Skip to content

Commit

Permalink
Debug v19
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 18, 2023
1 parent c61e9f4 commit 2f14087
Showing 1 changed file with 31 additions and 14 deletions.
45 changes: 31 additions & 14 deletions htdocs/expedition/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,10 @@
if (!$sortorder) {
$sortorder = "DESC";
}
if (empty($page) || $page == -1 || (empty($toselect) && $massaction === '0')) {
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
// If $page is not defined, or '' or -1 or if we click on clear filters
$page = 0;
} // If $page is not defined, or '' or -1
}
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
Expand All @@ -108,7 +109,7 @@
$hookmanager->initHooks(array('shipmentlist'));
$extrafields = new ExtraFields($db);

// fetch optionals attributes and labels
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);

$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
Expand Down Expand Up @@ -160,7 +161,8 @@
$error = 0;

if (GETPOST('cancel', 'alpha')) {
$action = 'list'; $massaction = '';
$action = 'list';
$massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
Expand Down Expand Up @@ -564,7 +566,7 @@

// Add $param from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
$param .= $hookmanager->resPrint;

$arrayofmassactions = array(
Expand Down Expand Up @@ -676,10 +678,11 @@
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";

// Fields title search
// --------------------------------------------------------------------
print '<tr class="liste_titre_filter">';
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="liste_titre middle">';
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre center maxwidthsearch">';
$searchpicto = $form->showFilterButtons('left');
print $searchpicto;
print '</td>';
Expand Down Expand Up @@ -805,16 +808,22 @@
print '</td>';
}
// Action column
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="liste_titre middle">';
$searchpicto = $form->showFilterAndCheckAddButtons(0);
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print '<td class="liste_titre center maxwidthsearch">';
$searchpicto = $form->showFilterButtons();
print $searchpicto;
print '</td>';
}
print "</tr>\n";
print '</tr>'."\n";

$totalarray = array();
$totalarray['nbfield'] = 0;

// Fields title label
// --------------------------------------------------------------------
print '<tr class="liste_titre">';
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
}
if (!empty($arrayfields['e.ref']['checked'])) {
Expand Down Expand Up @@ -877,18 +886,26 @@
if (!empty($arrayfields['e.billed']['checked'])) {
print_liste_field_titre($arrayfields['e.billed']['label'], $_SERVER["PHP_SELF"], "e.billed", "", $param, '', $sortfield, $sortorder, 'center ');
}
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
// Action column
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
}
print "</tr>\n";

$typenArray = $formcompany->typent_array(1);

// Loop on record
// --------------------------------------------------------------------
$i = 0;
$savnbfield = $totalarray['nbfield'];
$totalarray = array();
$totalarray['nbfield'] = 0;
while ($i < min($num, $limit)) {
$imaxinloop = ($limit ? min($num, $limit) : $num);
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
if (empty($obj)) {
break; // Should not happen
}

$shipment->id = $obj->rowid;
$shipment->ref = $obj->ref;
Expand Down

0 comments on commit 2f14087

Please sign in to comment.