mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-08 18:12:53 +01:00
NEW: redirect to expedition card if global search has unique result (#30108)
This commit is contained in:
@@ -517,8 +517,8 @@ if (empty($reshook)) {
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode(strval($limit));
|
||||
}
|
||||
if ($sall) {
|
||||
$param .= "&sall=".urlencode($sall);
|
||||
if ($search_all) {
|
||||
$param .= "&search_all=".urlencode($search_all);
|
||||
}
|
||||
if ($search_ref_exp) {
|
||||
$param .= "&search_ref_exp=".urlencode($search_ref_exp);
|
||||
@@ -642,7 +642,6 @@ $formcompany = new FormCompany($db);
|
||||
$shipment = new Expedition($db);
|
||||
|
||||
$helpurl = 'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
|
||||
llxHeader('', $langs->trans('ListOfSendings'), $helpurl);
|
||||
|
||||
$sql = 'SELECT';
|
||||
if ($search_all || $search_user > 0) {
|
||||
@@ -887,6 +886,16 @@ $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) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$id = $obj->rowid;
|
||||
header("Location: ".DOL_URL_ROOT.'/expedition/card.php?id='.$id);
|
||||
exit;
|
||||
}
|
||||
|
||||
llxHeader('', $langs->trans('ListOfSendings'), $helpurl);
|
||||
|
||||
$expedition = new Expedition($db);
|
||||
|
||||
if ($socid > 0) {
|
||||
|
||||
Reference in New Issue
Block a user