diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php index 695afb7562fd32bbbc6512aa6f20f4d6cb038999..8f90183f0f76f8ea13f965254e95f685b69381f4 100644 --- a/htdocs/compta/prelevement/bons.php +++ b/htdocs/compta/prelevement/bons.php @@ -37,33 +37,57 @@ $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'prelevement','','','bons'); -// Get supervariables +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); -$sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha'); -$sortfield = ((GETPOST('sortfield','alpha')=="")) ? "p.datec" : GETPOST('sortfield','alpha'); +if ($page == -1) { $page = 0; } +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortorder) $sortorder="DESC"; +if (! $sortfield) $sortfield="p.datec"; + +// Get supervariables $statut = GETPOST('statut','int'); -$search_line = GETPOST('search_ligne','int'); +$search_ref = GETPOST('search_ref','alpha'); -llxHeader('',$langs->trans("WithdrawalsReceipts")); -$bon=new BonPrelevement($db,""); +/* + * Actions + */ -if ($page == -1) { $page = 0 ; } -$offset = $conf->liste_limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers +{ + $search_ref=""; +} /* - * Mode List - * + * View */ + +llxHeader('',$langs->trans("WithdrawalsReceipts")); + +$bon=new BonPrelevement($db,""); + $sql = "SELECT p.rowid, p.ref, p.amount, p.statut"; $sql.= ", p.datec"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p"; $sql.= " WHERE p.entity = ".$conf->entity; -$sql.= " ORDER BY $sortfield $sortorder "; -$sql.= $db->plimit($conf->liste_limit+1, $offset); +if ($search_ref) $sql.=natural_search("p.ref", $search_ref); + +$sql.= $db->order($sortfield,$sortorder); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) +{ + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); +} + +$sql.= $db->plimit($limit + 1,$offset); $result = $db->query($sql); if ($result) @@ -73,9 +97,22 @@ if ($result) $urladd= "&statut=".$statut; - print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num); - - print '<table class="liste" width="100%">'; + // Lines of title fields + print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'; + if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; + print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; + print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">'; + print '<input type="hidden" name="action" value="list">'; + print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; + print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; + print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; + + print_barre_liste($langs->trans("WithdrawalsReceipts"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit); + + $moreforfilter=''; + + print '<div class="div-table-responsive">'; + print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n"; print '<tr class="liste_titre">'; print_liste_field_titre($langs->trans("WithdrawalsReceipts"),$_SERVER["PHP_SELF"],"p.ref",'','','class="liste_titre"'); @@ -84,17 +121,18 @@ if ($result) print "</tr>\n"; print '<tr class="liste_titre">'; - print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">'; - print '<td class="liste_titre"><input type="text" class="flat" name="search_ligne" value="'. $search_line.'" size="10"></td>'; + print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_ref" value="'. $db->escape($search_ref).'"></td>'; print '<td class="liste_titre"> </td>'; - print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>'; - print '</form>'; + print '<td class="liste_titre" align="right">'; + $searchpitco=$form->showFilterAndCheckAddButtons(0); + print $searchpitco; + print '</td>'; print '</tr>'; $var=True; - while ($i < min($num,$conf->liste_limit)) - { + while ($i < min($num,$limit)) + { $obj = $db->fetch_object($result); $var=!$var; @@ -113,6 +151,10 @@ if ($result) $i++; } print "</table>"; + print '</div>'; + + print '</form>'; + $db->free($result); } else diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 9e33bac4046335934fa54dccdeaf19a4d2e2c06e..7a7eeb7610a83e551378e3dc3d8e768a21e2d534 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -23,6 +23,7 @@ * \ingroup prelevement * \brief Page liste des prelevements */ + require('../../main.inc.php'); require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php'; @@ -38,10 +39,18 @@ $socid = GETPOST('socid','int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'prelevement','','','bons'); -// Get supervariables + +$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; +$sortfield = GETPOST('sortfield','alpha'); +$sortorder = GETPOST('sortorder','alpha'); $page = GETPOST('page','int'); -$sortorder = ((GETPOST('sortorder','alpha')=="")) ? "DESC" : GETPOST('sortorder','alpha'); -$sortfield = ((GETPOST('sortfield','alpha')=="")) ? "p.datec" : GETPOST('sortfield','alpha'); +if ($page == -1) { $page = 0; } +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (! $sortorder) $sortorder="DESC"; +if (! $sortfield) $sortfield="p.datec"; + $search_line = GETPOST('search_line','alpha'); $search_bon = GETPOST('search_bon','alpha'); $search_code = GETPOST('search_code','alpha'); @@ -51,9 +60,12 @@ $statut = GETPOST('statut','int'); $bon=new BonPrelevement($db,""); $ligne=new LignePrelevement($db,$user); -$offset = $conf->liste_limit * $page ; -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +/* + * Actions + */ + +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers { $search_line=""; $search_bon=""; @@ -62,10 +74,13 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $statut=""; } + /* * View */ +$form=new Form($db); + llxHeader('',$langs->trans("WithdrawalsLines")); $sql = "SELECT p.rowid, p.ref, p.statut, p.datec"; @@ -83,24 +98,22 @@ $sql.= " AND pf.fk_facture = f.rowid"; $sql.= " AND f.fk_soc = s.rowid"; $sql.= " AND f.entity = ".$conf->entity; if ($socid) $sql.= " AND s.rowid = ".$socid; -if ($search_line) -{ - $sql.= " AND pl.rowid = '".$db->escape($search_line)."'"; -} -if ($search_bon) -{ - $sql.= " AND p.ref LIKE '%".$db->escape($search_bon)."%'"; -} -if ($search_code) -{ - $sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'"; -} -if ($search_company) +if ($search_line) $sql.= " AND pl.rowid = '".$db->escape($search_line)."'"; +if ($search_bon) $sql.= natural_search("p.ref", $search_bon); +if ($search_code) $sql.= natural_search("s.code_client", $search_code); +if ($search_company) natural_search("s.nom", $search_company); + +$sql.= $db->order($sortfield,$sortorder); + +// Count total nb of records +$nbtotalofrecords = ''; +if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'"; + $result = $db->query($sql); + $nbtotalofrecords = $db->num_rows($result); } -$sql.=$db->order($sortfield,$sortorder); -$sql.=$db->plimit($conf->liste_limit+1, $offset); + +$sql.= $db->plimit($limit + 1,$offset); $result = $db->query($sql); if ($result) @@ -111,11 +124,15 @@ if ($result) $urladd = "&statut=".$statut; $urladd .= "&search_bon=".$search_bon; - print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num); + print_barre_liste($langs->trans("WithdrawalsLines"), $page, $_SERVER["PHP_SELF"], $urladd, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_generic', 0, '', '', $limit); print"\n<!-- debut table -->\n"; print '<form action="'.$_SERVER["PHP_SELF"].'" method="GET">'; - print '<table class="liste" width="100%">'; + + $moreforfilter=''; + + print '<div class="div-table-responsive">'; + print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n"; print '<tr class="liste_titre">'; print_liste_field_titre($langs->trans("Line"),$_SERVER["PHP_SELF"]); @@ -144,7 +161,7 @@ if ($result) $var=True; - while ($i < min($num,$conf->liste_limit)) + while ($i < min($num,$limit)) { $obj = $db->fetch_object($result); @@ -185,6 +202,7 @@ if ($result) $i++; } print "</table>"; + print '</div>'; print '</form>'; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 74b80ec0e82b5c090966486b5b377f9c8abfe94f..5b2c6b70a139ac2a2b7bbe76c92cbe184f05e18c 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -641,7 +641,9 @@ if (! empty($conf->don->enabled)) $totentrees=array(); $totsorties=array(); -print '<table class="noborder" width="100%">'; +print '<div class="div-table-responsive">'; +print '<table class="tagtable liste">'."\n"; + print '<tr class="liste_titre"><td class="liste_titre"> </td>'; for ($annee = $year_start ; $annee <= $year_end ; $annee++) @@ -735,7 +737,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++) print "</tr>\n"; print "</table>"; - +print '</div>'; llxFooter(); $db->close(); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 827fd5c5e4aeca152bddbc1dc2d352e4cfc04714..4ed3ecb7cefe9408fc84213208df335776492a93 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -967,7 +967,7 @@ if ($action == 'create') // Description (must be a textarea and not html must be allowed (used in list view) print '<tr><td class="tdtop">'.$langs->trans("Description").'</td>'; print '<td>'; - print '<textarea name="description" cols="80" rows="'.ROWS_3.'">'.GETPOST('description').'</textarea>'; + print '<textarea name="description" class="quatrevingtpercent" rows="'.ROWS_3.'">'.GETPOST('description').'</textarea>'; print '</td></tr>'; // Project diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 9d01643825af4042d6a287532389a4c8c6e3eb98..563c57f5ad799fe1d027265939522d00b74d6507 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -251,7 +251,8 @@ if ($result) $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage; $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields - print '<table class="liste '.($moreforfilter?"listwithfilterbefore":"").'">'; + print '<div class="div-table-responsive">'; + print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n"; print '<tr class="liste_titre">'; if (! empty($arrayfields['f.ref']['checked'])) print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"f.ref","",$param,'',$sortfield,$sortorder); if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER["PHP_SELF"],"s.nom","",$param,'',$sortfield,$sortorder); @@ -527,6 +528,8 @@ if ($result) } print '</table>'; + print '</div>'; + print "</form>\n"; $db->free($result); } diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index c4cd1b53d7148083807b524ff53889b5f59c8402..1afd69b73e0b2d6f7e85085ce000591902c1f5c6 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -81,7 +81,7 @@ LT2PaymentES=IRPF Payment LT2PaymentsES=IRPF Payments VATPayment=Sales tax payment VATPayments=Sales tax payments -VATRefund=Sales tax refund Refund +VATRefund=Sales tax refund Refund=Refund SocialContributionsPayments=Social/fiscal taxes payments ShowVatPayment=Show VAT payment