diff --git a/htdocs/adherents/class/api_members.class.php b/htdocs/adherents/class/api_members.class.php index 000ecc26f2b07..889f1212547cb 100644 --- a/htdocs/adherents/class/api_members.class.php +++ b/htdocs/adherents/class/api_members.class.php @@ -432,7 +432,12 @@ public function delete($id) private function _validate($data) { $member = array(); - foreach (Members::$FIELDS as $field) { + + $mandatoryfields = array( + 'morphy', + 'typeid' + ); + foreach ($mandatoryfields as $field) { if (!isset($data[$field])) { throw new RestException(400, "$field field missing"); } @@ -857,7 +862,10 @@ public function deleteType($id) private function _validateType($data) { $membertype = array(); - foreach (MembersTypes::$FIELDS as $field) { + + $mandatoryfields = array('label'); + + foreach ($mandatoryfields as $field) { if (!isset($data[$field])) { throw new RestException(400, "$field field missing"); } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 39c01663d93ad..868a16ed304a6 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -409,8 +409,6 @@ class Propal extends CommonObject */ public function __construct($db, $socid = 0, $propalid = 0) { - global $conf, $langs; - $this->db = $db; $this->socid = $socid; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 96e5814074239..8501ef2616500 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -101,7 +101,7 @@ $search_categ = GETPOSTINT("search_categ"); $search_categ_thirdparty = GETPOSTINT("search_categ_thirdparty"); $search_categ_supplier = GETPOSTINT("search_categ_supplier"); -$search_status = GETPOSTINT("search_status"); +$search_status = GETPOST("search_status", "intcomma"); $search_type = GETPOST('search_type', 'alpha'); $search_address = GETPOST('search_address', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 7c7fc412669c4..7caa6533194f8 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -998,7 +998,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); - $search_status = GETPOSTINT("search_status"); + $search_status = GETPOST("search_status", "intcomma"); if ($search_status == '') { $search_status = 1; // always display active customer first } diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 476a429d97278..d1bde9d79c58d 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -249,6 +249,7 @@ $search[$key.'_dtend'] = ''; } } + $search_all = ''; $toselect = array(); $search_array_options = array(); } diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 28af89a6246d0..9abf9bd532689 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; -$type = GETPOSTINT("type"); +$type = GETPOST("type", 'intcomma'); if ($type == '' && !$user->hasRight('produit', 'lire') && $user->hasRight('service', 'lire')) { $type = '1'; // Force global page on service page only } @@ -69,15 +69,15 @@ $transAreaType = $langs->trans("ProductsAndServicesArea"); $helpurl = ''; -if (!isset($_GET["type"])) { +if (!GETPOSTISSET("type")) { $transAreaType = $langs->trans("ProductsAndServicesArea"); $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; } -if ((isset($_GET["type"]) && $_GET["type"] == 0) || !isModEnabled("service")) { +if ((GETPOSTISSET("type") && GETPOST("type") == '0') || !isModEnabled("service")) { $transAreaType = $langs->trans("ProductsArea"); $helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos'; } -if ((isset($_GET["type"]) && $_GET["type"] == 1) || !isModEnabled("product")) { +if ((GETPOSTISSET("type") && GETPOST("type") == '1') || !isModEnabled("product")) { $transAreaType = $langs->trans("ServicesArea"); $helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios'; } @@ -310,10 +310,10 @@ if ($num > 0) { $transRecordedType = $langs->trans("LastModifiedProductsAndServices", $max); - if (isset($_GET["type"]) && $_GET["type"] == 0) { + if (GETPOSTISSET("type") && GETPOST("type") == '0') { $transRecordedType = $langs->trans("LastRecordedProducts", $max); } - if (isset($_GET["type"]) && $_GET["type"] == 1) { + if (GETPOSTISSET("type") && GETPOST("type") == '1') { $transRecordedType = $langs->trans("LastRecordedServices", $max); } diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index ca5bcb5fdedc9..787cc14f77987 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -52,7 +52,7 @@ $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', '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 = GETPOSTINT("search_status"); +$search_status = GETPOST("search_status", "intcomma"); $search_category_list = array(); if (isModEnabled('category')) { diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 19e620f7b8a3b..c0baeb41882a8 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -120,7 +120,7 @@ $search_type_thirdparty = GETPOSTINT("search_type_thirdparty"); $search_price_level = GETPOSTINT('search_price_level'); $search_staff = GETPOSTINT("search_staff"); -$search_status = GETPOSTINT("search_status"); +$search_status = GETPOST("search_status", 'intcomma'); $search_type = GETPOST('search_type', 'alpha'); $search_level = GETPOST("search_level", "array:alpha"); $search_stcomm = GETPOST('search_stcomm', "array:int"); @@ -446,6 +446,8 @@ $search_level = ''; $search_parent_name = ''; $search_import_key = ''; + + $search_all = ''; $toselect = array(); $search_array_options = array(); } @@ -472,8 +474,8 @@ } } -if ($search_status == '') { - $search_status = 1; // always display active thirdparty first +if ($search_status == '' && empty($search_all)) { + $search_status = 1; // display active thirdparty only by default }