From 885fc3c5b74a03e0762f22e913f54234c4196179 Mon Sep 17 00:00:00 2001 From: phf Date: Mon, 17 Jul 2017 11:04:48 +0200 Subject: [PATCH 1/3] Fix lost search value in list if come from thirdparty card --- htdocs/comm/propal/list.php | 1 + htdocs/commande/list.php | 1 + htdocs/compta/facture/list.php | 1 + htdocs/contrat/list.php | 7 +++++++ htdocs/fichinter/list.php | 9 ++++++++- htdocs/fourn/facture/list.php | 1 + 6 files changed, 19 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 93c93850652..0fd9ddb4c7c 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -353,6 +353,7 @@ if ($resql) $soc = new Societe($db); $soc->fetch($socid); $title = $langs->trans('ListOfProposals') . ' - '.$soc->name; + if (empty($search_societe)) $search_societe = $soc->name; } else { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index e62ae11d5cd..d91d1737281 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -578,6 +578,7 @@ if ($resql) $soc = new Societe($db); $soc->fetch($socid); $title = $langs->trans('ListOfOrders') . ' - '.$soc->name; + if (empty($search_company)) $search_company = $soc->name; } else { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 982f61f5067..5a05c7c43ac 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -423,6 +423,7 @@ if ($resql) { $soc = new Societe($db); $soc->fetch($socid); + if (empty($search_societe)) $search_societe = $soc->name; } $param='&socid='.$socid; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 8a22f7ee324..1f23c9aad0a 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -306,6 +306,13 @@ if ($resql) $arrayofselected=is_array($toselect)?$toselect:array(); + if ($socid) + { + $soc = new Societe($db); + $soc->fetch($socid); + if (empty($search_name)) $search_name = $soc->name; + } + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index bafafb40dd1..373cb9b99cf 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -211,7 +211,14 @@ $result=$db->query($sql); if ($result) { $num = $db->num_rows($result); - + + if ($socid) + { + $soc = new Societe($db); + $soc->fetch($socid); + if (empty($search_company)) $search_company = $soc->name; + } + $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 77064191d24..8022eb7ef17 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -394,6 +394,7 @@ if ($resql) { $soc = new Societe($db); $soc->fetch($socid); + if (empty($search_societe)) $search_societe = $soc->name; } $param='&socid='.$socid; From 7ac5054df8c9a1b00f0f48bf7533e164ce9eb55d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Jul 2017 14:47:44 +0200 Subject: [PATCH 2/3] Update list.php --- htdocs/fichinter/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 373cb9b99cf..1e508b4f7e8 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -212,7 +212,7 @@ if ($result) { $num = $db->num_rows($result); - if ($socid) + if ($socid > 0) { $soc = new Societe($db); $soc->fetch($socid); From f6060b976dc3a4f58c41034280d66b7be13b10c0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Jul 2017 14:48:18 +0200 Subject: [PATCH 3/3] Update list.php --- htdocs/contrat/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 1f23c9aad0a..6c28dbe631e 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -306,7 +306,7 @@ if ($resql) $arrayofselected=is_array($toselect)?$toselect:array(); - if ($socid) + if ($socid > 0) { $soc = new Societe($db); $soc->fetch($socid);