diff --git a/ChangeLog b/ChangeLog index ed7cf76603c..a31cf7fac53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,12 +21,13 @@ The following changes may create regressions for some external modules, but were * Prepare your module for deprecation of triggers code XXX_INSERT to support also XXX_CREATE. * More class properties (with old name in french) are now deprecated in favor of the property name in english. * The json emulator dol_json_encode/decode() is removed. The native json PHP module must be enabled/available (this is the case by default with most PHP installation). -* The experimental and deprecated module WebserviceClient is completely removed (SOAP technology is deprecated). May be replaced with the stable module Webhook. +* The deprecated GET parameter "&sall=" has been removed, use now the "&search_all=". +* The experimental and deprecated module WebserviceClient is completely removed (was never released and use deprecated architecture). May be replaced with the stable module Webhook. * The dynamic properties ->no_button_delete, ->no_button_edit, ->no_button_copy for $object Product that could be set by an external module must no more be set (not allowed by PHP 8.2). A module can already return an array with key 'no_button_delete', 'no_button_edit', 'no_button_copy' for same purpose. * The old function dol_bc($var, $moreclass = '') has been removed. If you called it, just stop to call it. -* The trigger code CATEGORY_LINK and CATEGORY_UNLINK has been replaced with code CATEGORY_MODIFY. You can read ->context['linkto'] or ->context['unlinkoff' to detect we want to make a link or unlink. -* The property ->domiciliation and ->propio on bank accounts has been deprecated and replaced with property ->address and ->owner_name +* The trigger code CATEGORY_LINK and CATEGORY_UNLINK has been replaced with code CATEGORY_MODIFY. You can read ->context['linkto'] or ->context['unlinkoff' to detect if we want to make a link or unlink. +* The property ->domiciliation and ->propio on bank accounts has been deprecated and replaced with property ->address and ->owner_name everywhere. * If you were using the substitution key __MEMBER_CIVILITY__, you must now use __MEMBER_TITLE__ diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 0e349810944..7bfcc4c2d79 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -110,7 +110,7 @@ if ($statut != '') { $search_status = $statut; // For backward compatibility } -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); if ($search_status < -2) { $search_status = ''; diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 9893e9c3946..d9b28022a1c 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -39,18 +39,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/interface_20_all_Logevents.class. * @var User $user */ -if (!$user->admin) { - accessforbidden(); -} - $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); - -// Security check -if ($user->socid > 0) { - $action = ''; - $socid = $user->socid; -} +$optioncss = GETPOST("optioncss", "aZ"); // Option for the css output (always '' except when 'print') // Load translation files required by the page $langs->loadLangs(array("companies", "admin", "users", "other","withdrawals")); @@ -80,7 +71,7 @@ $search_user = GETPOST("search_user", "alpha"); $search_desc = GETPOST("search_desc", "alpha"); $search_ua = GETPOST("search_ua", "restricthtml"); $search_prefix_session = GETPOST("search_prefix_session", "restricthtml"); -$optioncss = GETPOST("optioncss", "aZ"); // Option for the css output (always '' except when 'print') +$search_entity = ($user->entity > 0 ? $user->entity : GETPOSTINT('search_entity')); $now = dol_now(); $nowarray = dol_getdate($now); @@ -101,7 +92,6 @@ if ($date_start !== '' && $date_end !== '' && $date_start > $date_end) { $date_end = $date_start + 86400; } - if (!GETPOSTISSET('pageplusoneold') && !GETPOSTISSET('page') && $date_start === '') { // We define date_start and date_end $date_start = dol_get_first_day($nowarray['year'], $nowarray['mon'], 'tzuserrel'); } @@ -139,6 +129,19 @@ $arrayfields = array( ) ); +// Security check +/* +$socid = 0; +if ($user->socid > 0) { + $action = ''; + $socid = $user->socid; +} +*/ + +if (!$user->admin) { + accessforbidden(); +} + /* * Actions @@ -163,6 +166,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_desc = ''; $search_ua = ''; $search_prefix_session = ''; + $search_entity = ''; } // Purge audit events @@ -219,7 +223,7 @@ $sql .= " e.fk_user, e.description, e.prefix_session,"; $sql .= " u.login, u.admin, u.entity, u.firstname, u.lastname, u.statut as status"; $sql .= " FROM ".MAIN_DB_PREFIX."events as e"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid = e.fk_user"; -$sql .= " WHERE e.entity IN (".getEntity('event').")"; +$sql .= " WHERE e.entity IN (".($search_entity > 0 ? $search_entity : getEntity('event', (GETPOSTINT('search_current_entity') ? 0 : 1))).")"; if ($date_start !== '') { $sql .= " AND e.dateevent >= '".$db->idate($date_start)."'"; } @@ -286,6 +290,9 @@ if ($result) { if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } + if ($search_entity != '') { + $param .= '&search_entity='.((int) $search_entity); + } if ($search_rowid) { $param .= '&search_rowid='.urlencode((string) ($search_rowid)); } diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 1012ce10db5..5bb17d3d786 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -66,7 +66,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; // Search Fields -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_ref = GETPOST("search_ref", "alpha") ? GETPOST("search_ref", "alpha") : GETPOST("sref", "alpha"); $search_messtype = GETPOST("search_messtype", "alpha"); $filteremail = GETPOST('filteremail', 'alpha'); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 998e84506b9..6d2b714ed17 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -86,7 +86,7 @@ $optioncss = GETPOST('optioncss', 'alpha'); $mode = GETPOST('mode', 'alpha'); // Search Fields -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_user = GETPOSTINT('search_user'); if ($search_user == -1) { $search_user = 0; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 659c2781e97..90de41c3acd 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -98,7 +98,7 @@ $search_datedelivery_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datedeliver $socid = GETPOSTINT('socid'); -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_product_category = GETPOST('search_product_category', 'intcomma'); $search_id = GETPOST('search_id', 'int'); $search_ref = GETPOST('search_ref', 'alpha') != '' ? GETPOST('search_ref', 'alpha') : GETPOST('sref', 'alpha'); diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 9f81b7dfe70..b501d463135 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -117,7 +117,7 @@ $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST("search_state", 'alpha'); $search_country = GETPOST("search_country", 'aZ09'); $search_type_thirdparty = GETPOST("search_type_thirdparty", 'intcomma'); -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_user = GETPOST('search_user', 'intcomma'); $search_sale = GETPOST('search_sale', 'intcomma'); $search_total_ht = GETPOST('search_total_ht', 'alpha'); diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index b882025651d..46a5828f1d9 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -134,7 +134,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_type_id = ''; } -$search_all = GETPOSTISSET("search_all") ? trim(GETPOST("search_all", 'alpha')) : trim(GETPOST('sall')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); /* * TODO: fill array "$fields" in "/compta/bank/class/paymentvarious.class.php" and use diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index a9dbd994ebe..c9b3be80649 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -89,7 +89,7 @@ if (!$sortorder) { } // Initialize array of search criteria -$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index fd066ef2e1e..9e569f25967 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -77,7 +77,7 @@ if (isModEnabled('order')) { // Load translation files required by the page $langs->loadLangs(array('bills', 'companies', 'products', 'categories')); -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index dbea0022b80..fd5c5b20799 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -100,7 +100,7 @@ if (!$sortfield) { $sortfield = "p.ref"; } -$search_all = trim(GETPOSTISSET("search_all") ? GETPOST("search_all", 'alpha') : GETPOST('sall')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index c6b336ddd75..f6aedacb6bf 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -74,7 +74,7 @@ $id = GETPOSTINT('id'); $contactid = GETPOSTINT('id'); $ref = ''; // There is no ref for contacts -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_cti = preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('search_cti', 'alphanohtml'))); // Phone number without any special chars $search_phone = GETPOST("search_phone", 'alpha'); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 1158425d53e..a3adefa2526 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -77,7 +77,7 @@ $search_type_thirdparty = GETPOST("search_type_thirdparty", 'intcomma'); $search_contract = GETPOST('search_contract', 'alpha'); $search_ref_customer = GETPOST('search_ref_customer', 'alpha'); $search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); -$search_all = (GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml'); $search_status = GETPOST('search_status', 'alpha'); $search_signed_status = GETPOST('search_signed_status', 'alpha'); $search_user = GETPOST('search_user', 'intcomma'); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b312c7ac66e..01b783b6155 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -968,7 +968,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null if ($qualified && isset($user->default_values[$relativepathstring]['filters'][$defkey][$paramname])) { // We must keep $_POST and $_GET here - if (isset($_POST['sall']) || isset($_POST['search_all']) || isset($_GET['sall']) || isset($_GET['search_all'])) { + if (isset($_POST['search_all']) || isset($_GET['search_all'])) { // We made a search from quick search menu, do we still use default filter ? if (!getDolGlobalString('MAIN_DISABLE_DEFAULT_FILTER_FOR_QUICK_SEARCH')) { $forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ";", "="); // we accept _, -, . and , diff --git a/htdocs/don/list.php b/htdocs/don/list.php index 1a3e26fcd89..da96c68cb04 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -56,7 +56,7 @@ $mode = GETPOST('mode', 'alpha'); $type = GETPOST('type', 'aZ'); $search_status = (GETPOST("search_status", 'intcomma') != '') ? GETPOST("search_status", 'intcomma') : "-4"; -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_ref = GETPOST('search_ref', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); $search_thirdparty = GETPOST('search_thirdparty', 'alpha'); diff --git a/htdocs/don/paiement/list.php b/htdocs/don/paiement/list.php index 9d2ff770ae5..5fd82766651 100644 --- a/htdocs/don/paiement/list.php +++ b/htdocs/don/paiement/list.php @@ -85,7 +85,7 @@ if (!$sortfield) { $sortfield = "pd.rowid"; } -$search_all = trim(GETPOSTISSET("search_all") ? GETPOST("search_all", 'alpha') : GETPOST('sall')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index a4d0813292a..9924283caa6 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -102,7 +102,7 @@ if (!$sortorder) { } // Initialize array of search criteria -$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index a555032c122..6ca09ff8fb6 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -81,7 +81,7 @@ $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datedelivery $search_datedelivery_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datedelivery_endmonth'), GETPOSTINT('search_datedelivery_endday'), GETPOSTINT('search_datedelivery_endyear')); $search_datereceipt_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datereceipt_startmonth'), GETPOSTINT('search_datereceipt_startday'), GETPOSTINT('search_datereceipt_startyear')); $search_datereceipt_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datereceipt_endmonth'), GETPOSTINT('search_datereceipt_endday'), GETPOSTINT('search_datereceipt_endyear')); -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_user = GETPOST('search_user', 'intcomma'); $search_sale = GETPOST('search_sale', 'intcomma'); $search_categ_cus = GETPOST("search_categ_cus", 'intcomma'); diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index e1ff74c3398..bea0c167356 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -103,7 +103,7 @@ if (!$sortfield) { } -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_ref = GETPOST('search_ref', 'alpha'); $search_user = GETPOST('search_user', 'intcomma'); diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index dde2241d612..14196f33b9e 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -100,7 +100,7 @@ if (!$sortfield) { $sortfield = "pndf.datep"; } -$search_all = trim(GETPOSTISSET("search_all") ? GETPOST("search_all", 'alpha') : GETPOST('sall')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index e3d606b7169..b2debc9e3ca 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -78,7 +78,7 @@ $search_projet_ref = GETPOST('search_projet_ref', 'alpha'); $search_contrat_ref = GETPOST('search_contrat_ref', 'alpha'); $search_status = GETPOST('search_status', 'alpha'); $search_signed_status = GETPOST('search_signed_status', 'alpha'); -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_date_startday = GETPOSTINT('search_date_startday'); $search_date_startmonth = GETPOSTINT('search_date_startmonth'); $search_date_startyear = GETPOSTINT('search_date_startyear'); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 95ed76f15c4..78fb936bfa8 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -108,7 +108,7 @@ $search_date_approve_endyear = GETPOSTINT('search_date_approve_endyear'); $search_date_approve_start = dol_mktime(0, 0, 0, $search_date_approve_startmonth, $search_date_approve_startday, $search_date_approve_startyear); // Use tzserver $search_date_approve_end = dol_mktime(23, 59, 59, $search_date_approve_endmonth, $search_date_approve_endday, $search_date_approve_endyear); -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_product_category = GETPOSTINT('search_product_category'); $search_ref = GETPOST('search_ref', 'alpha'); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index e32e0d0057c..8fc931eb42f 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -71,7 +71,7 @@ $optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'supplierinvoicelist'; $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_label = GETPOST("search_label", "alpha"); $search_amount_no_tax = GETPOST("search_amount_no_tax", "alpha"); $search_amount_all_tax = GETPOST("search_amount_all_tax", "alpha"); diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 1677e827cf4..b07b9a45add 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -96,7 +96,7 @@ if (!$sortfield) { $sortfield = "p.datep"; } -$search_all = trim(GETPOSTISSET("search_all") ? GETPOST("search_all", 'alpha') : GETPOST('sall')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index 53a1a33e2bf..cfe0f519db9 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -93,7 +93,7 @@ if (!$sortfield) { $sortfield = "cp.ref"; } -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_ref = GETPOST('search_ref', 'alphanohtml'); $search_day_create = GETPOST('search_day_create', 'int'); $search_month_create = GETPOST('search_month_create', 'int'); diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index d7dcbb1010a..75af2891413 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -98,7 +98,7 @@ if (!$sortorder) { } // Initialize array of search criteria -$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index b23282cba21..b61195bde8b 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -97,7 +97,7 @@ if (!$sortorder) { } // Initialize array of search criteria -$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index 0a72689c723..bb05f0124bf 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -108,7 +108,7 @@ if (!$sortorder) { } // Initialize array of search criteria -$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); foreach ($objectposition->fields as $key => $val) { if (GETPOST('search_' . $key, 'alpha') !== '') { diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 8643c3397cc..fd562ed9858 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -98,7 +98,7 @@ if (!$sortorder) { } // Initialize array of search criteria -$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index b6aab469db4..6c4362511ea 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -591,7 +591,7 @@ if ($action != "create" && $action != "edit") { } // Initialize array of search criteria - $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); + $search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); foreach ($objectline->fields as $key => $val) { if (GETPOST('search_' . $key, 'alpha') !== '') { diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 8450895f3e1..89be7098c24 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -98,7 +98,7 @@ if (!$sortorder) { } // Initialize array of search criteria -$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 236b0f6a062..8bad85d7b15 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -51,7 +51,7 @@ $toselect = GETPOST('toselect', 'array:int'); // Array of ids of elements sele $optioncss = GETPOST('optioncss', 'alpha'); $mode = GETPOST('mode', 'aZ'); -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_ref = GETPOST("search_ref", 'alpha'); $search_type = GETPOST("search_type", 'int'); @@ -277,7 +277,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")"; + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; } else { $sql .= " WHERE 1 = 1"; } diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index ce957b10297..ea434e1187e 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -95,7 +95,7 @@ if (!$sortorder) { } // Initialize array of search criteria -$search_all = trim(GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { @@ -254,7 +254,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")"; + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; } else { $sql .= " WHERE 1 = 1"; } diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index 9ed773acc58..01d197f0737 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -58,7 +58,7 @@ $show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $id_rate_selected = GETPOSTINT('id_rate'); -$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$sall = trim(GETPOST('search_all', 'alphanohtml')); $search_date_sync = dol_mktime(0, 0, 0, GETPOSTINT('search_date_syncmonth'), GETPOSTINT('search_date_syncday'), GETPOSTINT('search_date_syncyear')); $search_date_sync_end = dol_mktime(0, 0, 0, GETPOSTINT('search_date_sync_endmonth'), GETPOSTINT('search_date_sync_endday'), GETPOSTINT('search_date_sync_endyear')); $search_rate = GETPOST('search_rate', 'alpha'); diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index 49c5df14190..2da002eb215 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -49,7 +49,7 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'opensurveylist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$sall = trim(GETPOST('search_all', 'alphanohtml')); $id = GETPOST('id', 'alpha'); $search_ref = GETPOST('search_ref', 'alpha'); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index cba76bfd5c5..28a9d723ad5 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -86,7 +86,7 @@ $mode = GETPOST('mode', 'alpha'); $fourn_id = GETPOSTINT("fourn_id"); // Search Criteria -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_id = GETPOST("search_id", 'alpha'); $search_ref = GETPOST("search_ref", 'alpha'); $search_ref_supplier = GETPOST("search_ref_supplier", 'alpha'); diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 482f39b9580..092b69e3be3 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -49,7 +49,7 @@ $langs->loadLangs(array('products', 'stocks')); $action = GETPOST('action', 'aZ09'); $sref = GETPOST("sref", 'alpha'); $snom = GETPOST("snom", 'alpha'); -$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$sall = trim(GETPOST('search_all', 'alphanohtml')); $type = GETPOSTISSET('type') ? GETPOSTINT('type') : Product::TYPE_PRODUCT; $search_barcode = GETPOST("search_barcode", 'alpha'); $search_toolowstock = GETPOST('search_toolowstock'); diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 81d3528427f..7093fedc7b4 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -58,7 +58,7 @@ $mode = GETPOST('mode', 'aZ'); $sref = GETPOST("sref", 'alpha'); $snom = GETPOST("snom", 'alpha'); -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $type = GETPOSTISSET('type') ? GETPOSTINT('type') : Product::TYPE_PRODUCT; $search_barcode = GETPOST("search_barcode", 'alpha'); $search_warehouse = GETPOST('search_warehouse', 'alpha'); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 08a75713a2f..fdaa3dbad02 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -57,7 +57,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_ref = GETPOST("sref", "alpha") ? GETPOST("sref", "alpha") : GETPOST("search_ref", "alpha"); $search_label = GETPOST("snom", "alpha") ? GETPOST("snom", "alpha") : GETPOST("search_label", "alpha"); $search_status = GETPOST("search_status", "intcomma"); diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 542a2bcdf6d..a8ecbeacf72 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -77,7 +77,7 @@ $idproduct = GETPOST('idproduct', 'intcomma'); $product_id = GETPOST("product_id", 'intcomma'); $show_files = GETPOSTINT('show_files'); -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_date_startday = GETPOSTINT('search_date_startday'); $search_date_startmonth = GETPOSTINT('search_date_startmonth'); $search_date_startyear = GETPOSTINT('search_date_startyear'); diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index d82bc13b10e..95784d927cc 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -94,7 +94,7 @@ if (!$sortorder) { } // Initialize array of search criteria -$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml'); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 4e0a9ccdd45..150984d4064 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -64,7 +64,7 @@ $result = restrictedArea($user, 'produit|service'); $action = GETPOST('action', 'aZ09'); $search_ref = GETPOST('search_ref', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); -$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$sall = trim(GETPOST('search_all', 'alphanohtml')); $type = GETPOSTINT('type'); $tobuy = GETPOSTINT('tobuy'); $salert = GETPOST('salert', 'alpha'); diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index 5e8181c6691..e1a543eeedd 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -42,7 +42,7 @@ $langs->load("stocks"); $sref = GETPOST("sref", 'alpha'); $snom = GETPOST("snom", 'alpha'); -$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$sall = trim(GETPOST('search_all', 'alphanohtml')); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index f8d1952aee2..f3326d6cbcf 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -104,7 +104,9 @@ $offset = $limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml'); +$search_entity = ($user->entity > 0 ? $user->entity : GETPOSTINT('search_entity')); + $search_ref = GETPOST("search_ref", 'alpha'); $search_label = GETPOST("search_label", 'alpha'); $search_societe = GETPOST("search_societe", 'alpha'); @@ -429,6 +431,7 @@ if (empty($reshook)) { $search_price_booth = ''; $search_login = ''; $search_import_key = ''; + $search_entity = ''; $toselect = array(); $search_array_options = array(); $search_category_array = array(); @@ -585,7 +588,7 @@ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user AS u ON p.fk_user_creat = u.rowid'; $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -$sql .= " WHERE p.entity IN (".getEntity('project', (GETPOSTINT('search_current_entity') ? 0 : 1)).')'; +$sql .= " WHERE p.entity IN (".($search_entity > 0 ? $search_entity : getEntity('project', (GETPOSTINT('search_current_entity') ? 0 : 1))).')'; if (!$user->hasRight('projet', 'all', 'lire')) { $sql .= " AND p.rowid IN (".$db->sanitize($projectsListId).")"; // public and assigned to, or restricted to company for external users } @@ -886,6 +889,12 @@ if ($limit > 0 && $limit != $conf->liste_limit) { if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); } +if ($search_all != '') { + $param .= '&search_all='.urlencode($search_all); +} +if ($search_entity != '') { + $param .= '&search_entity='.((int) $search_entity); +} if ($groupby != '') { $param .= '&groupby='.urlencode($groupby); } @@ -893,9 +902,6 @@ if ($groupby != '') { if ($socid) { $param .= '&socid='.urlencode((string) $socid); } -if ($search_all != '') { - $param .= '&search_all='.urlencode($search_all); -} if ($search_sday) { $param .= '&search_sday='.urlencode((string) ($search_sday)); } diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index fb01017d448..a358aec466e 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -57,7 +57,7 @@ $mode = GETPOST('mode', 'aZ'); $id = GETPOSTINT('id'); -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_categ = GETPOST("search_categ", 'intcomma'); $search_projectstatus = GETPOST('search_projectstatus', 'intcomma'); $search_project_ref = GETPOST('search_project_ref'); diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index d9489cf0321..b8801e6a26d 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -87,7 +87,7 @@ $search_date_create_start = dol_mktime(0, 0, 0, $search_date_create_startmonth, $search_date_create_end = dol_mktime(23, 59, 59, $search_date_create_endmonth, $search_date_create_endday, $search_date_create_endyear); $search_billed = GETPOST("search_billed", 'intcomma'); $search_status = GETPOST('search_status', 'intcomma'); -$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'); +$search_all = GETPOST('search_all', 'alphanohtml'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 00ee9149fa3..5dafaa0b4c6 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -78,7 +78,7 @@ if ($contextpage == 'poslist') { $mode = GETPOST("mode", 'alpha'); // search fields -$search_all = trim(GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_cti = preg_replace('/^0+/', '', preg_replace('/[^0-9]/', '', GETPOST('search_cti', 'alphanohtml'))); // Phone number without any special chars $search_id = GETPOST("search_id", 'int'); diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 5b85682a9fc..8046729f74c 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -108,7 +108,7 @@ $search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', $search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha'); $search_status = GETPOST('search_status', 'intcomma'); $search_product_category = GETPOST('search_product_category', 'int'); -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $object_statut = GETPOST('supplier_proposal_statut', 'intcomma'); $search_btn = GETPOST('button_search', 'alpha'); diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index d4f42db9f3b..553bebec441 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -122,7 +122,7 @@ if (!$sortorder) { }*/ // Initialize array of search criteria -$search_all = (GETPOSTISSET("search_all") ? GETPOST("search_all", 'alpha') : GETPOST('sall')); +$search_all = trim(GETPOST("search_all", 'alphanohtml')); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index e466cca651b..568d7b6d5d7 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -51,7 +51,7 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_group = GETPOST('search_group'); $search = array(); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 86eff542802..36d0a7df8d9 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -171,7 +171,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position'); '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan // Init search fields -$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search_user = GETPOST('search_user', 'alpha'); $search_rowid = GETPOST('search_rowid', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index 213bdb5ee0f..fbec288d582 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -275,7 +275,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")"; + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; } else { $sql .= " WHERE 1 = 1"; } diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index 243dee3a8d7..30e70a8ea09 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -260,7 +260,7 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")"; + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; } else { $sql .= " WHERE 1 = 1"; }