From 4bf70b0c2d59dcf6014d57e76290ed42c9ee113e Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Tue, 11 Mar 2025 12:41:54 +0200 Subject: [PATCH] FIX: #33365 Global search for single shipment (#33401) Co-authored-by: Laurent Destailleur --- htdocs/expedition/list.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index b45450396bc..c9e71665c7b 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -672,8 +672,6 @@ $shipment = new Expedition($db); $title = $langs->trans('Shipments'); $help_url = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones'; -llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-expedition page-list'); - $sql = 'SELECT'; if ($search_all || $search_user > 0) { $sql = 'SELECT DISTINCT'; @@ -924,10 +922,8 @@ if (!$resql) { $num = $db->num_rows($resql); -$arrayofselected = is_array($toselect) ? $toselect : array(); - // Redirect to expedition card if there is only one result for global search -if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all) { +if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all) { $obj = $db->fetch_object($resql); $id = $obj->rowid; header("Location: ".DOL_URL_ROOT.'/expedition/card.php?id='.$id); @@ -942,6 +938,13 @@ if ($socid > 0) { } } +// Output page +// -------------------------------------------------------------------- + +llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-expedition page-list'); + +$arrayofselected = is_array($toselect) ? $toselect : array(); + $param = ''; if ($socid > 0) { $param .= '&socid='.urlencode((string) ($socid));