From fc718e68ee47aa19a39ac1342b63bb1c83c5b3fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 10 May 2022 11:38:56 +0200 Subject: [PATCH] css --- htdocs/comm/propal/list.php | 13 ++++- htdocs/compta/bank/various_payment/list.php | 48 +++++++++++++------ htdocs/compta/facture/list.php | 19 ++++++-- htdocs/compta/sociales/list.php | 27 +++++++++-- htdocs/compta/tva/list.php | 36 ++++++++++---- htdocs/contact/consumption.php | 2 +- htdocs/contact/list.php | 24 +++++++--- .../modulebuilder/template/myobject_list.php | 2 +- htdocs/societe/list.php | 6 +-- 9 files changed, 133 insertions(+), 44 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index eb5b310edd1..c989cd34d39 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -2133,7 +2133,7 @@ if ($resql) { $totalarray['nbfield']++; } - print "\n"; + print ''."\n"; $i++; } @@ -2141,6 +2141,17 @@ if ($resql) { // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + // If no record found + if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''.$langs->trans("NoRecordFound").''; + } + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index bbec4f23fc6..92d38d95274 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -40,7 +40,6 @@ $socid = GETPOST("socid", "int"); if ($user->socid) { $socid = $user->socid; } -$result = restrictedArea($user, 'banque', '', '', ''); $optioncss = GETPOST('optioncss', 'alpha'); @@ -173,6 +172,11 @@ $arrayfields = array( $arrayfields = dol_sort_array($arrayfields, 'position'); +$object = new PaymentVarious($db); + +$result = restrictedArea($user, 'banque', '', '', ''); + + /* * Actions */ @@ -271,19 +275,19 @@ if ($search_all) { $sql .= $db->order($sortfield, $sortorder); $totalnboflines = 0; -$result = $db->query($sql); -if ($result) { - $totalnboflines = $db->num_rows($result); +$resql = $db->query($sql); +if ($resql) { + $totalnboflines = $db->num_rows($resql); } $sql .= $db->plimit($limit + 1, $offset); -$result = $db->query($sql); -if ($result) { - $num = $db->num_rows($result); +$resql = $db->query($sql); +if ($resql) { + $num = $db->num_rows($resql); // Direct jump if only one record found if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($resql); $id = $obj->rowid; header("Location: ".DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$id); exit; @@ -541,7 +545,7 @@ if ($result) { $totalarray = array(); while ($i < min($num, $limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($resql); $variousstatic->id = $obj->rowid; $variousstatic->ref = $obj->rowid; @@ -704,7 +708,7 @@ if ($result) { $totalarray['nbfield']++; } - print ""; + print ''."\n"; $i++; } @@ -712,11 +716,27 @@ if ($result) { // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; - print ""; - print ''; - print ''; + // If no record found + if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''.$langs->trans("NoRecordFound").''; + } - $db->free($result); + $db->free($resql); + + $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); + $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook + print $hookmanager->resPrint; + + print ''."\n"; + print ''."\n"; + + print ''."\n"; } else { dol_print_error($db); } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 2ef50801717..5937eda916c 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -2415,16 +2415,27 @@ if ($resql) { include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; } + // If no record found + if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''.$langs->trans("NoRecordFound").''; + } + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); - $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; - print "\n"; - print ''; + print ''."\n"; + print ''."\n"; - print "\n"; + print ''."\n"; // Show the file area only when this page is not opend from the Extended POS if ($contextpage != 'poslist') { diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 8d63e52256e..082a485f817 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -713,16 +713,35 @@ while ($i < min($num, $limit)) { $totalarray['nbfield']++; } - print ''; + print ''."\n"; + $i++; } // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; -print ''; -print ''; -print ''; +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''.$langs->trans("NoRecordFound").''; +} + +$db->free($resql); + +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print ''."\n"; +print ''."\n"; + +print ''."\n"; // End of page llxFooter(); diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index f1731420852..5f76b2e9190 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -190,8 +190,8 @@ $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); + $resql = $db->query($sql); + $nbtotalofrecords = $db->num_rows($resql); // if total resultset is smaller then paging size (filtering), goto and load page 0 if (($page * $limit) > $nbtotalofrecords) { @@ -202,15 +202,15 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { $sql .= $db->plimit($limit + 1, $offset); -$result = $db->query($sql); -if (!$result) { +$resql = $db->query($sql); +if (!$resql) { dol_print_error($db); llxFooter(); $db->close(); exit; } -$num = $db->num_rows($result); +$num = $db->num_rows($resql); $param = ''; if (!empty($contextpage) && $contextpage != $_SERVER['PHP_SELF']) { @@ -429,7 +429,7 @@ print ''; $i = 0; $totalarray = array(); while ($i < min($num, $limit)) { - $obj = $db->fetch_object($result); + $obj = $db->fetch_object($resql); $tva_static->id = $obj->rowid; $tva_static->ref = $obj->rowid; @@ -549,11 +549,27 @@ $totalarray['nbfield']++; // Show total line include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; -print ''; -print ''; -print ''; +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''.$langs->trans("NoRecordFound").''; +} -$db->free($result); +$db->free($resql); + +$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; + +print ''."\n"; +print ''."\n"; + +print ''."\n"; // End of page llxFooter(); diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 631bf932640..02813cee469 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -355,7 +355,7 @@ if (empty($elementTypeArray) && !$object->thirdparty->client && !$object->thirdp // Define type of elements $typeElementString = $form->selectarray("type_element", $elementTypeArray, GETPOST('type_element'), $showempty, 0, 0, '', 0, 0, $disabled, '', 'maxwidth150onsmartphone'); -$button = ''; +$button = ''; $param = ''; $param .= "&sref=".urlencode($sref); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 31b2153c2c8..93d61f8a903 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1309,19 +1309,31 @@ while ($i < min($num, $limit)) { $i++; } +// Show total line +include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php'; + +// If no record found +if ($num == 0) { + $colspan = 1; + foreach ($arrayfields as $key => $val) { + if (!empty($val['checked'])) { + $colspan++; + } + } + print ''.$langs->trans("NoRecordFound").''; +} + $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; -print ""; -print ""; - -//if ($num > $limit || $page) print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_companies.png', 0, '', '', $limit, 1); - -print ''; +print ''."\n"; +print ''."\n"; +print ''."\n"; +// End of page llxFooter(); $db->close(); diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 8771ad0f9b6..9638eb4ce7f 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -811,7 +811,7 @@ if ($num == 0) { $db->free($resql); $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); -$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; print ''."\n"; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 746b4dc0db0..e7b9e5097ea 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -863,9 +863,6 @@ $arrayofmassactions = array( // 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), ); //if($user->rights->societe->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer"); -if ($user->rights->societe->supprimer) { - $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); -} if ($user->rights->societe->creer) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } @@ -881,6 +878,9 @@ if ($user->rights->societe->creer) { if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag', 'preenable', 'preclose'))) { $arrayofmassactions = array(); } +if ($user->rights->societe->supprimer) { + $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); +} $massactionbutton = $form->selectMassAction('', $arrayofmassactions); $typefilter = '';