From 5a0ae16c18839dddb905e0ca99d184503fba6aed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 09:28:14 +0100 Subject: [PATCH 01/84] PERF: Performance enhancement on Invoice/Paiement area page --- htdocs/compta/index.php | 60 ++++++++----------- .../install/mysql/migration/19.0.0-20.0.0.sql | 3 + .../install/mysql/tables/llx_facture.key.sql | 1 + .../mysql/tables/llx_facture_fourn.key.sql | 1 + 4 files changed, 30 insertions(+), 35 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 3d8d6c10e1d..e5e49696f0f 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -137,28 +137,23 @@ if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { $sql .= ", s.rowid as socid"; $sql .= ", s.code_client, s.code_compta, s.email"; $sql .= ", cc.rowid as country_id, cc.code as country_code"; - $sql .= ", sum(pf.amount) as am"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays, ".MAIN_DB_PREFIX."facture as f"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture"; - if (!$user->hasRight('societe', 'client', 'voir')) { - $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - } - $sql .= " WHERE s.rowid = f.fk_soc"; - $sql .= " AND f.entity IN (".getEntity('invoice').")"; - if (!$user->hasRight('societe', 'client', 'voir')) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); - } - if ($socid) { + $sql .= ", (SELECT SUM(pf.amount) FROM llx_paiement_facture as pf WHERE pf.fk_facture = f.rowid) as am"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; + $sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays"; + $sql .= " WHERE f.entity IN (".getEntity('invoice').")"; + if ($socid > 0) { $sql .= " AND f.fk_soc = ".((int) $socid); } + // Filter on sale representative + if (!$user->hasRight('societe', 'client', 'voir')) { + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = f.fk_soc AND sc.fk_user = ".((int) $user->id).")"; + } // Add where from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhereCustomerLastModified', $parameters); $sql .= $hookmanager->resPrint; - $sql .= " GROUP BY f.rowid, f.ref, f.fk_statut, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms, f.date_lim_reglement,"; - $sql .= " s.nom, s.rowid, s.code_client, s.code_compta, s.email,"; - $sql .= " cc.rowid, cc.code"; $sql .= " ORDER BY f.tms DESC"; $sql .= $db->plimit($max, 0); @@ -197,6 +192,7 @@ if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { $tmpinvoice->total_tva = $obj->total_tva; $tmpinvoice->total_ttc = $obj->total_ttc; $tmpinvoice->statut = $obj->status; + $tmpinvoice->status = $obj->status; $tmpinvoice->paye = $obj->paye; $tmpinvoice->date_lim_reglement = $db->jdate($obj->datelimite); $tmpinvoice->type = $obj->type; @@ -210,7 +206,7 @@ if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { $thirdpartystatic->client = 1; $thirdpartystatic->code_client = $obj->code_client; //$thirdpartystatic->code_fournisseur = $obj->code_fournisseur; - $thirdpartystatic->code_compta = $obj->code_compta; + $thirdpartystatic->code_compta_client = $obj->code_compta; //$thirdpartystatic->code_compta_fournisseur = $obj->code_compta_fournisseur; print ''; @@ -287,28 +283,23 @@ if ((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMO $sql .= ", s.nom as name"; $sql .= ", s.rowid as socid"; $sql .= ", s.code_fournisseur, s.code_compta_fournisseur, s.email"; - $sql .= ", SUM(pf.amount) as am"; + $sql .= ", (SELECT SUM(pf.amount) FROM llx_paiementfourn_facturefourn as pf WHERE pf.fk_facturefourn = ff.rowid) as am"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn"; - if (!$user->hasRight('societe', 'client', 'voir')) { - $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - } $sql .= " WHERE s.rowid = ff.fk_soc"; $sql .= " AND ff.entity IN (".getEntity('facture_fourn').")"; - if (!$user->hasRight('societe', 'client', 'voir')) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); - } - if ($socid) { + if ($socid > 0) { $sql .= " AND ff.fk_soc = ".((int) $socid); } + // Filter on sale representative + if (!$user->hasRight('societe', 'client', 'voir')) { + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = ff.fk_soc AND sc.fk_user = ".((int) $user->id).")"; + } // Add where from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhereSupplierLastModified', $parameters); $sql .= $hookmanager->resPrint; - $sql .= " GROUP BY ff.rowid, ff.ref, ff.fk_statut, ff.type, ff.libelle, ff.total_ht, ff.tva, ff.total_tva, ff.total_ttc, ff.tms, ff.paye, ff.ref_supplier,"; - $sql .= " s.nom, s.rowid, s.code_fournisseur, s.code_compta_fournisseur, s.email"; - $sql .= " ORDER BY ff.tms DESC "; + $sql .= " ORDER BY ff.tms DESC"; $sql .= $db->plimit($max, 0); $resql = $db->query($sql); @@ -600,22 +591,21 @@ if (isModEnabled('facture') && isModEnabled('commande') && $user->hasRight("comm $sql .= ", c.rowid, c.ref, c.facture, c.fk_statut as status, c.total_ht, c.total_tva, c.total_ttc,"; $sql .= " cc.rowid as country_id, cc.code as country_code"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s LEFT JOIN ".MAIN_DB_PREFIX."c_country as cc ON cc.rowid = s.fk_pays"; - if (!$user->hasRight('societe', 'client', 'voir')) { - $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - } $sql .= ", ".MAIN_DB_PREFIX."commande as c"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_source = c.rowid AND el.sourcetype = 'commande'"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture AS f ON el.fk_target = f.rowid AND el.targettype = 'facture'"; $sql .= " WHERE c.fk_soc = s.rowid"; $sql .= " AND c.entity IN (".getEntity('commande').")"; - if (!$user->hasRight('societe', 'client', 'voir')) { - $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id); - } if ($socid) { $sql .= " AND c.fk_soc = ".((int) $socid); } - $sql .= " AND c.fk_statut = ".Commande::STATUS_CLOSED; + $sql .= " AND c.fk_statut = ".((int) Commande::STATUS_CLOSED); $sql .= " AND c.facture = 0"; + // Filter on sale representative + if (!$user->hasRight('societe', 'client', 'voir')) { + $sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc AND sc.fk_user = ".((int) $user->id).")"; + } + // Add where from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhereCustomerOrderToBill', $parameters); diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql index f45c3ed8d2f..0728a44f540 100644 --- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql +++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql @@ -261,3 +261,6 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, ALTER TABLE llx_societe ADD COLUMN phone_mobile varchar(20) after phone; + +ALTER TABLE llx_facture ADD INDEX idx_facture_tms (tms); +ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_tms (tms); diff --git a/htdocs/install/mysql/tables/llx_facture.key.sql b/htdocs/install/mysql/tables/llx_facture.key.sql index ee25f8c09d8..702392a459d 100644 --- a/htdocs/install/mysql/tables/llx_facture.key.sql +++ b/htdocs/install/mysql/tables/llx_facture.key.sql @@ -30,6 +30,7 @@ ALTER TABLE llx_facture ADD INDEX idx_facture_fk_account (fk_account); ALTER TABLE llx_facture ADD INDEX idx_facture_fk_currency (fk_currency); ALTER TABLE llx_facture ADD INDEX idx_facture_fk_statut (fk_statut); ALTER TABLE llx_facture ADD INDEX idx_facture_datef (datef); +ALTER TABLE llx_facture ADD INDEX idx_facture_tms (tms); ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); diff --git a/htdocs/install/mysql/tables/llx_facture_fourn.key.sql b/htdocs/install/mysql/tables/llx_facture_fourn.key.sql index 18036c19d92..0331f9e4ae2 100644 --- a/htdocs/install/mysql/tables/llx_facture_fourn.key.sql +++ b/htdocs/install/mysql/tables/llx_facture_fourn.key.sql @@ -26,6 +26,7 @@ ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_fk_soc (fk_soc); ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_fk_user_author (fk_user_author); ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_fk_user_valid (fk_user_valid); ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_fk_projet (fk_projet); +ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_tms (tms); ALTER TABLE llx_facture_fourn ADD CONSTRAINT fk_facture_fourn_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); ALTER TABLE llx_facture_fourn ADD CONSTRAINT fk_facture_fourn_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); From 34ad7e86708c5f7195eed54b63cb8761b1b6ef61 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 09:30:20 +0100 Subject: [PATCH 02/84] Fix doxygen --- htdocs/emailcollector/lib/emailcollector.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/lib/emailcollector.lib.php b/htdocs/emailcollector/lib/emailcollector.lib.php index 63a37a540cf..e1244b06eda 100644 --- a/htdocs/emailcollector/lib/emailcollector.lib.php +++ b/htdocs/emailcollector/lib/emailcollector.lib.php @@ -90,7 +90,7 @@ function emailcollectorPrepareHead($object) * Get parts of a message * * @param object $structure Structure of message - * @return array[false Array of parts of the message|false if error + * @return array|false Array of parts of the message|false if error */ function getParts($structure) { From b08e17e76d4dbebf2845e41ba2f7d7ddb896401e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 09:36:14 +0100 Subject: [PATCH 03/84] QUAL Rename all input fields "tel" into "phone" --- htdocs/admin/accountant.php | 4 ++-- htdocs/admin/company.php | 2 +- htdocs/societe/canvas/individual/tpl/card_create.tpl.php | 2 +- htdocs/societe/canvas/individual/tpl/card_edit.tpl.php | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 66a1aa7a3b1..4190c55a8e1 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -61,7 +61,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id", 'int'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOST('country_id', 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("tel", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("phone", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_WEB", GETPOST("web", 'alphanohtml'), 'chaine', 0, '', $conf->entity); @@ -153,7 +153,7 @@ print ''."\n"; // Telephone print ''; print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // Fax diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 87639008243..d6981147691 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -481,7 +481,7 @@ print ''."\n"; // Phone print ''; print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth'); -print ''; +print ''; print ''."\n"; // Fax diff --git a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php index e46721b167c..d929b7c8df9 100644 --- a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php @@ -144,7 +144,7 @@ if (isModEnabled('barcode')) { ?> trans('Phone'); ?> - + trans('Fax'); ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index 9c53ad5b3d8..d8b78283b95 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -148,7 +148,7 @@ if ($this->control->tpl['fournisseur']) { trans('Phone'); ?> - + trans('Fax'); ?> From c9f718f1c1b6fbfff225cce7335ed2252c8e1c3b Mon Sep 17 00:00:00 2001 From: Jon Bendtsen Date: Sun, 25 Feb 2024 09:43:11 +0100 Subject: [PATCH 04/84] Attempt at fixing #28070 with mobile phone to a thirdparty (#28110) * NEW #28070 Adding mobile phone to thirdparty * fix indenting * trying to fix build errors * too many parentases and missing; * Update actions_card_common.class.php --------- Co-authored-by: Jon Bendtsen Co-authored-by: Laurent Destailleur --- .../canvas/actions_card_common.class.php | 4 ++- .../canvas/company/tpl/card_create.tpl.php | 2 ++ .../canvas/company/tpl/card_edit.tpl.php | 2 ++ .../canvas/company/tpl/card_view.tpl.php | 2 ++ .../canvas/individual/tpl/card_create.tpl.php | 2 ++ .../canvas/individual/tpl/card_edit.tpl.php | 2 ++ .../canvas/individual/tpl/card_view.tpl.php | 2 ++ htdocs/societe/card.php | 10 +++++++ htdocs/societe/class/societe.class.php | 23 +++++++++++++-- htdocs/societe/list.php | 28 ++++++++++++++++++- 10 files changed, 72 insertions(+), 5 deletions(-) diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 8949242dfc3..a98680cfeb9 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -298,6 +298,7 @@ abstract class ActionsCardCommon $this->tpl['country'] = ($img ? $img.' ' : '').$this->object->country; $this->tpl['phone'] = dol_print_phone($this->object->phone, $this->object->country_code, 0, $this->object->id, 'AC_TEL'); + $this->tpl['phone_mobile'] = dol_print_phone($this->object->phone_mobile, $this->object->country_code, 0, $this->object->id, 'AC_MOB'); $this->tpl['fax'] = dol_print_phone($this->object->fax, $this->object->country_code, 0, $this->object->id, 'AC_FAX'); $this->tpl['email'] = dol_print_email($this->object->email, 0, $this->object->id, 1); $this->tpl['url'] = dol_print_url($this->object->url); @@ -401,7 +402,8 @@ abstract class ActionsCardCommon $this->object->town = GETPOST("town"); $this->object->country_id = GETPOST("country_id") ? GETPOST("country_id") : $mysoc->country_id; $this->object->state_id = GETPOST("state_id"); - $this->object->phone = GETPOST("tel"); + $this->object->phone = GETPOST("phone"); + $this->object->phone_mobile = GETPOST("phone_mobile"); $this->object->fax = GETPOST("fax"); $this->object->email = GETPOST("email", 'alphawithlgt'); $this->object->url = GETPOST("url"); diff --git a/htdocs/societe/canvas/company/tpl/card_create.tpl.php b/htdocs/societe/canvas/company/tpl/card_create.tpl.php index b18f0b31ec2..396edff865b 100644 --- a/htdocs/societe/canvas/company/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_create.tpl.php @@ -137,6 +137,8 @@ if (isModEnabled('barcode')) { ?> trans('Phone'); ?> + trans('PhoneMobile'); ?> + trans('Fax'); ?> diff --git a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php index 651a9cc180d..74851c874ea 100644 --- a/htdocs/societe/canvas/company/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_edit.tpl.php @@ -152,6 +152,8 @@ if (isModEnabled('barcode')) { ?> trans('Phone'); ?> + trans('PhoneMobile'); ?> + trans('Fax'); ?> diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index e4fa05d1b0e..f649f607280 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -111,6 +111,8 @@ print dol_get_fiche_head($head, 'card', $langs->trans("ThirdParty"), 0, 'company trans('Phone'); ?> control->tpl['phone']; ?> + trans('PhoneMobile'); ?> + control->tpl['phone_mobile']; ?> trans('Fax'); ?> control->tpl['fax']; ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php index d929b7c8df9..d255656bd72 100644 --- a/htdocs/societe/canvas/individual/tpl/card_create.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_create.tpl.php @@ -145,6 +145,8 @@ if (isModEnabled('barcode')) { ?> trans('Phone'); ?> + trans('PhoneMobile'); ?> + trans('Fax'); ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php index d8b78283b95..46f2bb63afa 100644 --- a/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_edit.tpl.php @@ -149,6 +149,8 @@ if ($this->control->tpl['fournisseur']) { trans('Phone'); ?> + trans('PhoneMobile'); ?> + trans('Fax'); ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index b23df41c5b9..3d5d98197f2 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -106,6 +106,8 @@ if ($this->control->tpl['action_delete']) { trans('Phone'); ?> control->tpl['phone']; ?> + trans('PhoneMobile'); ?> + control->tpl['phone_mobile']; ?> trans('Fax'); ?> control->tpl['fax']; ?> diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 02d42b389ad..f349ca32078 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -340,6 +340,7 @@ if (empty($reshook)) { } $object->phone = GETPOST('phone', 'alpha'); + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); $object->fax = GETPOST('fax', 'alpha'); $object->email = trim(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)); $object->no_email = GETPOST("no_email", "int"); @@ -992,6 +993,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } $object->phone = GETPOST('phone', 'alpha'); + $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); @@ -1475,6 +1477,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio // Phone / Fax print ''.$form->editfieldkey('Phone', 'phone', '', $object, 0).''; print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' '; + + print ''.$form->editfieldkey('PhoneMobile', 'phone_mobile', '', $object, 0).''; + print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'.img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"').' '; + if ($conf->browser->layout == 'phone') { print ''; } @@ -1865,6 +1871,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } $object->phone = GETPOST('phone', 'alpha'); + $object->phone_mobile = (string) GETPOST('phone_mobile', 'alpha'); $object->fax = GETPOST('fax', 'alpha'); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->no_email = GETPOST("no_email", "int"); @@ -2211,6 +2218,9 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio if ($conf->browser->layout == 'phone') { print ''; } + print ''.$form->editfieldkey('PhoneMobile', 'phone_mobile', GETPOST('phone_mobile', 'alpha'), $object, 0).''; + print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'.img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"').' '; + print ''.$form->editfieldkey('Fax', 'fax', GETPOST('fax', 'alpha'), $object, 0).''; print 'browser->layout == 'phone' ? ' colspan="3"' : '').'>'.img_picto('', 'object_phoning_fax', 'class="pictofixedwidth"').' '; print ''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index df727b4f8ce..8390295fed6 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -208,6 +208,7 @@ class Societe extends CommonObject 'fk_departement' =>array('type'=>'integer', 'label'=>'State', 'enabled'=>1, 'visible'=>-1, 'position'=>90), 'fk_pays' =>array('type'=>'integer:Ccountry:core/class/ccountry.class.php', 'label'=>'Country', 'enabled'=>1, 'visible'=>-1, 'position'=>95), 'phone' =>array('type'=>'varchar(20)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>-1, 'position'=>100), + 'phone_mobile' =>array('type'=>'varchar(20)', 'label'=>'PhoneMobile', 'enabled'=>1, 'visible'=>-1, 'position'=>102), 'fax' =>array('type'=>'varchar(20)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>-1, 'position'=>105), 'url' =>array('type'=>'varchar(255)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>110), 'email' =>array('type'=>'varchar(128)', 'label'=>'Email', 'enabled'=>1, 'visible'=>-1, 'position'=>115), @@ -351,6 +352,11 @@ class Societe extends CommonObject * @var string */ public $phone; + /** + * PhoneMobile number + * @var string + */ + public $phone_mobile; /** * Fax number * @var string @@ -1371,6 +1377,9 @@ class Societe extends CommonObject $this->phone = trim((string) $this->phone); $this->phone = preg_replace("/\s/", "", $this->phone); $this->phone = preg_replace("/\./", "", $this->phone); + $this->phone_mobile = trim((string) $this->phone_mobile); + $this->phone_mobile = preg_replace("/\s/", "", $this->phone_mobile); + $this->phone_mobile = preg_replace("/\./", "", $this->phone_mobile); $this->fax = trim((string) $this->fax); $this->fax = preg_replace("/\s/", "", $this->fax); $this->fax = preg_replace("/\./", "", $this->fax); @@ -1521,6 +1530,7 @@ class Societe extends CommonObject $sql .= ",fk_pays = ".((!empty($this->country_id) && $this->country_id > 0) ? ((int) $this->country_id) : 'null'); $sql .= ",phone = ".(!empty($this->phone) ? "'".$this->db->escape($this->phone)."'" : "null"); + $sql .= ",phone_mobile = ".(!empty($this->phone_mobile) ? "'".$this->db->escape($this->phone_mobile)."'" : "null"); $sql .= ",fax = ".(!empty($this->fax) ? "'".$this->db->escape($this->fax)."'" : "null"); $sql .= ",email = ".(!empty($this->email) ? "'".$this->db->escape($this->email)."'" : "null"); $sql .= ",socialnetworks = '".$this->db->escape(json_encode($this->socialnetworks))."'"; @@ -1801,7 +1811,7 @@ class Societe extends CommonObject $sql .= ', s.status, s.fk_warehouse'; $sql .= ', s.price_level'; $sql .= ', s.tms as date_modification, s.fk_user_creat, s.fk_user_modif'; - $sql .= ', s.phone, s.fax, s.email'; + $sql .= ', s.phone, s.phone_mobile, s.fax, s.email'; $sql .= ', s.socialnetworks'; $sql .= ', s.url, s.zip, s.town, s.note_private, s.note_public, s.client, s.fournisseur'; $sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4, s.idprof5, s.idprof6'; @@ -1945,6 +1955,7 @@ class Societe extends CommonObject $this->url = $obj->url; $this->phone = $obj->phone; + $this->phone_mobile = $obj->phone_mobile; $this->fax = $obj->fax; $this->parent = $obj->parent; @@ -2769,11 +2780,15 @@ class Societe extends CommonObject if (!empty($this->url)) { $datas['url'] = '
'.img_picto('', 'globe', 'class="pictofixedwidth"').$this->url; } - if (!empty($this->phone) || !empty($this->fax)) { + if (!empty($this->phone) || !empty($this->phone_mobile) || !empty($this->fax)) { $phonelist = array(); if ($this->phone) { $phonelist[] = dol_print_phone($this->phone, $this->country_code, $this->id, 0, '', ' ', 'phone'); } + // deliberately not making new list because fax uses same list as phone + if ($this->phone_mobile) { + $phonelist[] = dol_print_phone($this->phone_mobile, $this->country_code, $this->id, 0, '', ' ', 'phone_mobile'); + } if ($this->fax) { $phonelist[] = dol_print_phone($this->fax, $this->country_code, $this->id, 0, '', ' ', 'fax'); } @@ -4383,6 +4398,7 @@ class Societe extends CommonObject } $this->phone = getDolGlobalString('MAIN_INFO_SOCIETE_TEL'); + $this->phone_mobile = getDolGlobalString('MAIN_INFO_SOCIETE_MOBILE'); $this->fax = getDolGlobalString('MAIN_INFO_SOCIETE_FAX'); $this->url = getDolGlobalString('MAIN_INFO_SOCIETE_WEB'); @@ -4477,6 +4493,7 @@ class Societe extends CommonObject $this->url = 'http://www.specimen.com'; $this->phone = '0909090901'; + $this->phone_mobile = '0909090901'; $this->fax = '0909090909'; $this->code_client = 'CC-'.dol_print_date($now, 'dayhourlog'); @@ -5321,7 +5338,7 @@ class Societe extends CommonObject $this->client = $this->client | $soc_origin->client; $this->fournisseur = $this->fournisseur | $soc_origin->fournisseur; $listofproperties = array( - 'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'fax', 'email', 'socialnetworks', 'url', 'barcode', + 'address', 'zip', 'town', 'state_id', 'country_id', 'phone', 'phone_mobile', 'fax', 'email', 'socialnetworks', 'url', 'barcode', 'idprof1', 'idprof2', 'idprof3', 'idprof4', 'idprof5', 'idprof6', 'tva_intra', 'effectif_id', 'forme_juridique', 'remise_percent', 'remise_supplier_percent', 'mode_reglement_supplier_id', 'cond_reglement_supplier_id', 'name_bis', 'stcomm_id', 'outstanding_limit', 'order_min_amount', 'supplier_order_min_amount', 'price_level', 'parent', 'default_lang', 'ref', 'ref_ext', 'import_key', 'fk_incoterms', 'fk_multicurrency', diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index c2f994d2fd8..b7103477be3 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -86,6 +86,7 @@ $search_state = trim(GETPOST("search_state", 'alpha')); $search_region = trim(GETPOST("search_region", 'alpha')); $search_email = trim(GETPOST('search_email', 'alpha')); $search_phone = trim(GETPOST('search_phone', 'alpha')); +$search_phone_mobile = trim(GETPOST('search_phone_mobile', 'alpha')); $search_fax = trim(GETPOST('search_fax', 'alpha')); $search_url = trim(GETPOST('search_url', 'alpha')); $search_idprof1 = trim(GETPOST('search_idprof1', 'alpha')); @@ -229,6 +230,7 @@ $fieldstosearchall = array( 's.siret'=>"ProfId2", 's.ape'=>"ProfId3", 's.phone'=>"Phone", + 's.phone_mobile'=>"PhoneMobile", 's.fax'=>"Fax", ); if (($tmp = $langs->transnoentities("ProfId4".$mysoc->country_code)) && $tmp != "ProfId4".$mysoc->country_code && $tmp != '-') { @@ -287,6 +289,7 @@ $arrayfields = array( 's.fax'=>array('label'=>"Fax", 'position'=>28, 'checked'=>0), 'typent.code'=>array('label'=>"ThirdPartyType", 'position'=>29, 'checked'=>$checkedtypetiers), 'staff.code'=>array('label'=>"Workforce", 'position'=>31, 'checked'=>0), + 's.phone_mobile'=>array('label'=>"PhoneMobile", 'position'=>32, 'checked'=>0), 's.siren'=>array('label'=>"ProfId1Short", 'position'=>40, 'checked'=>$checkedprofid1), 's.siret'=>array('label'=>"ProfId2Short", 'position'=>41, 'checked'=>$checkedprofid2), 's.ape'=>array('label'=>"ProfId3Short", 'position'=>42, 'checked'=>$checkedprofid3), @@ -408,6 +411,7 @@ if (empty($reshook)) { $search_country = ''; $search_email = ''; $search_phone = ''; + $search_phone_mobile = ''; $search_fax = ''; $search_url = ''; $search_idprof1 = ''; @@ -536,7 +540,7 @@ if ($resql) { $sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.address, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, s.logo,"; $sql .= " s.entity,"; $sql .= " st.libelle as stcomm, st.picto as stcomm_picto, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,"; -$sql .= " s.email, s.phone, s.fax, s.url, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4 as idprof4, s.idprof5 as idprof5, s.idprof6 as idprof6, s.tva_intra, s.fk_pays,"; +$sql .= " s.email, s.phone, s.phone_mobile, s.fax, s.url, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4 as idprof4, s.idprof5 as idprof5, s.idprof6 as idprof6, s.tva_intra, s.fk_pays,"; $sql .= " s.tms as date_modification, s.datec as date_creation, s.import_key,"; $sql .= " s.code_compta, s.code_compta_fournisseur, s.parent as fk_parent,s.price_level,"; $sql .= " s2.nom as name2,"; @@ -705,6 +709,9 @@ if ($search_email) { if (strlen($search_phone)) { $sql .= natural_search("s.phone", $search_phone); } +if (strlen($search_phone_mobile)) { + $sql .= natural_search("s.phone_mobile", $search_phone_mobile); +} if (strlen($search_fax)) { $sql .= natural_search("s.fax", $search_fax); } @@ -929,6 +936,9 @@ if ($search_town != '') { if ($search_phone != '') { $param .= "&search_phone=".urlencode($search_phone); } +if ($search_phone_mobile != '') { + $param .= "&search_phone_mobile=".urlencode($search_phone_mobile); +} if ($search_fax != '') { $param .= "&search_fax=".urlencode($search_fax); } @@ -1372,6 +1382,12 @@ if (!empty($arrayfields['s.phone']['checked'])) { print ''; print ''; } +if (!empty($arrayfields['s.phone_mobile']['checked'])) { + // PhoneMobile + print ''; + print ''; + print ''; +} if (!empty($arrayfields['s.fax']['checked'])) { // Fax print ''; @@ -1599,6 +1615,10 @@ if (!empty($arrayfields['s.phone']['checked'])) { print_liste_field_titre($arrayfields['s.phone']['label'], $_SERVER["PHP_SELF"], "s.phone", "", $param, '', $sortfield, $sortorder); $totalarray['nbfield']++; } +if (!empty($arrayfields['s.phone_mobile']['checked'])) { + print_liste_field_titre($arrayfields['s.phone_mobile']['label'], $_SERVER["PHP_SELF"], "s.phone_mobile", "", $param, '', $sortfield, $sortorder); + $totalarray['nbfield']++; +} if (!empty($arrayfields['s.fax']['checked'])) { print_liste_field_titre($arrayfields['s.fax']['label'], $_SERVER["PHP_SELF"], "s.fax", "", $param, '', $sortfield, $sortorder); $totalarray['nbfield']++; @@ -1955,6 +1975,12 @@ while ($i < $imaxinloop) { $totalarray['nbfield']++; } } + if (!empty($arrayfields['s.phone_mobile']['checked'])) { + print ''.dol_print_phone($obj->phone_mobile, $companystatic->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone_mobile')."\n"; + if (!$i) { + $totalarray['nbfield']++; + } + } if (!empty($arrayfields['s.fax']['checked'])) { print ''.dol_print_phone($obj->fax, $companystatic->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'fax')."\n"; if (!$i) { From a08cb4ca1e5e922622ebde46559ee1621aeeabe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 09:55:47 +0100 Subject: [PATCH 05/84] fix phpstan (#28408) Property RecruitmentJobPosition::$import_key (string) does not accept null. --- htdocs/recruitment/class/recruitmentjobposition.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 115c390aeeb..57f900c86c1 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -268,7 +268,7 @@ class RecruitmentJobPosition extends CommonObject // Reset some properties unset($object->id); unset($object->fk_user_creat); - $object->import_key = null; + unset($object->import_key); // Clear fields if (property_exists($object, 'ref')) { From fc432928eaa170d9d18369d4d27e37ff866a7912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 09:56:05 +0100 Subject: [PATCH 06/84] fix phpstan (#28400) * fix phpstan Property PaymentVarious::$id (int) does not accept null. Property PaymentVarious::$ref (string) does not accept null. * Update emailcollector.lib.php --- htdocs/compta/bank/various_payment/card.php | 5 +++-- htdocs/emailcollector/lib/emailcollector.lib.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 6e6924727bb..9463e357b42 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2018-2020 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023 Laurent Destailleur * Copyright (C) 2023 Joachim Kueter * @@ -264,7 +264,8 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && $permissiontoadd) { $object->fetch($id); if ($object->id > 0) { - $object->id = $object->ref = null; + unset($object->id); + unset($object->ref); if (GETPOST('clone_label', 'alphanohtml')) { $object->label = GETPOST('clone_label', 'alphanohtml'); diff --git a/htdocs/emailcollector/lib/emailcollector.lib.php b/htdocs/emailcollector/lib/emailcollector.lib.php index e1244b06eda..8bb69da5f3b 100644 --- a/htdocs/emailcollector/lib/emailcollector.lib.php +++ b/htdocs/emailcollector/lib/emailcollector.lib.php @@ -1,5 +1,6 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -101,7 +102,7 @@ function getParts($structure) * Array with joined files * * @param object $part Part of message - * @return object|boolean Definition of message|false en cas d'erreur + * @return object|boolean Definition of message|false in case of error */ function getDParameters($part) { @@ -112,7 +113,7 @@ function getDParameters($part) * Get attachments of a given mail * * @param integer $jk Number of email - * @param object $mbox object connection imaap + * @param object $mbox object connection imap * @return array type, filename, pos */ function getAttachments($jk, $mbox) From 8588e973644669a5bc69c064d02618eeb03861ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 09:56:23 +0100 Subject: [PATCH 07/84] fix phpstan (#28397) Property CommonObject::$ref (string) does not accept int. --- htdocs/core/class/fiscalyear.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 0162ee7de95..7d617e1ecb3 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2020 OScss-Shop - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -317,7 +317,7 @@ class Fiscalyear extends CommonObject global $conf, $langs, $user; if (empty($this->ref)) { - $this->ref = $this->id; + $this->ref = (string) $this->id; } if (!empty($conf->dol_no_mouse_hover)) { From af3761000a4abe1b15b1060610e7a17a96e8df9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 09:56:46 +0100 Subject: [PATCH 08/84] fix phpstan (#28406) Property ExtraFields::$errno (string) does not accept int. --- htdocs/core/class/extrafields.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 2986940f30e..2153ad048a2 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -171,7 +171,7 @@ class ExtraFields $err2 = $this->errno; if ($result2 > 0 || ($err1 == 'DB_ERROR_COLUMN_ALREADY_EXISTS' && $err2 == 'DB_ERROR_RECORD_ALREADY_EXISTS')) { $this->error = ''; - $this->errno = 0; + $this->errno = '0'; return 1; } else { return -2; From 6876f9fcc39ee1d331f69ccf81a336508eca39dc Mon Sep 17 00:00:00 2001 From: Goldron Date: Sun, 25 Feb 2024 09:58:24 +0100 Subject: [PATCH 09/84] Fixes an error by initializing ->line in the insert_discount method. (#28407) * Fixes an error by initializing ->line in the insert_discount method. * Update propal.class.php --------- Co-authored-by: David IGREJA Co-authored-by: Laurent Destailleur --- htdocs/comm/propal/class/propal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 2a54cf84cf1..937b3424acb 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -514,7 +514,7 @@ class Propal extends CommonObject $line = new PropaleLigne($this->db); - $this->line->context = $this->context; + $line->context = $this->context; $line->fk_propal = $this->id; $line->fk_remise_except = $remise->id; From cac5d5e7c8172f7b83bbb21b7fe4bbaf09516519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 10:00:09 +0100 Subject: [PATCH 10/84] fix phpstan (#28398) Property HookManager::$error (string) does not accept int. --- htdocs/core/class/hookmanager.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index b4c4f37e569..6c9cea6f6f7 100644 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -239,7 +239,7 @@ class HookManager $modulealreadyexecuted[$module] = $module; // Clean class (an error may have been set from a previous call of another method for same module/hook) - $actionclassinstance->error = 0; + $actionclassinstance->error = ''; $actionclassinstance->errors = array(); if (getDolGlobalInt('MAIN_HOOK_DEBUG')) { From 92103e20292f20c7410e96d02dcee90c1273ecfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 10:00:39 +0100 Subject: [PATCH 11/84] fix phpstan (#28399) Property CommonObject::$fk_project (int) does not accept string. --- .../supplier_proposal/class/supplier_proposal.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 2a3a2681b77..b2a681606df 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -13,7 +13,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2019-2023 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2022 Gauthier VERDOL * @@ -1125,9 +1125,9 @@ class SupplierProposal extends CommonObject if (!empty($fromid) && $fromid != $this->socid) { if ($objsoc->fetch($fromid) > 0) { $this->socid = $objsoc->id; - $this->cond_reglement_id = (!empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); - $this->mode_reglement_id = (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); - $this->fk_project = ''; + $this->cond_reglement_id = (!empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); + $this->mode_reglement_id = (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); + unset($this->fk_project); } // TODO Change product price if multi-prices From fe0123262d54a12a128b288dac255b3bdb96eff1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 10:00:58 +0100 Subject: [PATCH 12/84] fix phpstan (#28401) Property ProductCombinationLevel::$fk_product_attribute_combination (int) does not accept float. --- htdocs/variants/class/ProductCombination.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/variants/class/ProductCombination.class.php b/htdocs/variants/class/ProductCombination.class.php index 46e41cb5680..25d69eaeac9 100644 --- a/htdocs/variants/class/ProductCombination.class.php +++ b/htdocs/variants/class/ProductCombination.class.php @@ -1151,7 +1151,7 @@ class ProductCombinationLevel } $this->id = $obj->rowid; - $this->fk_product_attribute_combination = (float) $obj->fk_product_attribute_combination; + $this->fk_product_attribute_combination = (int) $obj->fk_product_attribute_combination; $this->fk_price_level = intval($obj->fk_price_level); $this->variation_price = (float) $obj->variation_price; $this->variation_price_percentage = (bool) $obj->variation_price_percentage; From 2cfeacbd1eff919788954a31776f565f316e856a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 10:03:04 +0100 Subject: [PATCH 13/84] fix phpstan (#28402) --- htdocs/societe/class/api_thirdparties.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 8dc6b56262f..fc14b2c8d1f 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Pierre Chéné * Copyright (C) 2019 Cedric Ancelin - * Copyright (C) 2020-2021 Frédéric France + * Copyright (C) 2020-2024 Frédéric France * Copyright (C) 2023 Alexandre Janniaux * * This program is free software; you can redistribute it and/or modify @@ -472,9 +472,12 @@ class Thirdparties extends DolibarrApi * * @param int $id Id of thirdparty * @param int $representative_id Id of representative - * @return Object|void + * @return int Return integer <=0 if KO, >0 if OK * * @url POST {id}/representative/{representative_id} + * + * @throws RestException 401 Access not allowed for your login + * @throws RestException 404 User or Thirdparty not found */ public function addRepresentative($id, $representative_id) { @@ -503,9 +506,12 @@ class Thirdparties extends DolibarrApi * * @param int $id Id of thirdparty * @param int $representative_id Id of representative - * @return Object|void + * @return int Return integer <=0 if KO, >0 if OK * * @url DELETE {id}/representative/{representative_id} + * + * @throws RestException 401 Access not allowed for your login + * @throws RestException 404 User or Thirdparty not found */ public function deleteRepresentative($id, $representative_id) { From c159aff82fbef58b190eeb0f5e304c5cafe857be Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 10:04:27 +0100 Subject: [PATCH 14/84] phpcs --- htdocs/societe/class/api_thirdparties.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index fc14b2c8d1f..db163d36068 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -32,7 +32,7 @@ class Thirdparties extends DolibarrApi { /** * - * @var array $FIELDS Mandatory fields, checked when create and update object + * @var array $FIELDS Mandatory fields, checked when we create and update the object */ public static $FIELDS = array( 'name' @@ -477,7 +477,7 @@ class Thirdparties extends DolibarrApi * @url POST {id}/representative/{representative_id} * * @throws RestException 401 Access not allowed for your login - * @throws RestException 404 User or Thirdparty not found + * @throws RestException 404 User or Thirdparty not found */ public function addRepresentative($id, $representative_id) { @@ -511,7 +511,7 @@ class Thirdparties extends DolibarrApi * @url DELETE {id}/representative/{representative_id} * * @throws RestException 401 Access not allowed for your login - * @throws RestException 404 User or Thirdparty not found + * @throws RestException 404 User or Thirdparty not found */ public function deleteRepresentative($id, $representative_id) { From b7b799b88e1fec4bb7ccf4e8ce7c19112ad9944f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 10:04:57 +0100 Subject: [PATCH 15/84] fix phpstan (#28403) --- htdocs/core/class/html.formsetup.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index dec81f921ec..1852fc9f878 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -249,7 +249,7 @@ class FormSetup * saveConfFromPost * * @param bool $noMessageInUpdate display event message on errors and success - * @return int -1 if KO, 1 if OK + * @return int|null Return -1 if KO, 1 if OK, null if no items */ public function saveConfFromPost($noMessageInUpdate = false) { @@ -266,7 +266,6 @@ class FormSetup return $reshook; } - if (empty($this->items)) { return null; } From 5c33a3602d0923a3d498d37913b62d289ab43467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 10:05:11 +0100 Subject: [PATCH 16/84] fix phpstan (#28404) --- htdocs/product/stock/class/productlot.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 70f6334972d..cd4dca967dc 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -1225,8 +1225,8 @@ class Productlot extends CommonObject $this->sellby = $now - 100000; $this->datec = $now - 3600; $this->tms = $now; - $this->fk_user_creat = null; - $this->fk_user_modif = null; + $this->fk_user_creat = 0; + $this->fk_user_modif = 0; $this->import_key = '123456'; } From b6fdae934a47f343862e5d2413772c8f07d180a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 10:05:26 +0100 Subject: [PATCH 17/84] fix phpstan (#28405) Method DolibarrApi::_checkValForAPI() should return string but returns array. --- htdocs/api/class/api.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php index 8e900c27462..63d504b14cb 100644 --- a/htdocs/api/class/api.class.php +++ b/htdocs/api/class/api.class.php @@ -75,10 +75,10 @@ class DolibarrApi * * Display a short message an return a http code 200 * - * @param string $field Field name - * @param mixed $value Value to check/clean - * @param Object $object Object - * @return string Value cleaned + * @param string $field Field name + * @param string|array $value Value to check/clean + * @param Object $object Object + * @return string|array Value cleaned */ protected function _checkValForAPI($field, $value, $object) { From 19427168c0aa2fe67f3466ba57fcfd1f6490f9d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 10:06:21 +0100 Subject: [PATCH 18/84] enhance warnings messages (#28409) --- htdocs/admin/modulehelp.php | 2 +- htdocs/admin/modules.php | 2 +- htdocs/admin/system/modules.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index cbf9ac6fba6..8ef166d933c 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -200,7 +200,7 @@ foreach ($modulesdir as $dir) { dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); } } else { - print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
"; + print info_admin("Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)", 0, 0, '1', 'warning'); } } catch (Exception $e) { dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 27d0b5c0581..62c612ab24a 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -485,7 +485,7 @@ foreach ($modulesdir as $dir) { dol_syslog("Module ".get_class($objMod)." not qualified"); } } else { - print "admin/modules.php Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
"; + print info_admin("admin/modules.php Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)", 0, 0, '1', 'warning'); } } catch (Exception $e) { dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); diff --git a/htdocs/admin/system/modules.php b/htdocs/admin/system/modules.php index 4cd42fe0243..94c29927cb9 100644 --- a/htdocs/admin/system/modules.php +++ b/htdocs/admin/system/modules.php @@ -67,7 +67,7 @@ $arrayfields = array( $arrayfields = dol_sort_array($arrayfields, 'position'); $param = ''; - +$info_admin = ''; /* * Actions @@ -120,7 +120,7 @@ foreach ($modulesdir as $dir) { dol_syslog("Failed to load ".$dir.$file." ".$e->getMessage(), LOG_ERR); } } else { - print "Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)
"; + $info_admin .= info_admin("Warning bad descriptor file : ".$dir.$file." (Class ".$modName." not found into file)", 0, 0, '1', 'warning'); } } } @@ -202,7 +202,7 @@ foreach ($modules as $key => $module) { */ llxHeader(); - +print $info_admin; print '
'; if ($optioncss != '') { print ''; From b8acde3a4383be5705b3c2338a3b1f7453e2da9c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 12:58:20 +0100 Subject: [PATCH 19/84] Fix field position --- htdocs/emailcollector/class/emailcollector.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 706c32494b4..bf454b2a1ca 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -135,7 +135,7 @@ class EmailCollector extends CommonObject 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), 'password' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>"1", 'position'=>103, 'notnull'=>-1, 'comment'=>"IMAP password", 'help'=>'WithGMailYouCanCreateADedicatedPassword'), 'oauth_service' => array('type'=>'varchar(128)', 'label'=>'oauthService', 'visible'=>-1, 'enabled'=>"getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>104, 'notnull'=>0, 'index'=>1, 'comment'=>"IMAP login oauthService", 'arrayofkeyval'=>array(), 'help'=>'TokenMustHaveBeenCreated'), - 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>104, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX, [Gmail]/Spam, [Gmail]/Draft, [Gmail]/Brouillons, [Gmail]/Sent Mail, [Gmail]/Messages envoyés, ...'), + 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>109, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX, [Gmail]/Spam, [Gmail]/Draft, [Gmail]/Brouillons, [Gmail]/Sent Mail, [Gmail]/Messages envoyés, ...'), 'target_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxTargetDirectory', 'visible'=>1, 'enabled'=>1, 'position'=>110, 'notnull'=>0, 'help'=>"EmailCollectorTargetDir"), 'maxemailpercollect' => array('type'=>'integer', 'label'=>'MaxEmailCollectPerCollect', 'visible'=>-1, 'enabled'=>1, 'position'=>111, 'default'=>50), 'datelastresult' => array('type'=>'datetime', 'label'=>'DateLastCollectResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>121, 'notnull'=>-1, 'csslist'=>'nowraponall'), From fca9ebe72f8d793e5cc1ef63d330ebb2d28960bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 12:58:20 +0100 Subject: [PATCH 20/84] Fix field position --- htdocs/emailcollector/class/emailcollector.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index df07651e7af..d68d6fbb99e 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -136,7 +136,7 @@ class EmailCollector extends CommonObject 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), 'password' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>"1", 'position'=>103, 'notnull'=>-1, 'comment'=>"IMAP password", 'help'=>'WithGMailYouCanCreateADedicatedPassword'), 'oauth_service' => array('type'=>'varchar(128)', 'label'=>'oauthService', 'visible'=>-1, 'enabled'=>"getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>104, 'notnull'=>0, 'index'=>1, 'comment'=>"IMAP login oauthService", 'arrayofkeyval'=>array(), 'help'=>'TokenMustHaveBeenCreated'), - 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>104, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX, [Gmail]/Spam, [Gmail]/Draft, [Gmail]/Brouillons, [Gmail]/Sent Mail, [Gmail]/Messages envoyés, ...'), + 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>109, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX, [Gmail]/Spam, [Gmail]/Draft, [Gmail]/Brouillons, [Gmail]/Sent Mail, [Gmail]/Messages envoyés, ...'), 'target_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxTargetDirectory', 'visible'=>1, 'enabled'=>1, 'position'=>110, 'notnull'=>0, 'help'=>"EmailCollectorTargetDir"), 'maxemailpercollect' => array('type'=>'integer', 'label'=>'MaxEmailCollectPerCollect', 'visible'=>-1, 'enabled'=>1, 'position'=>111, 'default'=>50), 'datelastresult' => array('type'=>'datetime', 'label'=>'DateLastCollectResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>121, 'notnull'=>-1, 'csslist'=>'nowraponall'), From 4c3830b90973640805be1a8d804e8cd3b59daaa9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 13:06:31 +0100 Subject: [PATCH 21/84] Fix set the default value --- htdocs/emailcollector/class/emailcollector.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index d68d6fbb99e..8a74a5a434a 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -152,7 +152,7 @@ class EmailCollector extends CommonObject 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'visible'=>-2, 'enabled'=>1, 'position'=>511, 'notnull'=>-1,), //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1,), - 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Inactive', '1'=>'Active')) + 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'arrayofkeyval'=>array('0'=>'Inactive', '1'=>'Active')) ); From 05914b4c78162d3dfdaea7de746b1a90efedd370 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 16:57:45 +0100 Subject: [PATCH 22/84] Fix warning --- htdocs/core/lib/website.lib.php | 6 +++--- htdocs/core/website.inc.php | 2 +- htdocs/website/class/website.class.php | 7 ++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 912247eb0ff..4583852526a 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -676,13 +676,13 @@ function getStructuredData($type, $data = array()) $ret .= '{ "@context": "https://schema.org", "@type": "Organization", - "name": "'.dol_escape_json($data['name'] ? $data['name'] : $companyname).'", - "url": "'.dol_escape_json($data['url'] ? $data['url'] : $url).'", + "name": "'.dol_escape_json(!empty($data['name']) ? $data['name'] : $companyname).'", + "url": "'.dol_escape_json(!empty($data['url']) ? $data['url'] : $url).'", "logo": "'.($data['logo'] ? dol_escape_json($data['logo']) : '/wrapper.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo)).'", "contactPoint": { "@type": "ContactPoint", "contactType": "Contact", - "email": "'.dol_escape_json($data['email'] ? $data['email'] : $mysoc->email).'" + "email": "'.dol_escape_json(!empty($data['email']) ? $data['email'] : $mysoc->email).'" }'."\n"; if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) { $ret .= ",\n"; diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 9be644e0c16..9a340050d22 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -67,7 +67,7 @@ if (!is_object($weblangs)) { if (!is_object($pagelangs)) { $pagelangs = new Translate('', $conf); } -if ($pageid > 0) { +if (!empty($pageid) && $pageid > 0) { $websitepage->fetch($pageid); $weblangs->setDefaultLang(GETPOSTISSET('lang') ? GETPOST('lang', 'aZ09') : (empty($_COOKIE['weblangs-shortcode']) ? 'auto' : preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE['weblangs-shortcode']))); diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index f5a4ec292bd..84a35074805 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -77,10 +77,15 @@ class Website extends CommonObject public $description; /** - * @var string Main language of web site + * @var string Main language on 5 chars of web site */ public $lang; + /** + * @var string Main language on 2 chars of web site + */ + public $shortlang; + /** * @var string List of languages of web site ('fr', 'es_MX', ...) */ From 0a9d4540554627525539803c2e1104792a16219d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 17:01:37 +0100 Subject: [PATCH 23/84] Fix revert --- htdocs/website/class/website.class.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/htdocs/website/class/website.class.php b/htdocs/website/class/website.class.php index 84a35074805..f5a4ec292bd 100644 --- a/htdocs/website/class/website.class.php +++ b/htdocs/website/class/website.class.php @@ -77,15 +77,10 @@ class Website extends CommonObject public $description; /** - * @var string Main language on 5 chars of web site + * @var string Main language of web site */ public $lang; - /** - * @var string Main language on 2 chars of web site - */ - public $shortlang; - /** * @var string List of languages of web site ('fr', 'es_MX', ...) */ From 076cde3005e3246b7821cd5e0b4f3b18ae1230e0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 17:20:28 +0100 Subject: [PATCH 24/84] Fix warning --- htdocs/asset/class/asset.class.php | 2 +- htdocs/asset/class/assetmodel.class.php | 2 +- htdocs/bookcal/class/availabilities.class.php | 2 +- htdocs/bookcal/class/calendar.class.php | 2 +- htdocs/core/class/defaultvalues.class.php | 2 +- htdocs/core/class/timespent.class.php | 2 +- htdocs/eventorganization/class/conferenceorbooth.class.php | 2 +- .../eventorganization/class/conferenceorboothattendee.class.php | 2 +- htdocs/hrm/class/evaluation.class.php | 2 +- htdocs/hrm/class/evaluationdet.class.php | 2 +- htdocs/hrm/class/job.class.php | 2 +- htdocs/hrm/class/position.class.php | 2 +- htdocs/hrm/class/skill.class.php | 2 +- htdocs/hrm/class/skilldet.class.php | 2 +- htdocs/hrm/class/skillrank.class.php | 2 +- htdocs/knowledgemanagement/class/knowledgerecord.class.php | 2 +- htdocs/opensurvey/class/opensurveysondage.class.php | 2 +- htdocs/partnership/class/partnership.class.php | 2 +- htdocs/partnership/class/partnership_type.class.php | 2 +- htdocs/product/class/productfournisseurprice.class.php | 2 +- htdocs/recruitment/class/recruitmentcandidature.class.php | 2 +- htdocs/recruitment/class/recruitmentjobposition.class.php | 2 +- htdocs/ticket/class/cticketcategory.class.php | 2 +- htdocs/user/class/user.class.php | 2 +- htdocs/webhook/class/target.class.php | 2 +- htdocs/workstation/class/workstation.class.php | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 058c12b377f..f8835a4d44c 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -418,7 +418,7 @@ class Asset extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index b8eead48384..531937c699d 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -358,7 +358,7 @@ class AssetModel extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 3e8a0c4dab2..21f32a19efc 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -413,7 +413,7 @@ class Availabilities extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index 4490852b2a8..29e64e1c69a 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -370,7 +370,7 @@ class Calendar extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index 059f9a2f393..0302d06c277 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -269,7 +269,7 @@ class DefaultValues extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid' || ($key == 't.entity' && !is_array($value)) || ($key == 't.user_id' && !is_array($value))) { $sqlwhere[] = $key." = ".((int) $value); - } elseif (isset($this->fields[$key]) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 't.page' || $key == 't.param' || $key == 't.type') { $sqlwhere[] = $key." = '".$this->db->escape($value)."'"; diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index 9484c0e3f58..4deeeeab874 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -352,7 +352,7 @@ class TimeSpent extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 7dd88929a48..28cf4604b06 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -304,7 +304,7 @@ class ConferenceOrBooth extends ActionComm foreach ($filter as $key => $value) { if ($key == 't.id' || $key == 't.fk_project' || $key == 't.fk_soc' || $key == 't.fk_action') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 126f2e66941..b11cd1931c2 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -433,7 +433,7 @@ class ConferenceOrBoothAttendee extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid' || $key == 't.fk_soc' || $key == 't.fk_project' || $key == 't.fk_actioncomm') { $sqlwhere[] = $key.'='.((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 5e8cd595229..b0c647e55b1 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -416,7 +416,7 @@ class Evaluation extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 2778ac9e76c..b5c8abe5bdc 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -384,7 +384,7 @@ class EvaluationLine extends CommonObjectLine $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 2a306d5b8be..c53a239ac8a 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -385,7 +385,7 @@ class Job extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index ab6db1911f2..f006893227e 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -397,7 +397,7 @@ class Position extends CommonObject $sqlwhere[] = $key . '=' . $value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key . ' IN (' . $this->db->sanitize($this->db->escape($value)) . ')'; diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index bc9998adf82..f9ca03493ff 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -454,7 +454,7 @@ class Skill extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index e658e75b265..c79c79d1b8c 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -378,7 +378,7 @@ class Skilldet extends CommonObjectLine $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")"; diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index dffb5600e46..028e4ad1ba3 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -425,7 +425,7 @@ class SkillRank extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif ($key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && $key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 390ccf22287..3a5c78b929f 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -399,7 +399,7 @@ class KnowledgeRecord extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 4fd68649ef6..025c3895113 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -798,7 +798,7 @@ class Opensurveysondage extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 3f8e6b176d8..f894d4ca51f 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -452,7 +452,7 @@ class Partnership extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index aba40325cfd..68d654b64e0 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -180,7 +180,7 @@ class PartnershipType extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index a8b2f56c553..1c7b9693072 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -348,7 +348,7 @@ class ProductFournisseurPrice extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index d632c7d30f3..efb9b69d7a5 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -384,7 +384,7 @@ class RecruitmentCandidature extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index feb94f13bd9..3e2a0d36fc4 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -399,7 +399,7 @@ class RecruitmentJobPosition extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index 9033587e2df..f5f0dfd4f92 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -392,7 +392,7 @@ class CTicketCategory extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a0eed471a0b..3c3bded98fd 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -4052,7 +4052,7 @@ class User extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 3030617098b..689d95a5d8e 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -394,7 +394,7 @@ class Target extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index 543ded86b6c..ac25ea56c2e 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -397,7 +397,7 @@ class Workstation extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; From 4897d1eb97800c7ab12cf9044177111ced1e14bf Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 17:20:28 +0100 Subject: [PATCH 25/84] Fix warning --- htdocs/asset/class/asset.class.php | 2 +- htdocs/asset/class/assetmodel.class.php | 2 +- htdocs/bookcal/class/availabilities.class.php | 2 +- htdocs/bookcal/class/calendar.class.php | 2 +- htdocs/core/class/defaultvalues.class.php | 2 +- htdocs/core/class/timespent.class.php | 2 +- htdocs/core/lib/xcal.lib.php | 9 +++++---- .../eventorganization/class/conferenceorbooth.class.php | 2 +- .../class/conferenceorboothattendee.class.php | 2 +- htdocs/hrm/class/evaluation.class.php | 2 +- htdocs/hrm/class/evaluationdet.class.php | 2 +- htdocs/hrm/class/job.class.php | 2 +- htdocs/hrm/class/position.class.php | 2 +- htdocs/hrm/class/skill.class.php | 2 +- htdocs/hrm/class/skilldet.class.php | 2 +- htdocs/hrm/class/skillrank.class.php | 2 +- .../knowledgemanagement/class/knowledgerecord.class.php | 2 +- htdocs/opensurvey/class/opensurveysondage.class.php | 2 +- htdocs/partnership/class/partnership.class.php | 2 +- htdocs/partnership/class/partnership_type.class.php | 2 +- htdocs/product/class/productfournisseurprice.class.php | 2 +- .../recruitment/class/recruitmentcandidature.class.php | 2 +- .../recruitment/class/recruitmentjobposition.class.php | 2 +- htdocs/ticket/class/cticketcategory.class.php | 2 +- htdocs/user/class/user.class.php | 2 +- htdocs/webhook/class/target.class.php | 2 +- htdocs/workstation/class/workstation.class.php | 2 +- 27 files changed, 31 insertions(+), 30 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 058c12b377f..f8835a4d44c 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -418,7 +418,7 @@ class Asset extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index b8eead48384..531937c699d 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -358,7 +358,7 @@ class AssetModel extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 3e8a0c4dab2..21f32a19efc 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -413,7 +413,7 @@ class Availabilities extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index 4490852b2a8..29e64e1c69a 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -370,7 +370,7 @@ class Calendar extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index 059f9a2f393..0302d06c277 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -269,7 +269,7 @@ class DefaultValues extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid' || ($key == 't.entity' && !is_array($value)) || ($key == 't.user_id' && !is_array($value))) { $sqlwhere[] = $key." = ".((int) $value); - } elseif (isset($this->fields[$key]) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 't.page' || $key == 't.param' || $key == 't.type') { $sqlwhere[] = $key." = '".$this->db->escape($value)."'"; diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index 9484c0e3f58..4deeeeab874 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -352,7 +352,7 @@ class TimeSpent extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 4ea8fffb327..bfca11682e4 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -401,8 +401,8 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt $startdate = $event["startdate"]; $summary = $event["summary"]; $url = $event["url"]; - $author = $event["author"]; - $category = $event["category"]; + $author = $event["author"]; + $category = empty($event["category"]) ? null : $event["category"]; if (!empty($event["image"])) { $image = $event["image"]; } @@ -419,9 +419,10 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt fwrite($fichier, "<![CDATA[".$summary."]]>\n"); fwrite($fichier, "\n"); fwrite($fichier, "\n"); - fwrite($fichier, "\n"); + if (!empty($category)) { + fwrite($fichier, "\n"); + } fwrite($fichier, "

'); } diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 7dd88929a48..28cf4604b06 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -304,7 +304,7 @@ class ConferenceOrBooth extends ActionComm foreach ($filter as $key => $value) { if ($key == 't.id' || $key == 't.fk_project' || $key == 't.fk_soc' || $key == 't.fk_action') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 126f2e66941..b11cd1931c2 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -433,7 +433,7 @@ class ConferenceOrBoothAttendee extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid' || $key == 't.fk_soc' || $key == 't.fk_project' || $key == 't.fk_actioncomm') { $sqlwhere[] = $key.'='.((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 5e8cd595229..b0c647e55b1 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -416,7 +416,7 @@ class Evaluation extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 2778ac9e76c..b5c8abe5bdc 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -384,7 +384,7 @@ class EvaluationLine extends CommonObjectLine $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 2a306d5b8be..c53a239ac8a 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -385,7 +385,7 @@ class Job extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index ab6db1911f2..f006893227e 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -397,7 +397,7 @@ class Position extends CommonObject $sqlwhere[] = $key . '=' . $value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key . ' IN (' . $this->db->sanitize($this->db->escape($value)) . ')'; diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index bc9998adf82..f9ca03493ff 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -454,7 +454,7 @@ class Skill extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index e658e75b265..c79c79d1b8c 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -378,7 +378,7 @@ class Skilldet extends CommonObjectLine $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")"; diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index dffb5600e46..028e4ad1ba3 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -425,7 +425,7 @@ class SkillRank extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif ($key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && $key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 390ccf22287..3a5c78b929f 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -399,7 +399,7 @@ class KnowledgeRecord extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 4fd68649ef6..025c3895113 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -798,7 +798,7 @@ class Opensurveysondage extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 3f8e6b176d8..f894d4ca51f 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -452,7 +452,7 @@ class Partnership extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index aba40325cfd..68d654b64e0 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -180,7 +180,7 @@ class PartnershipType extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index a8b2f56c553..1c7b9693072 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -348,7 +348,7 @@ class ProductFournisseurPrice extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index d632c7d30f3..efb9b69d7a5 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -384,7 +384,7 @@ class RecruitmentCandidature extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index feb94f13bd9..3e2a0d36fc4 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -399,7 +399,7 @@ class RecruitmentJobPosition extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index 9033587e2df..f5f0dfd4f92 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -392,7 +392,7 @@ class CTicketCategory extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a0eed471a0b..3c3bded98fd 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -4052,7 +4052,7 @@ class User extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 3030617098b..689d95a5d8e 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -394,7 +394,7 @@ class Target extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index 543ded86b6c..ac25ea56c2e 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -397,7 +397,7 @@ class Workstation extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; From 66804093cd2e4e68fb19dc7ce1beb3b8cad2932e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 18:27:57 +0100 Subject: [PATCH 26/84] MQ and GP are same country for default vat definition --- htdocs/core/lib/functions.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bc8d2e7a2e9..c8b7adbb9aa 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7060,7 +7060,9 @@ function get_default_tva(Societe $thirdparty_seller, Societe $thirdparty_buyer, // If the (seller country = buyer country) then the default VAT = VAT of the product sold. End of rule. if (($seller_country_code == $buyer_country_code) - || (in_array($seller_country_code, array('FR', 'MC')) && in_array($buyer_country_code, array('FR', 'MC')))) { // Warning ->country_code not always defined + || (in_array($seller_country_code, array('FR', 'MC')) && in_array($buyer_country_code, array('FR', 'MC'))) + || (in_array($seller_country_code, array('MQ', 'GP')) && in_array($buyer_country_code, array('MQ', 'GP'))) + ) { // Warning ->country_code not always defined //print 'VATRULE 2'; $tmpvat = get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournprice); From 2db3dc0eef8ef275c3afe4a3550c2da7f99756f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 18:36:40 +0100 Subject: [PATCH 27/84] Fix output for phpphan --- dev/tools/apstats.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index 44283bbc226..28c1f84badb 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -669,12 +669,13 @@ if (!empty($output_arrtd)) { $tmp .= ''; $tmp .= ''.dolPrintHTML($reg[4]).''; $tmp .= ''."\n"; + $nblines++; } } } - +$tmpphan = ''; $phan_nblines = 0; if (count($output_phan_json) != 0) { $phan_notices = json_decode($output_phan_json[count($output_phan_json) - 1], true); @@ -695,18 +696,17 @@ if (count($output_phan_json) != 0) { } $code_url_attr = dol_escape_htmltag($urlgit.$path.$line_range); if ($phan_nblines < 20) { - $tmp = ''; + $tmpphan = ''; } else { - $tmp = ''; + $tmpphan = ''; } - $tmp .= ''.dolPrintHTML($path).''; - $tmp .= ''; - $tmp .= ''.$line_range_txt.''; - $tmp .= ''; - $tmp .= ''.dolPrintHTML($notice['description']).''; - $tmp .= ''; + $tmpphan .= ''.dolPrintHTML($path).''; + $tmpphan .= ''; + $tmpphan .= ''.$line_range_txt.''; + $tmpphan .= ''; + $tmpphan .= ''.dolPrintHTML($notice['description']).''; + $tmpphan .= ''; - $phan_items[] = $tmp; $phan_nblines++; } } @@ -813,7 +813,7 @@ if ($phan_nblines != 0) { $html .= '
'."\n"; $html .= ''."\n"; $html .= ''."\n"; - $html .= implode("\n", $phan_items); + $html .= $tmpphan; $html .= '
FileLineDetail
'; // Disabled, no more required as list is managed with datatable //$html .= '
Show all...
'; From 87d25869acbb4342ee37c9bb46e53e8476407d10 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 18:55:22 +0100 Subject: [PATCH 28/84] Fix lost lines --- dev/tools/apstats.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index 28c1f84badb..da238e0f43b 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -696,9 +696,9 @@ if (count($output_phan_json) != 0) { } $code_url_attr = dol_escape_htmltag($urlgit.$path.$line_range); if ($phan_nblines < 20) { - $tmpphan = ''; + $tmpphan .= ''; } else { - $tmpphan = ''; + $tmpphan .= ''; } $tmpphan .= ''.dolPrintHTML($path).''; $tmpphan .= ''; @@ -706,6 +706,7 @@ if (count($output_phan_json) != 0) { $tmpphan .= ''; $tmpphan .= ''.dolPrintHTML($notice['description']).''; $tmpphan .= ''; + $tmpphan .= "\n"; $phan_nblines++; } From c171ce20650f362e81b34ca756046c3fe99c4e37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 19:04:05 +0100 Subject: [PATCH 29/84] Fix bad function --- htdocs/asset/class/asset.class.php | 2 +- htdocs/asset/class/assetmodel.class.php | 2 +- htdocs/bookcal/class/availabilities.class.php | 2 +- htdocs/bookcal/class/calendar.class.php | 2 +- htdocs/core/class/defaultvalues.class.php | 2 +- htdocs/core/class/timespent.class.php | 2 +- htdocs/eventorganization/class/conferenceorbooth.class.php | 2 +- .../eventorganization/class/conferenceorboothattendee.class.php | 2 +- htdocs/hrm/class/evaluation.class.php | 2 +- htdocs/hrm/class/evaluationdet.class.php | 2 +- htdocs/hrm/class/job.class.php | 2 +- htdocs/hrm/class/position.class.php | 2 +- htdocs/hrm/class/skill.class.php | 2 +- htdocs/hrm/class/skilldet.class.php | 2 +- htdocs/hrm/class/skillrank.class.php | 2 +- htdocs/knowledgemanagement/class/knowledgerecord.class.php | 2 +- htdocs/opensurvey/class/opensurveysondage.class.php | 2 +- htdocs/partnership/class/partnership.class.php | 2 +- htdocs/partnership/class/partnership_type.class.php | 2 +- htdocs/product/class/productfournisseurprice.class.php | 2 +- htdocs/recruitment/class/recruitmentcandidature.class.php | 2 +- htdocs/recruitment/class/recruitmentjobposition.class.php | 2 +- htdocs/ticket/class/cticketcategory.class.php | 2 +- htdocs/user/class/user.class.php | 2 +- htdocs/webhook/class/target.class.php | 2 +- htdocs/workstation/class/workstation.class.php | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index f8835a4d44c..94fad45138d 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -418,7 +418,7 @@ class Asset extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index 531937c699d..3b557456e77 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -358,7 +358,7 @@ class AssetModel extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 21f32a19efc..040a06e62ca 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -413,7 +413,7 @@ class Availabilities extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index 29e64e1c69a..a7bde4a7746 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -370,7 +370,7 @@ class Calendar extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index 0302d06c277..734d78202a9 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -269,7 +269,7 @@ class DefaultValues extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid' || ($key == 't.entity' && !is_array($value)) || ($key == 't.user_id' && !is_array($value))) { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 't.page' || $key == 't.param' || $key == 't.type') { $sqlwhere[] = $key." = '".$this->db->escape($value)."'"; diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index 4deeeeab874..cd0b1a655a2 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -352,7 +352,7 @@ class TimeSpent extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 28cf4604b06..60b8114dd80 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -304,7 +304,7 @@ class ConferenceOrBooth extends ActionComm foreach ($filter as $key => $value) { if ($key == 't.id' || $key == 't.fk_project' || $key == 't.fk_soc' || $key == 't.fk_action') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index b11cd1931c2..426ed9eaefc 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -433,7 +433,7 @@ class ConferenceOrBoothAttendee extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid' || $key == 't.fk_soc' || $key == 't.fk_project' || $key == 't.fk_actioncomm') { $sqlwhere[] = $key.'='.((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index b0c647e55b1..7689312ec39 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -416,7 +416,7 @@ class Evaluation extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index b5c8abe5bdc..da18ecd8a6e 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -384,7 +384,7 @@ class EvaluationLine extends CommonObjectLine $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index c53a239ac8a..ec0c67a0ad1 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -385,7 +385,7 @@ class Job extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index f006893227e..f1127f67e5a 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -397,7 +397,7 @@ class Position extends CommonObject $sqlwhere[] = $key . '=' . $value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key . ' IN (' . $this->db->sanitize($this->db->escape($value)) . ')'; diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index f9ca03493ff..01861a6b185 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -454,7 +454,7 @@ class Skill extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index c79c79d1b8c..b9df29a9daf 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -378,7 +378,7 @@ class Skilldet extends CommonObjectLine $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")"; diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 028e4ad1ba3..2dcc3373f5e 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -425,7 +425,7 @@ class SkillRank extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && $key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && $key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 3a5c78b929f..370c29f1dce 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -399,7 +399,7 @@ class KnowledgeRecord extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 025c3895113..24fef99e5b8 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -798,7 +798,7 @@ class Opensurveysondage extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index f894d4ca51f..c4e3c0fd3b8 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -452,7 +452,7 @@ class Partnership extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index 68d654b64e0..e3f7457919f 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -180,7 +180,7 @@ class PartnershipType extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index 1c7b9693072..f037762b01f 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -348,7 +348,7 @@ class ProductFournisseurPrice extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index efb9b69d7a5..d7f1db2a564 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -384,7 +384,7 @@ class RecruitmentCandidature extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 3e2a0d36fc4..b3c9f92e12f 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -399,7 +399,7 @@ class RecruitmentJobPosition extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index f5f0dfd4f92..19b1572e2be 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -392,7 +392,7 @@ class CTicketCategory extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 3c3bded98fd..8f438adc5e4 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -4052,7 +4052,7 @@ class User extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 689d95a5d8e..d8f2a14a861 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -394,7 +394,7 @@ class Target extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index ac25ea56c2e..8e650fa9f3f 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -397,7 +397,7 @@ class Workstation extends CommonObject foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (property_exists($this->fields, $key) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; From 16b2cf28802333042c6ffde360af4cecc5164835 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 20:41:58 +0100 Subject: [PATCH 30/84] Fix creation of emailing --- htdocs/comm/mailing/card.php | 9 +++++++-- htdocs/comm/mailing/class/mailing.class.php | 14 ++++++++++++-- htdocs/langs/en_US/mails.lang | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 645d24a0e75..80eb874e179 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -547,7 +547,11 @@ if (empty($reshook)) { $mesgs = array(); $object->messtype = (string) GETPOST("messtype"); - $object->email_from = (string) GETPOST("from", 'alphawithlgt'); // Must allow 'name ' + if ($object->messtype == 'sms') { + $object->email_from = (string) GETPOST("from_phone", 'alphawithlgt'); // Must allow 'name ' + } else { + $object->email_from = (string) GETPOST("from", 'alphawithlgt'); // Must allow 'name ' + } $object->email_replyto = (string) GETPOST("replyto", 'alphawithlgt'); // Must allow 'name ' $object->email_errorsto = (string) GETPOST("errorsto", 'alphawithlgt'); // Must allow 'name ' $object->title = (string) GETPOST("title"); @@ -823,7 +827,8 @@ if ($action == 'create') { print ''; print ''; - print ''; + + print ''; print ''; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index fb378c8f8cd..8884af4f085 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -226,7 +226,11 @@ class Mailing extends CommonObject $this->email_from = trim($this->email_from); if (!$this->email_from) { - $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("From")); + if ($this->messtype !== 'sms') { + $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("MailFrom")); + } else { + $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PhoneFrom")); + } return -1; } @@ -287,6 +291,8 @@ class Mailing extends CommonObject */ public function update($user, $notrigger = 0) { + global $langs; + // Check properties if (preg_match('/^InvalidHTMLStringCantBeCleaned/', $this->body)) { $this->error = 'InvalidHTMLStringCantBeCleaned'; @@ -331,7 +337,11 @@ class Mailing extends CommonObject return -2; } } else { - $this->error = $this->db->lasterror(); + if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $this->error = $langs->trans("ErrorTitleAlreadyExists", $this->title); + } else { + $this->error = $this->db->lasterror(); + } $this->db->rollback(); return -1; } diff --git a/htdocs/langs/en_US/mails.lang b/htdocs/langs/en_US/mails.lang index 704b4553dcc..159d1a0bd9e 100644 --- a/htdocs/langs/en_US/mails.lang +++ b/htdocs/langs/en_US/mails.lang @@ -7,7 +7,7 @@ AllEMailings=All eMailings MailCard=EMailing card MailRecipients=Recipients MailRecipient=Recipient -MailTitle=Description +MailTitle=Label MailFrom=From PhoneFrom=From MailErrorsTo=Errors to From 08a61c542ad9d004b33dcc3a1e7ae9a611c3e734 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 20:53:42 +0100 Subject: [PATCH 31/84] Restore dolPrintLabel --- dev/tools/apstats.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dev/tools/apstats.php b/dev/tools/apstats.php index da238e0f43b..164713fa3bf 100755 --- a/dev/tools/apstats.php +++ b/dev/tools/apstats.php @@ -663,11 +663,11 @@ if (!empty($output_arrtd)) { } else { $tmp .= ''; } - $tmp .= ''; + $tmp .= ''; $tmp .= ''; - $tmp .= ''; + $tmp .= ''; $tmp .= ''."\n"; $nblines++; @@ -700,11 +700,11 @@ if (count($output_phan_json) != 0) { } else { $tmpphan .= ''; } - $tmpphan .= ''; + $tmpphan .= ''; $tmpphan .= ''; - $tmpphan .= ''; + $tmpphan .= ''; $tmpphan .= ''; $tmpphan .= "\n"; From 181c70f1162d90d8b3a61a19789b583604308ac5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 21:53:35 +0100 Subject: [PATCH 32/84] Do not use mysql port on command line if value is 0 --- dev/initdemo/initdemopassword.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/dev/initdemo/initdemopassword.sh b/dev/initdemo/initdemopassword.sh index e2929441e76..b70c97a831e 100755 --- a/dev/initdemo/initdemopassword.sh +++ b/dev/initdemo/initdemopassword.sh @@ -145,12 +145,16 @@ fi # ---------------------------- run sql file +if [ "x$port" != "x0" ] +then + export Pport="-P$port" +fi if [ "x$passwd" != "x" ] then export passwd="-p$passwd" fi -#echo "mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile" -#mysql -P$port -u$admin $passwd $base < $mydir/$dumpfile +#echo "mysql $Pport -u$admin $passwd $base < $mydir/$dumpfile" +#mysql $Pport -u$admin $passwd $base < $mydir/$dumpfile if [ "x${demopasshash}" != "xpassword_hash" ] then @@ -162,19 +166,19 @@ else fi #rm /tmp/tmp.php -echo "echo \"UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';\" | mysql -P$port $base" -echo "UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';" | mysql -P$port $base +echo "echo \"UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';\" | mysql $Pport $base" +echo "UPDATE llx_user SET pass_crypted = '$newpass' WHERE login = '$demologin';" | mysql $Pport $base export res=$? if [ $res -ne 0 ]; then - echo "Error to execute sql with mysql -P$port -u$admin -p***** $base" + echo "Error to execute sql with mysql $Pport -u$admin -p***** $base" exit fi if [ -s "$mydir/initdemopostsql.sql" ]; then echo A file initdemopostsql.sql was found, we execute it. - echo "mysql -P$port $base < \"$mydir/initdemopostsql.sql\"" - mysql -P$port $base < "$mydir/initdemopostsql.sql" + echo "mysql $Pport $base < \"$mydir/initdemopostsql.sql\"" + mysql $Pport $base < "$mydir/initdemopostsql.sql" else echo No file initdemopostsql.sql found, so no extra sql action done. fi From acd8168cb690bf1d3aab9ed14f37db801010a956 Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 25 Feb 2024 22:08:07 +0100 Subject: [PATCH 33/84] Fix: Fix var_dump checker (#28226) * Fix: Fix var_dump checker # Fix: Fix var_dump checker The core issue was that in PHP whitespace includes newlines by default, the m modifier is needed to not match multilines. * Fix: Allow multiple var_dumps on single comment line, refactor # Fix: Allow multiple var_dumps on single comment line, refactor Updated the regex to not match a var_dump preceeded with a comment somewhere on the line. Refactored var_dump check in dedicated method. * Qual: Test the test function ! # Qual: Test the test function ! Test that the test function detecting var_dump does detect them. * Qual: CodingPhpTest - remove comments from file before checking # Qual: CodingPhpTest - remove comments from file before checking This helps remove false positives and may have a positive impact on performance. --------- Co-authored-by: Laurent Destailleur --- test/phpunit/CodingPhpTest.php | 213 +++++++++++++++++++++++++++------ 1 file changed, 177 insertions(+), 36 deletions(-) diff --git a/test/phpunit/CodingPhpTest.php b/test/phpunit/CodingPhpTest.php index 7e134b07bbb..5dd8a43257a 100644 --- a/test/phpunit/CodingPhpTest.php +++ b/test/phpunit/CodingPhpTest.php @@ -131,14 +131,20 @@ class CodingPhpTest extends CommonClassTest //print 'Check php file '.$file['relativename']."\n"; $filecontent = file_get_contents($file['fullname']); - $this->verifyIsModuleEnabledOk($filecontent, "htdocs/{$file['relativename']}"); + // We are not interested in the comments + $filecontent = $this->removePhpComments(file_get_contents($file['fullname'])); + + // File path for reports + $report_filepath = "htdocs/{$file['relativename']}"; + + $this->verifyIsModuleEnabledOk($filecontent, $report_filepath); if (preg_match('/\.class\.php/', $file['relativename']) || preg_match('/boxes\/box_/', $file['relativename']) || preg_match('/modules\/.*\/doc\/(doc|pdf)_/', $file['relativename']) || preg_match('/modules\/(import|mailings|printing)\//', $file['relativename']) || in_array($file['name'], array('modules_boxes.php', 'TraceableDB.php'))) { - // Check into Class files + // Check Class files if (! in_array($file['name'], array( 'api.class.php', 'commonobject.class.php', @@ -152,18 +158,18 @@ class CodingPhpTest extends CommonClassTest // Must not find $db-> $ok = true; $matches = array(); - // Check string $db-> inside a class.php file (it should be $this->db-> into such classes) + // Check string $db-> inside a class.php file (it should be $this->db-> in such classes) preg_match_all('/'.preg_quote('$db->', '/').'/', $filecontent, $matches, PREG_SET_ORDER); foreach ($matches as $key => $val) { $ok = false; break; } //print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n"; - $this->assertTrue($ok, 'Found string $db-> into a .class.php file in '.$file['relativename'].'. Inside a .class file, you should use $this->db-> instead.'); + $this->assertTrue($ok, 'Found string $db-> in a .class.php file in '.$file['relativename'].'. Inside a .class file, you should use $this->db-> instead.'); //exit; } - if (preg_match('/\.class\.php/', $file['relativename']) && ! in_array($file['relativename'], array( + if (preg_match('/\.class\.php$/', $file['relativename']) && ! in_array($file['relativename'], array( 'adherents/canvas/actions_adherentcard_common.class.php', 'contact/canvas/actions_contactcard_common.class.php', 'compta/facture/class/facture.class.php', @@ -191,7 +197,7 @@ class CodingPhpTest extends CommonClassTest // Must not find GETPOST $ok = true; $matches = array(); - // Check string GETPOSTFLOAT a class.php file (should not be found into classes) + // Check string GETPOSTFLOAT a class.php file (should not be found in classes) preg_match_all('/GETPOST\(["\'](....)/', $filecontent, $matches, PREG_SET_ORDER); foreach ($matches as $key => $val) { if (in_array($val[1], array('lang', 'forc', 'mass', 'conf'))) { @@ -201,11 +207,10 @@ class CodingPhpTest extends CommonClassTest $ok = false; break; } - //print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n"; - $this->assertTrue($ok, 'Found string GETPOST into a .class.php file in '.$file['relativename'].'.'); + $this->assertTrue($ok, 'Found string GETPOST in a .class.php file in '.$file['relativename'].'.'); } } else { - // Check into Include files + // Check Include files if (! in_array($file['name'], array( 'objectline_view.tpl.php', 'extrafieldsinexport.inc.php', @@ -216,7 +221,7 @@ class CodingPhpTest extends CommonClassTest // Must not found $this->db-> $ok = true; $matches = array(); - // Check string $this->db-> into a non class.php file (it should be $db-> into such classes) + // Check string $this->db-> in a non class.php file (it should be $db-> in such classes) preg_match_all('/'.preg_quote('$this->db->', '/').'/', $filecontent, $matches, PREG_SET_ORDER); foreach ($matches as $key => $val) { $ok = false; @@ -228,9 +233,9 @@ class CodingPhpTest extends CommonClassTest } } - // Check we don't miss top_httphead() into any ajax pages + // Check we don't miss top_httphead() in any ajax pages if (preg_match('/ajax\//', $file['relativename'])) { - print "Analyze ajax page ".$file['relativename']."\n"; + //print "Analyze ajax page ".$file['relativename']."\n"; $ok = true; $matches = array(); preg_match_all('/top_httphead/', $filecontent, $matches, PREG_SET_ORDER); @@ -238,28 +243,13 @@ class CodingPhpTest extends CommonClassTest $ok = false; } //print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n"; - $this->assertTrue($ok, 'Did not find top_httphead into the ajax page '.$file['relativename']); + $this->assertTrue($ok, 'Did not find top_httphead in the ajax page '.$file['relativename']); //exit; } - // Check if a var_dump has been forgotten + // Check for unauthorised vardumps if (!preg_match('/test\/phpunit/', $file['fullname'])) { - if (! in_array($file['name'], array('class.nusoap_base.php'))) { - $ok = true; - $matches = array(); - preg_match_all('/(.)\s*var_dump\(/', $filecontent, $matches, PREG_SET_ORDER); - //var_dump($matches); - foreach ($matches as $key => $val) { - if ($val[1] != '/' && $val[1] != '*') { - $ok = false; - break; - } - break; - } - //print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n"; - $this->assertTrue($ok, 'Found string var_dump that is not just after /* or // in '.$file['relativename']); - //exit; - } + $this->verifyNoActiveVardump($filecontent, $report_filepath); } // Check get_class followed by __METHOD__ @@ -311,7 +301,7 @@ class CodingPhpTest extends CommonClassTest break; } //print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n"; - $this->assertTrue($ok, 'Found non quoted or not casted var into sql request '.$file['relativename'].' - Bad.'); + $this->assertTrue($ok, 'Found non quoted or not casted var in sql request '.$file['relativename'].' - Bad.'); //exit; // Check that forged sql string is using ' instead of " as string PHP quotes @@ -327,7 +317,7 @@ class CodingPhpTest extends CommonClassTest //if ($reg[0] != 'db') $ok=false; } //print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n"; - $this->assertTrue($ok, 'Found a forged SQL string that mix on same line the use of \' for PHP string and PHP variables into file '.$file['relativename'].' Use " to forge PHP string like this: $sql = "SELECT ".$myvar...'); + $this->assertTrue($ok, 'Found a forged SQL string that mix on same line the use of \' for PHP string and PHP variables in file '.$file['relativename'].' Use " to forge PHP string like this: $sql = "SELECT ".$myvar...'); //exit; // Check that forged sql string is using ' instead of " as string PHP quotes @@ -339,7 +329,7 @@ class CodingPhpTest extends CommonClassTest $ok = false; break; } - $this->assertTrue($ok, 'Found a forged SQL string that mix on same line the use of \' for PHP string and PHP variables into file '.$file['relativename'].' Use " to forge PHP string like this: $sql = "SELECT ".$myvar...'); + $this->assertTrue($ok, 'Found a forged SQL string that mix on same line the use of \' for PHP string and PHP variables in file '.$file['relativename'].' Use " to forge PHP string like this: $sql = "SELECT ".$myvar...'); // Check sql string VALUES ... , ".$xxx // with xxx that is not 'db-' (for $db->escape). It means we forget a ' if string, or an (int) if int, when forging sql request. @@ -358,7 +348,7 @@ class CodingPhpTest extends CommonClassTest break; } //print __METHOD__." Result for checking we don't have non escaped string in sql requests for file ".$file."\n"; - $this->assertTrue($ok, 'Found non quoted or not casted var into sql request '.$file['relativename'].' - Bad.'); + $this->assertTrue($ok, 'Found non quoted or not casted var in sql request '.$file['relativename'].' - Bad.'); //exit; // Check '".$xxx non escaped @@ -514,7 +504,7 @@ class CodingPhpTest extends CommonClassTest break; } } - $this->assertTrue($ok, 'Found a forbidden string sequence into '.$file['relativename'].' : name="token" value="\'.$_SESSION[..., you must use a newToken() instead of $_SESSION[\'newtoken\'].'); + $this->assertTrue($ok, 'Found a forbidden string sequence in '.$file['relativename'].' : name="token" value="\'.$_SESSION[..., you must use a newToken() instead of $_SESSION[\'newtoken\'].'); // Test we don't have preg_grep with a param without preg_quote @@ -589,10 +579,93 @@ class CodingPhpTest extends CommonClassTest $ok = false; break; } - $this->assertTrue($ok, 'Found a CURDATE\(\) into code. Do not use this SQL method in file '.$file['relativename'].'. You must use the PHP function dol_now() instead.'); + $this->assertTrue($ok, 'Found a CURDATE\(\) in code. Do not use this SQL method in file '.$file['relativename'].'. You must use the PHP function dol_now() instead.'); } + /** + * Verify that no active var_dump was left over in the code + * + * @param string $filecontent Contents to check for php code that uses a module name + * @param string $filename File name for the contents (used for reporting) + * + * @return void + */ + private function verifyNoActiveVardump(&$filecontent, $filename) + { + $ok = true; + $matches = array(); + // Match!: + // - Line-start, whitespace, var_dump + // - Line-start, no-comment-leader, var_dump + // no-commen-leader= + // - Any character not / or * + // - Any / not preceded with / and not followed by / or * + // - Any * not preceded with / + preg_match_all('{^(?:^|^(?:[ \t]*|(?:(?:[^*/]|(? $val) { + if (!isset($val[1]) || $val[1] != '/' && $val[1] != '*') { + $ok = false; + $failing_string = $val[0]; + break; + } + } + $this->assertTrue($ok, "Found string var_dump that is not just after /* or // in '$filename': $failing_string"); + } + + + /** + * Provide test data for testing the method detecting var_dump presence. + * + * @return array Test sets + */ + public function vardumpTesterProvider() + { + return [ + 'var_dump at start of file' => ["var_dump(\$help)\n", true], + 'var_dump at start of line' => ["\nvar_dump(\$help)\n", true], + 'var_dump after comment next line' => ["/* Hello */\nvar_dump(\$help)\n", true], + 'var_dump with space' => [" var_dump(\$help)\n", true], + 'var_dump after comment' => [" // var_dump(\$help)\n", false], + '2 var_dumps after comment' => [" // var_dump(\$help); var_dump(\$help)\n", false], + 'var_dump before and after comment' => [" var_dump(\$help); // var_dump(\$help)\n", true], + ]; + } + + /** + * Test that verifyNoActiveVardump generates a notification + * + * @param string $filecontent Fake file content + * @param bool $hasVardump When true, expect var_dump detection + * + * @return void + * + * @dataProvider vardumpTesterProvider + */ + public function testVerifyNoActiveVardump(&$filecontent, $hasVardump) + { + $this->nbLinesToShow = 1; + // Create some dummy file content + $filename = $this->getName(false); + + $notification = false; + ob_start(); // Do not disturb the output with tests that are meant to fail. + try { + $this->verifyNoActiveVardump($filecontent, $filename); + } catch (Throwable $e) { + $notification = (string) $e; + } + $output = ob_get_clean(); + + // Assert that a notification was generated + if ($hasVardump) { + $this->assertStringContainsString("Found string var_dump", $notification ?? '', "Expected notification not found."); + } else { + $this->assertFalse($notification, "Unexpection detection of var_dump"); + } + } + /** * Verify that only known modules are used * @@ -635,4 +708,72 @@ class CodingPhpTest extends CommonClassTest ); } } + + + /** + * Remove php comments from source string + * + * @param string $string The string from which the PHP comments are removed + * + * @return string The string without the comments + */ + private function removePhpComments($string) + { + return preg_replace_callback( + '{(//.*?$)|(/\*.*?\*/)}ms', + static function ($match) { + if (isset($match[2])) { + // Count the number of newline characters in the comment + $num_newlines = substr_count($match[0], "\n"); + // Generate whitespace equivalent to the number of newlines + if ($num_newlines == 0) { + // /* Comment on single line -> space + return " "; + } else { + // /* Comment on multiple lines -> new lines + return str_repeat("\n", $num_newlines); + } + } else { + // Double slash comment, just remove + return ""; + } + }, + $string + ); + } + + /** + * Provide test data for testing the comments remover + * + * @return array Test sets + */ + public function commentRemovalTestProvider() + { + return [ + 'complete line 1' => ["/*Comment complete line*/", " "], + 'complete line 2' => ["// Comment complete line", ""], + 'partial line 1' => ["a/*Comment complete line*/b", "a b"], + 'partial line 2' => ["a// Comment complete line", "a"], + 'multi line full 1' => ["/*Comment\ncomplete line*/", "\n"], + 'multi line full 2' => ["/*Comment\ncomplete line*/\n", "\n\n"], + 'multi line partials 1' => ["a/*Comment\ncomplete line*/b", "a\nb"], + ]; + } + + /** + * Test that comments are properly removed + * + * @param string $source Fake file content + * @param bool $expected When true, expect var_dump detection + * + * @return void + * + * @dataProvider commentRemovalTestProvider + */ + public function testRemovePhpComments(&$source, &$expected) + { + $this->nbLinesToShow = 0; + + $this->assertEquals($expected, $this->removePhpComments($source), "Comments not removed as expected"); + } } From 3f8376c2b875074501cdad5fe48e67c1a22f652a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 22:08:45 +0100 Subject: [PATCH 34/84] fix odt templates lost (#28411) --- htdocs/core/lib/functions2.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index df55b335132..27b78638c33 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1912,7 +1912,7 @@ function getListOfModels($db, $type, $maxfilenamelength = 0) } if (is_dir($tmpdir)) { // all type of template is allowed - $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '', '', 'name', SORT_ASC, 0); + $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '', null, 'name', SORT_ASC, 0); if (count($tmpfiles)) { $listoffiles = array_merge($listoffiles, $tmpfiles); } From a1d90ada653ff911bb8e65aa8ab58028295ce1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 22:09:50 +0100 Subject: [PATCH 35/84] NEW Can setup phone mobile for the main company (#28410) * setup phone mobile for mysoc * clean code --- htdocs/admin/company.php | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index d6981147691..9eb4626c3bc 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -106,13 +106,14 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) $db->begin(); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("name", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ADDRESS", GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TOWN", GETPOST("MAIN_INFO_SOCIETE_TOWN", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_ZIP", GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_REGION", GETPOST("region_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MONNAIE", GETPOST("currency", 'aZ09'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL", GETPOST("tel", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_TEL", GETPOST("phone", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MOBILE", GETPOST("phone_mobile", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_FAX", GETPOST("fax", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_MAIL", GETPOST("mail", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_WEB", GETPOST("web", 'alphanohtml'), 'chaine', 0, '', $conf->entity); @@ -440,18 +441,18 @@ print ''."\n"; +print ''."\n"; // Address print ''."\n"; +print ''."\n"; // Zip print ''."\n"; +print ''."\n"; print ''."\n"; +print ''."\n"; // Country print ''."\n"; // Phone print ''; +print ''; +print ''."\n"; + +// Phone mobile +print ''; print ''."\n"; // Fax print ''; +print ''; print ''."\n"; // Email From 7374dd9c2de80123570be03753c306c90f2ac8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 22:10:04 +0100 Subject: [PATCH 36/84] fix phpstan (#28412) Property CommonObject::$shipping_method_id (int) does not accept string. --- htdocs/reception/class/reception.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 44ff7c4a6fb..ee2587cc04e 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -937,7 +937,7 @@ class Reception extends CommonObject $this->fk_user_valid = trim($this->fk_user_valid); } if (isset($this->shipping_method_id)) { - $this->shipping_method_id = trim($this->shipping_method_id); + $this->shipping_method_id = (int) $this->shipping_method_id; } if (isset($this->tracking_number)) { $this->tracking_number = trim($this->tracking_number); From 75131fcc8f96f8bf00e148a6bd1f6b83b5b74390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 22:10:38 +0100 Subject: [PATCH 37/84] fix phpstan (#28414) Default value of the parameter #7 $save_lastsearch_value (string) of method Categorie::getNomUrl() is incompatible with type int. --- htdocs/categories/class/categorie.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 9fb167e4e46..0037dc520cf 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -10,7 +10,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Charlie Benke - * Copyright (C) 2018-2023 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023 Benjamin Falière * * This program is free software; you can redistribute it and/or modify @@ -1707,7 +1707,7 @@ class Categorie extends CommonObject * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking * @return string Chaine avec URL */ - public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $moreparam = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = '') + public function getNomUrl($withpicto = 0, $option = '', $maxlength = 0, $moreparam = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = 0) { global $conf, $langs, $hookmanager; From 0d60041d8fdc8389170fe0e1e5177ae093a500ff Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 25 Feb 2024 22:11:25 +0100 Subject: [PATCH 38/84] Qual: Add custom phan plugin to detect var_dump (#28420) # Qual: Add custom phan plugin to detect var_dump This adds a custom plugin to detect the presence of var_dump. Also disable a standard plugin in the extended configuration (avoid reporting suggestions to add typing to the function definitions (/declarations). --- dev/tools/phan/config.php | 11 +-- dev/tools/phan/config_extended.php | 12 ++-- dev/tools/phan/plugins/NoVarDumpPlugin.php | 81 ++++++++++++++++++++++ 3 files changed, 95 insertions(+), 9 deletions(-) create mode 100644 dev/tools/phan/plugins/NoVarDumpPlugin.php diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 9821b5049b7..1dc71344d2d 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -83,6 +83,7 @@ return [ // Alternately, you can pass in the full path to a PHP file // with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php') 'plugins' => [ + __DIR__.'/plugins/NoVarDumpPlugin.php', // checks if a function, closure or method unconditionally returns. // can also be written as 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php' //'DeprecateAliasPlugin', @@ -149,9 +150,13 @@ return [ 'PhanPluginShortArray', 'PhanPluginNumericalComparison', 'PhanPluginUnknownObjectMethodCall', - 'PhanPluginCanUseParamType', 'PhanPluginNonBoolInLogicalArith', - 'PhanPluginCanUseReturnType', + // Fixers From PHPDocToRealTypesPlugin: + 'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string) + 'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string) + 'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition + 'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition + // 'PhanPluginNotFullyQualifiedFunctionCall', 'PhanPluginConstantVariableScalar', // 'PhanPluginNoCommentOnPublicProperty', @@ -166,7 +171,6 @@ return [ 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgumentInternal', 'PhanPluginDuplicateAdjacentStatement', - 'PhanPluginCanUseNullableParamType', 'PhanTypeInvalidLeftOperandOfNumericOp', 'PhanTypeMismatchProperty', // 'PhanPluginNoCommentOnPublicMethod', @@ -190,7 +194,6 @@ return [ 'PhanTypeInvalidLeftOperandOfAdd', // 'PhanPluginNoCommentOnPrivateProperty', // 'PhanPluginNoCommentOnFunction', - 'PhanPluginCanUseNullableReturnType', 'PhanPluginUnknownArrayFunctionParamType', // 'PhanPluginDescriptionlessCommentOnPublicProperty', 'PhanPluginUnknownFunctionParamType', diff --git a/dev/tools/phan/config_extended.php b/dev/tools/phan/config_extended.php index 2e748430fe2..9a721355daf 100644 --- a/dev/tools/phan/config_extended.php +++ b/dev/tools/phan/config_extended.php @@ -83,6 +83,7 @@ return [ // Alternately, you can pass in the full path to a PHP file // with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php') 'plugins' => [ + __DIR__.'/plugins/NoVarDumpPlugin.php', 'DeprecateAliasPlugin', //'EmptyMethodAndFunctionPlugin', 'InvalidVariableIssetPlugin', @@ -102,7 +103,7 @@ return [ 'NonBoolBranchPlugin', // Requires test on bool, nont on ints 'NonBoolInLogicalArithPlugin', 'NumericalComparisonPlugin', - 'PHPDocToRealTypesPlugin', + // 'PHPDocToRealTypesPlugin', // Report/Add types to function definitions 'PHPDocInWrongCommentPlugin', // Missing /** (/* was used) //'ShortArrayPlugin', // Checks that [] is used //'StrictLiteralComparisonPlugin', @@ -138,10 +139,11 @@ return [ 'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility 'PhanPluginShortArray', // Dolibarr uses array() 'PhanPluginShortArrayList', // Dolibarr uses array() - // The following may require that --quick is not used - 'PhanPluginCanUseParamType', // Does not seem useful: is reporting types already in PHPDoc? - 'PhanPluginCanUseReturnType', // Does not seem useful: is reporting types already in PHPDoc? - 'PhanPluginCanUseNullableParamType', // Does not seem useful: is reporting types already in PHPDoc? + // Fixers From PHPDocToRealTypesPlugin: + 'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string) + 'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string) + 'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition + 'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition 'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences 'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences 'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences diff --git a/dev/tools/phan/plugins/NoVarDumpPlugin.php b/dev/tools/phan/plugins/NoVarDumpPlugin.php new file mode 100644 index 00000000000..b2b093922f7 --- /dev/null +++ b/dev/tools/phan/plugins/NoVarDumpPlugin.php @@ -0,0 +1,81 @@ + + */ + +declare(strict_types=1); + +use ast\Node; +use Phan\PluginV3; +use Phan\PluginV3\PluginAwarePostAnalysisVisitor; +use Phan\PluginV3\PostAnalyzeNodeCapability; + +/** + * NoVarDumpPlugin hooks into one event: + * + * - getPostAnalyzeNodeVisitorClassName + * This method returns a visitor that is called on every AST node from every + * file being analyzed + * + * A plugin file must + * + * - Contain a class that inherits from \Phan\PluginV3 + * + * - End by returning an instance of that class. + * + * It is assumed without being checked that plugins aren't + * mangling state within the passed code base or context. + * + * Note: When adding new plugins, + * add them to the corresponding section of README.md + */ +class NoVarDumpPlugin extends PluginV3 implements PostAnalyzeNodeCapability +{ + /** + * @return string - name of PluginAwarePostAnalysisVisitor subclass + */ + public static function getPostAnalyzeNodeVisitorClassName(): string + { + return NoVarDumpVisitor::class; + } +} + +/** + * When __invoke on this class is called with a node, a method + * will be dispatched based on the `kind` of the given node. + * + * Visitors such as this are useful for defining lots of different + * checks on a node based on its kind. + */ +class NoVarDumpVisitor extends PluginAwarePostAnalysisVisitor +{ + // A plugin's visitors should not override visit() unless they need to. + + /** + * @param Node $node A node to analyze + * + * @return void + * + * @override + */ + public function visitCall(Node $node): void + { + $name = $node->children['expr']->children['name'] ?? null; + if (!is_string($name)) { + return; + } + if (strcasecmp($name, 'var_dump') !== 0) { + return; + } + $this->emitPluginIssue( + $this->code_base, + $this->context, + 'NoVarDumpPlugin', + 'var_dump() should be commented in submitted code', + [] + ); + } +} + +// Every plugin needs to return an instance of itself at the +// end of the file in which it's defined. +return new NoVarDumpPlugin(); From aa25dc5bdc0bdd1b99094136f943e17f529d39f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 22:11:44 +0100 Subject: [PATCH 39/84] fix phpstan (#28417) Default value of the parameter #2 $array_options (int) of method Delivery::update_line() is incompatible with type array. --- htdocs/delivery/class/delivery.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 26cea82e0d7..1dfc406a9b9 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2011-2023 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2015 Marcos García - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -599,10 +599,10 @@ class Delivery extends CommonObject * Update a livraison line (only extrafields) * * @param int $id Id of line (livraison line) - * @param array $array_options extrafields array + * @param array $array_options extrafields array * @return int Return integer <0 if KO, >0 if OK */ - public function update_line($id, $array_options = 0) + public function update_line($id, $array_options = []) { // phpcs:enable global $conf; From 6ab63d4f3379093752c4c475503ae615364cbbe3 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+BB2A-Anthony@users.noreply.github.com> Date: Sun, 25 Feb 2024 22:12:32 +0100 Subject: [PATCH 40/84] look and feel yes no (#28421) Co-authored-by: Anthony Berton --- htdocs/commande/list.php | 2 +- htdocs/core/lib/functions.lib.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index d471e9d7ca4..de9e0bd9892 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -2727,7 +2727,7 @@ while ($i < $imaxinloop) { // Billed if (!empty($arrayfields['c.facture']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c8b7adbb9aa..9af757a62ea 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7235,6 +7235,9 @@ function yn($yesno, $case = 1, $color = 0) if ($case == 3) { $result = ' '.$result; } + if ($case == 4) { + $result = img_picto('check', 'check'); + } $classname = 'ok'; } elseif ($yesno == 0 || strtolower($yesno) == 'no' || strtolower($yesno) == 'false') { @@ -7248,6 +7251,9 @@ function yn($yesno, $case = 1, $color = 0) if ($case == 3) { $result = ' '.$result; } + if ($case == 4) { + $result = img_picto('uncheck', 'uncheck'); + } if ($color == 2) { $classname = 'ok'; From 0de5807423c9498e8783c89c60d3d7b091b3c9fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 22:14:02 +0100 Subject: [PATCH 41/84] fix phpstan (#28416) Default value of the parameter #8 $filterkey (string) of method FormResource::select_resource_list() is incompatible with type array. --- htdocs/resource/class/html.formresource.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php index 0241e62a8fc..425ee481964 100644 --- a/htdocs/resource/class/html.formresource.class.php +++ b/htdocs/resource/class/html.formresource.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2022 Ferran Marcet * Copyright (C) 2023 William Mead * @@ -80,7 +80,7 @@ class FormResource * @param bool $multiple add [] in the name of element and add 'multiple' attribute * @return string|array HTML string with */ - public function select_resource_list($selected = 0, $htmlname = 'fk_resource', array $filter = [], $showempty = 0, $showtype = 0, $forcecombo = 0, $event = [], $filterkey = '', $outputmode = 0, $limit = 20, $morecss = '', $multiple = false) + public function select_resource_list($selected = 0, $htmlname = 'fk_resource', array $filter = [], $showempty = 0, $showtype = 0, $forcecombo = 0, $event = [], $filterkey = [], $outputmode = 0, $limit = 20, $morecss = '', $multiple = false) { // phpcs:enable global $conf, $user, $langs; From 3d3ef247c559854892d98d7a24e1a358c996972b Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 25 Feb 2024 22:14:39 +0100 Subject: [PATCH 42/84] Fix: Replace deprecated php aliases with actual functions (#28419) * Fix: Handle facture modulepart depr + optimise # Fix: Handle facture modulepart depr + optimise Add a case for 'facture' to 'invoice' conversion for the 'modulepart' (issue seen when introducing DolDeprationHandler). Use elseif for optimisation. * Fix: Replace deprecated php aliases with actual functions # Fix: Replace deprecated php aliases with actual functions Replacements of join with implode. * Fix: Replace deprecated php aliases with actual functions # Fix: Replace deprecated php aliases with actual functions Replacements of join with implode. * Fix: Replace deprecated php aliases with actual functions # Fix: Replace deprecated php aliases with actual functions Replacements of join with implode. --- htdocs/core/lib/files.lib.php | 12 +- .../fourn/class/fournisseur.facture.class.php | 106 +++++++++--------- htdocs/product/stats/commande.php | 4 +- htdocs/product/stats/commande_fournisseur.php | 2 +- 4 files changed, 62 insertions(+), 62 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index eb113f1ddb9..bc316e5b80f 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2660,14 +2660,14 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, } } // Fix modulepart for backward compatibility - if ($modulepart == 'users') { + if ($modulepart == 'facture') { + $modulepart = 'invoice'; + } elseif ($modulepart == 'users') { $modulepart = 'user'; - } - if ($modulepart == 'tva') { + } elseif ($modulepart == 'tva') { $modulepart = 'tax-vat'; - } - // Fix modulepart delivery - if ($modulepart == 'expedition' && strpos($original_file, 'receipt/') === 0) { + } elseif ($modulepart == 'expedition' && strpos($original_file, 'receipt/') === 0) { + // Fix modulepart delivery $modulepart = 'delivery'; } diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 8c004650de0..5216aa24d81 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -250,55 +250,55 @@ class FactureFournisseur extends CommonInvoice public $fk_fac_rec_source; public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'showoncombobox'=>1, 'position'=>15), - 'ref_supplier' =>array('type'=>'varchar(255)', 'label'=>'RefSupplier', 'enabled'=>1, 'visible'=>-1, 'position'=>20), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>25, 'index'=>1), - 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>30), - 'type' =>array('type'=>'smallint(6)', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>35), - 'subtype' =>array('type'=>'smallint(6)', 'label'=>'InvoiceSubtype', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>36), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'isModEnabled("societe")', 'visible'=>-1, 'notnull'=>1, 'position'=>40), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>45), - 'datef' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>50), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>55), - 'libelle' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>-1, 'position'=>60), - 'paye' =>array('type'=>'smallint(6)', 'label'=>'Paye', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>65), - 'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>70), - 'remise' =>array('type'=>'double(24,8)', 'label'=>'Discount', 'enabled'=>1, 'visible'=>-1, 'position'=>75), - 'close_code' =>array('type'=>'varchar(16)', 'label'=>'CloseCode', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'close_note' =>array('type'=>'varchar(128)', 'label'=>'CloseNote', 'enabled'=>1, 'visible'=>-1, 'position'=>85), - 'tva' =>array('type'=>'double(24,8)', 'label'=>'Tva', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'Localtax1', 'enabled'=>1, 'visible'=>-1, 'position'=>95), - 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'Localtax2', 'enabled'=>1, 'visible'=>-1, 'position'=>100), - 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'TotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>105), - 'total_tva' =>array('type'=>'double(24,8)', 'label'=>'TotalVAT', 'enabled'=>1, 'visible'=>-1, 'position'=>110), - 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'TotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>115), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>125), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>130), - 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>135), - 'fk_facture_source' =>array('type'=>'integer', 'label'=>'Fk facture source', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>145), - 'fk_account' =>array('type'=>'integer', 'label'=>'Account', 'enabled'=>'isModEnabled("banque")', 'visible'=>-1, 'position'=>150), - 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>-1, 'position'=>155), - 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>-1, 'position'=>160), - 'date_lim_reglement' =>array('type'=>'date', 'label'=>'DateLimReglement', 'enabled'=>1, 'visible'=>-1, 'position'=>165), - 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>170), - 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>175), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPdf', 'enabled'=>1, 'visible'=>0, 'position'=>180), - 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>190), - 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>1, 'visible'=>-1, 'position'=>195), - 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLocation', 'enabled'=>1, 'visible'=>-1, 'position'=>200), - 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'MulticurrencyId', 'enabled'=>1, 'visible'=>-1, 'position'=>205), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'MulticurrencyCode', 'enabled'=>1, 'visible'=>-1, 'position'=>210), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyRate', 'enabled'=>1, 'visible'=>-1, 'position'=>215), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyTotalHT', 'enabled'=>1, 'visible'=>-1, 'position'=>220), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyTotalVAT', 'enabled'=>1, 'visible'=>-1, 'position'=>225), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyTotalTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>230), - 'date_pointoftax' =>array('type'=>'date', 'label'=>'Date pointoftax', 'enabled'=>1, 'visible'=>-1, 'position'=>235), - 'date_valid' =>array('type'=>'date', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>240), - 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'Last main doc', 'enabled'=>1, 'visible'=>-1, 'position'=>245), - 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>500), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'ref' => array('type' => 'varchar(255)', 'label' => 'Ref', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'showoncombobox' => 1, 'position' => 15), + 'ref_supplier' => array('type' => 'varchar(255)', 'label' => 'RefSupplier', 'enabled' => 1, 'visible' => -1, 'position' => 20), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 25, 'index' => 1), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 30), + 'type' => array('type' => 'smallint(6)', 'label' => 'Type', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 35), + 'subtype' => array('type' => 'smallint(6)', 'label' => 'InvoiceSubtype', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 36), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'notnull' => 1, 'position' => 40), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 45), + 'datef' => array('type' => 'date', 'label' => 'Date', 'enabled' => 1, 'visible' => -1, 'position' => 50), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 55), + 'libelle' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'visible' => -1, 'position' => 60), + 'paye' => array('type' => 'smallint(6)', 'label' => 'Paye', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 65), + 'amount' => array('type' => 'double(24,8)', 'label' => 'Amount', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 70), + 'remise' => array('type' => 'double(24,8)', 'label' => 'Discount', 'enabled' => 1, 'visible' => -1, 'position' => 75), + 'close_code' => array('type' => 'varchar(16)', 'label' => 'CloseCode', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'close_note' => array('type' => 'varchar(128)', 'label' => 'CloseNote', 'enabled' => 1, 'visible' => -1, 'position' => 85), + 'tva' => array('type' => 'double(24,8)', 'label' => 'Tva', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'localtax1' => array('type' => 'double(24,8)', 'label' => 'Localtax1', 'enabled' => 1, 'visible' => -1, 'position' => 95), + 'localtax2' => array('type' => 'double(24,8)', 'label' => 'Localtax2', 'enabled' => 1, 'visible' => -1, 'position' => 100), + 'total_ht' => array('type' => 'double(24,8)', 'label' => 'TotalHT', 'enabled' => 1, 'visible' => -1, 'position' => 105), + 'total_tva' => array('type' => 'double(24,8)', 'label' => 'TotalVAT', 'enabled' => 1, 'visible' => -1, 'position' => 110), + 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'TotalTTC', 'enabled' => 1, 'visible' => -1, 'position' => 115), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -1, 'position' => 125), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 130), + 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 135), + 'fk_facture_source' => array('type' => 'integer', 'label' => 'Fk facture source', 'enabled' => 1, 'visible' => -1, 'position' => 140), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label' => 'Project', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 145), + 'fk_account' => array('type' => 'integer', 'label' => 'Account', 'enabled' => 'isModEnabled("banque")', 'visible' => -1, 'position' => 150), + 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'PaymentTerm', 'enabled' => 1, 'visible' => -1, 'position' => 155), + 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'PaymentMode', 'enabled' => 1, 'visible' => -1, 'position' => 160), + 'date_lim_reglement' => array('type' => 'date', 'label' => 'DateLimReglement', 'enabled' => 1, 'visible' => -1, 'position' => 165), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 170), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 175), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'ModelPdf', 'enabled' => 1, 'visible' => 0, 'position' => 180), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 190), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => 1, 'visible' => -1, 'position' => 195), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLocation', 'enabled' => 1, 'visible' => -1, 'position' => 200), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'MulticurrencyId', 'enabled' => 1, 'visible' => -1, 'position' => 205), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'MulticurrencyCode', 'enabled' => 1, 'visible' => -1, 'position' => 210), + 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyRate', 'enabled' => 1, 'visible' => -1, 'position' => 215), + 'multicurrency_total_ht' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyTotalHT', 'enabled' => 1, 'visible' => -1, 'position' => 220), + 'multicurrency_total_tva' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyTotalVAT', 'enabled' => 1, 'visible' => -1, 'position' => 225), + 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyTotalTTC', 'enabled' => 1, 'visible' => -1, 'position' => 230), + 'date_pointoftax' => array('type' => 'date', 'label' => 'Date pointoftax', 'enabled' => 1, 'visible' => -1, 'position' => 235), + 'date_valid' => array('type' => 'date', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 240), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'Last main doc', 'enabled' => 1, 'visible' => -1, 'position' => 245), + 'fk_statut' => array('type' => 'smallint(6)', 'label' => 'Status', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 500), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 900), ); @@ -1350,7 +1350,7 @@ class FactureFournisseur extends CommonInvoice $facligne->rang = 1; $linecount = count($this->lines); for ($ii = 1; $ii <= $linecount; $ii++) { - $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii+1); + $this->updateRangOfLine($this->lines[$ii - 1]->id, $ii + 1); } } @@ -2658,7 +2658,7 @@ class FactureFournisseur extends CommonInvoice } if ($qualified) { $paymentornot = ($obj->fk_paiementfourn ? 1 : 0); - $return[$obj->rowid] = array('ref'=>$obj->ref, 'status'=>$obj->fk_statut, 'type'=>$obj->type, 'paye'=>$obj->paye, 'paymentornot'=>$paymentornot); + $return[$obj->rowid] = array('ref' => $obj->ref, 'status' => $obj->fk_statut, 'type' => $obj->type, 'paye' => $obj->paye, 'paymentornot' => $paymentornot); } } @@ -2922,7 +2922,7 @@ class FactureFournisseur extends CommonInvoice } global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -3689,7 +3689,7 @@ class FactureFournisseur extends CommonInvoice return 0; } else { - $this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg)) ? join(', ', $errorsMsg) : $error; + $this->error = 'Nb of emails sent : '.$nbMailSend.', '.(!empty($errorsMsg)) ? implode(', ', $errorsMsg) : $error; dol_syslog(__METHOD__." end - ".$this->error, LOG_INFO); diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 3532afb8116..eedd1cb47c8 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -69,7 +69,7 @@ if (!$sortfield) { $search_month = GETPOST('search_month', 'int'); $search_year = GETPOST('search_year', 'int'); if (GETPOSTISARRAY('search_status')) { - $search_status = join(',', GETPOST('search_status', 'array:intcomma')); + $search_status = implode(',', GETPOST('search_status', 'array:intcomma')); } else { $search_status = (GETPOST('search_status', 'intcomma') != '' ? GETPOST('search_status', 'intcomma') : GETPOST('statut', 'intcomma')); } @@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) { $object = $product; - $parameters = array('id'=>$id); + $parameters = array('id' => $id); $reshook = $hookmanager->executeHooks('doActions', $parameters, $product, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index a76c572af19..44e35990683 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -69,7 +69,7 @@ if (!$sortfield) { $search_month = GETPOST('search_month', 'int'); $search_year = GETPOST('search_year', 'int'); if (GETPOSTISARRAY('search_status')) { - $search_status = join(',', GETPOST('search_status', 'array:intcomma')); + $search_status = implode(',', GETPOST('search_status', 'array:intcomma')); } else { $search_status = (GETPOST('search_status', 'intcomma') != '' ? GETPOST('search_status', 'intcomma') : GETPOST('statut', 'intcomma')); } From 991b39c8a013eee70f4799808a12cd86525dda21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 25 Feb 2024 22:14:55 +0100 Subject: [PATCH 43/84] fix phpstan (#28422) --- htdocs/projet/class/task.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index ff079efe387..265f218fc53 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2008-2014 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2014 Marcos García - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2020 Juanjo Menent * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Gauthier VERDOL @@ -903,14 +903,14 @@ class Task extends CommonObjectLine { $this->id = 0; - $this->fk_project = ''; + $this->fk_project = 0; $this->ref = 'TK01'; - $this->fk_task_parent = null; + $this->fk_task_parent = 0; $this->label = 'Specimen task TK01'; $this->duration_effective = ''; - $this->fk_user_creat = null; + $this->fk_user_creat = 1; $this->progress = '25'; - $this->status = null; + $this->status = 0; $this->note = 'This is a specimen task not'; } From d8e12140e059f1489b0cc17281128852babf2947 Mon Sep 17 00:00:00 2001 From: MDW Date: Sun, 25 Feb 2024 22:16:32 +0100 Subject: [PATCH 44/84] Fix: Handle facture modulepart depr + optimise (#28418) # Fix: Handle facture modulepart depr + optimise Add a case for 'facture' to 'invoice' conversion for the 'modulepart' (issue seen when introducing DolDeprationHandler). Use elseif for optimisation. From 9b8d39267a152c7aaa50b555d9f4753de58fc9e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 23:49:20 +0100 Subject: [PATCH 45/84] Debug v20 --- htdocs/core/customreports.php | 7 ++++++- htdocs/core/lib/functions.lib.php | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 950f6f8d684..816652f01ff 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -111,6 +111,7 @@ $arrayoftype = array( 'cotisation' => array('label' => 'Subscriptions', 'picto'=>'member', 'ObjectClassName' => 'Subscription', 'enabled' => isModEnabled('adherent'), 'ClassPath' => "/adherents/class/subscription.class.php", 'langs'=>'members'), ); + // Complete $arrayoftype by external modules $parameters = array('objecttype'=>$objecttype, 'tabfamily'=>$tabfamily); $reshook = $hookmanager->executeHooks('loadDataForCustomReports', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks @@ -302,7 +303,11 @@ $formother = new FormOther($db); if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) { llxHeader('', $langs->transnoentitiesnoconv('CustomReports'), ''); - print dol_get_fiche_head($head, 'customreports', $title, -1, $picto); + if (empty($head)) { + print dol_get_fiche_head($head, 'customreports', $title, -2, $picto); + } else { + print dol_get_fiche_head($head, 'customreports', $title, -1, $picto); + } } $newarrayoftype = array(); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index c8b7adbb9aa..779359719e5 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2164,7 +2164,7 @@ function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0 * @param array $links Array of tabs (0=>url, 1=>label, 2=>code, 3=>not used, 4=>text after link, 5=>morecssonlink). Currently initialized by calling a function xxx_admin_prepare_head. Note that label into $links[$i][1] must be already HTML escaped. * @param string $active Active tab name * @param string $title Title - * @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no seaparation under tab (to start a tab just after), -3=-2+'noborderbottom' + * @param int $notab -1 or 0=Add tab header, 1=no tab header (if you set this to 1, using print dol_get_fiche_end() to close tab is not required), -2=Add tab header with no separation under tab (to start a tab just after), -3=-2+'noborderbottom' * @param string $picto Add a picto on tab title * @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto. * @param string $morehtmlright Add more html content on right of tabs title @@ -2340,7 +2340,8 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab } if (!$notab || $notab == -1 || $notab == -2 || $notab == -3) { - $out .= "\n".'
'."\n"; + $out .= "\n".'
'."\n"; } if (!empty($dragdropfile)) { include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; From 7d4334a353223b5ee1f7e9ca226fa7fc552a69f4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 25 Feb 2024 23:58:37 +0100 Subject: [PATCH 46/84] Fix when first label is '0' --- htdocs/core/customreports.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 816652f01ff..f503e647dff 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -940,7 +940,7 @@ if ($sql) { } $labeltouse = (($xlabel || $xlabel == '0') ? dol_trunc($xlabel, 20, 'middle') : ($xlabel === '' ? $langs->transnoentitiesnoconv("Empty") : $langs->transnoentitiesnoconv("NotDefined"))); - if ($oldlabeltouse && ($labeltouse != $oldlabeltouse)) { + if ($oldlabeltouse !== '' && ($labeltouse != $oldlabeltouse)) { $xi++; // Increase $xi } //var_dump($labeltouse.' '.$oldlabeltouse.' '.$xi); From 3e801c94ff88d4267fe80b1001bb5dc2a5db5cb6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Feb 2024 13:43:34 +0100 Subject: [PATCH 47/84] NEW Look and field: The operator 'or' on category filter visible only when 2+ categories --- htdocs/core/class/html.formcategory.class.php | 20 +++++++++++++++---- htdocs/langs/en_US/main.lang | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/html.formcategory.class.php b/htdocs/core/class/html.formcategory.class.php index 19530933d86..5841f5035e1 100644 --- a/htdocs/core/class/html.formcategory.class.php +++ b/htdocs/core/class/html.formcategory.class.php @@ -35,7 +35,7 @@ class FormCategory extends Form * @param string $type The categorie type (e.g Categorie::TYPE_WAREHOUSE) * @param array $preSelected A list with the elements that should pre-selected * @param string $morecss More CSS - * @param int $searchCategoryProductOperator 0 or 1 to enable the checkbox to search with a or (0=not preseleted, 1=preselected), -1=Not used + * @param int $searchCategoryProductOperator Used only if $multiselect is 1. Set to 0 or 1 to enable the checkbox to search with a or (0=not preseleted, 1=preselected), -1=Checkbox never shown. * @param int $multiselect 0 or 1 * @param int $nocateg 1=Add an entry '- No Category -' * @param string $showempty 1 or 'string' to add an empty entry @@ -75,11 +75,23 @@ class FormCategory extends Form $filter .= $formother->select_categories($type, $preSelected[0], $htmlName, $nocateg, $tmptitle, $morecss); } - if ($searchCategoryProductOperator >= 0) { - $filter .= ' '; - $filter .= '
"; diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index d603986da72..685acf120c2 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1272,4 +1272,4 @@ Settings=Settings FillMessageWithALayout=Fill message with a layout FillMessageWithAIContent=Fill message with AI content EnterYourAIPromptHere=Enter your AI prompt here -UseOrOperatorShort=Use 'or' +UseOrOperatorShort=or From 1141cdca18e1b09285b765cba81dd73ada39951a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Feb 2024 14:16:24 +0100 Subject: [PATCH 48/84] Link to whatsapp --- htdocs/install/mysql/data/llx_c_socialnetworks.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_socialnetworks.sql b/htdocs/install/mysql/data/llx_c_socialnetworks.sql index 2283832a98f..a5800230cab 100644 --- a/htdocs/install/mysql/data/llx_c_socialnetworks.sql +++ b/htdocs/install/mysql/data/llx_c_socialnetworks.sql @@ -57,7 +57,7 @@ INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'viadeo', 'Viadeo', 'https://fr.viadeo.com/fr/{socialid}', 'fa-viadeo', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'viber', 'Viber', '{socialid}', '', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'vimeo', 'Vimeo', '{socialid}', 'fa-vimeo', 0); -INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'whatsapp', 'Whatsapp', '{socialid}', 'fa-whatsapp', 1); +INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'whatsapp', 'Whatsapp', 'https://web.whatsapp.com/send?phone={socialid}', 'fa-whatsapp', 1); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'wikipedia', 'Wikipedia', '{socialid}', 'fa-wikipedia-w', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'xing', 'Xing', '{socialid}', 'fa-xing', 0); INSERT INTO llx_c_socialnetworks (entity, code, label, url, icon, active) VALUES ( 1, 'youtube', 'Youtube', 'https://www.youtube.com/{socialid}', 'fa-youtube', 1); From fa2cfb97b16aa950ccf08c947989fd88f3022609 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Feb 2024 15:02:39 +0100 Subject: [PATCH 49/84] Fix bad parameter for GETPOST --- htdocs/admin/mails.php | 4 ++-- htdocs/admin/mails_emailing.php | 4 ++-- htdocs/admin/mails_ticket.php | 8 ++++---- htdocs/admin/menus/edit.php | 2 +- htdocs/comm/propal/stats/index.php | 4 ++-- htdocs/commande/stats/index.php | 4 ++-- htdocs/compta/facture/card.php | 4 ++-- htdocs/compta/facture/stats/index.php | 4 ++-- htdocs/core/actions_massactions.inc.php | 2 +- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 2 +- htdocs/modulebuilder/admin/setup.php | 2 +- htdocs/mrp/mo_card.php | 2 +- htdocs/projet/tasks/time.php | 2 +- htdocs/reception/card.php | 2 +- htdocs/webportal/class/controller.class.php | 6 +++--- .../webportal/controllers/document.controller.class.php | 2 ++ 16 files changed, 28 insertions(+), 26 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index 443e5eb2e8f..cdda45c2a90 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -99,10 +99,10 @@ if ($action == 'update' && !$cancel) { dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW", GETPOST("MAIN_MAIL_SMTPS_PW", 'none'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET("MAIN_MAIL_SMTPS_AUTH_TYPE")) { - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_AUTH_TYPE", GETPOST("MAIN_MAIL_SMTPS_AUTH_TYPE", 'chaine'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_AUTH_TYPE", GETPOST("MAIN_MAIL_SMTPS_AUTH_TYPE", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET("MAIN_MAIL_SMTPS_OAUTH_SERVICE")) { - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE", 'chaine'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOST("MAIN_MAIL_EMAIL_TLS", 'int'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOST("MAIN_MAIL_EMAIL_STARTTLS", 'int'), 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php index bf619d5f554..059a99a7a1b 100644 --- a/htdocs/admin/mails_emailing.php +++ b/htdocs/admin/mails_emailing.php @@ -88,10 +88,10 @@ if ($action == 'update' && !$cancel) { dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW_EMAILING", GETPOST("MAIN_MAIL_SMTPS_PW_EMAILING", 'none'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET("MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING")) { - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING", GETPOST("MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING", 'chaine'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING", GETPOST("MAIN_MAIL_SMTPS_AUTH_TYPE_EMAILING", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET("MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING")) { - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING", 'chaine'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE_EMAILING", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_TLS_EMAILING"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_EMAILING", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_EMAILING"), 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/mails_ticket.php b/htdocs/admin/mails_ticket.php index fbb5edddfc3..dd9f63c3ef6 100644 --- a/htdocs/admin/mails_ticket.php +++ b/htdocs/admin/mails_ticket.php @@ -86,10 +86,10 @@ if ($action == 'update' && !$cancel) { dolibarr_set_const($db, "MAIN_MAIL_SMTPS_PW_TICKET", GETPOST("MAIN_MAIL_SMTPS_PW_TICKET", 'none'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET("MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET")) { - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET", GETPOST("MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET", 'chaine'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET", GETPOST("MAIN_MAIL_SMTPS_AUTH_TYPE_TICKET", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET("MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET")) { - dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET", 'chaine'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE_TICKET", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS_TICKET", GETPOST("MAIN_MAIL_EMAIL_TLS_TICKET"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_TICKET", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_TICKET"), 'chaine', 0, '', $conf->entity); @@ -672,8 +672,8 @@ if ($action == 'edit') { // Cree l'objet formulaire mail include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; $formmail = new FormMail($db); - $formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM); - $formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM); + $formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : getDolGlobalString('MAIN_MAIL_EMAIL_FROM')); + $formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : getDolGlobalString('MAIN_MAIL_EMAIL_FROM')); $formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test"); $formmail->fromid = $user->id; $formmail->fromalsorobot = 1; diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 95de2e96b99..3b680f93a7b 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -362,7 +362,7 @@ if ($action == 'create') { // Picto print '
'; - print ''; + print ''; // URL print ''; diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 4e0a4071ae0..3603f89af2a 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -41,8 +41,8 @@ $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); $mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer'; $object_status = GETPOST('object_status', 'intcomma'); -$typent_id = GETPOST('typent_id', 'int'); -$categ_id = GETPOST('categ_id', 'categ_id'); +$typent_id = GETPOSTINT('typent_id'); +$categ_id = GETPOSTINT('categ_id'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php index f7da50833e1..1a06944f272 100644 --- a/htdocs/commande/stats/index.php +++ b/htdocs/commande/stats/index.php @@ -62,8 +62,8 @@ if ($mode == 'supplier') { } -$typent_id = GETPOST('typent_id', 'int'); -$categ_id = GETPOST('categ_id', 'categ_id'); +$typent_id = GETPOSTINT('typent_id'); +$categ_id = GETPOSTINT('categ_id'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 091af287d69..f1ae8948052 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -442,13 +442,13 @@ if (empty($reshook)) { } } elseif ($action == 'setretainedwarranty' && $user->hasRight('facture', 'creer')) { $object->fetch($id); - $result = $object->setRetainedWarranty(GETPOST('retained_warranty', 'float')); + $result = $object->setRetainedWarranty(GETPOSTFLOAT('retained_warranty')); if ($result < 0) { dol_print_error($db, $object->error); } } elseif ($action == 'setretainedwarrantydatelimit' && $user->hasRight('facture', 'creer')) { $object->fetch($id); - $result = $object->setRetainedWarrantyDateLimit(GETPOST('retained_warranty_date_limit', 'float')); + $result = $object->setRetainedWarrantyDateLimit(GETPOSTFLOAT('retained_warranty_date_limit')); if ($result < 0) { dol_print_error($db, $object->error); } diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 4ae358d682d..f98216140f9 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -52,8 +52,8 @@ if ($mode == 'supplier' && !$user->hasRight('fournisseur', 'facture', 'lire')) { } $object_status = GETPOST('object_status', 'intcomma'); -$typent_id = GETPOST('typent_id', 'int'); -$categ_id = GETPOST('categ_id', 'categ_id'); +$typent_id = GETPOSTINT('typent_id'); +$categ_id = GETPOSTINT('categ_id'); $userid = GETPOST('userid', 'int'); $socid = GETPOST('socid', 'int'); diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index e1762456dce..551c7b7c069 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1684,7 +1684,7 @@ if (!$error && ($massaction == 'increaseholiday' || ($action == 'increaseholiday $objecttmp = new $objectclass($db); $nbok = 0; $typeholiday = GETPOST('typeholiday', 'alpha'); - $nbdaysholidays = GETPOST('nbdaysholidays', 'double'); + $nbdaysholidays = GETPOSTFLOAT('nbdaysholidays'); // May be 1.5 if ($nbdaysholidays <= 0) { setEventMessages($langs->trans("WrongAmount"), "", 'errors'); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 957a57c9f39..a810b92a8d3 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -217,7 +217,7 @@ class pdf_einstein extends ModelePDFCommandes // Possibility to use suffix for proforma $suffix = ''; if (getDolGlobalString('PROFORMA_PDF_WITH_SUFFIX')) { - $suffix = (GETPOST('model', 2)=='proforma') ? $conf->global->PROFORMA_PDF_WITH_SUFFIX : ''; + $suffix = (GETPOST('model') == 'proforma') ? $conf->global->PROFORMA_PDF_WITH_SUFFIX : ''; $suffix = dol_sanitizeFileName($suffix); } diff --git a/htdocs/modulebuilder/admin/setup.php b/htdocs/modulebuilder/admin/setup.php index 02513e697be..3b189f9908a 100644 --- a/htdocs/modulebuilder/admin/setup.php +++ b/htdocs/modulebuilder/admin/setup.php @@ -45,7 +45,7 @@ if ($action == "update") { $res4 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_EDITOR_NAME', GETPOST('MODULEBUILDER_SPECIFIC_EDITOR_NAME', 'alphanohtml'), 'chaine', 0, '', $conf->entity); $res5 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_EDITOR_URL', GETPOST('MODULEBUILDER_SPECIFIC_EDITOR_URL', 'alphanohtml'), 'chaine', 0, '', $conf->entity); $res6 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_FAMILY', GETPOST('MODULEBUILDER_SPECIFIC_FAMILY', 'alphanohtml'), 'chaine', 0, '', $conf->entity); - $res7 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_AUTHOR', GETPOST('MODULEBUILDER_SPECIFIC_AUTHOR', 'html'), 'chaine', 0, '', $conf->entity); + $res7 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_AUTHOR', GETPOST('MODULEBUILDER_SPECIFIC_AUTHOR', 'restricthtml'), 'chaine', 0, '', $conf->entity); $res8 = dolibarr_set_const($db, 'MODULEBUILDER_SPECIFIC_VERSION', GETPOST('MODULEBUILDER_SPECIFIC_VERSION', 'alphanohtml'), 'chaine', 0, '', $conf->entity); if ($res1 < 0 || $res2 < 0 || $res3 < 0 || $res4 < 0 || $res5 < 0 || $res6 < 0 || $res7 < 0 || $res8 < 0) { setEventMessages('ErrorFailedToSaveDate', null, 'errors'); diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 39ae023c7c3..5f6a90f964e 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -203,7 +203,7 @@ if (empty($reshook)) { } $error = 0; - $deleteChilds = GETPOST('deletechilds', 'boolean'); + $deleteChilds = GETPOST('deletechilds', 'aZ'); // Start the database transaction $db->begin(); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index e050fc44c1d..bc970a38fd5 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -425,7 +425,7 @@ if ($action == 'confirm_generateinvoice') { $db->begin(); $idprod = GETPOST('productid', 'int'); - $generateinvoicemode = GETPOST('generateinvoicemode', 'string'); + $generateinvoicemode = GETPOST('generateinvoicemode', 'alphanohtml'); $invoiceToUse = GETPOST('invoiceid', 'int'); $prodDurationHoursBase = 1.0; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 73d31b376b8..79a9fe082ad 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -414,7 +414,7 @@ if (empty($reshook)) { $sellbydate = str_replace('/', '-', $sellby); if (getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION') || getDolGlobalString('STOCK_CALCULATE_ON_RECEPTION_CLOSE')) { - $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha'), price2num(GETPOST($cost_price, 'double'), 'MU')); + $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha'), GETPOSTFLOAT($cost_price, 'MU')); } else { $ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha')); } diff --git a/htdocs/webportal/class/controller.class.php b/htdocs/webportal/class/controller.class.php index 6c2c0aed3b3..0904b664847 100644 --- a/htdocs/webportal/class/controller.class.php +++ b/htdocs/webportal/class/controller.class.php @@ -164,11 +164,11 @@ class Controller } /** - * Load a template + * Load a template .tpl file * - * @param string $templateName Template name + * @param string $templateName Template file name (without the .tpl.php) * @param mixed $vars Data to transmit to template - * @return bool True if template found, else false + * @return bool True if template found, else false */ public function loadTemplate($templateName, $vars = false) { diff --git a/htdocs/webportal/controllers/document.controller.class.php b/htdocs/webportal/controllers/document.controller.class.php index 92cc37e9ad7..9f5cd408867 100644 --- a/htdocs/webportal/controllers/document.controller.class.php +++ b/htdocs/webportal/controllers/document.controller.class.php @@ -95,9 +95,11 @@ class DocumentController extends Controller // Security check if (empty($modulepart)) { httponly_accessforbidden('Bad link. Bad value for parameter modulepart', 400); + exit; } if (empty($original_file)) { httponly_accessforbidden('Bad link. Missing identification to find file (original_file)', 400); + exit; } // get original file From 182d5eba5bbcde66ce57698223736bf7b6ae6b44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Feb 2024 15:15:08 +0100 Subject: [PATCH 50/84] Fix warnings --- htdocs/comm/action/card.php | 2 +- htdocs/compta/facture/card.php | 6 +++--- htdocs/contrat/card.php | 2 +- htdocs/fichinter/card.php | 2 +- htdocs/fourn/facture/card.php | 4 ++-- htdocs/user/card.php | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index be75149de77..cc5c5c1c8dd 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1666,7 +1666,7 @@ if ($action == 'create') { //Reminder print ''; diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index f1ae8948052..28a7c1a39fc 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1372,7 +1372,7 @@ if (empty($reshook)) { $object->ref_client = $object->ref_customer; $object->model_pdf = GETPOST('model'); $object->fk_project = GETPOST('projectid', 'int'); - $object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id')); + $object->cond_reglement_id = (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id')); $object->mode_reglement_id = GETPOST('mode_reglement_id', 'int'); $object->fk_account = GETPOST('fk_account', 'int'); $object->amount = price2num(GETPOST('amount')); @@ -1459,7 +1459,7 @@ if (empty($reshook)) { $object->ref_customer = GETPOST('ref_client'); $object->model_pdf = GETPOST('model'); $object->fk_project = GETPOST('projectid', 'int'); - $object->cond_reglement_id = (GETPOST('type') == 3 ? 1 : GETPOST('cond_reglement_id')); + $object->cond_reglement_id = (GETPOSTINT('type') == 3 ? 1 : GETPOST('cond_reglement_id')); $object->mode_reglement_id = GETPOST('mode_reglement_id'); $object->fk_account = GETPOST('fk_account', 'int'); $object->amount = price2num(GETPOST('amount')); @@ -3496,7 +3496,7 @@ if ($action == 'create') { // Deposit - Down payment if (!getDolGlobalString('INVOICE_DISABLE_DEPOSIT')) { print '
'; - $tmp = ' '; + $tmp = ' '; print ''; -} -print '
'; + // Select object + print '
'; + print '
'.$langs->trans("StatisticsOn").'
'; + print $form->selectarray('objecttype', $newarrayoftype, $objecttype, 0, 0, 0, '', 1, 0, 0, '', 'minwidth200', 1, '', 0, 1); + if (empty($conf->use_javascript_ajax)) { + print ''; + } else { + print ' + '; + } + print '
'; -// Filter (you can use param &show_search_component_params_hidden=1 for debug) -if (!empty($object)) { - print '
'; - print $form->searchComponent(array($object->element => $object->fields), $search_component_params, array(), $search_component_params_hidden); + // Filter (you can use param &show_search_component_params_hidden=1 for debug) + if (!empty($object)) { + print '
'; + print $form->searchComponent(array($object->element => $object->fields), $search_component_params, array(), $search_component_params_hidden); + print '
'; + } + + // YAxis (add measures into array) + $count = 0; + //var_dump($arrayofmesures); + print '
'; + print '
'; + $simplearrayofmesures = array(); + foreach ($arrayofmesures as $key => $val) { + $simplearrayofmesures[$key] = $arrayofmesures[$key]['label']; + } + print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300', 1, 0, '', '', $langs->trans("Measures")); // Fill the array $arrayofmeasures with possible fields print '
'; -} -// YAxis (add measures into array) -$count = 0; -//var_dump($arrayofmesures); -print '
'; -print '
'; -$simplearrayofmesures = array(); -foreach ($arrayofmesures as $key => $val) { - $simplearrayofmesures[$key] = $arrayofmesures[$key]['label']; -} -print $form->multiselectarray('search_measures', $simplearrayofmesures, $search_measures, 0, 0, 'minwidth300', 1, 0, '', '', $langs->trans("Measures")); // Fill the array $arrayofmeasures with possible fields -print '
'; - -// XAxis -$count = 0; -print '
'; -print '
'; -//var_dump($arrayofxaxis); -print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400'); // Fill the array $arrayofxaxis with possible fields -print '
'; - -// Group by -$count = 0; -print '
'; -print '
'; -print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields -print '
'; - - -if ($mode == 'grid') { - // YAxis + // XAxis + $count = 0; print '
'; - foreach ($object->fields as $key => $val) { - if (empty($val['measure']) && (!isset($val['enabled']) || dol_eval($val['enabled'], 1, 1, '1'))) { - if (in_array($key, array('id', 'rowid', 'entity', 'last_main_doc', 'extraparams'))) { - continue; - } - if (preg_match('/^fk_/', $key)) { - continue; - } - if (in_array($val['type'], array('html', 'text'))) { - continue; - } - if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { - $arrayofyaxis['t.'.$key.'-year'] = array( - 'label' => $langs->trans($val['label']).' ('.$YYYY.')', - 'position' => $val['position'], - 'table' => $object->table_element - ); - $arrayofyaxis['t.'.$key.'-month'] = array( - 'label' => $langs->trans($val['label']).' ('.$YYYY.'-'.$MM.')', - 'position' => $val['position'], - 'table' => $object->table_element - ); - $arrayofyaxis['t.'.$key.'-day'] = array( - 'label' => $langs->trans($val['label']).' ('.$YYYY.'-'.$MM.'-'.$DD.')', - 'position' => $val['position'], - 'table' => $object->table_element - ); - } else { - $arrayofyaxis['t.'.$key] = array( - 'label' => $val['label'], - 'position' => (int) $val['position'], - 'table' => $object->table_element - ); - } - } - } - // Add measure from extrafields - if ($object->isextrafieldmanaged) { - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { - $arrayofyaxis['te.'.$key] = array( - 'label' => $extrafields->attributes[$object->table_element]['label'][$key], - 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key], - 'table' => $object->table_element - ); - } - } - } - $arrayofyaxis = dol_sort_array($arrayofyaxis, 'position'); - $arrayofyaxislabel = array(); - foreach ($arrayofyaxis as $key => $val) { - $arrayofyaxislabel[$key] = $val['label']; - } - print '
'.$langs->trans("YAxis").'
'; - print $form->multiselectarray('search_yaxis', $arrayofyaxislabel, $search_yaxis, 0, 0, 'minwidth100', 1); + print '
'; + //var_dump($arrayofxaxis); + print $formother->selectXAxisField($object, $search_xaxis, $arrayofxaxis, $langs->trans("XAxis"), 'minwidth300 maxwidth400'); // Fill the array $arrayofxaxis with possible fields print '
'; -} -if ($mode == 'graph') { - // -} + // Group by + $count = 0; + print '
'; + print '
'; + print $formother->selectGroupByField($object, $search_groupby, $arrayofgroupby, 'minwidth250 maxwidth300', $langs->trans("GroupBy")); // Fill the array $arrayofgroupby with possible fields + print '
'; -print '
'; -print ''; -print '
'; -print '
'; -print ''; + + if ($mode == 'grid') { + // YAxis + print '
'; + foreach ($object->fields as $key => $val) { + if (empty($val['measure']) && (!isset($val['enabled']) || dol_eval($val['enabled'], 1, 1, '1'))) { + if (in_array($key, array('id', 'rowid', 'entity', 'last_main_doc', 'extraparams'))) { + continue; + } + if (preg_match('/^fk_/', $key)) { + continue; + } + if (in_array($val['type'], array('html', 'text'))) { + continue; + } + if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) { + $arrayofyaxis['t.'.$key.'-year'] = array( + 'label' => $langs->trans($val['label']).' ('.$YYYY.')', + 'position' => $val['position'], + 'table' => $object->table_element + ); + $arrayofyaxis['t.'.$key.'-month'] = array( + 'label' => $langs->trans($val['label']).' ('.$YYYY.'-'.$MM.')', + 'position' => $val['position'], + 'table' => $object->table_element + ); + $arrayofyaxis['t.'.$key.'-day'] = array( + 'label' => $langs->trans($val['label']).' ('.$YYYY.'-'.$MM.'-'.$DD.')', + 'position' => $val['position'], + 'table' => $object->table_element + ); + } else { + $arrayofyaxis['t.'.$key] = array( + 'label' => $val['label'], + 'position' => (int) $val['position'], + 'table' => $object->table_element + ); + } + } + } + // Add measure from extrafields + if ($object->isextrafieldmanaged) { + foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { + if (!empty($extrafields->attributes[$object->table_element]['totalizable'][$key]) && (!isset($extrafields->attributes[$object->table_element]['enabled'][$key]) || dol_eval($extrafields->attributes[$object->table_element]['enabled'][$key], 1, 1, '1'))) { + $arrayofyaxis['te.'.$key] = array( + 'label' => $extrafields->attributes[$object->table_element]['label'][$key], + 'position' => (int) $extrafields->attributes[$object->table_element]['pos'][$key], + 'table' => $object->table_element + ); + } + } + } + $arrayofyaxis = dol_sort_array($arrayofyaxis, 'position'); + $arrayofyaxislabel = array(); + foreach ($arrayofyaxis as $key => $val) { + $arrayofyaxislabel[$key] = $val['label']; + } + print '
'.$langs->trans("YAxis").'
'; + print $form->multiselectarray('search_yaxis', $arrayofyaxislabel, $search_yaxis, 0, 0, 'minwidth100', 1); + print '
'; + } + + if ($mode == 'graph') { + // + } + + print '
'; + print ''; + print '
'; + print '
'; + print ''; +} // Generate the SQL request $sql = ''; @@ -1117,7 +1123,7 @@ if ($mode == 'graph') { } } -if ($sql) { +if ($sql && !defined('MAIN_CUSTOM_REPORT_KEEP_GRAPH_ONLY')) { // Show admin info print '
'.info_admin($langs->trans("SQLUsedForExport").':
'.$sql, 0, 0, 1, '', 'TechnicalInformation'); } From d4c1896552ade9e4071ca7636535120b496e31fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Feb 2024 21:47:12 +0100 Subject: [PATCH 58/84] Fix edit website css content --- htdocs/website/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 9453d1b403c..0cf1abe101e 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -25,7 +25,7 @@ /** @phan-file-suppress PhanPluginSuspiciousParamPosition */ // We allow POST of rich content with js and style, but only for this php file and if into some given POST variable -define('NOSCANPOSTFORINJECTION', array('PAGE_CONTENT', 'WEBSITE_JS_INLINE', 'WEBSITE_HTML_HEADER', 'htmlheader')); +define('NOSCANPOSTFORINJECTION', array('PAGE_CONTENT', 'WEBSITE_CSS_INLINE', 'WEBSITE_JS_INLINE', 'WEBSITE_HTML_HEADER', 'htmlheader')); define('USEDOLIBARREDITOR', 1); define('FORCE_CKEDITOR', 1); // We need CKEditor, even if module is off. From e969ddc386cf3e3900d4207a6f3338e937bc3b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 22:34:17 +0100 Subject: [PATCH 59/84] fix phpstan (#28436) --- htdocs/core/lib/barcode.lib.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/barcode.lib.php b/htdocs/core/lib/barcode.lib.php index 5b00a1eabd1..9f3ce7d3468 100644 --- a/htdocs/core/lib/barcode.lib.php +++ b/htdocs/core/lib/barcode.lib.php @@ -405,7 +405,7 @@ function barcode_encode_genbarcode($code, $encoding) * @param string $mode png,gif,jpg (default='png') * @param int $total_y the total height of the image ( default: scale * 60 ) * @param array $space default: $space[top] = 2 * $scale; $space[bottom]= 2 * $scale; $space[left] = 2 * $scale; $space[right] = 2 * $scale; - * @return string|null + * @return string|void */ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, $space = '') { @@ -413,9 +413,6 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, global $font_loc, $filebarcode; //print "$text, $bars, $scale, $mode, $total_y, $space, $font_loc, $filebarcode
"; - //var_dump($text); - //var_dump($bars); - //var_dump($font_loc); /* set defaults */ if ($scale < 1) { @@ -504,7 +501,7 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0, header("Content-Type: image/gif; name=\"barcode.gif\""); imagegif($im); } elseif (!empty($filebarcode)) { - // To write into a file onto disk + // To write into a file onto disk imagepng($im, $filebarcode); } else { header("Content-Type: image/png; name=\"barcode.png\""); From 1692dad347957fbeeed677a1acd9e7114fe0ef5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 22:52:09 +0100 Subject: [PATCH 60/84] fix #28431 (#28439) --- htdocs/contact/list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 26f1c8c2f89..a9878be3a28 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -9,7 +9,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Juanjo Menent - * Copyright (C) 2019 Frédéric France + * Copyright (C) 2019 Frédéric France * Copyright (C) 2019 Josep Lluís Amador * Copyright (C) 2020 Open-Dsi * @@ -1629,6 +1629,8 @@ while ($i < $imaxinloop) { $option_link = 'customer'; if ($objsoc->client == 0 && $objsoc->fournisseur > 0) { $option_link = 'supplier'; + } elseif ($objsoc->client == 0 && $objsoc->fournisseur == 0) { + $option_link = ''; } if ($contextpage == 'poslist') { print $objsoc->name; From 8262fb96057c02017ca738d8ede3a7c788f1a6e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 22:53:21 +0100 Subject: [PATCH 61/84] fix phpstan (#28440) --- .../eventorganization/class/conferenceorboothattendee.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index c54d8238da4..011c176e2f2 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -48,7 +48,7 @@ class ConferenceOrBoothAttendee extends CommonObject public $table_element = 'eventorganization_conferenceorboothattendee'; /** - * @var int Does this object support multicompany module ? + * @var int|string Does this object support multicompany module ? * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table */ public $ismultientitymanaged = 'fk_project@projet'; From f0209f1b66e70dacf9b42a26ec74a71024c8ddb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 22:54:32 +0100 Subject: [PATCH 62/84] fix phpstan (#28441) --- .../class/conferenceorboothattendee.class.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 011c176e2f2..b137fd538ad 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -258,7 +258,7 @@ class ConferenceOrBoothAttendee extends CommonObject if ($result > 0) { $result = $this->fetch($result); if ($result > 0) { - $this->ref = $this->id; + $this->ref = (string) $this->id; $result = $this->update($user); } } @@ -333,10 +333,9 @@ class ConferenceOrBoothAttendee extends CommonObject $result = $object->createCommon($user); if ($result < 0) { $error++; - $this->error = $object->error; - $this->errors = $object->errors; + $this->setErrorsFromObject($object); } else { - $object->ref = $object->id; + $object->ref = (string) $object->id; $result = $object->update($user); } From 96a727d1f00c39f70c14c963dec33f8ab639604a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 23:00:28 +0100 Subject: [PATCH 63/84] fix phpstan (#28434) Default value of the parameter #5 $id (string) of function print_fiche_titre() is incompatible with type int. --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 391dbe2e0b4..5246e9554f8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13,7 +13,7 @@ * Copyright (C) 2014 Cédric GROSS * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2019-2023 Thibault Foucart * Copyright (C) 2020 Open-Dsi * Copyright (C) 2021 Gauthier VERDOL @@ -5841,7 +5841,7 @@ function print_titre($title) * @param string $mesg Added message to show on right * @param string $picto Icon to use before title (should be a 32x32 transparent png file) * @param int $pictoisfullpath 1=Icon name is a full absolute url of image - * @param int $id To force an id on html objects + * @param string $id To force an id on html objects by example id="name" where name is id * @return void * @deprecated Use print load_fiche_titre instead */ From f0dc1358f96b0591d4ab88328e09c0a555b244e8 Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+BB2A-Anthony@users.noreply.github.com> Date: Mon, 26 Feb 2024 23:01:08 +0100 Subject: [PATCH 64/84] Order list det change to eprimental (#28438) Co-authored-by: Anthony Berton --- htdocs/core/menus/init_menu_auguria.sql | 2 +- htdocs/core/menus/standard/eldy.lib.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 5b975bca59e..b17ec92127d 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -183,7 +183,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1207__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=4', 'StatusOrderProcessed', 1, 'orders', '$user->hasRight("commande", "lire")', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $leftmenu=="orders"', __HANDLER__, 'left', 1208__+MAX_llx_menu__, 'commercial', '', 1202__+MAX_llx_menu__, '/commande/list.php?mainmenu=commercial&leftmenu=orders&search_status=-1', 'StatusOrderCanceledShort', 1, 'orders', '$user->hasRight("commande", "lire")', '', 2, 7, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1209__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/stats/index.php?mainmenu=commercial&leftmenu=orders', 'Statistics', 1, 'orders', '(!empty($conf->global->MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS)?$user->hasRight("commande", "commande", "export"):$user->hasRight("commande", "lire"))', '', 2, 4, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $conf->global->MAIN_FEATURES_LEVEL >= 2 && empty($user->socid)', __HANDLER__, 'left', 1210__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list_det.php?mainmenu=commercial&leftmenu=orders', 'ListOrderLigne', 1, 'orders', '$user->hasRight("commande", "lire")', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande") && $conf->global->MAIN_FEATURES_LEVEL >= 1 && empty($user->socid)', __HANDLER__, 'left', 1210__+MAX_llx_menu__, 'commercial', '', 1200__+MAX_llx_menu__, '/commande/list_det.php?mainmenu=commercial&leftmenu=orders', 'ListOrderLigne', 1, 'orders', '$user->hasRight("commande", "lire")', '', 2, 1, __ENTITY__); -- Commercial - Supplier's proposals insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_proposal")', __HANDLER__, 'left', 1650__+MAX_llx_menu__, 'commercial', 'propals_supplier', 3__+MAX_llx_menu__, '/supplier_proposal/index.php?leftmenu=propals_supplier', 'SupplierProposalsShort', 0, 'supplier_proposal', '$user->rights->supplier_proposal->lire', '', 2, 4, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index ef2581aed68..e489f415fe0 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -1378,7 +1378,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left //$newmenu->add("/commande/list.php?leftmenu=orders&search_status=4", $langs->trans("StatusOrderProcessed"), 2, $user->hasRight('commande', 'lire')); $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-1", $langs->trans("StatusOrderCanceledShort"), 2, $user->hasRight('commande', 'lire')); } - if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2 && empty($user->socid)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 1 && empty($user->socid)) { $newmenu->add("/commande/list_det.php?leftmenu=orders", $langs->trans("ListOrderLigne"), 1, $user->hasRight('commande', 'lire')); } if (getDolGlobalInt('MAIN_NEED_EXPORT_PERMISSION_TO_READ_STATISTICS')) { From 84b01dc1f8d4bb2bbfffe22a03068884c2c56fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 23:02:53 +0100 Subject: [PATCH 65/84] fix phpstan (#28433) Default value of the parameter #2 $mesgarray (string) of function get_htmloutput_mesg() is incompatible with type array. --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5246e9554f8..045798228c0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -9348,7 +9348,7 @@ function dol_htmloutput_events($disabledoutputofmessages = 0) * @see dol_htmloutput_errors() * @see setEventMessages() */ -function get_htmloutput_mesg($mesgstring = '', $mesgarray = '', $style = 'ok', $keepembedded = 0) +function get_htmloutput_mesg($mesgstring = '', $mesgarray = [], $style = 'ok', $keepembedded = 0) { global $conf, $langs; From ac328d6acb93a25118a45b77aaab1e1067f536cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 23:03:42 +0100 Subject: [PATCH 66/84] fix phpstan (#28432) Default value of the parameter #6 $noreplace (int) of function GETPOST() is incompatible with type string. --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 045798228c0..42d1f1df716 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -656,7 +656,7 @@ function GETPOSTISARRAY($paramname, $method = 0) * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get) * @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails) * @param mixed $options Options to pass to filter_var when $check is set to 'custom' - * @param string $noreplace Force disable of replacement of __xxx__ strings. + * @param int $noreplace Force disable of replacement of __xxx__ strings. * @return string|array Value found (string or array), or '' if check fails */ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null, $options = null, $noreplace = 0) From 1d1e6ac562d8d77910273209a7676c164e297d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 26 Feb 2024 23:04:07 +0100 Subject: [PATCH 67/84] fix typo (#28430) --- htdocs/adherents/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index d7f94aa0908..5ab338489de 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -820,7 +820,7 @@ $moreforfilter = ''; if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; - $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedlength"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1, $langs->trans("MembersCategoriesShort")); + $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1, $langs->trans("MembersCategoriesShort")); $moreforfilter .= '
'; } $parameters = array(); From 1c3a035ae5ae8bc71777067bfc9fc51c859d0cb8 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 26 Feb 2024 23:10:16 +0100 Subject: [PATCH 68/84] Qual: New Phan plugin for testing that argument matches regex (#28424) * Qual: New Phan plugin for testing that argument matches regex # Qual: New Phan plugin for testing that argument matches regex This Plugin - currently applied to GETPOST - allows verifying that a selected argument of a function matches a regular expression. * Qual: Add isModEnabled verification to phan # Qual: Add isModEnabled verification in phan Using ParamMatchRegexPlugin, add isModEnabled parameter verification. * Qual: Verify sanitizeVal check value # Qual: Verify sanitizeVal check value Use ParamMatchPlugin to check sanitizeVal check value * Qual: Extend ParamMatchRegexPlugin with class_method # Qual: Extend ParamMatchRegexPlugin with class_method Allow matching class methods for argument verification. * Update config.php * Qual: New Phan plugin for testing that argument matches regex # Qual: New Phan plugin for testing that argument matches regex This Plugin - currently applied to GETPOST - allows verifying that a selected argument of a function matches a regular expression. * Qual: Add isModEnabled verification to phan # Qual: Add isModEnabled verification in phan Using ParamMatchRegexPlugin, add isModEnabled parameter verification. * Qual: Verify sanitizeVal check value # Qual: Verify sanitizeVal check value Use ParamMatchPlugin to check sanitizeVal check value * Qual: Extend ParamMatchRegexPlugin with class_method # Qual: Extend ParamMatchRegexPlugin with class_method Allow matching class methods for argument verification. * Report scalar values (see null, etc) * Qual: Ignore false Phan Notification * Qual: Ignore false Phan Notification * Qual: Fix Phan needs specific message keys for coloring. --------- Co-authored-by: Laurent Destailleur --- dev/tools/phan/config.php | 188 +++++++++++++ dev/tools/phan/config_extended.php | 187 +++++++++++++ dev/tools/phan/config_fixer.php | 203 ++++++++++++++ .../phan/plugins/ParamMatchRegexPlugin.php | 248 ++++++++++++++++++ htdocs/core/lib/functions.lib.php | 1 + htdocs/modulebuilder/index.php | 1 + 6 files changed, 828 insertions(+) create mode 100644 dev/tools/phan/config_fixer.php create mode 100644 dev/tools/phan/plugins/ParamMatchRegexPlugin.php diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 1dc71344d2d..b5ac3bfafd8 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -4,6 +4,187 @@ define('DOL_PROJECT_ROOT', __DIR__.'/../../..'); define('DOL_DOCUMENT_ROOT', DOL_PROJECT_ROOT.'/htdocs'); define('PHAN_DIR', __DIR__); +$sanitizeRegex + = '/^(array:)?(?:'.implode( + '|', + array( + // Documented: + 'none', + 'array', + 'int', + 'intcomma', + 'alpha', + 'alphawithlgt', + 'alphanohtml', + 'MS', + 'aZ', + 'aZ09', + 'aZ09arobase', + 'aZ09comma', + 'san_alpha', + 'restricthtml', + 'nohtml', + 'custom', + // Not documented: + 'email', + 'restricthtmlallowclass', + 'restricthtmlallowunvalid', + 'restricthtmlnolink', + //'ascii', + //'categ_id', + //'chaine', + + //'html', + //'boolean', + //'double', + //'float', + //'string', + ) + ).')*$/'; + +/** + * Map deprecated module names to new module names + */ +$DEPRECATED_MODULE_MAPPING = array( + 'actioncomm' => 'agenda', + 'adherent' => 'member', + 'adherent_type' => 'member_type', + 'banque' => 'bank', + 'categorie' => 'category', + 'commande' => 'order', + 'contrat' => 'contract', + 'entrepot' => 'stock', + 'expedition' => 'delivery_note', + 'facture' => 'invoice', + 'ficheinter' => 'intervention', + 'product_fournisseur_price' => 'productsupplierprice', + 'product_price' => 'productprice', + 'projet' => 'project', + 'propale' => 'propal', + 'socpeople' => 'contact', +); + +/** + * Map module names to the 'class' name (the class is: mod) + * Value is null when the module is not internal to the default + * Dolibarr setup. + */ +$VALID_MODULE_MAPPING = array( + 'accounting' => 'Accounting', + 'agenda' => 'Agenda', + 'ai' => 'Ai', + 'anothermodule' => null, + 'api' => 'Api', + 'asset' => 'Asset', + 'bank' => 'Banque', + 'barcode' => 'Barcode', + 'blockedlog' => 'BlockedLog', + 'bom' => 'Bom', + 'bookcal' => 'BookCal', + 'bookmark' => 'Bookmark', + 'cashdesk' => null, // TODO: fill in proper class + 'category' => 'Categorie', + 'clicktodial' => 'ClickToDial', + 'collab' => 'Collab', + 'comptabilite' => 'Comptabilite', + 'contact' => null, // TODO: fill in proper class + 'contract' => 'Contrat', + 'cron' => 'Cron', + 'datapolicy' => 'DataPolicy', + 'dav' => 'Dav', + 'debugbar' => 'DebugBar', + 'delivery_note' => 'Expedition', + 'deplacement' => 'Deplacement', + "documentgeneration" => 'DocumentGeneration', + 'don' => 'Don', + 'dynamicprices' => 'DynamicPrices', + 'ecm' => 'ECM', + 'ecotax' => null, // TODO: External module ? + 'emailcollector' => 'EmailCollector', + 'eventorganization' => 'EventOrganization', + 'expensereport' => 'ExpenseReport', + 'export' => 'Export', + 'externalrss' => 'ExternalRss', + 'externalsite' => 'ExternalSite', + 'fckeditor' => 'Fckeditor', + 'fournisseur' => 'Fournisseur', + 'ftp' => 'FTP', + 'geoipmaxmind' => 'GeoIPMaxmind', + 'google' => null, // External ? + 'gravatar' => 'Gravatar', + 'holiday' => 'Holiday', + 'hrm' => 'HRM', + 'import' => 'Import', + 'incoterm' => 'Incoterm', + 'intervention' => 'Ficheinter', + 'intracommreport' => 'Intracommreport', + 'invoice' => 'Facture', + 'knowledgemanagement' => 'KnowledgeManagement', + 'label' => 'Label', + 'ldap' => 'Ldap', + 'loan' => 'Loan', + 'mailing' => 'Mailing', + 'mailman' => null, // Same module as mailmanspip -> MailmanSpip ?? + 'mailmanspip' => 'MailmanSpip', + 'margin' => 'Margin', + 'member' => 'Adherent', + 'memcached' => null, // TODO: External module? + 'modulebuilder' => 'ModuleBuilder', + 'mrp' => 'Mrp', + 'multicompany' => null, // Not provided by default, no module tests + 'multicurrency' => 'MultiCurrency', + 'mymodule' => null, // modMyModule - Name used in module builder (avoid false positives) + 'notification' => 'Notification', + 'numberwords' => null, // Not provided by default, no module tests + 'oauth' => 'Oauth', + 'openstreetmap' => null, // External module? + 'opensurvey' => 'OpenSurvey', + 'order' => 'Commande', + 'partnership' => 'Partnership', + 'paybox' => 'Paybox', + 'paymentbybanktransfer' => 'PaymentByBankTransfer', + 'paypal' => 'Paypal', + 'paypalplus' => null, + 'prelevement' => 'Prelevement', + 'printing' => 'Printing', + 'product' => 'Product', + 'productbatch' => 'ProductBatch', + 'productprice' => null, + 'productsupplierprice' => null, + 'project' => 'Projet', + 'propal' => 'Propale', + 'receiptprinter' => 'ReceiptPrinter', + 'reception' => 'Reception', + 'recruitment' => 'Recruitment', + 'resource' => 'Resource', + 'salaries' => 'Salaries', + 'service' => 'Service', + 'socialnetworks' => 'SocialNetworks', + 'societe' => 'Societe', + 'stock' => 'Stock', + 'stocktransfer' => 'StockTransfer', + 'stripe' => 'Stripe', + 'supplier_invoice' => null, // Special case, uses invoice + 'supplier_order' => null, // Special case, uses invoice + 'supplier_proposal' => 'SupplierProposal', + 'syslog' => 'Syslog', + 'takepos' => 'TakePos', + 'tax' => 'Tax', + 'ticket' => 'Ticket', + 'user' => 'User', + 'variants' => 'Variants', + 'webhook' => 'Webhook', + 'webportal' => 'WebPortal', + 'webservices' => 'WebServices', + 'webservicesclient' => 'WebServicesClient', + 'website' => 'Website', + 'workflow' => 'Workflow', + 'workstation' => 'Workstation', + 'zapier' => 'Zapier', +); + +$moduleNameRegex = '/^(?:'.implode('|', array_merge(array_keys($DEPRECATED_MODULE_MAPPING), array_keys($VALID_MODULE_MAPPING), array('\$modulename'))).')$/'; + /** * This configuration will be read and overlaid on top of the * default configuration. Command line arguments will be applied @@ -71,6 +252,7 @@ return [ .'|htdocs/includes/restler/.*' // @phpstan-ignore-line // Included as stub (did not seem properly analysed by phan without it) .'|htdocs/includes/stripe/.*' // @phpstan-ignore-line + // .'|htdocs/[^h].*/.*' // For testing @phpstan-ignore-line .')@', // @phpstan-ignore-line // A list of plugin files to execute. @@ -82,8 +264,14 @@ return [ // // Alternately, you can pass in the full path to a PHP file // with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php') + 'ParamMatchRegexPlugin' => [ + '/^GETPOST$/' => [1, $sanitizeRegex], + '/^isModEnabled$/' => [0, $moduleNameRegex], + '/^sanitizeVal$/' => [1, $sanitizeRegex], + ], 'plugins' => [ __DIR__.'/plugins/NoVarDumpPlugin.php', + __DIR__.'/plugins/ParamMatchRegexPlugin.php', // checks if a function, closure or method unconditionally returns. // can also be written as 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php' //'DeprecateAliasPlugin', diff --git a/dev/tools/phan/config_extended.php b/dev/tools/phan/config_extended.php index 9a721355daf..3b46fa7a49d 100644 --- a/dev/tools/phan/config_extended.php +++ b/dev/tools/phan/config_extended.php @@ -4,6 +4,187 @@ define('DOL_PROJECT_ROOT', __DIR__.'/../../..'); define('DOL_DOCUMENT_ROOT', DOL_PROJECT_ROOT.'/htdocs'); define('PHAN_DIR', __DIR__); +$sanitizeRegex + = '/^(array:)?(?:'.implode( + '|', + array( + // Documented: + 'none', + 'array', + 'int', + 'intcomma', + 'alpha', + 'alphawithlgt', + 'alphanohtml', + 'MS', + 'aZ', + 'aZ09', + 'aZ09arobase', + 'aZ09comma', + 'san_alpha', + 'restricthtml', + 'nohtml', + 'custom', + // Not documented: + 'email', + 'restricthtmlallowclass', + 'restricthtmlallowunvalid', + 'restricthtmlnolink', + //'ascii', + //'categ_id', + //'chaine', + + //'html', + //'boolean', + //'double', + //'float', + //'string', + ) + ).')*$/'; + +/** + * Map deprecated module names to new module names + */ +$DEPRECATED_MODULE_MAPPING = array( + 'actioncomm' => 'agenda', + 'adherent' => 'member', + 'adherent_type' => 'member_type', + 'banque' => 'bank', + 'categorie' => 'category', + 'commande' => 'order', + 'contrat' => 'contract', + 'entrepot' => 'stock', + 'expedition' => 'delivery_note', + 'facture' => 'invoice', + 'ficheinter' => 'intervention', + 'product_fournisseur_price' => 'productsupplierprice', + 'product_price' => 'productprice', + 'projet' => 'project', + 'propale' => 'propal', + 'socpeople' => 'contact', +); + +/** + * Map module names to the 'class' name (the class is: mod) + * Value is null when the module is not internal to the default + * Dolibarr setup. + */ +$VALID_MODULE_MAPPING = array( + 'accounting' => 'Accounting', + 'agenda' => 'Agenda', + 'ai' => 'Ai', + 'anothermodule' => null, + 'api' => 'Api', + 'asset' => 'Asset', + 'bank' => 'Banque', + 'barcode' => 'Barcode', + 'blockedlog' => 'BlockedLog', + 'bom' => 'Bom', + 'bookcal' => 'BookCal', + 'bookmark' => 'Bookmark', + 'cashdesk' => null, // TODO: fill in proper class + 'category' => 'Categorie', + 'clicktodial' => 'ClickToDial', + 'collab' => 'Collab', + 'comptabilite' => 'Comptabilite', + 'contact' => null, // TODO: fill in proper class + 'contract' => 'Contrat', + 'cron' => 'Cron', + 'datapolicy' => 'DataPolicy', + 'dav' => 'Dav', + 'debugbar' => 'DebugBar', + 'delivery_note' => 'Expedition', + 'deplacement' => 'Deplacement', + "documentgeneration" => 'DocumentGeneration', + 'don' => 'Don', + 'dynamicprices' => 'DynamicPrices', + 'ecm' => 'ECM', + 'ecotax' => null, // TODO: External module ? + 'emailcollector' => 'EmailCollector', + 'eventorganization' => 'EventOrganization', + 'expensereport' => 'ExpenseReport', + 'export' => 'Export', + 'externalrss' => 'ExternalRss', + 'externalsite' => 'ExternalSite', + 'fckeditor' => 'Fckeditor', + 'fournisseur' => 'Fournisseur', + 'ftp' => 'FTP', + 'geoipmaxmind' => 'GeoIPMaxmind', + 'google' => null, // External ? + 'gravatar' => 'Gravatar', + 'holiday' => 'Holiday', + 'hrm' => 'HRM', + 'import' => 'Import', + 'incoterm' => 'Incoterm', + 'intervention' => 'Ficheinter', + 'intracommreport' => 'Intracommreport', + 'invoice' => 'Facture', + 'knowledgemanagement' => 'KnowledgeManagement', + 'label' => 'Label', + 'ldap' => 'Ldap', + 'loan' => 'Loan', + 'mailing' => 'Mailing', + 'mailman' => null, // Same module as mailmanspip -> MailmanSpip ?? + 'mailmanspip' => 'MailmanSpip', + 'margin' => 'Margin', + 'member' => 'Adherent', + 'memcached' => null, // TODO: External module? + 'modulebuilder' => 'ModuleBuilder', + 'mrp' => 'Mrp', + 'multicompany' => null, // Not provided by default, no module tests + 'multicurrency' => 'MultiCurrency', + 'mymodule' => null, // modMyModule - Name used in module builder (avoid false positives) + 'notification' => 'Notification', + 'numberwords' => null, // Not provided by default, no module tests + 'oauth' => 'Oauth', + 'openstreetmap' => null, // External module? + 'opensurvey' => 'OpenSurvey', + 'order' => 'Commande', + 'partnership' => 'Partnership', + 'paybox' => 'Paybox', + 'paymentbybanktransfer' => 'PaymentByBankTransfer', + 'paypal' => 'Paypal', + 'paypalplus' => null, + 'prelevement' => 'Prelevement', + 'printing' => 'Printing', + 'product' => 'Product', + 'productbatch' => 'ProductBatch', + 'productprice' => null, + 'productsupplierprice' => null, + 'project' => 'Projet', + 'propal' => 'Propale', + 'receiptprinter' => 'ReceiptPrinter', + 'reception' => 'Reception', + 'recruitment' => 'Recruitment', + 'resource' => 'Resource', + 'salaries' => 'Salaries', + 'service' => 'Service', + 'socialnetworks' => 'SocialNetworks', + 'societe' => 'Societe', + 'stock' => 'Stock', + 'stocktransfer' => 'StockTransfer', + 'stripe' => 'Stripe', + 'supplier_invoice' => null, // Special case, uses invoice + 'supplier_order' => null, // Special case, uses invoice + 'supplier_proposal' => 'SupplierProposal', + 'syslog' => 'Syslog', + 'takepos' => 'TakePos', + 'tax' => 'Tax', + 'ticket' => 'Ticket', + 'user' => 'User', + 'variants' => 'Variants', + 'webhook' => 'Webhook', + 'webportal' => 'WebPortal', + 'webservices' => 'WebServices', + 'webservicesclient' => 'WebServicesClient', + 'website' => 'Website', + 'workflow' => 'Workflow', + 'workstation' => 'Workstation', + 'zapier' => 'Zapier', +); + +$moduleNameRegex = '/^(?:'.implode('|', array_merge(array_keys($DEPRECATED_MODULE_MAPPING), array_keys($VALID_MODULE_MAPPING))).')$/'; + /** * This configuration will be read and overlaid on top of the * default configuration. Command line arguments will be applied @@ -82,8 +263,14 @@ return [ // // Alternately, you can pass in the full path to a PHP file // with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php') + 'ParamMatchRegexPlugin' => [ + '/^GETPOST$/' => [1, $sanitizeRegex], + '/^isModEnabled$/' => [0, $moduleNameRegex], + '/^sanitizeVal$/' => [1, $sanitizeRegex], + ], 'plugins' => [ __DIR__.'/plugins/NoVarDumpPlugin.php', + __DIR__.'/plugins/ParamMatchRegexPlugin.php', 'DeprecateAliasPlugin', //'EmptyMethodAndFunctionPlugin', 'InvalidVariableIssetPlugin', diff --git a/dev/tools/phan/config_fixer.php b/dev/tools/phan/config_fixer.php new file mode 100644 index 00000000000..d5607844f26 --- /dev/null +++ b/dev/tools/phan/config_fixer.php @@ -0,0 +1,203 @@ + + */ +define('DOL_PROJECT_ROOT', __DIR__.'/../../..'); +define('DOL_DOCUMENT_ROOT', DOL_PROJECT_ROOT.'/htdocs'); +define('PHAN_DIR', __DIR__); +/** + * This configuration will be read and overlaid on top of the + * default configuration. Command line arguments will be applied + * after this file is read. + */ +return [ + // 'processes' => 6, + 'backward_compatibility_checks' => false, + 'simplify_ast' => true, + 'analyzed_file_extensions' => ['php','inc'], + 'globals_type_map' => [ + 'conf' => '\Conf', + 'db' => '\DoliDB', + 'extrafields' => '\ExtraFields', + 'hookmanager' => '\HookManager', + 'langs' => '\Translate', + 'mysoc' => '\Societe', + 'nblines' => '\int', + 'user' => '\User', + ], + + // Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`, `'7.4'`, `null`. + // If this is set to `null`, + // then Phan assumes the PHP version which is closest to the minor version + // of the php executable used to execute Phan. + //"target_php_version" => null, + "target_php_version" => '8.2', + //"target_php_version" => '7.3', + //"target_php_version" => '5.6', + + // A list of directories that should be parsed for class and + // method information. After excluding the directories + // defined in exclude_analysis_directory_list, the remaining + // files will be statically analyzed for errors. + // + // Thus, both first-party and third-party code being used by + // your application should be included in this list. + 'directory_list' => [ + 'htdocs', + PHAN_DIR . '/stubs/', + ], + + // A directory list that defines files that will be excluded + // from static analysis, but whose class and method + // information should be included. + // + // Generally, you'll want to include the directories for + // third-party code (such as "vendor/") in this list. + // + // n.b.: If you'd like to parse but not analyze 3rd + // party code, directories containing that code + // should be added to the `directory_list` as + // to `exclude_analysis_directory_list`. + "exclude_analysis_directory_list" => [ + 'htdocs/includes/', + 'htdocs/core/class/lessc.class.php', // External library + PHAN_DIR . '/stubs/', + ], + //'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@', + 'exclude_file_regex' => '@^(' // @phpstan-ignore-line + .'dummy' // @phpstan-ignore-line + .'|htdocs/.*/canvas/.*/tpl/.*.tpl.php' // @phpstan-ignore-line + .'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line + // Included as stub (old version + incompatible typing hints) + .'|htdocs/includes/restler/.*' // @phpstan-ignore-line + // Included as stub (did not seem properly analysed by phan without it) + .'|htdocs/includes/stripe/.*' // @phpstan-ignore-line + .')@', // @phpstan-ignore-line + + // A list of plugin files to execute. + // Plugins which are bundled with Phan can be added here by providing their name + // (e.g. 'AlwaysReturnPlugin') + // + // Documentation about available bundled plugins can be found + // at https://github.com/phan/phan/tree/master/.phan/plugins + // + // Alternately, you can pass in the full path to a PHP file + // with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php') + 'plugins' => [ + //'DeprecateAliasPlugin', + // __DIR__.'/plugins/NoVarDumpPlugin.php', + //'PHPDocToRealTypesPlugin', + + /* + //'EmptyMethodAndFunctionPlugin', + 'InvalidVariableIssetPlugin', + //'MoreSpecificElementTypePlugin', + 'NoAssertPlugin', + 'NotFullyQualifiedUsagePlugin', + 'PHPDocRedundantPlugin', + 'PHPUnitNotDeadCodePlugin', + //'PossiblyStaticMethodPlugin', + 'PreferNamespaceUsePlugin', + 'PrintfCheckerPlugin', + 'RedundantAssignmentPlugin', + + 'ConstantVariablePlugin', // Warns about values that are actually constant + //'HasPHPDocPlugin', // Requires PHPDoc + 'InlineHTMLPlugin', // html in PHP file, or at end of file + 'NonBoolBranchPlugin', // Requires test on bool, nont on ints + 'NonBoolInLogicalArithPlugin', + 'NumericalComparisonPlugin', + 'PHPDocToRealTypesPlugin', + 'PHPDocInWrongCommentPlugin', // Missing /** (/* was used) + //'ShortArrayPlugin', // Checks that [] is used + //'StrictLiteralComparisonPlugin', + 'UnknownClassElementAccessPlugin', + 'UnknownElementTypePlugin', + 'WhitespacePlugin', + //'RemoveDebugStatementPlugin', // Reports echo, print, ... + //'StrictComparisonPlugin', // Expects === + 'SuspiciousParamOrderPlugin', + 'UnsafeCodePlugin', + //'UnusedSuppressionPlugin', + + 'AlwaysReturnPlugin', + //'DollarDollarPlugin', + 'DuplicateArrayKeyPlugin', + 'DuplicateExpressionPlugin', + 'PregRegexCheckerPlugin', + 'PrintfCheckerPlugin', + 'SleepCheckerPlugin', + // Checks for syntactically unreachable statements in + // the global scope or function bodies. + 'UnreachableCodePlugin', + 'UseReturnValuePlugin', + 'EmptyStatementListPlugin', + 'LoopVariableReusePlugin', + */ + ], + + // Add any issue types (such as 'PhanUndeclaredMethod') + // here to inhibit them from being reported + 'suppress_issue_types' => [ + 'PhanPluginWhitespaceTab', // Dolibarr used tabs + 'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility + 'PhanPluginShortArray', // Dolibarr uses array() + 'PhanPluginShortArrayList', // Dolibarr uses array() + // The following may require that --quick is not used + // Fixers From PHPDocToRealTypesPlugin: + 'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string) + 'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string) + 'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition + 'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition + + 'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences + 'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences + 'PhanTypeMismatchArgument', // Not essential - 12300+ occurrences + 'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences + 'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences + 'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences + 'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences + + ], + // You can put relative paths to internal stubs in this config option. + // Phan will continue using its detailed type annotations, + // but load the constants, classes, functions, and classes (and their Reflection types) + // from these stub files (doubling as valid php files). + // Use a different extension from php (and preferably a separate folder) + // to avoid accidentally parsing these as PHP (includes projects depending on this). + // The 'mkstubs' script can be used to generate your own stubs (compatible with php 7.0+ right now) + // Note: The array key must be the same as the extension name reported by `php -m`, + // so that phan can skip loading the stubs if the extension is actually available. + 'autoload_internal_extension_signatures' => [ + // Stubs may be available at https://github.com/JetBrains/phpstorm-stubs/tree/master + + // Xdebug stubs are bundled with Phan 0.10.1+/0.8.9+ for usage, + // because Phan disables xdebug by default. + //'xdebug' => 'vendor/phan/phan/.phan/internal_stubs/xdebug.phan_php', + //'memcached' => PHAN_DIR . '/your_internal_stubs_folder_name/memcached.phan_php', + //'PDO' => PHAN_DIR . '/stubs/PDO.phan_php', + 'brotli' => PHAN_DIR . '/stubs/brotli.phan_php', + 'curl' => PHAN_DIR . '/stubs/curl.phan_php', + 'calendar' => PHAN_DIR . '/stubs/calendar.phan_php', + 'fileinfo' => PHAN_DIR . '/stubs/fileinfo.phan_php', + 'ftp' => PHAN_DIR . '/stubs/ftp.phan_php', + 'gd' => PHAN_DIR . '/stubs/gd.phan_php', + 'geoip' => PHAN_DIR . '/stubs/geoip.phan_php', + 'imap' => PHAN_DIR . '/stubs/imap.phan_php', + 'intl' => PHAN_DIR . '/stubs/intl.phan_php', + 'ldap' => PHAN_DIR . '/stubs/ldap.phan_php', + 'mcrypt' => PHAN_DIR . '/stubs/mcrypt.phan_php', + 'memcache' => PHAN_DIR . '/stubs/memcache.phan_php', + 'mysqli' => PHAN_DIR . '/stubs/mysqli.phan_php', + 'pdo_cubrid' => PHAN_DIR . '/stubs/pdo_cubrid.phan_php', + 'pdo_mysql' => PHAN_DIR . '/stubs/pdo_mysql.phan_php', + 'pdo_pgsql' => PHAN_DIR . '/stubs/pdo_pgsql.phan_php', + 'pdo_sqlite' => PHAN_DIR . '/stubs/pdo_sqlite.phan_php', + 'pgsql' => PHAN_DIR . '/stubs/pgsql.phan_php', + 'session' => PHAN_DIR . '/stubs/session.phan_php', + 'simplexml' => PHAN_DIR . '/stubs/SimpleXML.phan_php', + 'soap' => PHAN_DIR . '/stubs/soap.phan_php', + 'sockets' => PHAN_DIR . '/stubs/sockets.phan_php', + 'zip' => PHAN_DIR . '/stubs/zip.phan_php', + ], + + ]; diff --git a/dev/tools/phan/plugins/ParamMatchRegexPlugin.php b/dev/tools/phan/plugins/ParamMatchRegexPlugin.php new file mode 100644 index 00000000000..248ed72843e --- /dev/null +++ b/dev/tools/phan/plugins/ParamMatchRegexPlugin.php @@ -0,0 +1,248 @@ + + * + * Phan Plugin to validate that arguments match a regex + * + * + * "ParamMatchRegexPlugin" => [ + * "/^test1$/" => [ 0, "/^OK$/"], // Argument 0 must be 'OK' + * "/^test2$/" => [ 1, "/^NOK$/", "Test2Arg1NokError"], // Argument 1 must be 'NOK', error code + * "/^\\MyTest::mymethod$/" => [ 0, "/^NOK$/"], // Argument 0 must be 'NOK' + * ], + * 'plugins' => [ + * ".phan/plugins/ParamMatchRegexPlugin.php", + * // [...] + * ], + */ +declare(strict_types=1); + + +use ast\Node; +use Phan\Config; +use Phan\AST\UnionTypeVisitor; +//use Phan\Language\Element\FunctionInterface; +use Phan\Language\UnionType; +use Phan\Language\Type; +use Phan\PluginV3; +use Phan\PluginV3\PluginAwarePostAnalysisVisitor; +use Phan\PluginV3\PostAnalyzeNodeCapability; +use Phan\Exception\NodeException; +use Phan\Language\FQSEN\FullyQualifiedClassName; +use Phan\Exception\FQSENException; + +/** + * ParamMatchPlugin hooks into one event: + * + * - getPostAnalyzeNodeVisitorClassName + * This method returns a visitor that is called on every AST node from every + * file being analyzed + * + * A plugin file must + * + * - Contain a class that inherits from \Phan\PluginV3 + * + * - End by returning an instance of that class. + * + * It is assumed without being checked that plugins aren't + * mangling state within the passed code base or context. + * + * Note: When adding new plugins, + * add them to the corresponding section of README.md + */ +class ParamMatchPlugin extends PluginV3 implements PostAnalyzeNodeCapability +{ + /** + * @return string - name of PluginAwarePostAnalysisVisitor subclass + */ + public static function getPostAnalyzeNodeVisitorClassName(): string + { + return ParamMatchVisitor::class; + } +} + +/** + * When __invoke on this class is called with a node, a method + * will be dispatched based on the `kind` of the given node. + * + * Visitors such as this are useful for defining lots of different + * checks on a node based on its kind. + */ +class ParamMatchVisitor extends PluginAwarePostAnalysisVisitor +{ + // A plugin's visitors should not override visit() unless they need to. + + /** + * @override + * @param Node $node Node to analyze + * + * @return void + */ + public function visitMethodCall(Node $node): void + { + $method_name = $node->children['method'] ?? null; + if (!\is_string($method_name)) { + return; // Not handled, TODO: handle variable(?) methods + // throw new NodeException($node); + } + try { + // Fetch the list of valid classes, and warn about any undefined classes. + $union_type = UnionTypeVisitor::unionTypeFromNode($this->code_base, $this->context, $node->children['expr']); + } catch (Exception $_) { + // Phan should already throw for this + return; + } + + $class_list = []; + foreach ($union_type->getTypeSet() as $type) { + $class_fqsen = "NoFSQENType"; + if ($type instanceof Type) { + try { + $class_fqsen = (string) FullyQualifiedClassName::fromFullyQualifiedString($type->getName()); + } catch (FQSENException $_) { + // var_dump([$_, $node]); + continue; + } + } else { + // var_dump( $type) ; + continue; + } + $class_name = (string) $class_fqsen; + $class_list[] = $class_name; + } + + /* May need to check list of classes + */ + + /* + if (!$class->hasMethodWithName($this->code_base, $method_name, true)) { + throw new NodeException($expr, 'does not have method'); + } + $class_name = $class->getName(); + */ + foreach ($class_list as $class_name) { + $this->checkRule($node, "$class_name::$method_name"); + } + } + + /** + * @override + * @param Node $node Node to analyze + * + * @return void + */ + public function visitStaticCall(Node $node): void + { + $class_name = $node->children['class']->children['name'] ?? null; + if (!\is_string($class_name)) { + throw new NodeException($expr, 'does not have class'); + } + try { + $class_name = (string) FullyQualifiedClassName::fromFullyQualifiedString($class_name); + } catch (FQSENException $_) { + } + $method_name = $node->children['method'] ?? null; + + if (!\is_string($method_name)) { + return; + } + $this->checkRule($node, "$class_name::$method_name"); + } + /** + * @override + * + * @param Node $node A node to analyze + * + * @return void + */ + public function visitCall(Node $node): void + { + $name = $node->children['expr']->children['name'] ?? null; + if (!\is_string($name)) { + return; + } + + + $this->checkRule($node, $name); + } + + /** + * + * @param Node $node A node to analyze + * @param string $name function name or fqsn of class:: + * + * @return void + */ + public function checkRule(Node $node, string $name) + { + $rules = Config::getValue('ParamMatchRegexPlugin'); + foreach ($rules as $regex => $rule) { + if (preg_match($regex, $name)) { + $this->checkParam($node, $rule[0], $rule[1], $name, $rule[2] ?? null); + } + } + } + + /** + * Check that argument matches regex at node + * + * @param Node $node Visited node for which to verify arguments match regex + * @param int $argPosition Position of argument to check + * @param string $argRegex Regex to validate against argument + * @param string $functionName Function name for report + * @param string $messageCode Message code to provide in message + * + * @return void + */ + public function checkParam(Node $node, int $argPosition, string $argRegex, $functionName, $messageCode = null): void + { + $args = $node->children['args']->children; + + if (!array_key_exists($argPosition, $args)) { + /* + $this->emitPluginIssue( + $this->code_base, + $this->context, + 'ParamMatchMissingArgument', + "Argument at %s for %s is missing", + [$argPosition, $function_name] + ); + */ + return; + } + $expr = $args[$argPosition]; + try { + $expr_type = UnionTypeVisitor::unionTypeFromNode($this->code_base, $this->context, $expr, false); + } catch (Exception $_) { + return; + } + + $expr_value = $expr_type->getRealUnionType()->asValueOrNullOrSelf(); + if (!is_object($expr_value)) { + $list = [(string) $expr_value]; + } elseif ($expr_value instanceof UnionType) { + $list = $expr_value->asScalarValues(); + } else { + // Note: maybe more types could be supported + return; + } + + foreach ($list as $argValue) { + if (!\preg_match($argRegex, (string) $argValue)) { + // Emit an issue if the argument does not match the expected regex pattern + // var_dump([$node,$expr_value,$expr_type->getRealUnionType()]); // Information about node + $this->emitPluginIssue( + $this->code_base, + $this->context, + $messageCode ?? 'ParamMatchRegexError', + "Argument {INDEX} function {FUNCTION} can have value {STRING_LITERAL} that does not match the expected pattern '{STRING_LITERAL}'", + [$argPosition, $functionName, json_encode($argValue), $argRegex] + ); + } + } + } +} + +// Every plugin needs to return an instance of itself at the +// end of the file in which it's defined. +return new ParamMatchPlugin(); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 42d1f1df716..40e1aa39219 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -932,6 +932,7 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null $out = preg_replace('/([<>])([-+]?\d)/', '\1 \2', $out); } + // @phan-suppress-next-line ParamMatchRegexError $out = sanitizeVal($out, $check, $filter, $options); } diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index aa0d49399a4..61c41d0782c 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -4186,6 +4186,7 @@ if ($module == 'initmodule') { print ''.img_picto($langs->trans("Delete"), 'delete').''; print $form->textwithpicto('', $langs->trans("InfoForApiFile"), 1, 'warning'); print '   '; + // @phan-suppress-next-line ParamMatchRegexError if (!isModEnabled($modulelowercase)) { // If module is not activated print ''.$langs->trans("ApiExplorer").''; } else { From 02ec0bcd74944836f6d1aed671a5e12a13971435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 00:14:34 +0100 Subject: [PATCH 69/84] fix phan (#28444) --- htdocs/accountancy/admin/account.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index b914ef5f769..5fff15480e0 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -152,6 +152,7 @@ if (empty($reshook)) { $error = 0; if ($chartofaccounts > 0 && $permissiontoadd) { + $country_code = ''; // Get language code for this $chartofaccounts $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a'; $sql .= ' WHERE c.rowid = a.fk_country AND a.rowid = '.(int) $chartofaccounts; From cadbb0cea1f58f35fdf10ec47566ed6ce89daecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 00:14:53 +0100 Subject: [PATCH 70/84] fix phpstan (#28445) Default value of the parameter #9 $fk_unit (string) of method BOM::addLine() is incompatible with type int. --- htdocs/bom/class/bom.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 6935ac2594d..e36415b4077 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -600,7 +600,7 @@ class BOM extends CommonObject * @param int $fk_default_workstation Default workstation * @return int Return integer <0 if KO, Id of created object if OK */ - public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit = '', $array_options = array(), $fk_default_workstation = null) + public function addLine($fk_product, $qty, $qty_frozen = 0, $disable_stock_change = 0, $efficiency = 1.0, $position = -1, $fk_bom_child = null, $import_key = null, $fk_unit = 0, $array_options = array(), $fk_default_workstation = null) { global $mysoc, $conf, $langs, $user; From 148d6d4c39aaf809e90c780728c45f7936797444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 00:15:57 +0100 Subject: [PATCH 71/84] add arrayfields in parameters for hook printFieldPreListTitle (#28428) * add search member status if column not displayed * Update list.php --- htdocs/adherents/list.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 5ab338489de..d2297697632 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -5,7 +5,7 @@ * Copyright (C) 2013-2015 Raphaël Doursenaud * Copyright (C) 2014-2016 Juanjo Menent * Copyright (C) 2018 Alexandre Spangaro - * Copyright (C) 2021-2023 Frédéric France + * Copyright (C) 2021-2023 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -815,6 +815,10 @@ if ($search_all) { print '
'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'
'."\n"; } +$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; +$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields +$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); + $moreforfilter = ''; // Filter on categories if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { @@ -823,7 +827,9 @@ if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1, $langs->trans("MembersCategoriesShort")); $moreforfilter .= ''; } -$parameters = array(); +$parameters = array( + 'arrayfields' => &$arrayfields, +); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $moreforfilter .= $hookmanager->resPrint; @@ -839,10 +845,6 @@ if (!empty($moreforfilter)) { print ''; } -$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields -$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); - print '
'; print '
'.$langs->trans("MailFrom").'
'.$langs->trans("MailErrorsTo").'
'.$langs-> // Name print '
'; -print '
'; -print '
'; -print '
'; -print '
'; @@ -481,13 +482,19 @@ print '
'; print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth'); -print '
'; +print img_picto('', 'object_phoning_mobile', '', false, 0, 0, '', 'pictofixedwidth'); +print '
'; print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth'); -print '
'.yn($obj->billed).''.yn($obj->billed, 4).'
'.$langs->trans('Image').''.$langs->trans('Example').': fa-global
'.$langs->trans('Example').': fa-global
'.$langs->trans('URL').'
'.$langs->trans("ReminderTime").''; - print ' '; + print ' '; print $form->selectTypeDuration('offsetunit', 'i', array('y', 'm')); print '
'."\n"; From ce56fee2b46e50648d9a961f038c5be8d62897bc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2024 12:28:16 +0100 Subject: [PATCH 72/84] Fix fatal error class not found --- htdocs/accountancy/admin/productaccount.php | 9 ++++----- htdocs/compta/bank/list.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_list.php | 13 +++---------- htdocs/product/inventory/list.php | 4 +--- htdocs/product/stock/list.php | 1 - htdocs/projet/list.php | 1 - htdocs/projet/tasks/list.php | 7 ++++--- 7 files changed, 13 insertions(+), 24 deletions(-) diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 8eca43948e6..66b120cf1d5 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -26,17 +26,16 @@ * \brief To define accounting account on product / service */ require '../../main.inc.php'; - +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; -if (isModEnabled('categorie')) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -} +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "compta", "accountancy", "products")); diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 3c8d4a68aaa..1a66ee4b4bb 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -28,11 +28,11 @@ // Load Dolibarr environment require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; } diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index c56bb6aef75..97d48d8d00d 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -25,20 +25,13 @@ // Load Dolibarr environment require '../main.inc.php'; - -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; - -// load knowledgemanagement libraries require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php'; - -// for other modules -if (isModEnabled('categorie')) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -} -//dol_include_once('/othermodule/class/otherobject.class.php'); +require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; // Load translation files required by the page $langs->loadLangs(array("knowledgemanagement", "other")); diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 947de8a3fc9..396aca79e25 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -23,13 +23,11 @@ // Load Dolibarr environment require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/product/inventory/class/inventory.class.php'; -if (isModEnabled('categorie')) { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -} // Load translation files required by the page $langs->loadLangs(array("stocks", "other")); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 8fc6a31c813..919566195f4 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -29,7 +29,6 @@ // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; - if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index 55937976c50..1d3f9ee94bc 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -37,7 +37,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; - if (isModEnabled('categorie')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 1394d6da1fd..e6ace40c941 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -27,11 +27,12 @@ */ require "../../main.inc.php"; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; // Load translation files required by the page $langs->loadLangs(array('projects', 'users', 'companies')); From 9e2ae31af742a360860ae1c0f91f73af55154d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 14:00:46 +0100 Subject: [PATCH 73/84] fix phpstan (#28453) --- htdocs/product/class/html.formproduct.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 7a563ac4c91..282917f2099 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -627,7 +627,7 @@ class FormProduct * @param string $selected Preselected value * @param int $mode 1=Use label as value, 0=Use code * @param int $showempty 1=show empty value, 0= no - * @return string + * @return string|int */ public function selectProductNature($name = 'finished', $selected = '', $mode = 0, $showempty = 1) { From 1122805bf046403d2741cfd6f563a13fd3953695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 14:01:09 +0100 Subject: [PATCH 74/84] fix phpstan (#28454) --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 113d7f8742c..c061fa61c19 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -64,7 +64,7 @@ class pdf_azur extends ModelePDFPropales public $description; /** - * @var string Save the name of generated file as the main doc when generating a doc with this template + * @var int Save the name of generated file as the main doc when generating a doc with this template */ public $update_main_doc_field; From 36f890f973d717754ad2cdc20bf68be0c66cc251 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 27 Feb 2024 14:05:53 +0100 Subject: [PATCH 75/84] Fix: GETPOST(...,'int') to GETPOSTINT(...) (#28448) * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: Update spelling exceptions * Qual: Ignore Phan Notice --- .../codespell/codespell-lines-ignore.txt | 31 +-- htdocs/accountancy/admin/account.php | 20 +- htdocs/accountancy/admin/accountmodel.php | 6 +- htdocs/accountancy/admin/card.php | 4 +- htdocs/accountancy/admin/categories.php | 10 +- htdocs/accountancy/admin/categories_list.php | 10 +- htdocs/accountancy/admin/defaultaccounts.php | 8 +- htdocs/accountancy/admin/export.php | 2 +- htdocs/accountancy/admin/fiscalyear.php | 4 +- htdocs/accountancy/admin/fiscalyear_card.php | 6 +- htdocs/accountancy/admin/fiscalyear_info.php | 2 +- htdocs/accountancy/admin/index.php | 26 +- htdocs/accountancy/admin/journals_list.php | 6 +- htdocs/accountancy/admin/productaccount.php | 8 +- htdocs/accountancy/admin/subaccount.php | 10 +- htdocs/accountancy/bookkeeping/balance.php | 22 +- htdocs/accountancy/bookkeeping/card.php | 4 +- htdocs/accountancy/bookkeeping/export.php | 78 +++--- htdocs/accountancy/bookkeeping/list.php | 76 +++--- .../accountancy/bookkeeping/listbyaccount.php | 52 ++-- htdocs/accountancy/closure/index.php | 20 +- htdocs/accountancy/customer/card.php | 4 +- htdocs/accountancy/customer/index.php | 8 +- htdocs/accountancy/customer/lines.php | 22 +- htdocs/accountancy/customer/list.php | 20 +- htdocs/accountancy/expensereport/card.php | 4 +- htdocs/accountancy/expensereport/index.php | 8 +- htdocs/accountancy/expensereport/lines.php | 22 +- htdocs/accountancy/expensereport/list.php | 16 +- htdocs/accountancy/index.php | 4 +- htdocs/accountancy/journal/bankjournal.php | 14 +- .../journal/expensereportsjournal.php | 2 +- .../accountancy/journal/purchasesjournal.php | 2 +- htdocs/accountancy/journal/sellsjournal.php | 2 +- htdocs/accountancy/journal/variousjournal.php | 2 +- htdocs/accountancy/supplier/card.php | 4 +- htdocs/accountancy/supplier/index.php | 8 +- htdocs/accountancy/supplier/lines.php | 22 +- htdocs/accountancy/supplier/list.php | 20 +- htdocs/adherents/admin/member_emails.php | 2 +- htdocs/adherents/admin/website.php | 2 +- htdocs/adherents/agenda.php | 6 +- .../actions_adherentcard_common.class.php | 8 +- htdocs/adherents/card.php | 42 ++-- htdocs/adherents/document.php | 6 +- htdocs/adherents/index.php | 4 +- htdocs/adherents/ldap.php | 2 +- htdocs/adherents/list.php | 22 +- htdocs/adherents/note.php | 2 +- htdocs/adherents/partnership.php | 6 +- htdocs/adherents/stats/index.php | 4 +- htdocs/adherents/subscription.php | 50 ++-- htdocs/adherents/subscription/card.php | 6 +- htdocs/adherents/subscription/info.php | 2 +- htdocs/adherents/subscription/list.php | 10 +- htdocs/adherents/type.php | 14 +- htdocs/adherents/type_ldap.php | 2 +- htdocs/adherents/type_translation.php | 4 +- htdocs/adherents/vcard.php | 2 +- htdocs/admin/accountant.php | 8 +- htdocs/admin/agenda_extsites.php | 2 +- htdocs/admin/agenda_xcal.php | 4 +- htdocs/admin/barcode.php | 2 +- htdocs/admin/boxes.php | 8 +- htdocs/admin/company.php | 4 +- htdocs/admin/const.php | 10 +- htdocs/admin/debugbar.php | 4 +- htdocs/admin/defaultvalues.php | 6 +- htdocs/admin/delais.php | 2 +- htdocs/admin/dict.php | 24 +- htdocs/admin/dolistore/ajax/image.php | 4 +- htdocs/admin/emailcollector_card.php | 10 +- htdocs/admin/emailcollector_list.php | 14 +- htdocs/admin/events.php | 4 +- htdocs/admin/expensereport.php | 6 +- htdocs/admin/expensereport_rules.php | 6 +- htdocs/admin/external_rss.php | 18 +- htdocs/admin/facture.php | 2 +- htdocs/admin/hrm.php | 2 +- htdocs/admin/ihm.php | 10 +- htdocs/admin/ldap.php | 4 +- htdocs/admin/limits.php | 4 +- htdocs/admin/mailing.php | 4 +- htdocs/admin/mails.php | 16 +- htdocs/admin/mails_senderprofile_list.php | 34 +-- htdocs/admin/mails_templates.php | 20 +- htdocs/admin/menus/edit.php | 18 +- htdocs/admin/menus/index.php | 14 +- htdocs/admin/modulehelp.php | 2 +- htdocs/admin/modules.php | 8 +- htdocs/admin/multicurrency.php | 4 +- htdocs/admin/payment.php | 2 +- htdocs/admin/paymentbybanktransfer.php | 6 +- htdocs/admin/pdf.php | 2 +- htdocs/admin/pdf_other.php | 8 +- htdocs/admin/perms.php | 4 +- htdocs/admin/prelevement.php | 6 +- htdocs/admin/receiptprinter.php | 8 +- htdocs/admin/supplier_payment.php | 2 +- htdocs/admin/taxes.php | 4 +- htdocs/admin/ticket.php | 8 +- htdocs/admin/ticket_public.php | 2 +- htdocs/admin/tools/dolibarr_export.php | 4 +- htdocs/admin/tools/export.php | 8 +- htdocs/admin/tools/export_files.php | 4 +- htdocs/admin/tools/listevents.php | 14 +- htdocs/admin/tools/listsessions.php | 4 +- htdocs/admin/translation.php | 14 +- htdocs/admin/website.php | 6 +- htdocs/admin/website_options.php | 4 +- htdocs/asset/accountancy_codes.php | 2 +- htdocs/asset/agenda.php | 6 +- htdocs/asset/card.php | 22 +- .../class/assetdepreciationoptions.class.php | 6 +- htdocs/asset/depreciation.php | 2 +- htdocs/asset/depreciation_options.php | 2 +- htdocs/asset/disposal.php | 2 +- htdocs/asset/document.php | 6 +- htdocs/asset/list.php | 14 +- htdocs/asset/model/accountancy_codes.php | 2 +- htdocs/asset/model/agenda.php | 6 +- htdocs/asset/model/card.php | 2 +- htdocs/asset/model/depreciation_options.php | 2 +- htdocs/asset/model/list.php | 14 +- htdocs/asset/model/note.php | 2 +- htdocs/asset/note.php | 2 +- .../tpl/depreciation_options_edit.tpl.php | 2 +- htdocs/barcode/printsheet.php | 18 +- htdocs/blockedlog/admin/blockedlog.php | 2 +- htdocs/blockedlog/admin/blockedlog_list.php | 36 +-- htdocs/blockedlog/ajax/block-add.php | 2 +- htdocs/blockedlog/ajax/block-info.php | 2 +- htdocs/bom/ajax/ajax.php | 2 +- htdocs/bom/bom_agenda.php | 8 +- htdocs/bom/bom_card.php | 22 +- htdocs/bom/bom_document.php | 6 +- htdocs/bom/bom_list.php | 20 +- htdocs/bom/bom_net_needs.php | 4 +- htdocs/bom/bom_note.php | 2 +- htdocs/bom/tpl/objectline_create.tpl.php | 4 +- htdocs/bom/tpl/objectline_edit.tpl.php | 4 +- htdocs/bookcal/availabilities_agenda.php | 6 +- htdocs/bookcal/availabilities_card.php | 12 +- htdocs/bookcal/availabilities_contact.php | 10 +- htdocs/bookcal/availabilities_document.php | 6 +- htdocs/bookcal/availabilities_list.php | 22 +- htdocs/bookcal/availabilities_note.php | 2 +- htdocs/bookcal/bookcalindex.php | 2 +- htdocs/bookcal/booking_list.php | 4 +- htdocs/bookcal/calendar_agenda.php | 6 +- htdocs/bookcal/calendar_card.php | 12 +- htdocs/bookcal/calendar_contact.php | 10 +- htdocs/bookcal/calendar_document.php | 6 +- htdocs/bookcal/calendar_list.php | 22 +- htdocs/bookcal/calendar_note.php | 2 +- htdocs/bookmarks/card.php | 16 +- htdocs/bookmarks/list.php | 10 +- htdocs/categories/card.php | 10 +- htdocs/categories/edit.php | 10 +- htdocs/categories/index.php | 4 +- htdocs/categories/info.php | 2 +- htdocs/categories/photos.php | 2 +- htdocs/categories/traduction.php | 2 +- htdocs/categories/viewcat.php | 12 +- htdocs/collab/index.php | 2 +- htdocs/comm/action/card.php | 120 ++++----- htdocs/comm/action/document.php | 8 +- htdocs/comm/action/index.php | 40 +-- htdocs/comm/action/info.php | 2 +- htdocs/comm/action/list.php | 78 +++--- htdocs/comm/action/pertype.php | 32 +-- htdocs/comm/action/peruser.php | 36 +-- htdocs/comm/action/rapport/index.php | 8 +- htdocs/comm/card.php | 16 +- htdocs/comm/contact.php | 6 +- htdocs/comm/index.php | 4 +- htdocs/comm/mailing/advtargetemailing.php | 28 +-- htdocs/comm/mailing/card.php | 2 +- htdocs/comm/mailing/cibles.php | 14 +- htdocs/comm/mailing/info.php | 2 +- htdocs/comm/mailing/list.php | 8 +- htdocs/comm/mailing/note.php | 2 +- htdocs/comm/multiprix.php | 6 +- htdocs/comm/propal/agenda.php | 6 +- htdocs/comm/propal/card.php | 114 ++++----- htdocs/comm/propal/contact.php | 8 +- htdocs/comm/propal/document.php | 6 +- htdocs/comm/propal/index.php | 2 +- htdocs/comm/propal/list.php | 78 +++--- htdocs/comm/propal/note.php | 2 +- htdocs/comm/propal/stats/index.php | 6 +- htdocs/comm/prospect/index.php | 2 +- htdocs/comm/recap-client.php | 2 +- htdocs/comm/remise.php | 12 +- htdocs/comm/remx.php | 6 +- htdocs/commande/agenda.php | 6 +- htdocs/commande/card.php | 76 +++--- htdocs/commande/contact.php | 8 +- htdocs/commande/customer.php | 4 +- htdocs/commande/document.php | 6 +- htdocs/commande/index.php | 2 +- htdocs/commande/list.php | 60 ++--- htdocs/commande/list_det.php | 52 ++-- htdocs/commande/note.php | 4 +- htdocs/commande/stats/index.php | 4 +- htdocs/compta/accounting-files.php | 36 +-- htdocs/compta/ajaxpayment.php | 2 +- .../bank/account_statement_document.php | 6 +- htdocs/compta/bank/bankentries_list.php | 60 ++--- htdocs/compta/bank/card.php | 44 ++-- htdocs/compta/bank/document.php | 6 +- htdocs/compta/bank/graph.php | 10 +- htdocs/compta/bank/info.php | 4 +- htdocs/compta/bank/line.php | 18 +- htdocs/compta/bank/list.php | 6 +- htdocs/compta/bank/releve.php | 8 +- htdocs/compta/bank/transfer.php | 16 +- htdocs/compta/bank/treso.php | 4 +- .../compta/bank/various_payment/document.php | 8 +- htdocs/compta/bank/various_payment/info.php | 4 +- htdocs/compta/bank/various_payment/list.php | 30 +-- .../compta/cashcontrol/cashcontrol_card.php | 24 +- .../compta/cashcontrol/cashcontrol_list.php | 18 +- htdocs/compta/cashcontrol/report.php | 2 +- htdocs/compta/charges/index.php | 8 +- htdocs/compta/clients.php | 4 +- htdocs/compta/deplacement/card.php | 32 +-- htdocs/compta/deplacement/document.php | 6 +- htdocs/compta/deplacement/index.php | 8 +- htdocs/compta/deplacement/info.php | 2 +- htdocs/compta/deplacement/list.php | 8 +- htdocs/compta/deplacement/stats/index.php | 6 +- htdocs/compta/facture/agenda-rec.php | 6 +- htdocs/compta/facture/agenda.php | 6 +- htdocs/compta/facture/card-rec.php | 52 ++-- htdocs/compta/facture/card.php | 238 +++++++++--------- htdocs/compta/facture/class/facture.class.php | 6 +- htdocs/compta/facture/contact.php | 10 +- htdocs/compta/facture/document.php | 8 +- htdocs/compta/facture/index.php | 2 +- .../compta/facture/invoicetemplate_list.php | 40 +-- htdocs/compta/facture/list.php | 26 +- htdocs/compta/facture/note.php | 4 +- htdocs/compta/facture/prelevement.php | 18 +- htdocs/compta/facture/stats/index.php | 6 +- htdocs/compta/index.php | 2 +- htdocs/compta/localtax/card.php | 10 +- htdocs/compta/localtax/clients.php | 8 +- htdocs/compta/localtax/index.php | 16 +- htdocs/compta/localtax/list.php | 6 +- htdocs/compta/localtax/quadri_detail.php | 16 +- htdocs/compta/paiement.php | 8 +- htdocs/compta/paiement/card.php | 8 +- htdocs/compta/paiement/cheque/card.php | 38 +-- htdocs/compta/paiement/cheque/list.php | 18 +- htdocs/compta/paiement/info.php | 2 +- htdocs/compta/paiement/list.php | 26 +- htdocs/compta/paiement/rapport.php | 6 +- htdocs/compta/paiement/tovalidate.php | 4 +- htdocs/compta/paiement_charge.php | 8 +- htdocs/compta/paiement_vat.php | 16 +- htdocs/compta/payment_sc/card.php | 2 +- htdocs/compta/payment_vat/card.php | 2 +- htdocs/compta/paymentbybanktransfer/index.php | 2 +- htdocs/compta/prelevement/card.php | 16 +- htdocs/compta/prelevement/create.php | 12 +- htdocs/compta/prelevement/demandes.php | 8 +- htdocs/compta/prelevement/factures.php | 10 +- htdocs/compta/prelevement/fiche-rejet.php | 6 +- htdocs/compta/prelevement/fiche-stat.php | 6 +- htdocs/compta/prelevement/index.php | 2 +- htdocs/compta/prelevement/line.php | 18 +- htdocs/compta/prelevement/list.php | 10 +- htdocs/compta/prelevement/orders_list.php | 8 +- htdocs/compta/prelevement/rejets.php | 6 +- htdocs/compta/prelevement/stats.php | 2 +- htdocs/compta/recap-compta.php | 6 +- htdocs/compta/resultat/clientfourn.php | 24 +- htdocs/compta/resultat/index.php | 20 +- htdocs/compta/resultat/result.php | 24 +- htdocs/compta/sociales/card.php | 30 +-- htdocs/compta/sociales/document.php | 6 +- htdocs/compta/sociales/info.php | 4 +- htdocs/compta/sociales/list.php | 42 ++-- htdocs/compta/sociales/note.php | 4 +- htdocs/compta/sociales/payments.php | 8 +- htdocs/compta/stats/byratecountry.php | 10 +- htdocs/compta/stats/cabyprodserv.php | 10 +- htdocs/compta/stats/cabyuser.php | 18 +- htdocs/compta/stats/casoc.php | 22 +- htdocs/compta/stats/index.php | 22 +- htdocs/compta/stats/supplier_turnover.php | 20 +- .../stats/supplier_turnover_by_prodserv.php | 10 +- .../stats/supplier_turnover_by_thirdparty.php | 10 +- htdocs/compta/tva/card.php | 26 +- htdocs/compta/tva/document.php | 6 +- htdocs/compta/tva/index.php | 8 +- htdocs/compta/tva/info.php | 4 +- htdocs/compta/tva/initdatesforvat.inc.php | 10 +- htdocs/compta/tva/list.php | 48 ++-- htdocs/compta/tva/payments.php | 6 +- htdocs/contact/agenda.php | 8 +- .../actions_contactcard_common.class.php | 2 +- htdocs/contact/card.php | 36 +-- htdocs/contact/consumption.php | 10 +- htdocs/contact/document.php | 6 +- htdocs/contact/info.php | 2 +- htdocs/contact/ldap.php | 2 +- htdocs/contact/list.php | 36 +-- htdocs/contact/note.php | 2 +- htdocs/contact/perso.php | 2 +- htdocs/contact/project.php | 2 +- htdocs/contact/vcard.php | 2 +- htdocs/contrat/agenda.php | 6 +- htdocs/contrat/card.php | 52 ++-- htdocs/contrat/contact.php | 8 +- htdocs/contrat/document.php | 6 +- htdocs/contrat/index.php | 4 +- htdocs/contrat/list.php | 64 ++--- htdocs/contrat/messaging.php | 8 +- htdocs/contrat/note.php | 4 +- htdocs/contrat/services_list.php | 28 +-- htdocs/contrat/ticket.php | 4 +- htdocs/core/actions_addupdatedelete.inc.php | 20 +- htdocs/core/actions_builddoc.inc.php | 4 +- htdocs/core/actions_dellink.inc.php | 4 +- htdocs/core/actions_extrafields.inc.php | 4 +- htdocs/core/actions_linkedfiles.inc.php | 12 +- htdocs/core/actions_massactions.inc.php | 8 +- htdocs/core/actions_setmoduleoptions.inc.php | 4 +- htdocs/core/actions_setnotes.inc.php | 6 +- htdocs/core/ajax/ajaxdirpreview.php | 6 +- htdocs/core/ajax/ajaxdirtree.php | 2 +- htdocs/core/ajax/ajaxinvoiceline.php | 2 +- htdocs/core/ajax/ajaxstatusprospect.php | 4 +- htdocs/core/ajax/ajaxtooltip.php | 2 +- htdocs/core/ajax/bankconciliate.php | 16 +- htdocs/core/ajax/box.php | 6 +- htdocs/core/ajax/check_notifications.php | 2 +- htdocs/core/ajax/constantonoff.php | 2 +- htdocs/core/ajax/contacts.php | 4 +- htdocs/core/ajax/extraparams.php | 2 +- htdocs/core/ajax/fileupload.php | 2 +- htdocs/core/ajax/objectonoff.php | 4 +- htdocs/core/ajax/selectobject.php | 2 +- htdocs/core/ajax/vatrates.php | 4 +- htdocs/core/bookmarks_page.php | 6 +- .../boxes/box_graph_invoices_permonth.php | 2 +- .../core/boxes/box_graph_invoices_peryear.php | 2 +- .../box_graph_invoices_supplier_permonth.php | 2 +- .../core/boxes/box_graph_orders_permonth.php | 2 +- .../box_graph_orders_supplier_permonth.php | 2 +- .../boxes/box_graph_product_distribution.php | 2 +- .../boxes/box_graph_propales_permonth.php | 2 +- htdocs/core/class/commonobject.class.php | 8 +- htdocs/core/class/extrafields.class.php | 32 +-- htdocs/core/class/html.formmail.class.php | 2 +- htdocs/core/class/html.formsetup.class.php | 4 +- htdocs/core/class/html.formticket.class.php | 10 +- htdocs/core/datepicker.php | 2 +- htdocs/core/get_info.php | 2 +- htdocs/core/get_menudiv.php | 6 +- htdocs/core/lib/company.lib.php | 22 +- htdocs/core/lib/files.lib.php | 2 +- htdocs/core/lib/security2.lib.php | 16 +- htdocs/core/login/functions_googleoauth.php | 2 +- htdocs/core/login/functions_openid.php | 2 +- htdocs/core/menus/standard/auguria.lib.php | 2 +- htdocs/core/menus/standard/auguria_menu.php | 2 +- htdocs/core/menus/standard/eldy.lib.php | 4 +- htdocs/core/menus/standard/eldy_menu.php | 2 +- .../mailings/eventorganization.modules.php | 4 +- .../core/modules/mailings/fraise.modules.php | 12 +- .../modules/mailings/partnership.modules.php | 8 +- .../modules/mailings/thirdparties.modules.php | 12 +- .../thirdparties_services_expired.modules.php | 2 +- .../movement/doc/pdf_standard.modules.php | 14 +- .../modules/oauth/google_oauthcallback.php | 2 +- htdocs/core/multicompany_page.php | 2 +- htdocs/core/photos_resize.php | 6 +- htdocs/core/search_page.php | 8 +- htdocs/core/tpl/admin_extrafields_add.tpl.php | 6 +- htdocs/core/tpl/card_presend.tpl.php | 2 +- htdocs/core/tpl/commonfields_add.tpl.php | 6 +- htdocs/core/tpl/commonfields_edit.tpl.php | 4 +- htdocs/core/tpl/contacts.tpl.php | 2 +- .../tpl/document_actions_post_headers.tpl.php | 4 +- htdocs/core/tpl/extrafields_view.tpl.php | 4 +- htdocs/core/tpl/massactions_pre.tpl.php | 4 +- htdocs/core/tpl/objectline_create.tpl.php | 4 +- htdocs/core/tpl/objectline_edit.tpl.php | 6 +- htdocs/core/tpl/resource_view.tpl.php | 4 +- htdocs/cron/card.php | 20 +- htdocs/cron/info.php | 2 +- htdocs/cron/list.php | 10 +- htdocs/datapolicy/admin/setup.php | 4 +- htdocs/dav/fileserver.php | 4 +- htdocs/delivery/card.php | 8 +- htdocs/document.php | 2 +- htdocs/don/card.php | 20 +- htdocs/don/document.php | 8 +- htdocs/don/info.php | 4 +- htdocs/don/list.php | 6 +- htdocs/don/note.php | 4 +- htdocs/don/paiement/list.php | 22 +- htdocs/don/payment/card.php | 2 +- htdocs/don/payment/payment.php | 8 +- htdocs/don/stats/index.php | 4 +- htdocs/ecm/dir_add_card.php | 8 +- htdocs/ecm/dir_card.php | 6 +- htdocs/ecm/file_card.php | 6 +- htdocs/ecm/file_note.php | 10 +- htdocs/ecm/index.php | 10 +- htdocs/ecm/index_auto.php | 8 +- htdocs/ecm/index_medias.php | 12 +- htdocs/ecm/search.php | 8 +- .../conferenceorbooth_card.php | 14 +- .../conferenceorbooth_contact.php | 12 +- .../conferenceorbooth_document.php | 8 +- .../conferenceorbooth_list.php | 24 +- .../conferenceorboothattendee_card.php | 16 +- .../conferenceorboothattendee_list.php | 26 +- .../conferenceorboothattendee_note.php | 2 +- .../core/actions_massactions_mail.inc.php | 2 +- htdocs/expedition/ajax/searchfrombarcode.php | 10 +- htdocs/expedition/card.php | 116 ++++----- htdocs/expedition/contact.php | 8 +- htdocs/expedition/dispatch.php | 22 +- htdocs/expedition/document.php | 6 +- htdocs/expedition/index.php | 2 +- htdocs/expedition/list.php | 32 +-- htdocs/expedition/note.php | 2 +- htdocs/expedition/shipment.php | 16 +- htdocs/expedition/stats/index.php | 4 +- htdocs/expedition/stats/month.php | 2 +- htdocs/expensereport/ajax/ajaxik.php | 8 +- htdocs/expensereport/card.php | 62 ++--- htdocs/expensereport/document.php | 6 +- htdocs/expensereport/index.php | 8 +- htdocs/expensereport/info.php | 2 +- htdocs/expensereport/list.php | 36 +-- htdocs/expensereport/note.php | 4 +- htdocs/expensereport/payment/card.php | 2 +- htdocs/expensereport/payment/list.php | 20 +- htdocs/expensereport/payment/payment.php | 8 +- htdocs/expensereport/stats/index.php | 8 +- htdocs/exports/export.php | 8 +- htdocs/externalsite/frames.php | 2 +- htdocs/fichinter/agenda.php | 6 +- htdocs/fichinter/card-rec.php | 18 +- htdocs/fichinter/card.php | 68 ++--- htdocs/fichinter/contact.php | 8 +- htdocs/fichinter/document.php | 6 +- htdocs/fichinter/index.php | 2 +- htdocs/fichinter/list.php | 12 +- htdocs/fichinter/note.php | 2 +- htdocs/fichinter/stats/index.php | 6 +- htdocs/fourn/ajax/getSupplierPrices.php | 2 +- htdocs/fourn/card.php | 8 +- .../fourn/class/fournisseur.facture.class.php | 6 +- htdocs/fourn/commande/card.php | 68 ++--- htdocs/fourn/commande/contact.php | 6 +- htdocs/fourn/commande/dispatch.php | 30 +-- htdocs/fourn/commande/document.php | 6 +- htdocs/fourn/commande/info.php | 6 +- htdocs/fourn/commande/list.php | 78 +++--- htdocs/fourn/commande/note.php | 2 +- htdocs/fourn/contact.php | 6 +- htdocs/fourn/facture/card-rec.php | 80 +++--- htdocs/fourn/facture/card.php | 162 ++++++------ htdocs/fourn/facture/contact.php | 6 +- htdocs/fourn/facture/document.php | 6 +- htdocs/fourn/facture/index.php | 2 +- htdocs/fourn/facture/info.php | 2 +- htdocs/fourn/facture/list-rec.php | 40 +-- htdocs/fourn/facture/list.php | 42 ++-- htdocs/fourn/facture/note.php | 2 +- htdocs/fourn/facture/paiement.php | 8 +- htdocs/fourn/facture/rapport.php | 6 +- htdocs/fourn/index.php | 2 +- htdocs/fourn/paiement/card.php | 4 +- htdocs/fourn/paiement/document.php | 6 +- htdocs/fourn/paiement/info.php | 2 +- htdocs/fourn/paiement/list.php | 22 +- htdocs/fourn/product/list.php | 6 +- htdocs/fourn/recap-fourn.php | 2 +- htdocs/ftp/index.php | 4 +- htdocs/holiday/card.php | 22 +- htdocs/holiday/card_group.php | 18 +- htdocs/holiday/define_holiday.php | 8 +- htdocs/holiday/document.php | 6 +- htdocs/holiday/info.php | 2 +- htdocs/holiday/list.php | 36 +-- htdocs/holiday/month_report.php | 14 +- htdocs/holiday/view_log.php | 16 +- htdocs/hrm/admin/admin_establishment.php | 2 +- htdocs/hrm/establishment/card.php | 12 +- htdocs/hrm/establishment/info.php | 6 +- htdocs/hrm/evaluation_agenda.php | 6 +- htdocs/hrm/evaluation_card.php | 12 +- htdocs/hrm/evaluation_contact.php | 10 +- htdocs/hrm/evaluation_document.php | 6 +- htdocs/hrm/evaluation_list.php | 20 +- htdocs/hrm/evaluation_note.php | 2 +- htdocs/hrm/index.php | 2 +- htdocs/hrm/job_agenda.php | 6 +- htdocs/hrm/job_card.php | 12 +- htdocs/hrm/job_document.php | 6 +- htdocs/hrm/job_list.php | 20 +- htdocs/hrm/job_note.php | 2 +- htdocs/hrm/position.php | 20 +- htdocs/hrm/position_agenda.php | 6 +- htdocs/hrm/position_card.php | 10 +- htdocs/hrm/position_document.php | 6 +- htdocs/hrm/position_list.php | 20 +- htdocs/hrm/position_note.php | 2 +- htdocs/hrm/skill_agenda.php | 6 +- htdocs/hrm/skill_card.php | 18 +- htdocs/hrm/skill_document.php | 6 +- htdocs/hrm/skill_list.php | 20 +- htdocs/hrm/skill_note.php | 2 +- htdocs/hrm/skill_tab.php | 4 +- htdocs/imports/import.php | 6 +- htdocs/index.php | 4 +- .../containers/wrapper.php | 4 +- .../containers/wrapper.php | 4 +- .../containers/wrapper.php | 4 +- .../containers/wrapper.php | 4 +- .../containers/wrapper.php | 4 +- .../containers/wrapper.php | 4 +- htdocs/install/step1.php | 2 +- htdocs/intracommreport/card.php | 2 +- htdocs/intracommreport/list.php | 10 +- .../knowledgemanagementindex.php | 2 +- .../knowledgerecord_agenda.php | 8 +- .../knowledgerecord_card.php | 8 +- .../knowledgerecord_contact.php | 10 +- .../knowledgerecord_document.php | 6 +- .../knowledgerecord_list.php | 22 +- .../knowledgerecord_note.php | 2 +- htdocs/loan/calcmens.php | 4 +- htdocs/loan/card.php | 22 +- htdocs/loan/document.php | 6 +- htdocs/loan/info.php | 4 +- htdocs/loan/list.php | 12 +- htdocs/loan/note.php | 2 +- htdocs/loan/payment/card.php | 2 +- htdocs/loan/payment/payment.php | 15 +- htdocs/loan/schedule.php | 6 +- htdocs/main.inc.php | 64 ++--- htdocs/margin/agentMargins.php | 18 +- htdocs/margin/checkMargins.php | 12 +- htdocs/margin/customerMargins.php | 26 +- htdocs/margin/productMargins.php | 26 +- htdocs/margin/tabs/productMargins.php | 6 +- htdocs/margin/tabs/thirdpartyMargins.php | 6 +- htdocs/master.inc.php | 4 +- htdocs/modulebuilder/index.php | 40 +-- htdocs/mrp/ajax/interface.php | 4 +- htdocs/mrp/mo_agenda.php | 6 +- htdocs/mrp/mo_card.php | 18 +- htdocs/mrp/mo_document.php | 6 +- htdocs/mrp/mo_list.php | 14 +- htdocs/mrp/mo_movements.php | 20 +- htdocs/mrp/mo_note.php | 2 +- htdocs/mrp/mo_production.php | 22 +- htdocs/multicurrency/multicurrency_rate.php | 14 +- htdocs/opensurvey/card.php | 2 +- htdocs/opensurvey/list.php | 8 +- htdocs/partnership/admin/setup.php | 2 +- htdocs/partnership/partnership_agenda.php | 8 +- htdocs/partnership/partnership_card.php | 14 +- htdocs/partnership/partnership_contact.php | 8 +- htdocs/partnership/partnership_document.php | 6 +- htdocs/partnership/partnership_list.php | 24 +- htdocs/partnership/partnership_note.php | 2 +- htdocs/paybox/admin/paybox.php | 2 +- htdocs/paypal/admin/paypal.php | 4 +- htdocs/product/admin/dynamic_prices.php | 12 +- htdocs/product/agenda.php | 6 +- htdocs/product/ajax/product_lot.php | 2 +- htdocs/product/ajax/products.php | 26 +- htdocs/product/card.php | 72 +++--- htdocs/product/composition/card.php | 8 +- htdocs/product/document.php | 6 +- htdocs/product/dynamic_price/editor.php | 4 +- htdocs/product/fournisseurs.php | 10 +- htdocs/product/index.php | 2 +- .../inventory/ajax/searchfrombarcode.php | 10 +- htdocs/product/inventory/card.php | 4 +- htdocs/product/inventory/inventory.php | 16 +- htdocs/product/inventory/list.php | 22 +- htdocs/product/list.php | 28 +-- htdocs/product/note.php | 2 +- htdocs/product/popuprop.php | 6 +- htdocs/product/price.php | 42 ++-- htdocs/product/reassort.php | 14 +- htdocs/product/reassortlot.php | 28 +-- htdocs/product/stats/bom.php | 6 +- htdocs/product/stats/card.php | 16 +- htdocs/product/stats/commande.php | 10 +- htdocs/product/stats/commande_fournisseur.php | 10 +- htdocs/product/stats/contrat.php | 6 +- htdocs/product/stats/facture.php | 6 +- htdocs/product/stats/facture_fournisseur.php | 10 +- htdocs/product/stats/facturerec.php | 10 +- htdocs/product/stats/mo.php | 10 +- htdocs/product/stats/propal.php | 10 +- htdocs/product/stats/supplier_proposal.php | 10 +- htdocs/product/stock/card.php | 16 +- htdocs/product/stock/fiche-valo.php | 2 +- htdocs/product/stock/info.php | 2 +- htdocs/product/stock/list.php | 16 +- htdocs/product/stock/massstockmove.php | 10 +- htdocs/product/stock/movement_card.php | 50 ++-- htdocs/product/stock/movement_list.php | 68 ++--- htdocs/product/stock/product.php | 48 ++-- htdocs/product/stock/productlot_card.php | 26 +- htdocs/product/stock/productlot_document.php | 6 +- htdocs/product/stock/productlot_list.php | 20 +- htdocs/product/stock/productlot_note.php | 2 +- htdocs/product/stock/replenish.php | 22 +- htdocs/product/stock/replenishorders.php | 18 +- .../stock/stats/commande_fournisseur.php | 12 +- htdocs/product/stock/stats/expedition.php | 12 +- htdocs/product/stock/stats/mo.php | 10 +- htdocs/product/stock/stats/reception.php | 12 +- htdocs/product/stock/stockatdate.php | 30 +-- .../stocktransfer/stocktransfer_agenda.php | 6 +- .../stocktransfer/stocktransfer_card.php | 20 +- .../stocktransfer/stocktransfer_contact.php | 6 +- .../stocktransfer/stocktransfer_document.php | 6 +- .../stocktransfer/stocktransfer_list.php | 22 +- .../stocktransfer/stocktransfer_note.php | 2 +- .../product/stock/tpl/stockcorrection.tpl.php | 6 +- .../product/stock/tpl/stocktransfer.tpl.php | 6 +- htdocs/product/stock/valo.php | 2 +- htdocs/product/traduction.php | 4 +- htdocs/projet/activity/index.php | 2 +- htdocs/projet/activity/perday.php | 26 +- htdocs/projet/activity/permonth.php | 26 +- htdocs/projet/activity/perweek.php | 26 +- htdocs/projet/admin/website.php | 4 +- htdocs/projet/agenda.php | 10 +- htdocs/projet/ajax/projects.php | 6 +- htdocs/projet/card.php | 30 +-- htdocs/projet/comment.php | 6 +- htdocs/projet/contact.php | 14 +- htdocs/projet/document.php | 6 +- htdocs/projet/element.php | 4 +- htdocs/projet/index.php | 4 +- htdocs/projet/list.php | 94 +++---- htdocs/projet/messaging.php | 10 +- htdocs/projet/note.php | 2 +- htdocs/projet/stats/index.php | 4 +- htdocs/projet/tasks.php | 46 ++-- htdocs/projet/tasks/comment.php | 10 +- htdocs/projet/tasks/contact.php | 12 +- htdocs/projet/tasks/document.php | 8 +- htdocs/projet/tasks/list.php | 42 ++-- htdocs/projet/tasks/note.php | 4 +- htdocs/projet/tasks/stats/index.php | 4 +- htdocs/projet/tasks/task.php | 12 +- htdocs/projet/tasks/time.php | 162 ++++++------ htdocs/public/agenda/agendaexport.php | 26 +- htdocs/public/bookcal/bookcalAjax.php | 4 +- htdocs/public/bookcal/index.php | 22 +- htdocs/public/company/new.php | 2 +- htdocs/public/demo/index.php | 10 +- .../public/eventorganization/attendee_new.php | 4 +- .../eventorganization/subscriptionok.php | 2 +- htdocs/public/members/new.php | 6 +- htdocs/public/members/public_card.php | 2 +- htdocs/public/members/public_list.php | 4 +- htdocs/public/opensurvey/index.php | 6 +- htdocs/public/opensurvey/studs.php | 2 +- htdocs/public/partnership/new.php | 8 +- htdocs/public/payment/newpayment.php | 32 +-- htdocs/public/payment/paymentok.php | 2 +- htdocs/public/project/index.php | 4 +- htdocs/public/project/new.php | 2 +- htdocs/public/project/suggestbooth.php | 8 +- htdocs/public/project/suggestconference.php | 8 +- htdocs/public/project/viewandvote.php | 2 +- htdocs/public/recruitment/index.php | 6 +- htdocs/public/ticket/ajax/ajax.php | 2 +- htdocs/public/ticket/create_ticket.php | 6 +- htdocs/public/ticket/list.php | 6 +- htdocs/public/users/view.php | 2 +- htdocs/public/website/javascript.js.php | 2 +- htdocs/public/website/styles.css.php | 2 +- htdocs/reception/card.php | 114 ++++----- htdocs/reception/contact.php | 8 +- htdocs/reception/dispatch.php | 26 +- htdocs/reception/document.php | 6 +- htdocs/reception/list.php | 44 ++-- htdocs/reception/note.php | 2 +- htdocs/reception/stats/index.php | 4 +- htdocs/reception/stats/month.php | 8 +- htdocs/recruitment/index.php | 2 +- .../recruitmentcandidature_agenda.php | 8 +- .../recruitmentcandidature_card.php | 14 +- .../recruitmentcandidature_document.php | 6 +- .../recruitmentcandidature_list.php | 16 +- .../recruitmentcandidature_note.php | 2 +- .../recruitmentjobposition_agenda.php | 6 +- .../recruitmentjobposition_applications.php | 6 +- .../recruitmentjobposition_card.php | 12 +- .../recruitmentjobposition_document.php | 6 +- .../recruitmentjobposition_list.php | 14 +- .../recruitmentjobposition_note.php | 2 +- htdocs/resource/agenda.php | 6 +- htdocs/resource/contact.php | 8 +- htdocs/resource/document.php | 6 +- htdocs/resource/element_resource.php | 14 +- htdocs/resource/list.php | 14 +- htdocs/resource/note.php | 2 +- htdocs/salaries/ajax/ajaxsalaries.php | 4 +- htdocs/salaries/card.php | 48 ++-- htdocs/salaries/document.php | 8 +- htdocs/salaries/info.php | 6 +- htdocs/salaries/list.php | 30 +-- htdocs/salaries/paiement_salary.php | 14 +- htdocs/salaries/payment_salary/card.php | 4 +- htdocs/salaries/payments.php | 40 +-- htdocs/salaries/stats/index.php | 8 +- htdocs/salaries/virement_request.php | 8 +- htdocs/societe/admin/societe.php | 20 +- htdocs/societe/agenda.php | 6 +- htdocs/societe/ajax/ajaxcompanies.php | 6 +- htdocs/societe/ajax/company.php | 4 +- htdocs/societe/card.php | 114 ++++----- htdocs/societe/consumption.php | 10 +- htdocs/societe/contact.php | 2 +- htdocs/societe/document.php | 6 +- htdocs/societe/index.php | 6 +- htdocs/societe/list.php | 52 ++-- htdocs/societe/messaging.php | 6 +- htdocs/societe/note.php | 2 +- htdocs/societe/notify/card.php | 10 +- htdocs/societe/paymentmodes.php | 34 +-- htdocs/societe/price.php | 24 +- htdocs/societe/project.php | 4 +- htdocs/societe/societecontact.php | 12 +- htdocs/societe/website.php | 10 +- htdocs/stripe/admin/stripe.php | 8 +- htdocs/stripe/ajax/ajax.php | 4 +- htdocs/stripe/charge.php | 6 +- htdocs/stripe/payout.php | 6 +- htdocs/stripe/transaction.php | 6 +- htdocs/supplier_proposal/card.php | 48 ++-- htdocs/supplier_proposal/contact.php | 6 +- htdocs/supplier_proposal/document.php | 6 +- htdocs/supplier_proposal/index.php | 2 +- htdocs/supplier_proposal/info.php | 4 +- htdocs/supplier_proposal/list.php | 44 ++-- htdocs/supplier_proposal/note.php | 2 +- htdocs/takepos/admin/orderprinters.php | 2 +- htdocs/takepos/admin/printqr.php | 2 +- htdocs/takepos/admin/terminal.php | 4 +- htdocs/takepos/ajax/ajax.php | 12 +- htdocs/takepos/floors.php | 4 +- htdocs/takepos/freezone.php | 2 +- htdocs/takepos/genimg/index.php | 6 +- htdocs/takepos/index.php | 2 +- htdocs/takepos/invoice.php | 2 +- htdocs/takepos/pay.php | 2 +- htdocs/takepos/phone.php | 8 +- htdocs/takepos/printbox.php | 2 +- htdocs/takepos/receipt.php | 6 +- htdocs/takepos/reduction.php | 2 +- htdocs/takepos/send.php | 2 +- htdocs/takepos/split.php | 4 +- htdocs/theme/eldy/info-box.inc.php | 2 +- htdocs/theme/eldy/style.css.php | 2 +- htdocs/theme/md/info-box.inc.php | 4 +- htdocs/theme/md/style.css.php | 2 +- htdocs/ticket/agenda.php | 14 +- htdocs/ticket/card.php | 58 ++--- htdocs/ticket/class/ticket.class.php | 2 +- htdocs/ticket/contact.php | 16 +- htdocs/ticket/document.php | 12 +- htdocs/ticket/index.php | 8 +- htdocs/ticket/list.php | 44 ++-- htdocs/ticket/messaging.php | 14 +- htdocs/ticket/stats/index.php | 6 +- htdocs/user/agenda.php | 6 +- htdocs/user/agenda_extsites.php | 2 +- htdocs/user/bank.php | 12 +- htdocs/user/card.php | 48 ++-- htdocs/user/clicktodial.php | 2 +- htdocs/user/document.php | 6 +- htdocs/user/group/card.php | 6 +- htdocs/user/group/ldap.php | 2 +- htdocs/user/group/list.php | 14 +- htdocs/user/group/perms.php | 8 +- htdocs/user/hierarchy.php | 4 +- htdocs/user/home.php | 4 +- htdocs/user/ldap.php | 2 +- htdocs/user/list.php | 18 +- htdocs/user/messaging.php | 4 +- htdocs/user/note.php | 2 +- htdocs/user/notify/card.php | 10 +- htdocs/user/param_ihm.php | 4 +- htdocs/user/passwordforgotten.php | 6 +- htdocs/user/perms.php | 8 +- htdocs/user/vcard.php | 2 +- htdocs/user/virtualcard.php | 2 +- htdocs/variants/ajax/getCombinations.php | 2 +- htdocs/variants/ajax/get_attribute_values.php | 2 +- htdocs/variants/card.php | 6 +- htdocs/variants/combinations.php | 10 +- htdocs/variants/list.php | 20 +- htdocs/viewimage.php | 2 +- htdocs/webhook/target_card.php | 12 +- htdocs/webhook/target_list.php | 14 +- .../class/html.formcardwebportal.class.php | 6 +- .../class/html.formlistwebportal.class.php | 12 +- .../controllers/document.controller.class.php | 4 +- htdocs/website/index.php | 56 ++--- htdocs/website/samples/wrapper.php | 4 +- htdocs/website/websiteaccount_card.php | 2 +- htdocs/workstation/workstation_agenda.php | 6 +- htdocs/workstation/workstation_card.php | 2 +- htdocs/workstation/workstation_document.php | 6 +- htdocs/workstation/workstation_list.php | 22 +- htdocs/workstation/workstation_note.php | 2 +- 827 files changed, 5130 insertions(+), 5136 deletions(-) diff --git a/dev/tools/codespell/codespell-lines-ignore.txt b/dev/tools/codespell/codespell-lines-ignore.txt index d0ebf648c39..5ddee3b9244 100644 --- a/dev/tools/codespell/codespell-lines-ignore.txt +++ b/dev/tools/codespell/codespell-lines-ignore.txt @@ -28,7 +28,7 @@ $tmpprojtime = $element->getSumOfAmount($idofelementuser ? $elementuser : '', $dates, $datee); // $element is a task. $elementuser may be empty $typea = ($data[$j]->typea == 'birth') ? $picb : $pice; //var_dump("$key, $tablename, $datefieldname, $dates, $datee"); - GETPOST("mouvement", 'int'), + GETPOSTINT("mouvement"), dol_syslog("msgid=".$overview[0]->message_id." date=".dol_print_date($overview[0]->udate, 'dayrfc', 'gmt')." from=".$overview[0]->from." to=".$overview[0]->to." subject=".$overview[0]->subject); if ((empty($dates) && empty($datee)) || (intval($dates) <= $element->datestart && intval($datee) >= $element->dateend)) { jQuery("#mouvement option").removeAttr("selected").change(); @@ -59,20 +59,19 @@ $tmp = array('id_users'=>$obj->id_users, 'nom'=>$obj->name, 'reponses'=>$obj->reponses); $tmpfiles = dol_dir_list($tmpdir, 'files', 0, '\.od(s|t)$', '', 'name', SORT_ASC, 0, true); // Disable hook for the moment //si les reponses ne concerne pas la colonne effacée, on concatenate - GETPOST("mouvement", "int"), GETPOST("mouvement", 'alpha'), - GETPOST("mouvement", 'int'), + GETPOSTINT("mouvement"), foreach ($TWeek as $weekIndex => $weekNb) { if (count($arrayfields) > 0 && !empty($arrayfields['t.datee']['checked'])) { if (jQuery("#mouvement").val() == \'0\') jQuery("#unitprice").removeAttr("disabled"); print ''.$langs->trans("TransferStock").''; print ''; $action = 'transfert'; - $date_com = dol_mktime(GETPOST('rehour', 'int'), GETPOST('remin', 'int'), GETPOST('resec', 'int'), GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $date_com = dol_mktime(GETPOSTINT('rehour'), GETPOSTINT('remin'), GETPOSTINT('resec'), GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); $date_next_execution = (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1); $date_next_execution = dol_mktime($rehour, $remin, 0, $remonth, $reday, $reyear); - $datee = dol_get_last_day(GETPOST('yeartoexport', 'int'), GETPOST('monthtoexport', 'int') ? GETPOST('monthtoexport', 'int') : 12); - $datesubscription = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", "int"), GETPOST("reyear", "int")); + $datee = dol_get_last_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 12); + $datesubscription = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); $ensemblereponses = $obj->reponses; $object->datee = $datee; $object->periode = $dateperiod; @@ -114,20 +113,17 @@ $cle_rib = strtolower(checkES($rib, $CCC)); $date_com = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear")); $date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1); - $datefrom = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); - $datesubscription = dol_mktime(0, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int")); + $datefrom = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); + $datesubscription = dol_mktime(0, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); $datetouse = ($this->date_end > 0) ? $this->date_end : ((isset($this->datee) && $this->datee > 0) ? $this->datee : 0); $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, !empty($project_field) ? $project_field : 'fk_projet'); $ensemblereponses = $obj->reponses; $head[$h][1] = $langs->trans("Referers"); $head[$tab][1] = $langs->trans("Referers"); $out .= "".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"]) ? dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT) : '')."
\n"; - $reday = GETPOST('reday', 'int'); $reday = GETPOSTINT('reday'); $sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_modification, p.budget_amount"; - $sql = "SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount"; $sql = 'SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_modification, p.budget_amount'; - $sql = 'SELECT p.rowid as id, p.entity, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status, p.fk_opp_status, p.opp_amount, p.opp_percent, p.tms as date_update, p.budget_amount'; $sql .= " (cs.periode IS NOT NULL AND cs.periode between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= " OR (cs.periode IS NULL AND cs.date_ech between '".$db->idate(dol_get_first_day($year))."' AND '".$db->idate(dol_get_last_day($year))."')"; $sql .= " VALUES (".$conf->entity.", '".$this->db->idate($this->datea)."'"; @@ -187,11 +183,10 @@ $datee = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); $datee = dol_stringtotime($dateerfc); $datepaid = dol_mktime(12, 0, 0, GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear")); - $datepaid = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); - $datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int")); - $datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); - $datepaye = dol_mktime(GETPOST("rehour", 'int'), GETPOST("remin", 'int'), GETPOST("resec", 'int'), GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); - $datepaye = dol_mktime(GETPOST("rehour", 'int'), GETPOST("remin", 'int'), GETPOST("resec", 'int'), GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int'), 'tzuserrel'); + $datepaid = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); + $datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); + $datepaye = dol_mktime(GETPOSTINT("rehour"), GETPOSTINT("remin"), GETPOSTINT("resec"), GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); + $datepaye = dol_mktime(GETPOSTINT("rehour"), GETPOSTINT("remin"), GETPOSTINT("resec"), GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear"), 'tzuserrel'); $ensemblereponses = $obj->reponses; $head[$h][1] = $langs->trans('Referers'); $morewherefilterarray[] = " t.datee <= '".$db->idate($search_date_end_end)."'"; @@ -238,8 +233,8 @@ foreach ($TWeek as $week_number) { if (!empty($arrayfields['t.datee']['checked'])) { if ($action == "transfert") { - if (GETPOST("reyear", "int") && GETPOST("remonth", "int") && GETPOST("reday", "int")) { if (GETPOST('reday')) { + if (GETPOSTINT("reyear") && GETPOSTINT("remonth") && GETPOSTINT("reday")) { print $form->selectDate($datee, 'datee', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); print ''; print ''; @@ -977,7 +977,7 @@ function fieldListAccountingCategories($fieldlist, $obj = null, $tabname = '', $ $fieldname = 'country'; if ($context == 'add') { $fieldname = 'country_id'; - $preselectcountrycode = GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : $mysoc->country_code; + $preselectcountrycode = GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : $mysoc->country_code; print $form->select_country($preselectcountrycode, $fieldname, '', 28, 'maxwidth150 maxwidthonsmartphone'); } else { $preselectcountrycode = (empty($obj->country_code) ? (empty($obj->country) ? $mysoc->country_code : $obj->country) : $obj->country_code); diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 3eace908373..65a447811cc 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -143,13 +143,13 @@ if ($action == 'update') { } $constname = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'; - $constvalue = GETPOST($constname, 'int'); + $constvalue = GETPOSTINT($constname); if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { $error++; } $constname = 'ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT'; - $constvalue = GETPOST($constname, 'int'); + $constvalue = GETPOSTINT($constname); if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { $error++; } @@ -163,7 +163,7 @@ if ($action == 'update') { } if ($action == 'setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT') { - $setDisableAuxiliaryAccountOnCustomerDeposit = GETPOST('value', 'int'); + $setDisableAuxiliaryAccountOnCustomerDeposit = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT", $setDisableAuxiliaryAccountOnCustomerDeposit, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -177,7 +177,7 @@ if ($action == 'setACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT') { } if ($action == 'setACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT') { - $setDisableAuxiliaryAccountOnSupplierDeposit = GETPOST('value', 'int'); + $setDisableAuxiliaryAccountOnSupplierDeposit = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_ACCOUNT_SUPPLIER_USE_AUXILIARY_ON_DEPOSIT", $setDisableAuxiliaryAccountOnSupplierDeposit, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; diff --git a/htdocs/accountancy/admin/export.php b/htdocs/accountancy/admin/export.php index 902b184a48c..8a0d6764590 100644 --- a/htdocs/accountancy/admin/export.php +++ b/htdocs/accountancy/admin/export.php @@ -84,7 +84,7 @@ $model_option = array( if ($action == 'update') { $error = 0; - $modelcsv = GETPOST('ACCOUNTING_EXPORT_MODELCSV', 'int'); + $modelcsv = GETPOSTINT('ACCOUNTING_EXPORT_MODELCSV'); if (!empty($modelcsv)) { if (!dolibarr_set_const($db, 'ACCOUNTING_EXPORT_MODELCSV', $modelcsv, 'chaine', 0, '', $conf->entity)) { diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index cb142948096..8f2aff9a587 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -29,10 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php'; $action = GETPOST('action', 'aZ09'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php index 477fac08eee..e6408d33ab6 100644 --- a/htdocs/accountancy/admin/fiscalyear_card.php +++ b/htdocs/accountancy/admin/fiscalyear_card.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fiscalyear.class.php'; $langs->loadLangs(array("admin", "compta")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); @@ -70,8 +70,8 @@ foreach ($tmpstatus2label as $key => $val) { $status2label[$key] = $langs->trans($val); } -$date_start = dol_mktime(0, 0, 0, GETPOST('fiscalyearmonth', 'int'), GETPOST('fiscalyearday', 'int'), GETPOST('fiscalyearyear', 'int')); -$date_end = dol_mktime(0, 0, 0, GETPOST('fiscalyearendmonth', 'int'), GETPOST('fiscalyearendday', 'int'), GETPOST('fiscalyearendyear', 'int')); +$date_start = dol_mktime(0, 0, 0, GETPOSTINT('fiscalyearmonth'), GETPOSTINT('fiscalyearday'), GETPOSTINT('fiscalyearyear')); +$date_end = dol_mktime(0, 0, 0, GETPOSTINT('fiscalyearendmonth'), GETPOSTINT('fiscalyearendday'), GETPOSTINT('fiscalyearendyear')); $permissiontoadd = $user->hasRight('accounting', 'fiscalyear', 'write'); diff --git a/htdocs/accountancy/admin/fiscalyear_info.php b/htdocs/accountancy/admin/fiscalyear_info.php index 39754c0345d..f1ad54d9bb9 100644 --- a/htdocs/accountancy/admin/fiscalyear_info.php +++ b/htdocs/accountancy/admin/fiscalyear_info.php @@ -38,7 +38,7 @@ if (!$user->hasRight('accounting', 'fiscalyear', 'write')) { accessforbidden(); } -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // View diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index ea93f6751fa..748b55ed733 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -45,7 +45,7 @@ if (!$user->hasRight('accounting', 'chartofaccount')) { $action = GETPOST('action', 'aZ09'); -$nbletter = GETPOST('ACCOUNTING_LETTERING_NBLETTERS', 'int'); +$nbletter = GETPOSTINT('ACCOUNTING_LETTERING_NBLETTERS'); // Parameters ACCOUNTING_* and others $list = array( @@ -70,7 +70,7 @@ $error = 0; if (in_array($action, array('setBANK_DISABLE_DIRECT_INPUT', 'setACCOUNTANCY_COMBO_FOR_AUX', 'setACCOUNTING_MANAGE_ZERO'))) { $constname = preg_replace('/^set/', '', $action); - $constvalue = GETPOST('value', 'int'); + $constvalue = GETPOSTINT('value'); $res = dolibarr_set_const($db, $constname, $constvalue, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -102,7 +102,7 @@ if ($action == 'update') { $constvalue = GETPOST($constname, 'alpha'); if ($constname == 'ACCOUNTING_DATE_START_BINDING') { - $constvalue = dol_mktime(0, 0, 0, GETPOST($constname.'month', 'int'), GETPOST($constname.'day', 'int'), GETPOST($constname.'year', 'int')); + $constvalue = dol_mktime(0, 0, 0, GETPOSTINT($constname.'month'), GETPOSTINT($constname.'day'), GETPOSTINT($constname.'year')); } if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { @@ -128,7 +128,7 @@ if ($action == 'update') { } if ($action == 'setmanagezero') { - $setmanagezero = GETPOST('value', 'int'); + $setmanagezero = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_MANAGE_ZERO", $setmanagezero, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -142,7 +142,7 @@ if ($action == 'setmanagezero') { } if ($action == 'setdisabledirectinput') { - $setdisabledirectinput = GETPOST('value', 'int'); + $setdisabledirectinput = GETPOSTINT('value'); $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -156,7 +156,7 @@ if ($action == 'setdisabledirectinput') { } if ($action == 'setenabledraftexport') { - $setenabledraftexport = GETPOST('value', 'int'); + $setenabledraftexport = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL", $setenabledraftexport, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -170,7 +170,7 @@ if ($action == 'setenabledraftexport') { } if ($action == 'setenablesubsidiarylist') { - $setenablesubsidiarylist = GETPOST('value', 'int'); + $setenablesubsidiarylist = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTANCY_COMBO_FOR_AUX", $setenablesubsidiarylist, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -184,7 +184,7 @@ if ($action == 'setenablesubsidiarylist') { } if ($action == 'setdisablebindingonsales') { - $setdisablebindingonsales = GETPOST('value', 'int'); + $setdisablebindingonsales = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_SALES", $setdisablebindingonsales, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -198,7 +198,7 @@ if ($action == 'setdisablebindingonsales') { } if ($action == 'setdisablebindingonpurchases') { - $setdisablebindingonpurchases = GETPOST('value', 'int'); + $setdisablebindingonpurchases = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_PURCHASES", $setdisablebindingonpurchases, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -212,7 +212,7 @@ if ($action == 'setdisablebindingonpurchases') { } if ($action == 'setdisablebindingonexpensereports') { - $setdisablebindingonexpensereports = GETPOST('value', 'int'); + $setdisablebindingonexpensereports = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS", $setdisablebindingonexpensereports, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -226,7 +226,7 @@ if ($action == 'setdisablebindingonexpensereports') { } if ($action == 'setenablelettering') { - $setenablelettering = GETPOST('value', 'int'); + $setenablelettering = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_LETTERING", $setenablelettering, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -240,7 +240,7 @@ if ($action == 'setenablelettering') { } if ($action == 'setenableautolettering') { - $setenableautolettering = GETPOST('value', 'int'); + $setenableautolettering = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_ENABLE_AUTOLETTERING", $setenableautolettering, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; @@ -254,7 +254,7 @@ if ($action == 'setenableautolettering') { } if ($action == 'setenablevatreversecharge') { - $setenablevatreversecharge = GETPOST('value', 'int'); + $setenablevatreversecharge = GETPOSTINT('value'); $res = dolibarr_set_const($db, "ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE", $setenablevatreversecharge, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; diff --git a/htdocs/accountancy/admin/journals_list.php b/htdocs/accountancy/admin/journals_list.php index 6f001eec6e5..1df04810801 100644 --- a/htdocs/accountancy/admin/journals_list.php +++ b/htdocs/accountancy/admin/journals_list.php @@ -56,12 +56,12 @@ $actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"') $actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"'); $listoffset = GETPOST('listoffset', 'alpha'); -$listlimit = GETPOST('listlimit', 'int') > 0 ? GETPOST('listlimit', 'int') : 1000; +$listlimit = GETPOSTINT('listlimit') > 0 ? GETPOSTINT('listlimit') : 1000; $active = 1; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -77,7 +77,7 @@ if (empty($sortorder)) { $error = 0; -$search_country_id = GETPOST('search_country_id', 'int'); +$search_country_id = GETPOSTINT('search_country_id'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('admin')); diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 66b120cf1d5..aa4c4a3eb00 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -57,13 +57,13 @@ $optioncss = GETPOST('optioncss', 'alpha'); $codeventil_buy = GETPOST('codeventil_buy', 'array'); $codeventil_sell = GETPOST('codeventil_sell', 'array'); $chk_prod = GETPOST('chk_prod', 'array'); -$default_account = GETPOST('default_account', 'int'); +$default_account = GETPOSTINT('default_account'); $account_number_buy = GETPOST('account_number_buy'); $account_number_sell = GETPOST('account_number_sell'); $changeaccount = GETPOST('changeaccount', 'array'); $changeaccount_buy = GETPOST('changeaccount_buy', 'array'); $changeaccount_sell = GETPOST('changeaccount_sell', 'array'); -$searchCategoryProductOperator = (GETPOST('search_category_product_operator', 'int') ? GETPOST('search_category_product_operator', 'int') : 0); +$searchCategoryProductOperator = (GETPOSTINT('search_category_product_operator') ? GETPOSTINT('search_category_product_operator') : 0); $searchCategoryProductList = GETPOST('search_category_product_list', 'array'); $search_ref = GETPOST('search_ref', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); @@ -84,10 +84,10 @@ if (empty($accounting_product_mode)) { $accounting_product_mode = 'ACCOUNTANCY_SELL'; } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalInt('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalInt('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index fb9a61e36d0..b048663e405 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -35,8 +35,8 @@ $langs->loadLangs(array("accountancy", "admin", "bills", "compta", "errors", "hr $mesg = ''; $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); -$id = GETPOST('id', 'int'); -$rowid = GETPOST('rowid', 'int'); +$id = GETPOSTINT('id'); +$rowid = GETPOSTINT('rowid'); $massaction = GETPOST('massaction', 'aZ09'); $optioncss = GETPOST('optioncss', 'alpha'); $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) @@ -44,7 +44,7 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'ac $search_subaccount = GETPOST('search_subaccount', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); -$search_type = GETPOST('search_type', 'int'); +$search_type = GETPOSTINT('search_type'); // Security check if ($user->socid > 0) { @@ -55,10 +55,10 @@ if (!$user->hasRight('accounting', 'chartofaccount')) { } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index dfbe2a06cff..b04e3f644e2 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -50,8 +50,8 @@ if ($type == 'sub') { } $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : $context_default; $show_subgroup = GETPOST('show_subgroup', 'alpha'); -$search_date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); -$search_date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); +$search_date_start = dol_mktime(0, 0, 0, GETPOSTINT('date_startmonth'), GETPOSTINT('date_startday'), GETPOSTINT('date_startyear')); +$search_date_end = dol_mktime(23, 59, 59, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear')); $search_ledger_code = GETPOST('search_ledger_code', 'array'); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); if ($search_accountancy_code_start == - 1) { @@ -64,10 +64,10 @@ if ($search_accountancy_code_end == - 1) { $search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action @@ -161,15 +161,15 @@ if (empty($reshook)) { if (!empty($search_date_start)) { $filter['t.doc_date>='] = $search_date_start; - $param .= '&date_startmonth=' . GETPOST('date_startmonth', 'int') . '&date_startday=' . GETPOST('date_startday', 'int') . '&date_startyear=' . GETPOST('date_startyear', 'int'); + $param .= '&date_startmonth=' . GETPOSTINT('date_startmonth') . '&date_startday=' . GETPOSTINT('date_startday') . '&date_startyear=' . GETPOSTINT('date_startyear'); } if (!empty($search_date_end)) { $filter['t.doc_date<='] = $search_date_end; - $param .= '&date_endmonth=' . GETPOST('date_endmonth', 'int') . '&date_endday=' . GETPOST('date_endday', 'int') . '&date_endyear=' . GETPOST('date_endyear', 'int'); + $param .= '&date_endmonth=' . GETPOSTINT('date_endmonth') . '&date_endday=' . GETPOSTINT('date_endday') . '&date_endyear=' . GETPOSTINT('date_endyear'); } if (!empty($search_doc_date)) { $filter['t.doc_date'] = $search_doc_date; - $param .= '&doc_datemonth=' . GETPOST('doc_datemonth', 'int') . '&doc_dateday=' . GETPOST('doc_dateday', 'int') . '&doc_dateyear=' . GETPOST('doc_dateyear', 'int'); + $param .= '&doc_datemonth=' . GETPOSTINT('doc_datemonth') . '&doc_dateday=' . GETPOSTINT('doc_dateday') . '&doc_dateyear=' . GETPOSTINT('doc_dateyear'); } if (!empty($search_accountancy_code_start)) { if ($type == 'sub') { @@ -587,20 +587,20 @@ if ($action != 'export_csv') { if ($line->subledger_account) { $urlzoom = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?type=sub&search_accountancy_code_start=' . urlencode($line->subledger_account) . '&search_accountancy_code_end=' . urlencode($line->subledger_account); if (GETPOSTISSET('date_startmonth')) { - $urlzoom .= '&search_date_startmonth=' . GETPOST('date_startmonth', 'int') . '&search_date_startday=' . GETPOST('date_startday', 'int') . '&search_date_startyear=' . GETPOST('date_startyear', 'int'); + $urlzoom .= '&search_date_startmonth=' . GETPOSTINT('date_startmonth') . '&search_date_startday=' . GETPOSTINT('date_startday') . '&search_date_startyear=' . GETPOSTINT('date_startyear'); } if (GETPOSTISSET('date_endmonth')) { - $urlzoom .= '&search_date_endmonth=' . GETPOST('date_endmonth', 'int') . '&search_date_endday=' . GETPOST('date_endday', 'int') . '&search_date_endyear=' . GETPOST('date_endyear', 'int'); + $urlzoom .= '&search_date_endmonth=' . GETPOSTINT('date_endmonth') . '&search_date_endday=' . GETPOSTINT('date_endday') . '&search_date_endyear=' . GETPOSTINT('date_endyear'); } } } else { if ($line->numero_compte) { $urlzoom = DOL_URL_ROOT . '/accountancy/bookkeeping/listbyaccount.php?search_accountancy_code_start=' . urlencode($line->numero_compte) . '&search_accountancy_code_end=' . urlencode($line->numero_compte); if (GETPOSTISSET('date_startmonth')) { - $urlzoom .= '&search_date_startmonth=' . GETPOST('date_startmonth', 'int') . '&search_date_startday=' . GETPOST('date_startday', 'int') . '&search_date_startyear=' . GETPOST('date_startyear', 'int'); + $urlzoom .= '&search_date_startmonth=' . GETPOSTINT('date_startmonth') . '&search_date_startday=' . GETPOSTINT('date_startday') . '&search_date_startyear=' . GETPOSTINT('date_startyear'); } if (GETPOSTISSET('date_endmonth')) { - $urlzoom .= '&search_date_endmonth=' . GETPOST('date_endmonth', 'int') . '&search_date_endday=' . GETPOST('date_endday', 'int') . '&search_date_endyear=' . GETPOST('date_endyear', 'int'); + $urlzoom .= '&search_date_endmonth=' . GETPOSTINT('date_endmonth') . '&search_date_endday=' . GETPOSTINT('date_endday') . '&search_date_endyear=' . GETPOSTINT('date_endyear'); } } } diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 4fa8ff92697..444cb44d104 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -250,7 +250,7 @@ if ($action == "confirm_update") { $object->label_compte = ''; $object->debit = 0; $object->credit = 0; - $object->doc_date = $date_start = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); + $object->doc_date = $date_start = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); $object->doc_type = GETPOST('doc_type', 'alpha'); $object->piece_num = GETPOSTINT('next_num_mvt'); $object->doc_ref = GETPOST('doc_ref', 'alpha'); @@ -276,7 +276,7 @@ if ($action == "confirm_update") { } if ($action == 'setdate') { - $datedoc = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); + $datedoc = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); $result = $object->updateByMvt($piece_num, 'doc_date', $db->idate($datedoc), $mode); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index f6d4f4bfd30..b2d205f74eb 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -43,55 +43,55 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; // Load translation files required by the page $langs->loadLangs(array("accountancy", "compta")); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookkeepinglist'; -$search_mvt_num = GETPOST('search_mvt_num', 'int'); +$search_mvt_num = GETPOSTINT('search_mvt_num'); $search_doc_type = GETPOST("search_doc_type", 'alpha'); $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endday = GETPOSTINT('search_date_endday'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); -$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int'); -$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int'); -$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int'); -$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int'); -$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int'); -$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int'); +$search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); +$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); +$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); +$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); +$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); +$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); +$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); $search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); $search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); -$search_date_modification_startyear = GETPOST('search_date_modification_startyear', 'int'); -$search_date_modification_startmonth = GETPOST('search_date_modification_startmonth', 'int'); -$search_date_modification_startday = GETPOST('search_date_modification_startday', 'int'); -$search_date_modification_endyear = GETPOST('search_date_modification_endyear', 'int'); -$search_date_modification_endmonth = GETPOST('search_date_modification_endmonth', 'int'); -$search_date_modification_endday = GETPOST('search_date_modification_endday', 'int'); +$search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); +$search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); +$search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); +$search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); +$search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); +$search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); $search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); $search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); -$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int'); -$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int'); -$search_date_export_startday = GETPOST('search_date_export_startday', 'int'); -$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); -$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); -$search_date_export_endday = GETPOST('search_date_export_endday', 'int'); +$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); +$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); +$search_date_export_startday = GETPOSTINT('search_date_export_startday'); +$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); +$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); +$search_date_export_endday = GETPOSTINT('search_date_export_endday'); $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); -$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); -$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); -$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); -$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); -$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); -$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); +$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); +$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); +$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); +$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); +$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); +$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_import_key = GETPOST("search_import_key", 'alpha'); @@ -104,7 +104,7 @@ if (GETPOST("button_export_file_x") || GETPOST("button_export_file.x") || GETPOS $action = 'export_file'; } -$search_account_category = GETPOST('search_account_category', 'int'); +$search_account_category = GETPOSTINT('search_account_category'); $search_accountancy_code = GETPOST("search_accountancy_code", 'alpha'); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); @@ -134,11 +134,11 @@ $search_lettering_code = GETPOST('search_lettering_code', 'alpha'); $search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $optioncss = GETPOST('optioncss', 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } @@ -159,7 +159,7 @@ $hookmanager->initHooks(array('bookkeepingexport')); $formaccounting = new FormAccounting($db); $form = new Form($db); -if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->hasRight('accounting', 'mouvements', 'export')) { +if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOSTINT('page') == '' && !GETPOSTINT('noreset') && $user->hasRight('accounting', 'mouvements', 'export')) { if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start')) { $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; $query .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1"; @@ -459,7 +459,7 @@ if (empty($reshook)) { } if ($action == 'setreexport') { - $setreexport = GETPOST('value', 'int'); + $setreexport = GETPOSTINT('value'); if (!dolibarr_set_const($db, "ACCOUNTING_REEXPORT", $setreexport, 'yesno', 0, '', $conf->entity)) { $error++; } @@ -614,7 +614,7 @@ if ($action == 'export_fileconfirm' && $user->hasRight('accounting', 'mouvements $error++; setEventMessages($object->error, $object->errors, 'errors'); } else { - $formatexport = GETPOST('formatexport', 'int'); + $formatexport = GETPOSTINT('formatexport'); $notexportlettering = GETPOST('notexportlettering', 'alpha'); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 990d6e288c0..2c62409c4ae 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/lettering.class.php'; $langs->loadLangs(array("accountancy", "compta")); // Get Parameters -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); // action+display Parameters $action = GETPOST('action', 'aZ09'); @@ -53,53 +53,53 @@ $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bookkeepinglist'; // Search Parameters -$search_mvt_num = GETPOST('search_mvt_num', 'int'); +$search_mvt_num = GETPOSTINT('search_mvt_num'); $search_doc_type = GETPOST("search_doc_type", 'alpha'); $search_doc_ref = GETPOST("search_doc_ref", 'alpha'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endday = GETPOSTINT('search_date_endday'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); -$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int'); -$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int'); -$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int'); -$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int'); -$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int'); -$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int'); +$search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); +$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); +$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); +$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); +$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); +$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); +$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); $search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); $search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); -$search_date_modification_startyear = GETPOST('search_date_modification_startyear', 'int'); -$search_date_modification_startmonth = GETPOST('search_date_modification_startmonth', 'int'); -$search_date_modification_startday = GETPOST('search_date_modification_startday', 'int'); -$search_date_modification_endyear = GETPOST('search_date_modification_endyear', 'int'); -$search_date_modification_endmonth = GETPOST('search_date_modification_endmonth', 'int'); -$search_date_modification_endday = GETPOST('search_date_modification_endday', 'int'); +$search_date_modification_startyear = GETPOSTINT('search_date_modification_startyear'); +$search_date_modification_startmonth = GETPOSTINT('search_date_modification_startmonth'); +$search_date_modification_startday = GETPOSTINT('search_date_modification_startday'); +$search_date_modification_endyear = GETPOSTINT('search_date_modification_endyear'); +$search_date_modification_endmonth = GETPOSTINT('search_date_modification_endmonth'); +$search_date_modification_endday = GETPOSTINT('search_date_modification_endday'); $search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear); $search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear); -$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int'); -$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int'); -$search_date_export_startday = GETPOST('search_date_export_startday', 'int'); -$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); -$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); -$search_date_export_endday = GETPOST('search_date_export_endday', 'int'); +$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); +$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); +$search_date_export_startday = GETPOSTINT('search_date_export_startday'); +$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); +$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); +$search_date_export_endday = GETPOSTINT('search_date_export_endday'); $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); -$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); -$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); -$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); -$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); -$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); -$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); +$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); +$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); +$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); +$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); +$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); +$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_import_key = GETPOST("search_import_key", 'alpha'); -$search_account_category = GETPOST('search_account_category', 'int'); +$search_account_category = GETPOSTINT('search_account_category'); $search_accountancy_code = GETPOST("search_accountancy_code", 'alpha'); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); @@ -129,11 +129,11 @@ $search_lettering_code = GETPOST('search_lettering_code', 'alpha'); $search_not_reconciled = GETPOST('search_not_reconciled', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $optioncss = GETPOST('optioncss', 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } @@ -154,7 +154,7 @@ $hookmanager->initHooks(array('bookkeepinglist')); $formaccounting = new FormAccounting($db); $form = new Form($db); -if (!in_array($action, array('delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->hasRight('accounting', 'mouvements', 'export')) { +if (!in_array($action, array('delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOSTINT('page') == '' && !GETPOSTINT('noreset') && $user->hasRight('accounting', 'mouvements', 'export')) { if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values') && !GETPOST('search_accountancy_code_start')) { $query = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; $query .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."' limit 1"; @@ -738,7 +738,7 @@ if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accountin if ($user->hasRight('accounting', 'mouvements', 'supprimer')) { $arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('preunletteringauto', 'preunletteringmanual', 'predeletebookkeepingwriting'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('preunletteringauto', 'preunletteringmanual', 'predeletebookkeepingwriting'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions); diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index ed423ba1fdb..24856b36ae3 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; $langs->loadLangs(array("accountancy", "compta")); $action = GETPOST('action', 'aZ09'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $massaction = GETPOST('massaction', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); @@ -52,34 +52,34 @@ if ($type == 'sub') { $context_default = 'bookkeepingbyaccountlist'; } $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : $context_default; -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endday = GETPOSTINT('search_date_endday'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int')); -$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int'); -$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int'); -$search_date_export_startday = GETPOST('search_date_export_startday', 'int'); -$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int'); -$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int'); -$search_date_export_endday = GETPOST('search_date_export_endday', 'int'); +$search_doc_date = dol_mktime(0, 0, 0, GETPOSTINT('doc_datemonth'), GETPOSTINT('doc_dateday'), GETPOSTINT('doc_dateyear')); +$search_date_export_startyear = GETPOSTINT('search_date_export_startyear'); +$search_date_export_startmonth = GETPOSTINT('search_date_export_startmonth'); +$search_date_export_startday = GETPOSTINT('search_date_export_startday'); +$search_date_export_endyear = GETPOSTINT('search_date_export_endyear'); +$search_date_export_endmonth = GETPOSTINT('search_date_export_endmonth'); +$search_date_export_endday = GETPOSTINT('search_date_export_endday'); $search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear); $search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear); -$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int'); -$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int'); -$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int'); -$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int'); -$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int'); -$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int'); +$search_date_validation_startyear = GETPOSTINT('search_date_validation_startyear'); +$search_date_validation_startmonth = GETPOSTINT('search_date_validation_startmonth'); +$search_date_validation_startday = GETPOSTINT('search_date_validation_startday'); +$search_date_validation_endyear = GETPOSTINT('search_date_validation_endyear'); +$search_date_validation_endmonth = GETPOSTINT('search_date_validation_endmonth'); +$search_date_validation_endday = GETPOSTINT('search_date_validation_endday'); $search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear); $search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear); $search_import_key = GETPOST("search_import_key", 'alpha'); -$search_account_category = GETPOST('search_account_category', 'int'); +$search_account_category = GETPOSTINT('search_account_category'); $search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha'); if ($search_accountancy_code_start == - 1) { @@ -91,7 +91,7 @@ if ($search_accountancy_code_end == - 1) { } $search_doc_ref = GETPOST('search_doc_ref', 'alpha'); $search_label_operation = GETPOST('search_label_operation', 'alpha'); -$search_mvt_num = GETPOST('search_mvt_num', 'int'); +$search_mvt_num = GETPOSTINT('search_mvt_num'); $search_direction = GETPOST('search_direction', 'alpha'); $search_ledger_code = GETPOST('search_ledger_code', 'array'); $search_debit = GETPOST('search_debit', 'alpha'); @@ -104,11 +104,11 @@ if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_ } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $optioncss = GETPOST('optioncss', 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } @@ -282,7 +282,7 @@ if (empty($reshook)) { } if (!empty($search_doc_date)) { $filter['t.doc_date'] = $search_doc_date; - $param .= '&doc_datemonth='.GETPOST('doc_datemonth', 'int').'&doc_dateday='.GETPOST('doc_dateday', 'int').'&doc_dateyear='.GETPOST('doc_dateyear', 'int'); + $param .= '&doc_datemonth='.GETPOSTINT('doc_datemonth').'&doc_dateday='.GETPOSTINT('doc_dateday').'&doc_dateyear='.GETPOSTINT('doc_dateyear'); } if ($search_account_category != '-1' && !empty($search_account_category)) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancycategory.class.php'; @@ -650,7 +650,7 @@ if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && $user->hasRight('accountin if ($user->hasRight('accounting', 'mouvements', 'supprimer')) { $arrayofmassactions['predeletebookkeepingwriting'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('preunletteringauto', 'preunletteringmanual', 'predeletebookkeepingwriting'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('preunletteringauto', 'preunletteringmanual', 'predeletebookkeepingwriting'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction($massaction, $arrayofmassactions); diff --git a/htdocs/accountancy/closure/index.php b/htdocs/accountancy/closure/index.php index 772d1672542..1226ae9d167 100644 --- a/htdocs/accountancy/closure/index.php +++ b/htdocs/accountancy/closure/index.php @@ -34,9 +34,9 @@ $langs->loadLangs(array("compta", "bills", "other", "accountancy")); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'aZ09'); -$fiscal_period_id = GETPOST('fiscal_period_id', 'int'); -$validatemonth = GETPOST('validatemonth', 'int'); -$validateyear = GETPOST('validateyear', 'int'); +$fiscal_period_id = GETPOSTINT('fiscal_period_id'); +$validatemonth = GETPOSTINT('validatemonth'); +$validateyear = GETPOSTINT('validateyear'); // Security check if (!isModEnabled('accounting')) { @@ -104,8 +104,8 @@ if ($reshook < 0) { if (empty($reshook)) { if (isset($current_fiscal_period) && $user->hasRight('accounting', 'fiscalyear', 'write')) { if ($action == 'confirm_step_1' && $confirm == "yes") { - $date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); - $date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); + $date_start = dol_mktime(0, 0, 0, GETPOSTINT('date_startmonth'), GETPOSTINT('date_startday'), GETPOSTINT('date_startyear')); + $date_end = dol_mktime(23, 59, 59, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear')); $result = $object->validateMovementForFiscalPeriod($date_start, $date_end); if ($result > 0) { @@ -119,7 +119,7 @@ if (empty($reshook)) { $action = ''; } } elseif ($action == 'confirm_step_2' && $confirm == "yes") { - $new_fiscal_period_id = GETPOST('new_fiscal_period_id', 'int'); + $new_fiscal_period_id = GETPOSTINT('new_fiscal_period_id'); $separate_auxiliary_account = GETPOST('separate_auxiliary_account', 'aZ09'); $generate_bookkeeping_records = GETPOST('generate_bookkeeping_records', 'aZ09'); @@ -133,10 +133,10 @@ if (empty($reshook)) { exit; } } elseif ($action == 'confirm_step_3' && $confirm == "yes") { - $inventory_journal_id = GETPOST('inventory_journal_id', 'int'); - $new_fiscal_period_id = GETPOST('new_fiscal_period_id', 'int'); - $date_start = dol_mktime(0, 0, 0, GETPOST('date_startmonth', 'int'), GETPOST('date_startday', 'int'), GETPOST('date_startyear', 'int')); - $date_end = dol_mktime(23, 59, 59, GETPOST('date_endmonth', 'int'), GETPOST('date_endday', 'int'), GETPOST('date_endyear', 'int')); + $inventory_journal_id = GETPOSTINT('inventory_journal_id'); + $new_fiscal_period_id = GETPOSTINT('new_fiscal_period_id'); + $date_start = dol_mktime(0, 0, 0, GETPOSTINT('date_startmonth'), GETPOSTINT('date_startday'), GETPOSTINT('date_startyear')); + $date_end = dol_mktime(23, 59, 59, GETPOSTINT('date_endmonth'), GETPOSTINT('date_endday'), GETPOSTINT('date_endyear')); $result = $object->insertAccountingReversal($current_fiscal_period['id'], $inventory_journal_id, $new_fiscal_period_id, $date_start, $date_end); if ($result < 0) { diff --git a/htdocs/accountancy/customer/card.php b/htdocs/accountancy/customer/card.php index 3102b023015..b2731d981c5 100644 --- a/htdocs/accountancy/customer/card.php +++ b/htdocs/accountancy/customer/card.php @@ -34,8 +34,8 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$codeventil = GETPOST('codeventil', 'int'); -$id = GETPOST('id', 'int'); +$codeventil = GETPOSTINT('codeventil'); +$id = GETPOSTINT('id'); // Security check if (!isModEnabled('accounting')) { diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 018f222daf8..391cac7daf4 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -37,8 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; // Load translation files required by the page $langs->loadLangs(array("compta", "bills", "other", "accountancy")); -$validatemonth = GETPOST('validatemonth', 'int'); -$validateyear = GETPOST('validateyear', 'int'); +$validatemonth = GETPOSTINT('validatemonth'); +$validateyear = GETPOSTINT('validateyear'); // Security check if (!isModEnabled('accounting')) { @@ -54,8 +54,8 @@ if (!$user->hasRight('accounting', 'bind', 'write')) { $accountingAccount = new AccountingAccount($db); $month_start = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); -if (GETPOST("year", 'int')) { - $year_start = GETPOST("year", 'int'); +if (GETPOSTINT("year")) { + $year_start = GETPOSTINT("year"); } else { $year_start = dol_print_date(dol_now(), '%Y'); if (dol_print_date(dol_now(), '%m') < $month_start) { diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 2a08eb3986c..5c9457d818f 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -45,7 +45,7 @@ $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); // Search Getpost $search_societe = GETPOST('search_societe', 'alpha'); -$search_lineid = GETPOST('search_lineid', 'int'); +$search_lineid = GETPOSTINT('search_lineid'); $search_ref = GETPOST('search_ref', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); @@ -53,22 +53,22 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_country = GETPOST('search_country', 'alpha'); $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } @@ -131,7 +131,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('accounting', 'bind', 'write')) { $error = 0; - if (!(GETPOST('account_parent', 'int') >= 0)) { + if (!(GETPOSTINT('account_parent') >= 0)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors'); } @@ -140,7 +140,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('ac $db->begin(); $sql1 = "UPDATE ".MAIN_DB_PREFIX."facturedet"; - $sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0'); + $sql1 .= " SET fk_code_ventilation=".(GETPOSTINT('account_parent') > 0 ? GETPOSTINT('account_parent') : '0'); $sql1 .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')'; dol_syslog('accountancy/customer/lines.php::changeaccount sql= '.$sql1); diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index b34f29eef8f..d51b43eccd9 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -48,14 +48,14 @@ $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancycustomerlist'; // To manage different context of search $optioncss = GETPOST('optioncss', 'alpha'); -$default_account = GETPOST('default_account', 'int'); +$default_account = GETPOSTINT('default_account'); // Select Box $mesCasesCochees = GETPOST('toselect', 'array'); // Search Getpost $search_societe = GETPOST('search_societe', 'alpha'); -$search_lineid = GETPOST('search_lineid', 'int'); +$search_lineid = GETPOSTINT('search_lineid'); $search_ref = GETPOST('search_ref', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); @@ -63,12 +63,12 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_country = GETPOST('search_country', 'alpha'); @@ -80,10 +80,10 @@ if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDI } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/accountancy/expensereport/card.php b/htdocs/accountancy/expensereport/card.php index 6d2bd442bf8..056dbb3d74e 100644 --- a/htdocs/accountancy/expensereport/card.php +++ b/htdocs/accountancy/expensereport/card.php @@ -38,8 +38,8 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$codeventil = GETPOST('codeventil', 'int'); -$id = GETPOST('id', 'int'); +$codeventil = GETPOSTINT('codeventil'); +$id = GETPOSTINT('id'); // Security check if (!isModEnabled('accounting')) { diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index 703417bb1f5..00f52f0dd49 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -33,12 +33,12 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; // Load translation files required by the page $langs->loadLangs(array("compta", "bills", "other", "accountancy")); -$validatemonth = GETPOST('validatemonth', 'int'); -$validateyear = GETPOST('validateyear', 'int'); +$validatemonth = GETPOSTINT('validatemonth'); +$validateyear = GETPOSTINT('validateyear'); $month_start = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); -if (GETPOST("year", 'int')) { - $year_start = GETPOST("year", 'int'); +if (GETPOSTINT("year")) { + $year_start = GETPOSTINT("year"); } else { $year_start = dol_print_date(dol_now(), '%Y'); if (dol_print_date(dol_now(), '%m') < $month_start) { diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index 8d170a557b1..4fbc0642bc9 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -39,7 +39,7 @@ $langs->loadLangs(array("compta", "bills", "other", "accountancy", "trips", "pro $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$account_parent = GETPOST('account_parent', 'int'); +$account_parent = GETPOSTINT('account_parent'); $changeaccount = GETPOST('changeaccount'); // Search Getpost $search_login = GETPOST('search_login', 'alpha'); @@ -49,20 +49,20 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } @@ -121,7 +121,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('accounting', 'bind', 'write')) { $error = 0; - if (!(GETPOST('account_parent', 'int') >= 0)) { + if (!(GETPOSTINT('account_parent') >= 0)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors'); } @@ -130,7 +130,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('ac $db->begin(); $sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd"; - $sql1 .= " SET erd.fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0'); + $sql1 .= " SET erd.fk_code_ventilation=".(GETPOSTINT('account_parent') > 0 ? GETPOSTINT('account_parent') : '0'); $sql1 .= ' WHERE erd.rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')'; dol_syslog('accountancy/expensereport/lines.php::changeaccount sql= '.$sql1); diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index c688098058f..d70729d4521 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -58,12 +58,12 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); @@ -73,10 +73,10 @@ if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDI } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 09236110b0e..db569da428c 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -57,8 +57,8 @@ $pcgver = getDolGlobalInt('CHARTOFACCOUNTS'); if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled) require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; - $zone = GETPOST('areacode', 'int'); - $userid = GETPOST('userid', 'int'); + $zone = GETPOSTINT('areacode'); + $userid = GETPOSTINT('userid'); $boxorder = GETPOST('boxorder', 'aZ09'); $boxorder .= GETPOST('boxcombo', 'aZ09'); diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 993fce3899f..c091abb5b48 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -66,14 +66,14 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php'; $langs->loadLangs(array("companies", "other", "compta", "banks", "bills", "donations", "loan", "accountancy", "trips", "salaries", "hrm", "members")); // Multi journal -$id_journal = GETPOST('id_journal', 'int'); +$id_journal = GETPOSTINT('id_journal'); -$date_startmonth = GETPOST('date_startmonth', 'int'); -$date_startday = GETPOST('date_startday', 'int'); -$date_startyear = GETPOST('date_startyear', 'int'); -$date_endmonth = GETPOST('date_endmonth', 'int'); -$date_endday = GETPOST('date_endday', 'int'); -$date_endyear = GETPOST('date_endyear', 'int'); +$date_startmonth = GETPOSTINT('date_startmonth'); +$date_startday = GETPOSTINT('date_startday'); +$date_startyear = GETPOSTINT('date_startyear'); +$date_endmonth = GETPOSTINT('date_endmonth'); +$date_endday = GETPOSTINT('date_endday'); +$date_endyear = GETPOSTINT('date_endyear'); $in_bookkeeping = GETPOST('in_bookkeeping', 'aZ09'); if ($in_bookkeeping == '') { $in_bookkeeping = 'notyet'; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index de47b55ab83..881070ad6fd 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; // Load translation files required by the page $langs->loadLangs(array("commercial", "compta", "bills", "other", "accountancy", "trips", "errors")); -$id_journal = GETPOST('id_journal', 'int'); +$id_journal = GETPOSTINT('id_journal'); $action = GETPOST('action', 'aZ09'); $date_startmonth = GETPOST('date_startmonth'); diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index d92f99e771b..227c2f0f280 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; // Load translation files required by the page $langs->loadLangs(array("commercial", "compta", "bills", "other", "accountancy", "errors")); -$id_journal = GETPOST('id_journal', 'int'); +$id_journal = GETPOSTINT('id_journal'); $action = GETPOST('action', 'aZ09'); $date_startmonth = GETPOST('date_startmonth'); diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 3267f5ae397..6e0640df092 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -45,7 +45,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php'; // Load translation files required by the page $langs->loadLangs(array("commercial", "compta", "bills", "other", "accountancy", "errors")); -$id_journal = GETPOST('id_journal', 'int'); +$id_journal = GETPOSTINT('id_journal'); $action = GETPOST('action', 'aZ09'); $date_startmonth = GETPOST('date_startmonth'); diff --git a/htdocs/accountancy/journal/variousjournal.php b/htdocs/accountancy/journal/variousjournal.php index 62bd97df17f..4882b722053 100644 --- a/htdocs/accountancy/journal/variousjournal.php +++ b/htdocs/accountancy/journal/variousjournal.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; // Load translation files required by the page $langs->loadLangs(array("banks", "accountancy", "compta", "other", "errors")); -$id_journal = GETPOST('id_journal', 'int'); +$id_journal = GETPOSTINT('id_journal'); $action = GETPOST('action', 'aZ09'); $date_startmonth = GETPOST('date_startmonth'); diff --git a/htdocs/accountancy/supplier/card.php b/htdocs/accountancy/supplier/card.php index 99bfe67fce5..d384d7c944a 100644 --- a/htdocs/accountancy/supplier/card.php +++ b/htdocs/accountancy/supplier/card.php @@ -38,8 +38,8 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$codeventil = GETPOST('codeventil', 'int'); -$id = GETPOST('id', 'int'); +$codeventil = GETPOSTINT('codeventil'); +$id = GETPOSTINT('id'); // Security check if (!isModEnabled('accounting')) { diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index a74a9a04f54..ace576b4232 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -35,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; // Load translation files required by the page $langs->loadLangs(array("compta", "bills", "other", "accountancy")); -$validatemonth = GETPOST('validatemonth', 'int'); -$validateyear = GETPOST('validateyear', 'int'); +$validatemonth = GETPOSTINT('validatemonth'); +$validateyear = GETPOSTINT('validateyear'); // Security check if (!isModEnabled('accounting')) { @@ -52,8 +52,8 @@ if (!$user->hasRight('accounting', 'bind', 'write')) { $accountingAccount = new AccountingAccount($db); $month_start = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); -if (GETPOST("year", 'int')) { - $year_start = GETPOST("year", 'int'); +if (GETPOSTINT("year")) { + $year_start = GETPOSTINT("year"); } else { $year_start = dol_print_date(dol_now(), '%Y'); if (dol_print_date(dol_now(), '%m') < $month_start) { diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 576e4874a8d..3571a5e2df5 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -46,7 +46,7 @@ $account_parent = GETPOST('account_parent'); $changeaccount = GETPOST('changeaccount'); // Search Getpost $search_societe = GETPOST('search_societe', 'alpha'); -$search_lineid = GETPOST('search_lineid', 'int'); +$search_lineid = GETPOSTINT('search_lineid'); $search_ref = GETPOST('search_ref', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); //$search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); @@ -55,22 +55,22 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_country = GETPOST('search_country', 'alpha'); $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } @@ -136,7 +136,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('accounting', 'bind', 'write')) { $error = 0; - if (!(GETPOST('account_parent', 'int') >= 0)) { + if (!(GETPOSTINT('account_parent') >= 0)) { $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Account")), null, 'errors'); } @@ -145,7 +145,7 @@ if (is_array($changeaccount) && count($changeaccount) > 0 && $user->hasRight('ac $db->begin(); $sql1 = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det"; - $sql1 .= " SET fk_code_ventilation=".(GETPOST('account_parent', 'int') > 0 ? GETPOST('account_parent', 'int') : '0'); + $sql1 .= " SET fk_code_ventilation=".(GETPOSTINT('account_parent') > 0 ? GETPOSTINT('account_parent') : '0'); $sql1 .= ' WHERE rowid IN ('.$db->sanitize(implode(',', $changeaccount)).')'; dol_syslog('accountancy/supplier/lines.php::changeaccount sql= '.$sql1); diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index de9c72a56b5..a97bfb1d531 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -49,14 +49,14 @@ $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'accountancysupplierlist'; // To manage different context of search $optioncss = GETPOST('optioncss', 'alpha'); -$default_account = GETPOST('default_account', 'int'); +$default_account = GETPOSTINT('default_account'); // Select Box $mesCasesCochees = GETPOST('toselect', 'array'); // Search Getpost $search_societe = GETPOST('search_societe', 'alpha'); -$search_lineid = GETPOST('search_lineid', 'int'); +$search_lineid = GETPOSTINT('search_lineid'); $search_ref = GETPOST('search_ref', 'alpha'); $search_ref_supplier = GETPOST('search_ref_supplier', 'alpha'); $search_invoice = GETPOST('search_invoice', 'alpha'); @@ -65,22 +65,22 @@ $search_desc = GETPOST('search_desc', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_account = GETPOST('search_account', 'alpha'); $search_vat = GETPOST('search_vat', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_country = GETPOST('search_country', 'alpha'); $search_tvaintra = GETPOST('search_tvaintra', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } diff --git a/htdocs/adherents/admin/member_emails.php b/htdocs/adherents/admin/member_emails.php index cc7b60f6233..c2907004341 100644 --- a/htdocs/adherents/admin/member_emails.php +++ b/htdocs/adherents/admin/member_emails.php @@ -105,7 +105,7 @@ if ($action == 'updateall') { // Action to update or add a constant if ($action == 'update' || $action == 'add') { - $constlineid = GETPOST('rowid', 'int'); + $constlineid = GETPOSTINT('rowid'); $constname = GETPOST('constname', 'alpha'); $constvalue = (GETPOSTISSET('constvalue_'.$constname) ? GETPOST('constvalue_'.$constname, 'alphanohtml') : GETPOST('constvalue')); diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php index 8ac296f9449..f922f1abb7f 100644 --- a/htdocs/adherents/admin/website.php +++ b/htdocs/adherents/admin/website.php @@ -63,7 +63,7 @@ if ($action == 'update') { $showtable = GETPOST('MEMBER_SHOW_TABLE'); $showvoteallowed = GETPOST('MEMBER_SHOW_VOTE_ALLOWED'); $payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE'); - $forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int'); + $forcetype = GETPOSTINT('MEMBER_NEWFORM_FORCETYPE'); $forcemorphy = GETPOST('MEMBER_NEWFORM_FORCEMORPHY', 'aZ09'); $res = dolibarr_set_const($db, "MEMBER_ENABLE_PUBLIC", $public, 'chaine', 0, '', $conf->entity); diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index ef217d65871..742905600af 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -38,13 +38,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->loadLangs(array('companies', 'members')); // Get Parameters -$id = GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('rowid', 'int'); +$id = GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('rowid'); // Pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index 66e53b58109..d18ba0c335d 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -251,16 +251,16 @@ abstract class ActionsAdherentCardCommon $this->object->old_name = GETPOST("old_name"); $this->object->old_firstname = GETPOST("old_firstname"); - $this->object->fk_soc = GETPOST("fk_soc", 'int'); - $this->object->socid = GETPOST("fk_soc", 'int'); + $this->object->fk_soc = GETPOSTINT("fk_soc"); + $this->object->socid = GETPOSTINT("fk_soc"); $this->object->lastname = GETPOST("lastname"); $this->object->firstname = GETPOST("firstname"); $this->object->civility_id = GETPOST("civility_id"); $this->object->address = GETPOST("address"); $this->object->zip = GETPOST("zipcode"); $this->object->town = GETPOST("town"); - $this->object->country_id = GETPOST("country_id", 'int') ? GETPOST("country_id", 'int') : $mysoc->country_id; - $this->object->state_id = GETPOST("state_id", 'int'); + $this->object->country_id = GETPOSTINT("country_id") ? GETPOSTINT("country_id") : $mysoc->country_id; + $this->object->state_id = GETPOSTINT("state_id"); $this->object->phone_perso = GETPOST("phone_perso"); $this->object->phone_mobile = GETPOST("phone_mobile"); $this->object->email = GETPOST("email", 'alphawithlgt'); diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 7f41b76e564..8b96f6c3844 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -56,11 +56,11 @@ $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -$rowid = GETPOST('rowid', 'int'); -$id = GETPOST('id') ? GETPOST('id', 'int') : $rowid; -$typeid = GETPOST('typeid', 'int'); -$userid = GETPOST('userid', 'int'); -$socid = GETPOST('socid', 'int'); +$rowid = GETPOSTINT('rowid'); +$id = GETPOST('id') ? GETPOSTINT('id') : $rowid; +$typeid = GETPOSTINT('typeid'); +$userid = GETPOSTINT('userid'); +$socid = GETPOSTINT('socid'); $ref = GETPOST('ref', 'alpha'); if (isModEnabled('mailmanspip')) { @@ -256,8 +256,8 @@ if (empty($reshook)) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $birthdate = ''; - if (GETPOST("birthday", 'int') && GETPOST("birthmonth", 'int') && GETPOST("birthyear", 'int')) { - $birthdate = dol_mktime(12, 0, 0, GETPOST("birthmonth", 'int'), GETPOST("birthday", 'int'), GETPOST("birthyear", 'int')); + if (GETPOSTINT("birthday") && GETPOSTINT("birthmonth") && GETPOSTINT("birthyear")) { + $birthdate = dol_mktime(12, 0, 0, GETPOSTINT("birthmonth"), GETPOSTINT("birthday"), GETPOSTINT("birthyear")); } $lastname = GETPOST("lastname", 'alphanohtml'); $firstname = GETPOST("firstname", 'alphanohtml'); @@ -441,14 +441,14 @@ if (empty($reshook)) { } $birthdate = ''; if (GETPOSTISSET("birthday") && GETPOST("birthday") && GETPOSTISSET("birthmonth") && GETPOST("birthmonth") && GETPOSTISSET("birthyear") && GETPOST("birthyear")) { - $birthdate = dol_mktime(12, 0, 0, GETPOST("birthmonth", 'int'), GETPOST("birthday", 'int'), GETPOST("birthyear", 'int')); + $birthdate = dol_mktime(12, 0, 0, GETPOSTINT("birthmonth"), GETPOSTINT("birthday"), GETPOSTINT("birthyear")); } $datesubscription = ''; if (GETPOSTISSET("reday") && GETPOSTISSET("remonth") && GETPOSTISSET("reyear")) { - $datesubscription = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", "int"), GETPOST("reyear", "int")); + $datesubscription = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); } - $typeid = GETPOST("typeid", 'int'); + $typeid = GETPOSTINT("typeid"); $civility_id = GETPOST("civility_id", 'alphanohtml'); $lastname = GETPOST("lastname", 'alphanohtml'); $firstname = GETPOST("firstname", 'alphanohtml'); @@ -457,8 +457,8 @@ if (empty($reshook)) { $address = GETPOST("address", 'alphanohtml'); $zip = GETPOST("zipcode", 'alphanohtml'); $town = GETPOST("town", 'alphanohtml'); - $state_id = GETPOST("state_id", 'int'); - $country_id = GETPOST("country_id", 'int'); + $state_id = GETPOSTINT("state_id"); + $country_id = GETPOSTINT("country_id"); $phone = GETPOST("phone", 'alpha'); $phone_perso = GETPOST("phone_perso", 'alpha'); @@ -471,8 +471,8 @@ if (empty($reshook)) { $morphy = GETPOST("morphy", 'alphanohtml'); $public = GETPOST("public", 'alphanohtml'); - $userid = GETPOST("userid", 'int'); - $socid = GETPOST("socid", 'int'); + $userid = GETPOSTINT("userid"); + $socid = GETPOSTINT("socid"); $default_lang = GETPOST('default_lang', 'alpha'); $object->civility_id = $civility_id; @@ -926,10 +926,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Create mode if ($action == 'create') { $object->canvas = $canvas; - $object->state_id = GETPOST('state_id', 'int'); + $object->state_id = GETPOSTINT('state_id'); // We set country_id, country_code and country for the selected country - $object->country_id = GETPOST('country_id', 'int') ? GETPOST('country_id', 'int') : $mysoc->country_id; + $object->country_id = GETPOSTINT('country_id') ? GETPOSTINT('country_id') : $mysoc->country_id; if ($object->country_id) { $tmparray = getCountry($object->country_id, 'all'); $object->country_code = $tmparray['code']; @@ -1012,7 +1012,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $listetype = $adht->liste_array(1); print img_picto('', $adht->picto, 'class="pictofixedwidth"'); if (count($listetype)) { - print $form->selectarray("typeid", $listetype, (GETPOST('typeid', 'int') ? GETPOST('typeid', 'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', '', 1); + print $form->selectarray("typeid", $listetype, (GETPOSTINT('typeid') ? GETPOSTINT('typeid') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', '', 1); } else { print ''.$langs->trans("NoTypeDefinedGoToSetup").''; } @@ -1030,7 +1030,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Civility print ''; + print $formcompany->select_civility(GETPOSTINT('civility_id') ? GETPOSTINT('civility_id') : $object->civility_id, 'civility_id', 'maxwidth150', 1).''; print ''; // Lastname @@ -1087,7 +1087,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''."\n"; // State print ''."\n"; // Telephone diff --git a/htdocs/admin/agenda_extsites.php b/htdocs/admin/agenda_extsites.php index 0dca3ecbf1c..8ac54b3299e 100644 --- a/htdocs/admin/agenda_extsites.php +++ b/htdocs/admin/agenda_extsites.php @@ -154,7 +154,7 @@ if (preg_match('/set_(.*)/', $action, $reg)) { // Save nb of agenda if (!$error) { - $res = dolibarr_set_const($db, 'AGENDA_EXT_NB', trim(GETPOST('AGENDA_EXT_NB', 'int')), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'AGENDA_EXT_NB', trim(GETPOSTINT('AGENDA_EXT_NB')), 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 3700ecf631f..5ac6e892611 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -48,10 +48,10 @@ if (GETPOSTISSET('MAIN_AGENDA_XCAL_EXPORTKEY')) { $MAIN_AGENDA_XCAL_EXPORTKEY = trim(GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY', 'alpha')); } if (GETPOSTISSET('MAIN_AGENDA_EXPORT_PAST_DELAY')) { - $MAIN_AGENDA_EXPORT_PAST_DELAY = intval(GETPOST('MAIN_AGENDA_EXPORT_PAST_DELAY', 'int')); + $MAIN_AGENDA_EXPORT_PAST_DELAY = intval(GETPOSTINT('MAIN_AGENDA_EXPORT_PAST_DELAY')); } if (GETPOSTISSET('MAIN_AGENDA_EXPORT_CACHE')) { - $MAIN_AGENDA_EXPORT_CACHE = intval(GETPOST('MAIN_AGENDA_EXPORT_CACHE', 'int')); + $MAIN_AGENDA_EXPORT_CACHE = intval(GETPOSTINT('MAIN_AGENDA_EXPORT_CACHE')); } if (GETPOSTISSET('AGENDA_EXPORT_FIX_TZ')) { $AGENDA_EXPORT_FIX_TZ = trim(GETPOST('AGENDA_EXPORT_FIX_TZ', 'alpha')); diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index be817438610..49f2dc3380c 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -70,7 +70,7 @@ if ($action == 'setbarcodethirdpartyon') { if ($action == 'setcoder') { $coder = GETPOST('coder', 'alpha'); - $code_id = GETPOST('code_id', 'int'); + $code_id = GETPOSTINT('code_id'); $sqlp = "UPDATE ".MAIN_DB_PREFIX."c_barcode_type"; $sqlp .= " SET coder = '".$db->escape($coder)."'"; $sqlp .= " WHERE rowid = ".((int) $code_id); diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 189fb532e1f..99d56c35658 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -36,7 +36,7 @@ if (!$user->admin) { accessforbidden(); } -$rowid = GETPOST('rowid', 'int'); +$rowid = GETPOSTINT('rowid'); $action = GETPOST('action', 'aZ09'); @@ -50,7 +50,7 @@ $boxes = array(); */ if ($action == 'addconst') { - dolibarr_set_const($db, "MAIN_BOXES_MAXLINES", GETPOST("MAIN_BOXES_MAXLINES", 'int'), '', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_BOXES_MAXLINES", GETPOSTINT("MAIN_BOXES_MAXLINES"), '', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_ACTIVATE_FILECACHE", GETPOST("MAIN_ACTIVATE_FILECACHE", 'alpha'), 'chaine', 0, '', $conf->entity); } @@ -165,10 +165,10 @@ if ($action == 'switch') { $db->begin(); $objfrom = new ModeleBoxes($db); - $objfrom->fetch(GETPOST("switchfrom", 'int')); + $objfrom->fetch(GETPOSTINT("switchfrom")); $objto = new ModeleBoxes($db); - $objto->fetch(GETPOST('switchto', 'int')); + $objto->fetch(GETPOSTINT('switchto')); $resultupdatefrom = 0; $resultupdateto = 0; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 9eb4626c3bc..f07961486c6 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -92,7 +92,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) activateModulesRequiredByCountry($mysoc->country_code); } - $tmparray = getState(GETPOST('state_id', 'int'), 'all', $db, $langs, 0); + $tmparray = getState(GETPOSTINT('state_id'), 'all', $db, $langs, 0); if (!empty($tmparray['id'])) { $mysoc->state_id = $tmparray['id']; $mysoc->state_code = $tmparray['code']; @@ -218,7 +218,7 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) dolibarr_set_const($db, "MAIN_INFO_TVAINTRA", GETPOST("tva", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_SOCIETE_OBJECT", GETPOST("socialobject", 'alphanohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOST("SOCIETE_FISCAL_MONTH_START", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "SOCIETE_FISCAL_MONTH_START", GETPOSTINT("SOCIETE_FISCAL_MONTH_START"), 'chaine', 0, '', $conf->entity); // Sale tax options $usevat = GETPOST("optiontva", 'aZ09'); diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index f290df752bc..792fe0b30cf 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -32,19 +32,19 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php'; // Load translation files required by the page $langs->load("admin"); -$rowid = GETPOST('rowid', 'int'); -$entity = GETPOST('entity', 'int'); +$rowid = GETPOSTINT('rowid'); +$entity = GETPOSTINT('entity'); $action = GETPOST('action', 'aZ09'); -$debug = GETPOST('debug', 'int'); +$debug = GETPOSTINT('debug'); $consts = GETPOST('const', 'array'); $constname = GETPOST('constname', 'alphanohtml'); $constvalue = GETPOST('constvalue', 'restricthtml'); // We should be able to send everything here $constnote = GETPOST('constnote', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/admin/debugbar.php b/htdocs/admin/debugbar.php index 0994918d462..d06fb6502a2 100644 --- a/htdocs/admin/debugbar.php +++ b/htdocs/admin/debugbar.php @@ -49,8 +49,8 @@ $action = GETPOST('action', 'aZ09'); if ($action == 'set') { $db->begin(); - $result1 = dolibarr_set_const($db, "DEBUGBAR_LOGS_LINES_NUMBER", GETPOST('DEBUGBAR_LOGS_LINES_NUMBER', 'int'), 'chaine', 0, '', 0); - $result2 = dolibarr_set_const($db, "DEBUGBAR_USE_LOG_FILE", GETPOST('DEBUGBAR_USE_LOG_FILE', 'int'), 'chaine', 0, '', 0); + $result1 = dolibarr_set_const($db, "DEBUGBAR_LOGS_LINES_NUMBER", GETPOSTINT('DEBUGBAR_LOGS_LINES_NUMBER'), 'chaine', 0, '', 0); + $result2 = dolibarr_set_const($db, "DEBUGBAR_USE_LOG_FILE", GETPOSTINT('DEBUGBAR_USE_LOG_FILE'), 'chaine', 0, '', 0); if ($result1 < 0 || $result2 < 0) { $error++; } diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index 5c92e5acd14..0792ad97007 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -46,10 +46,10 @@ $optioncss = GETPOST('optionscss', 'alphanohtml'); $mode = GETPOST('mode', 'aZ09') ? GETPOST('mode', 'aZ09') : 'createform'; // 'createform', 'filters', 'sortorder', 'focus' -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -366,7 +366,7 @@ if (!is_array($result) && $result < 0) { // Page print ''; print ''; - print ''; + print ''; print ''; print '
'.dol_print_date($link->datea, "dayhour", "tzuser").'
'.$langs->trans("UserTitle").''; - print $formcompany->select_civility(GETPOST('civility_id', 'int') ? GETPOST('civility_id', 'int') : $object->civility_id, 'civility_id', 'maxwidth150', 1).'
'.$langs->trans('State').''; if ($soc->country_id) { print img_picto('', 'state', 'class="pictofixedwidth"'); - print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $soc->state_id, $soc->country_code); + print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : $soc->state_id, $soc->country_code); } else { print $countrynotdefined; } @@ -1167,7 +1167,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $adht->fetch($object->typeid); // We set country_id, and country_code, country of the chosen country - $country = GETPOST('country', 'int'); + $country = GETPOSTINT('country'); if (!empty($country) || $object->country_id) { $sql = "SELECT rowid, code, label from ".MAIN_DB_PREFIX."c_country where rowid = ".(!empty($country) ? $country : $object->country_id); $resql = $db->query($sql); @@ -1240,7 +1240,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Type print '
'.$langs->trans("Type").''; if ($user->hasRight('adherent', 'creer')) { - print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOST("typeid", 'int') : $object->typeid), 0, 0, 0, '', 0, 0, 0, '', '', 1); + print $form->selectarray("typeid", $adht->liste_array(), (GETPOSTISSET("typeid") ? GETPOSTINT("typeid") : $object->typeid), 0, 0, 0, '', 0, 0, 0, '', '', 1); } else { print $adht->getNomUrl(1); print ''; diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 1f02258fae9..ac692433247 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -38,16 +38,16 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; $langs->loadLangs(array("companies", "members", "other")); -$id = GETPOSTISSET('id') ? GETPOST('id', 'int') : GETPOST('rowid', 'int'); +$id = GETPOSTISSET('id') ? GETPOSTINT('id') : GETPOSTINT('rowid'); $ref = GETPOST('ref', 'alphanohtml'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 3b78f0305dc..baa8560b9c6 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -53,11 +53,11 @@ $result = restrictedArea($user, 'adherent'); * Actions */ -$userid = GETPOST('userid', 'int'); +$userid = GETPOSTINT('userid'); if (GETPOST('addbox')) { // Add box (when submit is done from a form when ajax disabled) require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; - $zone = GETPOST('areacode', 'int'); + $zone = GETPOSTINT('areacode'); $boxorder = GETPOST('boxorder', 'aZ09'); $boxorder .= GETPOST('boxcombo', 'aZ09'); $result = InfoBox::saveboxorder($db, $zone, $boxorder, $userid); diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index 47fb5c00a64..edfa8adbb2f 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; // Load translation files required by the page $langs->loadLangs(array("companies", "members", "ldap", "admin")); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alphanohtml'); $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index d2297697632..37aba189a17 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -43,7 +43,7 @@ $langs->loadLangs(array("members", "companies", "categories")); // Get parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); @@ -71,19 +71,19 @@ $search_phone_perso = GETPOST("search_phone_perso", 'alpha'); $search_phone_mobile = GETPOST("search_phone_mobile", 'alpha'); $search_type = GETPOST("search_type", 'alpha'); $search_email = GETPOST("search_email", 'alpha'); -$search_categ = GETPOST("search_categ", 'int'); +$search_categ = GETPOSTINT("search_categ"); $search_morphy = GETPOST("search_morphy", 'alpha'); $search_import_key = trim(GETPOST("search_import_key", 'alpha')); -$catid = GETPOST("catid", 'int'); -$socid = GETPOST('socid', 'int'); +$catid = GETPOSTINT("catid"); +$socid = GETPOSTINT('socid'); $search_filter = GETPOST("search_filter", 'alpha'); $search_status = GETPOST("search_status", 'intcomma'); // status -$search_datec_start = dol_mktime(0, 0, 0, GETPOST('search_datec_start_month', 'int'), GETPOST('search_datec_start_day', 'int'), GETPOST('search_datec_start_year', 'int')); -$search_datec_end = dol_mktime(23, 59, 59, GETPOST('search_datec_end_month', 'int'), GETPOST('search_datec_end_day', 'int'), GETPOST('search_datec_end_year', 'int')); -$search_datem_start = dol_mktime(0, 0, 0, GETPOST('search_datem_start_month', 'int'), GETPOST('search_datem_start_day', 'int'), GETPOST('search_datem_start_year', 'int')); -$search_datem_end = dol_mktime(23, 59, 59, GETPOST('search_datem_end_month', 'int'), GETPOST('search_datem_end_day', 'int'), GETPOST('search_datem_end_year', 'int')); +$search_datec_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datec_start_month'), GETPOSTINT('search_datec_start_day'), GETPOSTINT('search_datec_start_year')); +$search_datec_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datec_end_month'), GETPOSTINT('search_datec_end_day'), GETPOSTINT('search_datec_end_year')); +$search_datem_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datem_start_month'), GETPOSTINT('search_datem_start_day'), GETPOSTINT('search_datem_start_year')); +$search_datem_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datem_end_month'), GETPOSTINT('search_datem_end_day'), GETPOSTINT('search_datem_end_year')); $filter = GETPOST("filter", 'alpha'); if ($filter) { @@ -102,10 +102,10 @@ if ($search_status < -2) { } // Pagination parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -741,7 +741,7 @@ if ($user->hasRight('adherent', 'creer') && $user->hasRight('user', 'user', 'cre if ($user->hasRight('adherent', 'creer')) { $arrayofmassactions['createsubscription'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("CreateSubscription"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete', 'preaffecttag'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index 1adbdb2db03..180eee496b2 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -37,7 +37,7 @@ $langs->loadLangs(array("companies", "members", "bills")); // Get parameters $action = GETPOST('action', 'aZ09'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alphanohtml'); diff --git a/htdocs/adherents/partnership.php b/htdocs/adherents/partnership.php index 2ec81fdbea9..9edc0603ce2 100644 --- a/htdocs/adherents/partnership.php +++ b/htdocs/adherents/partnership.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php'; $langs->loadLangs(array("companies","members","partnership", "other")); // Get parameters -$id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int'); +$id = GETPOSTINT('rowid') ? GETPOSTINT('rowid') : GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -116,8 +116,8 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } -$date_start = dol_mktime(0, 0, 0, GETPOST('date_partnership_startmonth', 'int'), GETPOST('date_partnership_startday', 'int'), GETPOST('date_partnership_startyear', 'int')); -$date_end = dol_mktime(0, 0, 0, GETPOST('date_partnership_endmonth', 'int'), GETPOST('date_partnership_endday', 'int'), GETPOST('date_partnership_endyear', 'int')); +$date_start = dol_mktime(0, 0, 0, GETPOSTINT('date_partnership_startmonth'), GETPOSTINT('date_partnership_startday'), GETPOSTINT('date_partnership_startyear')); +$date_end = dol_mktime(0, 0, 0, GETPOSTINT('date_partnership_endmonth'), GETPOSTINT('date_partnership_endday'), GETPOSTINT('date_partnership_endyear')); if (empty($reshook)) { $error = 0; diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 13dce1b030e..b6c2ea3a676 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -33,10 +33,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php'; $WIDTH = DolGraph::getDefaultGraphSizeForStats('width'); $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height'); -$userid = GETPOST('userid', 'int'); if ($userid < 0) { +$userid = GETPOSTINT('userid'); if ($userid < 0) { $userid = 0; } -$socid = GETPOST('socid', 'int'); if ($socid < 0) { +$socid = GETPOSTINT('socid'); if ($socid < 0) { $socid = 0; } diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 3d479cd23c6..3efc9a74ef0 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -47,17 +47,17 @@ $confirm = GETPOST('confirm', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ09'); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int'); +$id = GETPOSTINT('rowid') ? GETPOSTINT('rowid') : GETPOSTINT('id'); $rowid = $id; $ref = GETPOST('ref', 'alphanohtml'); -$typeid = GETPOST('typeid', 'int'); +$typeid = GETPOSTINT('typeid'); $cancel = GETPOST('cancel'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -86,9 +86,9 @@ $errmsg = ''; $hookmanager->initHooks(array('subscription')); // PDF -$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); -$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); -$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); +$hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); +$hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); +$hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); $datefrom = 0; $dateto = 0; @@ -153,15 +153,15 @@ if (empty($reshook) && $action == 'confirm_create_thirdparty' && $confirm == 'ye if (empty($reshook) && $action == 'setuserid' && ($user->hasRight('user', 'self', 'creer') || $user->hasRight('user', 'user', 'creer'))) { $error = 0; if (!$user->hasRight('user', 'user', 'creer')) { // If can edit only itself user, we can link to itself only - if (GETPOST("userid", 'int') != $user->id && GETPOST("userid", 'int') != $object->user_id) { + if (GETPOSTINT("userid") != $user->id && GETPOSTINT("userid") != $object->user_id) { $error++; setEventMessages($langs->trans("ErrorUserPermissionAllowsToLinksToItselfOnly"), null, 'errors'); } } if (!$error) { - if (GETPOST("userid", 'int') != $object->user_id) { // If link differs from currently in database - $result = $object->setUserId(GETPOST("userid", 'int')); + if (GETPOSTINT("userid") != $object->user_id) { // If link differs from currently in database + $result = $object->setUserId(GETPOSTINT("userid")); if ($result < 0) { dol_print_error(null, $object->error); } @@ -173,9 +173,9 @@ if (empty($reshook) && $action == 'setuserid' && ($user->hasRight('user', 'self' if (empty($reshook) && $action == 'setsocid') { $error = 0; if (!$error) { - if (GETPOST('socid', 'int') != $object->fk_soc) { // If link differs from currently in database + if (GETPOSTINT('socid') != $object->fk_soc) { // If link differs from currently in database $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent"; - $sql .= " WHERE fk_soc = '".GETPOST('socid', 'int')."'"; + $sql .= " WHERE fk_soc = '".GETPOSTINT('socid')."'"; $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); @@ -183,14 +183,14 @@ if (empty($reshook) && $action == 'setsocid') { $othermember = new Adherent($db); $othermember->fetch($obj->rowid); $thirdparty = new Societe($db); - $thirdparty->fetch(GETPOST('socid', 'int')); + $thirdparty->fetch(GETPOSTINT('socid')); $error++; setEventMessages($langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty", $othermember->getFullName($langs), $othermember->login, $thirdparty->name), null, 'errors'); } } if (!$error) { - $result = $object->setThirdPartyId(GETPOST('socid', 'int')); + $result = $object->setThirdPartyId(GETPOSTINT('socid')); if ($result < 0) { dol_print_error(null, $object->error); } @@ -214,20 +214,20 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'subscripti $defaultdelay = !empty($adht->duration_value) ? $adht->duration_value : 1; $defaultdelayunit = !empty($adht->duration_unit) ? $adht->duration_unit : 'y'; $paymentdate = ''; // Do not use 0 here, default value is '' that means not filled where 0 means 1970-01-01 - if (GETPOST("reyear", "int") && GETPOST("remonth", "int") && GETPOST("reday", "int")) { - $datesubscription = dol_mktime(0, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int")); + if (GETPOSTINT("reyear") && GETPOSTINT("remonth") && GETPOSTINT("reday")) { + $datesubscription = dol_mktime(0, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); } - if (GETPOST("endyear", 'int') && GETPOST("endmonth", 'int') && GETPOST("endday", 'int')) { - $datesubend = dol_mktime(0, 0, 0, GETPOST("endmonth", 'int'), GETPOST("endday", 'int'), GETPOST("endyear", 'int')); + if (GETPOSTINT("endyear") && GETPOSTINT("endmonth") && GETPOSTINT("endday")) { + $datesubend = dol_mktime(0, 0, 0, GETPOSTINT("endmonth"), GETPOSTINT("endday"), GETPOSTINT("endyear")); } - if (GETPOST("paymentyear", 'int') && GETPOST("paymentmonth", 'int') && GETPOST("paymentday", 'int')) { - $paymentdate = dol_mktime(0, 0, 0, GETPOST("paymentmonth", 'int'), GETPOST("paymentday", 'int'), GETPOST("paymentyear", 'int')); + if (GETPOSTINT("paymentyear") && GETPOSTINT("paymentmonth") && GETPOSTINT("paymentday")) { + $paymentdate = dol_mktime(0, 0, 0, GETPOSTINT("paymentmonth"), GETPOSTINT("paymentday"), GETPOSTINT("paymentyear")); } $amount = price2num(GETPOST("subscription", 'alpha')); // Amount of subscription $label = GETPOST("label"); // Payment information - $accountid = GETPOST("accountid", 'int'); + $accountid = GETPOSTINT("accountid"); $operation = GETPOST("operation", "alphanohtml"); // Payment mode $num_chq = GETPOST("num_chq", "alphanohtml"); $emetteur_nom = GETPOST("chqemetteur"); @@ -287,14 +287,14 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'subscripti $error++; $action = 'addsubscription'; } - if (GETPOST("paymentsave") != 'invoiceonly' && !(GETPOST("accountid", 'int') > 0)) { + if (GETPOST("paymentsave") != 'invoiceonly' && !(GETPOSTINT("accountid") > 0)) { $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("FinancialAccount")); setEventMessages($errmsg, null, 'errors'); $error++; $action = 'addsubscription'; } } else { - if (GETPOST("accountid", 'int')) { + if (GETPOSTINT("accountid")) { $errmsg = $langs->trans("ErrorDoNotProvideAccountsIfNullAmount"); setEventMessages($errmsg, null, 'errors'); $error++; @@ -980,7 +980,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h $currentmonth = dol_print_date($now, "%m"); print ''.$langs->trans("DateSubscription").''; if (GETPOST('reday')) { - $datefrom = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $datefrom = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); } if (!$datefrom) { $datefrom = $object->datevalid; @@ -1001,7 +1001,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h // Date end subscription if (GETPOST('endday')) { - $dateto = dol_mktime(0, 0, 0, GETPOST('endmonth', 'int'), GETPOST('endday', 'int'), GETPOST('endyear', 'int')); + $dateto = dol_mktime(0, 0, 0, GETPOSTINT('endmonth'), GETPOSTINT('endday'), GETPOSTINT('endyear')); } if (!$dateto) { if (getDolGlobalInt('MEMBER_SUBSCRIPTION_SUGGEST_END_OF_MONTH')) { diff --git a/htdocs/adherents/subscription/card.php b/htdocs/adherents/subscription/card.php index 1cd7376ea75..b78303d6633 100644 --- a/htdocs/adherents/subscription/card.php +++ b/htdocs/adherents/subscription/card.php @@ -41,7 +41,7 @@ $object = new Subscription($db); $errmsg = ''; $action = GETPOST("action", 'alpha'); -$rowid = GETPOST("rowid", "int") ? GETPOST("rowid", "int") : GETPOST("id", "int"); +$rowid = GETPOSTINT("rowid") ? GETPOSTINT("rowid") : GETPOSTINT("id"); $typeid = GETPOSTINT("typeid"); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm'); @@ -86,8 +86,8 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'update' && $errmsg = ''; - $newdatestart = dol_mktime(GETPOST('datesubhour', 'int'), GETPOST('datesubmin', 'int'), 0, GETPOST('datesubmonth', 'int'), GETPOST('datesubday', 'int'), GETPOST('datesubyear', 'int')); - $newdateend = dol_mktime(GETPOST('datesubendhour', 'int'), GETPOST('datesubendmin', 'int'), 0, GETPOST('datesubendmonth', 'int'), GETPOST('datesubendday', 'int'), GETPOST('datesubendyear', 'int')); + $newdatestart = dol_mktime(GETPOSTINT('datesubhour'), GETPOSTINT('datesubmin'), 0, GETPOSTINT('datesubmonth'), GETPOSTINT('datesubday'), GETPOSTINT('datesubyear')); + $newdateend = dol_mktime(GETPOSTINT('datesubendhour'), GETPOSTINT('datesubendmin'), 0, GETPOSTINT('datesubendmonth'), GETPOSTINT('datesubendday'), GETPOSTINT('datesubendyear')); if ($object->fk_bank > 0) { $accountline = new AccountLine($db); diff --git a/htdocs/adherents/subscription/info.php b/htdocs/adherents/subscription/info.php index 14afbafca50..6bdf0fd6f5d 100644 --- a/htdocs/adherents/subscription/info.php +++ b/htdocs/adherents/subscription/info.php @@ -36,7 +36,7 @@ if (!$user->hasRight('adherent', 'lire')) { accessforbidden(); } -$rowid = GETPOST("rowid", 'int'); +$rowid = GETPOSTINT("rowid"); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index f411810242d..ddd2728d169 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -34,7 +34,7 @@ $langs->loadLangs(array("members", "companies", "banks")); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -50,17 +50,17 @@ $search_lastname = GETPOST('search_lastname', 'alpha'); $search_firstname = GETPOST('search_firstname', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); $search_note = GETPOST('search_note', 'alpha'); -$search_account = GETPOST('search_account', 'int'); +$search_account = GETPOSTINT('search_account'); $search_amount = GETPOST('search_amount', 'alpha'); $search_all = ''; $date_select = GETPOST("date_select", 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -345,7 +345,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 4a1ee4b36a6..a56598e360a 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -41,7 +41,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php'; // Load translation files required by the page $langs->load("members"); -$rowid = GETPOST('rowid', 'int'); +$rowid = GETPOSTINT('rowid'); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); @@ -61,10 +61,10 @@ $status = GETPOST('status', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -81,12 +81,12 @@ if (!$sortfield) { $label = GETPOST("label", "alpha"); $morphy = GETPOST("morphy", "alpha"); -$status = GETPOST("status", "int"); -$subscription = GETPOST("subscription", "int"); +$status = GETPOSTINT("status"); +$subscription = GETPOSTINT("subscription"); $amount = GETPOST('amount', 'alpha'); -$duration_value = GETPOST('duration_value', 'int'); +$duration_value = GETPOSTINT('duration_value'); $duration_unit = GETPOST('duration_unit', 'alpha'); -$vote = GETPOST("vote", "int"); +$vote = GETPOSTINT("vote"); $comment = GETPOST("comment", 'restricthtml'); $mail_valid = GETPOST("mail_valid", 'restricthtml'); $caneditamount = GETPOSTINT("caneditamount"); diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php index bd202e5a21a..88301150f13 100644 --- a/htdocs/adherents/type_ldap.php +++ b/htdocs/adherents/type_ldap.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php'; // Load translation files required by the page $langs->loadLangs(array("admin", "members", "ldap")); -$id = GETPOST('rowid', 'int'); +$id = GETPOSTINT('rowid'); $action = GETPOST('action', 'aZ09'); // Security check diff --git a/htdocs/adherents/type_translation.php b/htdocs/adherents/type_translation.php index 55ee3bbd697..4dd37b89e24 100644 --- a/htdocs/adherents/type_translation.php +++ b/htdocs/adherents/type_translation.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; // Load translation files required by the page $langs->loadLangs(array('members', 'languages')); -$id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int'); +$id = GETPOSTINT('rowid') ? GETPOSTINT('rowid') : GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $ref = GETPOST('ref', 'alphanohtml'); @@ -279,7 +279,7 @@ if ($action == 'create' && $user->hasRight('adherent', 'configurer')) { print '
'; print ''; print ''; - print ''; + print ''; print dol_get_fiche_head(); diff --git a/htdocs/adherents/vcard.php b/htdocs/adherents/vcard.php index cb8bd1603bb..cd39e578045 100644 --- a/htdocs/adherents/vcard.php +++ b/htdocs/adherents/vcard.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/vcard.class.php'; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alphanohtml'); $object = new Adherent($db); diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 4190c55a8e1..f225f899ee8 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -58,9 +58,9 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha')) dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ADDRESS", GETPOST("address", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_TOWN", GETPOST("town", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_ZIP", GETPOST("zipcode", 'alphanohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOST("state_id", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_STATE", GETPOSTINT("state_id"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_REGION", GETPOST("region_code", 'alphanohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOST('country_id', 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_COUNTRY", GETPOSTINT('country_id'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_PHONE", GETPOST("phone", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_FAX", GETPOST("fax", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_INFO_ACCOUNTANT_MAIL", GETPOST("mail", 'alphanohtml'), 'chaine', 0, '', $conf->entity); @@ -138,7 +138,7 @@ print '
'; print img_picto('', 'globe-americas', 'class="pictofixedwidth"'); -print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'country_id'); +print $form->select_country((GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'country_id'); if ($user->admin) { print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); } @@ -147,7 +147,7 @@ print '
'; print img_picto('', 'state', 'class="pictofixedwidth"'); -print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_STATE') ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id'); +print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOSTINT('state_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_STATE') ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOSTINT('country_id') : (getDolGlobalString('MAIN_INFO_ACCOUNTANT_COUNTRY') ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id'); print '
'; - if ($action != 'edit' || GETPOST('rowid', 'int') != $defaultvalue->id) { + if ($action != 'edit' || GETPOSTINT('rowid') != $defaultvalue->id) { print $defaultvalue->page; } else { print ''; diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php index ef1d477a624..0a7a3ea4e7a 100644 --- a/htdocs/admin/delais.php +++ b/htdocs/admin/delais.php @@ -188,7 +188,7 @@ if ($action == 'update') { // Update values for ($i = 0; $i < 4; $i++) { if (GETPOSTISSET('MAIN_METEO'.$plus.'_LEVEL'.$i)) { - dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOSTINT('MAIN_METEO'.$plus.'_LEVEL'.$i), 'chaine', 0, '', $conf->entity); } } diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 28fdb10609b..2afd06435b8 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -49,9 +49,9 @@ $langs->loadLangs(array("errors", "admin", "main", "companies", "resource", "hol $action = GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view'; $confirm = GETPOST('confirm', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $rowid = GETPOST('rowid', 'alpha'); -$entity = GETPOST('entity', 'int'); +$entity = GETPOSTINT('entity'); $code = GETPOST('code', 'alpha'); $acts = array(); $actl = array(); @@ -65,7 +65,7 @@ $listoffset = GETPOST('listoffset'); $listlimit = GETPOST('listlimit') > 0 ? GETPOST('listlimit') : 1000; // To avoid too long dictionaries $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -74,7 +74,7 @@ $offset = $listlimit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -$search_country_id = GETPOST('search_country_id', 'int'); +$search_country_id = GETPOSTINT('search_country_id'); $search_code = GETPOST('search_code', 'alpha'); $search_active = GETPOST('search_active', 'alpha'); @@ -931,13 +931,13 @@ if (empty($reshook)) { } if ($keycode == 'sortorder') { // For column name 'sortorder', we use the field name 'position' - $sql .= (int) GETPOST('position', 'int'); + $sql .= GETPOSTINT('position'); } elseif (GETPOST($keycode) == '' && !($keycode == 'code' && $id == 10)) { $sql .= "null"; // For vat, we want/accept code = '' } elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; } elseif (in_array($keycode, array('joinfile', 'private', 'pos', 'position', 'scale', 'use_default'))) { - $sql .= (int) GETPOST($keycode, 'int'); + $sql .= GETPOSTINT($keycode); } else { $sql .= "'".$db->escape(GETPOST($keycode, 'alphanohtml'))."'"; } @@ -952,8 +952,8 @@ if (empty($reshook)) { setEventMessages($langs->transnoentities("RecordCreatedSuccessfully"), null, 'mesgs'); // Clean $_POST array, we keep only id of dictionary - if ($id == 10 && GETPOST('country', 'int') > 0) { - $search_country_id = GETPOST('country', 'int'); + if ($id == 10 && GETPOSTINT('country') > 0) { + $search_country_id = GETPOSTINT('country'); } $_POST = array('id'=>$id); } else { @@ -1000,13 +1000,13 @@ if (empty($reshook)) { } $sql .= $field."="; if ($listfieldvalue[$i] == 'sortorder') { // For column name 'sortorder', we use the field name 'position' - $sql .= (int) GETPOST('position', 'int'); + $sql .= GETPOSTINT('position'); } elseif (GETPOST($keycode) == '' && !($keycode == 'code' && $id == 10)) { $sql .= "null"; // For vat, we want/accept code = '' } elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; } elseif (in_array($keycode, array('joinfile', 'private', 'pos', 'position', 'scale', 'use_default'))) { - $sql .= (int) GETPOST($keycode, 'int'); + $sql .= GETPOSTINT($keycode); } else { $sql .= "'".$db->escape(GETPOST($keycode, 'alphanohtml'))."'"; } @@ -2305,10 +2305,10 @@ if ($id > 0) { $showfield = 0; } elseif ($value == 'unicode') { $valuetoshow = $langs->getCurrencySymbol($obj->code, 1); - } elseif ($value == 'label' && $tabname[GETPOST("id", 'int')] == 'c_units') { + } elseif ($value == 'label' && $tabname[GETPOSTINT("id")] == 'c_units') { $langs->load("products"); $valuetoshow = $langs->trans($obj->$value); - } elseif ($value == 'short_label' && $tabname[GETPOST("id", 'int')] == 'c_units') { + } elseif ($value == 'short_label' && $tabname[GETPOSTINT("id")] == 'c_units') { $langs->load("products"); $valuetoshow = $langs->trans($obj->$value); } elseif (($value == 'unit') && ($tabname[$id] == 'c_paper_format')) { diff --git a/htdocs/admin/dolistore/ajax/image.php b/htdocs/admin/dolistore/ajax/image.php index 9ff92554e09..e5896a4eec1 100644 --- a/htdocs/admin/dolistore/ajax/image.php +++ b/htdocs/admin/dolistore/ajax/image.php @@ -40,8 +40,8 @@ top_httphead('image'); $dolistore = new Dolistore(); -$id_product = GETPOST('id_product', 'int'); -$id_image = GETPOST('id_image', 'int'); +$id_product = GETPOSTINT('id_product'); +$id_image = GETPOSTINT('id_image'); // quality : image resize with this in the URL : "cart_default", "home_default", "large_default", "medium_default", "small_default", "thickbox_default" $quality = GETPOST('quality', 'alpha'); diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php index b061eabdfe2..844f897547f 100644 --- a/htdocs/admin/emailcollector_card.php +++ b/htdocs/admin/emailcollector_card.php @@ -53,7 +53,7 @@ if (!isModEnabled('emailcollector')) { $langs->loadLangs(array("admin", "mails", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -61,7 +61,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'emailcollectorcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); -$operationid = GETPOST('operationid', 'int'); +$operationid = GETPOSTINT('operationid'); // Initialize technical objects $object = new EmailCollector($db); @@ -154,7 +154,7 @@ if (GETPOST('addfilter', 'alpha')) { if ($action == 'deletefilter') { $emailcollectorfilter = new EmailCollectorFilter($db); - $emailcollectorfilter->fetch(GETPOST('filterid', 'int')); + $emailcollectorfilter->fetch(GETPOSTINT('filterid')); if ($emailcollectorfilter->id > 0) { $result = $emailcollectorfilter->delete($user); if ($result > 0) { @@ -198,7 +198,7 @@ if (GETPOST('addoperation', 'alpha')) { if ($action == 'updateoperation') { $emailcollectoroperation = new EmailCollectorAction($db); - $emailcollectoroperation->fetch(GETPOST('rowidoperation2', 'int')); + $emailcollectoroperation->fetch(GETPOSTINT('rowidoperation2')); $emailcollectoroperation->actionparam = GETPOST('operationparam2', 'alphawithlgt'); @@ -221,7 +221,7 @@ if ($action == 'updateoperation') { } if ($action == 'deleteoperation') { $emailcollectoroperation = new EmailCollectorAction($db); - $emailcollectoroperation->fetch(GETPOST('operationid', 'int')); + $emailcollectoroperation->fetch(GETPOSTINT('operationid')); if ($emailcollectoroperation->id > 0) { $result = $emailcollectoroperation->delete($user); if ($result > 0) { diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 833e822c288..e431b1f19dc 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -38,7 +38,7 @@ $langs->loadLangs(array("admin", "other")); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -47,13 +47,13 @@ $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'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action $page = 0; @@ -99,8 +99,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -365,7 +365,7 @@ $arrayofmassactions = array( if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/admin/events.php b/htdocs/admin/events.php index afdeca4b7b2..6b321316f47 100644 --- a/htdocs/admin/events.php +++ b/htdocs/admin/events.php @@ -41,10 +41,10 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'au $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index a1360b92966..16f4e1acc36 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -152,13 +152,13 @@ if ($action == 'updateMask') { $res3 = 0; if (isModEnabled('project') && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided - $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity); + $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOSTINT('EXPENSEREPORT_PROJECT_IS_REQUIRED'), 'chaine', 0, '', $conf->entity); } - $dates = GETPOST('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', 'int'); + $dates = GETPOSTINT('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH'); $res4 = dolibarr_set_const($db, 'EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', intval($dates), 'chaine', 0, '', $conf->entity); - $amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int'); + $amounts = GETPOSTINT('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY'); $res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity); if (!($res1 > 0) || !($res2 > 0) || !($res3 >= 0) || !($res4 >0) || !($res5 >0)) { diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 639fcf50077..b3f22626264 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -60,11 +60,11 @@ if (empty($reshook)) { $error = false; $action = GETPOST('action', 'aZ09'); - $id = GETPOST('id', 'int'); + $id = GETPOSTINT('id'); $apply_to = GETPOST('apply_to'); - $fk_user = GETPOST('fk_user', 'int'); - $fk_usergroup = GETPOST('fk_usergroup', 'int'); + $fk_user = GETPOSTINT('fk_user'); + $fk_usergroup = GETPOSTINT('fk_usergroup'); $restrictive = GETPOSTINT('restrictive'); $fk_c_type_fees = GETPOSTINT('fk_c_type_fees'); $code_expense_rules_type = GETPOST('code_expense_rules_type'); diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php index b9c200b3b50..4d1b5cc3bed 100644 --- a/htdocs/admin/external_rss.php +++ b/htdocs/admin/external_rss.php @@ -68,8 +68,8 @@ if ($result) { } if ($action == 'add' || GETPOST("modify")) { - $external_rss_title = "external_rss_title_".GETPOST("norss", 'int'); - $external_rss_urlrss = "external_rss_urlrss_".GETPOST("norss", 'int'); + $external_rss_title = "external_rss_title_".GETPOSTINT("norss"); + $external_rss_urlrss = "external_rss_urlrss_".GETPOSTINT("norss"); if (GETPOST($external_rss_urlrss, 'alpha')) { $boxlabel = '(ExternalRSSInformations)'; @@ -93,7 +93,7 @@ if ($action == 'add' || GETPOST("modify")) { } else { // Ajoute boite box_external_rss dans definition des boites $sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes_def (file, note)"; - $sql .= " VALUES ('box_external_rss.php','".$db->escape(GETPOST("norss", 'int').' ('.GETPOST($external_rss_title, 'alpha')).")')"; + $sql .= " VALUES ('box_external_rss.php','".$db->escape(GETPOSTINT("norss").' ('.GETPOSTINT($external_rss_title)).")')"; if (!$db->query($sql)) { dol_print_error($db); $error++; @@ -101,9 +101,9 @@ if ($action == 'add' || GETPOST("modify")) { //print $sql;exit; } - $result1 = dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_".GETPOST("norss", 'int'), GETPOST($external_rss_title, 'alpha'), 'chaine', 0, '', $conf->entity); + $result1 = dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_".GETPOSTINT("norss"), GETPOSTINT($external_rss_title), 'chaine', 0, '', $conf->entity); if ($result1) { - $consttosave = "EXTERNAL_RSS_URLRSS_".GETPOST("norss", 'int'); + $consttosave = "EXTERNAL_RSS_URLRSS_".GETPOSTINT("norss"); $urltosave = GETPOST($external_rss_urlrss, 'alpha'); $result2 = dolibarr_set_const($db, $consttosave, $urltosave, 'chaine', 0, '', $conf->entity); //var_dump($result2);exit; @@ -121,12 +121,12 @@ if ($action == 'add' || GETPOST("modify")) { } if (GETPOST("delete")) { - if (GETPOST("norss", 'int')) { + if (GETPOSTINT("norss")) { $db->begin(); // Supprime boite box_external_rss de definition des boites $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."boxes_def"; - $sql .= " WHERE file = 'box_external_rss.php' AND note LIKE '".$db->escape(GETPOST("norss", 'int'))." %'"; + $sql .= " WHERE file = 'box_external_rss.php' AND note LIKE '".$db->escape(GETPOSTINT("norss"))." %'"; $resql = $db->query($sql); if ($resql) { @@ -161,9 +161,9 @@ if (GETPOST("delete")) { } - $result1 = dolibarr_del_const($db, "EXTERNAL_RSS_TITLE_".GETPOST("norss", 'int'), $conf->entity); + $result1 = dolibarr_del_const($db, "EXTERNAL_RSS_TITLE_".GETPOSTINT("norss"), $conf->entity); if ($result1) { - $result2 = dolibarr_del_const($db, "EXTERNAL_RSS_URLRSS_".GETPOST("norss", 'int'), $conf->entity); + $result2 = dolibarr_del_const($db, "EXTERNAL_RSS_URLRSS_".GETPOSTINT("norss"), $conf->entity); } if ($result1 && $result2) { diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index 30525d92a68..a28e5d57482 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -230,7 +230,7 @@ if ($action == 'updateMask') { } } } elseif ($action == 'set_INVOICE_CHECK_POSTERIOR_DATE') { - $check_posterior_date = GETPOST('INVOICE_CHECK_POSTERIOR_DATE', 'int'); + $check_posterior_date = GETPOSTINT('INVOICE_CHECK_POSTERIOR_DATE'); $res = dolibarr_set_const($db, 'INVOICE_CHECK_POSTERIOR_DATE', $check_posterior_date, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index ae0c57284df..e0c92c8f663 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -73,7 +73,7 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; if ($action == 'update') { - $max_rank = GETPOST('HRM_MAXRANK', 'int'); + $max_rank = GETPOSTINT('HRM_MAXRANK'); // We complete skill possible level notation if necessary if (!empty($max_rank)) { diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 2e13c2d5c7a..1d27c5b2dbd 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -248,17 +248,17 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("MAIN_SIZE_LISTE_LIMIT", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOSTINT("MAIN_SIZE_LISTE_LIMIT"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOSTINT("main_size_shortliste_limit"), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET("MAIN_CHECKBOX_LEFT_COLUMN")) { - dolibarr_set_const($db, "MAIN_CHECKBOX_LEFT_COLUMN", GETPOST("MAIN_CHECKBOX_LEFT_COLUMN", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_CHECKBOX_LEFT_COLUMN", GETPOSTINT("MAIN_CHECKBOX_LEFT_COLUMN"), 'chaine', 0, '', $conf->entity); } //dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity); //dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity); //dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", GETPOST("MAIN_MENU_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_START_WEEK", GETPOST("MAIN_START_WEEK", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_START_WEEK", GETPOSTINT("MAIN_START_WEEK"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_DAYS", GETPOST("MAIN_DEFAULT_WORKING_DAYS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_DEFAULT_WORKING_HOURS", GETPOST("MAIN_DEFAULT_WORKING_HOURS", 'alphanohtml'), 'chaine', 0, '', $conf->entity); @@ -318,7 +318,7 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity); } - header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup&mode=".$mode.(GETPOSTISSET('page_y') ? '&page_y='.GETPOST('page_y', 'int') : '')); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup&mode=".$mode.(GETPOSTISSET('page_y') ? '&page_y='.GETPOSTINT('page_y') : '')); exit; } diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index cc1fd97fe62..dcf59d40d8b 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -65,7 +65,7 @@ if (empty($reshook)) { if (!dolibarr_set_const($db, 'LDAP_SERVER_TYPE', GETPOST("type", 'aZ09'), 'chaine', 0, '', $conf->entity)) { $error++; } - if (!dolibarr_set_const($db, 'LDAP_USERACCOUNTCONTROL', GETPOST("userAccountControl", 'int'), 'chaine', 0, '', $conf->entity)) { + if (!dolibarr_set_const($db, 'LDAP_USERACCOUNTCONTROL', GETPOSTINT("userAccountControl"), 'chaine', 0, '', $conf->entity)) { $error++; } if (!dolibarr_set_const($db, 'LDAP_SERVER_PROTOCOLVERSION', GETPOST("LDAP_SERVER_PROTOCOLVERSION", 'aZ09'), 'chaine', 0, '', $conf->entity)) { @@ -77,7 +77,7 @@ if (empty($reshook)) { if (!dolibarr_set_const($db, 'LDAP_SERVER_HOST_SLAVE', GETPOST("slave", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) { $error++; } - if (!dolibarr_set_const($db, 'LDAP_SERVER_PORT', GETPOST("port", 'int'), 'chaine', 0, '', $conf->entity)) { + if (!dolibarr_set_const($db, 'LDAP_SERVER_PORT', GETPOSTINT("port"), 'chaine', 0, '', $conf->entity)) { $error++; } if (!dolibarr_set_const($db, 'LDAP_SERVER_DN', GETPOST("dn", 'alphanohtml'), 'chaine', 0, '', $conf->entity)) { diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 41699a84709..a4911e94e52 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -45,8 +45,8 @@ $mainmaxdecimalstot = 'MAIN_MAX_DECIMALS_TOT'.(!empty($currencycode) ? '_'.$curr $mainmaxdecimalsshown = 'MAIN_MAX_DECIMALS_SHOWN'.(!empty($currencycode) ? '_'.$currencycode : ''); $mainroundingruletot = 'MAIN_ROUNDING_RULE_TOT'.(!empty($currencycode) ? '_'.$currencycode : ''); -$valmainmaxdecimalsunit = GETPOST($mainmaxdecimalsunit, 'int'); -$valmainmaxdecimalstot = GETPOST($mainmaxdecimalstot, 'int'); +$valmainmaxdecimalsunit = GETPOSTINT($mainmaxdecimalsunit); +$valmainmaxdecimalstot = GETPOSTINT($mainmaxdecimalstot); $valmainmaxdecimalsshown = GETPOST($mainmaxdecimalsshown, 'alpha'); // Can be 'x.y' but also 'x...' $valmainroundingruletot = price2num(GETPOST($mainroundingruletot, 'alphanohtml'), '', 2); diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php index 417e90f9ef4..93a47a30e5e 100644 --- a/htdocs/admin/mailing.php +++ b/htdocs/admin/mailing.php @@ -51,7 +51,7 @@ if ($action == 'setvalue') { $mailerror = GETPOST('MAILING_EMAIL_ERRORSTO', 'alpha'); $checkread = GETPOST('value', 'alpha'); $checkread_key = GETPOST('MAILING_EMAIL_UNSUBSCRIBE_KEY', 'alpha'); - $contactbulkdefault = GETPOST('MAILING_CONTACT_DEFAULT_BULK_STATUS', 'int'); + $contactbulkdefault = GETPOSTINT('MAILING_CONTACT_DEFAULT_BULK_STATUS'); if (GETPOST('MAILING_DELAY', 'alpha') != '') { $mailingdelay = price2num(GETPOST('MAILING_DELAY', 'alpha'), 3); // Not less than 1 millisecond. } else { @@ -98,7 +98,7 @@ if ($action == 'setvalue') { } } if ($action == 'setonsearchandlistgooncustomerorsuppliercard') { - $setonsearchandlistgooncustomerorsuppliercard = GETPOST('value', 'int'); + $setonsearchandlistgooncustomerorsuppliercard = GETPOSTINT('value'); $res = dolibarr_set_const($db, "SOCIETE_ON_SEARCH_AND_LIST_GO_ON_CUSTOMER_OR_SUPPLIER_CARD", $setonsearchandlistgooncustomerorsuppliercard, 'yesno', 0, '', $conf->entity); if (!($res > 0)) { $error++; diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index cdda45c2a90..e224b75a986 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -86,13 +86,13 @@ if ($action == 'update' && !$cancel) { } if (!$error) { - dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOST("MAIN_DISABLE_ALL_MAILS", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DISABLE_ALL_MAILS", GETPOSTINT("MAIN_DISABLE_ALL_MAILS"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_FORCE_SENDTO", GETPOST("MAIN_MAIL_FORCE_SENDTO", 'alphanohtml'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_ENABLED_USER_DEST_SELECT", GETPOST("MAIN_MAIL_ENABLED_USER_DEST_SELECT", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, 'MAIN_MAIL_NO_WITH_TO_SELECTED', GETPOST('MAIN_MAIL_NO_WITH_TO_SELECTED', 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_ENABLED_USER_DEST_SELECT", GETPOSTINT("MAIN_MAIL_ENABLED_USER_DEST_SELECT"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MAIN_MAIL_NO_WITH_TO_SELECTED', GETPOSTINT('MAIN_MAIL_NO_WITH_TO_SELECTED'), 'chaine', 0, '', $conf->entity); // Send mode parameters dolibarr_set_const($db, "MAIN_MAIL_SENDMODE", GETPOST("MAIN_MAIL_SENDMODE", 'aZ09'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOST("MAIN_MAIL_SMTP_PORT", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_SMTP_PORT", GETPOSTINT("MAIN_MAIL_SMTP_PORT"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTP_SERVER", GETPOST("MAIN_MAIL_SMTP_SERVER", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_SMTPS_ID", GETPOST("MAIN_MAIL_SMTPS_ID", 'alphanohtml'), 'chaine', 0, '', $conf->entity); if (GETPOSTISSET("MAIN_MAIL_SMTPS_PW")) { @@ -104,11 +104,11 @@ if ($action == 'update' && !$cancel) { if (GETPOSTISSET("MAIN_MAIL_SMTPS_OAUTH_SERVICE")) { dolibarr_set_const($db, "MAIN_MAIL_SMTPS_OAUTH_SERVICE", GETPOST("MAIN_MAIL_SMTPS_OAUTH_SERVICE", 'alphanohtml'), 'chaine', 0, '', $conf->entity); } - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOST("MAIN_MAIL_EMAIL_TLS", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOST("MAIN_MAIL_EMAIL_STARTTLS", 'int'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED", GETPOST("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_TLS", GETPOSTINT("MAIN_MAIL_EMAIL_TLS"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS", GETPOSTINT("MAIN_MAIL_EMAIL_STARTTLS"), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED", GETPOSTINT("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED"), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_ENABLED", GETPOST("MAIN_MAIL_EMAIL_DKIM_ENABLED", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_ENABLED", GETPOSTINT("MAIN_MAIL_EMAIL_DKIM_ENABLED"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_DOMAIN", GETPOST("MAIN_MAIL_EMAIL_DKIM_DOMAIN", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_SELECTOR", GETPOST("MAIN_MAIL_EMAIL_DKIM_SELECTOR", 'alphanohtml'), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY", GETPOST("MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY", 'alphanohtml'), 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index d0a452061de..1d718819e79 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -35,7 +35,7 @@ $langs->loadLangs(array("errors", "admin", "mails", "languages")); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -44,14 +44,14 @@ $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', ...) -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $rowid = GETPOST('rowid', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -88,8 +88,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -203,7 +203,7 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; if ($action == 'delete') { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."c_email_senderprofile WHERE rowid = ".GETPOST('id', 'int'); + $sql = "DELETE FROM ".MAIN_DB_PREFIX."c_email_senderprofile WHERE rowid = ".GETPOSTINT('id'); $resql = $db->query($sql); if ($resql) { setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs'); @@ -268,7 +268,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"; } @@ -397,9 +397,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } @@ -453,11 +453,11 @@ if ($action != 'create') { print '
'.$langs->trans("User").''; print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers((GETPOSTISSET('private') ? GETPOST('private', 'int') : $object->private), 'private', 1, null, 0, ($user->admin ? '' : $user->id)); + print $form->select_dolusers((GETPOSTISSET('private') ? GETPOSTINT('private') : $object->private), 'private', 1, null, 0, ($user->admin ? '' : $user->id)); print '
'.$langs->trans("Position").'
'.$langs->trans("Position").'
'.$langs->trans("Status").''; - print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], (GETPOSTISSET('active') ? GETPOST('active', 'int') : $object->active), 0, 0, 0, '', 1); + print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], (GETPOSTISSET('active') ? GETPOSTINT('active') : $object->active), 0, 0, 0, '', 1); print '
'; @@ -485,11 +485,11 @@ if ($action != 'create') { print ''; print ''.$langs->trans("User").''; print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers((GETPOSTISSET('private') ? GETPOST('private', 'int') : -1), 'private', 1, null, 0, ($user->admin ? '' : $user->id)); + print $form->select_dolusers((GETPOSTISSET('private') ? GETPOSTINT('private') : -1), 'private', 1, null, 0, ($user->admin ? '' : $user->id)); print ''; - print ''.$langs->trans("Position").''; + print ''.$langs->trans("Position").''; print ''.$langs->trans("Status").''; - print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], GETPOST('active', 'int'), 0); + print $form->selectarray('active', $object->fields['active']['arrayofkeyval'], GETPOSTINT('active'), 0); print ''; print ''; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 13545002911..cc9b100d393 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -62,7 +62,7 @@ $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $mode = GETPOST('mode', 'aZ09'); $optioncss = GETPOST('optioncss', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $rowid = GETPOST('rowid', 'alpha'); $search_label = GETPOST('search_label', 'alphanohtml'); // Must allow value like 'Abc Def' or '(MyTemplateName)' $search_type_template = GETPOST('search_type_template', 'alpha'); @@ -81,10 +81,10 @@ $actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"') $listoffset = GETPOST('listoffset', 'alpha'); $listlimit = GETPOST('listlimit', 'alpha') > 0 ? GETPOST('listlimit', 'alpha') : 1000; -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -401,12 +401,12 @@ if (empty($reshook)) { if (!$user->admin) { // A non admin user can only edit its own template $sql .= " ".((int) $user->id); } else { - $sql .= " ".((int) GETPOST($keycode, 'int')); + $sql .= " ".(GETPOSTINT($keycode)); } } elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; } elseif (in_array($keycode, array('joinfiles', 'defaultfortype', 'private', 'position', 'entity'))) { - $sql .= (int) GETPOST($keycode, 'int'); + $sql .= GETPOSTINT($keycode); } else { $sql .= "'".$db->escape(GETPOST($keycode, 'alphanohtml'))."'"; } @@ -454,7 +454,7 @@ if (empty($reshook)) { } // Rename some POST variables into a generic name - if ($field == 'fk_user' && !(GETPOST('fk_user', 'int') > 0)) { + if ($field == 'fk_user' && !(GETPOSTINT('fk_user') > 0)) { $_POST['fk_user'] = ''; } if ($field == 'topic') { @@ -483,12 +483,12 @@ if (empty($reshook)) { if (!$user->admin) { // A non admin user can only edit its own template $sql .= " ".((int) $user->id); } else { - $sql .= " ".((int) GETPOST($keycode, 'int')); + $sql .= " ".(GETPOSTINT($keycode)); } } elseif ($keycode == 'content') { $sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'"; } elseif (in_array($keycode, array('joinfiles', 'defaultfortype', 'private', 'position'))) { - $sql .= (int) GETPOST($keycode, 'int'); + $sql .= GETPOSTINT($keycode); } else { $sql .= "'".$db->escape(GETPOST($keycode, 'alphanohtml'))."'"; } @@ -693,8 +693,8 @@ if ($action == 'create') { $obj->label = GETPOST('label'); $obj->lang = GETPOST('lang'); $obj->type_template = GETPOST('type_template'); - $obj->fk_user = GETPOST('fk_user', 'int'); - $obj->private = GETPOST('private', 'int'); + $obj->fk_user = GETPOSTINT('fk_user'); + $obj->private = GETPOSTINT('private'); $obj->position = GETPOST('position'); $obj->topic = GETPOST('topic'); $obj->joinfiles = GETPOST('joinfiles'); diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index 3b680f93a7b..f2969e5ed69 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -133,7 +133,7 @@ if ($action == 'add') { $menu->prefix = (string) GETPOST('picto', 'restricthtmlallowclass'); $menu->url = (string) GETPOST('url', 'alphanohtml'); $menu->langs = (string) GETPOST('langs', 'alphanohtml'); - $menu->position = (int) GETPOST('position', 'int'); + $menu->position = GETPOSTINT('position'); $menu->enabled = (string) GETPOST('enabled', 'alphanohtml'); $menu->perms = (string) GETPOST('perms', 'alphanohtml'); $menu->target = (string) GETPOST('target', 'alphanohtml'); @@ -187,14 +187,14 @@ if ($action == 'update') { if (!$error) { $menu = new Menubase($db); - $result = $menu->fetch(GETPOST('menuId', 'int')); + $result = $menu->fetch(GETPOSTINT('menuId')); if ($result > 0) { $menu->title = (string) GETPOST('titre', 'alphanohtml'); $menu->prefix = (string) GETPOST('picto', 'restricthtmlallowclass'); $menu->leftmenu = (string) GETPOST('leftmenu', 'aZ09'); $menu->url = (string) GETPOST('url', 'alphanohtml'); $menu->langs = (string) GETPOST('langs', 'alphanohtml'); - $menu->position = (int) GETPOST('position', 'int'); + $menu->position = GETPOSTINT('position'); $menu->enabled = (string) GETPOST('enabled', 'alphanohtml'); $menu->perms = (string) GETPOST('perms', 'alphanohtml'); $menu->target = (string) GETPOST('target', 'alphanohtml'); @@ -274,7 +274,7 @@ if ($action == 'create') { print load_fiche_titre($langs->trans("NewMenu"), '', 'title_setup'); - print ''; + print ''; print ''; print dol_get_fiche_head(); @@ -283,16 +283,16 @@ if ($action == 'create') { print ''; // Id - $parent_rowid = GETPOST('menuId', 'int'); + $parent_rowid = GETPOSTINT('menuId'); $parent_mainmenu = ''; $parent_leftmenu = ''; $parent_langs = ''; $parent_level = ''; - if (GETPOST('menuId', 'int')) { + if (GETPOSTINT('menuId')) { $sql = "SELECT m.rowid, m.mainmenu, m.leftmenu, m.level, m.langs"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql .= " WHERE m.rowid = ".((int) GETPOST('menuId', 'int')); + $sql .= " WHERE m.rowid = ".(GETPOSTINT('menuId')); $res = $db->query($sql); if ($res) { while ($menu = $db->fetch_array($res)) { @@ -408,7 +408,7 @@ if ($action == 'create') { print ''; print ''; print ''; - print ''; + print ''; print dol_get_fiche_head(); @@ -416,7 +416,7 @@ if ($action == 'create') { print '
'; $menu = new Menubase($db); - $result = $menu->fetch(GETPOST('menuId', 'int')); + $result = $menu->fetch(GETPOSTINT('menuId')); //var_dump($menu); // Id diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index d18f205f4de..c6099a88c6c 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -75,7 +75,7 @@ if ($action == 'up') { // Get current position $sql = "SELECT m.rowid, m.position, m.type, m.fk_menu"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql .= " WHERE m.rowid = ".GETPOST("menuId", "int"); + $sql .= " WHERE m.rowid = ".GETPOSTINT("menuId"); dol_syslog("admin/menus/index.php ".$sql); $result = $db->query($sql); $num = $db->num_rows($result); @@ -92,7 +92,7 @@ if ($action == 'up') { // Menu before $sql = "SELECT m.rowid, m.position"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql .= " WHERE (m.position < ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid < ".GETPOST("menuId", "int")."))"; + $sql .= " WHERE (m.position < ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid < ".GETPOSTINT("menuId")."))"; $sql .= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'"; $sql .= " AND m.entity = ".$conf->entity; $sql .= " AND m.type = '".$db->escape($current['type'])."'"; @@ -126,7 +126,7 @@ if ($action == 'up') { // Get current position $sql = "SELECT m.rowid, m.position, m.type, m.fk_menu"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql .= " WHERE m.rowid = ".GETPOST("menuId", "int"); + $sql .= " WHERE m.rowid = ".GETPOSTINT("menuId"); dol_syslog("admin/menus/index.php ".$sql); $result = $db->query($sql); $num = $db->num_rows($result); @@ -143,7 +143,7 @@ if ($action == 'up') { // Menu after $sql = "SELECT m.rowid, m.position"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql .= " WHERE (m.position > ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid > ".GETPOST("menuId", "int")."))"; + $sql .= " WHERE (m.position > ".($current['order'])." OR (m.position = ".($current['order'])." AND rowid > ".GETPOSTINT("menuId")."))"; $sql .= " AND m.menu_handler='".$db->escape($menu_handler_to_search)."'"; $sql .= " AND m.entity = ".$conf->entity; $sql .= " AND m.type = '".$db->escape($current['type'])."'"; @@ -174,7 +174,7 @@ if ($action == 'up') { $db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."menu"; - $sql .= " WHERE rowid = ".GETPOST('menuId', 'int'); + $sql .= " WHERE rowid = ".GETPOSTINT('menuId'); $resql = $db->query($sql); if ($resql) { $db->commit(); @@ -231,11 +231,11 @@ print "
\n"; if ($action == 'delete') { $sql = "SELECT m.titre as title"; $sql .= " FROM ".MAIN_DB_PREFIX."menu as m"; - $sql .= " WHERE m.rowid = ".GETPOST('menuId', 'int'); + $sql .= " WHERE m.rowid = ".GETPOSTINT('menuId'); $result = $db->query($sql); $obj = $db->fetch_object($result); - print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOST('menuId', 'int'), $langs->trans("DeleteMenu"), $langs->trans("ConfirmDeleteMenu", $obj->title), "confirm_delete"); + print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".GETPOSTINT('menuId'), $langs->trans("DeleteMenu"), $langs->trans("ConfirmDeleteMenu", $obj->title), "confirm_delete"); } $newcardbutton = ''; diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 8ef166d933c..dd91a52a04d 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -41,7 +41,7 @@ $langs->loadLangs(array('errors', 'admin', 'modulebuilder', 'exports')); $mode = GETPOST('mode', 'alpha'); $action = GETPOST('action', 'aZ09'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); if (empty($mode)) { $mode = 'desc'; } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 62c612ab24a..d24c833cb85 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -56,7 +56,7 @@ if (GETPOSTISSET('mode')) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); -$page_y = GETPOST('page_y', 'int'); +$page_y = GETPOSTINT('page_y'); $search_keyword = GETPOST('search_keyword', 'alpha'); $search_status = GETPOST('search_status', 'alpha'); $search_nature = GETPOST('search_nature', 'alpha'); @@ -66,9 +66,9 @@ $search_version = GETPOST('search_version', 'alpha'); // For dolistore search $options = array(); $options['per_page'] = 20; -$options['categorie'] = ((int) (GETPOST('categorie', 'int') ? GETPOST('categorie', 'int') : 0)); -$options['start'] = ((int) (GETPOST('start', 'int') ? GETPOST('start', 'int') : 0)); -$options['end'] = ((int) (GETPOST('end', 'int') ? GETPOST('end', 'int') : 0)); +$options['categorie'] = ((int) (GETPOSTINT('categorie') ? GETPOSTINT('categorie') : 0)); +$options['start'] = ((int) (GETPOSTINT('start') ? GETPOSTINT('start') : 0)); +$options['end'] = ((int) (GETPOSTINT('end') ? GETPOSTINT('end') : 0)); $options['search'] = GETPOST('search_keyword', 'alpha'); $dolistore = new Dolistore(false); diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 08822da9a59..6121350b972 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -100,7 +100,7 @@ if ($action == 'add_currency') { $error = 0; if (GETPOST('updatecurrency', 'alpha')) { - $fk_multicurrency = GETPOST('fk_multicurrency', 'int'); + $fk_multicurrency = GETPOSTINT('fk_multicurrency'); $rate = price2num(GETPOST('rate', 'alpha')); $currency = new MultiCurrency($db); @@ -117,7 +117,7 @@ if ($action == 'add_currency') { } } } elseif (GETPOST('deletecurrency', 'alpha')) { - $fk_multicurrency = GETPOST('fk_multicurrency', 'int'); + $fk_multicurrency = GETPOSTINT('fk_multicurrency'); $currency = new MultiCurrency($db); if ($currency->fetch($fk_multicurrency) > 0) { diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php index 5fd744ca88b..55dc6212a60 100644 --- a/htdocs/admin/payment.php +++ b/htdocs/admin/payment.php @@ -79,7 +79,7 @@ if ($action == 'setparams') { $error++; } - $res = dolibarr_set_const($db, "PAYMENTS_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "PAYMENTS_REPORT_GROUP_BY_MOD", GETPOSTINT('PAYMENTS_REPORT_GROUP_BY_MOD'), 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } diff --git a/htdocs/admin/paymentbybanktransfer.php b/htdocs/admin/paymentbybanktransfer.php index e5fe6cc018c..43e2f1473d2 100644 --- a/htdocs/admin/paymentbybanktransfer.php +++ b/htdocs/admin/paymentbybanktransfer.php @@ -50,7 +50,7 @@ $type = 'paymentorder'; if ($action == "set") { $db->begin(); - $id = GETPOST('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT', 'int'); + $id = GETPOSTINT('PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT'); $account = new Account($db); if ($account->fetch($id) > 0) { $res = dolibarr_set_const($db, "PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity); @@ -115,7 +115,7 @@ if ($action == "set") { if ($action == "addnotif") { $bon = new BonPrelevement($db); - $bon->addNotification($db, GETPOST('user', 'int'), $action); + $bon->addNotification($db, GETPOSTINT('user'), $action); header("Location: ".$_SERVER["PHP_SELF"]); exit; @@ -123,7 +123,7 @@ if ($action == "addnotif") { if ($action == "deletenotif") { $bon = new BonPrelevement($db); - $bon->deleteNotificationById(GETPOST('notif', 'int')); + $bon->deleteNotificationById(GETPOSTINT('notif')); header("Location: ".$_SERVER["PHP_SELF"]); exit; diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index e9af7bdc816..a792c664a6c 100644 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -137,7 +137,7 @@ if ($action == 'update') { } if (GETPOSTISSET('MAIN_DOCUMENTS_LOGO_HEIGHT')) { - dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOSTINT("MAIN_DOCUMENTS_LOGO_HEIGHT"), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET('MAIN_INVERT_SENDER_RECIPIENT')) { dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 2c76236310c..31becefc379 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -75,10 +75,10 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", GETPOST("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')) { - dolibarr_set_const($db, "MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", GETPOST("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", GETPOSTINT("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH"), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET('INVOICE_ADD_ZATCA_QR_CODE')) { - dolibarr_set_const($db, "INVOICE_ADD_ZATCA_QR_CODE", GETPOST("INVOICE_ADD_ZATCA_QR_CODE", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "INVOICE_ADD_ZATCA_QR_CODE", GETPOSTINT("INVOICE_ADD_ZATCA_QR_CODE"), 'chaine', 0, '', $conf->entity); if (GETPOSTINT('INVOICE_ADD_ZATCA_QR_CODE') == 1) { dolibarr_del_const($db, "INVOICE_ADD_SWISS_QR_CODE", $conf->entity); } @@ -90,10 +90,10 @@ if ($action == 'update') { } } if (GETPOSTISSET('INVOICE_CATEGORY_OF_OPERATION')) { - dolibarr_set_const($db, "INVOICE_CATEGORY_OF_OPERATION", GETPOST("INVOICE_CATEGORY_OF_OPERATION", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "INVOICE_CATEGORY_OF_OPERATION", GETPOSTINT("INVOICE_CATEGORY_OF_OPERATION"), 'chaine', 0, '', $conf->entity); } if (GETPOSTISSET('INVOICE_SHOW_SHIPPING_ADDRESS')) { - dolibarr_set_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", GETPOST("INVOICE_SHOW_SHIPPING_ADDRESS", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", GETPOSTINT("INVOICE_SHOW_SHIPPING_ADDRESS"), 'chaine', 0, '', $conf->entity); dolibarr_del_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", $conf->entity); } diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index e7c4bd3fbb4..b74904f0a9f 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -47,14 +47,14 @@ $entity = $conf->entity; if ($action == 'add') { $sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=1"; - $sql .= " WHERE id = ".GETPOST("pid", 'int'); + $sql .= " WHERE id = ".GETPOSTINT("pid"); $sql .= " AND entity = ".$conf->entity; $db->query($sql); } if ($action == 'remove') { $sql = "UPDATE ".MAIN_DB_PREFIX."rights_def SET bydefault=0"; - $sql .= " WHERE id = ".GETPOST('pid', 'int'); + $sql .= " WHERE id = ".GETPOSTINT('pid'); $sql .= " AND entity = ".$conf->entity; $db->query($sql); } diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 8e25b9295b9..f1add49e837 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -52,7 +52,7 @@ $error = 0; if ($action == "set") { $db->begin(); - $id = GETPOST('PRELEVEMENT_ID_BANKACCOUNT', 'int'); + $id = GETPOSTINT('PRELEVEMENT_ID_BANKACCOUNT'); $account = new Account($db); if ($account->fetch($id) > 0) { $res = dolibarr_set_const($db, "PRELEVEMENT_ID_BANKACCOUNT", $id, 'chaine', 0, '', $conf->entity); @@ -118,7 +118,7 @@ if ($action == "set") { if ($action == "addnotif") { $bon = new BonPrelevement($db); - $bon->addNotification($db, GETPOST('user', 'int'), $action); + $bon->addNotification($db, GETPOSTINT('user'), $action); header("Location: ".$_SERVER["PHP_SELF"]); exit; @@ -126,7 +126,7 @@ if ($action == "addnotif") { if ($action == "deletenotif") { $bon = new BonPrelevement($db); - $bon->deleteNotificationById(GETPOST('notif', 'int')); + $bon->deleteNotificationById(GETPOSTINT('notif')); header("Location: ".$_SERVER["PHP_SELF"]); exit; diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php index 2c7f58be336..6b7c5f686ed 100644 --- a/htdocs/admin/receiptprinter.php +++ b/htdocs/admin/receiptprinter.php @@ -44,12 +44,12 @@ $action = GETPOST('action', 'aZ09'); $mode = GETPOST('mode', 'alpha'); $printername = GETPOST('printername', 'alpha'); -$printerid = GETPOST('printerid', 'int'); +$printerid = GETPOSTINT('printerid'); $parameter = GETPOST('parameter', 'alpha'); $template = GETPOST('template', 'alphanohtml'); $templatename = GETPOST('templatename', 'alpha'); -$templateid = GETPOST('templateid', 'int'); +$templateid = GETPOSTINT('templateid'); $printer = new dolReceiptPrinter($db); @@ -89,7 +89,7 @@ if ($action == 'addprinter' && $user->admin) { if (!$error) { $db->begin(); - $result = $printer->addPrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter); + $result = $printer->addPrinter($printername, GETPOSTINT('printertypeid'), GETPOSTINT('printerprofileid'), $parameter); if ($result > 0) { $error++; } @@ -139,7 +139,7 @@ if ($action == 'updateprinter' && $user->admin) { if (!$error) { $db->begin(); - $result = $printer->updatePrinter($printername, GETPOST('printertypeid', 'int'), GETPOST('printerprofileid', 'int'), $parameter, $printerid); + $result = $printer->updatePrinter($printername, GETPOSTINT('printertypeid'), GETPOSTINT('printerprofileid'), $parameter, $printerid); if ($result > 0) { $error++; } diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index c1e01049a65..c8ac3fa4423 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -131,7 +131,7 @@ if ($action == 'updateMask') { dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR); } } elseif ($action == 'setparams') { - $res = dolibarr_set_const($db, "PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", GETPOST('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD', 'int'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", GETPOSTINT('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD'), 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } diff --git a/htdocs/admin/taxes.php b/htdocs/admin/taxes.php index f917784870e..fc745fb998c 100644 --- a/htdocs/admin/taxes.php +++ b/htdocs/admin/taxes.php @@ -71,7 +71,7 @@ if ($action == 'update') { $error = 0; // Tax mode - $tax_mode = GETPOST('tax_mode', 'int'); + $tax_mode = GETPOSTINT('tax_mode'); $db->begin(); @@ -122,7 +122,7 @@ if ($action == 'update') { dolibarr_set_const($db, "MAIN_INFO_VAT_RETURN", GETPOST("MAIN_INFO_VAT_RETURN", 'alpha'), 'chaine', 0, '', $conf->entity); - dolibarr_set_const($db, "MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION", GETPOST("deadline_day_vat", 'int'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_INFO_TVA_DAY_DEADLINE_SUBMISSION", GETPOSTINT("deadline_day_vat"), 'chaine', 0, '', $conf->entity); if (!$error) { $db->commit(); diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 6ca24301575..19405ddbf4b 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -86,7 +86,7 @@ if ($action == 'updateMask') { } } elseif (preg_match('/set_(.*)/', $action, $reg)) { $code = $reg[1]; - $value = GETPOSTISSET($code) ? GETPOST($code, 'int') : 1; + $value = GETPOSTISSET($code) ? GETPOSTINT($code) : 1; if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha'); $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity); @@ -152,20 +152,20 @@ if ($action == 'updateMask') { } if (GETPOSTISSET('product_category_id')) { - $param_ticket_product_category = GETPOST('product_category_id', 'int'); + $param_ticket_product_category = GETPOSTINT('product_category_id'); $res = dolibarr_set_const($db, 'TICKET_PRODUCT_CATEGORY', $param_ticket_product_category, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } } - $param_delay_first_response = GETPOST('delay_first_response', 'int'); + $param_delay_first_response = GETPOSTINT('delay_first_response'); $res = dolibarr_set_const($db, 'TICKET_DELAY_BEFORE_FIRST_RESPONSE', $param_delay_first_response, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; } - $param_delay_between_responses = GETPOST('delay_between_responses', 'int'); + $param_delay_between_responses = GETPOSTINT('delay_between_responses'); $res = dolibarr_set_const($db, 'TICKET_DELAY_SINCE_LAST_RESPONSE', $param_delay_between_responses, 'chaine', 0, '', $conf->entity); if (!($res > 0)) { $error++; diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php index e58b0599b76..942ff6662c0 100644 --- a/htdocs/admin/ticket_public.php +++ b/htdocs/admin/ticket_public.php @@ -163,7 +163,7 @@ if ($action == 'setTICKET_ENABLE_PUBLIC_INTERFACE') { } } elseif (preg_match('/set_(.*)/', $action, $reg)) { $code = $reg[1]; - $value = GETPOSTISSET($code) ? GETPOST($code, 'int') : 1; + $value = GETPOSTISSET($code) ? GETPOSTINT($code) : 1; if ($code == 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS' && getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { $param_notification_also_main_addressemail = GETPOST('TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', 'alpha'); $res = dolibarr_set_const($db, 'TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS', $param_notification_also_main_addressemail, 'chaine', 0, '', $conf->entity); diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php index 48781cd43e2..a3ffe8a8c53 100644 --- a/htdocs/admin/tools/dolibarr_export.php +++ b/htdocs/admin/tools/dolibarr_export.php @@ -34,7 +34,7 @@ $action = GETPOST('action', 'aZ09'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "DESC"; } @@ -44,7 +44,7 @@ if (!$sortfield) { if (empty($page) || $page == -1) { $page = 0; } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; if (!$user->admin) { diff --git a/htdocs/admin/tools/export.php b/htdocs/admin/tools/export.php index e01aa09e96b..a708e51adfa 100644 --- a/htdocs/admin/tools/export.php +++ b/htdocs/admin/tools/export.php @@ -38,10 +38,10 @@ $export_type = GETPOST('export_type', 'alpha'); $file = dol_sanitizeFileName(GETPOST('filename_template', 'alpha')); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action @@ -68,7 +68,7 @@ $utils = new Utils($db); if ($file && !$what) { //print DOL_URL_ROOT.'/dolibarr_export.php'; - header("Location: ".DOL_URL_ROOT.'/admin/tools/dolibarr_export.php?msg='.urlencode($langs->trans("ErrorFieldRequired", $langs->transnoentities("ExportMethod"))).(GETPOST('page_y', 'int') ? '&page_y='.GETPOST('page_y', 'int') : '')); + header("Location: ".DOL_URL_ROOT.'/admin/tools/dolibarr_export.php?msg='.urlencode($langs->trans("ErrorFieldRequired", $langs->transnoentities("ExportMethod"))).(GETPOSTINT('page_y') ? '&page_y='.GETPOSTINT('page_y') : '')); exit; } @@ -222,5 +222,5 @@ top_httphead(); $db->close(); // Redirect to backup page -header("Location: dolibarr_export.php".(GETPOST('page_y', 'int') ? '?page_y='.GETPOST('page_y', 'int') : '')); +header("Location: dolibarr_export.php".(GETPOSTINT('page_y') ? '?page_y='.GETPOSTINT('page_y') : '')); exit(); diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php index 1907e451b53..551a90c7b67 100644 --- a/htdocs/admin/tools/export_files.php +++ b/htdocs/admin/tools/export_files.php @@ -47,7 +47,7 @@ $file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2|\.zst)$/i', '', $ $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "DESC"; } @@ -59,7 +59,7 @@ if ($page < 0) { } elseif (empty($page)) { $page = 0; } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; if (!$user->admin) { diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 669d1fefac6..54fa535d5fc 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -47,10 +47,10 @@ if ($user->socid > 0) { $langs->loadLangs(array("companies", "admin", "users", "other","withdrawals")); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -64,7 +64,7 @@ if (!$sortorder) { $sortorder = "DESC"; } -$search_rowid = GETPOST("search_rowid", "int"); +$search_rowid = GETPOSTINT("search_rowid"); $search_code = GETPOST("search_code", "alpha"); $search_ip = GETPOST("search_ip", "alpha"); $search_user = GETPOST("search_user", "alpha"); @@ -76,13 +76,13 @@ $optioncss = GETPOST("optioncss", "aZ"); // Option for the css output (always '' $now = dol_now(); $nowarray = dol_getdate($now); -if (GETPOST("date_startmonth", 'int') > 0) { - $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth", 'int'), GETPOST("date_startday", 'int'), GETPOST("date_startyear", 'int'), 'tzuserrel'); +if (GETPOSTINT("date_startmonth") > 0) { + $date_start = dol_mktime(0, 0, 0, GETPOSTINT("date_startmonth"), GETPOSTINT("date_startday"), GETPOSTINT("date_startyear"), 'tzuserrel'); } else { $date_start = ''; } -if (GETPOST("date_endmonth", 'int') > 0) { - $date_end = dol_get_last_hour(dol_mktime(23, 59, 59, GETPOST("date_endmonth", 'int'), GETPOST("date_endday", 'int'), GETPOST("date_endyear", 'int'), 'tzuserrel'), 'tzuserrel'); +if (GETPOSTINT("date_endmonth") > 0) { + $date_end = dol_get_last_hour(dol_mktime(23, 59, 59, GETPOSTINT("date_endmonth"), GETPOSTINT("date_endday"), GETPOSTINT("date_endyear"), 'tzuserrel'), 'tzuserrel'); } else { $date_end = ''; } diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php index 1254bdeedc7..4a1861be87b 100644 --- a/htdocs/admin/tools/listsessions.php +++ b/htdocs/admin/tools/listsessions.php @@ -47,10 +47,10 @@ if ($user->socid > 0) { $socid = $user->socid; } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index e23297cc251..04b8cee7488 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -35,7 +35,7 @@ if (!$user->admin) { accessforbidden(); } -$id = GETPOST('rowid', 'int'); +$id = GETPOSTINT('rowid'); $action = GETPOST('action', 'aZ09'); $optioncss = GETPOST('optionscss', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ09'); @@ -51,10 +51,10 @@ if ($mode == 'searchkey') { } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -120,7 +120,7 @@ if ($action == 'update') { if (!$error) { $db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transkey = '".$db->escape($transkey)."', transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".((int) GETPOST('rowid', 'int')); + $sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transkey = '".$db->escape($transkey)."', transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".(GETPOSTINT('rowid')); $result = $db->query($sql); if ($result) { $db->commit(); @@ -397,7 +397,7 @@ if ($mode == 'overwrite') { print ''."\n"; print ''; print ''; $coldisplay++; - print ''; $coldisplay++; diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index 484360aae04..20fdeceede1 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; $langs->loadLangs(array("agenda", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -54,10 +54,10 @@ if (GETPOST('actioncode', 'array')) { $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index ae32bbe7b33..8845a16723b 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -34,9 +34,9 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; $langs->loadLangs(array("agenda", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOSTINT('lineid'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -148,10 +148,10 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); + $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', '', 'date', '', $user, $triggermodname); } if ($action == 'classin' && $permissiontoadd) { - $object->setProject(GETPOST('projectid', 'int')); + $object->setProject(GETPOSTINT('projectid')); } // Actions to send emails @@ -411,7 +411,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Show object lines $result = $object->getLinesArray(); - print ' + print ' @@ -429,7 +429,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1); + $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1); } // Form to add new line diff --git a/htdocs/bookcal/availabilities_contact.php b/htdocs/bookcal/availabilities_contact.php index 07278fd60c7..cfd91d3b2f6 100644 --- a/htdocs/bookcal/availabilities_contact.php +++ b/htdocs/bookcal/availabilities_contact.php @@ -32,10 +32,10 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page $langs->loadLangs(array("agenda", "companies", "other", "mails")); -$id = (GETPOST('id') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOST('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$lineid = GETPOST('lineid', 'int'); -$socid = GETPOST('socid', 'int'); +$lineid = GETPOSTINT('lineid'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); // Initialize technical objects @@ -78,7 +78,7 @@ if (!$permissiontoread) { */ if ($action == 'addcontact' && $permission) { - $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $contactid = (GETPOST('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); @@ -95,7 +95,7 @@ if ($action == 'addcontact' && $permission) { } } elseif ($action == 'swapstatut' && $permission) { // Toggle the status of a contact - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } elseif ($action == 'deletecontact' && $permission) { // Deletes a contact $result = $object->delete_contact($lineid); diff --git a/htdocs/bookcal/availabilities_document.php b/htdocs/bookcal/availabilities_document.php index 723df675ef5..cbd0d169216 100644 --- a/htdocs/bookcal/availabilities_document.php +++ b/htdocs/bookcal/availabilities_document.php @@ -37,14 +37,14 @@ $langs->loadLangs(array("agenda", "companies", "other", "mails")); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); -$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$id = (GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id')); $ref = GETPOST('ref', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index ca40cc6bc95..a98a6beb8bb 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -37,12 +37,12 @@ require_once __DIR__.'/class/availabilities.class.php'; // Load translation files required by the page $langs->loadLangs(array("agenda", "other")); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -52,10 +52,10 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ' $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -93,8 +93,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -259,7 +259,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"; } @@ -416,9 +416,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } @@ -440,7 +440,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/bookcal/availabilities_note.php b/htdocs/bookcal/availabilities_note.php index 5b8b4dee169..3f7bf24edee 100644 --- a/htdocs/bookcal/availabilities_note.php +++ b/htdocs/bookcal/availabilities_note.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; $langs->loadLangs(array("agenda", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/bookcal/bookcalindex.php b/htdocs/bookcal/bookcalindex.php index cbffda374fd..018a6914676 100644 --- a/htdocs/bookcal/bookcalindex.php +++ b/htdocs/bookcal/bookcalindex.php @@ -38,7 +38,7 @@ $action = GETPOST('action', 'aZ09'); // if (! $user->hasRight('bookcal', 'myobject', 'read')) { // accessforbidden(); // } -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if (isset($user->socid) && $user->socid > 0) { $action = ''; $socid = $user->socid; diff --git a/htdocs/bookcal/booking_list.php b/htdocs/bookcal/booking_list.php index 32d048a2b44..2503e170947 100644 --- a/htdocs/bookcal/booking_list.php +++ b/htdocs/bookcal/booking_list.php @@ -42,9 +42,9 @@ require_once __DIR__.'/class/calendar.class.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "other")); -$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $type = GETPOST('type', 'aZ09'); diff --git a/htdocs/bookcal/calendar_agenda.php b/htdocs/bookcal/calendar_agenda.php index deb1f993471..b7b2d319649 100644 --- a/htdocs/bookcal/calendar_agenda.php +++ b/htdocs/bookcal/calendar_agenda.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_calendar.lib.php'; $langs->loadLangs(array("bookcal@bookcal", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -53,10 +53,10 @@ if (GETPOST('actioncode', 'array')) { $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bookcal/calendar_card.php b/htdocs/bookcal/calendar_card.php index 45efc029195..6d8038b8d4a 100644 --- a/htdocs/bookcal/calendar_card.php +++ b/htdocs/bookcal/calendar_card.php @@ -84,9 +84,9 @@ dol_include_once('/bookcal/lib/bookcal_calendar.lib.php'); $langs->loadLangs(array("bookcal@bookcal", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOSTINT('lineid'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -204,10 +204,10 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); + $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', '', 'date', '', $user, $triggermodname); } if ($action == 'classin' && $permissiontoadd) { - $object->setProject(GETPOST('projectid', 'int')); + $object->setProject(GETPOSTINT('projectid')); } // Actions to send emails @@ -445,7 +445,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Show object lines $result = $object->getLinesArray(); - print ' + print ' @@ -463,7 +463,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1); + $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1); } // Form to add new line diff --git a/htdocs/bookcal/calendar_contact.php b/htdocs/bookcal/calendar_contact.php index 8247fa2ca74..71821a0a8c3 100644 --- a/htdocs/bookcal/calendar_contact.php +++ b/htdocs/bookcal/calendar_contact.php @@ -62,10 +62,10 @@ dol_include_once('/bookcal/lib/bookcal_calendar.lib.php'); // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); -$id = (GETPOST('id') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOST('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$lineid = GETPOST('lineid', 'int'); -$socid = GETPOST('socid', 'int'); +$lineid = GETPOSTINT('lineid'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); // Initialize technical objects @@ -108,7 +108,7 @@ if (!$permissiontoread) { */ if ($action == 'addcontact' && $permission) { - $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $contactid = (GETPOST('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); @@ -125,7 +125,7 @@ if ($action == 'addcontact' && $permission) { } } elseif ($action == 'swapstatut' && $permission) { // Toggle the status of a contact - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } elseif ($action == 'deletecontact' && $permission) { // Deletes a contact $result = $object->delete_contact($lineid); diff --git a/htdocs/bookcal/calendar_document.php b/htdocs/bookcal/calendar_document.php index 96b8b5b4d83..4a71e5d6457 100644 --- a/htdocs/bookcal/calendar_document.php +++ b/htdocs/bookcal/calendar_document.php @@ -86,14 +86,14 @@ $langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); -$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$id = (GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id')); $ref = GETPOST('ref', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index 9230edb9285..e8fc92b546d 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -36,7 +36,7 @@ $langs->loadLangs(array("bookcal@bookcal", "other")); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -45,14 +45,14 @@ $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', ...) -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -90,8 +90,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -256,7 +256,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"; } @@ -398,9 +398,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } @@ -422,7 +422,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/bookcal/calendar_note.php b/htdocs/bookcal/calendar_note.php index 31f47504264..5f13b1129e6 100644 --- a/htdocs/bookcal/calendar_note.php +++ b/htdocs/bookcal/calendar_note.php @@ -80,7 +80,7 @@ dol_include_once('/bookcal/lib/bookcal_calendar.lib.php'); $langs->loadLangs(array("bookcal@bookcal", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index d9d887ab4d4..3e474c85762 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -34,12 +34,12 @@ $langs->loadLangs(array('bookmarks', 'other')); // Get Parameters -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); $action = GETPOST("action", "alpha"); $title = (string) GETPOST("title", "alpha"); $url = (string) GETPOST("url", "alpha"); $urlsource = GETPOST("urlsource", "alpha"); -$target = GETPOST("target", "int"); +$target = GETPOSTINT("target"); $userid = GETPOSTINT("userid"); $position = GETPOSTINT("position"); $backtopage = GETPOST('backtopage', 'alpha'); @@ -82,7 +82,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update') { } if ($action == 'update') { - $object->fetch(GETPOST("id", 'int')); + $object->fetch(GETPOSTINT("id")); } // Check if null because user not admin can't set an user and send empty value here. if (!empty($userid)) { @@ -183,18 +183,18 @@ if ($action == 'create') { if ($url && !preg_match('/^http/i', $url)) { $defaulttarget = 0; } - print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : $defaulttarget, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300'); + print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOSTINT('target') : $defaulttarget, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300'); print ''; // Visibility / Owner print ''; // Position print ''; print '
'.$obj->lang.''; - if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) { + if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) { print ''; } else { print $obj->transkey; @@ -411,7 +411,7 @@ if ($mode == 'overwrite') { print ''; print ''; */ - if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) { + if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) { print ''; } else { //print $obj->transkey.' '.$langsenfileonly->tab_translate[$obj->transkey]; @@ -426,7 +426,7 @@ if ($mode == 'overwrite') { print ''; - if ($action == 'edit' && $obj->rowid == GETPOST('rowid', 'int')) { + if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) { print ''; print ''; print '   '; diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php index ade787ae727..3bceb532a83 100644 --- a/htdocs/admin/website.php +++ b/htdocs/admin/website.php @@ -49,10 +49,10 @@ $actl[0] = img_picto($langs->trans("Disabled"), 'switch_off', 'class="size15x"') $actl[1] = img_picto($langs->trans("Activated"), 'switch_on', 'class="size15x"'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -238,7 +238,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) { $db->begin(); $website = new Website($db); - $rowid = GETPOST('rowid', 'int'); + $rowid = GETPOSTINT('rowid'); $website->fetch($rowid); // Modify entry diff --git a/htdocs/admin/website_options.php b/htdocs/admin/website_options.php index 215ac230493..680cd961729 100644 --- a/htdocs/admin/website_options.php +++ b/htdocs/admin/website_options.php @@ -40,10 +40,10 @@ $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/asset/accountancy_codes.php b/htdocs/asset/accountancy_codes.php index 4641f61a021..f68e835a1ff 100644 --- a/htdocs/asset/accountancy_codes.php +++ b/htdocs/asset/accountancy_codes.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.ph $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index 181c9c209ef..7520dda55fc 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->loadLangs(array("assets", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -51,10 +51,10 @@ if (GETPOST('actioncode', 'array')) { $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index 95459707381..434ee1f3318 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $langs->loadLangs(array("assets", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -123,10 +123,10 @@ if (empty($reshook)) { // Action dispose object if ($action == 'confirm_disposal' && $confirm == 'yes' && $permissiontoadd) { - $object->disposal_date = dol_mktime(12, 0, 0, GETPOST('disposal_datemonth', 'int'), GETPOST('disposal_dateday', 'int'), GETPOST('disposal_dateyear', 'int')); // for date without hour, we use gmt - $object->disposal_amount_ht = GETPOST('disposal_amount', 'int'); - $object->fk_disposal_type = GETPOST('fk_disposal_type', 'int'); - $disposal_invoice_id = GETPOST('disposal_invoice_id', 'int'); + $object->disposal_date = dol_mktime(12, 0, 0, GETPOSTINT('disposal_datemonth'), GETPOSTINT('disposal_dateday'), GETPOSTINT('disposal_dateyear')); // for date without hour, we use gmt + $object->disposal_amount_ht = GETPOSTINT('disposal_amount'); + $object->fk_disposal_type = GETPOSTINT('fk_disposal_type'); + $disposal_invoice_id = GETPOSTINT('disposal_invoice_id'); $object->disposal_depreciated = ((GETPOST('disposal_depreciated') == '1' || GETPOST('disposal_depreciated') == 'on') ? 1 : 0); $object->disposal_subject_to_vat = ((GETPOST('disposal_subject_to_vat') == '1' || GETPOST('disposal_subject_to_vat') == 'on') ? 1 : 0); @@ -136,7 +136,7 @@ if (empty($reshook)) { } $action = ''; } elseif ($action == "add") { - $object->supplier_invoice_id = GETPOST('supplier_invoice_id', 'int'); + $object->supplier_invoice_id = GETPOSTINT('supplier_invoice_id'); } // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen @@ -189,7 +189,7 @@ if ($action == 'create') { } if (GETPOSTISSET('supplier_invoice_id')) { $object->fields['supplier_invoice_id'] = array('type' => 'integer:FactureFournisseur:fourn/class/fournisseur.facture.class.php:1:entity IN (__SHARED_ENTITIES__)', 'label' => 'SupplierInvoice', 'enabled' => '1', 'noteditable' => '1', 'position' => 280, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'validate' => '1',); - print ''; + print ''; } print dol_get_fiche_head(array(), ''); @@ -266,10 +266,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Disposal $langs->load('bills'); - $disposal_date = dol_mktime(12, 0, 0, GETPOST('disposal_datemonth', 'int'), GETPOST('disposal_dateday', 'int'), GETPOST('disposal_dateyear', 'int')); // for date without hour, we use gmt - $disposal_amount = GETPOST('disposal_amount', 'int'); - $fk_disposal_type = GETPOST('fk_disposal_type', 'int'); - $disposal_invoice_id = GETPOST('disposal_invoice_id', 'int'); + $disposal_date = dol_mktime(12, 0, 0, GETPOSTINT('disposal_datemonth'), GETPOSTINT('disposal_dateday'), GETPOSTINT('disposal_dateyear')); // for date without hour, we use gmt + $disposal_amount = GETPOSTINT('disposal_amount'); + $fk_disposal_type = GETPOSTINT('fk_disposal_type'); + $disposal_invoice_id = GETPOSTINT('disposal_invoice_id'); $disposal_depreciated = GETPOSTISSET('disposal_depreciated') ? GETPOST('disposal_depreciated') : 1; $disposal_depreciated = !empty($disposal_depreciated) ? 1 : 0; $disposal_subject_to_vat = GETPOSTISSET('disposal_subject_to_vat') ? GETPOST('disposal_subject_to_vat') : 1; diff --git a/htdocs/asset/class/assetdepreciationoptions.class.php b/htdocs/asset/class/assetdepreciationoptions.class.php index 15b7f24c216..99497d1b23a 100644 --- a/htdocs/asset/class/assetdepreciationoptions.class.php +++ b/htdocs/asset/class/assetdepreciationoptions.class.php @@ -236,11 +236,11 @@ class AssetDepreciationOptions extends CommonObject if (in_array($field_info['type'], array('text', 'html'))) { $value = GETPOST($html_name, 'restricthtml'); } elseif ($field_info['type'] == 'date') { - $value = dol_mktime(12, 0, 0, GETPOST($html_name . 'month', 'int'), GETPOST($html_name . 'day', 'int'), GETPOST($html_name . 'year', 'int')); // for date without hour, we use gmt + $value = dol_mktime(12, 0, 0, GETPOSTINT($html_name . 'month'), GETPOSTINT($html_name . 'day'), GETPOSTINT($html_name . 'year')); // for date without hour, we use gmt } elseif ($field_info['type'] == 'datetime') { - $value = dol_mktime(GETPOST($html_name . 'hour', 'int'), GETPOST($html_name . 'min', 'int'), GETPOST($html_name . 'sec', 'int'), GETPOST($html_name . 'month', 'int'), GETPOST($html_name . 'day', 'int'), GETPOST($html_name . 'year', 'int'), 'tzuserrel'); + $value = dol_mktime(GETPOSTINT($html_name . 'hour'), GETPOSTINT($html_name . 'min'), GETPOSTINT($html_name . 'sec'), GETPOSTINT($html_name . 'month'), GETPOSTINT($html_name . 'day'), GETPOSTINT($html_name . 'year'), 'tzuserrel'); } elseif ($field_info['type'] == 'duration') { - $value = 60 * 60 * GETPOST($html_name . 'hour', 'int') + 60 * GETPOST($html_name . 'min', 'int'); + $value = 60 * 60 * GETPOSTINT($html_name . 'hour') + 60 * GETPOSTINT($html_name . 'min'); } elseif (preg_match('/^(integer|price|real|double)/', $field_info['type'])) { $value = price2num(GETPOST($html_name, 'alphanohtml')); // To fix decimal separator according to lang setup } elseif ($field_info['type'] == 'boolean') { diff --git a/htdocs/asset/depreciation.php b/htdocs/asset/depreciation.php index 6c8659aad9c..f20ccdbe7e7 100644 --- a/htdocs/asset/depreciation.php +++ b/htdocs/asset/depreciation.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.ph $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/depreciation_options.php b/htdocs/asset/depreciation_options.php index 0b771b216d5..6202e4f2b6f 100644 --- a/htdocs/asset/depreciation_options.php +++ b/htdocs/asset/depreciation_options.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.ph $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/disposal.php b/htdocs/asset/disposal.php index 98f07003db1..6ef7433061d 100644 --- a/htdocs/asset/disposal.php +++ b/htdocs/asset/disposal.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php index 460b30d1a90..69112f6e619 100644 --- a/htdocs/asset/document.php +++ b/htdocs/asset/document.php @@ -37,14 +37,14 @@ $langs->loadLangs(array('assets', 'companies', 'other', 'mails')); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index a2f421410ea..427307532e2 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -36,7 +36,7 @@ $langs->loadLangs(array("assets", "other")); // Get parameters $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -44,13 +44,13 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'as $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', 'alpha'); // mode view (kanban or common) -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action @@ -87,8 +87,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -396,7 +396,7 @@ $arrayofmassactions = array( if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/asset/model/accountancy_codes.php b/htdocs/asset/model/accountancy_codes.php index 292c69defa7..61db2261bb1 100644 --- a/htdocs/asset/model/accountancy_codes.php +++ b/htdocs/asset/model/accountancy_codes.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php'; $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index e0b62ecec79..04739e21408 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; $langs->loadLangs(array("assets", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -51,10 +51,10 @@ if (GETPOST('actioncode', 'array')) { //$search_rowid = GETPOST('search_rowid'); //$search_agenda_label = GETPOST('search_agenda_label'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); $sortorder = GETPOST("sortorder", 'alpha'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/asset/model/card.php b/htdocs/asset/model/card.php index 3ab71c675c4..31544663a62 100644 --- a/htdocs/asset/model/card.php +++ b/htdocs/asset/model/card.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetaccountancycodes.class.php'; $langs->loadLangs(array("assets", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); diff --git a/htdocs/asset/model/depreciation_options.php b/htdocs/asset/model/depreciation_options.php index 0000f2bf723..5beeb1a7a33 100644 --- a/htdocs/asset/model/depreciation_options.php +++ b/htdocs/asset/model/depreciation_options.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetdepreciationoptions.class.ph $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index 00db6f0417c..51033b5c2b1 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -34,7 +34,7 @@ $langs->loadLangs(array("assets", "other")); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -42,13 +42,13 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'as $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action @@ -87,8 +87,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -399,7 +399,7 @@ $arrayofmassactions = array( if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/asset/model/note.php b/htdocs/asset/model/note.php index 0476b6f4a57..e704b6ae390 100644 --- a/htdocs/asset/model/note.php +++ b/htdocs/asset/model/note.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT . '/asset/class/assetmodel.class.php'; $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php index d2a89f96f0f..a87f252acc9 100644 --- a/htdocs/asset/note.php +++ b/htdocs/asset/note.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/asset/class/asset.class.php'; $langs->loadLangs(array("assets", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/asset/tpl/depreciation_options_edit.tpl.php b/htdocs/asset/tpl/depreciation_options_edit.tpl.php index 649a00e0797..8031d3576f1 100644 --- a/htdocs/asset/tpl/depreciation_options_edit.tpl.php +++ b/htdocs/asset/tpl/depreciation_options_edit.tpl.php @@ -124,7 +124,7 @@ if (empty($reshook)) { print img_picto('', $field_info['picto'], '', false, 0, 0, '', 'pictofixedwidth'); } if (in_array($field_info['type'], array('int', 'integer'))) { - $value = GETPOSTISSET($html_name) ? GETPOST($html_name, 'int') : $assetdepreciationoptions->$field_key; + $value = GETPOSTISSET($html_name) ? GETPOSTINT($html_name) : $assetdepreciationoptions->$field_key; } elseif ($field_info['type'] == 'double') { $value = GETPOSTISSET($html_name) ? price2num(GETPOST($html_name, 'alphanohtml')) : $assetdepreciationoptions->$field_key; } elseif (preg_match('/^(text|html)/', $field_info['type'])) { diff --git a/htdocs/barcode/printsheet.php b/htdocs/barcode/printsheet.php index 132c368114c..9f39d925bb6 100644 --- a/htdocs/barcode/printsheet.php +++ b/htdocs/barcode/printsheet.php @@ -45,10 +45,10 @@ $year = dol_print_date($now, '%Y'); $month = dol_print_date($now, '%m'); $day = dol_print_date($now, '%d'); $forbarcode = GETPOST('forbarcode', 'alphanohtml'); -$fk_barcode_type = GETPOST('fk_barcode_type', 'int'); +$fk_barcode_type = GETPOSTINT('fk_barcode_type'); $mode = GETPOST('mode', 'aZ09'); $modellabel = GETPOST("modellabel", 'aZ09'); // Doc template to use -$numberofsticker = GETPOST('numberofsticker', 'int'); +$numberofsticker = GETPOSTINT('numberofsticker'); $mesg = ''; @@ -86,8 +86,8 @@ if ($reshook < 0) { if (empty($reshook)) { if (GETPOST('submitproduct') && GETPOST('submitproduct')) { $action = ''; // We reset because we don't want to build doc - if (GETPOST('productid', 'int') > 0) { - $result = $producttmp->fetch(GETPOST('productid', 'int')); + if (GETPOSTINT('productid') > 0) { + $result = $producttmp->fetch(GETPOSTINT('productid')); if ($result < 0) { setEventMessage($producttmp->error, 'errors'); } @@ -105,8 +105,8 @@ if (empty($reshook)) { } if (GETPOST('submitthirdparty') && GETPOST('submitthirdparty')) { $action = ''; // We reset because we don't want to build doc - if (GETPOST('socid', 'int') > 0) { - $thirdpartytmp->fetch(GETPOST('socid', 'int')); + if (GETPOSTINT('socid') > 0) { + $thirdpartytmp->fetch(GETPOSTINT('socid')); $forbarcode = $thirdpartytmp->barcode; $fk_barcode_type = $thirdpartytmp->barcode_type_code; @@ -334,7 +334,7 @@ print '
'; print '
'; print $langs->trans("NumberOfStickers").'   '; print '
'; -print ''; +print ''; print '
'; print ''; @@ -410,7 +410,7 @@ if ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')) { print ''; print '
'; print '
'; - $form->select_produits(GETPOST('productid', 'int'), 'productid', '', '', 0, -1, 2, '', 0, array(), 0, '1', 0, 'minwidth400imp', 1); + $form->select_produits(GETPOSTINT('productid'), 'productid', '', '', 0, -1, 2, '', 0, array(), 0, '1', 0, 'minwidth400imp', 1); print '   '; print '
'; } @@ -419,7 +419,7 @@ if ($user->hasRight('societe', 'lire')) { print ''; print '
'; print '
'; - print $form->select_company(GETPOST('socid', 'int'), 'socid', '', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300'); + print $form->select_company(GETPOSTINT('socid'), 'socid', '', 'SelectThirdParty', 0, 0, array(), 0, 'minwidth300'); print '   '; print '
'; } diff --git a/htdocs/blockedlog/admin/blockedlog.php b/htdocs/blockedlog/admin/blockedlog.php index bb8cd151bbd..8978814dcb5 100644 --- a/htdocs/blockedlog/admin/blockedlog.php +++ b/htdocs/blockedlog/admin/blockedlog.php @@ -40,7 +40,7 @@ if (!$user->admin || empty($conf->blockedlog->enabled)) { // Get Parameters $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); -$withtab = GETPOST('withtab', 'int'); +$withtab = GETPOSTINT('withtab'); /* diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 8a39531b7e0..6b4fbec24e3 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -46,17 +46,17 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'bl $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$search_showonlyerrors = GETPOST('search_showonlyerrors', 'int'); +$search_showonlyerrors = GETPOSTINT('search_showonlyerrors'); if ($search_showonlyerrors < 0) { $search_showonlyerrors = 0; } -$search_startyear = GETPOST('search_startyear', 'int'); -$search_startmonth = GETPOST('search_startmonth', 'int'); -$search_startday = GETPOST('search_startday', 'int'); -$search_endyear = GETPOST('search_endyear', 'int'); -$search_endmonth = GETPOST('search_endmonth', 'int'); -$search_endday = GETPOST('search_endday', 'int'); +$search_startyear = GETPOSTINT('search_startyear'); +$search_startmonth = GETPOSTINT('search_startmonth'); +$search_startday = GETPOSTINT('search_startday'); +$search_endyear = GETPOSTINT('search_endyear'); +$search_endmonth = GETPOSTINT('search_endmonth'); +$search_endday = GETPOSTINT('search_endday'); $search_id = GETPOST('search_id', 'alpha'); $search_fk_user = GETPOST('search_fk_user', 'intcomma'); $search_start = -1; @@ -80,10 +80,10 @@ if (($search_start == -1 || empty($search_start)) && !GETPOSTISSET('search_start } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -159,9 +159,9 @@ if ($action === 'downloadblockchain') { $sql = "SELECT rowid,date_creation,tms,user_fullname,action,amounts,element,fk_object,date_object,ref_object,signature,fk_user,object_data"; $sql .= " FROM ".MAIN_DB_PREFIX."blockedlog"; $sql .= " WHERE entity = ".$conf->entity; - if (GETPOST('monthtoexport', 'int') > 0 || GETPOST('yeartoexport', 'int') > 0) { - $dates = dol_get_first_day(GETPOST('yeartoexport', 'int'), GETPOST('monthtoexport', 'int') ? GETPOST('monthtoexport', 'int') : 1); - $datee = dol_get_last_day(GETPOST('yeartoexport', 'int'), GETPOST('monthtoexport', 'int') ? GETPOST('monthtoexport', 'int') : 12); + if (GETPOSTINT('monthtoexport') > 0 || GETPOSTINT('yeartoexport') > 0) { + $dates = dol_get_first_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 1); + $datee = dol_get_last_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 12); $sql .= " AND date_creation BETWEEN '".$db->idate($dates)."' AND '".$db->idate($datee)."'"; } $sql .= " ORDER BY rowid ASC"; // Required so we get the first one @@ -189,9 +189,9 @@ if ($action === 'downloadblockchain') { $sql = "SELECT rowid, date_creation, tms, user_fullname, action, amounts, element, fk_object, date_object, ref_object, signature, fk_user, object_data, object_version"; $sql .= " FROM ".MAIN_DB_PREFIX."blockedlog"; $sql .= " WHERE entity = ".((int) $conf->entity); - if (GETPOST('monthtoexport', 'int') > 0 || GETPOST('yeartoexport', 'int') > 0) { - $dates = dol_get_first_day(GETPOST('yeartoexport', 'int'), GETPOST('monthtoexport', 'int') ? GETPOST('monthtoexport', 'int') : 1); - $datee = dol_get_last_day(GETPOST('yeartoexport', 'int'), GETPOST('monthtoexport', 'int') ? GETPOST('monthtoexport', 'int') : 12); + if (GETPOSTINT('monthtoexport') > 0 || GETPOSTINT('yeartoexport') > 0) { + $dates = dol_get_first_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 1); + $datee = dol_get_last_day(GETPOSTINT('yeartoexport'), GETPOSTINT('monthtoexport') ? GETPOSTINT('monthtoexport') : 12); $sql .= " AND date_creation BETWEEN '".$db->idate($dates)."' AND '".$db->idate($datee)."'"; } $sql .= " ORDER BY rowid ASC"; // Required so later we can use the parameter $previoushash of checkSignature() @@ -200,7 +200,7 @@ if ($action === 'downloadblockchain') { if ($res) { header('Content-Type: application/octet-stream'); header("Content-Transfer-Encoding: Binary"); - header("Content-disposition: attachment; filename=\"unalterable-log-archive-".$dolibarr_main_db_name."-".(GETPOST('yeartoexport', 'int') > 0 ? GETPOST('yeartoexport', 'int').(GETPOST('monthtoexport', 'int') > 0 ? sprintf("%02d", GETPOST('monthtoexport', 'int')) : '').'-' : '').$previoushash.".csv\""); + header("Content-disposition: attachment; filename=\"unalterable-log-archive-".$dolibarr_main_db_name."-".(GETPOSTINT('yeartoexport') > 0 ? GETPOSTINT('yeartoexport').(GETPOSTINT('monthtoexport') > 0 ? sprintf("%02d", GETPOSTINT('monthtoexport')) : '').'-' : '').$previoushash.".csv\""); print $langs->transnoentities('Id') .';'.$langs->transnoentities('Date') @@ -379,7 +379,7 @@ print ''; print '
'; print $langs->trans("RestrictYearToExport").': '; -$smonth = GETPOST('monthtoexport', 'int'); +$smonth = GETPOSTINT('monthtoexport'); // Month $retstring = ''; $retstring .= '"; print $retstring; -print ''; +print ''; print ''; print ''; if (getDolGlobalString('BLOCKEDLOG_USE_REMOTE_AUTHORITY')) { diff --git a/htdocs/blockedlog/ajax/block-add.php b/htdocs/blockedlog/ajax/block-add.php index e2009a01da1..cebd9151b5b 100644 --- a/htdocs/blockedlog/ajax/block-add.php +++ b/htdocs/blockedlog/ajax/block-add.php @@ -38,7 +38,7 @@ if (!defined('NOREQUIREHTML')) { $res = require '../../main.inc.php'; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $element = GETPOST('element', 'alpha'); $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/blockedlog/ajax/block-info.php b/htdocs/blockedlog/ajax/block-info.php index 8660ebbbc82..66d146cc533 100644 --- a/htdocs/blockedlog/ajax/block-info.php +++ b/htdocs/blockedlog/ajax/block-info.php @@ -41,7 +41,7 @@ if (!defined('NOREQUIREHTML')) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php'; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $block = new BlockedLog($db); if ((!$user->admin && !$user->hasRight('blockedlog', 'read')) || empty($conf->blockedlog->enabled)) { diff --git a/htdocs/bom/ajax/ajax.php b/htdocs/bom/ajax/ajax.php index eddb8a40dc5..943230cbed7 100644 --- a/htdocs/bom/ajax/ajax.php +++ b/htdocs/bom/ajax/ajax.php @@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/cunits.class.php'; $action = GETPOST('action', 'aZ09'); -$idproduct = GETPOST('idproduct', 'int'); +$idproduct = GETPOSTINT('idproduct'); /* diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index d4fb24d6daa..82d832319c1 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -35,8 +35,8 @@ require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; $langs->loadLangs(array('mrp', 'other')); // Get parameters -$id = GETPOST('id', 'int'); -$socid = GETPOST('socid', 'int'); +$id = GETPOSTINT('id'); +$socid = GETPOSTINT('socid'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); @@ -56,10 +56,10 @@ $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); // Load variables for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 9abba40be0c..c4db4c61421 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -36,8 +36,8 @@ require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp.lib.php'; $langs->loadLangs(array('mrp', 'other')); // Get parameters -$id = GETPOST('id', 'int'); -$lineid = GETPOST('lineid', 'int'); +$id = GETPOSTINT('id'); +$lineid = GETPOSTINT('lineid'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -47,9 +47,9 @@ $backtopage = GETPOST('backtopage', 'alpha'); // PDF -$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); -$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); -$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); +$hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); +$hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); +$hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); // Initialize technical objects $object = new BOM($db); @@ -155,7 +155,7 @@ if (empty($reshook)) { $predef = ''; // Set if we used free entry or predefined product - $bom_child_id = (int) GETPOST('bom_id', 'int'); + $bom_child_id = GETPOSTINT('bom_id'); if ($bom_child_id > 0) { $bom_child = new BOM($db); $res = $bom_child->fetch($bom_child_id); @@ -163,12 +163,12 @@ if (empty($reshook)) { $idprod = $bom_child->fk_product; } } else { - $idprod = (!empty(GETPOST('idprodservice', 'int')) ? GETPOST('idprodservice', 'int') : (int) GETPOST('idprod', 'int')); + $idprod = (!empty(GETPOSTINT('idprodservice')) ? GETPOSTINT('idprodservice') : GETPOSTINT('idprod')); } $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); - $disable_stock_change = GETPOST('disable_stock_change', 'int'); + $disable_stock_change = GETPOSTINT('disable_stock_change'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); $fk_unit = GETPOST('fk_unit', 'alphanohtml'); @@ -247,7 +247,7 @@ if (empty($reshook)) { // Set if we used free entry or predefined product $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); - $disable_stock_change = GETPOST('disable_stock_change', 'int'); + $disable_stock_change = GETPOSTINT('disable_stock_change'); $efficiency = price2num(GETPOST('efficiency', 'alpha')); $fk_unit = GETPOST('fk_unit', 'alphanohtml'); @@ -608,7 +608,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); + $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1, '/bom/tpl'); } // Form to add new line @@ -660,7 +660,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/bom/tpl'); + $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1, '/bom/tpl'); } // Form to add new line diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php index df5a9044bf5..67ef5c7e1c7 100644 --- a/htdocs/bom/bom_document.php +++ b/htdocs/bom/bom_document.php @@ -37,7 +37,7 @@ $langs->loadLangs(array("mrp", "companies", "other", "mails")); // Get parameters $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$id = (GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id')); $ref = GETPOST('ref', 'alpha'); // Security check - Protection if external user @@ -46,10 +46,10 @@ $ref = GETPOST('ref', 'alpha'); // $result = restrictedArea($user, 'bom', $id); // Load variables for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index a4d3be63e5f..cd6aaf1eaee 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -33,10 +33,10 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $langs->loadLangs(array('mrp', 'other')); // Get Parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -47,7 +47,7 @@ $mode = GETPOST('mode', 'aZ'); // mode view (kanban or common) // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page'); @@ -89,8 +89,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -322,7 +322,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"; } @@ -457,9 +457,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } @@ -480,7 +480,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/bom/bom_net_needs.php b/htdocs/bom/bom_net_needs.php index 52b472428b6..00383849710 100644 --- a/htdocs/bom/bom_net_needs.php +++ b/htdocs/bom/bom_net_needs.php @@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; $langs->loadLangs(array("mrp", "other", "stocks")); // Get parameters -$id = GETPOST('id', 'int'); -$lineid = GETPOST('lineid', 'int'); +$id = GETPOSTINT('id'); +$lineid = GETPOSTINT('lineid'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); diff --git a/htdocs/bom/bom_note.php b/htdocs/bom/bom_note.php index aba22ade7ca..5237fc30066 100644 --- a/htdocs/bom/bom_note.php +++ b/htdocs/bom/bom_note.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php'; $langs->loadLangs(array("mrp", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 3791531ed5a..cf927bc763c 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -120,9 +120,9 @@ if (isModEnabled("product") || isModEnabled("service")) { $statustoshow = -1; if (getDolGlobalString('ENTREPOT_EXTRA_STATUS')) { // hide products in closed warehouse, but show products for internal transfer - print $form->select_produits(GETPOST('idprod', 'int'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOST('combinations', 'array'), 1); + print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOSTINT('combinations'), 1); } else { - print $form->select_produits(GETPOST('idprod', 'int'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOST('combinations', 'array'), 1); + print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOSTINT('combinations'), 1); } $urltocreateproduct = DOL_URL_ROOT.'/product/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); print ''; diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index 6f4ad4e5a85..5535f3dbf5a 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -138,11 +138,11 @@ if ($filtertype != 1) { } $coldisplay++; - print '
qty_frozen ? ' checked="checked"' : '')) . '>'; + print 'qty_frozen ? ' checked="checked"' : '')) . '>'; print 'disable_stock_change ? ' checked="checked"' : '')) . '">'; + print 'disable_stock_change ? ' checked="checked"' : '')) . '">'; print ' '.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'
'.$langs->trans("Visibility").''; print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx'); + print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOSTINT('userid') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx'); print '
'.$langs->trans("Position").''; - print 'position).'">'; + print 'position).'">'; print '
'; @@ -284,7 +284,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { print ''.$langs->trans("Visibility").''; if ($action == 'edit' && $user->admin) { print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx'); + print $form->select_dolusers(GETPOSTISSET('userid') ? GETPOSTINT('userid') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx'); } else { if ($object->fk_user > 0) { $fuser = new User($db); @@ -299,7 +299,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { // Position print ''.$langs->trans("Position").''; if ($action == 'edit') { - print 'position).'">'; + print 'position).'">'; } else { print $object->position; } diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index b22c1d294b4..50212e04137 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -31,7 +31,7 @@ $langs->loadLangs(array('bookmarks', 'admin')); // Get Parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); @@ -40,14 +40,14 @@ $backtopage = GETPOST('backtopage', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); $mode = GETPOST('mode', 'aZ'); -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); $search_title = GETPOST('search_title', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -247,7 +247,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/categories/card.php b/htdocs/categories/card.php index 9d66e35f9f1..06510e44aa7 100644 --- a/htdocs/categories/card.php +++ b/htdocs/categories/card.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $langs->load("categories"); // Security check -$socid = (int) GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if (!$user->hasRight('categorie', 'lire')) { accessforbidden(); } @@ -45,7 +45,7 @@ if (!$user->hasRight('categorie', 'lire')) { $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $origin = GETPOST('origin', 'alpha'); -$catorigin = (int) GETPOST('catorigin', 'int'); +$catorigin = GETPOSTINT('catorigin'); $type = GETPOST('type', 'aZ09'); $urlfrom = GETPOST('urlfrom', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -53,9 +53,9 @@ $backtopage = GETPOST('backtopage', 'alpha'); $label = (string) GETPOST('label', 'alphanohtml'); $description = (string) GETPOST('description', 'restricthtml'); $color = preg_replace('/[^0-9a-f#]/i', '', (string) GETPOST('color', 'alphanohtml')); -$position = (int) GETPOST('position', 'int'); -$visible = (int) GETPOST('visible', 'int'); -$parent = (int) GETPOST('parent', 'int'); +$position = GETPOSTINT('position'); +$visible = GETPOSTINT('visible'); +$parent = GETPOSTINT('parent'); if ($origin) { if ($type == Categorie::TYPE_PRODUCT) { diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 16965accb55..a3fe18a25c1 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -34,20 +34,20 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->load("categories"); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alphanohtml'); $action = (GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'edit'); $confirm = GETPOST('confirm'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$socid = (int) GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $label = (string) GETPOST('label', 'alphanohtml'); $description = (string) GETPOST('description', 'restricthtml'); $color = preg_replace('/[^0-9a-f#]/i', '', (string) GETPOST('color', 'alphanohtml')); -$position = (int) GETPOST('position', 'int'); -$visible = (int) GETPOST('visible', 'int'); -$parent = (int) GETPOST('parent', 'int'); +$position = GETPOSTINT('position'); +$visible = GETPOSTINT('visible'); +$parent = GETPOSTINT('parent'); if ($id == "") { dol_print_error(null, 'Missing parameter id'); diff --git a/htdocs/categories/index.php b/htdocs/categories/index.php index eb322bbeb3f..d3eeb6b8e16 100644 --- a/htdocs/categories/index.php +++ b/htdocs/categories/index.php @@ -36,10 +36,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // Load translation files required by the page $langs->load("categories"); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $type = (GETPOST('type', 'aZ09') ? GETPOST('type', 'aZ09') : Categorie::TYPE_PRODUCT); $catname = GETPOST('catname', 'alpha'); -$nosearch = GETPOST('nosearch', 'int'); +$nosearch = GETPOSTINT('nosearch'); $categstatic = new Categorie($db); if (is_numeric($type)) { diff --git a/htdocs/categories/info.php b/htdocs/categories/info.php index aceabfdaffb..59dedc1312e 100644 --- a/htdocs/categories/info.php +++ b/htdocs/categories/info.php @@ -37,7 +37,7 @@ if (!$user->hasRight('categorie', 'lire')) { $langs->loadLangs(array('categories', 'sendings')); $socid = 0; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $label = GETPOST('label', 'alpha'); // Security check diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 4757aab5fdd..bd40d078fa1 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/categories.lib.php'; $langs->loadlangs(array('categories', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $label = GETPOST('label', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); diff --git a/htdocs/categories/traduction.php b/htdocs/categories/traduction.php index 9293c62219b..1665c80150d 100644 --- a/htdocs/categories/traduction.php +++ b/htdocs/categories/traduction.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->loadLangs(array('categories', 'languages')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $label = GETPOST('label', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php index a7a13ff64d1..ddfe5fc9946 100644 --- a/htdocs/categories/viewcat.php +++ b/htdocs/categories/viewcat.php @@ -37,14 +37,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->loadLangs(array("categories", "compta")); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $label = GETPOST('label', 'alpha'); -$removeelem = GETPOST('removeelem', 'int'); -$elemid = GETPOST('elemid', 'int'); +$removeelem = GETPOSTINT('removeelem'); +$elemid = GETPOSTINT('elemid'); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -54,10 +54,10 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/collab/index.php b/htdocs/collab/index.php index 746cc019a8b..bee5d778dc7 100644 --- a/htdocs/collab/index.php +++ b/htdocs/collab/index.php @@ -41,7 +41,7 @@ $conf->dol_hide_leftmenu = 1; // Force hide of left menu. $error = 0; $website = GETPOST('website', 'alpha'); $page = GETPOST('page', 'alpha'); -$pageid = GETPOST('pageid', 'int'); +$pageid = GETPOSTINT('pageid'); $action = GETPOST('action', 'aZ09'); if (GETPOST('delete')) { diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index cc5c5c1c8dd..bcad30ffa91 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -58,15 +58,15 @@ $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); $socpeopleassigned = GETPOST('socpeopleassigned', 'array'); $origin = GETPOST('origin', 'alpha'); -$originid = GETPOST('originid', 'int'); +$originid = GETPOSTINT('originid'); $confirm = GETPOST('confirm', 'alpha'); $fulldayevent = GETPOST('fullday', 'alpha'); -$aphour = GETPOST('aphour', 'int'); -$apmin = GETPOST('apmin', 'int'); -$p2hour = GETPOST('p2hour', 'int'); -$p2min = GETPOST('p2min', 'int'); +$aphour = GETPOSTINT('aphour'); +$apmin = GETPOSTINT('apmin'); +$p2hour = GETPOSTINT('p2hour'); +$p2min = GETPOSTINT('p2min'); $addreminder = GETPOST('addreminder', 'alpha'); $offsetvalue = GETPOSTINT('offsetvalue'); @@ -82,12 +82,12 @@ if ($complete == 'na' || $complete == -2) { if ($fulldayevent) { $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); // For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere) - $datep = dol_mktime('00', '00', 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); - $datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datep = dol_mktime('00', '00', 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datef = dol_mktime('23', '59', '59', GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), $tzforfullday ? $tzforfullday : 'tzuserrel'); //print $db->idate($datep); exit; } else { - $datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel'); - $datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel'); + $datep = dol_mktime($aphour, $apmin, 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel'); + $datef = dol_mktime($p2hour, $p2min, '59', GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel'); } $reg = array(); if (GETPOST('datep')) { @@ -99,8 +99,8 @@ if (GETPOST('datep')) { } // Security check -$socid = GETPOST('socid', 'int'); -$id = GETPOST('id', 'int'); +$socid = GETPOSTINT('socid'); +$id = GETPOSTINT('id'); if ($user->socid && ($socid != $user->socid)) { accessforbidden(); } @@ -269,7 +269,7 @@ if (empty($reshook) && (GETPOST('addassignedtoresource') || GETPOST('updateassig if (empty($reshook) && $action == 'classin' && ($user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->hasRight('agenda', 'myactions', 'create')))) { //$object->fetch($id); - $object->setProject(GETPOST('projectid', 'int')); + $object->setProject(GETPOSTINT('projectid')); } // Action clone object @@ -283,7 +283,7 @@ if (empty($reshook) && $action == 'confirm_clone' && $confirm == 'yes') { reset($object->socpeopleassigned); $object->contact_id = key($object->socpeopleassigned); } - $result = $object->createFromClone($user, GETPOST('socid', 'int')); + $result = $object->createFromClone($user, GETPOSTINT('socid')); if ($result > 0) { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); exit(); @@ -316,17 +316,17 @@ if (empty($reshook) && $action == 'add') { exit; } - $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status + $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOSTINT("percentage")); // If status is -1 or 100, percentage is not defined and we must use status // Clean parameters if ($fulldayevent) { $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); // For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere) - $datep = dol_mktime('00', '00', '00', GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); - $datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datep = dol_mktime('00', '00', '00', GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datef = dol_mktime('23', '59', '59', GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), $tzforfullday ? $tzforfullday : 'tzuserrel'); } else { - $datep = dol_mktime(GETPOST("aphour", 'int'), GETPOST("apmin", 'int'), GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel'); - $datef = dol_mktime(GETPOST("p2hour", 'int'), GETPOST("p2min", 'int'), GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel'); + $datep = dol_mktime(GETPOSTINT("aphour"), GETPOSTINT("apmin"), GETPOSTINT("apsec"), GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel'); + $datef = dol_mktime(GETPOSTINT("p2hour"), GETPOSTINT("p2min"), GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel'); } // Check parameters @@ -356,7 +356,7 @@ if (empty($reshook) && $action == 'add') { if (!$error) { // Initialisation object actioncomm - $object->priority = GETPOSTISSET("priority") ? GETPOST("priority", "int") : 0; + $object->priority = GETPOSTISSET("priority") ? GETPOSTINT("priority") : 0; $object->fulldayevent = ($fulldayevent ? 1 : 0); $object->location = GETPOST("location", 'alphanohtml'); $object->label = GETPOST('label', 'alphanohtml'); @@ -386,7 +386,7 @@ if (empty($reshook) && $action == 'add') { } } } - $object->fk_project = GETPOSTISSET("projectid") ? GETPOST("projectid", 'int') : 0; + $object->fk_project = GETPOSTISSET("projectid") ? GETPOSTINT("projectid") : 0; $taskid = GETPOSTINT('taskid'); if (!empty($taskid)) { @@ -437,7 +437,7 @@ if (empty($reshook) && $action == 'add') { $object->contact = $contact; } - if (GETPOST('socid', 'int') > 0) { + if (GETPOSTINT('socid') > 0) { $object->socid = GETPOSTINT('socid'); $object->fetch_thirdparty(); @@ -511,7 +511,7 @@ if (empty($reshook) && $action == 'add') { if ($userepeatevent && !empty($selectedrecurrulefreq) && $selectedrecurrulefreq != 'no') { $eventisrecurring = 1; $object->recurid = dol_print_date(dol_now('gmt'), 'dayhourlog', 'gmt'); - $object->recurdateend = dol_mktime(0, 0, 0, GETPOST('limitmonth', 'int'), GETPOST('limitday', 'int'), GETPOST('limityear', 'int')); + $object->recurdateend = dol_mktime(0, 0, 0, GETPOSTINT('limitmonth'), GETPOSTINT('limitday'), GETPOSTINT('limityear')); } else { unset($object->recurid); unset($object->recurrule); @@ -609,22 +609,22 @@ if (empty($reshook) && $action == 'add') { if ($eventisrecurring) { // We set first date of recurrence and offsets if ($selectedrecurrulefreq == 'WEEKLY' && !empty($selectedrecurrulebyday)) { - $firstdatearray = dol_get_first_day_week(GETPOST("apday", 'int'), GETPOST("apmonth", 'int'), GETPOST("apyear", 'int')); - $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), $firstdatearray['month'], $firstdatearray['first_day'], $firstdatearray['year'], $tzforfullday ? $tzforfullday : 'tzuserrel'); + $firstdatearray = dol_get_first_day_week(GETPOSTINT("apday"), GETPOSTINT("apmonth"), GETPOSTINT("apyear")); + $datep = dol_mktime($fulldayevent ? '00' : GETPOSTINT("aphour"), $fulldayevent ? '00' : GETPOSTINT("apmin"), $fulldayevent ? '00' : GETPOSTINT("apsec"), $firstdatearray['month'], $firstdatearray['first_day'], $firstdatearray['year'], $tzforfullday ? $tzforfullday : 'tzuserrel'); $datep = dol_time_plus_duree($datep, $selectedrecurrulebyday + 6, 'd');//We begin the week after $dayoffset = 7; $monthoffset = 0; } elseif ($selectedrecurrulefreq == 'MONTHLY' && !empty($selectedrecurrulebymonthday)) { $firstday = $selectedrecurrulebymonthday; - $firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOST("apmonth", 'int') + 1 : GETPOST("apmonth", 'int');//We begin the week after - $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), $firstmonth, $firstday, GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $firstmonth = GETPOST("apday") > $selectedrecurrulebymonthday ? GETPOSTINT("apmonth") + 1 : GETPOSTINT("apmonth");//We begin the week after + $datep = dol_mktime($fulldayevent ? '00' : GETPOSTINT("aphour"), $fulldayevent ? '00' : GETPOSTINT("apmin"), $fulldayevent ? '00' : GETPOSTINT("apsec"), $firstmonth, $firstday, GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel'); $dayoffset = 0; $monthoffset = 1; } else { $error++; } // End date - $repeateventlimitdate = dol_mktime(23, 59, 59, GETPOSTISSET("limitmonth") ? GETPOST("limitmonth", 'int') : 1, GETPOSTISSET("limitday") ? GETPOST("limitday", 'int') : 1, GETPOSTISSET("limityear") && GETPOST("limityear", 'int') < 2100 ? GETPOST("limityear", 'int') : 2100, $tzforfullday ? $tzforfullday : 'tzuserrel'); + $repeateventlimitdate = dol_mktime(23, 59, 59, GETPOSTISSET("limitmonth") ? GETPOSTINT("limitmonth") : 1, GETPOSTISSET("limitday") ? GETPOSTINT("limitday") : 1, GETPOSTISSET("limityear") && GETPOSTINT("limityear") < 2100 ? GETPOSTINT("limityear") : 2100, $tzforfullday ? $tzforfullday : 'tzuserrel'); // Set date of end of event $deltatime = num_between_day($object->datep, $datep); $datef = dol_time_plus_duree($datef, $deltatime, 'd'); @@ -743,11 +743,11 @@ if (empty($reshook) && $action == 'add') { if (empty($reshook) && $action == 'update') { if (empty($cancel)) { $fulldayevent = GETPOST('fullday'); - $aphour = GETPOST('aphour', 'int'); - $apmin = GETPOST('apmin', 'int'); - $p2hour = GETPOST('p2hour', 'int'); - $p2min = GETPOST('p2min', 'int'); - $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status + $aphour = GETPOSTINT('aphour'); + $apmin = GETPOSTINT('apmin'); + $p2hour = GETPOSTINT('p2hour'); + $p2min = GETPOSTINT('p2min'); + $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOSTINT("percentage")); // If status is -1 or 100, percentage is not defined and we must use status // Clean parameters if ($aphour == -1) { @@ -772,11 +772,11 @@ if (empty($reshook) && $action == 'update') { if ($fulldayevent) { $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); // For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere) - $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); - $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datep = dol_mktime($fulldayevent ? '00' : GETPOSTINT("aphour"), $fulldayevent ? '00' : GETPOSTINT("apmin"), $fulldayevent ? '00' : GETPOSTINT("apsec"), GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datef = dol_mktime($fulldayevent ? '23' : GETPOSTINT("p2hour"), $fulldayevent ? '59' : GETPOSTINT("p2min"), $fulldayevent ? '59' : GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), $tzforfullday ? $tzforfullday : 'tzuserrel'); } else { - $datep = dol_mktime($fulldayevent ? '00' : GETPOST("aphour", 'int'), $fulldayevent ? '00' : GETPOST("apmin", 'int'), $fulldayevent ? '00' : GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel'); - $datef = dol_mktime($fulldayevent ? '23' : GETPOST("p2hour", 'int'), $fulldayevent ? '59' : GETPOST("p2min", 'int'), $fulldayevent ? '59' : GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel'); + $datep = dol_mktime($fulldayevent ? '00' : GETPOSTINT("aphour"), $fulldayevent ? '00' : GETPOSTINT("apmin"), $fulldayevent ? '00' : GETPOSTINT("apsec"), GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel'); + $datef = dol_mktime($fulldayevent ? '23' : GETPOSTINT("p2hour"), $fulldayevent ? '59' : GETPOSTINT("p2min"), $fulldayevent ? '59' : GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel'); } if ($object->elementtype == 'ticket') { // code should be TICKET_MSG, TICKET_MSG_PRIVATE, TICKET_MSG_SENTBYMAIL, TICKET_MSG_PRIVATE_SENTBYMAIL @@ -805,21 +805,21 @@ if (empty($reshook) && $action == 'update') { $object->datep = $datep; $object->datef = $datef; $object->percentage = $percentage; - $object->priority = GETPOST("priority", "int"); + $object->priority = GETPOSTINT("priority"); $object->fulldayevent = GETPOST("fullday") ? 1 : 0; $object->location = GETPOST('location', "alphanohtml"); - $object->socid = GETPOST("socid", "int"); + $object->socid = GETPOSTINT("socid"); $socpeopleassigned = GETPOST("socpeopleassigned", 'array'); $object->socpeopleassigned = array(); foreach ($socpeopleassigned as $cid) { $object->socpeopleassigned[$cid] = array('id' => $cid); } - $object->contact_id = GETPOST("contactid", 'int'); + $object->contact_id = GETPOSTINT("contactid"); if (empty($object->contact_id) && !empty($object->socpeopleassigned)) { reset($object->socpeopleassigned); $object->contact_id = key($object->socpeopleassigned); } - $object->fk_project = GETPOST("projectid", 'int'); + $object->fk_project = GETPOSTINT("projectid"); $object->note_private = trim(GETPOST("note", "restricthtml")); if (GETPOST("elementtype", 'alpha')) { @@ -830,7 +830,7 @@ if (empty($reshook) && $action == 'update') { $hasPermissionOnLinkedObject = 1; } if ($hasPermissionOnLinkedObject) { - $object->fk_element = GETPOST("fk_element", 'int'); + $object->fk_element = GETPOSTINT("fk_element"); $object->elementtype = GETPOST("elementtype", 'alpha'); } } @@ -876,7 +876,7 @@ if (empty($reshook) && $action == 'update') { if (getDolGlobalString('AGENDA_ENABLE_DONEBY')) { if (GETPOST("doneby")) { - $object->userdoneid = GETPOST("doneby", "int"); + $object->userdoneid = GETPOSTINT("doneby"); } } @@ -1448,7 +1448,7 @@ if ($action == 'create') { // Done by if (getDolGlobalString('AGENDA_ENABLE_DONEBY')) { print ''.$langs->trans("ActionDoneBy").''; - print $form->select_dolusers(GETPOSTISSET("doneby") ? GETPOST("doneby", 'int') : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1); + print $form->select_dolusers(GETPOSTISSET("doneby") ? GETPOSTINT("doneby") : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1); print ''; } @@ -1498,7 +1498,7 @@ if ($action == 'create') { if (GETPOSTISSET('status')) { $percent = GETPOST('status'); } elseif (GETPOSTISSET('percentage')) { - $percent = GETPOST('percentage', 'int'); + $percent = GETPOSTINT('percentage'); } else { if ($complete == '0' || GETPOST("afaire") == 1) { $percent = '0'; @@ -1520,11 +1520,11 @@ if ($action == 'create') { if (isModEnabled("societe")) { // Related company print ''.$langs->trans("ActionOnCompany").''; - if (GETPOST('socid', 'int') > 0) { + if (GETPOSTINT('socid') > 0) { $societe = new Societe($db); - $societe->fetch(GETPOST('socid', 'int')); + $societe->fetch(GETPOSTINT('socid')); print $societe->getNomUrl(1); - print ''; + print ''; } else { $events = array(); $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); @@ -1540,11 +1540,11 @@ if ($action == 'create') { // Related contact print ''.$langs->trans("ActionOnContact").''; $preselectedids = GETPOST('socpeopleassigned', 'array'); - if (GETPOST('contactid', 'int')) { - $preselectedids[GETPOST('contactid', 'int')] = GETPOST('contactid', 'int'); + if (GETPOSTINT('contactid')) { + $preselectedids[GETPOSTINT('contactid')] = GETPOSTINT('contactid'); } if ($origin=='contact') { - $preselectedids[GETPOST('originid', 'int')] = GETPOST('originid', 'int'); + $preselectedids[GETPOSTINT('originid')] = GETPOSTINT('originid'); } // select "all" or "none" contact by default if (getDolGlobalInt('MAIN_ACTIONCOM_CAN_ADD_ANY_CONTACT')) { @@ -1561,7 +1561,7 @@ if ($action == 'create') { if (isModEnabled('project')) { $langs->load("projects"); - $projectid = GETPOST('projectid', 'int'); + $projectid = GETPOSTINT('projectid'); print ''.$langs->trans("Project").''; print img_picto('', 'project', 'class="pictofixedwidth"'); @@ -1596,7 +1596,7 @@ if ($action == 'create') { $projectsListId = $projectid; } - $tid = GETPOSTISSET("projecttaskid") ? GETPOST("projecttaskid", 'int') : (GETPOSTISSET("taskid") ? GETPOST("taskid", 'int') : ''); + $tid = GETPOSTISSET("projecttaskid") ? GETPOSTINT("projecttaskid") : (GETPOSTISSET("taskid") ? GETPOSTINT("taskid") : ''); $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500 widthcentpercentminusxx', $projectsListId); print ''; @@ -1632,7 +1632,7 @@ if ($action == 'create') { // Priority if (getDolGlobalString('AGENDA_SUPPORT_PRIORITY_IN_EVENTS')) { print ''.$langs->trans("Priority").''; - print ''; + print ''; print ''; } @@ -1744,10 +1744,10 @@ if ($id > 0) { $result5 = $object->fetch_optionals(); if ($listUserAssignedUpdated || $donotclearsession) { - $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOST("percentage", 'int')); // If status is -1 or 100, percentage is not defined and we must use status + $percentage = in_array(GETPOST('status'), array(-1, 100)) ? GETPOST('status') : (in_array($complete, array(-1, 100)) ? $complete : GETPOSTINT("percentage")); // If status is -1 or 100, percentage is not defined and we must use status - $datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel'); - $datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel'); + $datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel'); + $datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel'); $object->type_id = dol_getIdFromCode($db, GETPOST("actioncode", 'aZ09'), 'c_actioncomm'); $object->label = GETPOST("label", "alphanohtml"); @@ -1757,13 +1757,13 @@ if ($id > 0) { $object->priority = GETPOST("priority", "alphanohtml"); $object->fulldayevent = GETPOST("fullday") ? 1 : 0; $object->location = GETPOST('location', "alphanohtml"); - $object->socid = GETPOST("socid", "int"); + $object->socid = GETPOSTINT("socid"); $socpeopleassigned = GETPOST("socpeopleassigned", 'array'); foreach ($socpeopleassigned as $tmpid) { $object->socpeopleassigned[$id] = array('id' => $tmpid); } - $object->contact_id = GETPOST("contactid", 'int'); - $object->fk_project = GETPOST("projectid", 'int'); + $object->contact_id = GETPOSTINT("contactid"); + $object->fk_project = GETPOSTINT("projectid"); $object->note_private = GETPOST("note", 'restricthtml'); } @@ -2022,7 +2022,7 @@ if ($id > 0) { // Status print ''.$langs->trans("Status").' / '.$langs->trans("Percentage").''; - $percent = GETPOSTISSET("percentage") ? GETPOST("percentage", "int") : $object->percentage; + $percent = GETPOSTISSET("percentage") ? GETPOSTINT("percentage") : $object->percentage; $formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200'); print ''; diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index a27f7bfef20..44107ddaaf1 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -42,12 +42,12 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('companies', 'commercial', 'other', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } @@ -67,10 +67,10 @@ if ($id > 0) { $hookmanager->initHooks(array('actioncard', 'globalcard')); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 62b5600af50..338887acab2 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -51,13 +51,13 @@ if (!getDolGlobalString('AGENDA_EXT_NB')) { $MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB'); $DELAYFORCACHE = 300; // 300 seconds -$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int'); +$disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); -$check_holiday = GETPOST('check_holiday', 'int'); +$check_holiday = GETPOSTINT('check_holiday'); $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); $usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3); -$showbirthday = empty($conf->use_javascript_ajax) ? GETPOST("showbirthday", "int") : 1; +$showbirthday = empty($conf->use_javascript_ajax) ? GETPOSTINT("showbirthday") : 1; $search_categ_cus = GETPOST("search_categ_cus", "int", 3) ? GETPOST("search_categ_cus", "int", 3) : 0; // If not choice done on calendar owner (like on left menu link "Agenda"), we filter on user. @@ -69,11 +69,11 @@ $newparam = ''; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; if (!$sortorder) { $sortorder = "ASC"; @@ -83,7 +83,7 @@ if (!$sortfield) { } // Security check -$socid = GETPOST("search_socid", "int") ? GETPOST("search_socid", "int") : GETPOST("socid", "int"); +$socid = GETPOSTINT("search_socid") ? GETPOSTINT("search_socid") : GETPOSTINT("socid"); if ($user->socid) { $socid = $user->socid; } @@ -108,22 +108,22 @@ $mode = GETPOST('mode', 'aZ09'); if (empty($mode) && preg_match('/show_/', $action)) { $mode = $action; // For backward compatibility } -$resourceid = GETPOST("search_resourceid", "int"); -$year = GETPOST("year", "int") ? GETPOST("year", "int") : date("Y"); -$month = GETPOST("month", "int") ? GETPOST("month", "int") : date("m"); -$week = GETPOST("week", "int") ? GETPOST("week", "int") : date("W"); -$day = GETPOST("day", "int") ? GETPOST("day", "int") : date("d"); +$resourceid = GETPOSTINT("search_resourceid"); +$year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y"); +$month = GETPOSTINT("month") ? GETPOSTINT("month") : date("m"); +$week = GETPOSTINT("week") ? GETPOSTINT("week") : date("W"); +$day = GETPOSTINT("day") ? GETPOSTINT("day") : date("d"); $pid = GETPOST("search_projectid", "int", 3) ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); $status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo', 'na' or -1 $type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09'); -$maxprint = GETPOSTISSET("maxprint") ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW; +$maxprint = GETPOSTISSET("maxprint") ? GETPOSTINT("maxprint") : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW; $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') -$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); +$dateselect = dol_mktime(0, 0, 0, GETPOSTINT('dateselectmonth'), GETPOSTINT('dateselectday'), GETPOSTINT('dateselectyear')); if ($dateselect > 0) { - $day = GETPOST('dateselectday', 'int'); - $month = GETPOST('dateselectmonth', 'int'); - $year = GETPOST('dateselectyear', 'int'); + $day = GETPOSTINT('dateselectday'); + $month = GETPOSTINT('dateselectmonth'); + $year = GETPOSTINT('dateselectyear'); } // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) @@ -148,16 +148,16 @@ if (empty($mode) && !GETPOSTISSET('mode')) { if ($mode == 'default') { // When action is default, we want a calendar view and not the list $mode = (($defaultview != 'show_list') ? $defaultview : 'show_month'); } -if (GETPOST('viewcal', 'int') && GETPOST('mode', 'alpha') != 'show_day' && GETPOST('mode', 'alpha') != 'show_week') { +if (GETPOSTINT('viewcal') && GETPOSTINT('mode') != 'show_day' && GETPOSTINT('mode') != 'show_week') { $mode = 'show_month'; $day = ''; } // View by month -if (GETPOST('viewweek', 'int') || GETPOST('mode', 'alpha') == 'show_week') { +if (GETPOSTINT('viewweek') || GETPOSTINT('mode') == 'show_week') { $mode = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d")); } // View by week -if (GETPOST('viewday', 'int') || GETPOST('mode', 'alpha') == 'show_day') { +if (GETPOSTINT('viewday') || GETPOSTINT('mode') == 'show_day') { $mode = 'show_day'; $day = ($day ? $day : date("d")); } // View by day @@ -647,7 +647,7 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on foreach ($showextcals as $val) { $htmlname = md5($val['name']); // not used for security purpose, only to get a string with no special char - if (!empty($val['default']) || GETPOST('check_ext'.$htmlname, 'int')) { + if (!empty($val['default']) || GETPOSTINT('check_ext'.$htmlname)) { $default = "checked"; } else { $default = ''; diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index 591fb5082d3..0b16f28193e 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -37,7 +37,7 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->load("commercial"); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('actioncard', 'globalcard')); diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 55cb92d71f3..30a690b38cc 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -50,19 +50,19 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'ac $optioncss = GETPOST('optioncss', 'alpha'); -$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int'); +$disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); $mode = GETPOST('mode', 'aZ09'); if (empty($mode) && preg_match('/show_/', $action)) { $mode = $action; // For backward compatibility } -$resourceid = GETPOST("search_resourceid", "int") ? GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int"); +$resourceid = GETPOSTINT("search_resourceid") ? GETPOSTINT("search_resourceid") : GETPOSTINT("resourceid"); $pid = GETPOST("search_projectid", 'int', 3) ? GETPOST("search_projectid", 'int', 3) : GETPOST("projectid", 'int', 3); $search_status = (GETPOST("search_status", 'aZ09') != '') ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); $type = GETPOST('search_type', 'alphanohtml') ? GETPOST('search_type', 'alphanohtml') : GETPOST('type', 'alphanohtml'); -$year = GETPOST("year", 'int'); -$month = GETPOST("month", 'int'); -$day = GETPOST("day", 'int'); +$year = GETPOSTINT("year"); +$month = GETPOSTINT("month"); +$day = GETPOSTINT("day"); // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) if (GETPOST('search_actioncode', 'array')) { @@ -80,11 +80,11 @@ $search_title = GETPOST('search_title', 'alpha'); $search_note = GETPOST('search_note', 'alpha'); // $dateselect is a day included inside the event range -$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int'), 'tzuserrel'); -$datestart_dtstart = dol_mktime(0, 0, 0, GETPOST('datestart_dtstartmonth', 'int'), GETPOST('datestart_dtstartday', 'int'), GETPOST('datestart_dtstartyear', 'int'), 'tzuserrel'); -$datestart_dtend = dol_mktime(23, 59, 59, GETPOST('datestart_dtendmonth', 'int'), GETPOST('datestart_dtendday', 'int'), GETPOST('datestart_dtendyear', 'int'), 'tzuserrel'); -$dateend_dtstart = dol_mktime(0, 0, 0, GETPOST('dateend_dtstartmonth', 'int'), GETPOST('dateend_dtstartday', 'int'), GETPOST('dateend_dtstartyear', 'int'), 'tzuserrel'); -$dateend_dtend = dol_mktime(23, 59, 59, GETPOST('dateend_dtendmonth', 'int'), GETPOST('dateend_dtendday', 'int'), GETPOST('dateend_dtendyear', 'int'), 'tzuserrel'); +$dateselect = dol_mktime(0, 0, 0, GETPOSTINT('dateselectmonth'), GETPOSTINT('dateselectday'), GETPOSTINT('dateselectyear'), 'tzuserrel'); +$datestart_dtstart = dol_mktime(0, 0, 0, GETPOSTINT('datestart_dtstartmonth'), GETPOSTINT('datestart_dtstartday'), GETPOSTINT('datestart_dtstartyear'), 'tzuserrel'); +$datestart_dtend = dol_mktime(23, 59, 59, GETPOSTINT('datestart_dtendmonth'), GETPOSTINT('datestart_dtendday'), GETPOSTINT('datestart_dtendyear'), 'tzuserrel'); +$dateend_dtstart = dol_mktime(0, 0, 0, GETPOSTINT('dateend_dtstartmonth'), GETPOSTINT('dateend_dtstartday'), GETPOSTINT('dateend_dtstartyear'), 'tzuserrel'); +$dateend_dtend = dol_mktime(23, 59, 59, GETPOSTINT('dateend_dtendmonth'), GETPOSTINT('dateend_dtendday'), GETPOSTINT('dateend_dtendyear'), 'tzuserrel'); if ($search_status == '' && !GETPOSTISSET('search_status')) { $search_status = ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); } @@ -95,7 +95,7 @@ if (empty($mode) && !GETPOSTISSET('mode')) { $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); $usergroup = GETPOST("search_usergroup", "int", 3) ? GETPOST("search_usergroup", "int", 3) : GETPOST("usergroup", "int", 3); -$showbirthday = empty($conf->use_javascript_ajax) ? (GETPOST("search_showbirthday", "int") ? GETPOST("search_showbirthday", "int") : GETPOST("showbirthday", "int")) : 1; +$showbirthday = empty($conf->use_javascript_ajax) ? (GETPOSTINT("search_showbirthday") ? GETPOSTINT("search_showbirthday") : GETPOSTINT("showbirthday")) : 1; $search_categ_cus = GETPOST("search_categ_cus", "int", 3) ? GETPOST("search_categ_cus", "int", 3) : 0; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context @@ -114,10 +114,10 @@ if (empty($filtert) && !getDolGlobalString('AGENDA_ALL_CALENDARS')) { } // Pagination parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -137,7 +137,7 @@ if (!$sortfield) { } // Security check -$socid = GETPOST("search_socid", 'int') ? GETPOST("search_socid", 'int') : GETPOST("socid", 'int'); +$socid = GETPOSTINT("search_socid") ? GETPOSTINT("search_socid") : GETPOSTINT("socid"); if ($user->socid) { $socid = $user->socid; } @@ -350,41 +350,41 @@ if ($search_title != '') { if ($search_note != '') { $param .= '&search_note='.urlencode($search_note); } -if (GETPOST('datestart_dtstartday', 'int')) { - $param .= '&datestart_dtstartday='.GETPOST('datestart_dtstartday', 'int'); +if (GETPOSTINT('datestart_dtstartday')) { + $param .= '&datestart_dtstartday='.GETPOSTINT('datestart_dtstartday'); } -if (GETPOST('datestart_dtstartmonth', 'int')) { - $param .= '&datestart_dtstartmonth='.GETPOST('datestart_dtstartmonth', 'int'); +if (GETPOSTINT('datestart_dtstartmonth')) { + $param .= '&datestart_dtstartmonth='.GETPOSTINT('datestart_dtstartmonth'); } -if (GETPOST('datestart_dtstartyear', 'int')) { - $param .= '&datestart_dtstartyear='.GETPOST('datestart_dtstartyear', 'int'); +if (GETPOSTINT('datestart_dtstartyear')) { + $param .= '&datestart_dtstartyear='.GETPOSTINT('datestart_dtstartyear'); } -if (GETPOST('datestart_dtendday', 'int')) { - $param .= '&datestart_dtendday='.GETPOST('datestart_dtendday', 'int'); +if (GETPOSTINT('datestart_dtendday')) { + $param .= '&datestart_dtendday='.GETPOSTINT('datestart_dtendday'); } -if (GETPOST('datestart_dtendmonth', 'int')) { - $param .= '&datestart_dtendmonth='.GETPOST('datestart_dtendmonth', 'int'); +if (GETPOSTINT('datestart_dtendmonth')) { + $param .= '&datestart_dtendmonth='.GETPOSTINT('datestart_dtendmonth'); } -if (GETPOST('datestart_dtendyear', 'int')) { - $param .= '&datestart_dtendyear='.GETPOST('datestart_dtendyear', 'int'); +if (GETPOSTINT('datestart_dtendyear')) { + $param .= '&datestart_dtendyear='.GETPOSTINT('datestart_dtendyear'); } -if (GETPOST('dateend_dtstartday', 'int')) { - $param .= '&dateend_dtstartday='.GETPOST('dateend_dtstartday', 'int'); +if (GETPOSTINT('dateend_dtstartday')) { + $param .= '&dateend_dtstartday='.GETPOSTINT('dateend_dtstartday'); } -if (GETPOST('dateend_dtstartmonth', 'int')) { - $param .= '&dateend_dtstartmonth='.GETPOST('dateend_dtstartmonth', 'int'); +if (GETPOSTINT('dateend_dtstartmonth')) { + $param .= '&dateend_dtstartmonth='.GETPOSTINT('dateend_dtstartmonth'); } -if (GETPOST('dateend_dtstartyear', 'int')) { - $param .= '&dateend_dtstartyear='.GETPOST('dateend_dtstartyear', 'int'); +if (GETPOSTINT('dateend_dtstartyear')) { + $param .= '&dateend_dtstartyear='.GETPOSTINT('dateend_dtstartyear'); } -if (GETPOST('dateend_dtendday', 'int')) { - $param .= '&dateend_dtendday='.GETPOST('dateend_dtendday', 'int'); +if (GETPOSTINT('dateend_dtendday')) { + $param .= '&dateend_dtendday='.GETPOSTINT('dateend_dtendday'); } -if (GETPOST('dateend_dtendmonth', 'int')) { - $param .= '&dateend_dtendmonth='.GETPOST('dateend_dtendmonth', 'int'); +if (GETPOSTINT('dateend_dtendmonth')) { + $param .= '&dateend_dtendmonth='.GETPOSTINT('dateend_dtendmonth'); } -if (GETPOST('dateend_dtendyear', 'int')) { - $param .= '&dateend_dtendyear='.GETPOST('dateend_dtendyear', 'int'); +if (GETPOSTINT('dateend_dtendyear')) { + $param .= '&dateend_dtendyear='.GETPOSTINT('dateend_dtendyear'); } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); @@ -410,7 +410,7 @@ if ($user->hasRight('agenda', 'allactions', 'delete')) { if (isModEnabled('category') && $user->hasRight('agenda', 'myactions', 'create')) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index f226da960c4..83ac43bc4e2 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -46,7 +46,7 @@ if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) { $action = GETPOST('action', 'aZ09'); -$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int'); +$disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); @@ -64,11 +64,11 @@ if (empty($filtert) && !getDolGlobalString('AGENDA_ALL_CALENDARS')) { // Sorting $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; if (!$sortorder) { $sortorder = "ASC"; @@ -79,7 +79,7 @@ if (!$sortfield) { // Security check -$socid = GETPOST("search_socid", "int") ? GETPOST("search_socid", "int") : GETPOST("socid", "int"); +$socid = GETPOSTINT("search_socid") ? GETPOSTINT("search_socid") : GETPOSTINT("socid"); if ($user->socid) { $socid = $user->socid; } @@ -100,15 +100,15 @@ if (!$user->hasRight('agenda', 'allactions', 'read') || $filter == 'mine') { // } $mode = 'show_pertype'; -$resourceid = GETPOST("search_resourceid", "int") ? GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int"); -$year = GETPOST("year", "int") ? GETPOST("year", "int") : date("Y"); -$month = GETPOST("month", "int") ? GETPOST("month", "int") : date("m"); -$week = GETPOST("week", "int") ? GETPOST("week", "int") : date("W"); -$day = GETPOST("day", "int") ? GETPOST("day", "int") : date("d"); +$resourceid = GETPOSTINT("search_resourceid") ? GETPOSTINT("search_resourceid") : GETPOSTINT("resourceid"); +$year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y"); +$month = GETPOSTINT("month") ? GETPOSTINT("month") : date("m"); +$week = GETPOSTINT("week") ? GETPOSTINT("week") : date("W"); +$day = GETPOSTINT("day") ? GETPOSTINT("day") : date("d"); $pid = GETPOSTISSET("search_projectid") ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); $status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); $type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'alpha') : GETPOST("type", 'alpha'); -$maxprint = ((GETPOST("maxprint", 'int') != '') ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); +$maxprint = ((GETPOSTINT("maxprint") != '') ? GETPOSTINT("maxprint") : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) @@ -121,19 +121,19 @@ if (GETPOST('search_actioncode', 'array:aZ09')) { $actioncode = GETPOST("search_actioncode", "alpha", 3) ? GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE') || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE)); } -$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); +$dateselect = dol_mktime(0, 0, 0, GETPOSTINT('dateselectmonth'), GETPOSTINT('dateselectday'), GETPOSTINT('dateselectyear')); if ($dateselect > 0) { - $day = GETPOST('dateselectday', 'int'); - $month = GETPOST('dateselectmonth', 'int'); - $year = GETPOST('dateselectyear', 'int'); + $day = GETPOSTINT('dateselectday'); + $month = GETPOSTINT('dateselectmonth'); + $year = GETPOSTINT('dateselectyear'); } // working hours $tmp = !getDolGlobalString('MAIN_DEFAULT_WORKING_HOURS') ? '9-18' : $conf->global->MAIN_DEFAULT_WORKING_HOURS; $tmp = str_replace(' ', '', $tmp); // FIX 7533 $tmparray = explode('-', $tmp); -$begin_h = GETPOST('begin_h', 'int') != '' ? GETPOST('begin_h', 'int') : ($tmparray[0] != '' ? $tmparray[0] : 9); -$end_h = GETPOST('end_h', 'int') ? GETPOST('end_h', 'int') : ($tmparray[1] != '' ? $tmparray[1] : 18); +$begin_h = GETPOSTINT('begin_h') != '' ? GETPOSTINT('begin_h') : ($tmparray[0] != '' ? $tmparray[0] : 9); +$end_h = GETPOSTINT('end_h') ? GETPOSTINT('end_h') : ($tmparray[1] != '' ? $tmparray[1] : 18); if ($begin_h < 0 || $begin_h > 23) { $begin_h = 9; } diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index a3ae68e6bd3..2201fe9d360 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -47,7 +47,7 @@ if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) { $action = GETPOST('action', 'aZ09'); -$disabledefaultvalues = GETPOST('disabledefaultvalues', 'int'); +$disabledefaultvalues = GETPOSTINT('disabledefaultvalues'); $filter = GETPOST("search_filter", 'alpha', 3) ? GETPOST("search_filter", 'alpha', 3) : GETPOST("filter", 'alpha', 3); $filtert = GETPOST("search_filtert", "int", 3) ? GETPOST("search_filtert", "int", 3) : GETPOST("filtert", "int", 3); @@ -64,11 +64,11 @@ $showbirthday = 0; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; if (!$sortorder) { $sortorder = "ASC"; @@ -77,7 +77,7 @@ if (!$sortfield) { $sortfield = "a.datec"; } -$socid = GETPOST("search_socid", "int") ? GETPOST("search_socid", "int") : GETPOST("socid", "int"); +$socid = GETPOSTINT("search_socid") ? GETPOSTINT("search_socid") : GETPOSTINT("socid"); if ($user->socid) { $socid = $user->socid; } @@ -97,15 +97,15 @@ if (!$user->hasRight('agenda', 'allactions', 'read') || $filter == 'mine') { // } $mode = 'show_peruser'; -$resourceid = GETPOST("search_resourceid", "int") ? GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int"); -$year = GETPOST("year", "int") ? GETPOST("year", "int") : date("Y"); -$month = GETPOST("month", "int") ? GETPOST("month", "int") : date("m"); -$week = GETPOST("week", "int") ? GETPOST("week", "int") : date("W"); -$day = GETPOST("day", "int") ? GETPOST("day", "int") : date("d"); +$resourceid = GETPOSTINT("search_resourceid") ? GETPOSTINT("search_resourceid") : GETPOSTINT("resourceid"); +$year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y"); +$month = GETPOSTINT("month") ? GETPOSTINT("month") : date("m"); +$week = GETPOSTINT("week") ? GETPOSTINT("week") : date("W"); +$day = GETPOSTINT("day") ? GETPOSTINT("day") : date("d"); $pid = GETPOSTISSET("search_projectid") ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); $status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo', 'na' or -1 $type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'alpha') : GETPOST("type", 'alpha'); -$maxprint = ((GETPOST("maxprint", 'int') != '') ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); +$maxprint = ((GETPOSTINT("maxprint") != '') ? GETPOSTINT("maxprint") : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $search_categ_cus = GETPOST("search_categ_cus", "int", 3) ? GETPOST("search_categ_cus", "int", 3) : 0; // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) @@ -118,18 +118,18 @@ if (GETPOST('search_actioncode', 'array:aZ09')) { $actioncode = GETPOST("search_actioncode", "alpha", 3) ? GETPOST("search_actioncode", "alpha", 3) : (GETPOST("search_actioncode", "alpha") == '0' ? '0' : ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE') || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE)); } -$dateselect = dol_mktime(0, 0, 0, GETPOST('dateselectmonth', 'int'), GETPOST('dateselectday', 'int'), GETPOST('dateselectyear', 'int')); +$dateselect = dol_mktime(0, 0, 0, GETPOSTINT('dateselectmonth'), GETPOSTINT('dateselectday'), GETPOSTINT('dateselectyear')); if ($dateselect > 0) { - $day = GETPOST('dateselectday', 'int'); - $month = GETPOST('dateselectmonth', 'int'); - $year = GETPOST('dateselectyear', 'int'); + $day = GETPOSTINT('dateselectday'); + $month = GETPOSTINT('dateselectmonth'); + $year = GETPOSTINT('dateselectyear'); } $tmp = !getDolGlobalString('MAIN_DEFAULT_WORKING_HOURS') ? '9-18' : $conf->global->MAIN_DEFAULT_WORKING_HOURS; $tmp = str_replace(' ', '', $tmp); // FIX 7533 $tmparray = explode('-', $tmp); -$begin_h = GETPOST('begin_h', 'int') != '' ? GETPOST('begin_h', 'int') : ($tmparray[0] != '' ? $tmparray[0] : 9); -$end_h = GETPOST('end_h', 'int') ? GETPOST('end_h', 'int') : ($tmparray[1] != '' ? $tmparray[1] : 18); +$begin_h = GETPOSTINT('begin_h') != '' ? GETPOSTINT('begin_h') : ($tmparray[0] != '' ? $tmparray[0] : 9); +$end_h = GETPOSTINT('end_h') ? GETPOSTINT('end_h') : ($tmparray[1] != '' ? $tmparray[1] : 18); if ($begin_h < 0 || $begin_h > 23) { $begin_h = 9; } @@ -143,8 +143,8 @@ if ($end_h <= $begin_h) { $tmp = !getDolGlobalString('MAIN_DEFAULT_WORKING_DAYS') ? '1-5' : $conf->global->MAIN_DEFAULT_WORKING_DAYS; $tmp = str_replace(' ', '', $tmp); // FIX 7533 $tmparray = explode('-', $tmp); -$begin_d = GETPOST('begin_d', 'int') ? GETPOST('begin_d', 'int') : ($tmparray[0] != '' ? $tmparray[0] : 1); -$end_d = GETPOST('end_d', 'int') ? GETPOST('end_d', 'int') : ($tmparray[1] != '' ? $tmparray[1] : 5); +$begin_d = GETPOSTINT('begin_d') ? GETPOSTINT('begin_d') : ($tmparray[0] != '' ? $tmparray[0] : 1); +$end_d = GETPOSTINT('end_d') ? GETPOSTINT('end_d') : ($tmparray[1] != '' ? $tmparray[1] : 5); if ($begin_d < 1 || $begin_d > 7) { $begin_d = 1; } diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 5ef15ca226a..712c3ee0ccc 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -35,14 +35,14 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; $langs->loadLangs(array("agenda", "commercial")); $action = GETPOST('action', 'aZ09'); -$month = GETPOST('month', 'int'); -$year = GETPOST('year', 'int'); +$month = GETPOSTINT('month'); +$year = GETPOSTINT('year'); $optioncss = GETPOST('optioncss', 'alpha'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index ac3c2b57bbb..72357539c84 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -91,12 +91,12 @@ if (isModEnabled('notification')) { $action = GETPOST('action', 'aZ09'); -$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$id = (GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id')); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -173,7 +173,7 @@ if (empty($reshook)) { // Payment terms of the settlement if ($action == 'setconditions' && $user->hasRight('societe', 'creer')) { $object->fetch($id); - $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), GETPOST('cond_reglement_id_deposit_percent', 'alpha')); + $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'), GETPOSTINT('cond_reglement_id_deposit_percent')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -182,7 +182,7 @@ if (empty($reshook)) { // Payment mode if ($action == 'setmode' && $user->hasRight('societe', 'creer')) { $object->fetch($id); - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + $result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -200,7 +200,7 @@ if (empty($reshook)) { // Bank account if ($action == 'setbankaccount' && $user->hasRight('societe', 'creer')) { $object->fetch($id); - $result = $object->setBankAccount(GETPOST('fk_account', 'int')); + $result = $object->setBankAccount(GETPOSTINT('fk_account')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -209,7 +209,7 @@ if (empty($reshook)) { // customer preferred shipping method if ($action == 'setshippingmethod' && $user->hasRight('societe', 'creer')) { $object->fetch($id); - $result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int')); + $result = $object->setShippingMethod(GETPOSTINT('shipping_method_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -297,7 +297,7 @@ if (empty($reshook)) { // warehouse if ($action == 'setwarehouse' && $user->hasRight('societe', 'creer')) { - $result = $object->setWarehouse(GETPOST('fk_warehouse', 'int')); + $result = $object->setWarehouse(GETPOSTINT('fk_warehouse')); } } diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 255ab70afa7..ca78aa8f9c9 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -32,7 +32,7 @@ $langs->load("companies"); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "ASC"; } @@ -42,7 +42,7 @@ if (!$sortfield) { if ($page < 0) { $page = 0; } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; $type = GETPOST('type', 'alpha'); @@ -53,7 +53,7 @@ $contactname = GETPOST('contactname'); $begin = GETPOST('begin', 'alpha'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $action = ''; $socid = $user->socid; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 843c0ceaf35..67823d4b12f 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -54,10 +54,10 @@ $hookmanager->initHooks(array('commercialindex')); $langs->loadLangs(array("boxes", "commercial", "contracts", "orders", "propal", "supplier_proposal")); $action = GETPOST('action', 'aZ09'); -$bid = GETPOST('bid', 'int'); +$bid = GETPOSTINT('bid'); // Securite access client -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if (isset($user->socid) && $user->socid > 0) { $action = ''; $socid = $user->socid; diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index 73fc1826706..4742d6b66e7 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -44,10 +44,10 @@ if (isModEnabled('categorie')) { } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -62,12 +62,12 @@ if (!$sortfield) { } $id = GETPOSTINT('id'); -$rowid = GETPOST('rowid', 'int'); +$rowid = GETPOSTINT('rowid'); $action = GETPOST('action', 'aZ09'); $search_nom = GETPOST("search_nom"); $search_prenom = GETPOST("search_prenom"); $search_email = GETPOST("search_email"); -$template_id = GETPOST('template_id', 'int'); +$template_id = GETPOSTINT('template_id'); // Do we click on purge search criteria ? if (GETPOST('button_removefilter_x', 'alpha')) { @@ -134,14 +134,14 @@ if ($action == 'add') { $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_st_dt', $array_query)) { - $array_query['options_'.$dtarr[1].'_st_dt'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear', 'int')); + $array_query['options_'.$dtarr[1].'_st_dt'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_st_dtmonth'), GETPOSTINT('options_'.$dtarr[1].'_st_dtday'), GETPOSTINT('options_'.$dtarr[1].'_st_dtyear')); } } elseif (preg_match("/end_dt/", $key)) { // Special case for end date come with 3 inputs day, month, year $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_end_dt', $array_query)) { - $array_query['options_'.$dtarr[1].'_end_dt'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear', 'int')); + $array_query['options_'.$dtarr[1].'_end_dt'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_end_dtmonth'), GETPOSTINT('options_'.$dtarr[1].'_end_dtday'), GETPOSTINT('options_'.$dtarr[1].'_end_dtyear')); } } else { $array_query[$key] = GETPOST($key); @@ -154,14 +154,14 @@ if ($action == 'add') { $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_st_dt_cnct', $array_query)) { - $array_query['options_'.$dtarr[1].'_st_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear_cnct', 'int')); + $array_query['options_'.$dtarr[1].'_st_dt_cnct'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_st_dtmonth_cnct'), GETPOSTINT('options_'.$dtarr[1].'_st_dtday_cnct'), GETPOSTINT('options_'.$dtarr[1].'_st_dtyear_cnct')); } } elseif (preg_match("/end_dt/", $key)) { // Special case for end date come with 3 inputs day, month, year $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_end_dt_cnct', $array_query)) { - $array_query['options_'.$dtarr[1].'_end_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear_cnct', 'int')); + $array_query['options_'.$dtarr[1].'_end_dt_cnct'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_end_dtmonth_cnct'), GETPOSTINT('options_'.$dtarr[1].'_end_dtday_cnct'), GETPOSTINT('options_'.$dtarr[1].'_end_dtyear_cnct')); } } else { $array_query[$key] = GETPOST($key); @@ -185,7 +185,7 @@ if ($action == 'add') { if ($key == $date_key) { $dt = GETPOST($date_key); if (!empty($dt)) { - $array_query[$key] = dol_mktime(0, 0, 0, GETPOST($date_key.'month', 'int'), GETPOST($date_key.'day', 'int'), GETPOST($date_key.'year', 'int')); + $array_query[$key] = dol_mktime(0, 0, 0, GETPOSTINT($date_key.'month'), GETPOSTINT($date_key.'day'), GETPOSTINT($date_key.'year')); } else { $array_query[$key] = ''; } @@ -285,14 +285,14 @@ if ($action == 'savefilter' || $action == 'createfilter') { $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_st_dt', $array_query)) { - $array_query['options_'.$dtarr[1].'_st_dt'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear', 'int')); + $array_query['options_'.$dtarr[1].'_st_dt'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_st_dtmonth'), GETPOSTINT('options_'.$dtarr[1].'_st_dtday'), GETPOSTINT('options_'.$dtarr[1].'_st_dtyear')); } } elseif (preg_match("/end_dt/", $key)) { // Special case for end date come with 3 inputs day, month, year $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_end_dt', $array_query)) { - $array_query['options_'.$dtarr[1].'_end_dt'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear', 'int')); + $array_query['options_'.$dtarr[1].'_end_dt'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_end_dtmonth'), GETPOSTINT('options_'.$dtarr[1].'_end_dtday'), GETPOSTINT('options_'.$dtarr[1].'_end_dtyear')); // print $array_query['options_'.$dtarr[1].'_end_dt']; // 01/02/1013=1361228400 } @@ -306,14 +306,14 @@ if ($action == 'savefilter' || $action == 'createfilter') { $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_st_dt_cnct', $array_query)) { - $array_query['options_'.$dtarr[1].'_st_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_st_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_st_dtyear_cnct', 'int')); + $array_query['options_'.$dtarr[1].'_st_dt_cnct'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_st_dtmonth_cnct'), GETPOSTINT('options_'.$dtarr[1].'_st_dtday_cnct'), GETPOSTINT('options_'.$dtarr[1].'_st_dtyear_cnct')); } } elseif (preg_match("/end_dt/", $key)) { // Special case for end date come with 3 inputs day, month, year $dtarr = array(); $dtarr = explode('_', $key); if (!array_key_exists('options_'.$dtarr[1].'_end_dt_cnct', $array_query)) { - $array_query['options_'.$dtarr[1].'_end_dt_cnct'] = dol_mktime(0, 0, 0, GETPOST('options_'.$dtarr[1].'_end_dtmonth_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtday_cnct', 'int'), GETPOST('options_'.$dtarr[1].'_end_dtyear_cnct', 'int')); + $array_query['options_'.$dtarr[1].'_end_dt_cnct'] = dol_mktime(0, 0, 0, GETPOSTINT('options_'.$dtarr[1].'_end_dtmonth_cnct'), GETPOSTINT('options_'.$dtarr[1].'_end_dtday_cnct'), GETPOSTINT('options_'.$dtarr[1].'_end_dtyear_cnct')); // print $array_query['cnct_options_'.$dtarr[1].'_end_dt']; // 01/02/1013=1361228400 } @@ -339,7 +339,7 @@ if ($action == 'savefilter' || $action == 'createfilter') { if ($key == $date_key) { $dt = GETPOST($date_key); if (!empty($dt)) { - $array_query[$key] = dol_mktime(0, 0, 0, GETPOST($date_key.'month', 'int'), GETPOST($date_key.'day', 'int'), GETPOST($date_key.'year', 'int')); + $array_query[$key] = dol_mktime(0, 0, 0, GETPOSTINT($date_key.'month'), GETPOSTINT($date_key.'day'), GETPOSTINT($date_key.'year')); } else { $array_query[$key] = ''; } diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php index 80eb874e179..639a655efb7 100644 --- a/htdocs/comm/mailing/card.php +++ b/htdocs/comm/mailing/card.php @@ -42,7 +42,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Load translation files required by the page $langs->loadLangs(array("mails", "admin")); -$id = (GETPOST('mailid', 'int') ? GETPOST('mailid', 'int') : GETPOST('id', 'int')); +$id = (GETPOSTINT('mailid') ? GETPOSTINT('mailid') : GETPOSTINT('id')); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 4dac837e45b..d0b95b32522 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -38,10 +38,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; $langs->loadLangs(array("mails", "admin")); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -55,14 +55,14 @@ if (!$sortorder) { $sortorder = "DESC,ASC"; } -$id = GETPOST('id', 'int'); -$rowid = GETPOST('rowid', 'int'); +$id = GETPOSTINT('id'); +$rowid = GETPOSTINT('rowid'); $action = GETPOST('action', 'aZ09'); $search_lastname = GETPOST("search_lastname", 'alphanohtml'); $search_firstname = GETPOST("search_firstname", 'alphanohtml'); $search_email = GETPOST("search_email", 'alphanohtml'); $search_other = GETPOST("search_other", 'alphanohtml'); -$search_dest_status = GETPOST('search_dest_status', 'int'); +$search_dest_status = GETPOSTINT('search_dest_status'); // Search modules dirs $modulesdir = dolGetModulesDirs('/mailings'); @@ -145,7 +145,7 @@ if ($action == 'add' && $user->hasRight('mailing', 'creer')) { // Add recipient } } -if (GETPOST('clearlist', 'int') && $user->hasRight('mailing', 'creer')) { +if (GETPOSTINT('clearlist') && $user->hasRight('mailing', 'creer')) { // Loading Class $obj = new MailingTargets($db); $obj->clear_target($id); @@ -155,7 +155,7 @@ if (GETPOST('clearlist', 'int') && $user->hasRight('mailing', 'creer')) { */ } -if (GETPOST('exportcsv', 'int') && $user->hasRight('mailing', 'lire')) { +if (GETPOSTINT('exportcsv') && $user->hasRight('mailing', 'lire')) { $completefilename = 'targets_emailing'.$object->id.'_'.dol_print_date(dol_now(), 'dayhourlog').'.csv'; header('Content-Type: text/csv'); header('Content-Disposition: attachment;filename='.$completefilename); diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php index 12ca330896b..0bf7e9cb4ad 100644 --- a/htdocs/comm/mailing/info.php +++ b/htdocs/comm/mailing/info.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php'; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Load translation files required by the page $langs->load("mails"); diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 0383ee5a5a1..082c75b6fe3 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -32,7 +32,7 @@ $langs->load('mails'); // Get Parameters $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -42,10 +42,10 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ' $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -314,7 +314,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/comm/mailing/note.php b/htdocs/comm/mailing/note.php index 19e623d519b..6b7a5153bd7 100644 --- a/htdocs/comm/mailing/note.php +++ b/htdocs/comm/mailing/note.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php'; $langs->loadLangs(array("mails", "mailing", "companies")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index d2729885b96..c9a4dd839ed 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -34,15 +34,15 @@ $langs->loadLangs(array('orders', 'companies')); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); -$id = GETPOST('id', 'int'); -$_socid = GETPOST("id", 'int'); +$id = GETPOSTINT('id'); +$_socid = GETPOSTINT("id"); // Security check if ($user->socid > 0) { $_socid = $user->socid; } // Security check -$socid = GETPOST("socid", 'int'); +$socid = GETPOSTINT("socid"); if ($user->socid > 0) { $action = ''; $id = $user->socid; diff --git a/htdocs/comm/propal/agenda.php b/htdocs/comm/propal/agenda.php index bcf710dac81..7a6f4d4d6e1 100644 --- a/htdocs/comm/propal/agenda.php +++ b/htdocs/comm/propal/agenda.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->loadLangs(array("propal", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -50,10 +50,10 @@ if (GETPOST('actioncode', 'array')) { $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index f827bc3e6ae..d22278ad585 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -72,24 +72,24 @@ if (isModEnabled('margin')) { $error = 0; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $origin = GETPOST('origin', 'alpha'); -$originid = GETPOST('originid', 'int'); +$originid = GETPOSTINT('originid'); $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page -$lineid = GETPOST('lineid', 'int'); -$contactid = GETPOST('contactid', 'int'); -$projectid = GETPOST('projectid', 'int'); -$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1; +$lineid = GETPOSTINT('lineid'); +$contactid = GETPOSTINT('contactid'); +$projectid = GETPOSTINT('projectid'); +$rank = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1; // PDF -$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); -$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); -$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); +$hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); +$hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); +$hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); $object = new Propal($db); $extrafields = new ExtraFields($db); @@ -193,9 +193,9 @@ if (empty($reshook)) { 12, 0, 0, - GETPOST('date_deliverymonth', 'int'), - GETPOST('date_deliveryday', 'int'), - GETPOST('date_deliveryyear', 'int') + GETPOSTINT('date_deliverymonth'), + GETPOSTINT('date_deliveryday'), + GETPOSTINT('date_deliveryyear') ); $date_delivery_old = $object->delivery_date; if (!empty($date_delivery_old) && !empty($date_delivery)) { @@ -224,7 +224,7 @@ if (empty($reshook)) { } } - $result = $object->createFromClone($user, $socid, (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : null), (GETPOST('update_prices', 'aZ') ? true : false), (GETPOST('update_desc', 'aZ') ? true : false)); + $result = $object->createFromClone($user, $socid, (GETPOSTISSET('entity') ? GETPOSTINT('entity') : null), (GETPOSTINT('update_prices') ? true : false), (GETPOSTINT('update_desc') ? true : false)); if ($result > 0) { $warningMsgLineList = array(); // check all product lines are to sell otherwise add a warning message for each product line is not to sell @@ -302,7 +302,7 @@ if (empty($reshook)) { exit(); } elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) { // Validation - $idwarehouse = GETPOST('idwarehouse', 'int'); + $idwarehouse = GETPOSTINT('idwarehouse'); $result = $object->valid($user); if ($result > 0 && getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE')) { $result = $object->closeProposal($user, $object::STATUS_SIGNED); @@ -338,7 +338,7 @@ if (empty($reshook)) { } } } elseif ($action == 'setdate' && $usercancreate) { - $datep = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $datep = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); if (empty($datep)) { $error++; @@ -376,7 +376,7 @@ if (empty($reshook)) { } } } elseif ($action == 'setecheance' && $usercancreate) { - $result = $object->set_echeance($user, dol_mktime(12, 0, 0, GETPOST('echmonth', 'int'), GETPOST('echday', 'int'), GETPOST('echyear', 'int'))); + $result = $object->set_echeance($user, dol_mktime(12, 0, 0, GETPOSTINT('echmonth'), GETPOSTINT('echday'), GETPOSTINT('echyear'))); if ($result >= 0) { if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) { $outputlangs = $langs; @@ -403,7 +403,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'setdate_livraison' && $usercancreate) { - $result = $object->setDeliveryDate($user, dol_mktime(12, 0, 0, GETPOST('date_livraisonmonth', 'int'), GETPOST('date_livraisonday', 'int'), GETPOST('date_livraisonyear', 'int'))); + $result = $object->setDeliveryDate($user, dol_mktime(12, 0, 0, GETPOSTINT('date_livraisonmonth'), GETPOSTINT('date_livraisonday'), GETPOSTINT('date_livraisonyear'))); if ($result < 0) { dol_print_error($db, $object->error); } @@ -415,7 +415,7 @@ if (empty($reshook)) { } } elseif ($action == 'set_incoterms' && isModEnabled('incoterm') && $usercancreate) { // Set incoterm - $result = $object->setIncoterms(GETPOST('incoterm_id', 'int'), GETPOST('location_incoterms', 'alpha')); + $result = $object->setIncoterms(GETPOSTINT('incoterm_id'), GETPOSTINT('location_incoterms')); } elseif ($action == 'add' && $usercancreate) { // Create proposal $object->socid = $socid; @@ -423,7 +423,7 @@ if (empty($reshook)) { $datep = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $date_delivery = dol_mktime(12, 0, 0, GETPOST('date_livraisonmonth'), GETPOST('date_livraisonday'), GETPOST('date_livraisonyear')); - $duration = GETPOST('duree_validite', 'int'); + $duration = GETPOSTINT('duree_validite'); if (empty($datep)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePropal")), null, 'errors'); @@ -448,7 +448,7 @@ if (empty($reshook)) { // If we select proposal to clone during creation (when option PROPAL_CLONE_ON_CREATE_PAGE is on) if (GETPOST('createmode') == 'copy' && GETPOST('copie_propal')) { - if ($object->fetch(GETPOST('copie_propal', 'int')) > 0) { + if ($object->fetch(GETPOSTINT('copie_propal')) > 0) { $object->ref = GETPOST('ref'); $object->datep = $datep; $object->date = $datep; @@ -733,16 +733,16 @@ if (empty($reshook)) { } } elseif ($action == 'confirm_closeas' && $usercanclose && !GETPOST('cancel', 'alpha')) { // Close proposal - if (!(GETPOST('statut', 'int') > 0)) { + if (!(GETPOSTINT('statut') > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors'); $action = 'closeas'; - } elseif (GETPOST('statut', 'int') == $object::STATUS_SIGNED || GETPOST('statut', 'int') == $object::STATUS_NOTSIGNED) { + } elseif (GETPOSTINT('statut') == $object::STATUS_SIGNED || GETPOSTINT('statut') == $object::STATUS_NOTSIGNED) { $locationTarget = ''; // prevent browser refresh from closing proposal several times if ($object->statut == $object::STATUS_VALIDATED || (getDolGlobalString('PROPAL_SKIP_ACCEPT_REFUSE') && $object->statut == $object::STATUS_DRAFT)) { $db->begin(); - $result = $object->closeProposal($user, GETPOST('statut', 'int'), GETPOST('note_private', 'restricthtml')); + $result = $object->closeProposal($user, GETPOSTINT('statut'), GETPOSTINT('note_private')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; @@ -756,19 +756,19 @@ if (empty($reshook)) { $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); if ( - !$error && GETPOST('statut', 'int') == $object::STATUS_SIGNED && GETPOST('generate_deposit', 'alpha') == 'on' + !$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOSTINT('generate_deposit') == 'on' && !empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && $user->hasRight('facture', 'creer') ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; - $date = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int')); + $date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear')); $forceFields = array(); if (GETPOSTISSET('date_pointoftax')) { - $forceFields['date_pointoftax'] = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); + $forceFields['date_pointoftax'] = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear')); } - $deposit = Facture::createDepositFromOrigin($object, $date, GETPOST('cond_reglement_id', 'int'), $user, 0, GETPOST('validate_generated_deposit', 'alpha') == 'on', $forceFields); + $deposit = Facture::createDepositFromOrigin($object, $date, GETPOSTINT('cond_reglement_id'), $user, 0, GETPOSTINT('validate_generated_deposit') == 'on', $forceFields); if ($deposit) { setEventMessage('DepositGenerated'); @@ -936,9 +936,9 @@ if (empty($reshook)) { $object->generateDocument($object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref); } } elseif ($action == "setabsolutediscount" && $usercancreate) { - if (GETPOST("remise_id", "int")) { + if (GETPOSTINT("remise_id")) { if ($object->id > 0) { - $result = $object->insert_discount(GETPOST("remise_id", "int")); + $result = $object->insert_discount(GETPOSTINT("remise_id")); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -1020,7 +1020,7 @@ if (empty($reshook)) { if ($prod_entry_mode == 'free') { $idprod = 0; } else { - $idprod = GETPOST('idprod', 'int'); + $idprod = GETPOSTINT('idprod'); if (getDolGlobalString('MAIN_DISABLE_FREE_LINES') && $idprod <= 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")), null, 'errors'); @@ -1159,7 +1159,7 @@ if (empty($reshook)) { // If price per quantity if ($prod->prices_by_qty[0]) { // yes, this product has some prices per quantity // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. - $pqp = GETPOST('pbq', 'int'); + $pqp = GETPOSTINT('pbq'); // Search price into product_price_by_qty from $prod->id foreach ($prod->prices_by_qty_list[0] as $priceforthequantityarray) { @@ -1180,7 +1180,7 @@ if (empty($reshook)) { // If price per quantity and customer if ($prod->prices_by_qty[$object->thirdparty->price_level]) { // yes, this product has some prices per quantity // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. - $pqp = GETPOST('pbq', 'int'); + $pqp = GETPOSTINT('pbq'); // Search price into product_price_by_qty from $prod->id foreach ($prod->prices_by_qty_list[$object->thirdparty->price_level] as $priceforthequantityarray) { @@ -1510,13 +1510,13 @@ if (empty($reshook)) { } // Define special_code for special lines - $special_code = GETPOST('special_code', 'int'); + $special_code = GETPOSTINT('special_code'); if (!GETPOST('qty')) { $special_code = 3; } // Check minimum price - $productid = GETPOST('productid', 'int'); + $productid = GETPOSTINT('productid'); if (!empty($productid)) { $product = new Product($db); $res = $product->fetch($productid); @@ -1566,7 +1566,7 @@ if (empty($reshook)) { if (!$user->hasRight('margins', 'creer')) { foreach ($object->lines as &$line) { - if ($line->id == GETPOST('lineid', 'int')) { + if ($line->id == GETPOSTINT('lineid')) { $fournprice = $line->fk_fournprice; $buyingprice = $line->pa_ht; break; @@ -1583,7 +1583,7 @@ if (empty($reshook)) { $price_base_type = 'TTC'; } - $result = $object->updateline(GETPOST('lineid', 'int'), $pu, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $description, $price_base_type, $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise); + $result = $object->updateline(GETPOSTINT('lineid'), $pu, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $description, $price_base_type, $info_bits, $special_code, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $type, $date_start, $date_end, $array_options, GETPOST("units"), $pu_ht_devise); if ($result >= 0) { $db->commit(); @@ -1640,38 +1640,38 @@ if (empty($reshook)) { exit(); } elseif ($action == 'classin' && $usercancreate) { // Set project - $object->setProject(GETPOST('projectid', 'int')); + $object->setProject(GETPOSTINT('projectid')); } elseif ($action == 'setavailability' && $usercancreate) { // Delivery time - $result = $object->set_availability($user, GETPOST('availability_id', 'int')); + $result = $object->set_availability($user, GETPOSTINT('availability_id')); } elseif ($action == 'setdemandreason' && $usercancreate) { // Origin of the commercial proposal - $result = $object->set_demand_reason($user, GETPOST('demand_reason_id', 'int')); + $result = $object->set_demand_reason($user, GETPOSTINT('demand_reason_id')); } elseif ($action == 'setconditions' && $usercancreate) { // Terms of payment - $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'), GETPOST('cond_reglement_id_deposit_percent', 'alpha')); + $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id'), GETPOSTINT('cond_reglement_id_deposit_percent')); //} elseif ($action == 'setremisepercent' && $usercancreate) { // $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2)); //} elseif ($action == 'setremiseabsolue' && $usercancreate) { // $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2)); } elseif ($action == 'setmode' && $usercancreate) { // Payment choice - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + $result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id')); } elseif ($action == 'setmulticurrencycode' && $usercancreate) { // Multicurrency Code $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); } elseif ($action == 'setmulticurrencyrate' && $usercancreate) { // Multicurrency rate - $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOST('calculation_mode', 'int')); + $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOSTINT('calculation_mode')); } elseif ($action == 'setbankaccount' && $usercancreate) { // bank account - $result = $object->setBankAccount(GETPOST('fk_account', 'int')); + $result = $object->setBankAccount(GETPOSTINT('fk_account')); } elseif ($action == 'setshippingmethod' && $usercancreate) { // shipping method - $result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int')); + $result = $object->setShippingMethod(GETPOSTINT('shipping_method_id')); } elseif ($action == 'setwarehouse' && $usercancreate) { // warehouse - $result = $object->setWarehouse(GETPOST('warehouse_id', 'int')); + $result = $object->setWarehouse(GETPOSTINT('warehouse_id')); } elseif ($action == 'update_extras') { $object->oldcopy = dol_clone($object, 2); $attribute_name = GETPOST('attribute', 'restricthtml'); @@ -1715,7 +1715,7 @@ if (empty($reshook)) { } elseif ($action == 'swapstatut') { // Toggle the status of a contact if ($object->fetch($id) > 0) { - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } else { dol_print_error($db); } @@ -1775,10 +1775,10 @@ if ($action == 'create') { $currency_code = $conf->currency; - $cond_reglement_id = GETPOST('cond_reglement_id', 'int'); + $cond_reglement_id = GETPOSTINT('cond_reglement_id'); $deposit_percent = GETPOST('cond_reglement_id_deposit_percent', 'alpha'); - $mode_reglement_id = GETPOST('mode_reglement_id', 'int'); - $fk_account = GETPOST('fk_account', 'int'); + $mode_reglement_id = GETPOSTINT('mode_reglement_id'); + $fk_account = GETPOSTINT('fk_account'); // Load objectsrc if (!empty($origin) && !empty($originid)) { @@ -1857,16 +1857,16 @@ if ($action == 'create') { // If form was posted (but error returned), we must reuse the value posted in priority (standard Dolibarr behaviour) if (!GETPOST('changecompany')) { if (GETPOSTISSET('cond_reglement_id')) { - $cond_reglement_id = GETPOST('cond_reglement_id', 'int'); + $cond_reglement_id = GETPOSTINT('cond_reglement_id'); } if (GETPOSTISSET('deposit_percent')) { $deposit_percent = price2num(GETPOST('deposit_percent', 'alpha')); } if (GETPOSTISSET('mode_reglement_id')) { - $mode_reglement_id = GETPOST('mode_reglement_id', 'int'); + $mode_reglement_id = GETPOSTINT('mode_reglement_id'); } if (GETPOSTISSET('cond_reglement_id')) { - $fk_account = GETPOST('fk_account', 'int'); + $fk_account = GETPOSTINT('fk_account'); } } @@ -2000,7 +2000,7 @@ if ($action == 'create') { // Source / Channel - What trigger creation print ''.$langs->trans('Source').''; print img_picto('', 'question', 'class="pictofixedwidth"'); - $form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOST('demand_reason_id', 'int') : ''), 'demand_reason_id', "SRC_PROP", 1, 'maxwidth200 widthcentpercentminusx'); + $form->selectInputReason((GETPOSTISSET('demand_reason_id') ? GETPOSTINT('demand_reason_id') : ''), 'demand_reason_id', "SRC_PROP", 1, 'maxwidth200 widthcentpercentminusx'); print ''; // Shipping Method @@ -2010,7 +2010,7 @@ if ($action == 'create') { } print ''.$langs->trans('SendingMethod').''; print img_picto('', 'dolly', 'class="pictofixedwidth"'); - $form->selectShippingMethod((GETPOSTISSET('shipping_method_id') ? GETPOST('shipping_method_id', 'int') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); + $form->selectShippingMethod((GETPOSTISSET('shipping_method_id') ? GETPOSTINT('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); print ''; } @@ -2030,7 +2030,7 @@ if ($action == 'create') { } print ''; print img_picto('', 'clock', 'class="pictofixedwidth"'); - $form->selectAvailabilityDelay((GETPOSTISSET('availability_id') ? GETPOST('availability_id', 'int') : ''), 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx'); + $form->selectAvailabilityDelay((GETPOSTISSET('availability_id') ? GETPOSTINT('availability_id') : ''), 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx'); print ''; // Delivery date (or manufacturing) @@ -2258,7 +2258,7 @@ if ($action == 'create') { $formquestion = array( // 'text' => $langs->trans("ConfirmClone"), // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), - array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', $filter, '', 0, 0, null, 0, 'maxwidth300')), + array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', $filter, '', 0, 0, null, 0, 'maxwidth300')), array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans('PuttingPricesUpToDate'), 'value' => 0), array('type' => 'checkbox', 'name' => 'update_desc', 'label' => $langs->trans('PuttingDescUpToDate'), 'value' => 0), ); diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 1da537b7d89..3e47a6921e3 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -37,9 +37,9 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Load translation files required by the page $langs->loadLangs(array('facture', 'propal', 'orders', 'sendings', 'companies')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOSTINT('lineid'); $action = GETPOST('action', 'aZ09'); $object = new Propal($db); @@ -87,7 +87,7 @@ if (empty($reshook)) { // Add new contact if ($action == 'addcontact' && $user->hasRight('propal', 'creer')) { if ($object->id > 0) { - $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $contactid = (GETPOSTINT('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); } @@ -106,7 +106,7 @@ if (empty($reshook)) { } elseif ($action == 'swapstatut' && $user->hasRight('propal', 'creer')) { // Toggle the status of a contact if ($object->id > 0) { - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } } elseif ($action == 'deletecontact' && $user->hasRight('propal', 'creer')) { // Delete contact diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index 00ec2367c8a..07ea2de457b 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -42,14 +42,14 @@ $langs->loadLangs(array('propal', 'compta', 'other', 'companies')); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index ce58344c3d9..ebc5905dc2a 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -42,7 +42,7 @@ $now = dol_now(); $max = 5; // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if (isset($user->socid) && $user->socid > 0) { $action = ''; $socid = $user->socid; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index b785152916b..7a1626674e5 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -63,11 +63,11 @@ if (isModEnabled("expedition")) { } // Get Parameters -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); @@ -76,8 +76,8 @@ $mode = GETPOST('mode', 'alpha'); // Search Fields $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -$search_user = GETPOST('search_user', 'int'); -$search_sale = GETPOST('search_sale', 'int'); +$search_user = GETPOSTINT('search_user'); +$search_sale = GETPOSTINT('search_sale'); $search_ref = GETPOST('sf_ref') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_refcustomer = GETPOST('search_refcustomer', 'alpha'); $search_refproject = GETPOST('search_refproject', 'alpha'); @@ -94,48 +94,48 @@ $search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'a $search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha'); $search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); -$search_product_category = GETPOST('search_product_category', 'int'); +$search_product_category = GETPOSTINT('search_product_category'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST("search_state"); -$search_country = GETPOST("search_country", 'int'); -$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_country = GETPOSTINT("search_country"); +$search_type_thirdparty = GETPOSTINT("search_type_thirdparty"); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_date_end_startday = GETPOST('search_date_end_startday', 'int'); -$search_date_end_startmonth = GETPOST('search_date_end_startmonth', 'int'); -$search_date_end_startyear = GETPOST('search_date_end_startyear', 'int'); -$search_date_end_endday = GETPOST('search_date_end_endday', 'int'); -$search_date_end_endmonth = GETPOST('search_date_end_endmonth', 'int'); -$search_date_end_endyear = GETPOST('search_date_end_endyear', 'int'); +$search_date_end_startday = GETPOSTINT('search_date_end_startday'); +$search_date_end_startmonth = GETPOSTINT('search_date_end_startmonth'); +$search_date_end_startyear = GETPOSTINT('search_date_end_startyear'); +$search_date_end_endday = GETPOSTINT('search_date_end_endday'); +$search_date_end_endmonth = GETPOSTINT('search_date_end_endmonth'); +$search_date_end_endyear = GETPOSTINT('search_date_end_endyear'); $search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver $search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear); -$search_date_delivery_startday = GETPOST('search_date_delivery_startday', 'int'); -$search_date_delivery_startmonth = GETPOST('search_date_delivery_startmonth', 'int'); -$search_date_delivery_startyear = GETPOST('search_date_delivery_startyear', 'int'); -$search_date_delivery_endday = GETPOST('search_date_delivery_endday', 'int'); -$search_date_delivery_endmonth = GETPOST('search_date_delivery_endmonth', 'int'); -$search_date_delivery_endyear = GETPOST('search_date_delivery_endyear', 'int'); +$search_date_delivery_startday = GETPOSTINT('search_date_delivery_startday'); +$search_date_delivery_startmonth = GETPOSTINT('search_date_delivery_startmonth'); +$search_date_delivery_startyear = GETPOSTINT('search_date_delivery_startyear'); +$search_date_delivery_endday = GETPOSTINT('search_date_delivery_endday'); +$search_date_delivery_endmonth = GETPOSTINT('search_date_delivery_endmonth'); +$search_date_delivery_endyear = GETPOSTINT('search_date_delivery_endyear'); $search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear); $search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear); -$search_availability = GETPOST('search_availability', 'int'); -$search_categ_cus = GETPOST("search_categ_cus", 'int'); -$search_fk_cond_reglement = GETPOST("search_fk_cond_reglement", 'int'); -$search_fk_shipping_method = GETPOST("search_fk_shipping_method", 'int'); -$search_fk_input_reason = GETPOST("search_fk_input_reason", 'int'); -$search_fk_mode_reglement = GETPOST("search_fk_mode_reglement", 'int'); -$search_date_signature_startday = GETPOST('search_date_signature_startday', 'int'); -$search_date_signature_startmonth = GETPOST('search_date_signature_startmonth', 'int'); -$search_date_signature_startyear = GETPOST('search_date_signature_startyear', 'int'); -$search_date_signature_endday = GETPOST('search_date_signature_endday', 'int'); -$search_date_signature_endmonth = GETPOST('search_date_signature_endmonth', 'int'); -$search_date_signature_endyear = GETPOST('search_date_signature_endyear', 'int'); +$search_availability = GETPOSTINT('search_availability'); +$search_categ_cus = GETPOSTINT("search_categ_cus"); +$search_fk_cond_reglement = GETPOSTINT("search_fk_cond_reglement"); +$search_fk_shipping_method = GETPOSTINT("search_fk_shipping_method"); +$search_fk_input_reason = GETPOSTINT("search_fk_input_reason"); +$search_fk_mode_reglement = GETPOSTINT("search_fk_mode_reglement"); +$search_date_signature_startday = GETPOSTINT('search_date_signature_startday'); +$search_date_signature_startmonth = GETPOSTINT('search_date_signature_startmonth'); +$search_date_signature_startyear = GETPOSTINT('search_date_signature_startyear'); +$search_date_signature_endday = GETPOSTINT('search_date_signature_endday'); +$search_date_signature_endmonth = GETPOSTINT('search_date_signature_endmonth'); +$search_date_signature_endyear = GETPOSTINT('search_date_signature_endyear'); $search_date_signature_start = dol_mktime(0, 0, 0, $search_date_signature_startmonth, $search_date_signature_startday, $search_date_signature_startyear); $search_date_signature_end = dol_mktime(23, 59, 59, $search_date_signature_endmonth, $search_date_signature_endday, $search_date_signature_endyear); $search_status = GETPOST('search_status', 'alpha'); @@ -144,10 +144,10 @@ $optioncss = GETPOST('optioncss', 'alpha'); $object_statut = GETPOST('search_statut', 'alpha'); // Pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php index bc408a1c6de..e412b5d1077 100644 --- a/htdocs/comm/propal/note.php +++ b/htdocs/comm/propal/note.php @@ -37,7 +37,7 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('propal', 'compta', 'bills', 'companies')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php index 3603f89af2a..76809fc222f 100644 --- a/htdocs/comm/propal/stats/index.php +++ b/htdocs/comm/propal/stats/index.php @@ -44,8 +44,8 @@ $object_status = GETPOST('object_status', 'intcomma'); $typent_id = GETPOSTINT('typent_id'); $categ_id = GETPOSTINT('categ_id'); -$userid = GETPOST('userid', 'int'); -$socid = GETPOST('socid', 'int'); +$userid = GETPOSTINT('userid'); +$socid = GETPOSTINT('socid'); // Security check if ($user->socid > 0) { $action = ''; @@ -53,7 +53,7 @@ if ($user->socid > 0) { } $nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); -$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; +$year = GETPOST('year') > 0 ? GETPOSTINT('year') : $nowyear; $startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS')))); $endyear = $year; diff --git a/htdocs/comm/prospect/index.php b/htdocs/comm/prospect/index.php index 551172f2674..122d0f88811 100644 --- a/htdocs/comm/prospect/index.php +++ b/htdocs/comm/prospect/index.php @@ -36,7 +36,7 @@ if ($user->socid > 0) { } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $action = ''; $socid = $user->socid; diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index b1f003f9e11..4881fce1920 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -34,7 +34,7 @@ if (isModEnabled('facture')) { } // Security check -$socid = GETPOST("socid", 'int'); +$socid = GETPOSTINT("socid"); if ($user->socid > 0) { $action = ''; $id = $user->socid; diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index f1c5f748e62..2a3ee4a4991 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -30,9 +30,9 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'orders', 'bills')); -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); -$socid = GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('socid', 'int'); +$socid = GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('socid'); // Security check if ($user->socid > 0) { $socid = $user->socid; @@ -66,7 +66,7 @@ if ($action == 'setremise') { $object = new Societe($db); $object->fetch($id); - $discount_type = GETPOST('discount_type', 'int'); + $discount_type = GETPOSTINT('discount_type'); if (!empty($discount_type)) { $result = $object->set_remise_supplier(price2num(GETPOST("remise")), GETPOST("note", "alphanohtml"), $user); @@ -79,7 +79,7 @@ if ($action == 'setremise') { header("Location: ".$backtopage); exit; } else { - header("Location: remise.php?id=".GETPOST("id", 'int')); + header("Location: remise.php?id=".GETPOSTINT("id")); exit; } } else { @@ -175,10 +175,10 @@ if ($socid > 0) { // Discount type print ''.$langs->trans('DiscountType').''; if ($isCustomer) { - print ' '; + print ' '; } if ($isSupplier) { - print ' '; + print ' '; } print ''; } diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 068fdff9052..994e30fb9f1 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -38,13 +38,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php'; // Load translation files required by the page $langs->loadLangs(array('orders', 'bills', 'companies')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); // Security check -$socid = GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('socid', 'int'); +$socid = GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; } @@ -75,7 +75,7 @@ if ($action == 'confirm_split' && GETPOST("confirm", "alpha") == 'yes' && $permi $amount_ttc_2 = price2num($amount_ttc_2); $error = 0; - $remid = (GETPOST("remid", 'int') ? GETPOST("remid", 'int') : 0); + $remid = (GETPOSTINT("remid") ? GETPOSTINT("remid") : 0); $discount = new DiscountAbsolute($db); $res = $discount->fetch($remid); if (!($res > 0)) { diff --git a/htdocs/commande/agenda.php b/htdocs/commande/agenda.php index 49fe399610b..3c0eea17f23 100644 --- a/htdocs/commande/agenda.php +++ b/htdocs/commande/agenda.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; $langs->loadLangs(array("order", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -50,10 +50,10 @@ if (GETPOST('actioncode', 'array')) { $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 988879d2f7f..c2c6cfe44cf 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -78,25 +78,25 @@ if (isModEnabled('productbatch')) { } -$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('orderid', 'int')); +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('orderid')); $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$lineid = GETPOST('lineid', 'int'); -$contactid = GETPOST('contactid', 'int'); -$projectid = GETPOST('projectid', 'int'); +$lineid = GETPOSTINT('lineid'); +$contactid = GETPOSTINT('contactid'); +$projectid = GETPOSTINT('projectid'); $origin = GETPOST('origin', 'alpha'); -$originid = (GETPOST('originid', 'int') ? GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility -$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1; +$originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility +$rank = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1; // PDF -$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); -$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); -$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); +$hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); +$hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); +$hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); // Security check if (!empty($user->socid)) { @@ -139,7 +139,7 @@ $permissiontoadd = $usercancreate; // Used by the include of actions_addu $error = 0; -$date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); +$date_delivery = dol_mktime(GETPOSTINT('liv_hour'), GETPOSTINT('liv_min'), 0, GETPOSTINT('liv_month'), GETPOSTINT('liv_day'), GETPOSTINT('liv_year')); /* @@ -278,11 +278,11 @@ if (empty($reshook)) { } } elseif ($action == 'classin' && $usercancreate) { // Link to a project - $object->setProject(GETPOST('projectid', 'int')); + $object->setProject(GETPOSTINT('projectid')); } elseif ($action == 'add' && $usercancreate) { // Add order $datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); - $date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); + $date_delivery = dol_mktime(GETPOSTINT('liv_hour'), GETPOSTINT('liv_min'), 0, GETPOSTINT('liv_month'), GETPOSTINT('liv_day'), GETPOSTINT('liv_year')); if ($datecommande == '') { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('Date')), null, 'errors'); @@ -305,7 +305,7 @@ if (empty($reshook)) { $object->date_commande = $datecommande; $object->note_private = GETPOST('note_private', 'restricthtml'); $object->note_public = GETPOST('note_public', 'restricthtml'); - $object->source = GETPOST('source_id', 'int'); + $object->source = GETPOSTINT('source_id'); $object->fk_project = GETPOSTINT('projectid'); $object->ref_client = GETPOST('ref_client', 'alpha'); $object->model_pdf = GETPOST('model'); @@ -520,8 +520,8 @@ if (empty($reshook)) { // Insert default contacts if defined if ($object_id > 0) { - if (GETPOST('contactid', 'int')) { - $result = $object->add_contact(GETPOST('contactid', 'int'), 'CUSTOMER', 'external'); + if (GETPOSTINT('contactid')) { + $result = $object->add_contact(GETPOSTINT('contactid'), 'CUSTOMER', 'external'); if ($result < 0) { setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors'); $error++; @@ -574,14 +574,14 @@ if (empty($reshook)) { } } } elseif ($action == 'setdate' && $usercancreate) { - $date = dol_mktime(0, 0, 0, GETPOST('order_month', 'int'), GETPOST('order_day', 'int'), GETPOST('order_year', 'int')); + $date = dol_mktime(0, 0, 0, GETPOSTINT('order_month'), GETPOSTINT('order_day'), GETPOSTINT('order_year')); $result = $object->set_date($user, $date); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'setdate_livraison' && $usercancreate) { - $date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); + $date_delivery = dol_mktime(GETPOSTINT('liv_hour'), GETPOSTINT('liv_min'), 0, GETPOSTINT('liv_month'), GETPOSTINT('liv_day'), GETPOSTINT('liv_year')); $object->fetch($id); $result = $object->setDeliveryDate($user, $date_delivery); @@ -589,7 +589,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'setmode' && $usercancreate) { - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + $result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -598,7 +598,7 @@ if (empty($reshook)) { $result = $object->setMulticurrencyCode(GETPOST('multicurrency_code', 'alpha')); } elseif ($action == 'setmulticurrencyrate' && $usercancreate) { // Multicurrency rate - $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOST('calculation_mode', 'int')); + $result = $object->setMulticurrencyRate(price2num(GETPOST('multicurrency_tx')), GETPOSTINT('calculation_mode')); } elseif ($action == 'setavailability' && $usercancreate) { $result = $object->availability(GETPOST('availability_id')); if ($result < 0) { @@ -638,19 +638,19 @@ if (empty($reshook)) { } } elseif ($action == 'setbankaccount' && $usercancreate) { // bank account - $result = $object->setBankAccount(GETPOST('fk_account', 'int')); + $result = $object->setBankAccount(GETPOSTINT('fk_account')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'setshippingmethod' && $usercancreate) { // shipping method - $result = $object->setShippingMethod(GETPOST('shipping_method_id', 'int')); + $result = $object->setShippingMethod(GETPOSTINT('shipping_method_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'setwarehouse' && $usercancreate) { // warehouse - $result = $object->setWarehouse(GETPOST('warehouse_id', 'int')); + $result = $object->setWarehouse(GETPOSTINT('warehouse_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -708,7 +708,7 @@ if (empty($reshook)) { if ($prod_entry_mode == 'free') { $idprod = 0; } else { - $idprod = GETPOST('idprod', 'int'); + $idprod = GETPOSTINT('idprod'); if (getDolGlobalString('MAIN_DISABLE_FREE_LINES') && $idprod <= 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")), null, 'errors'); @@ -852,7 +852,7 @@ if (empty($reshook)) { // If price per quantity if ($prod->prices_by_qty[0]) { // yes, this product has some prices per quantity // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. - $pqp = GETPOST('pbq', 'int'); + $pqp = GETPOSTINT('pbq'); // Search price into product_price_by_qty from $prod->id foreach ($prod->prices_by_qty_list[0] as $priceforthequantityarray) { @@ -873,7 +873,7 @@ if (empty($reshook)) { // If price per quantity and customer if ($prod->prices_by_qty[$object->thirdparty->price_level]) { // yes, this product has some prices per quantity // Search the correct price into loaded array product_price_by_qty using id of array retrieved into POST['pqp']. - $pqp = GETPOST('pbq', 'int'); + $pqp = GETPOSTINT('pbq'); // Search price into product_price_by_qty from $prod->id foreach ($prod->prices_by_qty_list[$object->thirdparty->price_level] as $priceforthequantityarray) { if ($priceforthequantityarray['rowid'] != $pqp) { @@ -1199,7 +1199,7 @@ if (empty($reshook)) { $remise_percent = GETPOST('remise_percent') != '' ? price2num(GETPOST('remise_percent'), '', 2) : 0; // Check minimum price - $productid = GETPOST('productid', 'int'); + $productid = GETPOSTINT('productid'); if (!empty($productid)) { $product = new Product($db); $product->fetch($productid); @@ -1252,7 +1252,7 @@ if (empty($reshook)) { if (!$error) { if (!$user->hasRight('margins', 'creer')) { foreach ($object->lines as &$line) { - if ($line->id == GETPOST('lineid', 'int')) { + if ($line->id == GETPOSTINT('lineid')) { $fournprice = $line->fk_fournprice; $buyingprice = $line->pa_ht; break; @@ -1267,7 +1267,7 @@ if (empty($reshook)) { $price_base_type = 'TTC'; } - $result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $price_base_type, $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise); + $result = $object->updateline(GETPOSTINT('lineid'), $description, $pu, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, $price_base_type, $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise); if ($result >= 0) { if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) { @@ -1323,7 +1323,7 @@ if (empty($reshook)) { header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // To re-display card in edit mode exit(); } elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) { - $idwarehouse = GETPOST('idwarehouse', 'int'); + $idwarehouse = GETPOSTINT('idwarehouse'); $qualified_for_stock_change = 0; if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { @@ -1359,14 +1359,14 @@ if (empty($reshook)) { ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; - $date = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int')); + $date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear')); $forceFields = array(); if (GETPOSTISSET('date_pointoftax')) { - $forceFields['date_pointoftax'] = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int')); + $forceFields['date_pointoftax'] = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear')); } - $deposit = Facture::createDepositFromOrigin($object, $date, GETPOST('cond_reglement_id', 'int'), $user, 0, GETPOST('validate_generated_deposit', 'alpha') == 'on', $forceFields); + $deposit = Facture::createDepositFromOrigin($object, $date, GETPOSTINT('cond_reglement_id'), $user, 0, GETPOSTINT('validate_generated_deposit') == 'on', $forceFields); if ($deposit) { setEventMessage('DepositGenerated'); @@ -1469,7 +1469,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); } } elseif ($action == 'confirm_cancel' && $confirm == 'yes' && $usercanvalidate) { - $idwarehouse = GETPOST('idwarehouse', 'int'); + $idwarehouse = GETPOSTINT('idwarehouse'); $qualified_for_stock_change = 0; if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { @@ -1633,7 +1633,7 @@ if (empty($reshook)) { } elseif ($action == 'swapstatut') { // bascule du statut d'un contact if ($object->id > 0) { - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } else { dol_print_error($db); } @@ -1956,7 +1956,7 @@ if ($action == 'create' && $usercancreate) { if (isModEnabled('expedition')) { print ''.$langs->trans('SendingMethod').''; print img_picto('', 'object_dolly', 'class="pictofixedwidth"'); - $form->selectShippingMethod(((GETPOSTISSET('shipping_method_id') && GETPOST('shipping_method_id', 'int') != 0) ? GETPOST('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); + $form->selectShippingMethod(((GETPOSTISSET('shipping_method_id') && GETPOSTINT('shipping_method_id') != 0) ? GETPOST('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); print ''; } @@ -2216,7 +2216,7 @@ if ($action == 'create' && $usercancreate) { // 'text' => $langs->trans("ConfirmClone"), // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1), // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1), - array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse', 'int') ? GETPOST('idwarehouse', 'int') : 'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) + array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOSTINT('idwarehouse') ? GETPOSTINT('idwarehouse') : 'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo)) ); } @@ -2428,7 +2428,7 @@ if ($action == 'create' && $usercancreate) { $filter = '(s.client:IN:1,2,3)'; // Create an array for form $formquestion = array( - array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', $filter, '', 0, 0, null, 0, 'maxwidth300')) + array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', $filter, '', 0, 0, null, 0, 'maxwidth300')) ); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index f031865993b..0df141b3c41 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; // Load translation files required by the page $langs->loadLangs(array('orders', 'sendings', 'companies', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); @@ -71,7 +71,7 @@ if (empty($reshook)) { $result = $object->fetch($id); if ($result > 0 && $id > 0) { - $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $contactid = (GETPOSTINT('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); } @@ -90,14 +90,14 @@ if (empty($reshook)) { } elseif ($action == 'swapstatut' && $user->hasRight('commande', 'creer')) { // Toggle the status of a contact if ($object->fetch($id)) { - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } else { dol_print_error($db); } } elseif ($action == 'deletecontact' && $user->hasRight('commande', 'creer')) { // Delete contact $object->fetch($id); - $result = $object->delete_contact(GETPOST("lineid", 'int')); + $result = $object->delete_contact(GETPOSTINT("lineid")); if ($result >= 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index 828722687d4..07086496213 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -46,10 +46,10 @@ if (!$user->hasRight('facture', 'creer')) { // Load translation files required by the page $langs->loadLangs(array("companies", "orders")); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 864375fbf5d..550ed05cc01 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -42,14 +42,14 @@ $langs->loadLangs(array('companies', 'other', 'bills', 'orders')); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 3d3bdc94425..0186d660953 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -50,7 +50,7 @@ $hookmanager->initHooks(array('ordersindex')); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $action = ''; $socid = $user->socid; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index de9e0bd9892..c9fa02304f5 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -56,29 +56,29 @@ $langs->loadLangs(array('orders', 'sendings', 'deliveries', 'companies', 'compta // Get Parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'orderlist'; $mode = GETPOST('mode', 'alpha'); // Search Parameters -$search_datecloture_start = GETPOST('search_datecloture_start', 'int'); +$search_datecloture_start = GETPOSTINT('search_datecloture_start'); if (empty($search_datecloture_start)) { - $search_datecloture_start = dol_mktime(0, 0, 0, GETPOST('search_datecloture_startmonth', 'int'), GETPOST('search_datecloture_startday', 'int'), GETPOST('search_datecloture_startyear', 'int')); + $search_datecloture_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datecloture_startmonth'), GETPOSTINT('search_datecloture_startday'), GETPOSTINT('search_datecloture_startyear')); } -$search_datecloture_end = GETPOST('search_datecloture_end', 'int'); +$search_datecloture_end = GETPOSTINT('search_datecloture_end'); if (empty($search_datecloture_end)) { - $search_datecloture_end = dol_mktime(23, 59, 59, GETPOST('search_datecloture_endmonth', 'int'), GETPOST('search_datecloture_endday', 'int'), GETPOST('search_datecloture_endyear', 'int')); + $search_datecloture_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datecloture_endmonth'), GETPOSTINT('search_datecloture_endday'), GETPOSTINT('search_datecloture_endyear')); } -$search_dateorder_start = dol_mktime(0, 0, 0, GETPOST('search_dateorder_start_month', 'int'), GETPOST('search_dateorder_start_day', 'int'), GETPOST('search_dateorder_start_year', 'int')); -$search_dateorder_end = dol_mktime(23, 59, 59, GETPOST('search_dateorder_end_month', 'int'), GETPOST('search_dateorder_end_day', 'int'), GETPOST('search_dateorder_end_year', 'int')); -$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_start_month', 'int'), GETPOST('search_datedelivery_start_day', 'int'), GETPOST('search_datedelivery_start_year', 'int')); -$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_end_month', 'int'), GETPOST('search_datedelivery_end_day', 'int'), GETPOST('search_datedelivery_end_year', 'int')); +$search_dateorder_start = dol_mktime(0, 0, 0, GETPOSTINT('search_dateorder_start_month'), GETPOSTINT('search_dateorder_start_day'), GETPOSTINT('search_dateorder_start_year')); +$search_dateorder_end = dol_mktime(23, 59, 59, GETPOSTINT('search_dateorder_end_month'), GETPOSTINT('search_dateorder_end_day'), GETPOSTINT('search_dateorder_end_year')); +$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datedelivery_start_month'), GETPOSTINT('search_datedelivery_start_day'), GETPOSTINT('search_datedelivery_start_year')); +$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datedelivery_end_month'), GETPOSTINT('search_datedelivery_end_day'), GETPOSTINT('search_datedelivery_end_year')); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -$search_product_category = GETPOST('search_product_category', 'int'); +$search_product_category = GETPOSTINT('search_product_category'); $search_ref = GETPOST('search_ref', 'alpha') != '' ? GETPOST('search_ref', 'alpha') : GETPOST('sref', 'alpha'); $search_ref_customer = GETPOST('search_ref_customer', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); @@ -87,14 +87,14 @@ $search_parent_name = trim(GETPOST('search_parent_name', 'alphanohtml')); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST('search_state', 'alpha'); -$search_country = GETPOST('search_country', 'int'); -$search_type_thirdparty = GETPOST('search_type_thirdparty', 'int'); -$search_user = GETPOST('search_user', 'int'); -$search_sale = GETPOST('search_sale', 'int'); +$search_country = GETPOSTINT('search_country'); +$search_type_thirdparty = GETPOSTINT('search_type_thirdparty'); +$search_user = GETPOSTINT('search_user'); +$search_sale = GETPOSTINT('search_sale'); $search_total_ht = GETPOST('search_total_ht', 'alpha'); $search_total_vat = GETPOST('search_total_vat', 'alpha'); $search_total_ttc = GETPOST('search_total_ttc', 'alpha'); -$search_warehouse = GETPOST('search_warehouse', 'int'); +$search_warehouse = GETPOSTINT('search_warehouse'); $search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha'); $search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha'); @@ -103,26 +103,26 @@ $search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', $search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha'); $search_login = GETPOST('search_login', 'alpha'); -$search_categ_cus = GETPOST("search_categ_cus", 'int'); +$search_categ_cus = GETPOSTINT("search_categ_cus"); $optioncss = GETPOST('optioncss', 'alpha'); -$search_billed = GETPOST('search_billed', 'int'); -$search_status = GETPOST('search_status', 'int'); +$search_billed = GETPOSTINT('search_billed'); +$search_status = GETPOSTINT('search_status'); $search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_project = GETPOST('search_project', 'alpha'); $search_shippable = GETPOST('search_shippable', 'aZ09'); -$search_fk_cond_reglement = GETPOST('search_fk_cond_reglement', 'int'); -$search_fk_shipping_method = GETPOST('search_fk_shipping_method', 'int'); -$search_fk_mode_reglement = GETPOST('search_fk_mode_reglement', 'int'); -$search_fk_input_reason = GETPOST('search_fk_input_reason', 'int'); +$search_fk_cond_reglement = GETPOSTINT('search_fk_cond_reglement'); +$search_fk_shipping_method = GETPOSTINT('search_fk_shipping_method'); +$search_fk_mode_reglement = GETPOSTINT('search_fk_mode_reglement'); +$search_fk_input_reason = GETPOSTINT('search_fk_input_reason'); $diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -228,7 +228,7 @@ if (!$user->hasRight('societe', 'client', 'voir')) { } // Security check -$id = (GETPOST('orderid') ? GETPOST('orderid', 'int') : GETPOST('id', 'int')); +$id = (GETPOST('orderid') ? GETPOSTINT('orderid') : GETPOSTINT('id')); if ($user->socid) { $socid = $user->socid; } @@ -333,8 +333,8 @@ if (empty($reshook)) { if ($massaction == 'confirm_createbills') { // Create bills from orders. $orders = GETPOST('toselect', 'array'); - $createbills_onebythird = GETPOST('createbills_onebythird', 'int'); - $validate_invoices = GETPOST('validate_invoices', 'int'); + $createbills_onebythird = GETPOSTINT('createbills_onebythird'); + $validate_invoices = GETPOSTINT('validate_invoices'); $errors = array(); @@ -376,7 +376,7 @@ if (empty($reshook)) { $objecttmp->ref_client = $cmd->ref_client; } - $datefacture = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $datefacture = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); if (empty($datefacture)) { $datefacture = dol_now(); } @@ -1512,7 +1512,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); -if (GETPOST('autoselectall', 'int')) { +if (GETPOSTINT('autoselectall')) { $selectedfields .= ''; } - if (!GETPOST('fac_rec', 'int')) { + if (!GETPOSTINT('fac_rec')) { print ' '; } print ''; @@ -3394,8 +3394,8 @@ if ($action == 'create') { } // Overwrite some values if creation of invoice is from a predefined invoice - if (empty($origin) && empty($originid) && GETPOST('fac_rec', 'int') > 0) { - $invoice_predefined->fetch(GETPOST('fac_rec', 'int')); + if (empty($origin) && empty($originid) && GETPOSTINT('fac_rec') > 0) { + $invoice_predefined->fetch(GETPOSTINT('fac_rec')); $dateinvoice = $invoice_predefined->date_when; // To use next gen date by default later if (empty($projectid)) { @@ -3431,9 +3431,9 @@ if ($action == 'create') { while ($i < $num) { $objp = $db->fetch_object($resql); print ''; $i++; @@ -3469,7 +3469,7 @@ if ($action == 'create') { // Standard invoice print '
'; - $tmp = ' '; + $tmp = ' '; $tmp = $tmp.''; $desc = $form->textwithpicto($tmp, $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3, 'standardonsmartphone'); print ''; @@ -3540,7 +3540,7 @@ if ($action == 'create') { 'variablealllines' => $langs->transnoentitiesnoconv('VarAmountAllLines') ); $typedeposit = GETPOST('typedeposit', 'aZ09'); - $valuedeposit = GETPOST('valuedeposit', 'int'); + $valuedeposit = GETPOSTINT('valuedeposit'); if (empty($typedeposit) && !empty($objectsrc->deposit_percent)) { $origin_payment_conditions_deposit_percent = getDictionaryValue('c_payment_term', 'deposit_percent', $objectsrc->cond_reglement_id); if (!empty($origin_payment_conditions_deposit_percent)) { @@ -3573,10 +3573,10 @@ if ($action == 'create') { print ''; // Next situation invoice - $opt = $form->selectSituationInvoices(GETPOST('originid', 'int'), $socid); + $opt = $form->selectSituationInvoices(GETPOSTINT('originid'), $socid); print '
'; - $tmp = ''.$langs->trans('NoSituations').'') || (GETPOST('origin') && GETPOST('origin') != 'facture' && GETPOST('origin') != 'commande')) { $tmp .= ' disabled'; } @@ -3606,7 +3606,7 @@ if ($action == 'create') { if (is_array($facids)) { foreach ($facids as $facparam) { $options .= '
'; print '
'; @@ -3828,8 +3828,8 @@ if ($action == 'create') { print ''; } - $newdateinvoice = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'), 'tzserver'); - $date_pointoftax = dol_mktime(0, 0, 0, GETPOST('date_pointoftaxmonth', 'int'), GETPOST('date_pointoftaxday', 'int'), GETPOST('date_pointoftaxyear', 'int'), 'tzserver'); + $newdateinvoice = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'), 'tzserver'); + $date_pointoftax = dol_mktime(0, 0, 0, GETPOSTINT('date_pointoftaxmonth'), GETPOSTINT('date_pointoftaxday'), GETPOSTINT('date_pointoftaxyear'), 'tzserver'); // Date invoice print ''; // Number diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php index fc1dbded732..16d1af4f562 100644 --- a/htdocs/compta/localtax/clients.php +++ b/htdocs/compta/localtax/clients.php @@ -34,10 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; // Load translation files required by the page $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin")); -$local = GETPOST('localTaxType', 'int'); +$local = GETPOSTINT('localTaxType'); // Date range -$year = GETPOST("year", "int"); +$year = GETPOSTINT("year"); if (empty($year)) { $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year_start = $year_current; @@ -93,14 +93,14 @@ if (empty($min)) { // 0=normal, 1=option vat for services is on debit, 2=option on payments for products $modetax = getDolGlobalString('TAX_MODE'); if (GETPOSTISSET("modetax")) { - $modetax = GETPOST("modetax", 'int'); + $modetax = GETPOSTINT("modetax"); } if (empty($modetax)) { $modetax = 0; } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php index caa5173a13c..0e6ffde780c 100644 --- a/htdocs/compta/localtax/index.php +++ b/htdocs/compta/localtax/index.php @@ -35,10 +35,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; // Load translation files required by the page $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin")); -$localTaxType = GETPOST('localTaxType', 'int'); +$localTaxType = GETPOSTINT('localTaxType'); // Date range -$year = GETPOST("year", "int"); +$year = GETPOSTINT("year"); if (empty($year)) { $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year_start = $year_current; @@ -49,11 +49,11 @@ if (empty($year)) { $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_startday"), GETPOST("date_startyear")); $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int"); + $q = GETPOSTINT("q"); if (empty($q)) { - if (GETPOST("month", "int")) { - $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); - $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); + if (GETPOSTINT("month")) { + $date_start = dol_get_first_day($year_start, GETPOSTINT("month"), false); + $date_end = dol_get_last_day($year_start, GETPOSTINT("month"), false); } else { $date_start = dol_get_first_day($year_start, $conf->global->SOCIETE_FISCAL_MONTH_START, false); $date_end = dol_time_plus_duree($date_start, 1, 'y') - 1; @@ -82,14 +82,14 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e // 0=normal, 1=option vat for services is on debit, 2=option on payments for products $modetax = getDolGlobalString('TAX_MODE'); if (GETPOSTISSET("modetax")) { - $modetax = GETPOST("modetax", 'int'); + $modetax = GETPOSTINT("modetax"); } if (empty($modetax)) { $modetax = 0; } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php index f7e1a6a5431..6b11de62daa 100644 --- a/htdocs/compta/localtax/list.php +++ b/htdocs/compta/localtax/list.php @@ -28,16 +28,16 @@ require_once DOL_DOCUMENT_ROOT.'/compta/localtax/class/localtax.class.php'; // Load translation files required by the page $langs->load("compta"); -$limit = GETPOST('limit', 'int'); +$limit = GETPOSTINT('limit'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } $result = restrictedArea($user, 'tax', '', '', 'charges'); -$ltt = GETPOST("localTaxType", 'int'); +$ltt = GETPOSTINT("localTaxType"); $mode = GETPOST('mode', 'alpha'); diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php index 6a508abb5f8..63df3750d22 100644 --- a/htdocs/compta/localtax/quadri_detail.php +++ b/htdocs/compta/localtax/quadri_detail.php @@ -45,9 +45,9 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class. // Load translation files required by the page $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "product", "trips", "admin")); -$local = GETPOST('localTaxType', 'int'); +$local = GETPOSTINT('localTaxType'); // Date range -$year = GETPOST("year", "int"); +$year = GETPOSTINT("year"); if (empty($year)) { $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $year_start = $year_current; @@ -59,11 +59,11 @@ $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_star $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear")); // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int"); + $q = GETPOSTINT("q"); if (empty($q)) { - if (GETPOST("month", "int")) { - $date_start = dol_get_first_day($year_start, GETPOST("month", "int"), false); - $date_end = dol_get_last_day($year_start, GETPOST("month", "int"), false); + if (GETPOSTINT("month")) { + $date_start = dol_get_first_day($year_start, GETPOSTINT("month"), false); + $date_end = dol_get_last_day($year_start, GETPOSTINT("month"), false); } else { $date_start = dol_get_first_day($year_start, !getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') ? 1 : $conf->global->SOCIETE_FISCAL_MONTH_START, false); if (!getDolGlobalString('MAIN_INFO_VAT_RETURN') || getDolGlobalInt('MAIN_INFO_VAT_RETURN') == 2) { @@ -105,14 +105,14 @@ if (empty($min)) { $calc = getDolGlobalString('MAIN_INFO_LOCALTAX_CALC').$local; $modetax = getDolGlobalInt('TAX_MODE'); if (GETPOSTISSET("modetax")) { - $modetax = GETPOST("modetax", 'int'); + $modetax = GETPOSTINT("modetax"); } if (empty($modetax)) { $modetax = 0; } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 8a066a3ba42..2a593eb6543 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -53,7 +53,7 @@ $socid = GETPOSTINT('socid'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); $amounts = array(); $amountsresttopay = array(); @@ -164,7 +164,7 @@ if (empty($reshook)) { } } - $formquestion[$i++] = array('type' => 'hidden', 'name' => $key, 'value' => GETPOST($key, 'int')); + $formquestion[$i++] = array('type' => 'hidden', 'name' => $key, 'value' => GETPOSTINT($key)); } } @@ -253,7 +253,7 @@ if (empty($reshook)) { if (isModEnabled("banque")) { // If the bank module is active, an account is required to input a payment - if (GETPOST('accountid', 'int') <= 0) { + if (GETPOSTINT('accountid') <= 0) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors'); $error++; } @@ -933,7 +933,7 @@ if (!GETPOST('action', 'aZ09')) { if (empty($page) || $page == -1) { $page = 0; } - $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; + $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; if (!$sortorder) { diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index 7252650d2e0..bfdd60e522f 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -43,13 +43,13 @@ if (isModEnabled('margin')) { // Load translation files required by the page $langs->loadLangs(array('bills', 'banks', 'companies')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($socid < 0) { $socid = 0; } @@ -218,7 +218,7 @@ if (empty($reshook)) { } if ($action == 'setdatep' && GETPOST('datepday') && $user->hasRight('facture', 'paiement')) { - $datepaye = dol_mktime(GETPOST('datephour', 'int'), GETPOST('datepmin', 'int'), GETPOST('datepsec', 'int'), GETPOST('datepmonth', 'int'), GETPOST('datepday', 'int'), GETPOST('datepyear', 'int')); + $datepaye = dol_mktime(GETPOSTINT('datephour'), GETPOSTINT('datepmin'), GETPOSTINT('datepsec'), GETPOSTINT('datepmonth'), GETPOSTINT('datepday'), GETPOSTINT('datepyear')); $res = $object->update_date($datepaye); if ($res === 0) { setEventMessages($langs->trans('PaymentDateUpdateSucceeded'), null, 'mesgs'); @@ -237,7 +237,7 @@ if (empty($reshook)) { $label = '(CustomerInvoicePaymentBack)'; // Refund of a credit note } - $bankaccountid = GETPOST('accountid', 'int'); + $bankaccountid = GETPOSTINT('accountid'); if ($bankaccountid > 0) { $object->paiementcode = $object->type_code; $object->amounts = $object->getAmountsArray(); diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php index 898320fdb1c..b2dcd4f0bc5 100644 --- a/htdocs/compta/paiement/cheque/card.php +++ b/htdocs/compta/paiement/cheque/card.php @@ -51,7 +51,7 @@ $object = new RemiseCheque($db); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "ASC"; } @@ -61,21 +61,21 @@ if (!$sortfield) { if (empty($page) || $page == -1) { $page = 0; } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $offset = $limit * $page; $upload_dir = $conf->bank->multidir_output[$object->entity ? $object->entity : $conf->entity]."/checkdeposits"; // filter by dates from / to -$search_date_start_day = GETPOST('search_date_start_day', 'int'); -$search_date_start_month = GETPOST('search_date_start_month', 'int'); -$search_date_start_year = GETPOST('search_date_start_year', 'int'); -$search_date_end_day = GETPOST('search_date_end_day', 'int'); -$search_date_end_month = GETPOST('search_date_end_month', 'int'); -$search_date_end_year = GETPOST('search_date_end_year', 'int'); +$search_date_start_day = GETPOSTINT('search_date_start_day'); +$search_date_start_month = GETPOSTINT('search_date_start_month'); +$search_date_start_year = GETPOSTINT('search_date_start_year'); +$search_date_end_day = GETPOSTINT('search_date_end_day'); +$search_date_end_month = GETPOSTINT('search_date_end_month'); +$search_date_end_year = GETPOSTINT('search_date_end_year'); $search_date_start = dol_mktime(0, 0, 0, $search_date_start_month, $search_date_start_day, $search_date_start_year); $search_date_end = dol_mktime(23, 59, 59, $search_date_end_month, $search_date_end_day, $search_date_end_year); -$filteraccountid = GETPOST('accountid', 'int'); +$filteraccountid = GETPOSTINT('accountid'); // Security check $fieldname = (!empty($ref) ? 'ref' : 'rowid'); @@ -100,9 +100,9 @@ $arrayofpaymentmodetomanage = explode(',', getDolGlobalString('BANK_PAYMENT_MODE */ if ($action == 'setdate' && $user->hasRight('banque', 'cheque')) { - $result = $object->fetch(GETPOST('id', 'int')); + $result = $object->fetch(GETPOSTINT('id')); if ($result > 0) { - $date = dol_mktime(0, 0, 0, GETPOST('datecreate_month', 'int'), GETPOST('datecreate_day', 'int'), GETPOST('datecreate_year', 'int')); + $date = dol_mktime(0, 0, 0, GETPOSTINT('datecreate_month'), GETPOSTINT('datecreate_day'), GETPOSTINT('datecreate_year')); $result = $object->set_date($user, $date); if ($result < 0) { @@ -114,7 +114,7 @@ if ($action == 'setdate' && $user->hasRight('banque', 'cheque')) { } if ($action == 'setrefext' && $user->hasRight('banque', 'cheque')) { - $result = $object->fetch(GETPOST('id', 'int')); + $result = $object->fetch(GETPOSTINT('id')); if ($result > 0) { $ref_ext = GETPOST('ref_ext'); @@ -128,7 +128,7 @@ if ($action == 'setrefext' && $user->hasRight('banque', 'cheque')) { } if ($action == 'setref' && $user->hasRight('banque', 'cheque')) { - $result = $object->fetch(GETPOST('id', 'int')); + $result = $object->fetch(GETPOSTINT('id')); if ($result > 0) { $ref = GETPOST('ref'); @@ -141,12 +141,12 @@ if ($action == 'setref' && $user->hasRight('banque', 'cheque')) { } } -if ($action == 'create' && GETPOST("accountid", "int") > 0 && $user->hasRight('banque', 'cheque')) { +if ($action == 'create' && GETPOSTINT("accountid") > 0 && $user->hasRight('banque', 'cheque')) { if (GETPOSTISARRAY('toRemise')) { $object->type = $type; $arrayofid = GETPOST('toRemise', 'array:int'); - $result = $object->create($user, GETPOST("accountid", "int"), 0, $arrayofid); + $result = $object->create($user, GETPOSTINT("accountid"), 0, $arrayofid); if ($result > 0) { if ($object->statut == 1) { // If statut is validated, we build doc $object->fetch($object->id); // To force to reload all properties in correct property name @@ -175,9 +175,9 @@ if ($action == 'create' && GETPOST("accountid", "int") > 0 && $user->hasRight('b } } -if ($action == 'remove' && $id > 0 && GETPOST("lineid", 'int') > 0 && $user->hasRight('banque', 'cheque')) { +if ($action == 'remove' && $id > 0 && GETPOSTINT("lineid") > 0 && $user->hasRight('banque', 'cheque')) { $object->id = $id; - $result = $object->removeCheck(GETPOST("lineid", "int")); + $result = $object->removeCheck(GETPOSTINT("lineid")); if ($result === 0) { header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; @@ -223,7 +223,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->hasRight('banqu if ($action == 'confirm_reject_check' && $confirm == 'yes' && $user->hasRight('banque', 'cheque')) { $reject_date = dol_mktime(0, 0, 0, GETPOST('rejectdate_month'), GETPOST('rejectdate_day'), GETPOST('rejectdate_year')); - $rejected_check = GETPOST('bankid', 'int'); + $rejected_check = GETPOSTINT('bankid'); $object->fetch($id); $paiement_id = $object->rejectCheck($rejected_check, $reject_date); @@ -362,7 +362,7 @@ if ($action == 'new') { */ if ($action == 'reject_check') { $formquestion = array( - array('type' => 'hidden', 'name' => 'bankid', 'value' => GETPOST('lineid', 'int')), + array('type' => 'hidden', 'name' => 'bankid', 'value' => GETPOSTINT('lineid')), array('type' => 'date', 'name' => 'rejectdate_', 'label' => $langs->trans("RejectCheckDate"), 'value' => dol_now()) ); print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("RejectCheck"), $langs->trans("ConfirmRejectCheck"), 'confirm_reject_check', $formquestion, '', 1); diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 8aa74f5fe2a..3d7129afbcd 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -42,22 +42,22 @@ if ($user->socid) { $result = restrictedArea($user, 'banque', '', ''); $search_ref = GETPOST('search_ref', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_account = GETPOST('search_account', 'int'); +$search_account = GETPOSTINT('search_account'); $search_amount = GETPOST('search_amount', 'alpha'); $mode = GETPOST('mode', 'alpha'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/paiement/info.php b/htdocs/compta/paiement/info.php index 1cbee7a50cb..424a960061e 100644 --- a/htdocs/compta/paiement/info.php +++ b/htdocs/compta/paiement/info.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; // Load translation files required by the page $langs->loadLangs(array('bills', 'companies')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 693f6c8de39..bbded249fb9 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -47,32 +47,32 @@ $confirm = GETPOST('confirm', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'paymentlist'; -$facid = GETPOST('facid', 'int'); -$socid = GETPOST('socid', 'int'); -$userid = GETPOST('userid', 'int'); +$facid = GETPOSTINT('facid'); +$socid = GETPOSTINT('socid'); +$userid = GETPOSTINT('userid'); $search_ref = GETPOST("search_ref", "alpha"); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $search_company = GETPOST("search_company", 'alpha'); $search_paymenttype = GETPOST("search_paymenttype"); -$search_account = GETPOST("search_account", "int"); +$search_account = GETPOSTINT("search_account"); $search_payment_num = GETPOST('search_payment_num', 'alpha'); $search_amount = GETPOST("search_amount", 'alpha'); // alpha because we must be able to search on "< x" $search_status = GETPOST('search_status', 'intcomma'); -$search_sale = GETPOST('search_sale', 'int'); +$search_sale = GETPOSTINT('search_sale'); $mode = GETPOST('mode', 'alpha'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php index 9685b6821c2..52c5bfb27fe 100644 --- a/htdocs/compta/paiement/rapport.php +++ b/htdocs/compta/paiement/rapport.php @@ -44,7 +44,7 @@ if (!$user->hasRight('societe', 'client', 'voir')) { $dir .= '/private/'.$user->id; // If user has no permission to see all, output dir is specific to user } -$year = GETPOST('year', 'int'); +$year = GETPOSTINT('year'); if (!$year) { $year = date("Y"); } @@ -71,14 +71,14 @@ if ($action == 'builddoc') { // We save charset_output to restore it because write_file can change it if needed for // output format that does not support UTF8. $sav_charset_output = $outputlangs->charset_output; - if ($rap->write_file($dir, GETPOST("remonth", "int"), GETPOST("reyear", "int"), $outputlangs) > 0) { + if ($rap->write_file($dir, GETPOSTINT("remonth"), GETPOSTINT("reyear"), $outputlangs) > 0) { $outputlangs->charset_output = $sav_charset_output; } else { $outputlangs->charset_output = $sav_charset_output; dol_print_error($db, $obj->error); } - $year = GETPOST("reyear", "int"); + $year = GETPOSTINT("reyear"); } diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php index 5caada7cd7e..8735b7c0ebd 100644 --- a/htdocs/compta/paiement/tovalidate.php +++ b/htdocs/compta/paiement/tovalidate.php @@ -35,10 +35,10 @@ if ($user->socid > 0) { } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index c61dbcf3084..dce1a7f5d83 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -60,7 +60,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y exit; } - $datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", "int"), GETPOST("reday", "int"), GETPOST("reyear", "int")); + $datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); if (!(GETPOST("paiementtype") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")), null, 'errors'); @@ -118,7 +118,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y } if (!$error) { - $result = $paiement->addPaymentToBank($user, 'payment_sc', '(SocialContributionPayment)', GETPOST('accountid', 'int'), '', ''); + $result = $paiement->addPaymentToBank($user, 'payment_sc', '(SocialContributionPayment)', GETPOSTINT('accountid'), '', ''); if (!($result > 0)) { $error++; setEventMessages($paiement->error, null, 'errors'); @@ -202,7 +202,7 @@ if ($action == 'create') { print '';*/ print '"; @@ -218,7 +218,7 @@ if ($action == 'create') { print ''; print ''; // Number diff --git a/htdocs/compta/paiement_vat.php b/htdocs/compta/paiement_vat.php index 3cac781c50e..30fb1768dc7 100644 --- a/htdocs/compta/paiement_vat.php +++ b/htdocs/compta/paiement_vat.php @@ -58,9 +58,9 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y exit; } - $datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); + $datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); - if (!(GETPOST("paiementtype", 'int') > 0)) { + if (!(GETPOSTINT("paiementtype") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")), null, 'errors'); $error++; $action = 'create'; @@ -70,7 +70,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y $error++; $action = 'create'; } - if (isModEnabled("banque") && !(GETPOST("accountid", 'int') > 0)) { + if (isModEnabled("banque") && !(GETPOSTINT("accountid") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToDebit")), null, 'errors'); $error++; $action = 'create'; @@ -116,7 +116,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y } if (!$error) { - $result = $paiement->addPaymentToBank($user, 'payment_vat', '(VATPayment)', GETPOST('accountid', 'int'), '', ''); + $result = $paiement->addPaymentToBank($user, 'payment_vat', '(VATPayment)', GETPOSTINT('accountid'), '', ''); if (!($result > 0)) { $error++; setEventMessages($paiement->error, null, 'errors'); @@ -201,14 +201,14 @@ if ($action == 'create') { print '';*/ print '"; print ''; print '\n"; print ''; @@ -216,7 +216,7 @@ if ($action == 'create') { print ''; print ''; // Number diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index fe6eb04fcde..7e6303486d0 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -40,7 +40,7 @@ if (isModEnabled("banque")) { $langs->loadLangs(array('bills', 'banks', 'companies')); // Security check -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'aZ09'); if ($user->socid) { diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index 12650cb0122..f27bec0c8b6 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -40,7 +40,7 @@ if (isModEnabled("banque")) { $langs->loadLangs(array('bills', 'banks', 'companies')); // Security check -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); if ($user->socid) { diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php index 5f808e03e2e..8848d70c325 100644 --- a/htdocs/compta/paymentbybanktransfer/index.php +++ b/htdocs/compta/paymentbybanktransfer/index.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; $langs->loadLangs(array('banks', 'categories', 'withdrawals')); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index e9cf5f7dfa8..508c05c777f 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -38,17 +38,17 @@ $langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawal // Get supervariables $action = GETPOST('action', 'aZ09'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $type = GETPOST('type', 'aZ09'); -$date_trans = dol_mktime(GETPOST('date_transhour', 'int'), GETPOST('date_transmin', 'int'), GETPOST('date_transsec', 'int'), GETPOST('date_transmonth', 'int'), GETPOST('date_transday', 'int'), GETPOST('date_transyear', 'int')); +$date_trans = dol_mktime(GETPOSTINT('date_transhour'), GETPOSTINT('date_transmin'), GETPOSTINT('date_transsec'), GETPOSTINT('date_transmonth'), GETPOSTINT('date_transday'), GETPOSTINT('date_transyear')); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -104,7 +104,7 @@ if ($reshook < 0) { if (empty($reshook)) { if ($action == 'setbankaccount' && $permissiontoadd) { $object->oldcopy = dol_clone($object, 2); - $object->fk_bank_account = GETPOST('fk_bank_account', 'int'); + $object->fk_bank_account = GETPOSTINT('fk_bank_account'); $object->update($user); } @@ -119,7 +119,7 @@ if (empty($reshook)) { if ($action == 'infotrans' && $permissiontosend) { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; - $dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $dt = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); /* if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $object->ref) @@ -150,7 +150,7 @@ if (empty($reshook)) { // Set direct debit order to credited, create payment and close invoices if ($action == 'setinfocredit' && $permissiontocreditdebit) { - $dt = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + $dt = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); if (($object->type != 'bank-transfer' && $object->statut == BonPrelevement::STATUS_CREDITED) || ($object->type == 'bank-transfer' && $object->statut == BonPrelevement::STATUS_DEBITED)) { $error = 1; diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index f9cbe577064..1e44e0d7088 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -51,11 +51,11 @@ $mode = GETPOST('mode', 'alpha') ? GETPOST('mode', 'alpha') : 'real'; $type = GETPOST('type', 'aZ09'); $sourcetype = GETPOST('sourcetype', 'aZ09'); $format = GETPOST('format', 'aZ09'); -$id_bankaccount = GETPOST('id_bankaccount', 'int'); -$executiondate = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); +$id_bankaccount = GETPOSTINT('id_bankaccount'); +$executiondate = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -64,7 +64,7 @@ $offset = $limit * $page; $hookmanager->initHooks(array('directdebitcreatecard', 'globalcard')); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } @@ -218,7 +218,7 @@ $arrayofselected = is_array($toselect) ? $toselect : array(); // List of mass actions available $arrayofmassactions = array( ); -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index a072d5774da..50177879826 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -37,8 +37,8 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies')); // Security check -$socid = GETPOST('socid', 'int'); -$status = GETPOST('status', 'int'); +$socid = GETPOSTINT('socid'); +$status = GETPOSTINT('status'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlist'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page @@ -51,10 +51,10 @@ $search_facture = GETPOST('search_facture', 'alpha'); $search_societe = GETPOST('search_societe', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 157188d326f..358d5c9fff6 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -38,17 +38,17 @@ require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php'; $langs->loadLangs(array('banks', 'categories', 'bills', 'companies', 'withdrawals', 'salaries', 'suppliers')); // Get supervariables -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); -$userid = GETPOST('userid', 'int'); +$socid = GETPOSTINT('socid'); +$userid = GETPOSTINT('userid'); $type = GETPOST('type', 'aZ09'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 28992168195..fe3334fcfb9 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -45,16 +45,16 @@ if ($user->socid > 0) { } // Get supervariables -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $type = GETPOST('type', 'aZ09'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/prelevement/fiche-stat.php b/htdocs/compta/prelevement/fiche-stat.php index dee3198493b..370a9a21ddc 100644 --- a/htdocs/compta/prelevement/fiche-stat.php +++ b/htdocs/compta/prelevement/fiche-stat.php @@ -35,16 +35,16 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->loadLangs(array("banks", "categories", 'withdrawals', 'bills')); // Get supervariables -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $type = GETPOST('type', 'aZ09'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php index 341b378cc05..b8c75847372 100644 --- a/htdocs/compta/prelevement/index.php +++ b/htdocs/compta/prelevement/index.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->loadLangs(array('banks', 'categories', 'withdrawals')); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/prelevement/line.php b/htdocs/compta/prelevement/line.php index 340e0cde34e..ff5bdf390b3 100644 --- a/htdocs/compta/prelevement/line.php +++ b/htdocs/compta/prelevement/line.php @@ -38,15 +38,15 @@ $langs->loadlangs(array('banks', 'categories', 'bills', 'companies', 'withdrawal // Get supervariables $action = GETPOST('action', 'aZ09'); -$id = GETPOST('id', 'int'); -$socid = GETPOST('socid', 'int'); +$id = GETPOSTINT('id'); +$socid = GETPOSTINT('socid'); $type = GETPOST('type', 'aZ09'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortorder = GETPOST('sortorder', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -84,8 +84,8 @@ $error = 0; if ($action == 'confirm_rejet' && $permissiontoadd) { if (GETPOST("confirm") == 'yes') { - if (GETPOST('remonth', 'int')) { - $daterej = dol_mktime(0, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); + if (GETPOSTINT('remonth')) { + $daterej = dol_mktime(0, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear')); } if (empty($daterej)) { @@ -108,7 +108,7 @@ if ($action == 'confirm_rejet' && $permissiontoadd) { if ($lipre->fetch($id) == 0) { $rej = new RejetPrelevement($db, $user, $type); - $result = $rej->create($user, $id, GETPOST('motif', 'alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer', 'int')); + $result = $rej->create($user, $id, GETPOSTINT('motif'), $daterej, $lipre->bon_rowid, GETPOSTINT('facturer')); if ($result > 0) { header("Location: line.php?id=".urlencode($id).'&type='.urlencode($type)); @@ -239,7 +239,7 @@ if ($id) { //Reason print ''; print ''; //Facturer @@ -247,7 +247,7 @@ if ($id) { print $form->textwithpicto($langs->trans("RefusedInvoicing"), $langs->trans("DirectDebitRefusedInvoicingDesc")); print ''; print ''; print '
'.$langs->trans('DateInvoice').''; @@ -3854,11 +3854,11 @@ if ($action == 'create') { if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')) { $rwStyle = 'display:none;'; - if (in_array(GETPOST('type', 'int'), $retainedWarrantyInvoiceAvailableType)) { + if (in_array(GETPOSTINT('type'), $retainedWarrantyInvoiceAvailableType)) { $rwStyle = ''; } - $retained_warranty = GETPOST('retained_warranty', 'int'); + $retained_warranty = GETPOSTINT('retained_warranty'); if (empty($retained_warranty)) { if (!empty($objectsrc->retained_warranty)) { // use previous situation value $retained_warranty = $objectsrc->retained_warranty; @@ -3871,7 +3871,7 @@ if ($action == 'create') { // Retained warranty payment term print '
'.$langs->trans('PaymentConditionsShortRetainedWarranty').''; - $retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); + $retained_warranty_fk_cond_reglement = GETPOSTINT('retained_warranty_fk_cond_reglement'); if (empty($retained_warranty_fk_cond_reglement)) { $retained_warranty_fk_cond_reglement = getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID'); if (!empty($objectsrc->retained_warranty_fk_cond_reglement)) { // use previous situation value @@ -3986,7 +3986,7 @@ if ($action == 'create') { // Help of substitution key $htmltext = ''; - if (GETPOST('fac_rec', 'int') > 0) { + if (GETPOSTINT('fac_rec') > 0) { $dateexample = ($newdateinvoice ? $newdateinvoice : $dateinvoice); if (empty($dateexample)) { $dateexample = dol_now(); @@ -4910,7 +4910,7 @@ if ($action == 'create') { print ''; print ''; print ''; - $retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); + $retained_warranty_fk_cond_reglement = GETPOSTINT('retained_warranty_fk_cond_reglement'); $retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : $object->retained_warranty_fk_cond_reglement; $retained_warranty_fk_cond_reglement = !empty($retained_warranty_fk_cond_reglement) ? $retained_warranty_fk_cond_reglement : getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID'); print $form->getSelectConditionsPaiements($retained_warranty_fk_cond_reglement, 'retained_warranty_fk_cond_reglement', -1, 1); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 76941f3ee16..12bbd6fa5f0 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -538,12 +538,12 @@ class Facture extends CommonInvoice // Fields coming from GUI. // @TODO Value of template should be used as default value on the form on the GUI, and we should here always use the value from GUI // set by posted page with $object->xxx = ... and this section should be removed. - $this->fk_project = GETPOST('projectid', 'int') > 0 ? GETPOSTINT('projectid') : $_facrec->fk_project; + $this->fk_project = GETPOSTINT('projectid') > 0 ? GETPOSTINT('projectid') : $_facrec->fk_project; $this->note_public = GETPOSTISSET('note_public') ? GETPOST('note_public', 'restricthtml') : $_facrec->note_public; $this->note_private = GETPOSTISSET('note_private') ? GETPOST('note_private', 'restricthtml') : $_facrec->note_private; $this->model_pdf = GETPOSTISSET('model') ? GETPOST('model', 'alpha') : $_facrec->model_pdf; - $this->cond_reglement_id = GETPOST('cond_reglement_id', 'int') > 0 ? GETPOSTINT('cond_reglement_id') : $_facrec->cond_reglement_id; - $this->mode_reglement_id = GETPOST('mode_reglement_id', 'int') > 0 ? GETPOSTINT('mode_reglement_id') : $_facrec->mode_reglement_id; + $this->cond_reglement_id = GETPOSTINT('cond_reglement_id') > 0 ? GETPOSTINT('cond_reglement_id') : $_facrec->cond_reglement_id; + $this->mode_reglement_id = GETPOSTINT('mode_reglement_id') > 0 ? GETPOSTINT('mode_reglement_id') : $_facrec->mode_reglement_id; $this->fk_account = GETPOST('fk_account') > 0 ? GETPOSTINT('fk_account') : $_facrec->fk_account; // Set here to have this defined for substitution into notes, should be recalculated after adding lines to get same result diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index 616a365e879..a6bb2603558 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -40,10 +40,10 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('bills', 'companies')); -$id = (GETPOST('id') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOST('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$lineid = GETPOST('lineid', 'int'); -$socid = GETPOST('socid', 'int'); +$lineid = GETPOSTINT('lineid'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); // Security check @@ -77,7 +77,7 @@ if (empty($reshook)) { // Add new contact if ($action == 'addcontact' && $user->hasRight('facture', 'creer')) { if ($result > 0 && $id > 0) { - $contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $contactid = (GETPOST('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid')); $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); $result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); } @@ -95,7 +95,7 @@ if (empty($reshook)) { } } elseif ($action == 'swapstatut' && $user->hasRight('facture', 'creer')) { // Toggle the status of a contact - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } elseif ($action == 'deletecontact' && $user->hasRight('facture', 'creer')) { // Delete contact $result = $object->delete_contact($lineid); diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index a687998b04a..44519923cbe 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -43,17 +43,17 @@ if (isModEnabled('project')) { $langs->loadLangs(array('propal', 'compta', 'other', 'bills', 'companies')); -$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/facture/index.php b/htdocs/compta/facture/index.php index fe614a7d2dc..ea2543aeb90 100644 --- a/htdocs/compta/facture/index.php +++ b/htdocs/compta/facture/index.php @@ -35,7 +35,7 @@ restrictedArea($user, 'facture'); $langs->load('bills'); // Filter to show only result of one customer -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if (isset($user->socid) && $user->socid > 0) { $action = ''; $socid = $user->socid; diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 95b739eb5a7..13052314892 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -47,7 +47,7 @@ $langs->loadLangs(array('companies', 'bills', 'compta', 'admin', 'other')); $action = GETPOST('action', 'alpha'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $toselect = GETPOST('toselect', 'array'); @@ -55,10 +55,10 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'in $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); -$id = (GETPOST('facid', 'int') ? GETPOST('facid', 'int') : GETPOST('id', 'int')); -$lineid = GETPOST('lineid', 'int'); +$id = (GETPOSTINT('facid') ? GETPOSTINT('facid') : GETPOSTINT('id')); +$lineid = GETPOSTINT('lineid'); $ref = GETPOST('ref', 'alpha'); if ($user->socid) { $socid = $user->socid; @@ -75,32 +75,32 @@ $search_montant_vat = GETPOST('search_montant_vat'); $search_montant_ttc = GETPOST('search_montant_ttc'); $search_payment_mode = GETPOST('search_payment_mode'); $search_payment_term = GETPOST('search_payment_term'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_date_when_startday = GETPOST('search_date_when_startday', 'int'); -$search_date_when_startmonth = GETPOST('search_date_when_startmonth', 'int'); -$search_date_when_startyear = GETPOST('search_date_when_startyear', 'int'); -$search_date_when_endday = GETPOST('search_date_when_endday', 'int'); -$search_date_when_endmonth = GETPOST('search_date_when_endmonth', 'int'); -$search_date_when_endyear = GETPOST('search_date_when_endyear', 'int'); +$search_date_when_startday = GETPOSTINT('search_date_when_startday'); +$search_date_when_startmonth = GETPOSTINT('search_date_when_startmonth'); +$search_date_when_startyear = GETPOSTINT('search_date_when_startyear'); +$search_date_when_endday = GETPOSTINT('search_date_when_endday'); +$search_date_when_endmonth = GETPOSTINT('search_date_when_endmonth'); +$search_date_when_endyear = GETPOSTINT('search_date_when_endyear'); $search_date_when_start = dol_mktime(0, 0, 0, $search_date_when_startmonth, $search_date_when_startday, $search_date_when_startyear); // Use tzserver $search_date_when_end = dol_mktime(23, 59, 59, $search_date_when_endmonth, $search_date_when_endday, $search_date_when_endyear); -$search_recurring = GETPOST('search_recurring', 'int'); +$search_recurring = GETPOSTINT('search_recurring'); $search_frequency = GETPOST('search_frequency', 'alpha'); $search_unit_frequency = GETPOST('search_unit_frequency', 'alpha'); $search_nb_gen_done = GETPOST('search_nb_gen_done', 'alpha'); -$search_status = GETPOST('search_status', 'int'); +$search_status = GETPOSTINT('search_status'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 391b9bb084d..d728541b8d9 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -64,15 +64,15 @@ if (isModEnabled('commande')) { $langs->loadLangs(array('bills', 'companies', 'products', 'categories')); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -$projectid = (GETPOST('projectid') ? GETPOST('projectid', 'int') : 0); +$projectid = (GETPOST('projectid') ? GETPOSTINT('projectid') : 0); -$id = (GETPOST('id', 'int') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); $socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $optioncss = GETPOST('optioncss', 'alpha'); @@ -87,8 +87,8 @@ $lineid = GETPOSTINT('lineid'); $userid = GETPOSTINT('userid'); $search_ref = GETPOST('sf_ref') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_refcustomer = GETPOST('search_refcustomer', 'alpha'); -$search_type = GETPOST('search_type', 'int'); -$search_subtype = GETPOST('search_subtype', 'int'); +$search_type = GETPOSTINT('search_type'); +$search_subtype = GETPOSTINT('search_subtype'); $search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_project = GETPOST('search_project', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); @@ -106,8 +106,8 @@ $search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'a $search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha'); $search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha'); $search_status = GETPOST('search_status', 'intcomma'); -$search_paymentmode = GETPOST('search_paymentmode', 'int'); -$search_paymentterms = GETPOST('search_paymentterms', 'int'); +$search_paymentmode = GETPOSTINT('search_paymentmode'); +$search_paymentterms = GETPOSTINT('search_paymentterms'); $search_module_source = GETPOST('search_module_source', 'alpha'); $search_pos_source = GETPOST('search_pos_source', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); @@ -115,9 +115,9 @@ $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST("search_state"); $search_country = GETPOST("search_country", 'alpha'); $search_customer_code = GETPOST("search_customer_code", 'alphanohtml'); -$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); -$search_user = GETPOST('search_user', 'int'); -$search_sale = GETPOST('search_sale', 'int'); +$search_type_thirdparty = GETPOSTINT("search_type_thirdparty"); +$search_user = GETPOSTINT('search_user'); +$search_sale = GETPOSTINT('search_sale'); $search_date_startday = GETPOSTINT('search_date_startday'); $search_date_startmonth = GETPOSTINT('search_date_startmonth'); $search_date_startyear = GETPOSTINT('search_date_startyear'); @@ -142,8 +142,8 @@ $search_datelimit_endmonth = GETPOSTINT('search_datelimit_endmonth'); $search_datelimit_endyear = GETPOSTINT('search_datelimit_endyear'); $search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear); $search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear); -$search_categ_cus = GETPOST("search_categ_cus", 'int'); -$search_product_category = GETPOST('search_product_category', 'int'); +$search_categ_cus = GETPOSTINT("search_categ_cus"); +$search_product_category = GETPOSTINT('search_product_category'); $search_fac_rec_source_title = GETPOST("search_fac_rec_source_title", 'alpha'); $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); @@ -157,7 +157,7 @@ $filtre = GETPOST('filtre', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php index 226984ec5f4..7c93f507ff9 100644 --- a/htdocs/compta/facture/note.php +++ b/htdocs/compta/facture/note.php @@ -37,9 +37,9 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('companies', 'bills')); -$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $object = new Facture($db); diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 9942b002a73..e79cc953f3a 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -42,9 +42,9 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // Load translation files required by the page $langs->loadLangs(array('bills', 'banks', 'withdrawals', 'companies')); -$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility +$id = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility $ref = GETPOST('ref', 'alpha'); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); $action = GETPOST('action', 'aZ09'); $type = GETPOST('type', 'aZ09'); @@ -130,7 +130,7 @@ if (empty($reshook)) { if ($action == "delete" && $usercancreate) { if ($object->id > 0) { - $result = $object->demande_prelevement_delete($user, GETPOST('did', 'int')); + $result = $object->demande_prelevement_delete($user, GETPOSTINT('did')); if ($result == 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id.'&type='.$type); exit; @@ -140,7 +140,7 @@ if (empty($reshook)) { // Make payment with Direct Debit Stripe if ($action == 'sepastripedirectdebit' && $usercancreate) { - $result = $object->makeStripeSepaRequest($user, GETPOST('did', 'int'), 'direct-debit', 'facture'); + $result = $object->makeStripeSepaRequest($user, GETPOSTINT('did'), 'direct-debit', 'facture'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -155,7 +155,7 @@ if (empty($reshook)) { // Make payment with Direct Debit Stripe if ($action == 'sepastripecredittransfer' && $usercancreate) { - $result = $object->makeStripeSepaRequest($user, GETPOST('did', 'int'), 'bank-transfer', 'supplier_invoice'); + $result = $object->makeStripeSepaRequest($user, GETPOSTINT('did'), 'bank-transfer', 'supplier_invoice'); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { @@ -179,7 +179,7 @@ if (empty($reshook)) { $db->begin(); if (!$error) { - $result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int')); + $result = $object->setPaymentTerms(GETPOSTINT('cond_reglement_id')); if ($result < 0) { $error++; setEventMessages($object->error, $object->errors, 'errors'); @@ -209,9 +209,9 @@ if (empty($reshook)) { } } elseif ($action == 'setmode' && $usercancreate) { // payment mode - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + $result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id')); } elseif ($action == 'setdatef' && $usercancreate) { - $newdate = dol_mktime(0, 0, 0, GETPOST('datefmonth', 'int'), GETPOST('datefday', 'int'), GETPOST('datefyear', 'int'), 'tzserver'); + $newdate = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'), 'tzserver'); if ($newdate > (dol_now('tzuserrel') + (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY') ? 0 : $conf->global->INVOICE_MAX_FUTURE_DELAY))) { if (!getDolGlobalString('INVOICE_MAX_FUTURE_DELAY')) { setEventMessages($langs->trans("WarningInvoiceDateInFuture"), null, 'warnings'); @@ -234,7 +234,7 @@ if (empty($reshook)) { dol_print_error($db, $object->error); } } elseif ($action == 'setdate_lim_reglement' && $usercancreate) { - $object->date_echeance = dol_mktime(12, 0, 0, GETPOST('date_lim_reglementmonth', 'int'), GETPOST('date_lim_reglementday', 'int'), GETPOST('date_lim_reglementyear', 'int')); + $object->date_echeance = dol_mktime(12, 0, 0, GETPOSTINT('date_lim_reglementmonth'), GETPOSTINT('date_lim_reglementday'), GETPOSTINT('date_lim_reglementyear')); if (!empty($object->date_echeance) && $object->date_echeance < $object->date) { $object->date_echeance = $object->date; setEventMessages($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"), null, 'warnings'); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index f98216140f9..8e5ca60137a 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -55,8 +55,8 @@ $object_status = GETPOST('object_status', 'intcomma'); $typent_id = GETPOSTINT('typent_id'); $categ_id = GETPOSTINT('categ_id'); -$userid = GETPOST('userid', 'int'); -$socid = GETPOST('socid', 'int'); +$userid = GETPOSTINT('userid'); +$socid = GETPOSTINT('socid'); $custcats = GETPOST('custcats', 'array'); // Security check if ($user->socid > 0) { @@ -65,7 +65,7 @@ if ($user->socid > 0) { } $nowyear = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); -$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear; +$year = GETPOST('year') > 0 ? GETPOSTINT('year') : $nowyear; $startyear = $year - (!getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS') ? 2 : max(1, min(10, getDolGlobalString('MAIN_STATS_GRAPHS_SHOW_N_YEARS')))); $endyear = $year; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index e5e49696f0f..c280a92183e 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -56,7 +56,7 @@ if (isModEnabled('commande')) { // Get parameters $action = GETPOST('action', 'aZ09'); -$bid = GETPOST('bid', 'int'); +$bid = GETPOSTINT('bid'); // Security check $socid = ''; diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 894aa3986d1..f52b3c2f72e 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -32,19 +32,19 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'banks', 'bills')); -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); $action = GETPOST("action", "aZ09"); $cancel = GETPOST('cancel', 'aZ09'); -$refund = GETPOST("refund", "int"); +$refund = GETPOSTINT("refund"); if (empty($refund)) { $refund = 0; } -$lttype = GETPOST('localTaxType', 'int'); +$lttype = GETPOSTINT('localTaxType'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } @@ -188,7 +188,7 @@ if ($action == 'create') { // Bank account print '
'.$langs->trans("BankAccount").''; print img_picto('', 'bank_account', 'pictofixedwidth'); - $form->select_comptes(GETPOST("accountid", "int"), "accountid", 0, "courant=1", 2, '', 0, 'maxwidth500 widthcentpercentminusx'); // Affiche liste des comptes courant + $form->select_comptes(GETPOSTINT("accountid"), "accountid", 0, "courant=1", 2, '', 0, 'maxwidth500 widthcentpercentminusx'); // Affiche liste des comptes courant print '
'.$langs->trans("RemainderToPay").''.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'
'.$langs->trans("Date").''; - $datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); + $datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); $datepayment = !getDolGlobalString('MAIN_AUTOFILL_DATE') ? (GETPOSTISSET("remonth") ? $datepaye : -1) : ''; print $form->selectDate($datepayment, '', '', '', 0, "add_payment", 1, 1, 0, '', '', $charge->date_ech, '', 1, $langs->trans("DateOfSocialContribution")); print "'.$langs->trans('AccountToDebit').''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); - print $form->select_comptes(GETPOSTISSET("accountid") ? GETPOST("accountid", 'int') : $charge->accountid, "accountid", 0, '', 2, '', 0, 'maxwidth500 widthcentpercentminusx', 1); // Show opend bank account list + print $form->select_comptes(GETPOSTISSET("accountid") ? GETPOSTINT("accountid") : $charge->accountid, "accountid", 0, '', 2, '', 0, 'maxwidth500 widthcentpercentminusx', 1); // Show opend bank account list print '
'.$langs->trans("RemainderToPay").''.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).'
'.$langs->trans("Date").''; - $datepaye = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", 'int'), GETPOST("reyear", 'int')); - $datepayment = !getDolGlobalString('MAIN_AUTOFILL_DATE') ? (GETPOST("remonth", 'int') ? $datepaye : -1) : 0; + $datepaye = dol_mktime(12, 0, 0, GETPOSTINT("remonth"), GETPOSTINT("reday"), GETPOSTINT("reyear")); + $datepayment = !getDolGlobalString('MAIN_AUTOFILL_DATE') ? (GETPOSTINT("remonth") ? $datepaye : -1) : 0; print $form->selectDate($datepayment, '', '', '', '', "add_payment", 1, 1); print "
'.$langs->trans("PaymentMode").''; - print $form->select_types_paiements(GETPOSTISSET("paiementtype") ? GETPOST("paiementtype", "int") : $tva->paiementtype, "paiementtype", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1); + print $form->select_types_paiements(GETPOSTISSET("paiementtype") ? GETPOSTINT("paiementtype") : $tva->paiementtype, "paiementtype", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1); print "
'.$langs->trans('AccountToDebit').''; print img_picto('', 'bank_account', 'pictofixedwidth'); - $form->select_comptes(GETPOST("accountid", "int") ? GETPOST("accountid", "int") : $tva->accountid, "accountid", 0, '', 1, '', 0, 'maxwidth500 widthcentpercentminusx'); // Show opend bank account list + $form->select_comptes(GETPOSTINT("accountid") ? GETPOSTINT("accountid") : $tva->accountid, "accountid", 0, '', 1, '', 0, 'maxwidth500 widthcentpercentminusx'); // Show opend bank account list print '
'.$langs->trans("RefusedReason").''; - print $form->selectarray("motif", $rej->motifs, GETPOSTISSET('motif') ? GETPOST('motif', 'int') : ''); + print $form->selectarray("motif", $rej->motifs, GETPOSTISSET('motif') ? GETPOSTINT('motif') : ''); print '
'; - print $form->selectarray("facturer", $rej->labelsofinvoicing, GETPOSTISSET('facturer') ? GETPOST('facturer', 'int') : '', 0); + print $form->selectarray("facturer", $rej->labelsofinvoicing, GETPOSTISSET('facturer') ? GETPOSTINT('facturer') : '', 0); print '
'; diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index a03fa0e1148..e77bd4a2343 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -36,7 +36,7 @@ $langs->loadLangs(array('banks', 'withdrawals', 'companies', 'categories')); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -48,10 +48,10 @@ $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hier $type = GETPOST('type', 'aZ09'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -70,7 +70,7 @@ $search_line = GETPOST('search_line', 'alpha'); $search_bon = GETPOST('search_bon', 'alpha'); $search_code = GETPOST('search_code', 'alpha'); $search_company = GETPOST('search_company', 'alpha'); -$statut = GETPOST('statut', 'int'); +$statut = GETPOSTINT('statut'); $bon = new BonPrelevement($db); $line = new LignePrelevement($db); @@ -80,7 +80,7 @@ $userstatic = new User($db); $hookmanager->initHooks(array('withdrawalsreceiptslineslist')); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index 912e725e91d..5efc08d75ea 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -45,10 +45,10 @@ $mode = GETPOST('mode', 'alpha'); $type = GETPOST('type', 'aZ09'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -64,7 +64,7 @@ if (!$sortfield) { } // Get supervariables -$statut = GETPOST('statut', 'int'); +$statut = GETPOSTINT('statut'); $search_ref = GETPOST('search_ref', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); @@ -79,7 +79,7 @@ if ($type == 'bank-transfer') { } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/prelevement/rejets.php b/htdocs/compta/prelevement/rejets.php index 30db9e40c50..68e5c098bcd 100644 --- a/htdocs/compta/prelevement/rejets.php +++ b/htdocs/compta/prelevement/rejets.php @@ -40,10 +40,10 @@ $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies')); $type = GETPOST('type', 'aZ09'); // Get supervariables -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortorder = GETPOST('sortorder', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -52,7 +52,7 @@ $pageprev = $page - 1; $pagenext = $page + 1; // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/prelevement/stats.php b/htdocs/compta/prelevement/stats.php index 1ebee939615..ad8792944dd 100644 --- a/htdocs/compta/prelevement/stats.php +++ b/htdocs/compta/prelevement/stats.php @@ -35,7 +35,7 @@ $langs->loadLangs(array('banks', 'categories', 'withdrawals', 'companies')); $type = GETPOST('type', 'aZ09'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 2dda35eb209..17281ae721c 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -35,7 +35,7 @@ if (isModEnabled('facture')) { $langs->load("bills"); } -$id = GETPOST('id') ? GETPOST('id', 'int') : GETPOST('socid', 'int'); +$id = GETPOST('id') ? GETPOSTINT('id') : GETPOSTINT('socid'); // Security check if ($user->socid) { @@ -52,10 +52,10 @@ if ($id > 0) { $hookmanager->initHooks(array('recapcomptacard', 'globalcard')); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 62b86621a6a..efa2ed773d4 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -46,18 +46,18 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'donation', 'salaries', 'accountancy', 'loan')); -$date_startmonth = GETPOST('date_startmonth', 'int'); -$date_startday = GETPOST('date_startday', 'int'); -$date_startyear = GETPOST('date_startyear', 'int'); -$date_endmonth = GETPOST('date_endmonth', 'int'); -$date_endday = GETPOST('date_endday', 'int'); -$date_endyear = GETPOST('date_endyear', 'int'); +$date_startmonth = GETPOSTINT('date_startmonth'); +$date_startday = GETPOSTINT('date_startday'); +$date_startyear = GETPOSTINT('date_startyear'); +$date_endmonth = GETPOSTINT('date_endmonth'); +$date_endday = GETPOSTINT('date_endday'); +$date_endyear = GETPOSTINT('date_endyear'); $showaccountdetail = GETPOST('showaccountdetail', 'aZ09') ? GETPOST('showaccountdetail', 'aZ09') : 'yes'; -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -70,7 +70,7 @@ if (!$sortorder) { } // Date range -$year = GETPOST('year', 'int'); // this is used for navigation previous/next. It is the last year to show in filter +$year = GETPOSTINT('year'); // this is used for navigation previous/next. It is the last year to show in filter if (empty($year)) { $year_current = dol_print_date(dol_now(), "%Y"); $month_current = dol_print_date(dol_now(), "%m"); @@ -85,11 +85,11 @@ $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); // We define date_start and date_end if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q") ? GETPOST("q", 'int') : 0; + $q = GETPOST("q") ? GETPOSTINT("q") : 0; if ($q == 0) { // We define date_start and date_end $year_end = $year_start; - $month_start = GETPOST("month") ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); + $month_start = GETPOST("month") ? GETPOSTINT("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); $month_end = ""; if (!GETPOST('month')) { if (!$year && $month_start > $month_current) { @@ -147,7 +147,7 @@ if (GETPOST("modecompta", 'alpha')) { $AccCat = new AccountancyCategory($db); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; } diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index c769adfade6..167ca1793f6 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -36,12 +36,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'donation', 'salaries')); -$date_startday = GETPOST('date_startday', 'int'); -$date_startmonth = GETPOST('date_startmonth', 'int'); -$date_startyear = GETPOST('date_startyear', 'int'); -$date_endday = GETPOST('date_endday', 'int'); -$date_endmonth = GETPOST('date_endmonth', 'int'); -$date_endyear = GETPOST('date_endyear', 'int'); +$date_startday = GETPOSTINT('date_startday'); +$date_startmonth = GETPOSTINT('date_startmonth'); +$date_startyear = GETPOSTINT('date_startyear'); +$date_endday = GETPOSTINT('date_endday'); +$date_endmonth = GETPOSTINT('date_endmonth'); +$date_endyear = GETPOSTINT('date_endyear'); $nbofyear = 4; @@ -50,7 +50,7 @@ $nbofyear = 4; // Date range -$year = GETPOST('year', 'int'); // this is used for navigation previous/next. It is the last year to show in filter +$year = GETPOSTINT('year'); // this is used for navigation previous/next. It is the last year to show in filter if (empty($year)) { $year_current = dol_print_date(dol_now(), "%Y"); $month_current = dol_print_date(dol_now(), "%m"); @@ -65,11 +65,11 @@ $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear, // We define date_start and date_end if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q") ? GETPOST("q", 'int') : 0; + $q = GETPOST("q") ? GETPOSTINT("q") : 0; if ($q == 0) { // We define date_start and date_end $year_end = $year_start + $nbofyear - (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1); - $month_start = GETPOST("month") ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); + $month_start = GETPOST("month") ? GETPOSTINT("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); if (!GETPOST('month')) { if (!$year && $month_start > $month_current) { $year_start--; @@ -121,7 +121,7 @@ if (GETPOST("modecompta", 'alpha')) { } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; } diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index b03d6299aea..0a38507ccb6 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -41,18 +41,18 @@ $mesg = ''; $action = GETPOST('action', 'aZ09'); $cat_id = GETPOST('account_category'); $selectcpt = GETPOST('cpt_bk'); -$id = GETPOST('id', 'int'); -$rowid = GETPOST('rowid', 'int'); +$id = GETPOSTINT('id'); +$rowid = GETPOSTINT('rowid'); $cancel = GETPOST('cancel', 'alpha'); $showaccountdetail = GETPOST('showaccountdetail', 'aZ09') ? GETPOST('showaccountdetail', 'aZ09') : 'no'; -$date_startmonth = GETPOST('date_startmonth', 'int'); -$date_startday = GETPOST('date_startday', 'int'); -$date_startyear = GETPOST('date_startyear', 'int'); -$date_endmonth = GETPOST('date_endmonth', 'int'); -$date_endday = GETPOST('date_endday', 'int'); -$date_endyear = GETPOST('date_endyear', 'int'); +$date_startmonth = GETPOSTINT('date_startmonth'); +$date_startday = GETPOSTINT('date_startday'); +$date_startyear = GETPOSTINT('date_startyear'); +$date_endmonth = GETPOSTINT('date_endmonth'); +$date_endday = GETPOSTINT('date_endday'); +$date_endyear = GETPOSTINT('date_endyear'); $nbofyear = 1; @@ -60,7 +60,7 @@ $nbofyear = 1; //$conf->global->SOCIETE_FISCAL_MONTH_START = 7; // Date range -$year = GETPOST('year', 'int'); // year with current month, is the month of the period we must show +$year = GETPOSTINT('year'); // year with current month, is the month of the period we must show if (empty($year)) { $year_current = dol_print_date(dol_now('gmt'), "%Y", 'gmt'); $month_current = dol_print_date(dol_now(), "%m"); @@ -75,11 +75,11 @@ $date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear); // We define date_start and date_end if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q") ? GETPOST("q", 'int') : 0; + $q = GETPOST("q") ? GETPOSTINT("q") : 0; if ($q == 0) { // We define date_start and date_end $year_end = $year_start + ($nbofyear - 1); - $month_start = GETPOST("month", 'int') ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); + $month_start = GETPOSTINT("month") ? GETPOSTINT("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); $date_startmonth = $month_start; if (!GETPOST('month')) { if (!$year && $month_start > $month_current) { @@ -151,7 +151,7 @@ if (GETPOST("modecompta", 'alpha')) { $AccCat = new AccountancyCategory($db); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; } diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 9911bb2f6e8..6bb11589a2d 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -47,7 +47,7 @@ if (isModEnabled('accounting')) { // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'banks', 'hrm')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -55,15 +55,15 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOSTINT('lineid'); -$fk_project = (GETPOST('fk_project') ? GETPOST('fk_project', 'int') : 0); +$fk_project = (GETPOST('fk_project') ? GETPOSTINT('fk_project') : 0); $dateech = dol_mktime(GETPOST('echhour'), GETPOST('echmin'), GETPOST('echsec'), GETPOST('echmonth'), GETPOST('echday'), GETPOST('echyear')); $dateperiod = dol_mktime(GETPOST('periodhour'), GETPOST('periodmin'), GETPOST('periodsec'), GETPOST('periodmonth'), GETPOST('periodday'), GETPOST('periodyear')); $label = GETPOST('label', 'alpha'); $actioncode = GETPOST('actioncode'); -$fk_user = GETPOST('userid', 'int') > 0 ? GETPOST('userid', 'int') : 0; +$fk_user = GETPOSTINT('userid') > 0 ? GETPOSTINT('userid') : 0; // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('taxcard', 'globalcard')); @@ -91,7 +91,7 @@ $permissiondellink = $user->hasRight('tax', 'charges', 'creer'); // Used by the $upload_dir = $conf->tax->multidir_output[isset($object->entity) ? $object->entity : 1]; // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } @@ -146,7 +146,7 @@ if (empty($reshook)) { // payment mode if ($action == 'setmode' && $permissiontoadd) { - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + $result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -154,7 +154,7 @@ if (empty($reshook)) { // Bank account if ($action == 'setbankaccount' && $permissiontoadd) { - $result = $object->setBankAccount(GETPOST('fk_account', 'int')); + $result = $object->setBankAccount(GETPOSTINT('fk_account')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -204,9 +204,9 @@ if (empty($reshook)) { $object->period = $dateperiod; $object->amount = $amount; $object->fk_user = $fk_user; - $object->mode_reglement_id = (int) GETPOST('mode_reglement_id', 'int'); - $object->fk_account = (int) GETPOST('fk_account', 'int'); - $object->fk_project = (int) GETPOST('fk_project', 'int'); + $object->mode_reglement_id = GETPOSTINT('mode_reglement_id'); + $object->fk_account = GETPOSTINT('fk_account'); + $object->fk_project = GETPOSTINT('fk_project'); $id = $object->create($user); if ($id <= 0) { @@ -271,14 +271,14 @@ if (empty($reshook)) { $object->label = $langs->trans("CopyOf").' '.$object->label; } - if (GETPOST('clone_for_next_month', 'int')) { // This can be true only if TAX_ADD_CLONE_FOR_NEXT_MONTH_CHECKBOX has been set + if (GETPOSTINT('clone_for_next_month')) { // This can be true only if TAX_ADD_CLONE_FOR_NEXT_MONTH_CHECKBOX has been set $object->periode = dol_time_plus_duree($object->periode, 1, 'm'); $object->period = dol_time_plus_duree($object->periode, 1, 'm'); $object->date_ech = dol_time_plus_duree($object->date_ech, 1, 'm'); } else { // Note date_ech is often a little bit higher than dateperiod - $newdateperiod = dol_mktime(0, 0, 0, GETPOST('clone_periodmonth', 'int'), GETPOST('clone_periodday', 'int'), GETPOST('clone_periodyear', 'int')); - $newdateech = dol_mktime(0, 0, 0, GETPOST('clone_date_echmonth', 'int'), GETPOST('clone_date_echday', 'int'), GETPOST('clone_date_echyear', 'int')); + $newdateperiod = dol_mktime(0, 0, 0, GETPOSTINT('clone_periodmonth'), GETPOSTINT('clone_periodday'), GETPOSTINT('clone_periodyear')); + $newdateech = dol_mktime(0, 0, 0, GETPOSTINT('clone_date_echmonth'), GETPOSTINT('clone_date_echday'), GETPOSTINT('clone_date_echyear')); if ($newdateperiod) { $object->periode = $newdateperiod; $object->period = $newdateperiod; @@ -423,13 +423,13 @@ if ($action == 'create') { // Payment Mode print ''.$langs->trans('DefaultPaymentMode').''; - $form->select_types_paiements(GETPOST('mode_reglement_id', 'int'), 'mode_reglement_id'); + $form->select_types_paiements(GETPOSTINT('mode_reglement_id'), 'mode_reglement_id'); print ''; // Bank Account if (isModEnabled("banque")) { print ''.$langs->trans('DefaultBankAccount').''; - print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(GETPOST('fk_account', 'int'), 'fk_account', 0, '', 2, '', 0, '', 1); + print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(GETPOSTINT('fk_account'), 'fk_account', 0, '', 2, '', 0, '', 1); print ''; } diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php index ef68f325cc4..8c22eeed12d 100644 --- a/htdocs/compta/sociales/document.php +++ b/htdocs/compta/sociales/document.php @@ -42,15 +42,15 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('other', 'companies', 'compta', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } diff --git a/htdocs/compta/sociales/info.php b/htdocs/compta/sociales/info.php index 2d78bc86c66..24181ae4b7b 100644 --- a/htdocs/compta/sociales/info.php +++ b/htdocs/compta/sociales/info.php @@ -34,7 +34,7 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('compta', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $object = new ChargeSociales($db); @@ -43,7 +43,7 @@ if ($id > 0) { } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index a0145c6a260..e2f887eb034 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -49,36 +49,36 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'sc $mode = GETPOST('mode', 'alpha'); -$search_ref = GETPOST('search_ref', 'int'); +$search_ref = GETPOSTINT('search_ref'); $search_label = GETPOST('search_label', 'alpha'); -$search_typeid = GETPOST('search_typeid', 'int'); +$search_typeid = GETPOSTINT('search_typeid'); $search_amount = GETPOST('search_amount', 'alpha'); -$search_status = GETPOST('search_status', 'int'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_status = GETPOSTINT('search_status'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); -$search_date_limit_startday = GETPOST('search_date_limit_startday', 'int'); -$search_date_limit_startmonth = GETPOST('search_date_limit_startmonth', 'int'); -$search_date_limit_startyear = GETPOST('search_date_limit_startyear', 'int'); -$search_date_limit_endday = GETPOST('search_date_limit_endday', 'int'); -$search_date_limit_endmonth = GETPOST('search_date_limit_endmonth', 'int'); -$search_date_limit_endyear = GETPOST('search_date_limit_endyear', 'int'); +$search_date_limit_startday = GETPOSTINT('search_date_limit_startday'); +$search_date_limit_startmonth = GETPOSTINT('search_date_limit_startmonth'); +$search_date_limit_startyear = GETPOSTINT('search_date_limit_startyear'); +$search_date_limit_endday = GETPOSTINT('search_date_limit_endday'); +$search_date_limit_endmonth = GETPOSTINT('search_date_limit_endmonth'); +$search_date_limit_endyear = GETPOSTINT('search_date_limit_endyear'); $search_date_limit_start = dol_mktime(0, 0, 0, $search_date_limit_startmonth, $search_date_limit_startday, $search_date_limit_startyear); $search_date_limit_end = dol_mktime(23, 59, 59, $search_date_limit_endmonth, $search_date_limit_endday, $search_date_limit_endyear); $search_project_ref = GETPOST('search_project_ref', 'alpha'); $search_users = GETPOST('search_users'); -$search_type = GETPOST('search_type', 'int'); -$search_account = GETPOST('search_account', 'int'); +$search_type = GETPOSTINT('search_type'); +$search_account = GETPOSTINT('search_account'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST("sortorder", 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; // If $page is not defined, or '' or -1 @@ -94,7 +94,7 @@ if (!$sortorder) { $sortorder = "DESC"; } -$filtre = GETPOST("filtre", 'int'); +$filtre = GETPOSTINT("filtre"); $arrayfields = array( 'cs.rowid' =>array('label'=>"Ref", 'checked'=>1, 'position'=>10), @@ -123,7 +123,7 @@ $permissiontoadd = $user->hasRight('tax', 'charges', 'creer'); $permissiontodelete = $user->hasRight('tax', 'charges', 'supprimer'); // Security check -$socid = GETPOST("socid", 'int'); +$socid = GETPOSTINT("socid"); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/sociales/note.php b/htdocs/compta/sociales/note.php index cdabc0cede5..2f5487497f6 100644 --- a/htdocs/compta/sociales/note.php +++ b/htdocs/compta/sociales/note.php @@ -35,7 +35,7 @@ if (isModEnabled('project')) { $langs->loadLangs(array('compta', 'bills')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -47,7 +47,7 @@ if ($id > 0) { } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 749e9497c25..fb3ecf981cb 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -50,14 +50,14 @@ $hookmanager->initHooks(array('specialexpensesindex')); // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'hrm')); -$year = GETPOST("year", 'int'); -$search_sc_type = GETPOST('search_sc_type', 'int'); +$year = GETPOSTINT("year"); +$search_sc_type = GETPOSTINT('search_sc_type'); $optioncss = GETPOST('optioncss', 'alpha'); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/compta/stats/byratecountry.php b/htdocs/compta/stats/byratecountry.php index 60de44d0545..85906cd2c12 100644 --- a/htdocs/compta/stats/byratecountry.php +++ b/htdocs/compta/stats/byratecountry.php @@ -43,8 +43,8 @@ $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "produ $modecompta = (GETPOST('modecompta', 'alpha') ? GETPOST('modecompta', 'alpha') : $conf->global->ACCOUNTING_MODE); // Date range -$year = GETPOST("year", 'int'); -$month = GETPOST("month", 'int'); +$year = GETPOSTINT("year"); +$month = GETPOSTINT("month"); if (empty($year)) { $year_current = dol_print_date(dol_now(), '%Y'); $month_current = dol_print_date(dol_now(), '%m'); @@ -60,7 +60,7 @@ $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endda // Quarter $q = ''; if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int"); + $q = GETPOSTINT("q"); if (empty($q)) { // We define date_start and date_end $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); @@ -120,14 +120,14 @@ if (empty($min)) { // 0=normal, 1=option vat for services is on debit, 2=option on payments for products $modetax = !getDolGlobalString('TAX_MODE') ? 0 : $conf->global->TAX_MODE; if (GETPOSTISSET("modetax")) { - $modetax = GETPOST("modetax", 'int'); + $modetax = GETPOSTINT("modetax"); } if (empty($modetax)) { $modetax = 0; } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php index 34b0b614b7a..6a52f9ee62a 100644 --- a/htdocs/compta/stats/cabyprodserv.php +++ b/htdocs/compta/stats/cabyprodserv.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $langs->loadLangs(array("products", "categories", "errors", 'accountancy')); // Security pack (data & check) -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; @@ -64,8 +64,8 @@ if (!$sortfield) { } // Category -$selected_cat = (int) GETPOST('search_categ', 'int'); -$selected_soc = (int) GETPOST('search_soc', 'int'); +$selected_cat = GETPOSTINT('search_categ'); +$selected_soc = GETPOSTINT('search_soc'); $subcat = false; if (GETPOST('subcat', 'alpha') === 'yes') { $subcat = true; @@ -73,7 +73,7 @@ if (GETPOST('subcat', 'alpha') === 'yes') { $categorie = new Categorie($db); // product/service -$selected_type = GETPOST('search_type', 'int'); +$selected_type = GETPOSTINT('search_type'); if ($selected_type == '') { $selected_type = -1; } @@ -103,7 +103,7 @@ $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_star $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int"); + $q = GETPOSTINT("q"); if (empty($q)) { // We define date_start and date_end $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 7529db23725..768867e0ddc 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page $langs->load("accountancy"); -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); // Security check if ($user->socid > 0) { @@ -63,14 +63,14 @@ if (!$sortfield) { } // Date range -$year = GETPOST("year", 'int'); -$month = GETPOST("month", 'int'); -$date_startyear = GETPOST("date_startyear", 'int'); -$date_startmonth = GETPOST("date_startmonth", 'int'); -$date_startday = GETPOST("date_startday", 'int'); -$date_endyear = GETPOST("date_endyear", 'int'); -$date_endmonth = GETPOST("date_endmonth", 'int'); -$date_endday = GETPOST("date_endday", 'int'); +$year = GETPOSTINT("year"); +$month = GETPOSTINT("month"); +$date_startyear = GETPOSTINT("date_startyear"); +$date_startmonth = GETPOSTINT("date_startmonth"); +$date_startday = GETPOSTINT("date_startday"); +$date_endyear = GETPOSTINT("date_endyear"); +$date_endmonth = GETPOSTINT("date_endmonth"); +$date_endday = GETPOSTINT("date_endday"); if (empty($year)) { $year_current = dol_print_date(dol_now(), '%Y'); $month_current = dol_print_date(dol_now(), '%m'); diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index aada2d53b30..afd631a8cdc 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -55,10 +55,10 @@ if (!$sortfield) { $sortfield = "nom"; } -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); // Category -$selected_cat = (int) GETPOST('search_categ', 'int'); +$selected_cat = GETPOSTINT('search_categ'); if ($selected_cat == -1) { $selected_cat = ''; } @@ -82,18 +82,18 @@ if (isModEnabled('accounting')) { $hookmanager->initHooks(array('casoclist')); // Date range -$year = GETPOST("year", 'int'); -$month = GETPOST("month", 'int'); +$year = GETPOSTINT("year"); +$month = GETPOSTINT("month"); $search_societe = GETPOST("search_societe", 'alpha'); $search_zip = GETPOST("search_zip", 'alpha'); $search_town = GETPOST("search_town", 'alpha'); $search_country = GETPOST("search_country", 'alpha'); -$date_startyear = GETPOST("date_startyear", 'int'); -$date_startmonth = GETPOST("date_startmonth", 'int'); -$date_startday = GETPOST("date_startday", 'int'); -$date_endyear = GETPOST("date_endyear", 'int'); -$date_endmonth = GETPOST("date_endmonth", 'int'); -$date_endday = GETPOST("date_endday", 'int'); +$date_startyear = GETPOSTINT("date_startyear"); +$date_startmonth = GETPOSTINT("date_startmonth"); +$date_startday = GETPOSTINT("date_startday"); +$date_endyear = GETPOSTINT("date_endyear"); +$date_endmonth = GETPOSTINT("date_endmonth"); +$date_endday = GETPOSTINT("date_endday"); if (empty($year)) { $year_current = dol_print_date(dol_now(), '%Y'); $month_current = dol_print_date(dol_now(), '%m'); @@ -107,7 +107,7 @@ $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_star $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int") ? GETPOST("q", "int") : 0; + $q = GETPOSTINT("q") ? GETPOSTINT("q") : 0; if (empty($q)) { // We define date_start and date_end $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index 7bdf3a279ce..927b5760979 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -32,17 +32,17 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills', 'donation', 'salaries')); -$date_startday = GETPOST('date_startday', 'int'); -$date_startmonth = GETPOST('date_startmonth', 'int'); -$date_startyear = GETPOST('date_startyear', 'int'); -$date_endday = GETPOST('date_endday', 'int'); -$date_endmonth = GETPOST('date_endmonth', 'int'); -$date_endyear = GETPOST('date_endyear', 'int'); +$date_startday = GETPOSTINT('date_startday'); +$date_startmonth = GETPOSTINT('date_startmonth'); +$date_startyear = GETPOSTINT('date_startyear'); +$date_endday = GETPOSTINT('date_endday'); +$date_endmonth = GETPOSTINT('date_endmonth'); +$date_endyear = GETPOSTINT('date_endyear'); $nbofyear = 4; // Date range -$year = GETPOST('year', 'int'); +$year = GETPOSTINT('year'); if (empty($year)) { $year_current = dol_print_date(dol_now(), "%Y"); $month_current = dol_print_date(dol_now(), "%m"); @@ -61,7 +61,7 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e if ($q == 0) { // We define date_start and date_end $year_end = $year_start + $nbofyear - (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1); - $month_start = GETPOSTISSET("month") ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); + $month_start = GETPOSTISSET("month") ? GETPOSTINT("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); if (!GETPOST('month')) { if (!$year && $month_start > $month_current) { $year_start--; @@ -112,10 +112,10 @@ if (GETPOST("modecompta", 'alpha')) { $modecompta = GETPOST("modecompta", 'alpha'); } -$userid = GETPOST('userid', 'int'); +$userid = GETPOSTINT('userid'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; } @@ -384,7 +384,7 @@ $now = dol_now(); $casenow = dol_print_date($now, "%Y-%m"); // Loop on each month -$nb_mois_decalage = GETPOSTISSET('date_startmonth') ? (GETPOST('date_startmonth', 'int') - 1) : (!getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') ? 0 : ($conf->global->SOCIETE_FISCAL_MONTH_START - 1)); +$nb_mois_decalage = GETPOSTISSET('date_startmonth') ? (GETPOSTINT('date_startmonth') - 1) : (!getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') ? 0 : ($conf->global->SOCIETE_FISCAL_MONTH_START - 1)); for ($mois = 1 + $nb_mois_decalage; $mois <= 12 + $nb_mois_decalage; $mois++) { $mois_modulo = $mois; // ajout if ($mois > 12) { diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index ca856e67747..2b819e74fa6 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -28,17 +28,17 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills')); -$date_startday = GETPOST('date_startday', 'int'); -$date_startmonth = GETPOST('date_startmonth', 'int'); -$date_startyear = GETPOST('date_startyear', 'int'); -$date_endday = GETPOST('date_endday', 'int'); -$date_endmonth = GETPOST('date_endmonth', 'int'); -$date_endyear = GETPOST('date_endyear', 'int'); +$date_startday = GETPOSTINT('date_startday'); +$date_startmonth = GETPOSTINT('date_startmonth'); +$date_startyear = GETPOSTINT('date_startyear'); +$date_endday = GETPOSTINT('date_endday'); +$date_endmonth = GETPOSTINT('date_endmonth'); +$date_endyear = GETPOSTINT('date_endyear'); $nbofyear = 4; // Date range -$year = GETPOST('year', 'int'); +$year = GETPOSTINT('year'); if (empty($year)) { $year_current = dol_print_date(dol_now(), "%Y"); $month_current = dol_print_date(dol_now(), "%m"); @@ -57,7 +57,7 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e if ($q == 0) { // We define date_start and date_end $year_end = $year_start + $nbofyear - (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START') > 1 ? 0 : 1); - $month_start = GETPOSTISSET("month") ? GETPOST("month", 'int') : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); + $month_start = GETPOSTISSET("month") ? GETPOSTINT("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); if (!GETPOST('month')) { if (!$year && $month_start > $month_current) { $year_start--; @@ -91,8 +91,8 @@ if (empty($date_start) || empty($date_end)) { // We define date_start and date_e } } -$userid = GETPOST('userid', 'int'); -$socid = GETPOST('socid', 'int'); +$userid = GETPOSTINT('userid'); +$socid = GETPOSTINT('socid'); $tmps = dol_getdate($date_start); $year_start = $tmps['year']; diff --git a/htdocs/compta/stats/supplier_turnover_by_prodserv.php b/htdocs/compta/stats/supplier_turnover_by_prodserv.php index f49e79a18a0..e9568c4aa73 100644 --- a/htdocs/compta/stats/supplier_turnover_by_prodserv.php +++ b/htdocs/compta/stats/supplier_turnover_by_prodserv.php @@ -47,14 +47,14 @@ if (!$sortfield) { } // Category -$selected_cat = (int) GETPOST('search_categ', 'int'); -$selected_soc = (int) GETPOST('search_soc', 'int'); +$selected_cat = GETPOSTINT('search_categ'); +$selected_soc = GETPOSTINT('search_soc'); $subcat = false; if (GETPOST('subcat', 'alpha') === 'yes') { $subcat = true; } // product/service -$selected_type = GETPOST('search_type', 'int'); +$selected_type = GETPOSTINT('search_type'); if ($selected_type == '') { $selected_type = -1; } @@ -84,7 +84,7 @@ $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_star $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int"); + $q = GETPOSTINT("q"); if (empty($q)) { // We define date_start and date_end $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); @@ -194,7 +194,7 @@ foreach ($allparams as $key => $value) { } // Security pack (data & check) -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid > 0) { $socid = $user->socid; diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php index fe20a1e6bee..205f9000031 100644 --- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php +++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php @@ -52,10 +52,10 @@ if (!$sortfield) { } -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); // Category -$selected_cat = (int) GETPOST('search_categ', 'int'); +$selected_cat = GETPOSTINT('search_categ'); $subcat = false; if (GETPOST('subcat', 'alpha') === 'yes') { $subcat = true; @@ -73,8 +73,8 @@ $search_country = GETPOST("search_country", 'alpha'); // Date range -$year = GETPOST("year", 'int'); -$month = GETPOST("month", 'int'); +$year = GETPOSTINT("year"); +$month = GETPOSTINT("month"); $date_startyear = GETPOST("date_startyear", 'alpha'); $date_startmonth = GETPOST("date_startmonth", 'alpha'); $date_startday = GETPOST("date_startday", 'alpha'); @@ -94,7 +94,7 @@ $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_star $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // We use timezone of server so report is same from everywhere // Quarter if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int") ? GETPOST("q", "int") : 0; + $q = GETPOSTINT("q") ? GETPOSTINT("q") : 0; if (empty($q)) { // We define date_start and date_end $month_start = GETPOST("month") ? GETPOST("month") : getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1); diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 127aca426d3..df825768fee 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -43,7 +43,7 @@ if (isModEnabled('accounting')) { // Load translation files required by the page $langs->loadLangs(array('compta', 'banks', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -52,9 +52,9 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'my $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -$refund = GETPOST("refund", "int"); +$refund = GETPOSTINT("refund"); if (GETPOSTISSET('auto_create_paiement') || $action === 'add') { - $auto_create_payment = GETPOST("auto_create_paiement", "int"); + $auto_create_payment = GETPOSTINT("auto_create_paiement"); } else { $auto_create_payment = !getDolGlobalString('CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT'); } @@ -63,8 +63,8 @@ if (empty($refund)) { $refund = 0; } -$datev = dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int')); -$datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int')); +$datev = dol_mktime(12, 0, 0, GETPOSTINT("datevmonth"), GETPOSTINT("datevday"), GETPOSTINT("datevyear")); +$datep = dol_mktime(12, 0, 0, GETPOSTINT("datepmonth"), GETPOSTINT("datepday"), GETPOSTINT("datepyear")); // Initialize technical objects $object = new Tva($db); @@ -90,7 +90,7 @@ $permissiondellink = $user->hasRight('tax', 'charges', 'creer'); // Used by the $upload_dir = $conf->tax->multidir_output[isset($object->entity) ? $object->entity : 1].'/vat'; // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if (!empty($user->socid)) { $socid = $user->socid; } @@ -135,7 +135,7 @@ if (empty($reshook)) { // payment mode if ($action == 'setmode' && $user->hasRight('tax', 'charges', 'creer')) { $object->fetch($id); - $result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int')); + $result = $object->setPaymentMethods(GETPOSTINT('mode_reglement_id')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -144,7 +144,7 @@ if (empty($reshook)) { // Bank account if ($action == 'setbankaccount' && $user->hasRight('tax', 'charges', 'creer')) { $object->fetch($id); - $result = $object->setBankAccount(GETPOST('fk_account', 'int')); + $result = $object->setBankAccount(GETPOSTINT('fk_account')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -238,7 +238,7 @@ if (empty($reshook)) { } if (!$error) { - $result = $paiement->addPaymentToBank($user, 'payment_vat', '(VATPayment)', GETPOST('accountid', 'int'), '', ''); + $result = $paiement->addPaymentToBank($user, 'payment_vat', '(VATPayment)', GETPOSTINT('accountid'), '', ''); if (!($result > 0)) { $error++; setEventMessages($paiement->error, null, 'errors'); @@ -343,7 +343,7 @@ if (empty($reshook)) { $object->label = $langs->trans("CopyOf").' '.$object->label; } - $newdateperiod = dol_mktime(0, 0, 0, GETPOST('clone_periodmonth', 'int'), GETPOST('clone_periodday', 'int'), GETPOST('clone_periodyear', 'int')); + $newdateperiod = dol_mktime(0, 0, 0, GETPOSTINT('clone_periodmonth'), GETPOSTINT('clone_periodday'), GETPOSTINT('clone_periodyear')); if ($newdateperiod) { $object->datev = $newdateperiod; } @@ -460,7 +460,7 @@ if ($action == 'create') { print ''.$langs->trans("Label").''; print ''.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).''; - print $form->selectDate((GETPOST("datevmonth", 'int') ? $datev : -1), "datev", '', '', '', 'add', 1, 1); + print $form->selectDate((GETPOSTINT("datevmonth") ? $datev : -1), "datev", '', '', '', 'add', 1, 1); print ''; // Amount @@ -479,7 +479,7 @@ if ($action == 'create') { // Type payment print ''.$langs->trans("PaymentMode").''; - print $form->select_types_paiements(GETPOST("type_payment", 'int'), "type_payment", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1); + print $form->select_types_paiements(GETPOSTINT("type_payment"), "type_payment", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1); print "\n"; print ""; @@ -487,7 +487,7 @@ if ($action == 'create') { // Bank account print ''.$langs->trans("BankAccount").''; print img_picto('', 'bank_account', 'pictofixedwidth'); - $form->select_comptes(GETPOST("accountid", 'int'), "accountid", 0, "courant=1", 1, '', 0, 'maxwidth500 widthcentpercentminusx'); // List of bank account available + $form->select_comptes(GETPOSTINT("accountid"), "accountid", 0, "courant=1", 1, '', 0, 'maxwidth500 widthcentpercentminusx'); // List of bank account available print ''; } diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index c7b9f2dcc61..ba9af57f4c5 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -43,15 +43,15 @@ if (isModEnabled('project')) { // Load translation files required by the page $langs->loadLangs(array('other', 'companies', 'compta', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php index 5b30b2a9214..db73cc25e56 100644 --- a/htdocs/compta/tva/index.php +++ b/htdocs/compta/tva/index.php @@ -40,9 +40,9 @@ $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "produ $now = dol_now(); $refresh = GETPOSTISSET('submit') ? true : false; -$year_current = GETPOSTISSET('year') ? GETPOST('year', 'int') : dol_print_date($now, '%Y', 'tzserver'); +$year_current = GETPOSTISSET('year') ? GETPOSTINT('year') : dol_print_date($now, '%Y', 'tzserver'); $year_start = $year_current; -$month_current = GETPOSTISSET('month') ? GETPOST('month', 'int') : dol_print_date($now, '%m', 'tzserver'); +$month_current = GETPOSTISSET('month') ? GETPOSTINT('month') : dol_print_date($now, '%m', 'tzserver'); $month_start = $month_current; $refresh = true; @@ -53,14 +53,14 @@ include DOL_DOCUMENT_ROOT.'/compta/tva/initdatesforvat.inc.php'; // 0=normal, 1=option vat for services is on debit, 2=option on payments for products $modetax = getDolGlobalString('TAX_MODE'); if (GETPOSTISSET("modetax")) { - $modetax = GETPOST("modetax", 'int'); + $modetax = GETPOSTINT("modetax"); } if (empty($modetax)) { $modetax = 0; } // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/tva/info.php b/htdocs/compta/tva/info.php index a54be0cdf28..3e02aaa8c0c 100644 --- a/htdocs/compta/tva/info.php +++ b/htdocs/compta/tva/info.php @@ -30,13 +30,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $object = new Tva($db); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/compta/tva/initdatesforvat.inc.php b/htdocs/compta/tva/initdatesforvat.inc.php index 59106f8750c..53cbd63b8cc 100644 --- a/htdocs/compta/tva/initdatesforvat.inc.php +++ b/htdocs/compta/tva/initdatesforvat.inc.php @@ -28,7 +28,7 @@ if (!getDolGlobalInt('SOCIETE_FISCAL_MONTH_START')) { } // Date range -$year = GETPOST("year", "int"); +$year = GETPOSTINT("year"); if (empty($year)) { $year_current = $current_date['year']; $year_start = $year_current; @@ -40,11 +40,11 @@ $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth"), GETPOST("date_star $date_end = dol_mktime(23, 59, 59, GETPOST("date_endmonth"), GETPOST("date_endday"), GETPOST("date_endyear"), 'tzserver'); // Set default period if not defined if (empty($date_start) || empty($date_end)) { // We define date_start and date_end - $q = GETPOST("q", "int"); + $q = GETPOSTINT("q"); if (empty($q)) { - if (GETPOST("month", 'int')) { - $date_start = dol_get_first_day($year_start, GETPOST("month", 'int'), 'tzserver'); - $date_end = dol_get_last_day($year_start, GETPOST("month", 'int'), 'tzserver'); + if (GETPOSTINT("month")) { + $date_start = dol_get_first_day($year_start, GETPOSTINT("month"), 'tzserver'); + $date_end = dol_get_last_day($year_start, GETPOSTINT("month"), 'tzserver'); } else { if (!getDolGlobalString('MAIN_INFO_VAT_RETURN') || getDolGlobalInt('MAIN_INFO_VAT_RETURN') == 2) { // quaterly vat, we take last past complete quarter $date_start = dol_time_plus_duree(dol_get_first_day($year_start, $current_date['mon'], false), -3 - (($current_date['mon'] - $conf->global->SOCIETE_FISCAL_MONTH_START) % 3), 'm'); diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 4912417bdf9..32c982c080c 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -41,7 +41,7 @@ $langs->loadLangs(array('compta', 'bills')); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -53,20 +53,20 @@ $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hier $search_ref = GETPOST('search_ref', 'alpha'); $search_label = GETPOST('search_label', 'alpha'); -$search_dateend_start = dol_mktime(0, 0, 0, GETPOST('search_dateend_startmonth', 'int'), GETPOST('search_dateend_startday', 'int'), GETPOST('search_dateend_startyear', 'int')); -$search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth', 'int'), GETPOST('search_dateend_endday', 'int'), GETPOST('search_dateend_endyear', 'int')); -$search_datepayment_start = dol_mktime(0, 0, 0, GETPOST('search_datepayment_startmonth', 'int'), GETPOST('search_datepayment_startday', 'int'), GETPOST('search_datepayment_startyear', 'int')); -$search_datepayment_end = dol_mktime(23, 59, 59, GETPOST('search_datepayment_endmonth', 'int'), GETPOST('search_datepayment_endday', 'int'), GETPOST('search_datepayment_endyear', 'int')); -$search_type = GETPOST('search_type', 'int'); -$search_account = GETPOST('search_account', 'int'); +$search_dateend_start = dol_mktime(0, 0, 0, GETPOSTINT('search_dateend_startmonth'), GETPOSTINT('search_dateend_startday'), GETPOSTINT('search_dateend_startyear')); +$search_dateend_end = dol_mktime(23, 59, 59, GETPOSTINT('search_dateend_endmonth'), GETPOSTINT('search_dateend_endday'), GETPOSTINT('search_dateend_endyear')); +$search_datepayment_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datepayment_startmonth'), GETPOSTINT('search_datepayment_startday'), GETPOSTINT('search_datepayment_startyear')); +$search_datepayment_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datepayment_endmonth'), GETPOSTINT('search_datepayment_endday'), GETPOSTINT('search_datepayment_endyear')); +$search_type = GETPOSTINT('search_type'); +$search_account = GETPOSTINT('search_account'); $search_amount = GETPOST('search_amount', 'alpha'); -$search_status = GETPOST('search_status', 'int'); -$ltt = GETPOST("ltt", "int"); +$search_status = GETPOSTINT('search_status'); +$ltt = GETPOSTINT("ltt"); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST('page', 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT('page'); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -105,7 +105,7 @@ $permissiontoadd = $user->hasRight('tax', 'charges', 'creer'); $permissiontodelete = $user->hasRight('tax', 'charges', 'supprimer'); // Security check -$socid = GETPOST('socid', 'int'); +$socid = GETPOSTINT('socid'); if ($user->socid) { $socid = $user->socid; } @@ -281,40 +281,40 @@ if (!empty($search_label)) { $param .= '&search_label="'.$search_label.'"'; } if (!empty($search_dateend_start)) { - $param .= '&search_dateend_startyear='.GETPOST('search_dateend_startyear', 'int'); + $param .= '&search_dateend_startyear='.GETPOSTINT('search_dateend_startyear'); } if (!empty($search_dateend_start)) { - $param .= '&search_dateend_startmonth='.GETPOST('search_dateend_startmonth', 'int'); + $param .= '&search_dateend_startmonth='.GETPOSTINT('search_dateend_startmonth'); } if (!empty($search_dateend_start)) { - $param .= '&search_dateend_startday='.GETPOST('search_dateend_startday', 'int'); + $param .= '&search_dateend_startday='.GETPOSTINT('search_dateend_startday'); } if (!empty($search_dateend_end)) { - $param .= '&search_dateend_endyear='.GETPOST('search_dateend_endyear', 'int'); + $param .= '&search_dateend_endyear='.GETPOSTINT('search_dateend_endyear'); } if (!empty($search_dateend_end)) { - $param .= '&search_dateend_endmonth='.GETPOST('search_dateend_endmonth', 'int'); + $param .= '&search_dateend_endmonth='.GETPOSTINT('search_dateend_endmonth'); } if (!empty($search_dateend_end)) { - $param .= '&search_dateend_endday='.GETPOST('search_dateend_endday', 'int'); + $param .= '&search_dateend_endday='.GETPOSTINT('search_dateend_endday'); } if (!empty($search_datepayment_start)) { - $param .= '&search_datepayment_startyear='.GETPOST('search_datepayment_startyear', 'int'); + $param .= '&search_datepayment_startyear='.GETPOSTINT('search_datepayment_startyear'); } if (!empty($search_datepayment_start)) { - $param .= '&search_datepayment_startmonth='.GETPOST('search_datepayment_startmonth', 'int'); + $param .= '&search_datepayment_startmonth='.GETPOSTINT('search_datepayment_startmonth'); } if (!empty($search_datepayment_start)) { - $param .= '&search_datepayment_startday='.GETPOST('search_datepayment_startday', 'int'); + $param .= '&search_datepayment_startday='.GETPOSTINT('search_datepayment_startday'); } if (!empty($search_datepayment_end)) { - $param .= '&search_datepayment_endyear='.GETPOST('search_datepayment_endyear', 'int'); + $param .= '&search_datepayment_endyear='.GETPOSTINT('search_datepayment_endyear'); } if (!empty($search_datepayment_end)) { - $param .= '&search_datepayment_endmonth='.GETPOST('search_datepayment_endmonth', 'int'); + $param .= '&search_datepayment_endmonth='.GETPOSTINT('search_datepayment_endmonth'); } if (!empty($search_datepayment_end)) { - $param .= '&search_datepayment_endday='.GETPOST('search_datepayment_endday', 'int'); + $param .= '&search_datepayment_endday='.GETPOSTINT('search_datepayment_endday'); } if (!empty($search_type) && $search_type > 0) { $param .= '&search_type='.$search_type; diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index e5cb19877e6..b877b472551 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -40,17 +40,17 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; $langs->loadLangs(array('compta', 'bills')); $mode = GETPOST("mode", 'alpha'); -$year = GETPOST("year", 'int'); +$year = GETPOSTINT("year"); $filtre = GETPOST("filtre", 'alpha'); $optioncss = GETPOST('optioncss', 'alpha'); if (!$year && $mode != 'tvaonly') { $year = date("Y", time()); } -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index a0134194b48..40d49e2404f 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -55,8 +55,8 @@ $mesg = ''; $error = 0; $errors = array(); $action = (GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view'); $confirm = GETPOST('confirm', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$id = GETPOST('id', 'int'); -$socid = GETPOST('socid', 'int'); +$id = GETPOSTINT('id'); +$socid = GETPOSTINT('socid'); // Initialize objects $object = new Contact($db); @@ -92,10 +92,10 @@ if ($user->socid) { } $result = restrictedArea($user, 'contact', $id, 'socpeople&societe', '', '', 'rowid', 0); // If we create a contact with no company (shared contacts), no check on write permission -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index d0db16191d0..ab35f938890 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -285,7 +285,7 @@ abstract class ActionsContactCardCommon // phpcs:enable global $langs, $mysoc; - $this->object->socid = GETPOST("socid", 'int'); + $this->object->socid = GETPOSTINT("socid"); $this->object->lastname = GETPOST("name"); $this->object->firstname = GETPOST("firstname"); $this->object->civility_id = GETPOST("civility_id"); diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 9d8ee6762ce..3ca3250d3c3 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -205,7 +205,7 @@ if (empty($reshook)) { $object->canvas = $canvas; } - $object->entity = (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : $conf->entity); + $object->entity = (GETPOSTISSET('entity') ? GETPOSTINT('entity') : $conf->entity); $object->socid = $socid; $object->lastname = (string) GETPOST("lastname", 'alpha'); $object->firstname = (string) GETPOST("firstname", 'alpha'); @@ -214,8 +214,8 @@ if (empty($reshook)) { $object->address = (string) GETPOST("address", 'alpha'); $object->zip = (string) GETPOST("zipcode", 'alpha'); $object->town = (string) GETPOST("town", 'alpha'); - $object->country_id = (int) GETPOST("country_id", 'int'); - $object->state_id = (int) GETPOST("state_id", 'int'); + $object->country_id = GETPOSTINT("country_id"); + $object->state_id = GETPOSTINT("state_id"); $object->socialnetworks = array(); if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { @@ -238,7 +238,7 @@ if (empty($reshook)) { $object->statut = 1; //Default status to Actif // Note: Correct date should be completed with location to have exact GM time of birth. - $object->birthday = dol_mktime(0, 0, 0, GETPOST("birthdaymonth", 'int'), GETPOST("birthdayday", 'int'), GETPOST("birthdayyear", 'int')); + $object->birthday = dol_mktime(0, 0, 0, GETPOSTINT("birthdaymonth"), GETPOSTINT("birthdayday"), GETPOSTINT("birthdayyear")); $object->birthday_alert = GETPOSTINT("birthday_alert"); //Default language @@ -342,7 +342,7 @@ if (empty($reshook)) { $action = 'edit'; } - if (isModEnabled('mailing') && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOST("no_email", "int") == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { + if (isModEnabled('mailing') && getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2 && GETPOSTINT("no_email") == -1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) { $error++; $errors[] = $langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")); $action = 'edit'; @@ -356,7 +356,7 @@ if (empty($reshook)) { } if (!$error) { - $contactid = GETPOST("contactid", 'int'); + $contactid = GETPOSTINT("contactid"); $object->fetch($contactid); $object->fetchRoles(); @@ -413,11 +413,11 @@ if (empty($reshook)) { $object->address = (string) GETPOST("address", 'alpha'); $object->zip = (string) GETPOST("zipcode", 'alpha'); $object->town = (string) GETPOST("town", 'alpha'); - $object->state_id = GETPOST("state_id", 'int'); - $object->country_id = GETPOST("country_id", 'int'); + $object->state_id = GETPOSTINT("state_id"); + $object->country_id = GETPOSTINT("country_id"); $object->email = (string) GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); - $object->no_email = GETPOST("no_email", "int"); + $object->no_email = GETPOSTINT("no_email"); $object->socialnetworks = array(); if (isModEnabled('socialnetworks')) { foreach ($socialnetworks as $key => $value) { @@ -430,7 +430,7 @@ if (empty($reshook)) { $object->phone_perso = (string) GETPOST("phone_perso", 'alpha'); $object->phone_mobile = (string) GETPOST("phone_mobile", 'alpha'); $object->fax = (string) GETPOST("fax", 'alpha'); - $object->priv = (string) GETPOST("priv", 'int'); + $object->priv = (string) GETPOSTINT("priv"); $object->note_public = (string) GETPOST("note_public", 'restricthtml'); $object->note_private = (string) GETPOST("note_private", 'restricthtml'); @@ -455,7 +455,7 @@ if (empty($reshook)) { // Update mass emailing flag into table mailing_unsubscribe if (GETPOSTISSET('no_email') && $object->email) { - $no_email = GETPOST('no_email', 'int'); + $no_email = GETPOSTINT('no_email'); $result = $object->setNoEmail($no_email); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -500,14 +500,14 @@ if (empty($reshook)) { // Update extrafields if ($action == "update_extras" && !empty($permissiontoadd)) { - $object->fetch(GETPOST('id', 'int')); + $object->fetch(GETPOSTINT('id')); $attributekey = GETPOST('attribute', 'alpha'); $attributekeylong = 'options_'.$attributekey; if (GETPOSTISSET($attributekeylong.'day') && GETPOSTISSET($attributekeylong.'month') && GETPOSTISSET($attributekeylong.'year')) { // This is properties of a date - $object->array_options['options_'.$attributekey] = dol_mktime(GETPOST($attributekeylong.'hour', 'int'), GETPOST($attributekeylong.'min', 'int'), GETPOST($attributekeylong.'sec', 'int'), GETPOST($attributekeylong.'month', 'int'), GETPOST($attributekeylong.'day', 'int'), GETPOST($attributekeylong.'year', 'int')); + $object->array_options['options_'.$attributekey] = dol_mktime(GETPOSTINT($attributekeylong.'hour'), GETPOSTINT($attributekeylong.'min'), GETPOSTINT($attributekeylong.'sec'), GETPOSTINT($attributekeylong.'month'), GETPOSTINT($attributekeylong.'day'), GETPOSTINT($attributekeylong.'year')); //var_dump(dol_print_date($object->array_options['options_'.$attributekey]));exit; } else { $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, 'alpha'); @@ -628,10 +628,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { */ $object->canvas = $canvas; - $object->state_id = GETPOST("state_id", "int"); + $object->state_id = GETPOSTINT("state_id"); // We set country_id, country_code and label for the selected country - $object->country_id = GETPOST("country_id") ? GETPOST("country_id", "int") : (empty($objsoc->country_id) ? $mysoc->country_id : $objsoc->country_id); + $object->country_id = GETPOST("country_id") ? GETPOSTINT("country_id") : (empty($objsoc->country_id) ? $mysoc->country_id : $objsoc->country_id); if ($object->country_id) { $tmparray = getCountry($object->country_id, 'all'); $object->country_code = $tmparray['code']; @@ -848,7 +848,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; // Default value is in MAILING_CONTACT_DEFAULT_BULK_STATUS that you can modify in setup of module emailing - print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS')), 1, false, (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2)); + print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOSTINT("no_email") : getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS')), 1, false, (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2)); print ''; print ''; } @@ -1002,7 +1002,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { if (!getDolGlobalString('SOCIETE_DISABLE_CONTACTS')) { print ''; print ''; - print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company(GETPOST('socid', 'int') ? GETPOST('socid', 'int') : ($object->socid ? $object->socid : -1), 'socid', '', $langs->trans("SelectThirdParty")); + print img_picto('', 'company', 'class="pictofixedwidth"').$form->select_company(GETPOSTINT('socid') ? GETPOSTINT('socid') : ($object->socid ? $object->socid : -1), 'socid', '', $langs->trans("SelectThirdParty")); print ''; print ''; } @@ -1126,7 +1126,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''; $useempty = (getDolGlobalInt('MAILING_CONTACT_DEFAULT_BULK_STATUS') == 2); - print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOST("no_email", 'int') : $object->no_email), 1, false, $useempty); + print $form->selectyesno('no_email', (GETPOSTISSET("no_email") ? GETPOSTINT("no_email") : $object->no_email), 1, false, $useempty); print ''; print ''; } diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 1e82f807105..21ba9ed848f 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $object = new Contact($db); if ($id > 0) { @@ -49,10 +49,10 @@ if (empty($object->thirdparty)) { $socid = !empty($object->thirdparty->id) ? $object->thirdparty->id : null; // Sort & Order fields -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -69,8 +69,8 @@ if (!$sortfield) { // Search fields $sref = GETPOST("sref"); $sprod_fulldescr = GETPOST("sprod_fulldescr"); -$month = GETPOST('month', 'int'); -$year = GETPOST('year', 'int'); +$month = GETPOSTINT('month'); +$year = GETPOSTINT('year'); // Clean up on purge search criteria ? if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php index 0ab502e6fa9..ede18370781 100644 --- a/htdocs/contact/document.php +++ b/htdocs/contact/document.php @@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; $langs->loadLangs(array('other', 'companies', 'contact')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -53,10 +53,10 @@ if (!empty($canvas)) { } // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contact/info.php b/htdocs/contact/info.php index f92734644de..d1248286792 100644 --- a/htdocs/contact/info.php +++ b/htdocs/contact/info.php @@ -35,7 +35,7 @@ $langs->load("companies"); // Security check -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php index 4d74382ad4e..337966133c5 100644 --- a/htdocs/contact/ldap.php +++ b/htdocs/contact/ldap.php @@ -36,7 +36,7 @@ $langs->load("admin"); $action = GETPOST('action', 'aZ09'); // Security check -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); if ($user->socid) { $socid = $user->socid; } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index a9878be3a28..45a39bfee2f 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -49,7 +49,7 @@ $socialnetworks = getArrayOfSocialNetworks(); // Get parameters $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'contactlist'; @@ -60,8 +60,8 @@ if ($contextpage == 'poslist') { } // Security check -$id = GETPOST('id', 'int'); -$contactid = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); +$contactid = GETPOSTINT('id'); $ref = ''; // There is no ref for contacts if ($user->socid) { $socid = $user->socid; @@ -72,7 +72,7 @@ $search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('searc $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'); -$search_id = GETPOST("search_id", "int"); +$search_id = GETPOSTINT("search_id"); $search_firstlast_only = GETPOST("search_firstlast_only", 'alpha'); $search_lastname = GETPOST("search_lastname", 'alpha'); $search_firstname = GETPOST("search_firstname", 'alpha'); @@ -85,7 +85,7 @@ $search_phone_mobile = GETPOST("search_phone_mobile", 'alpha'); $search_fax = GETPOST("search_fax", 'alpha'); $search_email = GETPOST("search_email", 'alpha'); if (isModEnabled('mailing')) { - $search_no_email = GETPOSTISSET("search_no_email") ? GETPOST("search_no_email", 'int') : -1; + $search_no_email = GETPOSTISSET("search_no_email") ? GETPOSTINT("search_no_email") : -1; } else { $search_no_email = -1; } @@ -98,10 +98,10 @@ if (isModEnabled('socialnetworks')) { } $search_priv = GETPOST("search_priv", 'alpha'); $search_sale = GETPOSTINT('search_sale'); -$search_categ = GETPOST("search_categ", 'int'); -$search_categ_thirdparty = GETPOST("search_categ_thirdparty", 'int'); -$search_categ_supplier = GETPOST("search_categ_supplier", 'int'); -$search_status = GETPOST("search_status", 'int'); +$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_type = GETPOST('search_type', 'alpha'); $search_address = GETPOST('search_address', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); @@ -110,9 +110,9 @@ $search_import_key = GETPOST("search_import_key", 'alpha'); $search_country = GETPOST("search_country", 'intcomma'); $search_roles = GETPOST("search_roles", 'array'); $search_level = GETPOST("search_level", 'array'); -$search_stcomm = GETPOST('search_stcomm', 'int'); -$search_birthday_start = dol_mktime(0, 0, 0, GETPOST('search_birthday_startmonth', 'int'), GETPOST('search_birthday_startday', 'int'), GETPOST('search_birthday_startyear', 'int')); -$search_birthday_end = dol_mktime(23, 59, 59, GETPOST('search_birthday_endmonth', 'int'), GETPOST('search_birthday_endday', 'int'), GETPOST('search_birthday_endyear', 'int')); +$search_stcomm = GETPOSTINT('search_stcomm'); +$search_birthday_start = dol_mktime(0, 0, 0, GETPOSTINT('search_birthday_startmonth'), GETPOSTINT('search_birthday_startday'), GETPOSTINT('search_birthday_startyear')); +$search_birthday_end = dol_mktime(23, 59, 59, GETPOSTINT('search_birthday_endmonth'), GETPOSTINT('search_birthday_endday'), GETPOSTINT('search_birthday_endyear')); if ($search_status === '') { $search_status = 1; // always display active customer first @@ -128,14 +128,14 @@ $place = GETPOST('place', 'aZ09') ? GETPOST('place', 'aZ09') : '0'; // $place is $type = GETPOST("type", 'aZ'); $view = GETPOST("view", 'alpha'); -$userid = GETPOST('userid', 'int'); +$userid = GETPOSTINT('userid'); $begin = GETPOST('begin'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (!$sortorder) { $sortorder = "ASC"; } @@ -288,8 +288,8 @@ if (!$permissiontoread) { */ if ($action == "change" && $user->hasRight('takepos', 'run')) { // Change customer for TakePOS - $idcustomer = GETPOST('idcustomer', 'int'); - $idcontact = GETPOST('idcontact', 'int'); + $idcustomer = GETPOSTINT('idcustomer'); + $idcontact = GETPOSTINT('idcontact'); // Check if draft invoice already exists, if not create it $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' AND entity IN (".getEntity('invoice').")"; @@ -935,7 +935,7 @@ if (!empty($permissiontodelete)) { if (isModEnabled('category') && $user->hasRight('societe', 'creer')) { $arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete','preaffecttag'))) { $arrayofmassactions = array(); } if ($contextpage != 'poslist') { diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index 7dd2b319e67..1f7a328e614 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -35,7 +35,7 @@ $action = GETPOST('action', 'aZ09'); // Load translation files required by the page $langs->load("companies"); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $object = new Contact($db); if ($id > 0) { diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php index c9e96439ef9..357b6401023 100644 --- a/htdocs/contact/perso.php +++ b/htdocs/contact/perso.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php'; // Load translation files required by the page $langs->loadLangs(array('companies', 'other')); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); // Security check diff --git a/htdocs/contact/project.php b/htdocs/contact/project.php index 9cc60d2cbe4..389bb693d1d 100644 --- a/htdocs/contact/project.php +++ b/htdocs/contact/project.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $langs->loadLangs(array("contacts", "companies", "projects")); // Security check -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 5760cc9e670..a8434eff2d9 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/vcard.class.php'; $contact = new Contact($db); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Security check $result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 45f81b633c9..5c0506a94c7 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -50,7 +50,7 @@ $search_agenda_label = GETPOST('search_agenda_label'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Security check @@ -63,10 +63,10 @@ $fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : '')); $fieldtype = (!empty($id) ? 'rowid' : 'ref'); $result = restrictedArea($user, 'contrat', $fieldvalue, '', '', '', $fieldtype); -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index fb3290f6124..231f433f3b4 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -61,16 +61,16 @@ $confirm = GETPOST('confirm', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha'); -$socid = GETPOST('socid', 'int'); -$id = GETPOST('id', 'int'); +$socid = GETPOSTINT('socid'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $origin = GETPOST('origin', 'alpha'); -$originid = GETPOST('originid', 'int'); +$originid = GETPOSTINT('originid'); // PDF -$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); -$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); -$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); +$hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); +$hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); +$hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); $datecontrat = ''; @@ -164,7 +164,7 @@ if (empty($reshook)) { $date_end = dol_mktime(GETPOST('endhour'), GETPOST('endmin'), 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear')); } - $result = $object->active_line($user, GETPOST('ligne', 'int'), $date_start, $date_end, GETPOST('comment')); + $result = $object->active_line($user, GETPOSTINT('ligne'), $date_start, $date_end, GETPOST('comment')); if ($result > 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); @@ -182,7 +182,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), null, 'errors'); } if (!$error) { - $result = $object->close_line($user, GETPOST('ligne', 'int'), $date_end, urldecode(GETPOST('comment'))); + $result = $object->close_line($user, GETPOSTINT('ligne'), $date_end, urldecode(GETPOST('comment'))); if ($result > 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; @@ -250,12 +250,12 @@ if (empty($reshook)) { $object->socid = $socid; $object->date_contrat = $datecontrat; - $object->commercial_suivi_id = GETPOST('commercial_suivi_id', 'int'); - $object->commercial_signature_id = GETPOST('commercial_signature_id', 'int'); + $object->commercial_suivi_id = GETPOSTINT('commercial_suivi_id'); + $object->commercial_signature_id = GETPOSTINT('commercial_signature_id'); $object->note_private = GETPOST('note_private', 'alpha'); $object->note_public = GETPOST('note_public', 'alpha'); - $object->fk_project = GETPOST('projectid', 'int'); + $object->fk_project = GETPOSTINT('projectid'); $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2); $object->ref = GETPOST('ref', 'alpha'); $object->ref_customer = GETPOST('ref_customer', 'alpha'); @@ -451,7 +451,7 @@ if (empty($reshook)) { if (GETPOST('prod_entry_mode', 'alpha') == 'free') { $idprod = 0; } else { - $idprod = GETPOST('idprod', 'int'); + $idprod = GETPOSTINT('idprod'); if (getDolGlobalString('MAIN_DISABLE_FREE_LINES') && $idprod <= 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ProductOrService")), null, 'errors'); @@ -712,7 +712,7 @@ if (empty($reshook)) { if (!$error) { $objectline = new ContratLigne($db); - if ($objectline->fetch(GETPOST('elrowid', 'int')) < 0) { + if ($objectline->fetch(GETPOSTINT('elrowid')) < 0) { setEventMessages($objectline->error, $objectline->errors, 'errors'); $error++; } @@ -771,7 +771,7 @@ if (empty($reshook)) { $remise = round(($price_ht * $remise_percent / 100), 2); } - $objectline->fk_product = GETPOST('idprod', 'int'); + $objectline->fk_product = GETPOSTINT('idprod'); $objectline->description = GETPOST('product_desc', 'restricthtml'); $objectline->price_ht = $price_ht; $objectline->subprice = price2num(GETPOST('elprice'), 'MU'); @@ -822,7 +822,7 @@ if (empty($reshook)) { $db->rollback(); } } elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->hasRight('contrat', 'creer')) { - $result = $object->deleteLine(GETPOST('lineid', 'int'), $user); + $result = $object->deleteLine(GETPOSTINT('lineid'), $user); if ($result >= 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); @@ -1036,10 +1036,10 @@ if (empty($reshook)) { } } elseif ($action == 'swapstatut') { // bascule du statut d'un contact - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } elseif ($action == 'deletecontact') { // Efface un contact - $result = $object->delete_contact(GETPOST('lineid', 'int')); + $result = $object->delete_contact(GETPOSTINT('lineid')); if ($result >= 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); @@ -1111,7 +1111,7 @@ if ($action == 'create') { $soc->fetch($socid); } - if (GETPOST('origin') && GETPOST('originid', 'int')) { + if (GETPOST('origin') && GETPOSTINT('originid')) { // Parse element/subelement (ex: project_task) $regs = array(); $element = $subelement = GETPOST('origin'); @@ -1121,7 +1121,7 @@ if ($action == 'create') { } if ($element == 'project') { - $projectid = GETPOST('originid', 'int'); + $projectid = GETPOSTINT('originid'); } else { // For compatibility if ($element == 'order' || $element == 'commande') { @@ -1161,7 +1161,7 @@ if ($action == 'create') { $srccontactslist = $objectsrc->liste_contact(-1, 'external', 1); } } else { - $projectid = GETPOST('projectid', 'int'); + $projectid = GETPOSTINT('projectid'); $note_private = GETPOST("note_private"); $note_public = GETPOST("note_public"); } @@ -1358,7 +1358,7 @@ if ($action == 'create') { } elseif ($action == 'clone') { $filter = '(s.client:IN:1,2,3)'; // Clone confirmation - $formquestion = array(array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', $filter))); + $formquestion = array(array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', $filter))); $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneContract', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } @@ -1892,7 +1892,7 @@ if ($action == 'create') { 'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"), array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid)); - print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid', 'int'), $langs->trans("MoveToAnotherContract"), $langs->trans("ConfirmMoveToAnotherContract"), "confirm_move", $formquestion); + print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOSTINT('rowid'), $langs->trans("MoveToAnotherContract"), $langs->trans("ConfirmMoveToAnotherContract"), "confirm_move", $formquestion); print '
'; } @@ -1960,13 +1960,13 @@ if ($action == 'create') { } // Form to activate line - if ($user->hasRight('contrat', 'activer') && $action == 'activateline' && $object->lines[$cursorline - 1]->id == GETPOST('ligne', 'int')) { + if ($user->hasRight('contrat', 'activer') && $action == 'activateline' && $object->lines[$cursorline - 1]->id == GETPOSTINT('ligne')) { print ''; print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -2015,7 +2015,7 @@ if ($action == 'create') { print ''; } - if ($user->hasRight('contrat', 'activer') && $action == 'unactivateline' && $object->lines[$cursorline - 1]->id == GETPOST('ligne', 'int')) { + if ($user->hasRight('contrat', 'activer') && $action == 'unactivateline' && $object->lines[$cursorline - 1]->id == GETPOSTINT('ligne')) { /** * Disable a contract line */ @@ -2084,7 +2084,7 @@ if ($action == 'create') { $dateSelector = 1; print "\n"; - print ' + print ' diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index df7331cb65a..2af94f7654c 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -40,8 +40,8 @@ $langs->loadLangs(array('contracts', 'companies')); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -$socid = GETPOST('socid', 'int'); -$id = GETPOST('id', 'int'); +$socid = GETPOSTINT('socid'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Security check @@ -98,7 +98,7 @@ if (empty($reshook)) { // Toggle the status of a contact if ($action == 'swapstatut' && $user->hasRight('contrat', 'creer')) { if ($object->fetch($id)) { - $result = $object->swapContactStatus(GETPOST('ligne', 'int')); + $result = $object->swapContactStatus(GETPOSTINT('ligne')); } else { dol_print_error($db, $object->error); } @@ -107,7 +107,7 @@ if (empty($reshook)) { // Delete contact if ($action == 'deletecontact' && $user->hasRight('contrat', 'creer')) { $object->fetch($id); - $result = $object->delete_contact(GETPOST("lineid", 'int')); + $result = $object->delete_contact(GETPOSTINT("lineid")); if ($result >= 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 9cea403d00c..df1fe678317 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -42,7 +42,7 @@ $langs->loadLangs(array('other', 'products', 'contracts')); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Security check @@ -53,10 +53,10 @@ if ($user->socid > 0) { } // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index be492d4cea0..584ea7d0697 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -39,13 +39,13 @@ $langs->loadLangs(array('products', 'companies', 'contracts')); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); $statut = GETPOST('statut') ? GETPOST('statut') : 1; // Security check $socid = 0; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); if (!empty($user->socid)) { $socid = $user->socid; } diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 72fd00021c8..8c5d25cbb97 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -47,7 +47,7 @@ $langs->loadLangs(array('contracts', 'products', 'companies', 'compta')); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'contractlist'; // To manage different context of search @@ -59,59 +59,59 @@ $search_email = GETPOST('search_email', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); $search_state = GETPOST("search_state", 'alpha'); -$search_country = GETPOST("search_country", 'int'); -$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int'); +$search_country = GETPOSTINT("search_country"); +$search_type_thirdparty = GETPOSTINT("search_type_thirdparty"); $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_status = GETPOST('search_status', 'alpha'); -$socid = GETPOST('socid', 'int'); -$search_user = GETPOST('search_user', 'int'); -$search_sale = GETPOST('search_sale', 'int'); -$search_product_category = GETPOST('search_product_category', 'int'); -$search_dfmonth = GETPOST('search_dfmonth', 'int'); -$search_dfyear = GETPOST('search_dfyear', 'int'); +$socid = GETPOSTINT('socid'); +$search_user = GETPOSTINT('search_user'); +$search_sale = GETPOSTINT('search_sale'); +$search_product_category = GETPOSTINT('search_product_category'); +$search_dfmonth = GETPOSTINT('search_dfmonth'); +$search_dfyear = GETPOSTINT('search_dfyear'); $search_op2df = GETPOST('search_op2df', 'alpha'); -$search_date_startday = GETPOST('search_date_startday', 'int'); -$search_date_startmonth = GETPOST('search_date_startmonth', 'int'); -$search_date_startyear = GETPOST('search_date_startyear', 'int'); -$search_date_endday = GETPOST('search_date_endday', 'int'); -$search_date_endmonth = GETPOST('search_date_endmonth', 'int'); -$search_date_endyear = GETPOST('search_date_endyear', 'int'); +$search_date_startday = GETPOSTINT('search_date_startday'); +$search_date_startmonth = GETPOSTINT('search_date_startmonth'); +$search_date_startyear = GETPOSTINT('search_date_startyear'); +$search_date_endday = GETPOSTINT('search_date_endday'); +$search_date_endmonth = GETPOSTINT('search_date_endmonth'); +$search_date_endyear = GETPOSTINT('search_date_endyear'); $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver $search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear); $searchCategoryCustomerOperator = 0; if (GETPOSTISSET('formfilteraction')) { - $searchCategoryCustomerOperator = GETPOST('search_category_customer_operator', 'int'); + $searchCategoryCustomerOperator = GETPOSTINT('search_category_customer_operator'); } elseif (getDolGlobalString('MAIN_SEARCH_CAT_OR_BY_DEFAULT')) { $searchCategoryCustomerOperator = getDolGlobalString('MAIN_SEARCH_CAT_OR_BY_DEFAULT'); } $searchCategoryCustomerList = GETPOST('search_category_customer_list', 'array'); -$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int'); -$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int'); -$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int'); +$search_date_creation_startmonth = GETPOSTINT('search_date_creation_startmonth'); +$search_date_creation_startyear = GETPOSTINT('search_date_creation_startyear'); +$search_date_creation_startday = GETPOSTINT('search_date_creation_startday'); $search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear); // Use tzserver -$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int'); -$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int'); -$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int'); +$search_date_creation_endmonth = GETPOSTINT('search_date_creation_endmonth'); +$search_date_creation_endyear = GETPOSTINT('search_date_creation_endyear'); +$search_date_creation_endday = GETPOSTINT('search_date_creation_endday'); $search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear); // Use tzserver -$search_date_modif_startmonth = GETPOST('search_date_modif_startmonth', 'int'); -$search_date_modif_startyear = GETPOST('search_date_modif_startyear', 'int'); -$search_date_modif_startday = GETPOST('search_date_modif_startday', 'int'); +$search_date_modif_startmonth = GETPOSTINT('search_date_modif_startmonth'); +$search_date_modif_startyear = GETPOSTINT('search_date_modif_startyear'); +$search_date_modif_startday = GETPOSTINT('search_date_modif_startday'); $search_date_modif_start = dol_mktime(0, 0, 0, $search_date_modif_startmonth, $search_date_modif_startday, $search_date_modif_startyear); // Use tzserver -$search_date_modif_endmonth = GETPOST('search_date_modif_endmonth', 'int'); -$search_date_modif_endyear = GETPOST('search_date_modif_endyear', 'int'); -$search_date_modif_endday = GETPOST('search_date_modif_endday', 'int'); +$search_date_modif_endmonth = GETPOSTINT('search_date_modif_endmonth'); +$search_date_modif_endyear = GETPOSTINT('search_date_modif_endyear'); +$search_date_modif_endday = GETPOSTINT('search_date_modif_endday'); $search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $search_date_modif_endday, $search_date_modif_endyear); // Use tzserver // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -127,7 +127,7 @@ if (!$sortorder) { } // Security check -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); if ($user->socid) { $socid = $user->socid; } @@ -733,7 +733,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/contrat/messaging.php b/htdocs/contrat/messaging.php index 5eaaac8d51f..edaeb02525b 100644 --- a/htdocs/contrat/messaging.php +++ b/htdocs/contrat/messaging.php @@ -53,13 +53,13 @@ $search_agenda_label = GETPOST('search_agenda_label'); $action = GETPOST('action', 'alpha'); $confirm = GETPOST('confirm', 'alpha'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); -$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ?GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -80,7 +80,7 @@ $object = new Contrat($db); $hookmanager->initHooks(array('agendacontract', 'globalcard')); // Security check -$id = GETPOST("id", 'int'); +$id = GETPOSTINT("id"); $socid = 0; if ($user->socid) { $socid = $user->socid; diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php index ec9f9da7dc2..996eace982f 100644 --- a/htdocs/contrat/note.php +++ b/htdocs/contrat/note.php @@ -37,8 +37,8 @@ $langs->loadLangs(array('companies', 'contracts')); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); -$socid = GETPOST('socid', 'int'); -$id = GETPOST('id', 'int'); +$socid = GETPOSTINT('socid'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Security check diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 69025a66d0f..eae46a028e6 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -44,10 +44,10 @@ $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always ' $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -71,8 +71,8 @@ $search_total_ttc = GETPOST("search_total_ttc", 'alpha'); $search_contract = GETPOST("search_contract", 'alpha'); $search_service = GETPOST("search_service", 'alpha'); $search_status = GETPOST("search_status", 'alpha'); -$search_product_category = GETPOST('search_product_category', 'int'); -$socid = GETPOST('socid', 'int'); +$search_product_category = GETPOSTINT('search_product_category'); +$socid = GETPOSTINT('socid'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'contractservicelist'.$mode; $opouvertureprevuemonth = GETPOST('opouvertureprevuemonth'); @@ -80,19 +80,19 @@ $opouvertureprevueday = GETPOST('opouvertureprevueday'); $opouvertureprevueyear = GETPOST('opouvertureprevueyear'); $filter_opouvertureprevue = GETPOST('filter_opouvertureprevue'); -$op1month = GETPOST('op1month', 'int'); -$op1day = GETPOST('op1day', 'int'); -$op1year = GETPOST('op1year', 'int'); +$op1month = GETPOSTINT('op1month'); +$op1day = GETPOSTINT('op1day'); +$op1year = GETPOSTINT('op1year'); $filter_op1 = GETPOST('filter_op1', 'alpha'); -$op2month = GETPOST('op2month', 'int'); -$op2day = GETPOST('op2day', 'int'); -$op2year = GETPOST('op2year', 'int'); +$op2month = GETPOSTINT('op2month'); +$op2day = GETPOSTINT('op2day'); +$op2year = GETPOSTINT('op2year'); $filter_op2 = GETPOST('filter_op2', 'alpha'); -$opcloturemonth = GETPOST('opcloturemonth', 'int'); -$opclotureday = GETPOST('opclotureday', 'int'); -$opclotureyear = GETPOST('opclotureyear', 'int'); +$opcloturemonth = GETPOSTINT('opcloturemonth'); +$opclotureday = GETPOSTINT('opclotureday'); +$opclotureyear = GETPOSTINT('opclotureyear'); $filter_opcloture = GETPOST('filter_opcloture', 'alpha'); @@ -107,7 +107,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_'); // Security check -$contratid = GETPOST('id', 'int'); +$contratid = GETPOSTINT('id'); if (!empty($user->socid)) { $socid = $user->socid; } diff --git a/htdocs/contrat/ticket.php b/htdocs/contrat/ticket.php index e4e1296ccdb..7c7cce00982 100644 --- a/htdocs/contrat/ticket.php +++ b/htdocs/contrat/ticket.php @@ -37,8 +37,8 @@ require_once DOL_DOCUMENT_ROOT."/ticket/class/ticket.class.php"; $langs->loadLangs(array('companies', 'contracts', 'tickets')); -$socid=GETPOST('socid', 'int'); -$id=GETPOST('id', 'int'); +$socid=GETPOSTINT('socid'); +$id=GETPOSTINT('id'); $ref=GETPOST('ref', 'alpha'); $action=GETPOST('action', 'alpha'); diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 9f5228561d0..1fac2f45c9e 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -110,9 +110,9 @@ if ($action == 'add' && !empty($permissiontoadd)) { $value = GETPOST($key, 'restricthtml'); } } elseif ($object->fields[$key]['type'] == 'date') { - $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt + $value = dol_mktime(12, 0, 0, GETPOSTINT($key.'month'), GETPOSTINT($key.'day'), GETPOSTINT($key.'year')); // for date without hour, we use gmt } elseif ($object->fields[$key]['type'] == 'datetime') { - $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel'); + $value = dol_mktime(GETPOSTINT($key.'hour'), GETPOSTINT($key.'min'), GETPOSTINT($key.'sec'), GETPOSTINT($key.'month'), GETPOSTINT($key.'day'), GETPOSTINT($key.'year'), 'tzuserrel'); } elseif ($object->fields[$key]['type'] == 'duration') { $value = 60 * 60 * GETPOSTINT($key.'hour') + 60 * GETPOSTINT($key.'min'); } elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) { @@ -263,12 +263,12 @@ if ($action == 'update' && !empty($permissiontoadd)) { $value = GETPOST($key, 'restricthtml'); } } elseif ($object->fields[$key]['type'] == 'date') { - $value = dol_mktime(12, 0, 0, GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int')); // for date without hour, we use gmt + $value = dol_mktime(12, 0, 0, GETPOSTINT($key.'month'), GETPOSTINT($key.'day'), GETPOSTINT($key.'year')); // for date without hour, we use gmt } elseif ($object->fields[$key]['type'] == 'datetime') { - $value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel'); + $value = dol_mktime(GETPOSTINT($key.'hour'), GETPOSTINT($key.'min'), GETPOSTINT($key.'sec'), GETPOSTINT($key.'month'), GETPOSTINT($key.'day'), GETPOSTINT($key.'year'), 'tzuserrel'); } elseif ($object->fields[$key]['type'] == 'duration') { - if (GETPOST($key.'hour', 'int') != '' || GETPOST($key.'min', 'int') != '') { - $value = 60 * 60 * GETPOST($key.'hour', 'int') + 60 * GETPOST($key.'min', 'int'); + if (GETPOSTINT($key.'hour') != '' || GETPOSTINT($key.'min') != '') { + $value = 60 * 60 * GETPOSTINT($key.'hour') + 60 * GETPOSTINT($key.'min'); } else { $value = ''; } @@ -353,8 +353,8 @@ if ($action == 'update' && !empty($permissiontoadd)) { // Action to update one modulebuilder field $reg = array(); -if (preg_match('/^set(\w+)$/', $action, $reg) && GETPOST('id', 'int') > 0 && !empty($permissiontoadd)) { - $object->fetch(GETPOST('id', 'int')); +if (preg_match('/^set(\w+)$/', $action, $reg) && GETPOSTINT('id') > 0 && !empty($permissiontoadd)) { + $object->fetch(GETPOSTINT('id')); $keyforfield = $reg[1]; if (property_exists($object, $keyforfield)) { @@ -378,8 +378,8 @@ if (preg_match('/^set(\w+)$/', $action, $reg) && GETPOST('id', 'int') > 0 && !em } // Action to update one extrafield -if ($action == "update_extras" && GETPOST('id', 'int') > 0 && !empty($permissiontoadd)) { - $object->fetch(GETPOST('id', 'int')); +if ($action == "update_extras" && GETPOSTINT('id') > 0 && !empty($permissiontoadd)) { + $object->fetch(GETPOSTINT('id')); $object->oldcopy = dol_clone($object, 2); diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php index 5efa4df394d..8e34bcdbc52 100644 --- a/htdocs/core/actions_builddoc.inc.php +++ b/htdocs/core/actions_builddoc.inc.php @@ -55,9 +55,9 @@ if ($action == 'builddoc' && ($permissiontoadd || !empty($usercangeneretedoc))) // Special case to force bank account //if (property_exists($object, 'fk_bank')) //{ - if (GETPOST('fk_bank', 'int')) { + if (GETPOSTINT('fk_bank')) { // this field may come from an external module - $object->fk_bank = GETPOST('fk_bank', 'int'); + $object->fk_bank = GETPOSTINT('fk_bank'); } elseif (!empty($object->fk_account)) { $object->fk_bank = $object->fk_account; } diff --git a/htdocs/core/actions_dellink.inc.php b/htdocs/core/actions_dellink.inc.php index 3ba1df0b0e8..9d5bb687c64 100644 --- a/htdocs/core/actions_dellink.inc.php +++ b/htdocs/core/actions_dellink.inc.php @@ -26,9 +26,9 @@ // $object must be defined // $permissiondellink must be defined -$dellinkid = GETPOST('dellinkid', 'int'); +$dellinkid = GETPOSTINT('dellinkid'); $addlink = GETPOST('addlink', 'alpha'); -$addlinkid = GETPOST('idtolinkto', 'int'); +$addlinkid = GETPOSTINT('idtolinkto'); $addlinkref = GETPOST('reftolinkto', 'alpha'); $cancellink = GETPOST('cancel', 'alpha'); diff --git a/htdocs/core/actions_extrafields.inc.php b/htdocs/core/actions_extrafields.inc.php index a563b791f51..affca98a90d 100644 --- a/htdocs/core/actions_extrafields.inc.php +++ b/htdocs/core/actions_extrafields.inc.php @@ -200,7 +200,7 @@ if ($action == 'add') { GETPOST('attrname', 'aZ09'), GETPOST('label', 'alpha'), $type, - GETPOST('pos', 'int'), + GETPOSTINT('pos'), $extrasize, $elementtype, (GETPOST('unique', 'alpha') ? 1 : 0), @@ -337,7 +337,7 @@ if ($action == 'update') { if (!$error) { if (GETPOSTISSET("attrname") && preg_match("/^\w[a-zA-Z0-9-_]*$/", GETPOST('attrname', 'aZ09')) && !is_numeric(GETPOST('attrname', 'aZ09'))) { - $pos = GETPOST('pos', 'int'); + $pos = GETPOSTINT('pos'); // Construct array for parameter (value of select list) $parameters = $param; $parameters_array = explode("\r\n", $parameters); diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index 28d5d33800c..ed0d8b4e8ec 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -28,7 +28,7 @@ // Protection to understand what happen when submitting files larger than post_max_size -if (GETPOST('uploadform', 'int') && empty($_POST) && empty($_FILES)) { +if (GETPOSTINT('uploadform') && empty($_POST) && empty($_FILES)) { dol_syslog("The PHP parameter 'post_max_size' is too low. All POST parameters and FILES were set to empty."); $langs->loadLangs(array("errors", "install")); print $langs->trans("ErrorFileSizeTooLarge").' '; @@ -77,7 +77,7 @@ if (GETPOST('sendit', 'alpha') && getDolGlobalString('MAIN_UPLOAD_DOC') && !empt if (GETPOST('section_dir', 'alpha')) { $generatethumbs = 0; } - $allowoverwrite = (GETPOST('overwritefile', 'int') ? 1 : 0); + $allowoverwrite = (GETPOSTINT('overwritefile') ? 1 : 0); if (!empty($upload_dirold) && getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO')) { $result = dol_add_file_process($upload_dirold, $allowoverwrite, 1, 'userfile', GETPOST('savingdocmask', 'alpha'), null, '', $generatethumbs, $object); @@ -130,7 +130,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissionto $fileold = $upload_dirold."/".$urlfile; } } - $linkid = GETPOST('linkid', 'int'); + $linkid = GETPOSTINT('linkid'); if ($urlfile) { // delete of a file @@ -192,7 +192,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissionto require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; $link = new Link($db); - $f = $link->fetch(GETPOST('linkid', 'int')); + $f = $link->fetch(GETPOSTINT('linkid')); if ($f) { $link->url = GETPOST('link', 'alpha'); if (substr($link->url, 0, 7) != 'http://' && substr($link->url, 0, 8) != 'https://' && substr($link->url, 0, 7) != 'file://') { @@ -299,12 +299,12 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes' && !empty($permissionto } // Update properties in ECM table - if (GETPOST('ecmfileid', 'int') > 0) { + if (GETPOSTINT('ecmfileid') > 0) { $shareenabled = GETPOST('shareenabled', 'alpha'); include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; $ecmfile = new EcmFiles($db); - $result = $ecmfile->fetch(GETPOST('ecmfileid', 'int')); + $result = $ecmfile->fetch(GETPOSTINT('ecmfileid')); if ($result > 0) { if ($shareenabled) { if (empty($ecmfile->share)) { diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 551c7b7c069..651b48e40a4 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -85,7 +85,7 @@ if (!$error && $massaction == 'confirm_presend') { $listofobjectref = array(); $contactidtosend = array(); $attachedfilesThirdpartyObj = array(); - $oneemailperrecipient = (GETPOST('oneemailperrecipient', 'int') ? 1 : 0); + $oneemailperrecipient = (GETPOSTINT('oneemailperrecipient') ? 1 : 0); if (!$error) { $objecttmp = new $objectclass($db); @@ -1270,7 +1270,7 @@ if (!$error && ($action == 'affecttag' && $confirm == 'yes') && $permissiontoadd if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoadd) { $db->begin(); if (GETPOSTISSET('pricerate')) { - $pricepercentage=GETPOST('pricerate', 'int'); + $pricepercentage=GETPOSTINT('pricerate'); if ($pricepercentage == 0) { setEventMessages($langs->trans("RecordsModified", 0), null); } else { @@ -1768,7 +1768,7 @@ if (!$error && ($massaction == 'clonetasks' || ($action == 'clonetasks' && $conf $taskid = $clone_task->create($user); if ($taskid > 0) { - $result = $clone_task->add_contact(GETPOST("userid", 'int'), 'TASKEXECUTIVE', 'internal'); + $result = $clone_task->add_contact(GETPOSTINT("userid"), 'TASKEXECUTIVE', 'internal'); $num++; } else { if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { @@ -1786,7 +1786,7 @@ if (!$error && ($massaction == 'clonetasks' || ($action == 'clonetasks' && $conf if (!$error) { setEventMessage($langs->trans('NumberOfTasksCloned', $num)); - header("Refresh: 1;URL=".DOL_URL_ROOT.'/projet/tasks.php?id=' . GETPOST('projectid', 'int')); + header("Refresh: 1;URL=".DOL_URL_ROOT.'/projet/tasks.php?id=' . GETPOSTINT('projectid')); } } diff --git a/htdocs/core/actions_setmoduleoptions.inc.php b/htdocs/core/actions_setmoduleoptions.inc.php index 1ca6c3d3697..27fb7649100 100644 --- a/htdocs/core/actions_setmoduleoptions.inc.php +++ b/htdocs/core/actions_setmoduleoptions.inc.php @@ -42,10 +42,10 @@ if ($action == 'update' && is_array($arrayofparameters) && !empty($user->admin)) // Modify constant only if key was posted (avoid resetting key to the null value) if (GETPOSTISSET($key)) { if (!empty($val['type']) && preg_match('/category:/', $val['type'])) { - if (GETPOST($key, 'int') == '-1') { + if (GETPOSTINT($key) == '-1') { $val_const = ''; } else { - $val_const = GETPOST($key, 'int'); + $val_const = GETPOSTINT($key); } } elseif ($val['type'] == 'html') { $val_const = GETPOST($key, 'restricthtml'); diff --git a/htdocs/core/actions_setnotes.inc.php b/htdocs/core/actions_setnotes.inc.php index 1e3efe420be..5f27c2a9091 100644 --- a/htdocs/core/actions_setnotes.inc.php +++ b/htdocs/core/actions_setnotes.inc.php @@ -59,9 +59,9 @@ if ($action == 'setnote_public' && !empty($permissionnote) && !GETPOST('cancel', $outputlangs->setDefaultLang($newlang); } $model = $object->model_pdf; - $hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); - $hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); - $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); + $hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); + $hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); + $hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_REF') ? 1 : 0)); //see #21072: Update a public note with a "document model not found" is not really a problem : the PDF is not created/updated //but the note is saved, so just add a notification will be enough diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index f5ea99e4b36..11c2392f953 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -53,10 +53,10 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call $urlsource = GETPOST("urlsource", 'alpha'); $search_doc_ref = GETPOST('search_doc_ref', 'alpha'); - $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; + $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST("sortfield", 'aZ09comma'); $sortorder = GETPOST("sortorder", 'aZ09comma'); - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); + $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -321,7 +321,7 @@ if ($type == 'directory') { $param .= '&website='.urlencode(GETPOST('website', 'alpha')); } if (!preg_match('/pageid=/', $param)) { - $param .= '&pageid='.urlencode(GETPOST('pageid', 'int')); + $param .= '&pageid='.urlencode(GETPOSTINT('pageid')); } //if (!preg_match('/backtopage=/',$param)) $param.='&backtopage='.urlencode($_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid); } diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php index 07c1b8b13b1..680e46a244c 100644 --- a/htdocs/core/ajax/ajaxdirtree.php +++ b/htdocs/core/ajax/ajaxdirtree.php @@ -74,7 +74,7 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call } $websitekey = GETPOST('websitekey', 'alpha'); -$pageid = GETPOST('pageid', 'int'); +$pageid = GETPOSTINT('pageid'); // Load translation files required by the page $langs->load("ecm"); diff --git a/htdocs/core/ajax/ajaxinvoiceline.php b/htdocs/core/ajax/ajaxinvoiceline.php index f575bf326ac..2ce44ea57e3 100644 --- a/htdocs/core/ajax/ajaxinvoiceline.php +++ b/htdocs/core/ajax/ajaxinvoiceline.php @@ -34,7 +34,7 @@ if (!defined('NOREQUIREAJAX')) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -$invoice_id = GETPOST('id', 'int'); // id of thirdparty +$invoice_id = GETPOSTINT('id'); // id of thirdparty $action = GETPOST('action', 'aZ09'); $htmlname = GETPOST('htmlname', 'alpha'); diff --git a/htdocs/core/ajax/ajaxstatusprospect.php b/htdocs/core/ajax/ajaxstatusprospect.php index 6fcb0dcfd78..1b389a32d4f 100644 --- a/htdocs/core/ajax/ajaxstatusprospect.php +++ b/htdocs/core/ajax/ajaxstatusprospect.php @@ -43,8 +43,8 @@ if (!defined('NOREQUIRESOC')) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; -$idstatus = GETPOST('id', 'int'); -$idprospect = GETPOST('prospectid', 'int'); +$idstatus = GETPOSTINT('id'); +$idprospect = GETPOSTINT('prospectid'); $action = GETPOST('action', 'aZ09'); $prospectstatic = new Client($db); diff --git a/htdocs/core/ajax/ajaxtooltip.php b/htdocs/core/ajax/ajaxtooltip.php index f76498c3b3c..782123ca317 100644 --- a/htdocs/core/ajax/ajaxtooltip.php +++ b/htdocs/core/ajax/ajaxtooltip.php @@ -47,7 +47,7 @@ $objecttype = GETPOST('objecttype', 'aZ09arobase'); // 'module' or 'myobject@mym $params = array('fromajaxtooltip' => 1); if (GETPOSTISSET('infologin')) { - $params['infologin'] = GETPOST('infologin', 'int'); + $params['infologin'] = GETPOSTINT('infologin'); } if (GETPOSTISSET('option')) { $params['option'] = GETPOST('option', 'restricthtml'); diff --git a/htdocs/core/ajax/bankconciliate.php b/htdocs/core/ajax/bankconciliate.php index c67f1455b42..deed93cecc4 100644 --- a/htdocs/core/ajax/bankconciliate.php +++ b/htdocs/core/ajax/bankconciliate.php @@ -60,8 +60,8 @@ top_httphead(); if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'dvnext') { // Increase date $al = new AccountLine($db); - $al->datev_next(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->datev_next(GETPOSTINT('rowid')); + $al->fetch(GETPOSTINT('rowid')); print ''.dol_print_date($al->datev, "day").''; @@ -71,8 +71,8 @@ if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consoli if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'dvprev') { // Decrease date $al = new AccountLine($db); - $al->datev_previous(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->datev_previous(GETPOSTINT('rowid')); + $al->fetch(GETPOSTINT('rowid')); print ''.dol_print_date($al->datev, "day").''; @@ -82,8 +82,8 @@ if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consoli if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'donext') { // Increase date $al = new AccountLine($db); - $al->dateo_next(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->dateo_next(GETPOSTINT('rowid')); + $al->fetch(GETPOSTINT('rowid')); print ''.dol_print_date($al->dateo, "day").''; @@ -93,8 +93,8 @@ if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consoli if (($user->hasRight('banque', 'modifier') || $user->hasRight('banque', 'consolidate')) && $action == 'doprev') { // Decrease date $al = new AccountLine($db); - $al->dateo_previous(GETPOST('rowid', 'int')); - $al->fetch(GETPOST('rowid', 'int')); + $al->dateo_previous(GETPOSTINT('rowid')); + $al->fetch(GETPOSTINT('rowid')); print ''.dol_print_date($al->dateo, "day").''; diff --git a/htdocs/core/ajax/box.php b/htdocs/core/ajax/box.php index 621d6878098..82bcdf68983 100644 --- a/htdocs/core/ajax/box.php +++ b/htdocs/core/ajax/box.php @@ -41,10 +41,10 @@ if (!defined('NOREQUIRESOC')) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; -$boxid = GETPOST('boxid', 'int'); +$boxid = GETPOSTINT('boxid'); $boxorder = GETPOST('boxorder'); -$zone = GETPOST('zone', 'int'); -$userid = GETPOST('userid', 'int'); +$zone = GETPOSTINT('zone'); +$userid = GETPOSTINT('userid'); // Security check if ($userid != $user->id) { diff --git a/htdocs/core/ajax/check_notifications.php b/htdocs/core/ajax/check_notifications.php index 4408e327e2b..e636b499745 100644 --- a/htdocs/core/ajax/check_notifications.php +++ b/htdocs/core/ajax/check_notifications.php @@ -95,7 +95,7 @@ $eventfound = array(); //$eventfound[]=array('type'=>'agenda', 'id'=>1, 'tipo'=>'eee', 'location'=>'aaa'); // TODO Remove use of $_SESSION['auto_check_events_not_before']. Seems not used. -if (empty($_SESSION['auto_check_events_not_before']) || $time >= $_SESSION['auto_check_events_not_before'] || GETPOST('forcechecknow', 'int')) { +if (empty($_SESSION['auto_check_events_not_before']) || $time >= $_SESSION['auto_check_events_not_before'] || GETPOSTINT('forcechecknow')) { /*$time_update = (int) $conf->global->MAIN_BROWSER_NOTIFICATION_FREQUENCY; // Always defined if (!empty($_SESSION['auto_check_events_not_before'])) { diff --git a/htdocs/core/ajax/constantonoff.php b/htdocs/core/ajax/constantonoff.php index 603de7408c0..7a7139fa6ff 100644 --- a/htdocs/core/ajax/constantonoff.php +++ b/htdocs/core/ajax/constantonoff.php @@ -49,7 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; $action = GETPOST('action', 'aZ09'); // set or del $name = GETPOST('name', 'alpha'); -$entity = GETPOST('entity', 'int'); +$entity = GETPOSTINT('entity'); $value = (GETPOST('value', 'aZ09') != '' ? GETPOST('value', 'aZ09') : 1); // Security check diff --git a/htdocs/core/ajax/contacts.php b/htdocs/core/ajax/contacts.php index 4577fccf3c6..7c2f113510c 100644 --- a/htdocs/core/ajax/contacts.php +++ b/htdocs/core/ajax/contacts.php @@ -34,10 +34,10 @@ if (!defined('NOREQUIREAJAX')) { // Load Dolibarr environment require '../../main.inc.php'; -$id = GETPOST('id', 'int'); // id of thirdparty +$id = GETPOSTINT('id'); // id of thirdparty $action = GETPOST('action', 'aZ09'); $htmlname = GETPOST('htmlname', 'alpha'); -$showempty = GETPOST('showempty', 'int'); +$showempty = GETPOSTINT('showempty'); // Security check $result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); diff --git a/htdocs/core/ajax/extraparams.php b/htdocs/core/ajax/extraparams.php index 0adef3e9d74..9b63da251f5 100644 --- a/htdocs/core/ajax/extraparams.php +++ b/htdocs/core/ajax/extraparams.php @@ -39,7 +39,7 @@ if (!defined('NOREQUIRESOC')) { include '../../main.inc.php'; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $element = GETPOST('element', 'aZ09arobase'); $htmlelement = GETPOST('htmlelement', 'alpha'); $type = GETPOST('type', 'alpha'); diff --git a/htdocs/core/ajax/fileupload.php b/htdocs/core/ajax/fileupload.php index 1825477758a..44e0c943bc1 100644 --- a/htdocs/core/ajax/fileupload.php +++ b/htdocs/core/ajax/fileupload.php @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/fileupload.class.php'; // Class to u require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; -$id = GETPOST('fk_element', 'int'); +$id = GETPOSTINT('fk_element'); $element = GETPOST('element', 'alpha'); // 'myobject' (myobject=mymodule) or 'myobject@mymodule' or 'myobject_mysubobject' (myobject=mymodule) $elementupload = $element; diff --git a/htdocs/core/ajax/objectonoff.php b/htdocs/core/ajax/objectonoff.php index 1bc87d06145..e70ea0b98e0 100644 --- a/htdocs/core/ajax/objectonoff.php +++ b/htdocs/core/ajax/objectonoff.php @@ -44,10 +44,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage'); -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $element = GETPOST('element', 'alpha'); // 'myobject' (myobject=mymodule) or 'myobject@mymodule' or 'myobject_mysubobject' (myobject=mymodule) $field = GETPOST('field', 'alpha'); -$value = GETPOST('value', 'int'); +$value = GETPOSTINT('value'); $format = 'int'; // Load object according to $id and $element diff --git a/htdocs/core/ajax/selectobject.php b/htdocs/core/ajax/selectobject.php index edc5eb32998..aa702375d3e 100644 --- a/htdocs/core/ajax/selectobject.php +++ b/htdocs/core/ajax/selectobject.php @@ -45,7 +45,7 @@ $extrafields = new ExtraFields($db); $objectdesc = GETPOST('objectdesc', 'alphanohtml', 0, null, null, 1); $htmlname = GETPOST('htmlname', 'aZ09'); -$outjson = (GETPOST('outjson', 'int') ? GETPOST('outjson', 'int') : 0); +$outjson = (GETPOSTINT('outjson') ? GETPOSTINT('outjson') : 0); $id = GETPOSTINT('id'); $objectfield = GETPOST('objectfield', 'alpha'); // 'MyObject:field' or 'MyModule_MyObject:field' or 'MyObject:option_field' or 'MyModule_MyObject:option_field' diff --git a/htdocs/core/ajax/vatrates.php b/htdocs/core/ajax/vatrates.php index a1049287f53..06173974d97 100644 --- a/htdocs/core/ajax/vatrates.php +++ b/htdocs/core/ajax/vatrates.php @@ -33,11 +33,11 @@ if (!defined('NOREQUIREAJAX')) { // Load Dolibarr environment require '../../main.inc.php'; -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); // 'getSellerVATRates' or 'getBuyerVATRates' $htmlname = GETPOST('htmlname', 'alpha'); $selected = (GETPOST('selected') ? GETPOST('selected') : '-1'); -$productid = (GETPOST('productid', 'int') ? GETPOST('productid', 'int') : 0); +$productid = (GETPOSTINT('productid') ? GETPOSTINT('productid') : 0); // Security check $result = restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0); diff --git a/htdocs/core/bookmarks_page.php b/htdocs/core/bookmarks_page.php index e7ced61cff3..a24918273d8 100644 --- a/htdocs/core/bookmarks_page.php +++ b/htdocs/core/bookmarks_page.php @@ -56,10 +56,10 @@ $left = ($langs->trans("DIRECTION") == 'rtl' ? 'right' : 'left'); */ // Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access. -if (empty($dolibarr_nocache) && GETPOST('cache', 'int')) { - header('Cache-Control: max-age='.GETPOST('cache', 'int').', public'); +if (empty($dolibarr_nocache) && GETPOSTINT('cache')) { + header('Cache-Control: max-age='.GETPOSTINT('cache').', public'); // For a .php, we must set an Expires to avoid to have it forced to an expired value by the web server - header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + GETPOST('cache', 'int')).' GMT'); + header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + GETPOSTINT('cache')).' GMT'); // HTTP/1.0 header('Pragma: token=public'); } else { diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index c6db2ca40e5..74b31a3daaf 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -106,7 +106,7 @@ class box_graph_invoices_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $endyear = GETPOST($param_year, 'int'); + $endyear = GETPOSTINT($param_year); $shownb = GETPOST($param_shownb, 'alpha'); $showtot = GETPOST($param_showtot, 'alpha'); } else { diff --git a/htdocs/core/boxes/box_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php index cd3ee464eb2..f6decd57660 100644 --- a/htdocs/core/boxes/box_graph_invoices_peryear.php +++ b/htdocs/core/boxes/box_graph_invoices_peryear.php @@ -102,7 +102,7 @@ class box_graph_invoices_peryear extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $endyear = GETPOST($param_year, 'int'); + $endyear = GETPOSTINT($param_year); $showtot = GETPOST($param_showtot, 'alpha'); } else { $tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true); diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 97fa847f897..818398324c8 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -102,7 +102,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $endyear = GETPOST($param_year, 'int'); + $endyear = GETPOSTINT($param_year); $shownb = GETPOST($param_shownb, 'alpha'); $showtot = GETPOST($param_showtot, 'alpha'); } else { diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index f0021fe403a..ce11fe9e93d 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -105,7 +105,7 @@ class box_graph_orders_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $endyear = GETPOST($param_year, 'int'); + $endyear = GETPOSTINT($param_year); $shownb = GETPOST($param_shownb, 'alpha'); $showtot = GETPOST($param_showtot, 'alpha'); } else { diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index ca1da74b1bc..9b7e40ab20f 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -104,7 +104,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/commande/class/commandestats.class.php'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $endyear = GETPOST($param_year, 'int'); + $endyear = GETPOSTINT($param_year); $shownb = GETPOST($param_shownb, 'alpha'); $showtot = GETPOST($param_showtot, 'alpha'); } else { diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 7bb406ff64e..a90b8604060 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -80,7 +80,7 @@ class box_graph_product_distribution extends ModeleBoxes $param_showordernb = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showordernb'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $year = GETPOST($param_year, 'int'); + $year = GETPOSTINT($param_year); $showinvoicenb = GETPOST($param_showinvoicenb, 'alpha'); $showpropalnb = GETPOST($param_showpropalnb, 'alpha'); $showordernb = GETPOST($param_showordernb, 'alpha'); diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 796ba81a306..0192ecf2b12 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -105,7 +105,7 @@ class box_graph_propales_permonth extends ModeleBoxes include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propalestats.class.php'; $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE')); if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) { - $endyear = GETPOST($param_year, 'int'); + $endyear = GETPOSTINT($param_year); $shownb = GETPOST($param_shownb, 'alpha'); $showtot = GETPOST($param_showtot, 'alpha'); } else { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 33bd720fbdf..9f18717db03 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6177,11 +6177,11 @@ abstract class CommonObject if (in_array($key_type, array('date'))) { // Clean parameters // TODO GMT date in memory must be GMT so we should add gm=true in parameters - $value_key = dol_mktime(0, 0, 0, GETPOST($postfieldkey."month", 'int'), GETPOST($postfieldkey."day", 'int'), GETPOST($postfieldkey."year", 'int')); + $value_key = dol_mktime(0, 0, 0, GETPOSTINT($postfieldkey."month"), GETPOSTINT($postfieldkey."day"), GETPOSTINT($postfieldkey."year")); } elseif (in_array($key_type, array('datetime'))) { // Clean parameters // TODO GMT date in memory must be GMT so we should add gm=true in parameters - $value_key = dol_mktime(GETPOST($postfieldkey."hour", 'int'), GETPOST($postfieldkey."min", 'int'), 0, GETPOST($postfieldkey."month", 'int'), GETPOST($postfieldkey."day", 'int'), GETPOST($postfieldkey."year", 'int')); + $value_key = dol_mktime(GETPOSTINT($postfieldkey."hour"), GETPOSTINT($postfieldkey."min"), 0, GETPOSTINT($postfieldkey."month"), GETPOSTINT($postfieldkey."day"), GETPOSTINT($postfieldkey."year")); } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { $value_arr = GETPOST($postfieldkey, 'array'); // check if an array if (!empty($value_arr)) { @@ -7760,9 +7760,9 @@ abstract class CommonObject } $paramforthenewlink = ''; $paramforthenewlink .= (GETPOSTISSET('action') ? '&action='.GETPOST('action', 'aZ09') : ''); - $paramforthenewlink .= (GETPOSTISSET('id') ? '&id='.GETPOST('id', 'int') : ''); + $paramforthenewlink .= (GETPOSTISSET('id') ? '&id='.GETPOSTINT('id') : ''); $paramforthenewlink .= (GETPOSTISSET('origin') ? '&origin='.GETPOST('origin', 'aZ09') : ''); - $paramforthenewlink .= (GETPOSTISSET('originid') ? '&originid='.GETPOST('originid', 'int') : ''); + $paramforthenewlink .= (GETPOSTISSET('originid') ? '&originid='.GETPOSTINT('originid') : ''); $paramforthenewlink .= '&fk_'.strtolower($class).'=--IDFORBACKTOPAGE--'; // TODO Add JavaScript code to add input fields already filled into $paramforthenewlink so we won't loose them when going back to main page $out .= ''; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 2153ad048a2..7bcdab198e0 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -2049,7 +2049,7 @@ class ExtraFields $expand_display = false; if (is_array($extrafield_param_list) && count($extrafield_param_list) > 0) { $extrafield_collapse_display_value = intval($extrafield_param_list[0]); - $expand_display = ((isset($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) || GETPOST('ignorecollapsesetup', 'int')) ? (empty($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) ? false : true) : ($extrafield_collapse_display_value == 2 ? false : true)); + $expand_display = ((isset($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) || GETPOSTINT('ignorecollapsesetup')) ? (empty($_COOKIE['DOLCOLLAPSE_'.$object->table_element.'_extrafields_'.$key]) ? false : true) : ($extrafield_collapse_display_value == 2 ? false : true)); } $disabledcookiewrite = 0; if ($mode == 'create') { @@ -2207,13 +2207,13 @@ class ExtraFields if (in_array($key_type, array('date'))) { // Clean parameters - $value_key = dol_mktime(12, 0, 0, GETPOST("options_".$key."month", 'int'), GETPOST("options_".$key."day", 'int'), GETPOST("options_".$key."year", 'int')); + $value_key = dol_mktime(12, 0, 0, GETPOSTINT("options_".$key."month"), GETPOSTINT("options_".$key."day"), GETPOSTINT("options_".$key."year")); } elseif (in_array($key_type, array('datetime'))) { // Clean parameters - $value_key = dol_mktime(GETPOST("options_".$key."hour", 'int'), GETPOST("options_".$key."min", 'int'), GETPOST("options_".$key."sec", 'int'), GETPOST("options_".$key."month", 'int'), GETPOST("options_".$key."day", 'int'), GETPOST("options_".$key."year", 'int'), 'tzuserrel'); + $value_key = dol_mktime(GETPOSTINT("options_".$key."hour"), GETPOSTINT("options_".$key."min"), GETPOSTINT("options_".$key."sec"), GETPOSTINT("options_".$key."month"), GETPOSTINT("options_".$key."day"), GETPOSTINT("options_".$key."year"), 'tzuserrel'); } elseif (in_array($key_type, array('datetimegmt'))) { // Clean parameters - $value_key = dol_mktime(GETPOST("options_".$key."hour", 'int'), GETPOST("options_".$key."min", 'int'), GETPOST("options_".$key."sec", 'int'), GETPOST("options_".$key."month", 'int'), GETPOST("options_".$key."day", 'int'), GETPOST("options_".$key."year", 'int'), 'gmt'); + $value_key = dol_mktime(GETPOSTINT("options_".$key."hour"), GETPOSTINT("options_".$key."min"), GETPOSTINT("options_".$key."sec"), GETPOSTINT("options_".$key."month"), GETPOSTINT("options_".$key."day"), GETPOSTINT("options_".$key."year"), 'gmt'); } elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) { $value_arr = GETPOST("options_".$key, 'array'); // check if an array if (!empty($value_arr)) { @@ -2304,14 +2304,14 @@ class ExtraFields $value_key = array(); // values provided as a component year, month, day, etc. if (GETPOST($dateparamname_start . 'year')) { - $value_key['start'] = dol_mktime(0, 0, 0, GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int')); + $value_key['start'] = dol_mktime(0, 0, 0, GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year')); } if (GETPOST($dateparamname_start . 'year')) { - $value_key['end'] = dol_mktime(23, 59, 59, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int')); + $value_key['end'] = dol_mktime(23, 59, 59, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year')); } } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { // Clean parameters - $value_key = dol_mktime(12, 0, 0, GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int')); + $value_key = dol_mktime(12, 0, 0, GETPOSTINT($keysuffix."options_".$key.$keyprefix."month"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."day"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."year")); } else { continue; // Value was not provided, we should not set it. } @@ -2320,26 +2320,26 @@ class ExtraFields $dateparamname_end = $keysuffix . 'options_' . $key . $keyprefix . '_end'; if (GETPOST($dateparamname_start . 'year') && GETPOST($dateparamname_end . 'year')) { // values provided as a date pair (start date + end date), each date being broken down as year, month, day, etc. - $dateparamname_end_hour = GETPOST($dateparamname_end . 'hour', 'int') != '-1' ? GETPOST($dateparamname_end . 'hour', 'int') : '23'; - $dateparamname_end_min = GETPOST($dateparamname_end . 'min', 'int') != '-1' ? GETPOST($dateparamname_end . 'min', 'int') : '59'; - $dateparamname_end_sec = GETPOST($dateparamname_end . 'sec', 'int') != '-1' ? GETPOST($dateparamname_end . 'sec', 'int') : '59'; + $dateparamname_end_hour = GETPOSTINT($dateparamname_end . 'hour') != '-1' ? GETPOSTINT($dateparamname_end . 'hour') : '23'; + $dateparamname_end_min = GETPOSTINT($dateparamname_end . 'min') != '-1' ? GETPOSTINT($dateparamname_end . 'min') : '59'; + $dateparamname_end_sec = GETPOSTINT($dateparamname_end . 'sec') != '-1' ? GETPOSTINT($dateparamname_end . 'sec') : '59'; if ($key_type == 'datetimegmt') { $value_key = array( - 'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'gmt'), - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'gmt') + 'start' => dol_mktime(GETPOSTINT($dateparamname_start . 'hour'), GETPOSTINT($dateparamname_start . 'min'), GETPOSTINT($dateparamname_start . 'sec'), GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'gmt'), + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'gmt') ); } else { $value_key = array( - 'start' => dol_mktime(GETPOST($dateparamname_start . 'hour', 'int'), GETPOST($dateparamname_start . 'min', 'int'), GETPOST($dateparamname_start . 'sec', 'int'), GETPOST($dateparamname_start . 'month', 'int'), GETPOST($dateparamname_start . 'day', 'int'), GETPOST($dateparamname_start . 'year', 'int'), 'tzuserrel'), - 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOST($dateparamname_end . 'month', 'int'), GETPOST($dateparamname_end . 'day', 'int'), GETPOST($dateparamname_end . 'year', 'int'), 'tzuserrel') + 'start' => dol_mktime(GETPOSTINT($dateparamname_start . 'hour'), GETPOSTINT($dateparamname_start . 'min'), GETPOSTINT($dateparamname_start . 'sec'), GETPOSTINT($dateparamname_start . 'month'), GETPOSTINT($dateparamname_start . 'day'), GETPOSTINT($dateparamname_start . 'year'), 'tzuserrel'), + 'end' => dol_mktime($dateparamname_end_hour, $dateparamname_end_min, $dateparamname_end_sec, GETPOSTINT($dateparamname_end . 'month'), GETPOSTINT($dateparamname_end . 'day'), GETPOSTINT($dateparamname_end . 'year'), 'tzuserrel') ); } } elseif (GETPOST($keysuffix."options_".$key.$keyprefix."year")) { // Clean parameters if ($key_type == 'datetimegmt') { - $value_key = dol_mktime(GETPOST($keysuffix."options_".$key.$keyprefix."hour", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."min", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."sec", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int'), 'gmt'); + $value_key = dol_mktime(GETPOSTINT($keysuffix."options_".$key.$keyprefix."hour"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."min"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."sec"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."month"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."day"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."year"), 'gmt'); } else { - $value_key = dol_mktime(GETPOST($keysuffix."options_".$key.$keyprefix."hour", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."min", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."sec", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."month", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."day", 'int'), GETPOST($keysuffix."options_".$key.$keyprefix."year", 'int'), 'tzuserrel'); + $value_key = dol_mktime(GETPOSTINT($keysuffix."options_".$key.$keyprefix."hour"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."min"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."sec"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."month"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."day"), GETPOSTINT($keysuffix."options_".$key.$keyprefix."year"), 'tzuserrel'); } } else { continue; // Value was not provided, we should not set it. diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 78e5d7e0e9e..731b0514ef9 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -521,7 +521,7 @@ class FormMail extends Form // Zone to select email template if (count($modelmail_array) > 0) { - $model_mail_selected_id = GETPOSTISSET('modelmailselected') ? GETPOST('modelmailselected', 'int') : ($arraydefaultmessage->id > 0 ? $arraydefaultmessage->id : 0); + $model_mail_selected_id = GETPOSTISSET('modelmailselected') ? GETPOSTINT('modelmailselected') : ($arraydefaultmessage->id > 0 ? $arraydefaultmessage->id : 0); // If list of template is filled $out .= '
'."\n"; diff --git a/htdocs/core/class/html.formsetup.class.php b/htdocs/core/class/html.formsetup.class.php index 1852fc9f878..d6e0e56f688 100644 --- a/htdocs/core/class/html.formsetup.class.php +++ b/htdocs/core/class/html.formsetup.class.php @@ -774,10 +774,10 @@ class FormSetupItem // Modify constant only if key was posted (avoid resetting key to the null value) if ($this->type != 'title') { if (preg_match('/category:/', $this->type)) { - if (GETPOST($this->confKey, 'int') == '-1') { + if (GETPOSTINT($this->confKey) == '-1') { $val_const = ''; } else { - $val_const = GETPOST($this->confKey, 'int'); + $val_const = GETPOSTINT($this->confKey); } } elseif ($this->type == 'multiselect') { $val = GETPOST($this->confKey, 'array'); diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 06e42777894..b240c62cd7c 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -320,7 +320,7 @@ class FormTicket dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); $classname = ucfirst($subelement); $objectsrc = new $classname($this->db); - $objectsrc->fetch(GETPOST('originid', 'int')); + $objectsrc->fetch(GETPOSTINT('originid')); if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) { $objectsrc->fetch_lines(); @@ -639,7 +639,7 @@ class FormTicket print $langs->trans("AssignedTo"); print '
'; print ''; } @@ -648,7 +648,7 @@ class FormTicket if (isModEnabled('project') && !$this->ispublic) { $formproject = new FormProjets($this->db); print ''; } } @@ -658,7 +658,7 @@ class FormTicket $formcontract = new FormContract($this->db); print ''; } } @@ -1371,7 +1371,7 @@ class FormTicket print "\n\n"; - $send_email = GETPOST('send_email', 'int') ? GETPOST('send_email', 'int') : 0; + $send_email = GETPOSTINT('send_email') ? GETPOSTINT('send_email') : 0; // Example 1 : Adding jquery code print ''; } - $checked = (GETPOST('superadmin', 'int') ? ' checked' : ''); - $disabled = (GETPOST('superadmin', 'int') ? '' : ' disabled'); + $checked = (GETPOSTINT('superadmin') ? ' checked' : ''); + $disabled = (GETPOSTINT('superadmin') ? '' : ' disabled'); print '
'; print img_picto('', 'user', 'class="pictofixedwidth"'); - print $form->select_dolusers(GETPOST('fk_user_assign', 'int'), 'fk_user_assign', 1); + print $form->select_dolusers(GETPOSTINT('fk_user_assign'), 'fk_user_assign', 1); print '
'; - print img_picto('', 'project').$formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); + print img_picto('', 'project').$formproject->select_projects(-1, GETPOSTINT('projectid'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500'); print '
'; print img_picto('', 'contract'); - print $formcontract->select_contract(-1, GETPOST('contactid', 'int'), 'contractid', 0, 1, 1); + print $formcontract->select_contract(-1, GETPOSTINT('contactid'), 'contractid', 0, 1, 1); print '
'; } - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1, '/variants/tpl', ($permissiontoedit ? 1 : 0)); + $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1, '/variants/tpl', ($permissiontoedit ? 1 : 0)); if (!empty($object->lines) || ($permissiontoedit && $action != 'selectlines' && $action != 'editline')) { print '
'; diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index 83449b1fccb..e34cf104d40 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination2ValuePair.cla $langs->loadLangs(array("products", "other")); -$id = GETPOST('id', 'int'); -$valueid = GETPOST('valueid', 'int'); +$id = GETPOSTINT('id'); +$valueid = GETPOSTINT('valueid'); $ref = GETPOST('ref', 'alpha'); $weight_impact = price2num(GETPOST('weight_impact', 'alpha'), 2); $price_impact_percent = (bool) GETPOST('price_impact_percent'); @@ -47,7 +47,7 @@ $form = new Form($db); $action = GETPOST('action', 'aZ09'); $massaction = GETPOST('massaction', 'alpha'); -$show_files = GETPOST('show_files', 'int'); +$show_files = GETPOSTINT('show_files'); $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $cancel = GETPOST('cancel', 'alpha'); @@ -115,8 +115,8 @@ if ($action == 'add') { } if ($action == 'create' && GETPOST('selectvariant', 'alpha')) { // We click on select combination $action = 'add'; - $attribute_id = GETPOST('attribute', 'int'); - $attribute_value_id = GETPOST('value', 'int'); + $attribute_id = GETPOSTINT('attribute'); + $attribute_value_id = GETPOSTINT('value'); if ($attribute_id> 0 && $attribute_value_id > 0) { $feature = $attribute_id . '-' . $attribute_value_id; $selectedvariant[$feature] = $feature; diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index a16e6677780..4115d3b4c8f 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -32,7 +32,7 @@ $langs->loadLangs(array("products", "other")); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -41,13 +41,13 @@ $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', ...) -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -83,8 +83,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } $search['nb_of_values'] = GETPOST('search_nb_of_values', 'alpha'); @@ -412,9 +412,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } @@ -439,7 +439,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 0c22ac89a53..c5b582cc254 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -133,7 +133,7 @@ $original_file = GETPOST('file', 'alphanohtml'); // Do not use urldecode here ( $hashp = GETPOST('hashp', 'aZ09', 1); // Must be read only by GET $modulepart = GETPOST('modulepart', 'alpha', 1); // Must be read only by GET $urlsource = GETPOST('urlsource', 'alpha'); -$entity = (GETPOST('entity', 'int') ? GETPOST('entity', 'int') : $conf->entity); +$entity = (GETPOSTINT('entity') ? GETPOSTINT('entity') : $conf->entity); // Security check if (empty($modulepart) && empty($hashp)) { diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index 69cc920f1c5..f12b7ee8869 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -35,7 +35,7 @@ global $conf, $db, $hookmanager, $langs, $user; $langs->loadLangs(array('other')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); @@ -43,7 +43,7 @@ $cancel = GETPOST('cancel', 'aZ09'); $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'targetcard'; // To manage different context of search $backtopage = GETPOST('backtopage', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); -$lineid = GETPOST('lineid', 'int'); +$lineid = GETPOSTINT('lineid'); // Initialize technical objects $object = new Target($db); @@ -148,10 +148,10 @@ if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; if ($action == 'set_thirdparty' && $permissiontoadd) { - $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, $triggermodname); + $object->setValueFrom('fk_soc', GETPOSTINT('fk_soc'), '', '', 'date', '', $user, $triggermodname); } if ($action == 'classin' && $permissiontoadd) { - $object->setProject(GETPOST('projectid', 'int')); + $object->setProject(GETPOSTINT('projectid')); } // Actions to send emails @@ -408,7 +408,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Show object lines $result = $object->getLinesArray(); - print ' + print ' @@ -426,7 +426,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } if (!empty($object->lines)) { - $object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1); + $object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1); } // Form to add new line diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index ec84caa8e46..83deb784f41 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -39,7 +39,7 @@ $langs->loadLangs(array('other')); // Get Parameters $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -51,13 +51,13 @@ if (empty($mode)) { $mode = 'modulesetup'; } -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -95,8 +95,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -447,7 +447,7 @@ $arrayofmassactions = array( if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/webportal/class/html.formcardwebportal.class.php b/htdocs/webportal/class/html.formcardwebportal.class.php index 1f4c31726ca..d0d9531436e 100644 --- a/htdocs/webportal/class/html.formcardwebportal.class.php +++ b/htdocs/webportal/class/html.formcardwebportal.class.php @@ -335,8 +335,8 @@ class FormCardWebPortal } $value = dol_mktime($timeHours, $timeMinutes, $timeSeconds, $dateMonth, $dateDay, $dateYear); } elseif ($object->fields[$key]['type'] == 'duration') { - if (GETPOST($key . 'hour', 'int') != '' || GETPOST($key . 'min', 'int') != '') { - $value = 60 * 60 * GETPOST($key . 'hour', 'int') + 60 * GETPOST($key . 'min', 'int'); + if (GETPOSTINT($key . 'hour') != '' || GETPOSTINT($key . 'min') != '') { + $value = 60 * 60 * GETPOSTINT($key . 'hour') + 60 * GETPOSTINT($key . 'min'); } else { $value = ''; } @@ -655,7 +655,7 @@ class FormCardWebPortal $html .= '
'; if (in_array($val['type'], array('int', 'integer'))) { - $value = GETPOSTISSET($key) ? GETPOST($key, 'int') : $object->$key; + $value = GETPOSTISSET($key) ? GETPOSTINT($key) : $object->$key; } elseif ($val['type'] == 'double') { $value = GETPOSTISSET($key) ? price2num(GETPOST($key, 'alphanohtml')) : $object->$key; } elseif (preg_match('/^text/', $val['type'])) { diff --git a/htdocs/webportal/class/html.formlistwebportal.class.php b/htdocs/webportal/class/html.formlistwebportal.class.php index 1ba917f382a..c850c424377 100644 --- a/htdocs/webportal/class/html.formlistwebportal.class.php +++ b/htdocs/webportal/class/html.formlistwebportal.class.php @@ -142,10 +142,10 @@ class FormListWebPortal // set form list $this->action = GETPOST('action', 'aZ09'); $this->object = $object; - $this->limit = GETPOSTISSET('limit') ? (int) GETPOST('limit', 'int') : -1; + $this->limit = GETPOSTISSET('limit') ? GETPOSTINT('limit') : -1; $this->sortfield = GETPOST('sortfield', 'aZ09comma'); $this->sortorder = GETPOST('sortorder', 'aZ09comma'); - $this->page = GETPOSTISSET('page') ? (int) GETPOST('page', 'int') : 1; + $this->page = GETPOSTISSET('page') ? GETPOSTINT('page') : 1; $this->titleKey = $objectclass . 'ListTitle'; // Initialize array of search criteria @@ -303,7 +303,7 @@ class FormListWebPortal $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"; } @@ -413,9 +413,9 @@ class FormListWebPortal } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_' . $key . 'month=' . ((int) GETPOST('search_' . $key . 'month', 'int')); - $param .= '&search_' . $key . 'day=' . ((int) GETPOST('search_' . $key . 'day', 'int')); - $param .= '&search_' . $key . 'year=' . ((int) GETPOST('search_' . $key . 'year', 'int')); + $param .= '&search_' . $key . 'month=' . (GETPOSTINT('search_' . $key . 'month')); + $param .= '&search_' . $key . 'day=' . (GETPOSTINT('search_' . $key . 'day')); + $param .= '&search_' . $key . 'year=' . (GETPOSTINT('search_' . $key . 'year')); } elseif ($search[$key] != '') { $param .= '&search_' . $key . '=' . urlencode($search[$key]); } diff --git a/htdocs/webportal/controllers/document.controller.class.php b/htdocs/webportal/controllers/document.controller.class.php index 9f5cd408867..d09b4dc5fb2 100644 --- a/htdocs/webportal/controllers/document.controller.class.php +++ b/htdocs/webportal/controllers/document.controller.class.php @@ -89,8 +89,8 @@ class DocumentController extends Controller $action = GETPOST('action', 'aZ09'); $original_file = GETPOST('file', 'alphanohtml'); // Do not use urldecode here ($_GET are already decoded by PHP). $modulepart = GETPOST('modulepart', 'alpha'); - $entity = GETPOST('entity', 'int') ? GETPOST('entity', 'int') : $conf->entity; - $socId = (int) GETPOST('soc_id', 'int'); + $entity = GETPOSTINT('entity') ? GETPOSTINT('entity') : $conf->entity; + $socId = GETPOSTINT('soc_id'); // Security check if (empty($modulepart)) { diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 0cf1abe101e..d55b81d1151 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -62,10 +62,10 @@ if (!$user->hasRight('website', 'read')) { $conf->dol_hide_leftmenu = 1; // Force hide of left menu. $error = 0; -$websiteid = GETPOST('websiteid', 'int'); +$websiteid = GETPOSTINT('websiteid'); $websitekey = GETPOST('website', 'alpha'); $page = GETPOST('page', 'alpha'); -$pageid = GETPOST('pageid', 'int'); +$pageid = GETPOSTINT('pageid'); $pageref = GETPOST('pageref', 'alphanohtml'); $action = GETPOST('action', 'aZ09'); @@ -76,8 +76,8 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'websitelist'; // 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') -$dol_hide_topmenu = GETPOST('dol_hide_topmenu', 'int'); -$dol_hide_leftmenu = GETPOST('dol_hide_leftmenu', 'int'); +$dol_hide_topmenu = GETPOSTINT('dol_hide_topmenu'); +$dol_hide_leftmenu = GETPOSTINT('dol_hide_leftmenu'); $dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09'); $type_container = GETPOST('WEBSITE_TYPE_CONTAINER', 'alpha'); @@ -142,10 +142,10 @@ if (GETPOST('refreshsite') || GETPOST('refreshsite_x') || GETPOST('refreshsite.x } // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 @@ -342,8 +342,8 @@ if ($action == 'replacesite' || $mode == 'replacesite') { $containertype = GETPOST('optioncontainertype', 'aZ09') != '-1' ? GETPOST('optioncontainertype', 'aZ09') : ''; $langcode = GETPOST('optionlanguage', 'aZ09'); $otherfilters = array(); - if (GETPOST('optioncategory', 'int') > 0) { - $otherfilters['category'] = GETPOST('optioncategory', 'int'); + if (GETPOSTINT('optioncategory') > 0) { + $otherfilters['category'] = GETPOSTINT('optioncategory'); } $listofpages = getPagesFromSearchCriterias($containertype, $algo, $searchkey, 1000, $sortfield, $sortorder, $langcode, $otherfilters, -1); @@ -430,36 +430,36 @@ if ($action == 'renamefile') { // Must be after include DOL_DOCUMENT_ROOT.'/core if ($action == 'setwebsiteonline' && $usercanedit) { $website->setStatut($website::STATUS_VALIDATED, null, '', 'WEBSITE_MODIFY', 'status'); - header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('websitepage', 'int')); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOSTINT('website').'&pageid='.GETPOSTINT('websitepage')); exit; } if ($action == 'setwebsiteoffline' && $usercanedit) { $result = $website->setStatut($website::STATUS_DRAFT, null, '', 'WEBSITE_MODIFY', 'status'); - header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('websitepage', 'int')); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOSTINT('website').'&pageid='.GETPOSTINT('websitepage')); exit; } if ($action == 'seteditinline') { // No need of write permission dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 1); setEventMessages($langs->trans("FeatureNotYetAvailable"), null, 'warnings'); //dolibarr_set_const($db, 'WEBSITE_SUBCONTAINERSINLINE', 0); // Force disable of 'Include dynamic content' - header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('pageid', 'int')); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOSTINT('website').'&pageid='.GETPOSTINT('pageid')); exit; } if ($action == 'unseteditinline') { // No need of write permission dolibarr_del_const($db, 'WEBSITE_EDITINLINE'); - header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('pageid', 'int')); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOSTINT('website').'&pageid='.GETPOSTINT('pageid')); exit; } if ($action == 'setshowsubcontainers') { // No need of write permission dolibarr_set_const($db, 'WEBSITE_SUBCONTAINERSINLINE', 1); //dolibarr_set_const($db, 'WEBSITE_EDITINLINE', 0); // Force disable of edit inline - header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('pageid', 'int')); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOSTINT('website').'&pageid='.GETPOSTINT('pageid')); exit; } if ($action == 'unsetshowsubcontainers') { // No need of write permission dolibarr_del_const($db, 'WEBSITE_SUBCONTAINERSINLINE'); - header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOST('website', 'alphanohtml').'&pageid='.GETPOST('pageid', 'int')); + header("Location: ".$_SERVER["PHP_SELF"].'?website='.GETPOSTINT('website').'&pageid='.GETPOSTINT('pageid')); exit; } @@ -505,7 +505,7 @@ if ($massaction == 'setcategory' && GETPOST('confirmmassaction', 'alpha') && $us $db->begin(); - $categoryid = GETPOST('setcategory', 'int'); + $categoryid = GETPOSTINT('setcategory'); if ($categoryid > 0) { $tmpwebsitepage = new WebsitePage($db); $category = new Categorie($db); @@ -544,7 +544,7 @@ if ($massaction == 'delcategory' && GETPOST('confirmmassaction', 'alpha') && $us $db->begin(); - $categoryid = GETPOST('setcategory', 'int'); + $categoryid = GETPOSTINT('setcategory'); if ($categoryid > 0) { $tmpwebsitepage = new WebsitePage($db); $category = new Categorie($db); @@ -648,8 +648,8 @@ if ($massaction == 'replace' && GETPOST('confirmmassaction', 'alpha') && $userca $containertype = GETPOST('optioncontainertype', 'aZ09') != '-1' ? GETPOST('optioncontainertype', 'aZ09') : ''; $langcode = GETPOST('optionlanguage', 'aZ09'); $otherfilters = array(); - if (GETPOST('optioncategory', 'int') > 0) { - $otherfilters['category'] = GETPOST('optioncategory', 'int'); + if (GETPOSTINT('optioncategory') > 0) { + $otherfilters['category'] = GETPOSTINT('optioncategory'); } // Now we reload list @@ -1152,7 +1152,7 @@ if ($action == 'addcontainer' && $usercanedit) { $substitutionarray['__WEBSITE_CREATE_BY__'] = $user->getFullName($langs); // Define id of page the new page is translation of - $pageidfortranslation = (GETPOST('pageidfortranslation', 'int') > 0 ? GETPOST('pageidfortranslation', 'int') : 0); + $pageidfortranslation = (GETPOSTINT('pageidfortranslation') > 0 ? GETPOSTINT('pageidfortranslation') : 0); if ($pageidfortranslation > 0) { // Check if the page we are translation of is already a translation of a source page. if yes, we will use source id instead $objectpagetmp = new WebsitePage($db); @@ -1353,7 +1353,7 @@ if ($action == 'confirm_deletesite' && $confirm == 'yes' && $permissiontodelete) $db->begin(); - $res = $object->fetch(GETPOST('id', 'int')); + $res = $object->fetch(GETPOSTINT('id')); $website = $object; if ($res > 0) { @@ -1468,8 +1468,8 @@ if (!GETPOSTISSET('pageid')) { $containertype = GETPOST('optioncontainertype', 'aZ09') != '-1' ? GETPOST('optioncontainertype', 'aZ09') : ''; $langcode = GETPOST('optionlanguage', 'aZ09'); $otherfilters = array(); - if (GETPOST('optioncategory', 'int') > 0) { - $otherfilters['category'] = GETPOST('optioncategory', 'int'); + if (GETPOSTINT('optioncategory') > 0) { + $otherfilters['category'] = GETPOSTINT('optioncategory'); } $listofpages = getPagesFromSearchCriterias($containertype, $algo, $searchkey, 1000, $sortfield, $sortorder, $langcode, $otherfilters); @@ -2009,12 +2009,12 @@ if ($action == 'updatemeta' && $usercanedit) { $objectpage->keywords = str_replace(array('<', '>'), '', GETPOST('WEBSITE_KEYWORDS', 'alphanohtml')); $objectpage->allowed_in_frames = GETPOST('WEBSITE_ALLOWED_IN_FRAMES', 'aZ09'); $objectpage->htmlheader = trim(GETPOST('htmlheader', 'none')); - $objectpage->fk_page = (GETPOST('pageidfortranslation', 'int') > 0 ? GETPOST('pageidfortranslation', 'int') : 0); + $objectpage->fk_page = (GETPOSTINT('pageidfortranslation') > 0 ? GETPOSTINT('pageidfortranslation') : 0); $objectpage->author_alias = trim(GETPOST('WEBSITE_AUTHORALIAS', 'alphanohtml')); $objectpage->object_type = GETPOST('WEBSITE_OBJECTCLASS', 'alpha'); $objectpage->fk_object = GETPOST('WEBSITE_OBJECTID', 'aZ09'); - $newdatecreation = dol_mktime(GETPOST('datecreationhour', 'int'), GETPOST('datecreationmin', 'int'), GETPOST('datecreationsec', 'int'), GETPOST('datecreationmonth', 'int'), GETPOST('datecreationday', 'int'), GETPOST('datecreationyear', 'int')); + $newdatecreation = dol_mktime(GETPOSTINT('datecreationhour'), GETPOSTINT('datecreationmin'), GETPOSTINT('datecreationsec'), GETPOSTINT('datecreationmonth'), GETPOSTINT('datecreationday'), GETPOSTINT('datecreationyear')); if ($newdatecreation) { $objectpage->date_creation = $newdatecreation; } @@ -2168,7 +2168,7 @@ if ($usercanedit && (($action == 'updatesource' || $action == 'updatecontent' || $db->begin(); $objectnew = new Website($db); - $result = $objectnew->createFromClone($user, GETPOST('id', 'int'), GETPOST('siteref', 'aZ09'), (GETPOST('newlang', 'aZ09') ? GETPOST('newlang', 'aZ09') : '')); + $result = $objectnew->createFromClone($user, GETPOSTINT('id'), GETPOSTINT('siteref'), (GETPOSTINT('newlang') ? GETPOSTINT('newlang') : '')); if ($result < 0) { $error++; @@ -2195,7 +2195,7 @@ if ($usercanedit && (($action == 'updatesource' || $action == 'updatecontent' || setEventMessages($langs->trans("LanguageMustNotBeSameThanClonedPage"), null, 'errors'); $action = 'preview'; } - if (GETPOST('newwebsite', 'int') != $object->id) { + if (GETPOSTINT('newwebsite') != $object->id) { $error++; setEventMessages($langs->trans("WebsiteMustBeSameThanClonedPageIfTranslation"), null, 'errors'); $action = 'preview'; @@ -2205,7 +2205,7 @@ if ($usercanedit && (($action == 'updatesource' || $action == 'updatecontent' || if (!$error) { $db->begin(); - $newwebsiteid = GETPOST('newwebsite', 'int'); + $newwebsiteid = GETPOSTINT('newwebsite'); $pathofwebsitenew = $pathofwebsite; $tmpwebsite = new Website($db); @@ -4751,7 +4751,7 @@ if ($mode == 'replacesite' || $massaction == 'replace') { if ($permissiontodelete) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } - if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { + if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } diff --git a/htdocs/website/samples/wrapper.php b/htdocs/website/samples/wrapper.php index 313dfd2c438..e6f78442c1e 100644 --- a/htdocs/website/samples/wrapper.php +++ b/htdocs/website/samples/wrapper.php @@ -15,10 +15,10 @@ $encoding = ''; // Parameters to download files $hashp = GETPOST('hashp', 'aZ09'); $modulepart = GETPOST('modulepart', 'aZ09'); -$entity = GETPOST('entity', 'int') ? GETPOST('entity', 'int') : $conf->entity; +$entity = GETPOSTINT('entity') ? GETPOSTINT('entity') : $conf->entity; $original_file = GETPOST("file", "alpha"); $l = GETPOST('l', 'aZ09'); -$limit = GETPOST('limit', 'int'); +$limit = GETPOSTINT('limit'); // Parameters for RSS $rss = GETPOST('rss', 'aZ09'); diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 48123970e20..6194a540789 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/website/lib/websiteaccount.lib.php'; $langs->loadLangs(array("website", "other")); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index 4825fc196b4..c5c998aef4f 100644 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -37,7 +37,7 @@ global $conf, $db, $hookmanager, $langs, $user; $langs->loadLangs(array('mrp', 'other')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); @@ -56,10 +56,10 @@ $search_rowid = GETPOST('search_rowid'); $search_agenda_label = GETPOST('search_agenda_label'); // Load variables for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/workstation/workstation_card.php b/htdocs/workstation/workstation_card.php index 3e5791f0108..0dc3d05c6d5 100644 --- a/htdocs/workstation/workstation_card.php +++ b/htdocs/workstation/workstation_card.php @@ -38,7 +38,7 @@ global $conf, $db, $hookmanager, $langs, $user; $langs->loadLangs(array('mrp', 'other')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); diff --git a/htdocs/workstation/workstation_document.php b/htdocs/workstation/workstation_document.php index 5dba65f6776..2c5f77c6173 100644 --- a/htdocs/workstation/workstation_document.php +++ b/htdocs/workstation/workstation_document.php @@ -40,14 +40,14 @@ $langs->loadLangs(array('companies', 'mails', 'other', 'mrp')); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm'); -$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); +$id = (GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id')); $ref = GETPOST('ref', 'alpha'); // Get parameters -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index f573f6d1a27..1e6b89f4937 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -38,7 +38,7 @@ $langs->loadLangs(array('mrp', 'other')); $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) -$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? +$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list @@ -47,14 +47,14 @@ $backtopage = GETPOST('backtopage', 'alpha'); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...) -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -93,8 +93,8 @@ foreach ($object->fields as $key => $val) { $search[$key] = GETPOST('search_'.$key, 'alpha'); } if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { - $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int')); - $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int')); + $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear')); + $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear')); } } @@ -255,7 +255,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"; } @@ -400,9 +400,9 @@ foreach ($search as $key => $val) { } } } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) { - $param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int')); - $param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int')); - $param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int')); + $param .= '&search_'.$key.'month='.(GETPOSTINT('search_'.$key.'month')); + $param .= '&search_'.$key.'day='.(GETPOSTINT('search_'.$key.'day')); + $param .= '&search_'.$key.'year='.(GETPOSTINT('search_'.$key.'year')); } elseif ($search[$key] != '') { $param .= '&search_'.$key.'='.urlencode($search[$key]); } @@ -424,7 +424,7 @@ $arrayofmassactions = array( if (!empty($permissiontodelete)) { $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); } -if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { +if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) { $arrayofmassactions = array(); } $massactionbutton = $form->selectMassAction('', $arrayofmassactions); diff --git a/htdocs/workstation/workstation_note.php b/htdocs/workstation/workstation_note.php index 8f16aca5b3f..f2be1c32504 100644 --- a/htdocs/workstation/workstation_note.php +++ b/htdocs/workstation/workstation_note.php @@ -35,7 +35,7 @@ global $conf, $db, $hookmanager, $langs, $user; $langs->loadLangs(array('mrp', 'companies')); // Get parameters -$id = GETPOST('id', 'int'); +$id = GETPOSTINT('id'); $ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09'); From c0a4c049a42bac3307160a89d0cf1d10107ebed0 Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Tue, 27 Feb 2024 14:06:30 +0100 Subject: [PATCH 76/84] Fix php warning (#28442) * Fix php warning * Fix blank line --- ...nterface_20_modWorkflow_WorkflowManager.class.php | 12 ++++++++++-- .../expedition/class/expeditionlinebatch.class.php | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index e2602d2afb9..945ece57a4b 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -398,7 +398,11 @@ class InterfaceWorkflowManager extends DolibarrTriggers } foreach ($shipping->lines as $shippingline) { - $qtyshipped[$shippingline->fk_product] += $shippingline->qty; + if (isset($qtyshipped[$shippingline->fk_product])) { + $qtyshipped[$shippingline->fk_product] += $shippingline->qty; + } else { + $qtyshipped[$shippingline->fk_product] = $shippingline->qty; + } } } } @@ -411,7 +415,11 @@ class InterfaceWorkflowManager extends DolibarrTriggers if (!getDolGlobalString('STOCK_SUPPORTS_SERVICES') && $orderline->product_type > 0) { continue; } - $qtyordred[$orderline->fk_product] += $orderline->qty; + if (isset($qtyordred[$shippingline->fk_product])) { + $qtyordred[$orderline->fk_product] += $orderline->qty; + } else { + $qtyordred[$orderline->fk_product] = $orderline->qty; + } } } //dol_syslog(var_export($qtyordred,true),LOG_DEBUG); diff --git a/htdocs/expedition/class/expeditionlinebatch.class.php b/htdocs/expedition/class/expeditionlinebatch.class.php index 032ab9aff34..9bd94895f31 100644 --- a/htdocs/expedition/class/expeditionlinebatch.class.php +++ b/htdocs/expedition/class/expeditionlinebatch.class.php @@ -226,8 +226,8 @@ class ExpeditionLineBatch extends CommonObject $obj = $this->db->fetch_object($resql); $tmp = new self($this->db); - $tmp->sellby = $this->db->jdate($obj->sellby ? $obj->sellby : $obj->oldsellby); - $tmp->eatby = $this->db->jdate($obj->eatby ? $obj->eatby : $obj->oldeatby); + $tmp->sellby = $this->db->jdate(($fk_product > 0 && $obj->sellby) ? $obj->sellby : $obj->oldsellby); + $tmp->eatby = $this->db->jdate(($fk_product > 0 && $obj->eatby) ? $obj->eatby : $obj->oldeatby); $tmp->batch = $obj->batch; $tmp->id = $obj->rowid; $tmp->fk_origin_stock = $obj->fk_origin_stock; From 65da16f0de0e65efcb68922de1bf6f4a9daecb55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 14:06:45 +0100 Subject: [PATCH 77/84] fix phpstan (#28455) --- htdocs/core/class/html.form.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6782fbc31a3..50d22620a20 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -17,7 +17,7 @@ * Copyright (C) 2012-2015 Raphaël Doursenaud * Copyright (C) 2014-2023 Alexandre Spangaro * Copyright (C) 2018-2022 Ferran Marcet - * Copyright (C) 2018-2021 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018 Christophe Battarel * Copyright (C) 2018 Josep Lluis Amador @@ -2465,7 +2465,7 @@ class Form * 'warehouseclosed' = count products from closed warehouses, * 'warehouseinternal' = count products from warehouses for internal correct/transfer only * @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...]) - * @param string $nooutput No print, return the output into a string + * @param int $nooutput No print if 1, return the output into a string * @param int $status_purchase Purchase status: -1=No filter on purchase status, 0=Products not on purchase, 1=Products on purchase * @return void|string */ From a351bc05e5619bd5db1c0a181ca2e1e4d5cdd864 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 27 Feb 2024 14:08:07 +0100 Subject: [PATCH 78/84] New: Phan Plugin (with fixer) for GETPOST->GETPOSTINT (#28447) * New: Phan Plugin (with fixer) for GETPOST->GETPOSTINT # New: Phan Plugin (with fixer) for GETPOST->GETPOSTINT This detects GETPOST calls with second parameter 'int' and can convert to GETPOSTINT * New: Fixer for deprecated module names --- dev/tools/phan/config_fixer.php | 31 +++++ .../plugins/DeprecatedModuleNameFixer.php | 126 ++++++++++++++++++ dev/tools/phan/plugins/GetPostFixerPlugin.php | 98 ++++++++++++++ .../plugins/GetPostFixerPlugin/fixers.php | 123 +++++++++++++++++ 4 files changed, 378 insertions(+) create mode 100644 dev/tools/phan/plugins/DeprecatedModuleNameFixer.php create mode 100644 dev/tools/phan/plugins/GetPostFixerPlugin.php create mode 100644 dev/tools/phan/plugins/GetPostFixerPlugin/fixers.php diff --git a/dev/tools/phan/config_fixer.php b/dev/tools/phan/config_fixer.php index d5607844f26..841495e2a53 100644 --- a/dev/tools/phan/config_fixer.php +++ b/dev/tools/phan/config_fixer.php @@ -4,6 +4,30 @@ define('DOL_PROJECT_ROOT', __DIR__.'/../../..'); define('DOL_DOCUMENT_ROOT', DOL_PROJECT_ROOT.'/htdocs'); define('PHAN_DIR', __DIR__); + +$DEPRECATED_MODULE_MAPPING = array( + 'actioncomm' => 'agenda', + 'adherent' => 'member', + 'adherent_type' => 'member_type', + 'banque' => 'bank', + 'categorie' => 'category', + 'commande' => 'order', + 'contrat' => 'contract', + 'entrepot' => 'stock', + 'expedition' => 'delivery_note', + 'facture' => 'invoice', + 'ficheinter' => 'intervention', + 'product_fournisseur_price' => 'productsupplierprice', + 'product_price' => 'productprice', + 'projet' => 'project', + 'propale' => 'propal', + 'socpeople' => 'contact', +); + +$deprecatedModuleNameRegex = '/^(?!(?:'.implode('|', array_keys($DEPRECATED_MODULE_MAPPING)).')$).*/'; + +require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php'; + /** * This configuration will be read and overlaid on top of the * default configuration. Command line arguments will be applied @@ -71,6 +95,8 @@ return [ .'|htdocs/includes/restler/.*' // @phpstan-ignore-line // Included as stub (did not seem properly analysed by phan without it) .'|htdocs/includes/stripe/.*' // @phpstan-ignore-line + //.'|htdocs/[^c][^o][^r][^e][^/].*' // For testing @phpstan-ignore-line + //.'|htdocs/[^h].*' // For testing on restricted set @phpstan-ignore-line .')@', // @phpstan-ignore-line // A list of plugin files to execute. @@ -82,9 +108,14 @@ return [ // // Alternately, you can pass in the full path to a PHP file // with the plugin's implementation (e.g. 'vendor/phan/phan/.phan/plugins/AlwaysReturnPlugin.php') + 'ParamMatchRegexPlugin' => [ + '/^isModEnabled$/' => [0, $deprecatedModuleNameRegex, "DeprecatedModuleName"], + ], 'plugins' => [ + __DIR__.'/plugins/ParamMatchRegexPlugin.php', //'DeprecateAliasPlugin', // __DIR__.'/plugins/NoVarDumpPlugin.php', + __DIR__.'/plugins/GetPostFixerPlugin.php', //'PHPDocToRealTypesPlugin', /* diff --git a/dev/tools/phan/plugins/DeprecatedModuleNameFixer.php b/dev/tools/phan/plugins/DeprecatedModuleNameFixer.php new file mode 100644 index 00000000000..19caf46d95d --- /dev/null +++ b/dev/tools/phan/plugins/DeprecatedModuleNameFixer.php @@ -0,0 +1,126 @@ + + */ + +declare(strict_types=1); + +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; + +/** + * Implements --automatic-fix for GetPostFixerPlugin + * + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + $DEPRECATED_MODULE_MAPPING = array( + 'actioncomm' => 'agenda', + 'adherent' => 'member', + 'adherent_type' => 'member_type', + 'banque' => 'bank', + 'categorie' => 'category', + 'commande' => 'order', + 'contrat' => 'contract', + 'entrepot' => 'stock', + 'expedition' => 'delivery_note', + 'facture' => 'invoice', + 'ficheinter' => 'intervention', + 'product_fournisseur_price' => 'productsupplierprice', + 'product_price' => 'productprice', + 'projet' => 'project', + 'propale' => 'propal', + 'socpeople' => 'contact', + ); + + $line = $instance->getLine(); + $expected_name = 'isModEnabled'; + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) != 1) { + print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + print "Type$i: ".get_class($argument).PHP_EOL; + } + + $arg1 = $arguments[0]; + + if ($arg1 instanceof ArgumentExpression && $arg1->expression instanceof StringLiteral) { + // Get the string value of the StringLiteral + $stringValue = $arg1->expression->getStringContentsText(); + } else { + print "Expression is not string ".get_class($arg1)."/".get_class($arg1->expression)."- Skip $instance".PHP_EOL; + continue; + } + print "Fixture elem on $line - $actual_name('$stringValue') - $instance".PHP_EOL; + + // Check that module is deprecated + if (isset($DEPRECATED_MODULE_MAPPING[$stringValue])) { + $replacement = $DEPRECATED_MODULE_MAPPING[$stringValue]; + } else { + print "Module is not deprecated in $expected_name - Skip $instance".PHP_EOL; + continue; + } + + // Get the first argument (delimiter) + $moduleargument = $arguments[0]; + + $arg_start_pos = $moduleargument->getStartPosition() + 1; + $arg_end_pos = $moduleargument->getEndPosition() - 1; + + // Remove deprecated module name + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'DeprecatedModuleName', + $fix + ); +}); diff --git a/dev/tools/phan/plugins/GetPostFixerPlugin.php b/dev/tools/phan/plugins/GetPostFixerPlugin.php new file mode 100644 index 00000000000..4953bf34943 --- /dev/null +++ b/dev/tools/phan/plugins/GetPostFixerPlugin.php @@ -0,0 +1,98 @@ + + */ + +use ast\Node; +use Phan\CodeBase; +use Phan\Language\Context; +use Phan\AST\UnionTypeVisitor; +//use Phan\Language\Element\FunctionInterface; +use Phan\Language\UnionType; +use Phan\Language\Type; +use Phan\PluginV3; +use Phan\PluginV3\AnalyzeFunctionCallCapability; +use Phan\Language\Element\FunctionInterface; +use Phan\Config; + +/* + * 'GetPostFixerPlugin' => [ '\\Foo::bar', '\\Baz::bing' ], + * 'plugins' => [ + * __DIR__.'plugins/GetPostFixerPlugin.php', + * [...] + * ] + */ + +/** + * Prints out call sites of given functions or methods. + */ +final class GetPostFixerPlugin extends PluginV3 implements AnalyzeFunctionCallCapability +{ + /** + * @param CodeBase $code_base Code base + * + * @return array + */ + public function getAnalyzeFunctionCallClosures(CodeBase $code_base): array + { + static $function_call_closures; + + if ($function_call_closures === null) { + $function_call_closures = []; + $self = $this; + $func = 'GETPOST'; + $function_call_closures[$func] + = static function (CodeBase $code_base, Context $context, FunctionInterface $function, array $args, ?Node $node = null) use ($self, $func) { + self::handleCall($code_base, $context, $node, $function, $args, $func, $self); + }; + } + return $function_call_closures; + } + + /** + * @param CodeBase $code_base Code base + * @param Context $context Context + * @param ?Node $node Node + * @param FunctionInterface $function Visited function information + * @param array $args Arguments to the function + * @param string $func_to_analyze Name of the function to analyze (as we defined it) + * @param GetPostFixerPlugin $self This visitor + * + * @return void + */ + private static function handleCall(CodeBase $code_base, Context $context, ?Node $node, FunctionInterface $function, array $args, string $func_to_analyze, $self): void + { + $expr = $args[1] ?? null; + if ($expr === null) { + return; + } + try { + $expr_type = UnionTypeVisitor::unionTypeFromNode($code_base, $context, $expr, false); + } catch (Exception $_) { + return; + } + + $expr_value = $expr_type->getRealUnionType()->asValueOrNullOrSelf(); + if (!is_string($expr_value)) { + return; + } + if ($expr_value !== 'int') { + return; + } + + $self->emitIssue( + $code_base, + $context, + 'GetPostShouldBeGetPostInt', + 'Convert {FUNCTION} to {FUNCTION}', + [(string) $function->getFQSEN(), "GETPOSTINT"] + ); + } +} + +if (Config::isIssueFixingPluginEnabled()) { + require_once __DIR__ . '/GetPostFixerPlugin/fixers.php'; +} + +return new GetPostFixerPlugin(); diff --git a/dev/tools/phan/plugins/GetPostFixerPlugin/fixers.php b/dev/tools/phan/plugins/GetPostFixerPlugin/fixers.php new file mode 100644 index 00000000000..662a553eb62 --- /dev/null +++ b/dev/tools/phan/plugins/GetPostFixerPlugin/fixers.php @@ -0,0 +1,123 @@ + + */ + +declare(strict_types=1); + +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; + +/** + * Implements --automatic-fix for GetPostFixerPlugin + * + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + $line = $instance->getLine(); + $new_name = (string) $instance->getTemplateParameters()[1]; + if ($new_name !== "GETPOSTINT") { + return null; + } + + $function_repr = (string) $instance->getTemplateParameters()[0]; + if (!preg_match('{\\\\(\w+)}', $function_repr, $match)) { + return null; + } + $expected_name = $match[1]; + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) != 3) { + print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + print "Type$i: ".get_class($argument).PHP_EOL; + } + + $arg2 = $arguments[2]; + + if ($arg2 instanceof ArgumentExpression && $arg2->expression instanceof StringLiteral) { + // Get the string value of the StringLiteral + $stringValue = $arg2->expression->getStringContentsText(); + } else { + print "Expression is not string ".get_class($arg2)."/".get_class($arg2->expression)."- Skip $instance".PHP_EOL; + continue; + } + print "Fixture elem on $line - $new_name - $function_repr - arg: $stringValue".PHP_EOL; + + // Get the first argument (delimiter) + $delimiter = $arguments[1]; + // Get the second argument + $secondArgument = $arguments[2]; + + // Get the start position of the delimiter + $arg_start_pos = $delimiter->getStartPosition(); + + // Get the end position of the second argument + $arg_end_pos = $secondArgument->getEndPosition(); + + + + // @phan-suppress-next-line PhanThrowTypeAbsentForCall + $start = $callableExpression->getStartPosition(); + // @phan-suppress-next-line PhanThrowTypeAbsentForCall + $end = $callableExpression->getEndPosition(); + + // Remove second argument + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, ""); + + // Replace call with GETPOSTINT + $edits[] = new FileEdit($start, $end, (($file_contents[$start] ?? '') === '\\' ? '\\' : '') . $new_name); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'GetPostShouldBeGetPostInt', + $fix + ); +}); From a03c64ff4049782fab98cd86541f8c0786018634 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 27 Feb 2024 15:29:44 +0100 Subject: [PATCH 79/84] Fix: Replace deprecated module tests embedded in strings (#28459) --- .../core/modules/mailings/fraise.modules.php | 2 +- htdocs/core/modules/modAgenda.class.php | 358 +++++++++--------- htdocs/core/modules/modCategorie.class.php | 226 +++++------ .../class/conferenceorboothattendee.class.php | 48 +-- .../class/fournisseur.commande.class.php | 100 ++--- .../class/fournisseur.facture-rec.class.php | 90 ++--- .../fourn/class/fournisseur.facture.class.php | 2 +- .../canvas/company/tpl/card_view.tpl.php | 2 +- .../canvas/individual/tpl/card_view.tpl.php | 2 +- htdocs/societe/class/societe.class.php | 200 +++++----- htdocs/webservices/admin/index.php | 6 +- 11 files changed, 518 insertions(+), 518 deletions(-) diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php index 59e82deddc2..1547ce1d866 100644 --- a/htdocs/core/modules/mailings/fraise.modules.php +++ b/htdocs/core/modules/mailings/fraise.modules.php @@ -41,7 +41,7 @@ class mailing_fraise extends MailingTargets public $require_module = array('adherent'); - public $enabled = 'isModEnabled("adherent")'; + public $enabled = 'isModEnabled("member")'; /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 86fca2796c1..82c372f8249 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -107,15 +107,15 @@ class modAgenda extends DolibarrModules // Boxes //------ $this->boxes = array( - 0=>array('file'=>'box_actions.php', 'enabledbydefaulton'=>'Home'), - 1=>array('file'=>'box_actions_future.php', 'enabledbydefaulton'=>'Home') + 0 => array('file' => 'box_actions.php', 'enabledbydefaulton' => 'Home'), + 1 => array('file' => 'box_actions_future.php', 'enabledbydefaulton' => 'Home') ); // Cronjobs //------------ $datestart = dol_now(); $this->cronjobs = array( - 0=>array('label'=>'SendEmailsReminders', 'jobtype'=>'method', 'class'=>'comm/action/class/actioncomm.class.php', 'objectname'=>'ActionComm', 'method'=>'sendEmailsReminder', 'parameters'=>'', 'comment'=>'SendEMailsReminder', 'frequency'=>5, 'unitfrequency'=>60, 'priority'=>10, 'status'=>1, 'test'=>'isModEnabled("agenda")', 'datestart'=>$datestart), + 0 => array('label' => 'SendEmailsReminders', 'jobtype' => 'method', 'class' => 'comm/action/class/actioncomm.class.php', 'objectname' => 'ActionComm', 'method' => 'sendEmailsReminder', 'parameters' => '', 'comment' => 'SendEMailsReminder', 'frequency' => 5, 'unitfrequency' => 60, 'priority' => 10, 'status' => 1, 'test' => 'isModEnabled("agenda")', 'datestart' => $datestart), ); // Permissions @@ -205,206 +205,206 @@ class modAgenda extends DolibarrModules // 'user'=>2); // 0=Menu for internal users, 1=external users, 2=both // $r++; $this->menu[$r] = array( - 'fk_menu'=>0, - 'type'=>'top', - 'titre'=>'TMenuAgenda', + 'fk_menu' => 0, + 'type' => 'top', + 'titre' => 'TMenuAgenda', 'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth"'), - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php', - 'langs'=>'agenda', - 'position'=>86, - 'perms'=>'$user->hasRight("agenda", "myactions", "read") || $user->hasRight("resource", "read")', - 'enabled'=>'isModEnabled("agenda") || isModEnabled("resource")', - 'target'=>'', - 'user'=>2, + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php', + 'langs' => 'agenda', + 'position' => 86, + 'perms' => '$user->hasRight("agenda", "myactions", "read") || $user->hasRight("resource", "read")', + 'enabled' => 'isModEnabled("agenda") || isModEnabled("resource")', + 'target' => '', + 'user' => 2, ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=0', - 'type'=>'left', - 'titre'=>'Actions', + 'fk_menu' => 'r=0', + 'type' => 'left', + 'titre' => 'Actions', 'prefix' => img_picto('', $this->picto, 'class="paddingright pictofixedwidth"'), - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php?mainmenu=agenda&leftmenu=agenda', - 'langs'=>'agenda', - 'position'=>100, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2, + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php?mainmenu=agenda&leftmenu=agenda', + 'langs' => 'agenda', + 'position' => 100, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2, ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=1', - 'type'=>'left', - 'titre'=>'NewAction', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create', - 'langs'=>'commercial', - 'position'=>101, - 'perms'=>'($user->hasRight("agenda", "myactions", "create") || $user->hasRight("agenda", "allactions", "create"))', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=1', + 'type' => 'left', + 'titre' => 'NewAction', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create', + 'langs' => 'commercial', + 'position' => 101, + 'perms' => '($user->hasRight("agenda", "myactions", "create") || $user->hasRight("agenda", "allactions", "create"))', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; // Calendar $this->menu[$r] = array( - 'fk_menu'=>'r=1', - 'type'=>'left', - 'titre'=>'Calendar', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda', - 'langs'=>'agenda', - 'position'=>140, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=1', + 'type' => 'left', + 'titre' => 'Calendar', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda', + 'langs' => 'agenda', + 'position' => 140, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=3', - 'type'=>'left', - 'titre'=>'MenuToDoMyActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine', - 'langs'=>'agenda', - 'position'=>141, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=3', + 'type' => 'left', + 'titre' => 'MenuToDoMyActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine', + 'langs' => 'agenda', + 'position' => 141, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=3', - 'type'=>'left', - 'titre'=>'MenuDoneMyActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine', - 'langs'=>'agenda', - 'position'=>142, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=3', + 'type' => 'left', + 'titre' => 'MenuDoneMyActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine', + 'langs' => 'agenda', + 'position' => 142, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=3', - 'type'=>'left', - 'titre'=>'MenuToDoActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1', - 'langs'=>'agenda', - 'position'=>143, - 'perms'=>'$user->hasRight("agenda", "allactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=3', + 'type' => 'left', + 'titre' => 'MenuToDoActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1', + 'langs' => 'agenda', + 'position' => 143, + 'perms' => '$user->hasRight("agenda", "allactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=3', - 'type'=>'left', - 'titre'=>'MenuDoneActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1', - 'langs'=>'agenda', - 'position'=>144, - 'perms'=>'$user->hasRight("agenda", "allactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=3', + 'type' => 'left', + 'titre' => 'MenuDoneActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/index.php?action=default&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1', + 'langs' => 'agenda', + 'position' => 144, + 'perms' => '$user->hasRight("agenda", "allactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); // List $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=1', - 'type'=>'left', - 'titre'=>'List', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda', - 'langs'=>'agenda', - 'position'=>110, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=1', + 'type' => 'left', + 'titre' => 'List', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda', + 'langs' => 'agenda', + 'position' => 110, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=8', - 'type'=>'left', - 'titre'=>'MenuToDoMyActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine', - 'langs'=>'agenda', - 'position'=>111, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=8', + 'type' => 'left', + 'titre' => 'MenuToDoMyActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine', + 'langs' => 'agenda', + 'position' => 111, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=8', - 'type'=>'left', - 'titre'=>'MenuDoneMyActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine', - 'langs'=>'agenda', - 'position'=>112, - 'perms'=>'$user->hasRight("agenda", "myactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=8', + 'type' => 'left', + 'titre' => 'MenuDoneMyActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filter=mine', + 'langs' => 'agenda', + 'position' => 112, + 'perms' => '$user->hasRight("agenda", "myactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=8', - 'type'=>'left', - 'titre'=>'MenuToDoActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1', - 'langs'=>'agenda', - 'position'=>113, - 'perms'=>'$user->hasRight("agenda", "allactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=8', + 'type' => 'left', + 'titre' => 'MenuToDoActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=todo&filtert=-1', + 'langs' => 'agenda', + 'position' => 113, + 'perms' => '$user->hasRight("agenda", "allactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; $this->menu[$r] = array( - 'fk_menu'=>'r=8', - 'type'=>'left', - 'titre'=>'MenuDoneActions', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1', - 'langs'=>'agenda', - 'position'=>114, - 'perms'=>'$user->hasRight("agenda", "allactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=8', + 'type' => 'left', + 'titre' => 'MenuDoneActions', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/list.php?mode=show_list&mainmenu=agenda&leftmenu=agenda&status=done&filtert=-1', + 'langs' => 'agenda', + 'position' => 114, + 'perms' => '$user->hasRight("agenda", "allactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; // Reports $this->menu[$r] = array( - 'fk_menu'=>'r=1', - 'type'=>'left', - 'titre'=>'Reportings', - 'mainmenu'=>'agenda', - 'url'=>'/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda', - 'langs'=>'agenda', - 'position'=>160, - 'perms'=>'$user->hasRight("agenda", "allactions", "read")', - 'enabled'=>'isModEnabled("agenda")', - 'target'=>'', - 'user'=>2 + 'fk_menu' => 'r=1', + 'type' => 'left', + 'titre' => 'Reportings', + 'mainmenu' => 'agenda', + 'url' => '/comm/action/rapport/index.php?mainmenu=agenda&leftmenu=agenda', + 'langs' => 'agenda', + 'position' => 160, + 'perms' => '$user->hasRight("agenda", "allactions", "read")', + 'enabled' => 'isModEnabled("agenda")', + 'target' => '', + 'user' => 2 ); $r++; // Categories @@ -413,11 +413,11 @@ class modAgenda extends DolibarrModules 'type' => 'left', 'titre' => 'Categories', 'mainmenu' => 'agenda', - 'url'=>'/categories/index.php?mainmenu=agenda&leftmenu=agenda&type=10', + 'url' => '/categories/index.php?mainmenu=agenda&leftmenu=agenda&type=10', 'langs' => 'agenda', 'position' => 170, 'perms' => '$user->hasRight("agenda", "allactions", "read")', - 'enabled' => 'isModEnabled("categorie")', + 'enabled' => 'isModEnabled("category")', 'target' => '', 'user' => 2 ); @@ -432,13 +432,13 @@ class modAgenda extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_'.$r; $this->export_label[$r] = "ExportDataset_event1"; $this->export_permission[$r] = array(array("agenda", "export")); - $this->export_fields_array[$r] = array('ac.id'=>"IdAgenda", 'ac.ref_ext'=>"ExternalRef",'ac.ref'=>"Ref", 'ac.datec'=>"DateCreation", 'ac.datep'=>"DateActionBegin", - 'ac.datep2'=>"DateActionEnd", 'ac.location' => 'Location', 'ac.label'=>"Title", 'ac.note'=>"Note", 'ac.percent'=>"Percentage", 'ac.durationp'=>"Duration", - 'ac.fk_user_author'=>'CreatedById', 'ac.fk_user_action'=>'ActionsOwnedBy', 'ac.fk_user_mod'=>'ModifiedBy', 'ac.transparency'=>"Transparency", 'ac.priority'=>"Priority", 'ac.fk_element'=>"ElementID", 'ac.elementtype'=>"ElementType", - 'cac.libelle'=>"ActionType", 'cac.code'=>"Code", - 's.rowid'=>"IdCompany", 's.nom'=>'CompanyName', 's.address'=>'Address', 's.zip'=>'Zip', 's.town'=>'Town', - 'co.code'=>'CountryCode', 's.phone'=>'Phone', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.idprof5'=>'ProfId5', 's.idprof6'=>'ProfId6', - 's.code_compta'=>'CustomerAccountancyCode', 's.code_compta_fournisseur'=>'SupplierAccountancyCode', 's.tva_intra'=>'VATIntra', + $this->export_fields_array[$r] = array('ac.id' => "IdAgenda", 'ac.ref_ext' => "ExternalRef",'ac.ref' => "Ref", 'ac.datec' => "DateCreation", 'ac.datep' => "DateActionBegin", + 'ac.datep2' => "DateActionEnd", 'ac.location' => 'Location', 'ac.label' => "Title", 'ac.note' => "Note", 'ac.percent' => "Percentage", 'ac.durationp' => "Duration", + 'ac.fk_user_author' => 'CreatedById', 'ac.fk_user_action' => 'ActionsOwnedBy', 'ac.fk_user_mod' => 'ModifiedBy', 'ac.transparency' => "Transparency", 'ac.priority' => "Priority", 'ac.fk_element' => "ElementID", 'ac.elementtype' => "ElementType", + 'cac.libelle' => "ActionType", 'cac.code' => "Code", + 's.rowid' => "IdCompany", 's.nom' => 'CompanyName', 's.address' => 'Address', 's.zip' => 'Zip', 's.town' => 'Town', + 'co.code' => 'CountryCode', 's.phone' => 'Phone', 's.siren' => 'ProfId1', 's.siret' => 'ProfId2', 's.ape' => 'ProfId3', 's.idprof4' => 'ProfId4', 's.idprof5' => 'ProfId5', 's.idprof6' => 'ProfId6', + 's.code_compta' => 'CustomerAccountancyCode', 's.code_compta_fournisseur' => 'SupplierAccountancyCode', 's.tva_intra' => 'VATIntra', 'p.ref' => 'ProjectRef', ); // Add multicompany field @@ -448,21 +448,21 @@ class modAgenda extends DolibarrModules $this->export_fields_array[$r]['ac.entity'] = 'Entity'; } } - $this->export_TypeFields_array[$r] = array('ac.ref_ext'=>"Text", 'ac.ref'=>"Text", 'ac.datec'=>"Date", 'ac.datep'=>"Date", - 'ac.datep2'=>"Date", 'ac.location' => 'Text', 'ac.label'=>"Text", 'ac.note'=>"Text", 'ac.percent'=>"Numeric", - 'ac.durationp'=>"Duree",'ac.fk_user_author'=>'Numeric', 'ac.fk_user_action'=>'Numeric', 'ac.fk_user_mod'=>'Numeric', 'ac.transparency'=>"Numeric", 'ac.priority'=>"Numeric", 'ac.fk_element'=>"Numeric", 'ac.elementtype'=>"Text", - 'cac.libelle'=>"List:c_actioncomm:libelle:libelle", 'cac.code'=>"Text", - 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', - 'co.code'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text', 's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.idprof5'=>'Text', 's.idprof6'=>'Text', - 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text', - 'p.ref' => 'Text', 'ac.entity'=>'List:entity:label:rowid' + $this->export_TypeFields_array[$r] = array('ac.ref_ext' => "Text", 'ac.ref' => "Text", 'ac.datec' => "Date", 'ac.datep' => "Date", + 'ac.datep2' => "Date", 'ac.location' => 'Text', 'ac.label' => "Text", 'ac.note' => "Text", 'ac.percent' => "Numeric", + 'ac.durationp' => "Duree",'ac.fk_user_author' => 'Numeric', 'ac.fk_user_action' => 'Numeric', 'ac.fk_user_mod' => 'Numeric', 'ac.transparency' => "Numeric", 'ac.priority' => "Numeric", 'ac.fk_element' => "Numeric", 'ac.elementtype' => "Text", + 'cac.libelle' => "List:c_actioncomm:libelle:libelle", 'cac.code' => "Text", + 's.nom' => 'Text', 's.address' => 'Text', 's.zip' => 'Text', 's.town' => 'Text', + 'co.code' => 'Text', 's.phone' => 'Text', 's.siren' => 'Text', 's.siret' => 'Text', 's.ape' => 'Text', 's.idprof4' => 'Text', 's.idprof5' => 'Text', 's.idprof6' => 'Text', + 's.code_compta' => 'Text', 's.code_compta_fournisseur' => 'Text', 's.tva_intra' => 'Text', + 'p.ref' => 'Text', 'ac.entity' => 'List:entity:label:rowid' ); - $this->export_entities_array[$r] = array('ac.id'=>"action", 'ac.ref_ext'=>"action", 'ac.ref'=>"action", 'ac.datec'=>"action", 'ac.datep'=>"action", - 'ac.datep2'=>"action", 'ac.location' => 'action', 'ac.label'=>"action", 'ac.note'=>"action", 'ac.percent'=>"action", 'ac.durationp'=>"action",'ac.fk_user_author'=>'user', 'ac.fk_user_action'=>'user', 'ac.fk_user_mod'=>'user', 'ac.transparency'=>"action", 'ac.priority'=>"action", 'ac.fk_element'=>"action", 'ac.elementtype'=>"action", - 's.rowid'=>"company", 's.nom'=>'company', 's.address'=>'company', 's.zip'=>'company', 's.town'=>'company', - 'co.code'=>'company', 's.phone'=>'company', 's.siren'=>'company', 's.siret'=>'company', 's.ape'=>'company', 's.idprof4'=>'company', 's.idprof5'=>'company', 's.idprof6'=>'company', - 's.code_compta'=>'company', 's.code_compta_fournisseur'=>'company', 's.tva_intra'=>'company', + $this->export_entities_array[$r] = array('ac.id' => "action", 'ac.ref_ext' => "action", 'ac.ref' => "action", 'ac.datec' => "action", 'ac.datep' => "action", + 'ac.datep2' => "action", 'ac.location' => 'action', 'ac.label' => "action", 'ac.note' => "action", 'ac.percent' => "action", 'ac.durationp' => "action",'ac.fk_user_author' => 'user', 'ac.fk_user_action' => 'user', 'ac.fk_user_mod' => 'user', 'ac.transparency' => "action", 'ac.priority' => "action", 'ac.fk_element' => "action", 'ac.elementtype' => "action", + 's.rowid' => "company", 's.nom' => 'company', 's.address' => 'company', 's.zip' => 'company', 's.town' => 'company', + 'co.code' => 'company', 's.phone' => 'company', 's.siren' => 'company', 's.siret' => 'company', 's.ape' => 'company', 's.idprof4' => 'company', 's.idprof5' => 'company', 's.idprof6' => 'company', + 's.code_compta' => 'company', 's.code_compta_fournisseur' => 'company', 's.tva_intra' => 'company', 'p.ref' => 'project', ); diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 43c92e4810c..20aced509b9 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -165,10 +165,10 @@ class modCategorie extends DolibarrModules } // Definition of vars - $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.type'=>"Type", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification"); - $this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.type'=>"Numeric", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text'); + $this->export_fields_array[$r] = array('cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.type' => "Type", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategoryID", 'pcat.label' => "ParentCategoryLabel", 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification"); + $this->export_TypeFields_array[$r] = array('cat.rowid' => 'Numeric', 'cat.label' => "Text", 'cat.type' => "Numeric", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text'); $this->export_entities_array[$r] = array(); // We define here only fields that use another picto - $this->export_help_array[$r] = array('cat.type'=>$typeexample); + $this->export_help_array[$r] = array('cat.type' => $typeexample); $this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'categorie as cat'; @@ -182,9 +182,9 @@ class modCategorie extends DolibarrModules $this->export_icon[$r] = $this->picto; $this->export_enabled[$r] = 'isModEnabled("product") || isModEnabled("service")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("produit", "export")); - $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", 'p.rowid'=>'ProductId', 'p.ref'=>'Ref', 'p.label'=>'Label'); - $this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 'p.label'=>'Text'); - $this->export_entities_array[$r] = array('p.rowid'=>'product', 'p.ref'=>'product', 'p.label'=>'product'); // We define here only fields that use another picto + $this->export_fields_array[$r] = array('cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategoryID", 'pcat.label' => "ParentCategoryLabel", 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification", 'p.rowid' => 'ProductId', 'p.ref' => 'Ref', 'p.label' => 'Label'); + $this->export_TypeFields_array[$r] = array('cat.rowid' => 'Numeric', 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', 'p.rowid' => 'Numeric', 'p.ref' => 'Text', 'p.label' => 'Text'); + $this->export_entities_array[$r] = array('p.rowid' => 'product', 'p.ref' => 'product', 'p.label' => 'product'); // We define here only fields that use another picto $keyforselect = 'product'; $keyforelement = 'product'; @@ -208,28 +208,28 @@ class modCategorie extends DolibarrModules $this->export_enabled[$r] = 'isModEnabled("supplier_order") || isModEnabled("supplier_invoice")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("fournisseur", "lire")); $this->export_fields_array[$r] = array( - 'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", - 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", - 's.rowid'=>'IdThirdParty', 's.nom'=>'Name', 's.prefix_comm'=>"Prefix", 's.fournisseur'=>"Supplier", 's.datec'=>"DateCreation", 's.tms'=>"DateLastModification", 's.code_fournisseur'=>"SupplierCode", - 's.address'=>"Address", 's.zip'=>"Zip", 's.town'=>"Town", 'c.label'=>"Country", 'c.code'=>"CountryCode", - 's.phone'=>"Phone", 's.fax'=>"Fax", 's.url'=>"Url", 's.email'=>"Email", - 's.siret'=>"ProfId1", 's.siren'=>"ProfId2", 's.ape'=>"ProfId3", 's.idprof4'=>"ProfId4", 's.tva_intra'=>"VATIntraShort", 's.capital'=>"Capital", 's.note_public'=>"NotePublic", - 't.libelle'=>'ThirdPartyType' + 'cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategoryID", 'pcat.label' => "ParentCategoryLabel", + 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification", + 's.rowid' => 'IdThirdParty', 's.nom' => 'Name', 's.prefix_comm' => "Prefix", 's.fournisseur' => "Supplier", 's.datec' => "DateCreation", 's.tms' => "DateLastModification", 's.code_fournisseur' => "SupplierCode", + 's.address' => "Address", 's.zip' => "Zip", 's.town' => "Town", 'c.label' => "Country", 'c.code' => "CountryCode", + 's.phone' => "Phone", 's.fax' => "Fax", 's.url' => "Url", 's.email' => "Email", + 's.siret' => "ProfId1", 's.siren' => "ProfId2", 's.ape' => "ProfId3", 's.idprof4' => "ProfId4", 's.tva_intra' => "VATIntraShort", 's.capital' => "Capital", 's.note_public' => "NotePublic", + 't.libelle' => 'ThirdPartyType' ); $this->export_TypeFields_array[$r] = array( - 'cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', - 's.rowid'=>'List:societe:nom', 's.nom'=>'Text', 's.prefix_comm'=>"Text", 's.fournisseur'=>"Text", 's.datec'=>"Date", 's.tms'=>"Date", 's.code_fournisseur'=>"Text", - 's.address'=>"Text", 's.zip'=>"Text", 's.town'=>"Text", 'c.label'=>"List:c_country:label:label", 'c.code'=>"Text", - 's.phone'=>"Text", 's.fax'=>"Text", 's.url'=>"Text", 's.email'=>"Text", - 's.siret'=>"Text", 's.siren'=>"Text", 's.ape'=>"Text", 's.idprof4'=>"Text", 's.tva_intra'=>"Text", 's.capital'=>"Numeric", 's.note_public'=>"Text", - 't.libelle'=>'List:c_typent:libelle:code' + 'cat.rowid' => 'Numeric', 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', + 's.rowid' => 'List:societe:nom', 's.nom' => 'Text', 's.prefix_comm' => "Text", 's.fournisseur' => "Text", 's.datec' => "Date", 's.tms' => "Date", 's.code_fournisseur' => "Text", + 's.address' => "Text", 's.zip' => "Text", 's.town' => "Text", 'c.label' => "List:c_country:label:label", 'c.code' => "Text", + 's.phone' => "Text", 's.fax' => "Text", 's.url' => "Text", 's.email' => "Text", + 's.siret' => "Text", 's.siren' => "Text", 's.ape' => "Text", 's.idprof4' => "Text", 's.tva_intra' => "Text", 's.capital' => "Numeric", 's.note_public' => "Text", + 't.libelle' => 'List:c_typent:libelle:code' ); $this->export_entities_array[$r] = array( - 's.rowid'=>'company', 's.nom'=>'company', 's.prefix_comm'=>"company", 's.fournisseur'=>"company", 's.datec'=>"company", 's.tms'=>"company", 's.code_fournisseur'=>"company", - 's.address'=>"company", 's.zip'=>"company", 's.town'=>"company", 'c.label'=>"company", 'c.code'=>"company", - 's.phone'=>"company", 's.fax'=>"company", 's.url'=>"company", 's.email'=>"company", - 's.siret'=>"company", 's.siren'=>"company", 's.ape'=>"company", 's.idprof4'=>"company", 's.tva_intra'=>"company", 's.capital'=>"company", 's.note_public'=>"company", - 't.libelle'=>'company' + 's.rowid' => 'company', 's.nom' => 'company', 's.prefix_comm' => "company", 's.fournisseur' => "company", 's.datec' => "company", 's.tms' => "company", 's.code_fournisseur' => "company", + 's.address' => "company", 's.zip' => "company", 's.town' => "company", 'c.label' => "company", 'c.code' => "company", + 's.phone' => "company", 's.fax' => "company", 's.url' => "company", 's.email' => "company", + 's.siret' => "company", 's.siren' => "company", 's.ape' => "company", 's.idprof4' => "company", 's.tva_intra' => "company", 's.capital' => "company", 's.note_public' => "company", + 't.libelle' => 'company' ); // We define here only fields that use another picto $keyforselect = 'societe'; @@ -256,28 +256,28 @@ class modCategorie extends DolibarrModules $this->export_enabled[$r] = 'isModEnabled("societe")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("societe", "export")); $this->export_fields_array[$r] = array( - 'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", - 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", - 's.rowid'=>'IdThirdParty', 's.nom'=>'Name', 's.prefix_comm'=>"Prefix", 's.client'=>"Customer", 's.datec'=>"DateCreation", 's.tms'=>"DateLastModification", 's.code_client'=>"CustomerCode", - 's.address'=>"Address", 's.zip'=>"Zip", 's.town'=>"Town", 'c.label'=>"Country", 'c.code'=>"CountryCode", - 's.phone'=>"Phone", 's.fax'=>"Fax", 's.url'=>"Url", 's.email'=>"Email", - 's.siret'=>"ProfId1", 's.siren'=>"ProfId2", 's.ape'=>"ProfId3", 's.idprof4'=>"ProfId4", 's.tva_intra'=>"VATIntraShort", 's.capital'=>"Capital", 's.note_public'=>"NotePublic", - 't.libelle'=>'ThirdPartyType', 'pl.code'=>'ProspectLevel', 'st.code'=>'ProspectStatus' + 'cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategoryID", 'pcat.label' => "ParentCategoryLabel", + 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification", + 's.rowid' => 'IdThirdParty', 's.nom' => 'Name', 's.prefix_comm' => "Prefix", 's.client' => "Customer", 's.datec' => "DateCreation", 's.tms' => "DateLastModification", 's.code_client' => "CustomerCode", + 's.address' => "Address", 's.zip' => "Zip", 's.town' => "Town", 'c.label' => "Country", 'c.code' => "CountryCode", + 's.phone' => "Phone", 's.fax' => "Fax", 's.url' => "Url", 's.email' => "Email", + 's.siret' => "ProfId1", 's.siren' => "ProfId2", 's.ape' => "ProfId3", 's.idprof4' => "ProfId4", 's.tva_intra' => "VATIntraShort", 's.capital' => "Capital", 's.note_public' => "NotePublic", + 't.libelle' => 'ThirdPartyType', 'pl.code' => 'ProspectLevel', 'st.code' => 'ProspectStatus' ); $this->export_TypeFields_array[$r] = array( - 'cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', - 's.rowid'=>'List:societe:nom', 's.nom'=>'Text', 's.prefix_comm'=>"Text", 's.client'=>"Text", 's.datec'=>"Date", 's.tms'=>"Date", 's.code_client'=>"Text", - 's.address'=>"Text", 's.zip'=>"Text", 's.town'=>"Text", 'c.label'=>"List:c_country:label:label", 'c.code'=>"Text", - 's.phone'=>"Text", 's.fax'=>"Text", 's.url'=>"Text", 's.email'=>"Text", - 's.siret'=>"Text", 's.siren'=>"Text", 's.ape'=>"Text", 's.idprof4'=>"Text", 's.tva_intra'=>"Text", 's.capital'=>"Numeric", 's.note_public'=>"Text", - 't.libelle'=>'List:c_typent:libelle:code', 'pl.code'=>'List:c_prospectlevel:label:code', 'st.code'=>'List:c_stcomm:libelle:code' + 'cat.rowid' => 'Numeric', 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', + 's.rowid' => 'List:societe:nom', 's.nom' => 'Text', 's.prefix_comm' => "Text", 's.client' => "Text", 's.datec' => "Date", 's.tms' => "Date", 's.code_client' => "Text", + 's.address' => "Text", 's.zip' => "Text", 's.town' => "Text", 'c.label' => "List:c_country:label:label", 'c.code' => "Text", + 's.phone' => "Text", 's.fax' => "Text", 's.url' => "Text", 's.email' => "Text", + 's.siret' => "Text", 's.siren' => "Text", 's.ape' => "Text", 's.idprof4' => "Text", 's.tva_intra' => "Text", 's.capital' => "Numeric", 's.note_public' => "Text", + 't.libelle' => 'List:c_typent:libelle:code', 'pl.code' => 'List:c_prospectlevel:label:code', 'st.code' => 'List:c_stcomm:libelle:code' ); $this->export_entities_array[$r] = array( - 's.rowid'=>'company', 's.nom'=>'company', 's.prefix_comm'=>"company", 's.client'=>"company", 's.datec'=>"company", 's.tms'=>"company", 's.code_client'=>"company", - 's.address'=>"company", 's.zip'=>"company", 's.town'=>"company", 'c.label'=>"company", 'c.code'=>"company", - 's.phone'=>"company", 's.fax'=>"company", 's.url'=>"company", 's.email'=>"company", - 's.siret'=>"company", 's.siren'=>"company", 's.ape'=>"company", 's.idprof4'=>"company", 's.tva_intra'=>"company", 's.capital'=>"company", 's.note_public'=>"company", - 't.libelle'=>'company', 'pl.code'=>'company', 'st.code'=>'company' + 's.rowid' => 'company', 's.nom' => 'company', 's.prefix_comm' => "company", 's.client' => "company", 's.datec' => "company", 's.tms' => "company", 's.code_client' => "company", + 's.address' => "company", 's.zip' => "company", 's.town' => "company", 'c.label' => "company", 'c.code' => "company", + 's.phone' => "company", 's.fax' => "company", 's.url' => "company", 's.email' => "company", + 's.siret' => "company", 's.siren' => "company", 's.ape' => "company", 's.idprof4' => "company", 's.tva_intra' => "company", 's.capital' => "company", 's.note_public' => "company", + 't.libelle' => 'company', 'pl.code' => 'company', 'st.code' => 'company' ); // We define here only fields that use another picto $keyforselect = 'societe'; @@ -303,11 +303,11 @@ class modCategorie extends DolibarrModules $this->export_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3]; $this->export_label[$r] = 'CatMemberList'; $this->export_icon[$r] = $this->picto; - $this->export_enabled[$r] = 'isModEnabled("adherent")'; + $this->export_enabled[$r] = 'isModEnabled("member")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("adherent", "export")); - $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", 'p.rowid'=>'MemberId', 'p.lastname'=>'LastName', 'p.firstname'=>'Firstname'); - $this->export_TypeFields_array[$r] = array('cat.rowid'=>"Numeric", 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.lastname'=>'Text', 'p.firstname'=>'Text'); - $this->export_entities_array[$r] = array('p.rowid'=>'member', 'p.lastname'=>'member', 'p.firstname'=>'member'); // We define here only fields that use another picto + $this->export_fields_array[$r] = array('cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategoryID", 'pcat.label' => "ParentCategoryLabel", 'p.rowid' => 'MemberId', 'p.lastname' => 'LastName', 'p.firstname' => 'Firstname'); + $this->export_TypeFields_array[$r] = array('cat.rowid' => "Numeric", 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', 'p.lastname' => 'Text', 'p.firstname' => 'Text'); + $this->export_entities_array[$r] = array('p.rowid' => 'member', 'p.lastname' => 'member', 'p.firstname' => 'member'); // We define here only fields that use another picto $keyforselect = 'adherent'; $keyforelement = 'member'; @@ -331,27 +331,27 @@ class modCategorie extends DolibarrModules $this->export_enabled[$r] = 'isModEnabled("societe")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("societe", "contact", "export")); $this->export_fields_array[$r] = array( - 'cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategoryID", 'pcat.label'=>"ParentCategoryLabel", - 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", + 'cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategoryID", 'pcat.label' => "ParentCategoryLabel", + 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification", 'p.rowid' => 'ContactId', 'civ.label' => 'UserTitle', 'p.lastname' => 'LastName', 'p.firstname' => 'Firstname', 'p.address' => 'Address', 'p.zip' => 'Zip', 'p.town' => 'Town', 'c.code' => 'CountryCode', 'c.label' => 'Country', 'p.birthday' => 'DateOfBirth', 'p.poste' => 'PostOrFunction', 'p.phone' => 'Phone', 'p.phone_perso' => 'PhonePerso', 'p.phone_mobile' => 'PhoneMobile', 'p.fax' => 'Fax', 'p.email' => 'Email', 'p.note_private' => 'NotePrivate', 'p.note_public' => 'NotePublic', 'p.statut' => 'Status', - 's.nom'=>"Name", 's.client'=>"Customer", 's.fournisseur'=>"Supplier", 's.status'=>"Status", - 's.address'=>"Address", 's.zip'=>"Zip", 's.town'=>"Town", - 's.phone'=>"Phone", 's.fax'=>"Fax", 's.url'=>"Url", 's.email'=>"Email" + 's.nom' => "Name", 's.client' => "Customer", 's.fournisseur' => "Supplier", 's.status' => "Status", + 's.address' => "Address", 's.zip' => "Zip", 's.town' => "Town", + 's.phone' => "Phone", 's.fax' => "Fax", 's.url' => "Url", 's.email' => "Email" ); $this->export_TypeFields_array[$r] = array( - 'cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', - 'civ.label' => 'List:c_civility:label:label', 'p.rowid'=>'Numeric', 'p.lastname' => 'Text', 'p.firstname' => 'Text', + 'cat.rowid' => 'Numeric', 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', + 'civ.label' => 'List:c_civility:label:label', 'p.rowid' => 'Numeric', 'p.lastname' => 'Text', 'p.firstname' => 'Text', 'p.address' => 'Text', 'p.zip' => 'Text', 'p.town' => 'Text', 'c.code' => 'Text', 'c.label' => 'List:c_country:label:label', 'p.birthday' => 'Date', 'p.poste' => 'Text', 'p.phone' => 'Text', 'p.phone_perso' => 'Text', 'p.phone_mobile' => 'Text', 'p.fax' => 'Text', 'p.email' => 'Text', 'p.note_private' => 'Text', 'p.note_public' => 'Text', 'p.statut' => 'Boolean', - 's.nom'=>"Text", 's.client'=>"Boolean", 's.fournisseur'=>"Boolean", 's.status'=>"Boolean", - 's.address'=>"Text", 's.zip'=>"Text", 's.town'=>"Text", - 's.phone'=>"Text", 's.fax'=>"Text", 's.url'=>"Text", 's.email'=>"Text" + 's.nom' => "Text", 's.client' => "Boolean", 's.fournisseur' => "Boolean", 's.status' => "Boolean", + 's.address' => "Text", 's.zip' => "Text", 's.town' => "Text", + 's.phone' => "Text", 's.fax' => "Text", 's.url' => "Text", 's.email' => "Text" ); $this->export_entities_array[$r] = array( 'p.rowid' => 'contact', 'civ.label' => 'contact', 'p.lastname' => 'contact', 'p.firstname' => 'contact', @@ -359,9 +359,9 @@ class modCategorie extends DolibarrModules 'p.birthday' => 'contact', 'p.poste' => 'contact', 'p.phone' => 'contact', 'p.phone_perso' => 'contact', 'p.phone_mobile' => 'contact', 'p.fax' => 'contact', 'p.email' => 'contact', 'p.note_private' => 'contact', 'p.note_public' => 'contact', 'p.statut' => 'contact', - 's.nom'=>"company", 's.client'=>"company", 's.fournisseur'=>"company", 's.status'=>"company", - 's.address'=>"company", 's.zip'=>"company", 's.town'=>"company", - 's.phone'=>"company", 's.fax'=>"company", 's.url'=>"company", 's.email'=>"company" + 's.nom' => "company", 's.client' => "company", 's.fournisseur' => "company", 's.status' => "company", + 's.address' => "company", 's.zip' => "company", 's.town' => "company", + 's.phone' => "company", 's.fax' => "company", 's.url' => "company", 's.email' => "company" ); // We define here only fields that use another picto $keyforselect = 'socpeople'; @@ -390,9 +390,9 @@ class modCategorie extends DolibarrModules $this->export_icon[$r] = $this->picto; $this->export_enabled[$r] = "isModEnabled('project')"; $this->export_permission[$r] = array(array("categorie", "lire"), array("projet", "export")); - $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel", 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", 'p.rowid'=>'ProjectId', 'p.ref'=>'Ref', 's.rowid'=>"IdThirdParty", 's.nom'=>"Name"); - $this->export_TypeFields_array[$r] = array('cat.rowid'=>'Numeric', 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.ref'=>'Text', 's.rowid'=>"Numeric", 's.nom'=>"Text"); - $this->export_entities_array[$r] = array('p.rowid'=>'project', 'p.ref'=>'project', 's.rowid'=>"company", 's.nom'=>"company"); // We define here only fields that use another picto + $this->export_fields_array[$r] = array('cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategory", 'pcat.label' => "ParentCategoryLabel", 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification", 'p.rowid' => 'ProjectId', 'p.ref' => 'Ref', 's.rowid' => "IdThirdParty", 's.nom' => "Name"); + $this->export_TypeFields_array[$r] = array('cat.rowid' => 'Numeric', 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', 'p.rowid' => 'Numeric', 'p.ref' => 'Text', 's.rowid' => "Numeric", 's.nom' => "Text"); + $this->export_entities_array[$r] = array('p.rowid' => 'project', 'p.ref' => 'project', 's.rowid' => "company", 's.nom' => "company"); // We define here only fields that use another picto $keyforselect = 'projet'; $keyforelement = 'project'; @@ -416,9 +416,9 @@ class modCategorie extends DolibarrModules $this->export_icon[$r] = $this->picto; $this->export_enabled[$r] = 'isModEnabled("user")'; $this->export_permission[$r] = array(array("categorie", "lire"), array("user", "export")); - $this->export_fields_array[$r] = array('cat.rowid'=>"CategId", 'cat.label'=>"Label", 'cat.description'=>"Description", 'cat.fk_parent'=>"ParentCategory", 'pcat.label'=>"ParentCategoryLabel", 'cat.color'=>"Color", 'cat.date_creation'=>"DateCreation", 'cat.tms'=>"DateLastModification", 'p.rowid'=>'UserID', 'p.login'=>'Login', 'p.lastname'=>'Lastname', 'p.firstname'=>'Firstname'); - $this->export_TypeFields_array[$r] = array('cat.rowid'=>"Numeric", 'cat.label'=>"Text", 'cat.description'=>"Text", 'cat.fk_parent'=>'Numeric', 'pcat.label'=>'Text', 'p.rowid'=>'Numeric', 'p.login'=>'Text', 'p.lastname'=>'Text', 'p.firstname'=>'Text'); - $this->export_entities_array[$r] = array('p.rowid'=>'user', 'p.login'=>'user', 'p.lastname'=>'user', 'p.firstname'=>'user'); // We define here only fields that use another picto + $this->export_fields_array[$r] = array('cat.rowid' => "CategId", 'cat.label' => "Label", 'cat.description' => "Description", 'cat.fk_parent' => "ParentCategory", 'pcat.label' => "ParentCategoryLabel", 'cat.color' => "Color", 'cat.date_creation' => "DateCreation", 'cat.tms' => "DateLastModification", 'p.rowid' => 'UserID', 'p.login' => 'Login', 'p.lastname' => 'Lastname', 'p.firstname' => 'Firstname'); + $this->export_TypeFields_array[$r] = array('cat.rowid' => "Numeric", 'cat.label' => "Text", 'cat.description' => "Text", 'cat.fk_parent' => 'Numeric', 'pcat.label' => 'Text', 'p.rowid' => 'Numeric', 'p.login' => 'Text', 'p.lastname' => 'Text', 'p.firstname' => 'Text'); + $this->export_entities_array[$r] = array('p.rowid' => 'user', 'p.login' => 'user', 'p.lastname' => 'user', 'p.firstname' => 'user'); // We define here only fields that use another picto $keyforselect = 'user'; $keyforelement = 'user'; @@ -453,12 +453,12 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatList"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('ca'=>MAIN_DB_PREFIX.'categorie'); + $this->import_tables_array[$r] = array('ca' => MAIN_DB_PREFIX.'categorie'); $this->import_fields_array[$r] = array( - 'ca.label'=>"Label*", 'ca.type'=>"Type*", 'ca.description'=>"Description", + 'ca.label' => "Label*", 'ca.type' => "Type*", 'ca.description' => "Description", 'ca.fk_parent' => 'ParentCategory' ); - $this->import_regex_array[$r] = array('ca.type'=>'^(0|1|2|3|4|5|6|7|8|9|10|11)$'); + $this->import_regex_array[$r] = array('ca.type' => '^(0|1|2|3|4|5|6|7|8|9|10|11)$'); $this->import_convertvalue_array[$r] = array( 'ca.fk_parent' => array( 'rule' => 'fetchidfromcodeandlabel', @@ -471,10 +471,10 @@ class modCategorie extends DolibarrModules ); $this->import_examplevalues_array[$r] = array( - 'ca.label'=>"My Category Label", 'ca.type'=>$typeexample, 'ca.description'=>"My Category description", // $typeexample built above in exports + 'ca.label' => "My Category Label", 'ca.type' => $typeexample, 'ca.description' => "My Category description", // $typeexample built above in exports 'ca.fk_parent' => 'rowid or label' ); - $this->import_updatekeys_array[$r] = array('ca.label'=>'Label', 'ca.type' => 'Type'); + $this->import_updatekeys_array[$r] = array('ca.label' => 'Label', 'ca.type' => 'Type'); // 0 Products if (isModEnabled("product")) { @@ -483,15 +483,15 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatProdLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cp'=>MAIN_DB_PREFIX.'categorie_product'); - $this->import_fields_array[$r] = array('cp.fk_categorie'=>"Category*", 'cp.fk_product'=>"Product*"); - $this->import_regex_array[$r] = array('cp.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=0'); + $this->import_tables_array[$r] = array('cp' => MAIN_DB_PREFIX.'categorie_product'); + $this->import_fields_array[$r] = array('cp.fk_categorie' => "Category*", 'cp.fk_product' => "Product*"); + $this->import_regex_array[$r] = array('cp.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=0'); $this->import_convertvalue_array[$r] = array( - 'cp.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cp.fk_product'=>array('rule'=>'fetchidfromref', 'classfile'=>'/product/class/product.class.php', 'class'=>'Product', 'method'=>'fetch', 'element'=>'Product') + 'cp.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), + 'cp.fk_product' => array('rule' => 'fetchidfromref', 'classfile' => '/product/class/product.class.php', 'class' => 'Product', 'method' => 'fetch', 'element' => 'Product') ); - $this->import_examplevalues_array[$r] = array('cp.fk_categorie'=>"rowid or label", 'cp.fk_product'=>"rowid or ref"); + $this->import_examplevalues_array[$r] = array('cp.fk_categorie' => "rowid or label", 'cp.fk_product' => "rowid or ref"); $this->import_updatekeys_array[$r] = array('cp.fk_categorie' => 'Category', 'cp.fk_product' => 'ProductRef'); } @@ -502,18 +502,18 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatSupLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cs'=>MAIN_DB_PREFIX.'categorie_fournisseur'); - $this->import_fields_array[$r] = array('cs.fk_categorie'=>"Category*", 'cs.fk_soc'=>"Supplier*"); + $this->import_tables_array[$r] = array('cs' => MAIN_DB_PREFIX.'categorie_fournisseur'); + $this->import_fields_array[$r] = array('cs.fk_categorie' => "Category*", 'cs.fk_soc' => "Supplier*"); $this->import_regex_array[$r] = array( - 'cs.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=1', - 'cs.fk_soc'=>'rowid@'.MAIN_DB_PREFIX.'societe:fournisseur>0' + 'cs.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=1', + 'cs.fk_soc' => 'rowid@'.MAIN_DB_PREFIX.'societe:fournisseur>0' ); $this->import_convertvalue_array[$r] = array( - 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cs.fk_soc'=>array('rule'=>'fetchidfromref', 'classfile'=>'/societe/class/societe.class.php', 'class'=>'Societe', 'method'=>'fetch', 'element'=>'ThirdParty') + 'cs.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), + 'cs.fk_soc' => array('rule' => 'fetchidfromref', 'classfile' => '/societe/class/societe.class.php', 'class' => 'Societe', 'method' => 'fetch', 'element' => 'ThirdParty') ); - $this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_soc'=>"rowid or name"); + $this->import_examplevalues_array[$r] = array('cs.fk_categorie' => "rowid or label", 'cs.fk_soc' => "rowid or name"); } // 2 Customers @@ -523,18 +523,18 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatCusLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cs'=>MAIN_DB_PREFIX.'categorie_societe'); - $this->import_fields_array[$r] = array('cs.fk_categorie'=>"Category*", 'cs.fk_soc'=>"Customer*"); + $this->import_tables_array[$r] = array('cs' => MAIN_DB_PREFIX.'categorie_societe'); + $this->import_fields_array[$r] = array('cs.fk_categorie' => "Category*", 'cs.fk_soc' => "Customer*"); $this->import_regex_array[$r] = array( - 'cs.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=2', - 'cs.fk_soc'=>'rowid@'.MAIN_DB_PREFIX.'societe:client>0' + 'cs.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=2', + 'cs.fk_soc' => 'rowid@'.MAIN_DB_PREFIX.'societe:client>0' ); $this->import_convertvalue_array[$r] = array( - 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cs.fk_soc'=>array('rule'=>'fetchidfromref', 'classfile'=>'/societe/class/societe.class.php', 'class'=>'Societe', 'method'=>'fetch', 'element'=>'ThirdParty') + 'cs.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), + 'cs.fk_soc' => array('rule' => 'fetchidfromref', 'classfile' => '/societe/class/societe.class.php', 'class' => 'Societe', 'method' => 'fetch', 'element' => 'ThirdParty') ); - $this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_soc'=>"rowid or name"); + $this->import_examplevalues_array[$r] = array('cs.fk_categorie' => "rowid or label", 'cs.fk_soc' => "rowid or name"); } // 3 Members @@ -544,15 +544,15 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatMembersLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cm'=>MAIN_DB_PREFIX.'categorie_contact'); - $this->import_fields_array[$r] = array('cm.fk_categorie'=>"Category*", 'cm.fk_member'=>"Member*"); - $this->import_regex_array[$r] = array('cm.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=3'); + $this->import_tables_array[$r] = array('cm' => MAIN_DB_PREFIX.'categorie_contact'); + $this->import_fields_array[$r] = array('cm.fk_categorie' => "Category*", 'cm.fk_member' => "Member*"); + $this->import_regex_array[$r] = array('cm.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=3'); $this->import_convertvalue_array[$r] = array( - 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cs.fk_member'=>array('rule'=>'fetchidfromref', 'classfile'=>'/adherents/class/adherent.class.php', 'class'=>'Adherent', 'method'=>'fetch', 'element'=>'Member') + 'cs.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), + 'cs.fk_member' => array('rule' => 'fetchidfromref', 'classfile' => '/adherents/class/adherent.class.php', 'class' => 'Adherent', 'method' => 'fetch', 'element' => 'Member') ); - $this->import_examplevalues_array[$r] = array('cs.fk_categorie'=>"rowid or label", 'cs.fk_member'=>"rowid or ref"); + $this->import_examplevalues_array[$r] = array('cs.fk_categorie' => "rowid or label", 'cs.fk_member' => "rowid or ref"); } // 4 Contacts/Addresses @@ -562,18 +562,18 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatContactsLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cc'=>MAIN_DB_PREFIX.'categorie_contact'); - $this->import_fields_array[$r] = array('cc.fk_categorie'=>"Category*", 'cc.fk_socpeople'=>"IdContact*"); + $this->import_tables_array[$r] = array('cc' => MAIN_DB_PREFIX.'categorie_contact'); + $this->import_fields_array[$r] = array('cc.fk_categorie' => "Category*", 'cc.fk_socpeople' => "IdContact*"); $this->import_regex_array[$r] = array( - 'cc.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=4' + 'cc.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=4' //'cc.fk_socpeople'=>'rowid@'.MAIN_DB_PREFIX.'socpeople' ); $this->import_convertvalue_array[$r] = array( - 'cc.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), + 'cc.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), //'cc.fk_socpeople'=>array('rule'=>'fetchidfromref','classfile'=>'/contact/class/contact.class.php','class'=>'Contact','method'=>'fetch','element'=>'Contact') ); - $this->import_examplevalues_array[$r] = array('cc.fk_categorie'=>"rowid or label", 'cc.fk_socpeople'=>"rowid"); + $this->import_examplevalues_array[$r] = array('cc.fk_categorie' => "rowid or label", 'cc.fk_socpeople' => "rowid"); } // 5 Bank accounts, TODO ? @@ -585,15 +585,15 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatProjectsLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cp'=>MAIN_DB_PREFIX.'categorie_project'); - $this->import_fields_array[$r] = array('cp.fk_categorie'=>"Category*", 'cp.fk_project'=>"Project*"); - $this->import_regex_array[$r] = array('cp.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=6'); + $this->import_tables_array[$r] = array('cp' => MAIN_DB_PREFIX.'categorie_project'); + $this->import_fields_array[$r] = array('cp.fk_categorie' => "Category*", 'cp.fk_project' => "Project*"); + $this->import_regex_array[$r] = array('cp.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=6'); $this->import_convertvalue_array[$r] = array( - 'cs.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cs.fk_project'=>array('rule'=>'fetchidfromref', 'classfile'=>'/projet/class/project.class.php', 'class'=>'Project', 'method'=>'fetch', 'element'=>'Project') + 'cs.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), + 'cs.fk_project' => array('rule' => 'fetchidfromref', 'classfile' => '/projet/class/project.class.php', 'class' => 'Project', 'method' => 'fetch', 'element' => 'Project') ); - $this->import_examplevalues_array[$r] = array('cp.fk_categorie'=>"rowid or label", 'cp.fk_project'=>"rowid or ref"); + $this->import_examplevalues_array[$r] = array('cp.fk_categorie' => "rowid or label", 'cp.fk_project' => "rowid or ref"); } // 7 Users @@ -603,15 +603,15 @@ class modCategorie extends DolibarrModules $this->import_label[$r] = "CatUsersLinks"; // Translation key $this->import_icon[$r] = $this->picto; $this->import_entities_array[$r] = array(); // We define here only fields that use another icon that the one defined into import_icon - $this->import_tables_array[$r] = array('cu'=>MAIN_DB_PREFIX.'categorie_user'); - $this->import_fields_array[$r] = array('cu.fk_categorie'=>"Category*", 'cu.fk_user'=>"User*"); - $this->import_regex_array[$r] = array('cu.fk_categorie'=>'rowid@'.MAIN_DB_PREFIX.'categorie:type=7'); + $this->import_tables_array[$r] = array('cu' => MAIN_DB_PREFIX.'categorie_user'); + $this->import_fields_array[$r] = array('cu.fk_categorie' => "Category*", 'cu.fk_user' => "User*"); + $this->import_regex_array[$r] = array('cu.fk_categorie' => 'rowid@'.MAIN_DB_PREFIX.'categorie:type=7'); $this->import_convertvalue_array[$r] = array( - 'cu.fk_categorie'=>array('rule'=>'fetchidfromref', 'classfile'=>'/categories/class/categorie.class.php', 'class'=>'Categorie', 'method'=>'fetch', 'element'=>'category'), - 'cu.fk_user'=>array('rule'=>'fetchidfromref', 'classfile'=>'/user/class/user.class.php', 'class'=>'User', 'method'=>'fetch', 'element'=>'User') + 'cu.fk_categorie' => array('rule' => 'fetchidfromref', 'classfile' => '/categories/class/categorie.class.php', 'class' => 'Categorie', 'method' => 'fetch', 'element' => 'category'), + 'cu.fk_user' => array('rule' => 'fetchidfromref', 'classfile' => '/user/class/user.class.php', 'class' => 'User', 'method' => 'fetch', 'element' => 'User') ); - $this->import_examplevalues_array[$r] = array('cu.fk_categorie'=>"rowid or label", 'cu.fk_user'=>"rowid or login"); + $this->import_examplevalues_array[$r] = array('cu.fk_categorie' => "rowid or label", 'cu.fk_user' => "rowid or login"); } // 8 Bank Lines, TODO ? diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index b137fd538ad..eecb06e137c 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -101,29 +101,29 @@ class ConferenceOrBoothAttendee extends CommonObject * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), - 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"), + 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => 2, 'index' => 1, 'comment' => "Reference of object"), //'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>15, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'), - 'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150'), - 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1, 'searchall'=>1, 'csslist'=>'tdoverflowmax150'), - 'firstname' => array('type'=>'varchar(100)', 'label'=>'Firstname', 'enabled'=>'1', 'position'=>31, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1, 'csslist'=>'tdoverflowmax125'), - 'lastname' => array('type'=>'varchar(100)', 'label'=>'Lastname', 'enabled'=>'1', 'position'=>32, 'notnull'=>0, 'visible'=>1, 'index'=>1, 'searchall'=>1, 'csslist'=>'tdoverflowmax125'), - 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label'=>'ThirdParty', 'enabled'=>'isModEnabled("societe")', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'picto'=>'company', 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150'), - 'email_company' => array('type'=>'mail', 'label'=>'EmailCompany', 'enabled'=>'1', 'position'=>41, 'notnull'=>0, 'visible'=>-2, 'searchall'=>1), - 'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1, 'showoncombobox'=>'1',), - 'fk_invoice' => array('type'=>'integer:Facture:compta/facture/class/facture.class.php', 'label'=>'Invoice', 'enabled'=>'isModEnabled("facture")', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'index'=>0, 'picto'=>'bill', 'css'=>'maxwidth500 widthcentpercentminusxx', 'csslist'=>'tdoverflowmax150'), - 'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfRegistrationPaid",), - 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>3,), - 'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>'1', 'position'=>62, 'notnull'=>0, 'visible'=>3,), - 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2, 'css'=>'nowraponall'), - 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,), - 'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>-1, 'visible'=>-2), - 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,), - 'last_main_doc' => array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>0,), - 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>1000, 'notnull'=>-1, 'visible'=>-2,), - 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), - 'ip' => array('type'=>'varchar(250)', 'label'=>'IPAddress', 'enabled'=>'1', 'position'=>900, 'notnull'=>-1, 'visible'=>-2,), - 'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'default'=>0, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Canceled'),), + 'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1', 'label' => 'Project', 'enabled' => "isModEnabled('project')", 'position' => 20, 'notnull' => 1, 'visible' => 0, 'index' => 1, 'picto' => 'project', 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), + 'email' => array('type' => 'mail', 'label' => 'EmailAttendee', 'enabled' => '1', 'position' => 30, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'autofocusoncreate' => 1, 'searchall' => 1, 'csslist' => 'tdoverflowmax150'), + 'firstname' => array('type' => 'varchar(100)', 'label' => 'Firstname', 'enabled' => '1', 'position' => 31, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'csslist' => 'tdoverflowmax125'), + 'lastname' => array('type' => 'varchar(100)', 'label' => 'Lastname', 'enabled' => '1', 'position' => 32, 'notnull' => 0, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'csslist' => 'tdoverflowmax125'), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'position' => 40, 'notnull' => -1, 'visible' => 1, 'index' => 1, 'help' => "OrganizationEventLinkToThirdParty", 'picto' => 'company', 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), + 'email_company' => array('type' => 'mail', 'label' => 'EmailCompany', 'enabled' => '1', 'position' => 41, 'notnull' => 0, 'visible' => -2, 'searchall' => 1), + 'date_subscription' => array('type' => 'datetime', 'label' => 'DateOfRegistration', 'enabled' => '1', 'position' => 56, 'notnull' => 1, 'visible' => 1, 'showoncombobox' => '1',), + 'fk_invoice' => array('type' => 'integer:Facture:compta/facture/class/facture.class.php', 'label' => 'Invoice', 'enabled' => 'isModEnabled("invoice")', 'position' => 57, 'notnull' => 0, 'visible' => 1, 'index' => 0, 'picto' => 'bill', 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'), + 'amount' => array('type' => 'price', 'label' => 'AmountPaid', 'enabled' => '1', 'position' => 57, 'notnull' => 0, 'visible' => 1, 'default' => 'null', 'isameasure' => '1', 'help' => "AmountOfRegistrationPaid",), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => '1', 'position' => 61, 'notnull' => 0, 'visible' => 3,), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => '1', 'position' => 62, 'notnull' => 0, 'visible' => 3,), + 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 500, 'notnull' => 1, 'visible' => -2, 'css' => 'nowraponall'), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 501, 'notnull' => 0, 'visible' => -2,), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => '1', 'position' => 510, 'notnull' => -1, 'visible' => -2), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => '1', 'position' => 511, 'notnull' => -1, 'visible' => -2,), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => '1', 'position' => 600, 'notnull' => 0, 'visible' => 0,), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => '1', 'position' => 1000, 'notnull' => -1, 'visible' => -2,), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => '1', 'position' => 1010, 'notnull' => -1, 'visible' => 0,), + 'ip' => array('type' => 'varchar(250)', 'label' => 'IPAddress', 'enabled' => '1', 'position' => 900, 'notnull' => -1, 'visible' => -2,), + 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => '1', 'position' => 1000, 'default' => 0, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '9' => 'Canceled'),), ); public $rowid; public $ref; @@ -209,7 +209,7 @@ class ConferenceOrBoothAttendee extends CommonObject if (isset($conf->global->EVENTORGANIZATION_FILTERATTENDEES_TYPE) && getDolGlobalString('EVENTORGANIZATION_FILTERATTENDEES_TYPE') !== '' && getDolGlobalString('EVENTORGANIZATION_FILTERATTENDEES_TYPE') !== '-1') { - $this->fields['fk_soc']['type'] .= ' AND client = '.((int) getDolGlobalInt('EVENTORGANIZATION_FILTERATTENDEES_TYPE', 0)); + $this->fields['fk_soc']['type'] .= ' AND client = '.((int) getDolGlobalInt('EVENTORGANIZATION_FILTERATTENDEES_TYPE', 0)); } // Example to show how to set values of fields definition dynamically @@ -841,7 +841,7 @@ class ConferenceOrBoothAttendee extends CommonObject global $action, $hookmanager; $hookmanager->initHooks(array('conferenceorboothattendeedao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 1647eac9258..7a3ecf3dae6 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -355,51 +355,51 @@ class CommandeFournisseur extends CommonOrder * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>10), - 'ref' =>array('type'=>'varchar(255)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'showoncombobox'=>1, 'position'=>25, 'searchall'=>1), - 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'Ref ext', 'enabled'=>1, 'visible'=>0, 'position'=>35), - 'ref_supplier' =>array('type'=>'varchar(255)', 'label'=>'RefOrderSupplierShort', 'enabled'=>1, 'visible'=>1, 'position'=>40, 'searchall'=>1), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label'=>'Project', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>45), - 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>710), - 'date_approve' =>array('type'=>'datetime', 'label'=>'DateApprove', 'enabled'=>1, 'visible'=>-1, 'position'=>720), - 'date_approve2' =>array('type'=>'datetime', 'label'=>'DateApprove2', 'enabled'=>1, 'visible'=>3, 'position'=>725), - 'date_commande' =>array('type'=>'date', 'label'=>'OrderDateShort', 'enabled'=>1, 'visible'=>1, 'position'=>70), - 'date_livraison' =>array('type'=>'datetime', 'label'=>'DeliveryDate', 'enabled'=>'empty($conf->global->ORDER_DISABLE_DELIVERY_DATE)', 'visible'=>1, 'position'=>74), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>3, 'position'=>41), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>3, 'notnull'=>-1, 'position'=>80), - 'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>3, 'position'=>711), - 'fk_user_approve' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserApproval', 'enabled'=>1, 'visible'=>3, 'position'=>721), - 'fk_user_approve2' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserApproval2', 'enabled'=>1, 'visible'=>3, 'position'=>726), - 'source' =>array('type'=>'smallint(6)', 'label'=>'Source', 'enabled'=>1, 'visible'=>3, 'notnull'=>1, 'position'=>100), - 'billed' =>array('type'=>'smallint(6)', 'label'=>'Billed', 'enabled'=>1, 'visible'=>1, 'position'=>710), - 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'AmountHT', 'enabled'=>1, 'visible'=>1, 'position'=>130, 'isameasure'=>1), - 'total_tva' =>array('type'=>'double(24,8)', 'label'=>'AmountVAT', 'enabled'=>1, 'visible'=>1, 'position'=>135, 'isameasure'=>1), - 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'LT1', 'enabled'=>1, 'visible'=>3, 'position'=>140, 'isameasure'=>1), - 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'LT2', 'enabled'=>1, 'visible'=>3, 'position'=>145, 'isameasure'=>1), - 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'AmountTTC', 'enabled'=>1, 'visible'=>-1, 'position'=>150, 'isameasure'=>1), - 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>750, 'searchall'=>1), - 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>760, 'searchall'=>1), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'ModelPDF', 'enabled'=>1, 'visible'=>0, 'position'=>165), - 'fk_input_method' =>array('type'=>'integer', 'label'=>'OrderMode', 'enabled'=>1, 'visible'=>3, 'position'=>170), - 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'PaymentTerm', 'enabled'=>1, 'visible'=>3, 'position'=>175), - 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'PaymentMode', 'enabled'=>1, 'visible'=>3, 'position'=>180), - 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>0, 'position'=>190), - 'fk_account' =>array('type'=>'integer', 'label'=>'BankAccount', 'enabled'=>'isModEnabled("banque")', 'visible'=>3, 'position'=>200), - 'fk_incoterms' =>array('type'=>'integer', 'label'=>'IncotermCode', 'enabled'=>1, 'visible'=>3, 'position'=>205), - 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'IncotermLocation', 'enabled'=>1, 'visible'=>3, 'position'=>210), - 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>0, 'position'=>215), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Currency', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>220), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'CurrencyRate', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>225), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountHT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>230), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountVAT', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>235), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'MulticurrencyAmountTTC', 'enabled'=>'isModEnabled("multicurrency")', 'visible'=>-1, 'position'=>240), - 'date_creation' =>array('type'=>'datetime', 'label'=>'Date creation', 'enabled'=>1, 'visible'=>-1, 'position'=>500), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'isModEnabled("societe")', 'visible'=>1, 'notnull'=>1, 'position'=>50), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>1000, 'index'=>1), - 'tms'=>array('type'=>'datetime', 'label'=>"DateModificationShort", 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>501), - 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>0, 'position'=>700), - 'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'position'=>701), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>0, 'position'=>900), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 10), + 'ref' => array('type' => 'varchar(255)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'showoncombobox' => 1, 'position' => 25, 'searchall' => 1), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 35), + 'ref_supplier' => array('type' => 'varchar(255)', 'label' => 'RefOrderSupplierShort', 'enabled' => 1, 'visible' => 1, 'position' => 40, 'searchall' => 1), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:(fk_statut:=:1)', 'label' => 'Project', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 45), + 'date_valid' => array('type' => 'datetime', 'label' => 'DateValidation', 'enabled' => 1, 'visible' => -1, 'position' => 710), + 'date_approve' => array('type' => 'datetime', 'label' => 'DateApprove', 'enabled' => 1, 'visible' => -1, 'position' => 720), + 'date_approve2' => array('type' => 'datetime', 'label' => 'DateApprove2', 'enabled' => 1, 'visible' => 3, 'position' => 725), + 'date_commande' => array('type' => 'date', 'label' => 'OrderDateShort', 'enabled' => 1, 'visible' => 1, 'position' => 70), + 'date_livraison' => array('type' => 'datetime', 'label' => 'DeliveryDate', 'enabled' => 'empty($conf->global->ORDER_DISABLE_DELIVERY_DATE)', 'visible' => 1, 'position' => 74), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => 3, 'position' => 41), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => 3, 'notnull' => -1, 'position' => 80), + 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => 3, 'position' => 711), + 'fk_user_approve' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserApproval', 'enabled' => 1, 'visible' => 3, 'position' => 721), + 'fk_user_approve2' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserApproval2', 'enabled' => 1, 'visible' => 3, 'position' => 726), + 'source' => array('type' => 'smallint(6)', 'label' => 'Source', 'enabled' => 1, 'visible' => 3, 'notnull' => 1, 'position' => 100), + 'billed' => array('type' => 'smallint(6)', 'label' => 'Billed', 'enabled' => 1, 'visible' => 1, 'position' => 710), + 'total_ht' => array('type' => 'double(24,8)', 'label' => 'AmountHT', 'enabled' => 1, 'visible' => 1, 'position' => 130, 'isameasure' => 1), + 'total_tva' => array('type' => 'double(24,8)', 'label' => 'AmountVAT', 'enabled' => 1, 'visible' => 1, 'position' => 135, 'isameasure' => 1), + 'localtax1' => array('type' => 'double(24,8)', 'label' => 'LT1', 'enabled' => 1, 'visible' => 3, 'position' => 140, 'isameasure' => 1), + 'localtax2' => array('type' => 'double(24,8)', 'label' => 'LT2', 'enabled' => 1, 'visible' => 3, 'position' => 145, 'isameasure' => 1), + 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'AmountTTC', 'enabled' => 1, 'visible' => -1, 'position' => 150, 'isameasure' => 1), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 750, 'searchall' => 1), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 760, 'searchall' => 1), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'ModelPDF', 'enabled' => 1, 'visible' => 0, 'position' => 165), + 'fk_input_method' => array('type' => 'integer', 'label' => 'OrderMode', 'enabled' => 1, 'visible' => 3, 'position' => 170), + 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'PaymentTerm', 'enabled' => 1, 'visible' => 3, 'position' => 175), + 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'PaymentMode', 'enabled' => 1, 'visible' => 3, 'position' => 180), + 'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => 0, 'position' => 190), + 'fk_account' => array('type' => 'integer', 'label' => 'BankAccount', 'enabled' => 'isModEnabled("bank")', 'visible' => 3, 'position' => 200), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => 1, 'visible' => 3, 'position' => 205), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLocation', 'enabled' => 1, 'visible' => 3, 'position' => 210), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'Fk multicurrency', 'enabled' => 1, 'visible' => 0, 'position' => 215), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'Currency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 220), + 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'CurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 225), + 'multicurrency_total_ht' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountHT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 230), + 'multicurrency_total_tva' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountVAT', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 235), + 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyAmountTTC', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 240), + 'date_creation' => array('type' => 'datetime', 'label' => 'Date creation', 'enabled' => 1, 'visible' => -1, 'position' => 500), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => 1, 'notnull' => 1, 'position' => 50), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 1000, 'index' => 1), + 'tms' => array('type' => 'datetime', 'label' => "DateModificationShort", 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 501), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => 0, 'position' => 700), + 'fk_statut' => array('type' => 'smallint(6)', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'position' => 701), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => 0, 'position' => 900), ); @@ -1091,7 +1091,7 @@ class CommandeFournisseur extends CommonOrder global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; @@ -1881,7 +1881,7 @@ class CommandeFournisseur extends CommonOrder if (!$error) { // Hook of thirdparty module if (is_object($hookmanager)) { - $parameters = array('objFrom'=>$objFrom); + $parameters = array('objFrom' => $objFrom); $action = ''; $reshook = $hookmanager->executeHooks('createFrom', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { @@ -2280,7 +2280,7 @@ class CommandeFournisseur extends CommonOrder // Method change if qty < 0 if (getDolGlobalString('SUPPLIER_ORDER_ALLOW_NEGATIVE_QTY_FOR_SUPPLIER_ORDER_RETURN') && $qty < 0) { - $result = $mouv->livraison($user, $product, $entrepot, $qty*(-1), $price, $comment, $now, $eatby, $sellby, $batch, 0, $inventorycode); + $result = $mouv->livraison($user, $product, $entrepot, $qty * (-1), $price, $comment, $now, $eatby, $sellby, $batch, 0, $inventorycode); } else { $result = $mouv->reception($user, $product, $entrepot, $qty, $price, $comment, $eatby, $sellby, $batch, '', 0, $inventorycode); } @@ -3526,7 +3526,7 @@ class CommandeFournisseur extends CommonOrder $qtywished = array(); $supplierorderdispatch = new CommandeFournisseurDispatch($this->db); - $filter = array('t.fk_commande'=>$this->id); + $filter = array('t.fk_commande' => $this->id); if (getDolGlobalString('SUPPLIER_ORDER_USE_DISPATCH_STATUS')) { $filter['t.status'] = 1; // Restrict to lines with status validated } @@ -3714,7 +3714,7 @@ class CommandeFournisseur extends CommonOrder $return .= ''; } if (property_exists($this, 'socid') || property_exists($this, 'total_tva')) { - $return .='
'.$this->socid.''; + $return .= '
'.$this->socid.''; } if (property_exists($this, 'billed')) { $return .= '
'.$langs->trans("Billed").' : '.yn($this->billed).''; diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index ccb9f6749a4..8a85a32e37a 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -192,52 +192,52 @@ class FactureFournisseurRec extends CommonInvoice * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), - 'titre' =>array('type'=>'varchar(100)', 'label'=>'Titre', 'enabled'=>1, 'showoncombobox' => 1, 'visible'=>-1, 'position'=>15), - 'ref_supplier' =>array('type'=>'varchar(180)', 'label'=>'RefSupplier', 'enabled'=>1, 'showoncombobox' => 1, 'visible'=>-1, 'position'=>20), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>25, 'index'=>1), - 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'isModEnabled("societe")', 'visible'=>-1, 'notnull'=>1, 'position'=>30), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>35), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>40), - 'suspended' =>array('type'=>'integer', 'label'=>'Suspended', 'enabled'=>1, 'visible'=>-1, 'position'=>225), - 'libelle' =>array('type'=>'varchar(100)', 'label'=>'Libelle', 'enabled'=>1, 'showoncombobox' => 0, 'visible'=>-1, 'position'=>15), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), + 'titre' => array('type' => 'varchar(100)', 'label' => 'Titre', 'enabled' => 1, 'showoncombobox' => 1, 'visible' => -1, 'position' => 15), + 'ref_supplier' => array('type' => 'varchar(180)', 'label' => 'RefSupplier', 'enabled' => 1, 'showoncombobox' => 1, 'visible' => -1, 'position' => 20), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 25, 'index' => 1), + 'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 'isModEnabled("societe")', 'visible' => -1, 'notnull' => 1, 'position' => 30), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 35), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 40), + 'suspended' => array('type' => 'integer', 'label' => 'Suspended', 'enabled' => 1, 'visible' => -1, 'position' => 225), + 'libelle' => array('type' => 'varchar(100)', 'label' => 'Libelle', 'enabled' => 1, 'showoncombobox' => 0, 'visible' => -1, 'position' => 15), - 'localtax1' =>array('type'=>'double(24,8)', 'label'=>'Localtax1', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'isameasure'=>1), - 'localtax2' =>array('type'=>'double(24,8)', 'label'=>'Localtax2', 'enabled'=>1, 'visible'=>-1, 'position'=>65, 'isameasure'=>1), - 'total_ht' =>array('type'=>'double(24,8)', 'label'=>'Total', 'enabled'=>1, 'visible'=>-1, 'position'=>70, 'isameasure'=>1), - 'total_tva' =>array('type'=>'double(24,8)', 'label'=>'Tva', 'enabled'=>1, 'visible'=>-1, 'position'=>55, 'isameasure'=>1), - 'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>75, 'isameasure'=>1), + 'localtax1' => array('type' => 'double(24,8)', 'label' => 'Localtax1', 'enabled' => 1, 'visible' => -1, 'position' => 60, 'isameasure' => 1), + 'localtax2' => array('type' => 'double(24,8)', 'label' => 'Localtax2', 'enabled' => 1, 'visible' => -1, 'position' => 65, 'isameasure' => 1), + 'total_ht' => array('type' => 'double(24,8)', 'label' => 'Total', 'enabled' => 1, 'visible' => -1, 'position' => 70, 'isameasure' => 1), + 'total_tva' => array('type' => 'double(24,8)', 'label' => 'Tva', 'enabled' => 1, 'visible' => -1, 'position' => 55, 'isameasure' => 1), + 'total_ttc' => array('type' => 'double(24,8)', 'label' => 'Total ttc', 'enabled' => 1, 'visible' => -1, 'position' => 75, 'isameasure' => 1), - 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>210), - 'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>"isModEnabled('project')", 'visible'=>-1, 'position'=>85), - 'fk_account' =>array('type'=>'integer', 'label'=>'Fk account', 'enabled'=>'isModEnabled("banque")', 'visible'=>-1, 'position'=>175), - 'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>95), - 'date_lim_reglement' =>array('type'=>'date', 'label'=>'Date lim reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>100), + 'fk_user_author' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'Fk user author', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 210), + 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label' => 'Fk projet', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 85), + 'fk_account' => array('type' => 'integer', 'label' => 'Fk account', 'enabled' => 'isModEnabled("bank")', 'visible' => -1, 'position' => 175), + 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'Fk cond reglement', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'Fk mode reglement', 'enabled' => 1, 'visible' => -1, 'position' => 95), + 'date_lim_reglement' => array('type' => 'date', 'label' => 'Date lim reglement', 'enabled' => 1, 'visible' => -1, 'position' => 100), - 'note_private' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>105), - 'note_public' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>110), - 'modelpdf' =>array('type'=>'varchar(255)', 'label'=>'Modelpdf', 'enabled'=>1, 'visible'=>-1, 'position'=>115), + 'note_private' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 105), + 'note_public' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 110), + 'modelpdf' => array('type' => 'varchar(255)', 'label' => 'Modelpdf', 'enabled' => 1, 'visible' => -1, 'position' => 115), - 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>180), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Multicurrency code', 'enabled'=>1, 'visible'=>-1, 'position'=>185), - 'multicurrency_tx' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency tx', 'enabled'=>1, 'visible'=>-1, 'position'=>190, 'isameasure'=>1), - 'multicurrency_total_ht' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ht', 'enabled'=>1, 'visible'=>-1, 'position'=>195, 'isameasure'=>1), - 'multicurrency_total_tva' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total tva', 'enabled'=>1, 'visible'=>-1, 'position'=>200, 'isameasure'=>1), - 'multicurrency_total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Multicurrency total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>205, 'isameasure'=>1), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'Fk multicurrency', 'enabled' => 1, 'visible' => -1, 'position' => 180), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'Multicurrency code', 'enabled' => 1, 'visible' => -1, 'position' => 185), + 'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'Multicurrency tx', 'enabled' => 1, 'visible' => -1, 'position' => 190, 'isameasure' => 1), + 'multicurrency_total_ht' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total ht', 'enabled' => 1, 'visible' => -1, 'position' => 195, 'isameasure' => 1), + 'multicurrency_total_tva' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total tva', 'enabled' => 1, 'visible' => -1, 'position' => 200, 'isameasure' => 1), + 'multicurrency_total_ttc' => array('type' => 'double(24,8)', 'label' => 'Multicurrency total ttc', 'enabled' => 1, 'visible' => -1, 'position' => 205, 'isameasure' => 1), - 'usenewprice' =>array('type'=>'integer', 'label'=>'UseNewPrice', 'enabled'=>1, 'visible'=>0, 'position'=>155), - 'frequency' =>array('type'=>'integer', 'label'=>'Frequency', 'enabled'=>1, 'visible'=>-1, 'position'=>150), - 'unit_frequency' =>array('type'=>'varchar(2)', 'label'=>'Unit frequency', 'enabled'=>1, 'visible'=>-1, 'position'=>125), + 'usenewprice' => array('type' => 'integer', 'label' => 'UseNewPrice', 'enabled' => 1, 'visible' => 0, 'position' => 155), + 'frequency' => array('type' => 'integer', 'label' => 'Frequency', 'enabled' => 1, 'visible' => -1, 'position' => 150), + 'unit_frequency' => array('type' => 'varchar(2)', 'label' => 'Unit frequency', 'enabled' => 1, 'visible' => -1, 'position' => 125), - 'date_when' =>array('type'=>'datetime', 'label'=>'Date when', 'enabled'=>1, 'visible'=>-1, 'position'=>130), - 'date_last_gen' =>array('type'=>'datetime', 'label'=>'Date last gen', 'enabled'=>1, 'visible'=>-1, 'position'=>135), - 'nb_gen_done' =>array('type'=>'integer', 'label'=>'Nb gen done', 'enabled'=>1, 'visible'=>-1, 'position'=>140), - 'nb_gen_max' =>array('type'=>'integer', 'label'=>'Nb gen max', 'enabled'=>1, 'visible'=>-1, 'position'=>145), - 'revenuestamp' =>array('type'=>'double(24,8)', 'label'=>'RevenueStamp', 'enabled'=>1, 'visible'=>-1, 'position'=>160, 'isameasure'=>1), - 'auto_validate' =>array('type'=>'integer', 'label'=>'Auto validate', 'enabled'=>1, 'visible'=>-1, 'position'=>165), - 'generate_pdf' =>array('type'=>'integer', 'label'=>'Generate pdf', 'enabled'=>1, 'visible'=>-1, 'position'=>170), + 'date_when' => array('type' => 'datetime', 'label' => 'Date when', 'enabled' => 1, 'visible' => -1, 'position' => 130), + 'date_last_gen' => array('type' => 'datetime', 'label' => 'Date last gen', 'enabled' => 1, 'visible' => -1, 'position' => 135), + 'nb_gen_done' => array('type' => 'integer', 'label' => 'Nb gen done', 'enabled' => 1, 'visible' => -1, 'position' => 140), + 'nb_gen_max' => array('type' => 'integer', 'label' => 'Nb gen max', 'enabled' => 1, 'visible' => -1, 'position' => 145), + 'revenuestamp' => array('type' => 'double(24,8)', 'label' => 'RevenueStamp', 'enabled' => 1, 'visible' => -1, 'position' => 160, 'isameasure' => 1), + 'auto_validate' => array('type' => 'integer', 'label' => 'Auto validate', 'enabled' => 1, 'visible' => -1, 'position' => 165), + 'generate_pdf' => array('type' => 'integer', 'label' => 'Generate pdf', 'enabled' => 1, 'visible' => -1, 'position' => 170), ); // END MODULEBUILDER PROPERTIES @@ -1312,7 +1312,7 @@ class FactureFournisseurRec extends CommonInvoice } $saventity = $conf->entity; - $laststep="None"; + $laststep = "None"; while ($i < $num) { // Loop on each template invoice. If $num = 0, test is false at first pass. $line = $this->db->fetch_object($resql); @@ -1323,7 +1323,7 @@ class FactureFournisseurRec extends CommonInvoice $new_fac_fourn = null; $facturerec = new FactureFournisseurRec($this->db); - $laststep="Fetch {$line->rowid}"; + $laststep = "Fetch {$line->rowid}"; $facturerec->fetch($line->rowid); if ($facturerec->id > 0) { @@ -1349,7 +1349,7 @@ class FactureFournisseurRec extends CommonInvoice $new_fac_fourn->libelle = $facturerec->label; // deprecated $invoiceidgenerated = $new_fac_fourn->create($user); - $laststep="Create invoiceidgenerated $invoiceidgenerated"; + $laststep = "Create invoiceidgenerated $invoiceidgenerated"; if ($invoiceidgenerated <= 0) { $this->errors = $new_fac_fourn->errors; $this->error = $new_fac_fourn->error; @@ -1387,7 +1387,7 @@ class FactureFournisseurRec extends CommonInvoice if (!$error && $invoiceidgenerated >= 0) { $facturerec->nb_gen_done++; $facturerec->date_last_gen = dol_now(); - $facturerec->date_when= $facturerec->getNextDate(); + $facturerec->date_when = $facturerec->getNextDate(); $facturerec->update($user); $this->db->commit('createRecurringInvoices Process invoice template id=' .$facturerec->id. ', title=' .$facturerec->title); dol_syslog('createRecurringInvoices Process invoice template ' .$facturerec->title. ' is finished with a success generation'); @@ -1488,7 +1488,7 @@ class FactureFournisseurRec extends CommonInvoice $result .= $linkend; global $action; $hookmanager->initHooks(array($this->element . 'dao')); - $parameters = array('id'=>$this->id, 'getnomurl' => &$result); + $parameters = array('id' => $this->id, 'getnomurl' => &$result); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { $result = $hookmanager->resPrint; diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index cab15d4f618..887b5ab425f 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -278,7 +278,7 @@ class FactureFournisseur extends CommonInvoice 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 135), 'fk_facture_source' => array('type' => 'integer', 'label' => 'Fk facture source', 'enabled' => 1, 'visible' => -1, 'position' => 140), 'fk_projet' => array('type' => 'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label' => 'Project', 'enabled' => "isModEnabled('project')", 'visible' => -1, 'position' => 145), - 'fk_account' => array('type' => 'integer', 'label' => 'Account', 'enabled' => 'isModEnabled("banque")', 'visible' => -1, 'position' => 150), + 'fk_account' => array('type' => 'integer', 'label' => 'Account', 'enabled' => 'isModEnabled("bank")', 'visible' => -1, 'position' => 150), 'fk_cond_reglement' => array('type' => 'integer', 'label' => 'PaymentTerm', 'enabled' => 1, 'visible' => -1, 'position' => 155), 'fk_mode_reglement' => array('type' => 'integer', 'label' => 'PaymentMode', 'enabled' => 1, 'visible' => -1, 'position' => 160), 'date_lim_reglement' => array('type' => 'date', 'label' => 'DateLimReglement', 'enabled' => 1, 'visible' => -1, 'position' => 165), diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index f649f607280..ecd169d9009 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -249,7 +249,7 @@ for ($i = 1; $i <= 4; $i++) { control->tpl['sales_representatives']; ?> - + trans("LinkedToDolibarrMember"); ?> control->tpl['linked_member']; ?> diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 3d5d98197f2..e684b5c502d 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -176,7 +176,7 @@ if ($this->control->tpl['action_delete']) { control->tpl['sales_representatives']; ?> - + trans("LinkedToDolibarrMember"); ?> control->tpl['linked_member']; ?> diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 8390295fed6..3405b222938 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -190,90 +190,90 @@ class Societe extends CommonObject * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( - 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'), - 'parent' =>array('type'=>'integer', 'label'=>'Parent', 'enabled'=>1, 'visible'=>-1, 'position'=>20), - 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25), - 'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>30), - 'nom' =>array('type'=>'varchar(128)', 'label'=>'Nom', 'enabled'=>1, 'visible'=>-1, 'position'=>35, 'showoncombobox'=>1), - 'name_alias' =>array('type'=>'varchar(128)', 'label'=>'Name alias', 'enabled'=>1, 'visible'=>-1, 'position'=>36, 'showoncombobox'=>2), - 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>40, 'index'=>1), - 'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>45), - 'code_client' =>array('type'=>'varchar(24)', 'label'=>'CustomerCode', 'enabled'=>1, 'visible'=>-1, 'position'=>55), - 'code_fournisseur' =>array('type'=>'varchar(24)', 'label'=>'SupplierCode', 'enabled'=>1, 'visible'=>-1, 'position'=>60), - 'code_compta' =>array('type'=>'varchar(24)', 'label'=>'CustomerAccountancyCode', 'enabled'=>1, 'visible'=>-1, 'position'=>65), - 'code_compta_fournisseur' =>array('type'=>'varchar(24)', 'label'=>'SupplierAccountancyCode', 'enabled'=>1, 'visible'=>-1, 'position'=>70), - 'address' =>array('type'=>'varchar(255)', 'label'=>'Address', 'enabled'=>1, 'visible'=>-1, 'position'=>75), - 'zip' =>array('type'=>'varchar(25)', 'label'=>'Zip', 'enabled'=>1, 'visible'=>-1, 'position'=>80), - 'town' =>array('type'=>'varchar(50)', 'label'=>'Town', 'enabled'=>1, 'visible'=>-1, 'position'=>85), - 'fk_departement' =>array('type'=>'integer', 'label'=>'State', 'enabled'=>1, 'visible'=>-1, 'position'=>90), - 'fk_pays' =>array('type'=>'integer:Ccountry:core/class/ccountry.class.php', 'label'=>'Country', 'enabled'=>1, 'visible'=>-1, 'position'=>95), - 'phone' =>array('type'=>'varchar(20)', 'label'=>'Phone', 'enabled'=>1, 'visible'=>-1, 'position'=>100), - 'phone_mobile' =>array('type'=>'varchar(20)', 'label'=>'PhoneMobile', 'enabled'=>1, 'visible'=>-1, 'position'=>102), - 'fax' =>array('type'=>'varchar(20)', 'label'=>'Fax', 'enabled'=>1, 'visible'=>-1, 'position'=>105), - 'url' =>array('type'=>'varchar(255)', 'label'=>'Url', 'enabled'=>1, 'visible'=>-1, 'position'=>110), - 'email' =>array('type'=>'varchar(128)', 'label'=>'Email', 'enabled'=>1, 'visible'=>-1, 'position'=>115), - 'socialnetworks' =>array('type'=>'text', 'label'=>'Socialnetworks', 'enabled'=>1, 'visible'=>-1, 'position'=>120), - 'fk_effectif' =>array('type'=>'integer', 'label'=>'Workforce', 'enabled'=>1, 'visible'=>-1, 'position'=>170), - 'fk_typent' =>array('type'=>'integer', 'label'=>'TypeOfCompany', 'enabled'=>1, 'visible'=>-1, 'position'=>175, 'csslist'=>'minwidth200'), - 'fk_forme_juridique' =>array('type'=>'integer', 'label'=>'JuridicalStatus', 'enabled'=>1, 'visible'=>-1, 'position'=>180), - 'fk_currency' =>array('type'=>'varchar(3)', 'label'=>'Currency', 'enabled'=>1, 'visible'=>-1, 'position'=>185), - 'siren' =>array('type'=>'varchar(128)', 'label'=>'Idprof1', 'enabled'=>1, 'visible'=>-1, 'position'=>190), - 'siret' =>array('type'=>'varchar(128)', 'label'=>'Idprof2', 'enabled'=>1, 'visible'=>-1, 'position'=>195), - 'ape' =>array('type'=>'varchar(128)', 'label'=>'Idprof3', 'enabled'=>1, 'visible'=>-1, 'position'=>200), - 'idprof4' =>array('type'=>'varchar(128)', 'label'=>'Idprof4', 'enabled'=>1, 'visible'=>-1, 'position'=>205), - 'idprof5' =>array('type'=>'varchar(128)', 'label'=>'Idprof5', 'enabled'=>1, 'visible'=>-1, 'position'=>206), - 'idprof6' =>array('type'=>'varchar(128)', 'label'=>'Idprof6', 'enabled'=>1, 'visible'=>-1, 'position'=>207), - 'tva_intra' =>array('type'=>'varchar(20)', 'label'=>'Tva intra', 'enabled'=>1, 'visible'=>-1, 'position'=>210), - 'capital' =>array('type'=>'double(24,8)', 'label'=>'Capital', 'enabled'=>1, 'visible'=>-1, 'position'=>215), - 'fk_stcomm' =>array('type'=>'integer', 'label'=>'CommercialStatus', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>220), - 'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>225), - 'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>230), - 'prefix_comm' =>array('type'=>'varchar(5)', 'label'=>'Prefix comm', 'enabled'=>"getDolGlobalInt('SOCIETE_USEPREFIX')", 'visible'=>-1, 'position'=>235), - 'client' =>array('type'=>'tinyint(4)', 'label'=>'Client', 'enabled'=>1, 'visible'=>-1, 'position'=>240), - 'fournisseur' =>array('type'=>'tinyint(4)', 'label'=>'Fournisseur', 'enabled'=>1, 'visible'=>-1, 'position'=>245), - 'supplier_account' =>array('type'=>'varchar(32)', 'label'=>'Supplier account', 'enabled'=>1, 'visible'=>-1, 'position'=>250), - 'fk_prospectlevel' =>array('type'=>'varchar(12)', 'label'=>'ProspectLevel', 'enabled'=>1, 'visible'=>-1, 'position'=>255), - 'customer_bad' =>array('type'=>'tinyint(4)', 'label'=>'Customer bad', 'enabled'=>1, 'visible'=>-1, 'position'=>260), - 'customer_rate' =>array('type'=>'double', 'label'=>'Customer rate', 'enabled'=>1, 'visible'=>-1, 'position'=>265), - 'supplier_rate' =>array('type'=>'double', 'label'=>'Supplier rate', 'enabled'=>1, 'visible'=>-1, 'position'=>270), - 'fk_user_creat' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'position'=>275), - 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>280), + 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), + 'parent' => array('type' => 'integer', 'label' => 'Parent', 'enabled' => 1, 'visible' => -1, 'position' => 20), + 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 25), + 'datec' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -1, 'position' => 30), + 'nom' => array('type' => 'varchar(128)', 'label' => 'Nom', 'enabled' => 1, 'visible' => -1, 'position' => 35, 'showoncombobox' => 1), + 'name_alias' => array('type' => 'varchar(128)', 'label' => 'Name alias', 'enabled' => 1, 'visible' => -1, 'position' => 36, 'showoncombobox' => 2), + 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 40, 'index' => 1), + 'ref_ext' => array('type' => 'varchar(255)', 'label' => 'RefExt', 'enabled' => 1, 'visible' => 0, 'position' => 45), + 'code_client' => array('type' => 'varchar(24)', 'label' => 'CustomerCode', 'enabled' => 1, 'visible' => -1, 'position' => 55), + 'code_fournisseur' => array('type' => 'varchar(24)', 'label' => 'SupplierCode', 'enabled' => 1, 'visible' => -1, 'position' => 60), + 'code_compta' => array('type' => 'varchar(24)', 'label' => 'CustomerAccountancyCode', 'enabled' => 1, 'visible' => -1, 'position' => 65), + 'code_compta_fournisseur' => array('type' => 'varchar(24)', 'label' => 'SupplierAccountancyCode', 'enabled' => 1, 'visible' => -1, 'position' => 70), + 'address' => array('type' => 'varchar(255)', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 75), + 'zip' => array('type' => 'varchar(25)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80), + 'town' => array('type' => 'varchar(50)', 'label' => 'Town', 'enabled' => 1, 'visible' => -1, 'position' => 85), + 'fk_departement' => array('type' => 'integer', 'label' => 'State', 'enabled' => 1, 'visible' => -1, 'position' => 90), + 'fk_pays' => array('type' => 'integer:Ccountry:core/class/ccountry.class.php', 'label' => 'Country', 'enabled' => 1, 'visible' => -1, 'position' => 95), + 'phone' => array('type' => 'varchar(20)', 'label' => 'Phone', 'enabled' => 1, 'visible' => -1, 'position' => 100), + 'phone_mobile' => array('type' => 'varchar(20)', 'label' => 'PhoneMobile', 'enabled' => 1, 'visible' => -1, 'position' => 102), + 'fax' => array('type' => 'varchar(20)', 'label' => 'Fax', 'enabled' => 1, 'visible' => -1, 'position' => 105), + 'url' => array('type' => 'varchar(255)', 'label' => 'Url', 'enabled' => 1, 'visible' => -1, 'position' => 110), + 'email' => array('type' => 'varchar(128)', 'label' => 'Email', 'enabled' => 1, 'visible' => -1, 'position' => 115), + 'socialnetworks' => array('type' => 'text', 'label' => 'Socialnetworks', 'enabled' => 1, 'visible' => -1, 'position' => 120), + 'fk_effectif' => array('type' => 'integer', 'label' => 'Workforce', 'enabled' => 1, 'visible' => -1, 'position' => 170), + 'fk_typent' => array('type' => 'integer', 'label' => 'TypeOfCompany', 'enabled' => 1, 'visible' => -1, 'position' => 175, 'csslist' => 'minwidth200'), + 'fk_forme_juridique' => array('type' => 'integer', 'label' => 'JuridicalStatus', 'enabled' => 1, 'visible' => -1, 'position' => 180), + 'fk_currency' => array('type' => 'varchar(3)', 'label' => 'Currency', 'enabled' => 1, 'visible' => -1, 'position' => 185), + 'siren' => array('type' => 'varchar(128)', 'label' => 'Idprof1', 'enabled' => 1, 'visible' => -1, 'position' => 190), + 'siret' => array('type' => 'varchar(128)', 'label' => 'Idprof2', 'enabled' => 1, 'visible' => -1, 'position' => 195), + 'ape' => array('type' => 'varchar(128)', 'label' => 'Idprof3', 'enabled' => 1, 'visible' => -1, 'position' => 200), + 'idprof4' => array('type' => 'varchar(128)', 'label' => 'Idprof4', 'enabled' => 1, 'visible' => -1, 'position' => 205), + 'idprof5' => array('type' => 'varchar(128)', 'label' => 'Idprof5', 'enabled' => 1, 'visible' => -1, 'position' => 206), + 'idprof6' => array('type' => 'varchar(128)', 'label' => 'Idprof6', 'enabled' => 1, 'visible' => -1, 'position' => 207), + 'tva_intra' => array('type' => 'varchar(20)', 'label' => 'Tva intra', 'enabled' => 1, 'visible' => -1, 'position' => 210), + 'capital' => array('type' => 'double(24,8)', 'label' => 'Capital', 'enabled' => 1, 'visible' => -1, 'position' => 215), + 'fk_stcomm' => array('type' => 'integer', 'label' => 'CommercialStatus', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 220), + 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 225), + 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 230), + 'prefix_comm' => array('type' => 'varchar(5)', 'label' => 'Prefix comm', 'enabled' => "getDolGlobalInt('SOCIETE_USEPREFIX')", 'visible' => -1, 'position' => 235), + 'client' => array('type' => 'tinyint(4)', 'label' => 'Client', 'enabled' => 1, 'visible' => -1, 'position' => 240), + 'fournisseur' => array('type' => 'tinyint(4)', 'label' => 'Fournisseur', 'enabled' => 1, 'visible' => -1, 'position' => 245), + 'supplier_account' => array('type' => 'varchar(32)', 'label' => 'Supplier account', 'enabled' => 1, 'visible' => -1, 'position' => 250), + 'fk_prospectlevel' => array('type' => 'varchar(12)', 'label' => 'ProspectLevel', 'enabled' => 1, 'visible' => -1, 'position' => 255), + 'customer_bad' => array('type' => 'tinyint(4)', 'label' => 'Customer bad', 'enabled' => 1, 'visible' => -1, 'position' => 260), + 'customer_rate' => array('type' => 'double', 'label' => 'Customer rate', 'enabled' => 1, 'visible' => -1, 'position' => 265), + 'supplier_rate' => array('type' => 'double', 'label' => 'Supplier rate', 'enabled' => 1, 'visible' => -1, 'position' => 270), + 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'position' => 275), + 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 280), //'remise_client' =>array('type'=>'double', 'label'=>'CustomerDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>285, 'isameasure'=>1), //'remise_supplier' =>array('type'=>'double', 'label'=>'SupplierDiscount', 'enabled'=>1, 'visible'=>-1, 'position'=>290, 'isameasure'=>1), - 'mode_reglement' =>array('type'=>'tinyint(4)', 'label'=>'Mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>295), - 'cond_reglement' =>array('type'=>'tinyint(4)', 'label'=>'Cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>300), - 'deposit_percent' =>array('type'=>'varchar(63)', 'label'=>'DepositPercent', 'enabled'=>1, 'visible'=>-1, 'position'=>301), - 'mode_reglement_supplier' =>array('type'=>'integer', 'label'=>'Mode reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>305), - 'cond_reglement_supplier' =>array('type'=>'integer', 'label'=>'Cond reglement supplier', 'enabled'=>1, 'visible'=>-1, 'position'=>308), - 'outstanding_limit' =>array('type'=>'double(24,8)', 'label'=>'OutstandingBill', 'enabled'=>1, 'visible'=>-1, 'position'=>310, 'isameasure'=>1), - 'order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Order min amount', 'enabled'=>'isModEnabled("commande") && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>315, 'isameasure'=>1), - 'supplier_order_min_amount' =>array('type'=>'double(24,8)', 'label'=>'Supplier order min amount', 'enabled'=>'isModEnabled("commande") && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible'=>-1, 'position'=>320, 'isameasure'=>1), - 'fk_shipping_method' =>array('type'=>'integer', 'label'=>'Fk shipping method', 'enabled'=>1, 'visible'=>-1, 'position'=>330), - 'tva_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Tva assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>335), - 'localtax1_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Localtax1 assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>340), - 'localtax1_value' =>array('type'=>'double(6,3)', 'label'=>'Localtax1 value', 'enabled'=>1, 'visible'=>-1, 'position'=>345), - 'localtax2_assuj' =>array('type'=>'tinyint(4)', 'label'=>'Localtax2 assuj', 'enabled'=>1, 'visible'=>-1, 'position'=>350), - 'localtax2_value' =>array('type'=>'double(6,3)', 'label'=>'Localtax2 value', 'enabled'=>1, 'visible'=>-1, 'position'=>355), - 'vat_reverse_charge' =>array('type'=>'tinyint(4)', 'label'=>'Vat reverse charge', 'enabled'=>1, 'visible'=>-1, 'position'=>335), - 'barcode' =>array('type'=>'varchar(255)', 'label'=>'Barcode', 'enabled'=>1, 'visible'=>-1, 'position'=>360), - 'price_level' =>array('type'=>'integer', 'label'=>'Price level', 'enabled'=>'$conf->global->PRODUIT_MULTIPRICES || getDolGlobalString("PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES")', 'visible'=>-1, 'position'=>365), - 'default_lang' =>array('type'=>'varchar(6)', 'label'=>'Default lang', 'enabled'=>1, 'visible'=>-1, 'position'=>370), - 'canvas' =>array('type'=>'varchar(32)', 'label'=>'Canvas', 'enabled'=>1, 'visible'=>-1, 'position'=>375), - 'fk_barcode_type' =>array('type'=>'integer', 'label'=>'Fk barcode type', 'enabled'=>1, 'visible'=>-1, 'position'=>405), - 'webservices_url' =>array('type'=>'varchar(255)', 'label'=>'Webservices url', 'enabled'=>1, 'visible'=>-1, 'position'=>410), - 'webservices_key' =>array('type'=>'varchar(128)', 'label'=>'Webservices key', 'enabled'=>1, 'visible'=>-1, 'position'=>415), - 'fk_incoterms' =>array('type'=>'integer', 'label'=>'Fk incoterms', 'enabled'=>1, 'visible'=>-1, 'position'=>425), - 'location_incoterms' =>array('type'=>'varchar(255)', 'label'=>'Location incoterms', 'enabled'=>1, 'visible'=>-1, 'position'=>430), - 'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>435), - 'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270), - 'fk_multicurrency' =>array('type'=>'integer', 'label'=>'Fk multicurrency', 'enabled'=>1, 'visible'=>-1, 'position'=>440), - 'multicurrency_code' =>array('type'=>'varchar(255)', 'label'=>'Multicurrency code', 'enabled'=>1, 'visible'=>-1, 'position'=>445), - 'fk_account' =>array('type'=>'integer', 'label'=>'PaymentBankAccount', 'enabled'=>1, 'visible'=>-1, 'position'=>450), - 'fk_warehouse' =>array('type'=>'integer', 'label'=>'Warehouse', 'enabled'=>1, 'visible'=>-1, 'position'=>455), - 'logo' =>array('type'=>'varchar(255)', 'label'=>'Logo', 'enabled'=>1, 'visible'=>-1, 'position'=>400), - 'logo_squarred' =>array('type'=>'varchar(255)', 'label'=>'Logo squarred', 'enabled'=>1, 'visible'=>-1, 'position'=>401), - 'status' =>array('type'=>'tinyint(4)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500), - 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000), + 'mode_reglement' => array('type' => 'tinyint(4)', 'label' => 'Mode reglement', 'enabled' => 1, 'visible' => -1, 'position' => 295), + 'cond_reglement' => array('type' => 'tinyint(4)', 'label' => 'Cond reglement', 'enabled' => 1, 'visible' => -1, 'position' => 300), + 'deposit_percent' => array('type' => 'varchar(63)', 'label' => 'DepositPercent', 'enabled' => 1, 'visible' => -1, 'position' => 301), + 'mode_reglement_supplier' => array('type' => 'integer', 'label' => 'Mode reglement supplier', 'enabled' => 1, 'visible' => -1, 'position' => 305), + 'cond_reglement_supplier' => array('type' => 'integer', 'label' => 'Cond reglement supplier', 'enabled' => 1, 'visible' => -1, 'position' => 308), + 'outstanding_limit' => array('type' => 'double(24,8)', 'label' => 'OutstandingBill', 'enabled' => 1, 'visible' => -1, 'position' => 310, 'isameasure' => 1), + 'order_min_amount' => array('type' => 'double(24,8)', 'label' => 'Order min amount', 'enabled' => 'isModEnabled("order") && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible' => -1, 'position' => 315, 'isameasure' => 1), + 'supplier_order_min_amount' => array('type' => 'double(24,8)', 'label' => 'Supplier order min amount', 'enabled' => 'isModEnabled("order") && !empty($conf->global->ORDER_MANAGE_MIN_AMOUNT)', 'visible' => -1, 'position' => 320, 'isameasure' => 1), + 'fk_shipping_method' => array('type' => 'integer', 'label' => 'Fk shipping method', 'enabled' => 1, 'visible' => -1, 'position' => 330), + 'tva_assuj' => array('type' => 'tinyint(4)', 'label' => 'Tva assuj', 'enabled' => 1, 'visible' => -1, 'position' => 335), + 'localtax1_assuj' => array('type' => 'tinyint(4)', 'label' => 'Localtax1 assuj', 'enabled' => 1, 'visible' => -1, 'position' => 340), + 'localtax1_value' => array('type' => 'double(6,3)', 'label' => 'Localtax1 value', 'enabled' => 1, 'visible' => -1, 'position' => 345), + 'localtax2_assuj' => array('type' => 'tinyint(4)', 'label' => 'Localtax2 assuj', 'enabled' => 1, 'visible' => -1, 'position' => 350), + 'localtax2_value' => array('type' => 'double(6,3)', 'label' => 'Localtax2 value', 'enabled' => 1, 'visible' => -1, 'position' => 355), + 'vat_reverse_charge' => array('type' => 'tinyint(4)', 'label' => 'Vat reverse charge', 'enabled' => 1, 'visible' => -1, 'position' => 335), + 'barcode' => array('type' => 'varchar(255)', 'label' => 'Barcode', 'enabled' => 1, 'visible' => -1, 'position' => 360), + 'price_level' => array('type' => 'integer', 'label' => 'Price level', 'enabled' => '$conf->global->PRODUIT_MULTIPRICES || getDolGlobalString("PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES")', 'visible' => -1, 'position' => 365), + 'default_lang' => array('type' => 'varchar(6)', 'label' => 'Default lang', 'enabled' => 1, 'visible' => -1, 'position' => 370), + 'canvas' => array('type' => 'varchar(32)', 'label' => 'Canvas', 'enabled' => 1, 'visible' => -1, 'position' => 375), + 'fk_barcode_type' => array('type' => 'integer', 'label' => 'Fk barcode type', 'enabled' => 1, 'visible' => -1, 'position' => 405), + 'webservices_url' => array('type' => 'varchar(255)', 'label' => 'Webservices url', 'enabled' => 1, 'visible' => -1, 'position' => 410), + 'webservices_key' => array('type' => 'varchar(128)', 'label' => 'Webservices key', 'enabled' => 1, 'visible' => -1, 'position' => 415), + 'fk_incoterms' => array('type' => 'integer', 'label' => 'Fk incoterms', 'enabled' => 1, 'visible' => -1, 'position' => 425), + 'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'Location incoterms', 'enabled' => 1, 'visible' => -1, 'position' => 430), + 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'position' => 435), + 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => -1, 'position' => 270), + 'fk_multicurrency' => array('type' => 'integer', 'label' => 'Fk multicurrency', 'enabled' => 1, 'visible' => -1, 'position' => 440), + 'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'Multicurrency code', 'enabled' => 1, 'visible' => -1, 'position' => 445), + 'fk_account' => array('type' => 'integer', 'label' => 'PaymentBankAccount', 'enabled' => 1, 'visible' => -1, 'position' => 450), + 'fk_warehouse' => array('type' => 'integer', 'label' => 'Warehouse', 'enabled' => 1, 'visible' => -1, 'position' => 455), + 'logo' => array('type' => 'varchar(255)', 'label' => 'Logo', 'enabled' => 1, 'visible' => -1, 'position' => 400), + 'logo_squarred' => array('type' => 'varchar(255)', 'label' => 'Logo squarred', 'enabled' => 1, 'visible' => -1, 'position' => 401), + 'status' => array('type' => 'tinyint(4)', 'label' => 'Status', 'enabled' => 1, 'visible' => -1, 'position' => 500), + 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'position' => 1000), ); /** @@ -2681,7 +2681,7 @@ class Societe extends CommonObject { // phpcs:enable $error = 0; - $this->context = array('commercial_modified'=>$commid); + $this->context = array('commercial_modified' => $commid); $result = $this->call_trigger('COMPANY_UNLINK_SALE_REPRESENTATIVE', $user); if ($result < 0) { @@ -3004,13 +3004,13 @@ class Societe extends CommonObject global $action; $hookmanager->initHooks(array('thirdpartydao')); $parameters = array( - 'id'=>$this->id, + 'id' => $this->id, 'getnomurl' => &$result, - 'withpicto '=> $withpicto, - 'option'=> $option, - 'maxlen'=> $maxlen, - 'notooltip'=> $notooltip, - 'save_lastsearch_value'=> $save_lastsearch_value + 'withpicto ' => $withpicto, + 'option' => $option, + 'maxlen' => $maxlen, + 'notooltip' => $notooltip, + 'save_lastsearch_value' => $save_lastsearch_value ); $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) { @@ -3622,7 +3622,7 @@ class Societe extends CommonObject global $conf; if (getDolGlobalString('SOCIETE_CODECOMPTA_ADDON')) { - $module=getDolGlobalString('SOCIETE_CODECOMPTA_ADDON'); + $module = getDolGlobalString('SOCIETE_CODECOMPTA_ADDON'); $res = false; $dirsociete = array_merge(array('/core/modules/societe/'), $conf->modules_parts['societe']); foreach ($dirsociete as $dirroot) { @@ -3939,7 +3939,7 @@ class Societe extends CommonObject $action = ''; $hookmanager->initHooks(array('idprofurl')); - $parameters = array('idprof'=>$idprof, 'company'=>$thirdparty); + $parameters = array('idprof' => $idprof, 'company' => $thirdparty); $reshook = $hookmanager->executeHooks('getIdProfUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if (empty($reshook)) { if (getDolGlobalString('MAIN_DISABLEPROFIDRULES')) { @@ -4442,7 +4442,7 @@ class Societe extends CommonObject $this->forme_juridique_code = getDolGlobalString('MAIN_INFO_SOCIETE_FORME_JURIDIQUE'); $this->email = getDolGlobalString('MAIN_INFO_SOCIETE_MAIL'); $this->default_lang = getDolGlobalString('MAIN_LANG_DEFAULT', 'auto'); - $this->logo =getDolGlobalString('MAIN_INFO_SOCIETE_LOGO'); + $this->logo = getDolGlobalString('MAIN_INFO_SOCIETE_LOGO'); $this->logo_small = getDolGlobalString('MAIN_INFO_SOCIETE_LOGO_SMALL'); $this->logo_mini = getDolGlobalString('MAIN_INFO_SOCIETE_LOGO_MINI'); $this->logo_squarred = getDolGlobalString('MAIN_INFO_SOCIETE_LOGO_SQUARRED'); @@ -4743,7 +4743,7 @@ class Societe extends CommonObject $outstandingOpened += $obj->total_ttc; } } - return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax, 'refs'=>$arrayofref); // 'opened' is 'incl taxes' + return array('opened' => $outstandingOpened, 'total_ht' => $outstandingTotal, 'total_ttc' => $outstandingTotalIncTax, 'refs' => $arrayofref); // 'opened' is 'incl taxes' } else { return array(); } @@ -4786,7 +4786,7 @@ class Societe extends CommonObject $outstandingOpened += $obj->total_ttc; } } - return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax, 'refs'=>$arrayofref); // 'opened' is 'incl taxes' + return array('opened' => $outstandingOpened, 'total_ht' => $outstandingTotal, 'total_ttc' => $outstandingTotalIncTax, 'refs' => $arrayofref); // 'opened' is 'incl taxes' } else { return array(); } @@ -4845,7 +4845,7 @@ class Societe extends CommonObject if ($obj->status != $tmpobject::STATUS_DRAFT // Not a draft && !($obj->status == $tmpobject::STATUS_ABANDONED && $obj->close_code == 'replaced') // Not a replaced invoice - ) { + ) { $outstandingTotal += $obj->total_ht; $outstandingTotalIncTax += $obj->total_ttc; } @@ -4877,7 +4877,7 @@ class Societe extends CommonObject $arrayofrefopened[$obj->rowid] = $obj->ref; } } - return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax, 'refs'=>$arrayofref, 'refsopened'=>$arrayofrefopened); // 'opened' is 'incl taxes' + return array('opened' => $outstandingOpened, 'total_ht' => $outstandingTotal, 'total_ttc' => $outstandingTotalIncTax, 'refs' => $arrayofref, 'refsopened' => $arrayofrefopened); // 'opened' is 'incl taxes' } else { dol_syslog("Sql error ".$this->db->lasterror, LOG_ERR); return array(); @@ -4947,7 +4947,7 @@ class Societe extends CommonObject dol_print_error($this->db, $companybankaccount->error, $companybankaccount->errors); } $result = $companybankaccount->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams); - $this->last_main_doc=$companybankaccount->last_main_doc; + $this->last_main_doc = $companybankaccount->last_main_doc; } else { // Positionne le modele sur le nom du modele a utiliser if (!dol_strlen($modele)) { @@ -5284,8 +5284,8 @@ class Societe extends CommonObject 'civility' => $obj->civility, 'lastname' => $obj->lastname, 'firstname' => $obj->firstname, - 'email'=>$obj->email, - 'login'=> (empty($obj->login) ? '' : $obj->login), + 'email' => $obj->email, + 'login' => (empty($obj->login) ? '' : $obj->login), 'photo' => (empty($obj->photo) ? '' : $obj->photo), 'statuscontact' => $obj->statuscontact, 'rowid' => $obj->rowid, @@ -5484,7 +5484,7 @@ class Societe extends CommonObject if (!$error) { - $this->context = array('merge'=>1, 'mergefromid'=>$soc_origin->id, 'mergefromname'=>$soc_origin->name); + $this->context = array('merge' => 1, 'mergefromid' => $soc_origin->id, 'mergefromname' => $soc_origin->name); // Call trigger $result = $this->call_trigger('COMPANY_MODIFY', $user); diff --git a/htdocs/webservices/admin/index.php b/htdocs/webservices/admin/index.php index 6c70a42cd95..91fcad393d0 100644 --- a/htdocs/webservices/admin/index.php +++ b/htdocs/webservices/admin/index.php @@ -105,11 +105,11 @@ $webservices = array( 'thirdparty' => 'isModEnabled("societe")', 'contact' => 'isModEnabled("societe")', 'productorservice' => '(isModEnabled("product") || isModEnabled("service"))', - 'order' => 'isModEnabled("commande")', - 'invoice' => 'isModEnabled("facture")', + 'order' => 'isModEnabled("order")', + 'invoice' => 'isModEnabled("invoice")', 'supplier_invoice' => 'isModEnabled("fournisseur")', 'actioncomm' => 'isModEnabled("agenda")', - 'category' => 'isModEnabled("categorie")', + 'category' => 'isModEnabled("category")', 'project' => 'isModEnabled("project")', 'other' => '' ); From ec8f2a420d9aa26f352e2d0109af5d746630261f Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 27 Feb 2024 15:29:58 +0100 Subject: [PATCH 80/84] Fix: Use of deprecated fichinter in dynamic modulename (#28456) # Fix: Use of deprecated fichinter in dynamic modulename The modulename is computed dynamically and could use deprecated fichinter module name. Also optimised the test. --- htdocs/api/index.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/htdocs/api/index.php b/htdocs/api/index.php index 2a9375f58c0..d55fe8d38d5 100644 --- a/htdocs/api/index.php +++ b/htdocs/api/index.php @@ -233,12 +233,10 @@ if (!empty($reg[1]) && $reg[1] == 'explorer' && ($reg[2] == '/swagger.json' || $ $modulenameforenabled = $module; if ($module == 'propale') { $modulenameforenabled = 'propal'; - } - if ($module == 'supplierproposal') { + } elseif ($module == 'supplierproposal') { $modulenameforenabled = 'supplier_proposal'; - } - if ($module == 'ficheinter') { - $modulenameforenabled = 'ficheinter'; + } elseif ($module == 'ficheinter') { + $modulenameforenabled = 'intervention'; } dol_syslog("Found module file ".$file." - module=".$module." - modulenameforenabled=".$modulenameforenabled." - moduledirforclass=".$moduledirforclass); From fc597c4171d645ed520d3267bf87c0016e09256f Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 27 Feb 2024 15:30:37 +0100 Subject: [PATCH 81/84] Fix: Replace deprecated modulename with new in isModEnabled (#28452) * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. * Fix: Replace deprecated modulename with new in isModEnabled # Fix: Replace deprecated modulename with new in isModEnabled Replacement of old module names performed with dedicated detection and fixer in phan. --- htdocs/accountancy/admin/defaultaccounts.php | 4 +- htdocs/accountancy/admin/productaccount.php | 2 +- htdocs/adherents/admin/member.php | 12 +-- htdocs/adherents/card.php | 6 +- htdocs/adherents/class/adherent.class.php | 4 +- htdocs/adherents/list.php | 2 +- htdocs/adherents/subscription.php | 24 +++--- htdocs/adherents/subscription/card.php | 8 +- htdocs/adherents/subscription/list.php | 2 +- htdocs/admin/commande.php | 8 +- htdocs/admin/delivery.php | 2 +- htdocs/admin/dict.php | 14 ++-- htdocs/admin/facture.php | 2 +- htdocs/admin/fckeditor.php | 4 +- htdocs/admin/ldap.php | 4 +- htdocs/admin/mails_templates.php | 14 ++-- htdocs/admin/pdf_other.php | 2 +- htdocs/admin/propal.php | 8 +- htdocs/admin/stock.php | 14 ++-- htdocs/admin/supplier_proposal.php | 2 +- htdocs/admin/workflow.php | 20 ++--- htdocs/blockedlog/class/blockedlog.class.php | 6 +- htdocs/comm/action/card.php | 6 +- htdocs/comm/action/class/actioncomm.class.php | 2 +- .../comm/action/class/cactioncomm.class.php | 6 +- htdocs/comm/card.php | 54 ++++++------- htdocs/comm/index.php | 16 ++-- htdocs/comm/mailing/advtargetemailing.php | 2 +- htdocs/comm/propal/card.php | 24 +++--- htdocs/comm/propal/list.php | 10 +-- htdocs/comm/recap-client.php | 2 +- htdocs/commande/card.php | 22 ++--- htdocs/commande/class/commande.class.php | 2 +- htdocs/commande/index.php | 6 +- htdocs/commande/list.php | 18 ++--- htdocs/commande/list_det.php | 20 ++--- htdocs/compta/accounting-files.php | 6 +- htdocs/compta/bank/bankentries_list.php | 4 +- htdocs/compta/bank/card.php | 8 +- htdocs/compta/bank/class/account.class.php | 2 +- .../bank/class/paymentvarious.class.php | 6 +- htdocs/compta/bank/line.php | 4 +- htdocs/compta/bank/list.php | 6 +- htdocs/compta/bank/various_payment/card.php | 8 +- htdocs/compta/bank/various_payment/list.php | 4 +- htdocs/compta/charges/index.php | 12 +-- htdocs/compta/facture/card.php | 26 +++--- .../facture/class/api_invoices.class.php | 8 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/compta/facture/list.php | 6 +- htdocs/compta/facture/stats/index.php | 6 +- htdocs/compta/index.php | 10 +-- htdocs/compta/localtax/card.php | 4 +- .../compta/localtax/class/localtax.class.php | 6 +- htdocs/compta/paiement.php | 6 +- htdocs/compta/paiement/card.php | 6 +- .../compta/paiement/class/paiement.class.php | 2 +- htdocs/compta/paiement/list.php | 4 +- htdocs/compta/paiement_charge.php | 2 +- htdocs/compta/paiement_vat.php | 2 +- htdocs/compta/payment_sc/card.php | 4 +- htdocs/compta/payment_vat/card.php | 4 +- htdocs/compta/recap-compta.php | 4 +- htdocs/compta/resultat/clientfourn.php | 2 +- htdocs/compta/resultat/index.php | 8 +- htdocs/compta/sociales/card.php | 10 +-- .../class/paymentsocialcontribution.class.php | 2 +- htdocs/compta/sociales/list.php | 2 +- htdocs/compta/sociales/payments.php | 8 +- htdocs/compta/stats/cabyuser.php | 4 +- htdocs/compta/stats/casoc.php | 4 +- htdocs/compta/tva/card.php | 10 +-- htdocs/compta/tva/class/paymentvat.class.php | 2 +- htdocs/compta/tva/class/tva.class.php | 6 +- htdocs/compta/tva/list.php | 2 +- htdocs/compta/tva/payments.php | 6 +- .../actions_contactcard_common.class.php | 6 +- htdocs/contact/card.php | 22 ++--- htdocs/contact/consumption.php | 8 +- htdocs/contact/list.php | 2 +- htdocs/contrat/card.php | 4 +- htdocs/contrat/index.php | 2 +- htdocs/contrat/list.php | 6 +- htdocs/contrat/services_list.php | 2 +- htdocs/core/actions_addupdatedelete.inc.php | 4 +- htdocs/core/ajax/selectsearchbox.php | 16 ++-- htdocs/core/boxes/box_activity.php | 8 +- .../core/boxes/box_dolibarr_state_board.php | 10 +-- .../boxes/box_graph_product_distribution.php | 22 ++--- htdocs/core/boxes/box_members_by_tags.php | 2 +- htdocs/core/boxes/box_members_by_type.php | 2 +- .../core/boxes/box_members_last_modified.php | 2 +- .../boxes/box_members_last_subscriptions.php | 2 +- .../box_members_subscriptions_by_year.php | 2 +- htdocs/core/class/html.form.class.php | 22 ++--- htdocs/core/class/html.formmail.class.php | 16 ++-- htdocs/core/class/html.formticket.class.php | 2 +- htdocs/core/customreports.php | 14 ++-- htdocs/core/lib/admin.lib.php | 2 +- htdocs/core/lib/agenda.lib.php | 4 +- htdocs/core/lib/company.lib.php | 2 +- htdocs/core/lib/contact.lib.php | 2 +- htdocs/core/lib/expedition.lib.php | 2 +- htdocs/core/lib/functions.lib.php | 8 +- htdocs/core/lib/invoice.lib.php | 6 +- htdocs/core/lib/ldap.lib.php | 4 +- htdocs/core/lib/order.lib.php | 6 +- htdocs/core/lib/pdf.lib.php | 4 +- htdocs/core/lib/product.lib.php | 10 +-- htdocs/core/lib/project.lib.php | 20 ++--- htdocs/core/lib/propal.lib.php | 4 +- htdocs/core/menus/standard/auguria.lib.php | 6 +- htdocs/core/menus/standard/eldy.lib.php | 80 +++++++++---------- .../doc/pdf_standard.modules.php | 4 +- .../mailings/advthirdparties.modules.php | 2 +- .../modules/mailings/thirdparties.modules.php | 2 +- htdocs/core/modules/modCategorie.class.php | 4 +- htdocs/core/modules/modUser.class.php | 2 +- .../doc/doc_generic_project_odt.modules.php | 24 +++--- .../project/doc/pdf_beluga.modules.php | 10 +-- .../task/doc/doc_generic_task_odt.modules.php | 10 +-- .../modules/rapport/pdf_paiement.class.php | 12 +-- htdocs/core/tpl/advtarget.tpl.php | 6 +- htdocs/core/tpl/onlinepaymentlinks.tpl.php | 8 +- ...e_20_modWorkflow_WorkflowManager.class.php | 18 ++--- ..._50_modNotification_Notification.class.php | 4 +- htdocs/datapolicy/admin/setup.php | 2 +- htdocs/delivery/card.php | 6 +- htdocs/delivery/class/delivery.class.php | 2 +- htdocs/don/class/paymentdonation.class.php | 2 +- htdocs/don/paiement/list.php | 4 +- htdocs/don/payment/card.php | 4 +- htdocs/don/payment/payment.php | 2 +- htdocs/ecm/index_auto.php | 22 ++--- htdocs/ecm/search.php | 20 ++--- .../conferenceorbooth_card.php | 2 +- .../conferenceorbooth_contact.php | 2 +- .../conferenceorbooth_document.php | 2 +- .../conferenceorbooth_list.php | 2 +- .../conferenceorboothattendee_card.php | 2 +- .../conferenceorboothattendee_list.php | 4 +- htdocs/expedition/card.php | 8 +- htdocs/expedition/class/expedition.class.php | 2 +- htdocs/expedition/contact.php | 4 +- htdocs/expedition/dispatch.php | 4 +- htdocs/expedition/document.php | 2 +- htdocs/expedition/list.php | 4 +- htdocs/expedition/note.php | 2 +- htdocs/expensereport/card.php | 10 +-- .../class/api_expensereports.class.php | 2 +- .../class/paymentexpensereport.class.php | 2 +- htdocs/expensereport/payment/card.php | 4 +- htdocs/expensereport/payment/list.php | 2 +- htdocs/expensereport/payment/payment.php | 4 +- htdocs/fichinter/card-rec.php | 14 ++-- htdocs/fichinter/card.php | 10 +-- htdocs/fichinter/index.php | 4 +- htdocs/fichinter/list.php | 10 +-- htdocs/fourn/card.php | 10 +-- .../class/api_supplier_invoices.class.php | 4 +- htdocs/fourn/commande/card.php | 6 +- htdocs/fourn/commande/list.php | 2 +- htdocs/fourn/facture/card.php | 10 +-- htdocs/fourn/facture/list.php | 4 +- htdocs/fourn/facture/paiement.php | 4 +- htdocs/fourn/paiement/card.php | 2 +- htdocs/fourn/paiement/document.php | 2 +- htdocs/fourn/paiement/list.php | 2 +- htdocs/index.php | 12 +-- htdocs/install/upgrade2.php | 6 +- .../class/knowledgerecord.class.php | 2 +- .../knowledgerecord_card.php | 6 +- .../knowledgerecord_list.php | 2 +- htdocs/loan/card.php | 2 +- htdocs/loan/class/paymentloan.class.php | 2 +- htdocs/loan/payment/card.php | 4 +- htdocs/loan/payment/payment.php | 2 +- .../mailmanspip/class/mailmanspip.class.php | 4 +- htdocs/main.inc.php | 10 +-- htdocs/paybox/admin/paybox.php | 2 +- htdocs/paypal/admin/paypal.php | 2 +- htdocs/product/card.php | 16 ++-- htdocs/product/class/product.class.php | 6 +- htdocs/product/composition/card.php | 6 +- htdocs/product/index.php | 2 +- htdocs/product/inventory/list.php | 2 +- htdocs/product/list.php | 4 +- htdocs/product/reassort.php | 2 +- htdocs/product/reassortlot.php | 4 +- htdocs/product/stats/card.php | 6 +- htdocs/product/stock/card.php | 6 +- htdocs/product/stock/class/entrepot.class.php | 2 +- htdocs/product/stock/list.php | 6 +- htdocs/product/stock/movement_list.php | 2 +- htdocs/product/stock/product.php | 4 +- htdocs/product/stock/replenish.php | 4 +- htdocs/projet/card.php | 14 ++-- htdocs/projet/comment.php | 2 +- htdocs/projet/contact.php | 4 +- htdocs/projet/element.php | 36 ++++----- htdocs/projet/ganttview.php | 2 +- htdocs/projet/list.php | 8 +- htdocs/projet/tasks.php | 4 +- htdocs/projet/tasks/comment.php | 2 +- htdocs/projet/tasks/contact.php | 2 +- htdocs/projet/tasks/document.php | 2 +- htdocs/projet/tasks/list.php | 4 +- htdocs/projet/tasks/note.php | 2 +- htdocs/projet/tasks/task.php | 2 +- htdocs/projet/tasks/time.php | 4 +- htdocs/public/members/new.php | 2 +- htdocs/public/members/public_card.php | 2 +- htdocs/public/members/public_list.php | 2 +- htdocs/public/payment/paymentok.php | 22 ++--- htdocs/public/stripe/ipn.php | 2 +- htdocs/public/webportal/tpl/home.tpl.php | 4 +- htdocs/public/webportal/tpl/menu.tpl.php | 6 +- htdocs/reception/card.php | 4 +- htdocs/reception/class/reception.class.php | 2 +- htdocs/reception/dispatch.php | 2 +- htdocs/salaries/card.php | 14 ++-- htdocs/salaries/class/api_salaries.class.php | 4 +- htdocs/salaries/class/paymentsalary.class.php | 2 +- htdocs/salaries/list.php | 8 +- htdocs/salaries/paiement_salary.php | 2 +- htdocs/salaries/payment_salary/card.php | 2 +- htdocs/salaries/payments.php | 6 +- htdocs/salaries/virement_request.php | 6 +- htdocs/societe/admin/societe.php | 2 +- .../canvas/actions_card_common.class.php | 2 +- htdocs/societe/card.php | 16 ++-- htdocs/societe/class/societe.class.php | 6 +- htdocs/societe/consumption.php | 8 +- htdocs/societe/contact.php | 4 +- htdocs/societe/index.php | 2 +- htdocs/societe/list.php | 6 +- htdocs/societe/paymentmodes.php | 12 +-- htdocs/societe/societecontact.php | 2 +- htdocs/supplier_proposal/card.php | 6 +- htdocs/supplier_proposal/list.php | 2 +- htdocs/takepos/admin/terminal.php | 4 +- htdocs/takepos/index.php | 2 +- htdocs/takepos/invoice.php | 4 +- htdocs/takepos/pay.php | 2 +- htdocs/ticket/card.php | 8 +- htdocs/ticket/class/ticket.class.php | 4 +- htdocs/user/card.php | 16 ++-- htdocs/user/list.php | 4 +- htdocs/user/param_ihm.php | 6 +- .../class/html.formcardwebportal.class.php | 2 +- .../invoicelist.controller.class.php | 2 +- .../membercard.controller.class.php | 6 +- .../orderlist.controller.class.php | 2 +- .../propallist.controller.class.php | 2 +- htdocs/website/index.php | 8 +- 255 files changed, 842 insertions(+), 842 deletions(-) diff --git a/htdocs/accountancy/admin/defaultaccounts.php b/htdocs/accountancy/admin/defaultaccounts.php index 65a447811cc..982448cebdd 100644 --- a/htdocs/accountancy/admin/defaultaccounts.php +++ b/htdocs/accountancy/admin/defaultaccounts.php @@ -92,7 +92,7 @@ if (getDolGlobalString('ACCOUNTING_FORCE_ENABLE_VAT_REVERSE_CHARGE')) { $list_account[] = 'ACCOUNTING_VAT_BUY_REVERSE_CHARGES_CREDIT'; $list_account[] = 'ACCOUNTING_VAT_BUY_REVERSE_CHARGES_DEBIT'; } -if (isModEnabled('banque')) { +if (isModEnabled('bank')) { $list_account[] = 'ACCOUNTING_ACCOUNT_TRANSFER_CASH'; } if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')) { @@ -101,7 +101,7 @@ if (getDolGlobalString('INVOICE_USE_RETAINED_WARRANTY')) { if (isModEnabled('don')) { $list_account[] = 'DONATION_ACCOUNTINGACCOUNT'; } -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { $list_account[] = 'ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT'; } if (isModEnabled('loan')) { diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index aa4c4a3eb00..b625446ca60 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -525,7 +525,7 @@ if ($resql) { // Filter on categories $moreforfilter = ''; - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, $searchCategoryProductList, 'minwidth300', $searchCategoryProductList ? $searchCategoryProductList : 0); /* diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php index 3faf0de69b8..6a5139cf16b 100644 --- a/htdocs/adherents/admin/member.php +++ b/htdocs/adherents/admin/member.php @@ -114,7 +114,7 @@ if ($action == 'set_default') { $res8 = dolibarr_set_const($db, 'MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF', GETPOST('MEMBER_SUBSCRIPTION_START_FIRST_DAY_OF', 'alpha'), 'chaine', 0, '', $conf->entity); $res9 = dolibarr_set_const($db, 'MEMBER_SUBSCRIPTION_START_AFTER', GETPOST('MEMBER_SUBSCRIPTION_START_AFTER', 'alpha'), 'chaine', 0, '', $conf->entity); // Use vat for invoice creation - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $res4 = dolibarr_set_const($db, 'ADHERENT_VAT_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_VAT_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); $res5 = dolibarr_set_const($db, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', GETPOST('ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', 'alpha'), 'chaine', 0, '', $conf->entity); if (isModEnabled("product") || isModEnabled("service")) { @@ -394,13 +394,13 @@ print "\n"; // Insert subscription into bank account print ''.$langs->trans("MoreActionsOnSubscription").''; $arraychoices = array('0'=>$langs->trans("None")); -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { $arraychoices['bankdirect'] = $langs->trans("MoreActionBankDirect"); } -if (isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) { +if (isModEnabled("bank") && isModEnabled("societe") && isModEnabled('invoice')) { $arraychoices['invoiceonly'] = $langs->trans("MoreActionInvoiceOnly"); } -if (isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) { +if (isModEnabled("bank") && isModEnabled("societe") && isModEnabled('invoice')) { $arraychoices['bankviainvoice'] = $langs->trans("MoreActionBankViaInvoice"); } print ''; @@ -412,9 +412,9 @@ print ''; print "\n"; // Use vat for invoice creation -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { print ''.$langs->trans("VATToUseForSubscriptions").''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; print $form->selectarray('ADHERENT_VAT_FOR_SUBSCRIPTIONS', array('0'=>$langs->trans("NoVatOnSubscription"), 'defaultforfoundationcountry'=>$langs->trans("Default")), getDolGlobalString('ADHERENT_VAT_FOR_SUBSCRIPTIONS', '0'), 0); print ''; diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index 8b96f6c3844..eeff802a2e4 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1130,7 +1130,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print ''.$form->editfieldkey("Categories", 'memcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1); print img_picto('', 'category').$form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0); @@ -1384,7 +1384,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print "\n"; // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print ''.$form->editfieldkey("Categories", 'memcats', '', $object, 0).''; print ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1); @@ -1813,7 +1813,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; // Tags / Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print ''; print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index c03b28d37dd..c187fc05d75 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2258,7 +2258,7 @@ class Adherent extends CommonObject } $datas['address'] = '
'.$langs->trans("Address").': '.dol_format_address($this, 1, ' ', $langs); // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (isModEnabled('category') && !$nofetch) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_MEMBER, 1); @@ -2997,7 +2997,7 @@ class Adherent extends CommonObject $blockingerrormsg = ''; - if (!isModEnabled('adherent')) { // Should not happen. If module disabled, cron job should not be visible. + if (!isModEnabled('member')) { // Should not happen. If module disabled, cron job should not be visible. $langs->load("agenda"); $this->output = $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Adherent")); return 0; diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 37aba189a17..403026ff209 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -821,7 +821,7 @@ $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('che $moreforfilter = ''; // Filter on categories -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1, $langs->trans("MembersCategoriesShort")); diff --git a/htdocs/adherents/subscription.php b/htdocs/adherents/subscription.php index 3efc9a74ef0..e0c12678e2a 100644 --- a/htdocs/adherents/subscription.php +++ b/htdocs/adherents/subscription.php @@ -273,7 +273,7 @@ if ($user->hasRight('adherent', 'cotisation', 'creer') && $action == 'subscripti $action = 'addsubscription'; } else { // If an amount has been provided, we check also fields that becomes mandatory when amount is not null. - if (isModEnabled('banque') && GETPOST("paymentsave") != 'none') { + if (isModEnabled('bank') && GETPOST("paymentsave") != 'none') { if (GETPOST("subscription")) { if (!GETPOST("label")) { $errmsg = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")); @@ -583,7 +583,7 @@ print '
'; print ''; // Tags / Categories -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print ''; print '\n"; @@ -779,7 +779,7 @@ if ($action != 'addsubscription' && $action != 'create_thirdparty') { print '\n"; print '\n"; print ''; - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { print ''; @@ -865,11 +865,11 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h $bankviainvoice = 1; } } else { - if (getDolGlobalString('ADHERENT_BANK_USE') == 'bankviainvoice' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) { + if (getDolGlobalString('ADHERENT_BANK_USE') == 'bankviainvoice' && isModEnabled('bank') && isModEnabled('societe') && isModEnabled('invoice')) { $bankviainvoice = 1; - } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'bankdirect' && isModEnabled('banque')) { + } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'bankdirect' && isModEnabled('bank')) { $bankdirect = 1; - } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'invoiceonly' && isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) { + } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'invoiceonly' && isModEnabled('bank') && isModEnabled('societe') && isModEnabled('invoice')) { $invoiceonly = 1; } } @@ -1029,7 +1029,7 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h print '">'; // Complementary action - if ((isModEnabled('banque') || isModEnabled('facture')) && !getDolGlobalString('ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS')) { + if ((isModEnabled('bank') || isModEnabled('invoice')) && !getDolGlobalString('ADHERENT_SUBSCRIPTION_HIDECOMPLEMENTARYACTIONS')) { $company = new Societe($db); if ($object->socid) { $result = $company->fetch($object->socid); @@ -1043,12 +1043,12 @@ if (($action == 'addsubscription' || $action == 'create_thirdparty') && $user->h print ''; print '
'; // Add entry into bank account - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { print '
'; } // Add invoice with no payments - if (isModEnabled('societe') && isModEnabled('facture')) { + if (isModEnabled('societe') && isModEnabled('invoice')) { print 'fk_soc)) print ' disabled'; print '>
'; } // Add invoice with payments - if (isModEnabled('banque') && isModEnabled('societe') && isModEnabled('facture')) { + if (isModEnabled('bank') && isModEnabled('societe') && isModEnabled('invoice')) { print 'fk_soc)) print ' disabled'; print '>'; // Bank line - if (isModEnabled("banque") && (getDolGlobalString('ADHERENT_BANK_USE') || $object->fk_bank)) { + if (isModEnabled("bank") && (getDolGlobalString('ADHERENT_BANK_USE') || $object->fk_bank)) { print ''; print ''; @@ -542,8 +542,8 @@ print "\n"; print ''; print ""; print ""; print ''; print ""; print "\n"; print ''; print ""; print "'; } // Synchro member type active -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { print ''; diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index cc9b100d393..a8c07357a81 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -46,7 +46,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; // Load translation files required by the page $langsArray=array("errors", "admin", "mails", "languages"); -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { $langsArray[]='members'; } if (isModEnabled('eventorganization')) { @@ -183,7 +183,7 @@ $elementList = array(); $elementList['all'] = '-- '.dol_escape_htmltag($langs->trans("All")).' --'; $elementList['none'] = '-- '.dol_escape_htmltag($langs->trans("None")).' --'; $elementList['user'] = img_picto('', 'user', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToUser')); -if (isModEnabled('adherent') && $user->hasRight('adherent', 'lire')) { +if (isModEnabled('member') && $user->hasRight('adherent', 'lire')) { $elementList['member'] = img_picto('', 'object_member', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToMember')); } if (isModEnabled('recruitment') && $user->hasRight('recruitment', 'recruitmentjobposition', 'read')) { @@ -198,19 +198,19 @@ if (isModEnabled('project')) { if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) { $elementList['propal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendProposal')); } -if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { +if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $elementList['order_send'] = img_picto('', 'order', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendOrder')); } -if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { +if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $elementList['facture_send'] = img_picto('', 'bill', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendInvoice')); } -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { $elementList['shipping_send'] = img_picto('', 'dolly', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendShipment')); } if (isModEnabled("reception")) { $elementList['reception_send'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendReception')); } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $elementList['fichinter_send'] = img_picto('', 'intervention', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendIntervention')); } if (isModEnabled('supplier_proposal')) { @@ -222,7 +222,7 @@ if (isModEnabled("supplier_order") && ($user->hasRight('fournisseur', 'commande' if (isModEnabled("supplier_invoice") && ($user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('supplier_invoice', 'read'))) { $elementList['invoice_supplier_send'] = img_picto('', 'bill', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierInvoice')); } -if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { +if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $elementList['contract'] = img_picto('', 'contract', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendContract')); } if (isModEnabled('ticket') && $user->hasRight('ticket', 'read')) { diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 31becefc379..20603909699 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -234,7 +234,7 @@ if (isModEnabled('supplier_order')) { print ''; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { print load_fiche_titre($langs->trans("Invoices"), '', 'bill'); print '
'; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 0f6d91f26eb..2eb1ed3c820 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -507,7 +507,7 @@ print '
'; print ''; @@ -516,8 +516,8 @@ print "\n"; print ''; print ""; print ""; print ''; print ""; print "'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '\n"; print "\n"; // Option to force stock to be enough before adding a line into document -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { print ''; print ''; print '\n"; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { print ''; print ''; print '\n"; } -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { print ''; print ''; print '\n"; print ''; -if (isModEnabled('banque')) { +if (isModEnabled('bank')) { print ''; } - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { // Categories print ''; // Tags-Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 7bfbe08af9c..e42e58ec2fc 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1660,7 +1660,7 @@ class ActionComm extends CommonObject $datas['note'] .= ''; } // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (isModEnabled('category') && !$nofetch) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1); diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 93191e69bea..ac9148579b1 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -213,10 +213,10 @@ class CActionComm //var_dump($obj->type.' '.$obj->module.' '); var_dump($user->hasRight('facture', 'lire')); $qualified = 0; // Special cases - if ($obj->module == 'invoice' && isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if ($obj->module == 'invoice' && isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $qualified = 1; } - if ($obj->module == 'order' && isModEnabled('commande') && !$user->hasRight('commande', 'lire')) { + if ($obj->module == 'order' && isModEnabled('order') && !$user->hasRight('commande', 'lire')) { $qualified = 1; } if ($obj->module == 'propal' && isModEnabled("propal") && $user->hasRight('propal', 'lire')) { @@ -228,7 +228,7 @@ class CActionComm if ($obj->module == 'order_supplier' && ((isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight('fournisseur', 'commande', 'lire')) || (!isModEnabled('supplier_order') && $user->hasRight('supplier_order', 'lire')))) { $qualified = 1; } - if ($obj->module == 'shipping' && isModEnabled("expedition") && $user->hasRight('expedition', 'lire')) { + if ($obj->module == 'shipping' && isModEnabled("delivery_note") && $user->hasRight('expedition', 'lire')) { $qualified = 1; } // For case module = 'myobject@eventorganization' diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 72357539c84..c00ff438490 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -41,48 +41,48 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } // Load translation files required by the page $langs->loadLangs(array('companies', 'banks')); -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $langs->load("contracts"); } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $langs->load("orders"); } -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { $langs->load("sendings"); } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $langs->load("bills"); } if (isModEnabled('project')) { $langs->load("projects"); } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $langs->load("interventions"); } if (isModEnabled('notification')) { @@ -440,7 +440,7 @@ if ($object->id > 0) { print ""; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Default bank account for payments print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1); @@ -744,7 +744,7 @@ if ($action != 'addsubscription' && $action != 'create_thirdparty') { print_liste_field_titre('DateStart', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre('DateEnd', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center '); print_liste_field_titre('Amount', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { print_liste_field_titre('Account', $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'right '); } print "
'.dol_print_date($db->jdate($objp->dateh), 'day')."'.dol_print_date($db->jdate($objp->datef), 'day')."'.price($objp->subscription).''; if ($objp->bid) { $accountstatic->label = $objp->label; @@ -808,7 +808,7 @@ if ($action != 'addsubscription' && $action != 'create_thirdparty') { if (empty($num)) { $colspan = 6; - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { $colspan++; } print '
'.$langs->trans("None").'
'.$langs->trans("BankTransactionLine").''; if ($object->fk_bank) { $bankline = new AccountLine($db); @@ -282,7 +282,7 @@ if ($rowid && $action != 'edit') { $formquestion=array(); //$formquestion['text']=''.$langs->trans("ThisWillAlsoDeleteBankRecord").''; $text = $langs->trans("ConfirmDeleteSubscription"); - if (isModEnabled("banque") && getDolGlobalString('ADHERENT_BANK_USE')) { + if (isModEnabled("bank") && getDolGlobalString('ADHERENT_BANK_USE')) { $text .= '
'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord"); } print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id, $langs->trans("DeleteSubscription"), $text, "confirm_delete", $formquestion, 0, 1); @@ -337,7 +337,7 @@ if ($rowid && $action != 'edit') { print '
'.$langs->trans("Label").''.dol_string_onlythesehtmltags(dol_htmlentitiesbr($object->note_private)).'
'.$langs->trans("BankTransactionLine").''; if ($object->fk_bank > 0) { $bankline = new AccountLine($db); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index ddd2728d169..28ad3ef7dd7 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -95,7 +95,7 @@ $arrayfields = array( 'd.firstname'=>array('label'=>"Firstname", 'checked'=>1), 'd.login'=>array('label'=>"Login", 'checked'=>1), 't.libelle'=>array('label'=>"Label", 'checked'=>1), - 'd.bank'=>array('label'=>"BankAccount", 'checked'=>1, 'enabled'=>(isModEnabled('banque'))), + 'd.bank'=>array('label'=>"BankAccount", 'checked'=>1, 'enabled'=>(isModEnabled('bank'))), /*'d.note_public'=>array('label'=>"NotePublic", 'checked'=>0), 'd.note_private'=>array('label'=>"NotePrivate", 'checked'=>0),*/ 'c.dateadh'=>array('label'=>"DateSubscription", 'checked'=>1, 'position'=>100), diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 445535a55e4..9a4ba84d3c7 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -533,7 +533,7 @@ print ''; print ''; print $langs->trans("PaymentMode").''; -if (!isModEnabled('facture')) { +if (!isModEnabled('invoice')) { print ''; } print '
".$langs->trans("SuggestPaymentByRIBOnAccount").""; -if (!isModEnabled('facture')) { - if (isModEnabled("banque")) { +if (!isModEnabled('invoice')) { + if (isModEnabled("bank")) { $sql = "SELECT rowid, label"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql .= " WHERE clos = 0"; @@ -581,7 +581,7 @@ print "
".$langs->trans("SuggestPaymentByChequeToAddress").""; -if (!isModEnabled('facture')) { +if (!isModEnabled('invoice')) { print '
".$langs->trans("SuggestPaymentByRIBOnAccount").""; -if (isModEnabled('banque')) { +if (isModEnabled('bank')) { $sql = "SELECT rowid, label"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql .= " WHERE clos = 0"; diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 71105f078b5..5dc257a55d2 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -65,10 +65,10 @@ $conditions = array( 'NOTE_PRIVATE' => 1, 'SOCIETE' => 1, 'PRODUCTDESC' => (isModEnabled("product") || isModEnabled("service")), - 'DETAILS' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande') || isModEnabled('supplier_proposal') || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), + 'DETAILS' => (isModEnabled('invoice') || isModEnabled("propal") || isModEnabled('order') || isModEnabled('supplier_proposal') || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")), 'USERSIGN' => 1, 'MAILING' => isModEnabled('mailing'), - 'MAIL' => (isModEnabled('facture') || isModEnabled("propal") || isModEnabled('commande')), + 'MAIL' => (isModEnabled('invoice') || isModEnabled("propal") || isModEnabled('order')), 'TICKET' => isModEnabled('ticket'), 'SPECIALCHAR' => 1, ); diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php index dcf59d40d8b..53d52fdfe92 100644 --- a/htdocs/admin/ldap.php +++ b/htdocs/admin/ldap.php @@ -169,14 +169,14 @@ if (isModEnabled('societe')) { } // Synchro member active -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { print '
' . $langs->trans("LDAPDnMemberActive") . ''; print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_ACTIVE'), 'activemembers', array(), 2); print '' . $langs->trans("LDAPDnMemberActiveExample") . '
' . $langs->trans("LDAPDnMemberTypeActive") . ''; print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_TYPE_ACTIVE'), 'activememberstypes', array(), 2); print '' . $langs->trans("LDAPDnMemberTypeActiveExample") . '
'; print ''; print $langs->trans("PaymentMode").''; -if (!isModEnabled('facture')) { +if (!isModEnabled('invoice')) { print ''; } print '
".$langs->trans("SuggestPaymentByRIBOnAccount").""; -if (!isModEnabled('facture')) { - if (isModEnabled("banque")) { +if (!isModEnabled('invoice')) { + if (isModEnabled("bank")) { $sql = "SELECT rowid, label"; $sql .= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql .= " WHERE clos = 0"; @@ -555,7 +555,7 @@ print "
".$langs->trans("SuggestPaymentByChequeToAddress").""; -if (!isModEnabled('facture')) { +if (!isModEnabled('invoice')) { print '
'.$langs->trans("DeStockOnBill").''; -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { if ($conf->use_javascript_ajax) { if ($disabled) { print img_picto($langs->trans("Disabled"), 'off', 'class="opacitymedium"'); @@ -246,7 +246,7 @@ print ''; print '
'.$langs->trans("DeStockOnValidateOrder").''; -if (isModEnabled('commande')) { +if (isModEnabled('order')) { if ($conf->use_javascript_ajax) { if ($disabled) { print img_picto($langs->trans("Disabled"), 'off', 'class="opacitymedium"'); @@ -270,7 +270,7 @@ print ''; print '
'.$langs->trans("DeStockOnShipment").''; -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT', array(), null, 0, 0, 0, 2, 1, '', '', 'reposition'); } else { @@ -287,7 +287,7 @@ print ''; print '
'.$langs->trans("DeStockOnShipmentOnClosing").''; -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { if ($conf->use_javascript_ajax) { print ajax_constantonoff('STOCK_CALCULATE_ON_SHIPMENT_CLOSE', array(), null, 0, 0, 0, 2, 1, '', '', 'reposition'); } else { @@ -433,7 +433,7 @@ print "
'.$langs->trans("StockMustBeEnoughForInvoice").''; @@ -447,7 +447,7 @@ if (isModEnabled('facture')) { print "
'.$langs->trans("StockMustBeEnoughForOrder").''; @@ -461,7 +461,7 @@ if (isModEnabled('commande')) { print "
'.$langs->trans("StockMustBeEnoughForShipment").''; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index ef3dfb2fd99..82a55ca18d6 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -532,7 +532,7 @@ print '
'; print $langs->trans("BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL").' '; print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL'); diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php index 41b77c4e7a0..1628db01977 100644 --- a/htdocs/admin/workflow.php +++ b/htdocs/admin/workflow.php @@ -63,36 +63,36 @@ $workflowcodes = array( 'WORKFLOW_PROPAL_AUTOCREATE_ORDER'=>array( 'family'=>'create', 'position'=>10, - 'enabled'=>(isModEnabled("propal") && isModEnabled('commande')), + 'enabled'=>(isModEnabled("propal") && isModEnabled('order')), 'picto'=>'order' ), 'WORKFLOW_ORDER_AUTOCREATE_INVOICE'=>array( 'family'=>'create', 'position'=>20, - 'enabled'=>(isModEnabled('commande') && isModEnabled('facture')), + 'enabled'=>(isModEnabled('order') && isModEnabled('invoice')), 'picto'=>'bill' ), 'WORKFLOW_TICKET_CREATE_INTERVENTION' => array( 'family'=>'create', 'position'=>25, - 'enabled'=>(isModEnabled('ticket') && isModEnabled('ficheinter')), + 'enabled'=>(isModEnabled('ticket') && isModEnabled('intervention')), 'picto'=>'ticket' ), - 'separator1'=>array('family'=>'separator', 'position'=>25, 'title'=>'', 'enabled'=>((isModEnabled("propal") && isModEnabled('commande')) || (isModEnabled('commande') && isModEnabled('facture')) || (isModEnabled('ticket') && isModEnabled('ficheinter')))), + 'separator1'=>array('family'=>'separator', 'position'=>25, 'title'=>'', 'enabled'=>((isModEnabled("propal") && isModEnabled('order')) || (isModEnabled('order') && isModEnabled('invoice')) || (isModEnabled('ticket') && isModEnabled('intervention')))), // Automatic classification of proposal 'WORKFLOW_ORDER_CLASSIFY_BILLED_PROPAL'=>array( 'family'=>'classify_proposal', 'position'=>30, - 'enabled'=>(isModEnabled("propal") && isModEnabled('commande')), + 'enabled'=>(isModEnabled("propal") && isModEnabled('order')), 'picto'=>'propal', 'warning'=>'' ), 'WORKFLOW_INVOICE_CLASSIFY_BILLED_PROPAL'=>array( 'family'=>'classify_proposal', 'position'=>31, - 'enabled'=>(isModEnabled("propal") && isModEnabled('facture')), + 'enabled'=>(isModEnabled("propal") && isModEnabled('invoice')), 'picto'=>'propal', 'warning'=>'' ), @@ -101,19 +101,19 @@ $workflowcodes = array( 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING'=>array( // when shipping validated 'family'=>'classify_order', 'position'=>40, - 'enabled'=>(isModEnabled("expedition") && isModEnabled('commande')), + 'enabled'=>(isModEnabled("delivery_note") && isModEnabled('order')), 'picto'=>'order' ), 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED'=>array( // when shipping closed 'family'=>'classify_order', 'position'=>41, - 'enabled'=>(isModEnabled("expedition") && isModEnabled('commande')), + 'enabled'=>(isModEnabled("delivery_note") && isModEnabled('order')), 'picto'=>'order' ), 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER'=>array( 'family'=>'classify_order', 'position'=>42, - 'enabled'=>(isModEnabled('facture') && isModEnabled('commande')), + 'enabled'=>(isModEnabled('invoice') && isModEnabled('order')), 'picto'=>'order', 'warning'=>'' ), // For this option, if module invoice is disabled, it does not exists, so "Classify billed" for order must be done manually from order card. @@ -166,7 +166,7 @@ $workflowcodes = array( 'WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE' => array( 'family' => 'classify_shipping', 'position' => 91, - 'enabled' => isModEnabled("expedition") && isModEnabled("facture") && getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0', + 'enabled' => isModEnabled("delivery_note") && isModEnabled("invoice") && getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0', 'picto' => 'shipment' ), diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 23c40994d9b..451720bbd59 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -146,7 +146,7 @@ class BlockedLog $this->trackedevents = array(); // Customer Invoice/Facture / Payment - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $this->trackedevents['BILL_VALIDATE'] = 'logBILL_VALIDATE'; $this->trackedevents['BILL_DELETE'] = 'logBILL_DELETE'; $this->trackedevents['BILL_SENTBYMAIL'] = 'logBILL_SENTBYMAIL'; @@ -188,14 +188,14 @@ class BlockedLog */ // Members - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $this->trackedevents['MEMBER_SUBSCRIPTION_CREATE'] = 'logMEMBER_SUBSCRIPTION_CREATE'; $this->trackedevents['MEMBER_SUBSCRIPTION_MODIFY'] = 'logMEMBER_SUBSCRIPTION_MODIFY'; $this->trackedevents['MEMBER_SUBSCRIPTION_DELETE'] = 'logMEMBER_SUBSCRIPTION_DELETE'; } // Bank - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $this->trackedevents['PAYMENT_VARIOUS_CREATE'] = 'logPAYMENT_VARIOUS_CREATE'; $this->trackedevents['PAYMENT_VARIOUS_MODIFY'] = 'logPAYMENT_VARIOUS_MODIFY'; $this->trackedevents['PAYMENT_VARIOUS_DELETE'] = 'logPAYMENT_VARIOUS_DELETE'; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index bcad30ffa91..4eb7fa3ad6b 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1457,7 +1457,7 @@ if ($action == 'create') { print '
'.$langs->trans("Location").'
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); @@ -2027,7 +2027,7 @@ if ($id > 0) { print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1); $c = new Categorie($db); @@ -2452,7 +2452,7 @@ if ($id > 0) { } // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_ACTIONCOMM, 1); print "
'; print ''; print ''; print ''; // Bank Account - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) { print ''; @@ -2004,7 +2004,7 @@ if ($action == 'create') { print ''; // Shipping Method - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { if (getDolGlobalString('SOCIETE_ASK_FOR_SHIPPING_METHOD') && !empty($soc->shipping_method_id)) { $shipping_method_id = $soc->shipping_method_id; } @@ -2025,7 +2025,7 @@ if ($action == 'create') { // Delivery delay print '
'; @@ -512,7 +512,7 @@ if ($object->id > 0) { } if ($object->client) { - if (isModEnabled('commande') && getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT')) { + if (isModEnabled('order') && getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT')) { print ''."\n"; print '
'; @@ -607,7 +607,7 @@ if ($object->id > 0) { } // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $langs->load("categories"); print '
'.$langs->trans("CustomersCategoriesShort").''; @@ -623,7 +623,7 @@ if ($object->id > 0) { include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; // Module Adherent - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $langs->load("members"); $langs->load("users"); @@ -721,7 +721,7 @@ if ($object->id > 0) { } } - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { // Box commandes $tmp = $object->getOutstandingOrders(); $outstandingOpened = $tmp['opened']; @@ -742,7 +742,7 @@ if ($object->id > 0) { } } - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { // Box factures $tmp = $object->getOutstandingBills('customer', 0); $outstandingOpened = $tmp['opened']; @@ -917,7 +917,7 @@ if ($object->id > 0) { /* * Latest orders */ - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $param =""; $sql = "SELECT s.nom, s.rowid"; @@ -1028,7 +1028,7 @@ if ($object->id > 0) { /* * Latest shipments */ - if (isModEnabled("expedition") && $user->hasRight('expedition', 'lire')) { + if (isModEnabled("delivery_note") && $user->hasRight('expedition', 'lire')) { $sql = 'SELECT e.rowid as id'; $sql .= ', e.ref, e.entity'; $sql .= ', e.date_creation'; @@ -1126,7 +1126,7 @@ if ($object->id > 0) { /* * Latest contracts */ - if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $sql = "SELECT s.nom, s.rowid, c.rowid as id, c.ref as ref, c.statut as contract_status, c.datec as dc, c.date_contrat as dcon, c.ref_customer as refcus, c.ref_supplier as refsup, c.entity,"; $sql .= " c.last_main_doc, c.model_pdf"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c"; @@ -1234,7 +1234,7 @@ if ($object->id > 0) { /* * Latest interventions */ - if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire')) { + if (isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire')) { $sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate, f.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f"; $sql .= " WHERE f.fk_soc = s.rowid"; @@ -1320,7 +1320,7 @@ if ($object->id > 0) { /* * Latest invoices templates */ - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $sql = 'SELECT f.rowid as id, f.titre as ref'; $sql .= ', f.total_ht'; $sql .= ', f.total_tva'; @@ -1421,7 +1421,7 @@ if ($object->id > 0) { /* * Latest invoices */ - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $sql = 'SELECT f.rowid as facid, f.ref, f.type'; $sql .= ', f.total_ht'; $sql .= ', f.total_tva'; @@ -1579,7 +1579,7 @@ if ($object->id > 0) { print ''; } - if (isModEnabled('commande') && $user->hasRight('commande', 'creer') && $object->status == 1) { + if (isModEnabled('order') && $user->hasRight('commande', 'creer') && $object->status == 1) { $langs->load("orders"); print ''; } @@ -1589,7 +1589,7 @@ if ($object->id > 0) { print ''; } - if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'creer') && $object->status == 1) { + if (isModEnabled('intervention') && $user->hasRight('ficheinter', 'creer') && $object->status == 1) { $langs->load("fichinter"); print ''; } @@ -1601,14 +1601,14 @@ if ($object->id > 0) { print ''; } - if (isModEnabled('facture') && $object->status == 1) { + if (isModEnabled('invoice') && $object->status == 1) { if (!$user->hasRight('facture', 'creer')) { $langs->load("bills"); print ''; } else { $langs->loadLangs(array("orders", "bills")); - if (isModEnabled('commande')) { + if (isModEnabled('order')) { if ($object->client != 0 && $object->client != 2) { if (!empty($orders2invoice) && $orders2invoice > 0) { print ''; diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 67823d4b12f..77f0c7ea647 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -39,10 +39,10 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php'; -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } @@ -96,14 +96,14 @@ if (isModEnabled("propal")) { if (isModEnabled('supplier_proposal')) { $supplierproposalstatic = new SupplierProposal($db); } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $orderstatic = new Commande($db); } if (isModEnabled("supplier_order")) { $supplierorderstatic = new CommandeFournisseur($db); } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $fichinterstatic = new Fichinter($db); } @@ -323,7 +323,7 @@ if (isModEnabled('supplier_proposal') && $user->hasRight("supplier_proposal", "l * Draft sales orders */ -if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { +if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; @@ -518,7 +518,7 @@ if ((isModEnabled("fournisseur") && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERMO /* * Draft interventions */ -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $sql = "SELECT f.rowid, f.ref, s.nom as name, f.fk_statut, f.duree as duration"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; @@ -817,7 +817,7 @@ if ((isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $use /* * Latest contracts */ -if (isModEnabled('contrat') && $user->hasRight("contrat", "lire") && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT +if (isModEnabled('contract') && $user->hasRight("contrat", "lire") && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT $staticcontrat = new Contrat($db); $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; @@ -1014,7 +1014,7 @@ if (isModEnabled("propal") && $user->hasRight("propal", "lire")) { /* * Opened (validated) order */ -if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { +if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $sql = "SELECT c.rowid as commandeid, c.total_ttc, c.total_ht, c.total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.code_client, s.code_compta, s.client"; diff --git a/htdocs/comm/mailing/advtargetemailing.php b/htdocs/comm/mailing/advtargetemailing.php index 4742d6b66e7..adfb7feeffb 100644 --- a/htdocs/comm/mailing/advtargetemailing.php +++ b/htdocs/comm/mailing/advtargetemailing.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->loadLangs(array('mails', 'companies')); -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $langs->load("categories"); } diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index d22278ad585..9c30198f3e7 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -757,7 +757,7 @@ if (empty($reshook)) { if ( !$error && GETPOSTINT('statut') == $object::STATUS_SIGNED && GETPOSTINT('generate_deposit') == 'on' - && !empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && $user->hasRight('facture', 'creer') + && !empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer') ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; @@ -1991,7 +1991,7 @@ if ($action == 'create') { print '
'.$langs->trans('AvailabilityPeriod'); - if (isModEnabled('commande')) { + if (isModEnabled('order')) { print ' ('.$langs->trans('AfterOrder').')'; } print ''; @@ -2284,7 +2284,7 @@ if ($action == 'create') { // It may also break step of creating an order when invoicing must be done from orders and not from proposal $deposit_percent_from_payment_terms = getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); - if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && $user->hasRight('facture', 'creer')) { + if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $object->fetchObjectLinked(); @@ -2674,7 +2674,7 @@ if ($action == 'create') { // Delivery delay print '
'; print ''; // Shipping Method - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { print '
'; - if (isModEnabled('commande')) { + if (isModEnabled('order')) { print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')'); } else { print $langs->trans('AvailabilityPeriod'); @@ -2695,7 +2695,7 @@ if ($action == 'create') { print '
'; print ''; } - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) { // Bank Account print '
'; print $langs->trans('SendingMethod'); @@ -2813,7 +2813,7 @@ if ($action == 'create') { print '
'; print ''; // Bank Account - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_ORDER') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_ORDER') && isModEnabled("bank")) { print ''; } // Shipping Method - if (isModEnabled('expedition')) { + if (isModEnabled('delivery_note')) { print ''; // Shipping Method - if (isModEnabled('expedition')) { + if (isModEnabled('delivery_note')) { print ''; // Tags-Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'; @@ -3057,7 +3057,7 @@ if ($action == 'create') { } // Create a sale order - if (isModEnabled('commande') && $object->statut == Propal::STATUS_SIGNED) { + if (isModEnabled('order') && $object->statut == Propal::STATUS_SIGNED) { if ($usercancreateorder) { print ''.$langs->trans("AddOrder").''; } @@ -3073,7 +3073,7 @@ if ($action == 'create') { } // Create an intervention - if (isModEnabled("service") && isModEnabled('ficheinter') && $object->statut == Propal::STATUS_SIGNED) { + if (isModEnabled("service") && isModEnabled('intervention') && $object->statut == Propal::STATUS_SIGNED) { if ($usercancreateintervention) { $langs->load("interventions"); print ''.$langs->trans("AddIntervention").''; @@ -3081,7 +3081,7 @@ if ($action == 'create') { } // Create contract - if (isModEnabled('contrat') && $object->statut == Propal::STATUS_SIGNED) { + if (isModEnabled('contract') && $object->statut == Propal::STATUS_SIGNED) { $langs->load("contracts"); if ($usercancreatecontract) { @@ -3091,7 +3091,7 @@ if ($action == 'create') { // Create an invoice and classify billed if ($object->statut == Propal::STATUS_SIGNED && !getDolGlobalString('PROPOSAL_ARE_NOT_BILLABLE')) { - if (isModEnabled('facture') && $usercancreateinvoice) { + if (isModEnabled('invoice') && $usercancreateinvoice) { print ''.$langs->trans("CreateBill").''; } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 7a1626674e5..24c92ad317c 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -51,14 +51,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; } // Load translation files required by the page $langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories')); -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { $langs->loadLangs(array('sendings')); } @@ -222,7 +222,7 @@ $arrayfields = array( 'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0), 'p.date_signature'=>array('label'=>"DateSigning", 'checked'=>0), 'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0), - 'p.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'enabled'=>isModEnabled("expedition")), + 'p.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'enabled'=>isModEnabled("delivery_note")), 'p.fk_input_reason'=>array('label'=>"Origin", 'checked'=>0, 'enabled'=>1), 'p.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0), 'p.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0), @@ -1156,14 +1156,14 @@ if ($search_date_signature_endyear) { $moreforfilter .= ''; } // If the user can view products - if (isModEnabled('categorie') && $user->hasRight('categorie', 'read') && ($user->hasRight('product', 'read') || $user->hasRight('service', 'read'))) { + if (isModEnabled('category') && $user->hasRight('categorie', 'read') && ($user->hasRight('product', 'read') || $user->hasRight('service', 'read'))) { $searchCategoryProductOperator = -1; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $tmptitle = $langs->trans('IncludingProductWithTag'); $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, array($search_product_category), 'maxwidth300', $searchCategoryProductOperator, 0, 0, $tmptitle); } - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php index 4881fce1920..0c9a7454620 100644 --- a/htdocs/comm/recap-client.php +++ b/htdocs/comm/recap-client.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Load translation files required by the page $langs->load("companies"); -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $langs->load("bills"); } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index c2c6cfe44cf..41cfb6dd96c 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1355,7 +1355,7 @@ if (empty($reshook)) { if ( GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms) - && isModEnabled('facture') && $user->hasRight('facture', 'creer') + && isModEnabled('invoice') && $user->hasRight('facture', 'creer') ) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; @@ -1946,14 +1946,14 @@ if ($action == 'create' && $usercancreate) { print '
'.$langs->trans('BankAccount').''; print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); print '
'.$langs->trans('SendingMethod').''; print img_picto('', 'object_dolly', 'class="pictofixedwidth"'); $form->selectShippingMethod(((GETPOSTISSET('shipping_method_id') && GETPOSTINT('shipping_method_id') != 0) ? GETPOST('shipping_method_id') : $shipping_method_id), 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx'); @@ -2242,7 +2242,7 @@ if ($action == 'create' && $usercancreate) { // It may also break step of creating an order when invoicing must be done from proposals and not from orders $deposit_percent_from_payment_terms = (float) getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id); - if (!empty($deposit_percent_from_payment_terms) && isModEnabled('facture') && $user->hasRight('facture', 'creer')) { + if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) { require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $object->fetchObjectLinked(); @@ -2593,7 +2593,7 @@ if ($action == 'create' && $usercancreate) { print '
'; $editenable = $usercancreate; print $form->editfieldkey("SendingMethod", 'shippingmethod', '', $object, $editenable); @@ -2750,7 +2750,7 @@ if ($action == 'create' && $usercancreate) { } // Bank Account - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_ORDER') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_ORDER') && isModEnabled("bank")) { print '
'; $editenable = $usercancreate; print $form->editfieldkey("BankAccount", 'bankaccount', '', $object, $editenable); @@ -2971,7 +2971,7 @@ if ($action == 'create' && $usercancreate) { }*/ // Create intervention - $arrayforbutaction[] = array('lang'=>'interventions', 'enabled'=>(isModEnabled("ficheinter") && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0), 'perm'=>$user->hasRight('ficheinter', 'creer'), 'label'=>'AddIntervention', 'url'=>'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid); + $arrayforbutaction[] = array('lang'=>'interventions', 'enabled'=>(isModEnabled("intervention") && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0), 'perm'=>$user->hasRight('ficheinter', 'creer'), 'label'=>'AddIntervention', 'url'=>'/fichinter/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid); /*if (isModEnabled('ficheinter')) { $langs->load("interventions"); @@ -2985,7 +2985,7 @@ if ($action == 'create' && $usercancreate) { }*/ // Create contract - $arrayforbutaction[] = array('lang'=>'contracts', 'enabled'=>(isModEnabled("contrat") && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)), 'perm'=>$user->hasRight('contrat', 'creer'), 'label'=>'AddContract', 'url'=>'/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid); + $arrayforbutaction[] = array('lang'=>'contracts', 'enabled'=>(isModEnabled("contract") && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)), 'perm'=>$user->hasRight('contrat', 'creer'), 'label'=>'AddContract', 'url'=>'/contrat/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid); /*if (isModEnabled('contrat') && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) { $langs->load("contracts"); @@ -2995,14 +2995,14 @@ if ($action == 'create' && $usercancreate) { }*/ $numshipping = 0; - if (isModEnabled('expedition')) { + if (isModEnabled('delivery_note')) { $numshipping = $object->countNbOfShipments(); } // Create shipment if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES'))) { if ((getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'creer')) || (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'creer'))) { - $arrayforbutaction[] = array('lang'=>'sendings', 'enabled'=>(isModEnabled("expedition") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), 'perm'=>$user->hasRight('expedition', 'creer'), 'label'=>'CreateShipment', 'url'=>'/expedition/shipment.php?id='.$object->id); + $arrayforbutaction[] = array('lang'=>'sendings', 'enabled'=>(isModEnabled("delivery_note") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))), 'perm'=>$user->hasRight('expedition', 'creer'), 'label'=>'CreateShipment', 'url'=>'/expedition/shipment.php?id='.$object->id); /* if ($user->hasRight('expedition', 'creer')) { print dolGetButtonAction('', $langs->trans('CreateShipment'), 'default', DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id, ''); @@ -3018,7 +3018,7 @@ if ($action == 'create' && $usercancreate) { // Create bill $arrayforbutaction[] = array( 'lang'=>'bills', - 'enabled'=>(isModEnabled('facture') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0), + 'enabled'=>(isModEnabled('invoice') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0), 'perm'=>($user->hasRight('facture', 'creer') && !getDolGlobalInt('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')), 'label'=>'CreateBill', 'url'=>'/compta/facture/card.php?action=create&token='.newToken().'&origin='.urlencode($object->element).'&originid='.$object->id.'&socid='.$object->socid diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 27071e824ea..cb2f301c2d9 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3825,7 +3825,7 @@ class Commande extends CommonOrder $result = ''; - if (isModEnabled("expedition") && ($option == '1' || $option == '2')) { + if (isModEnabled("delivery_note") && ($option == '1' || $option == '2')) { $url = DOL_URL_ROOT.'/expedition/shipment.php?id='.$this->id; } else { $url = DOL_URL_ROOT.'/commande/card.php?id='.$this->id; diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index 0186d660953..564cfcde895 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -92,7 +92,7 @@ if ($tmp) { /* * Draft orders */ -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; @@ -244,7 +244,7 @@ $max = 10; /* * Orders to process */ -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; @@ -333,7 +333,7 @@ if (isModEnabled('commande')) { /* * Orders that are in process */ -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid"; $sql .= ", s.client"; $sql .= ", s.code_client"; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index c9fa02304f5..b8308827c6c 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -179,7 +179,7 @@ $arrayfields = array( 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55), 'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60, 'csslist'=>'nowraponall'), 'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>!getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position'=>65, 'csslist'=>'nowraponall'), - 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled("expedition")), + 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled("delivery_note")), 'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>-1, 'position'=>67), 'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>-1, 'position'=>68), 'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>-1, 'position'=>69), @@ -202,7 +202,7 @@ $arrayfields = array( 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position'=>135, 'searchall'=>1), 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position'=>140), - 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled("expedition")), 'position'=>990), + 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled("delivery_note")), 'position'=>990), 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position'=>995), 'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) @@ -893,7 +893,7 @@ if ($search_billed != '' && $search_billed >= 0) { } if ($search_status != '') { if ($search_status <= 3 && $search_status >= -1) { // status from -1 to 3 are real status (other are virtual combination) - if ($search_status == 1 && !isModEnabled('expedition')) { + if ($search_status == 1 && !isModEnabled('delivery_note')) { $sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status "sent" into "validated" } else { $sql .= ' AND c.fk_statut = '.((int) $search_status); // draft, validated, in process or canceled @@ -1150,7 +1150,7 @@ if ($search_status == -2) { $title .= ' - '.$langs->trans('StatusOrderToProcessShort'); } if ($search_status == -3) { - $title .= ' - '.$langs->trans('StatusOrderValidated').', '.(!isModEnabled('expedition') ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); + $title .= ' - '.$langs->trans('StatusOrderValidated').', '.(!isModEnabled('delivery_note') ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); } if ($search_status == -4) { $title .= ' - '.$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"); @@ -1327,7 +1327,7 @@ if ($permissiontovalidate) { if ($permissiontoclose) { $arrayofmassactions['preshipped'] = img_picto('', 'dollyrevert', 'class="pictofixedwidth"').$langs->trans("ClassifyShipped"); } -if (isModEnabled('facture') && $user->hasRight("facture", "creer")) { +if (isModEnabled('invoice') && $user->hasRight("facture", "creer")) { $arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer"); } if ($permissiontoclose) { @@ -1466,7 +1466,7 @@ if ($user->hasRight("user", "user", "lire")) { } // If the user can view other products/services than his own -if (isModEnabled('categorie') && $user->hasRight("categorie", "lire") && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) { +if (isModEnabled('category') && $user->hasRight("categorie", "lire") && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -1475,7 +1475,7 @@ if (isModEnabled('categorie') && $user->hasRight("categorie", "lire") && ($user- $moreforfilter .= '
'; } // If Categories are enabled & user has rights to see -if (isModEnabled('categorie') && $user->hasRight("categorie", "lire")) { +if (isModEnabled('category') && $user->hasRight("categorie", "lire")) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); @@ -2192,7 +2192,7 @@ while ($i < $imaxinloop) { } // If module invoices enabled and user with invoice creation permissions - if (isModEnabled('facture') && getDolGlobalString('ORDER_BILLING_ALL_CUSTOMER')) { + if (isModEnabled('invoice') && getDolGlobalString('ORDER_BILLING_ALL_CUSTOMER')) { if ($user->hasRight('facture', 'creer')) { if (($obj->fk_statut > 0 && $obj->fk_statut < 3) || ($obj->fk_statut == 3 && $obj->billed == 0)) { print ' '; @@ -2665,7 +2665,7 @@ while ($i < $imaxinloop) { $stock_order = 0; $stock_order_supplier = 0; if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT') || getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) { // What about other options ? - if (isModEnabled('commande')) { + if (isModEnabled('order')) { if (empty($productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'])) { $generic_product->load_stats_commande(0, '1,2'); $productstat_cache[$generic_commande->lines[$lig]->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty']; diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 38e10afd97e..2be6cd61baf 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -48,7 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -79,7 +79,7 @@ $search_dateorder_end = dol_mktime(23, 59, 59, GETPOSTINT('search_dateorder_end_ $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datedelivery_start_month'), GETPOSTINT('search_datedelivery_start_day'), GETPOSTINT('search_datedelivery_start_year')); $search_datedelivery_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datedelivery_end_month'), GETPOSTINT('search_datedelivery_end_day'), GETPOSTINT('search_datedelivery_end_year')); -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $search_product_category_array = GETPOST("search_category_".Categorie::TYPE_PRODUCT."_list", "array"); $searchCategoryProductOperator = 0; if (GETPOSTISSET('formfilteraction')) { @@ -197,7 +197,7 @@ $arrayfields = array( 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55), 'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60), 'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>!getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position'=>65), - 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled('expedition')), + 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled('delivery_note')), 'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>-1, 'position'=>67), 'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>-1, 'position'=>68), 'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>-1, 'position'=>69), @@ -221,7 +221,7 @@ $arrayfields = array( 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(!getDolGlobalString('MAIN_LIST_ALLOW_PUBLIC_NOTES')), 'position'=>135), 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(!getDolGlobalString('MAIN_LIST_ALLOW_PRIVATE_NOTES')), 'position'=>140), - 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled('expedition')), 'position'=>990), + 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled('delivery_note')), 'position'=>990), 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position'=>995), 'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) @@ -472,7 +472,7 @@ if ($search_billed != '' && $search_billed >= 0) { } if ($search_status != '') { if ($search_status <= 3 && $search_status >= -1) { // status from -1 to 3 are real status (other are virtual combination) - if ($search_status == 1 && !isModEnabled('expedition')) { + if ($search_status == 1 && !isModEnabled('delivery_note')) { $sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status "sent" into "validated" } else { $sql .= ' AND c.fk_statut = '.((int) $search_status); // draft, validated, in process or canceled @@ -687,7 +687,7 @@ if ($resql) { $title .= ' - '.$langs->trans('StatusOrderToProcessShort'); } if ($search_status == -3) { - $title .= ' - '.$langs->trans('StatusOrderValidated').', '.(!isModEnabled('expedition') ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); + $title .= ' - '.$langs->trans('StatusOrderValidated').', '.(!isModEnabled('delivery_note') ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); } if ($search_status == -4) { $title .= ' - '.$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"); @@ -937,11 +937,11 @@ if ($resql) { $moreforfilter .= '
'; } // Filter on categories - if (isModEnabled("categorie") && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { + if (isModEnabled("category") && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PRODUCT, $search_product_category_array, 'minwidth300imp minwidth300', $searchCategoryProductOperator ? $searchCategoryProductOperator : 0); } - if (isModEnabled("categorie") && $user->hasRight('categorie', 'lire')) { + if (isModEnabled("category") && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); @@ -1678,7 +1678,7 @@ if ($resql) { print $getNomUrl_cache[$obj->socid]; // If module invoices enabled and user with invoice creation permissions - if (isModEnabled('facture') && getDolGlobalString('ORDER_BILLING_ALL_CUSTOMER')) { + if (isModEnabled('invoice') && getDolGlobalString('ORDER_BILLING_ALL_CUSTOMER')) { if ($user->hasRight('facture', 'creer')) { if (($obj->fk_statut > 0 && $obj->fk_statut < 3) || ($obj->fk_statut == 3 && $obj->billed == 0)) { print ' '; @@ -2124,7 +2124,7 @@ if ($resql) { $stock_order = 0; $stock_order_supplier = 0; if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT') || getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) { // What about other options ? - if (isModEnabled('commande')) { + if (isModEnabled('order')) { if (empty($productstat_cache[$obj->fk_product]['stats_order_customer'])) { $generic_product->load_stats_commande(0, '1,2'); $productstat_cache[$obj->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty']; diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index f6a67149aa8..b22abd7b33a 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -135,13 +135,13 @@ if (empty($entity)) { $error = 0; $listofchoices = array( - 'selectinvoices'=>array('label'=>'Invoices', 'picto'=>'bill', 'lang'=>'bills', 'enabled' => isModEnabled('facture'), 'perms' => $user->hasRight('facture', 'lire')), + 'selectinvoices'=>array('label'=>'Invoices', 'picto'=>'bill', 'lang'=>'bills', 'enabled' => isModEnabled('invoice'), 'perms' => $user->hasRight('facture', 'lire')), 'selectsupplierinvoices'=>array('label'=>'BillsSuppliers', 'picto'=>'supplier_invoice', 'lang'=>'bills', 'enabled' => isModEnabled('supplier_invoice'), 'perms' => $user->hasRight('fournisseur', 'facture', 'lire')), 'selectexpensereports'=>array('label'=>'ExpenseReports', 'picto'=>'expensereport', 'lang'=>'trips', 'enabled' => isModEnabled('expensereport'), 'perms' => $user->hasRight('expensereport', 'lire')), 'selectdonations'=>array('label'=>'Donations', 'picto'=>'donation', 'lang'=>'donation', 'enabled' => isModEnabled('don'), 'perms' => $user->hasRight('don', 'lire')), 'selectsocialcontributions'=>array('label'=>'SocialContributions', 'picto'=>'bill', 'enabled' => isModEnabled('tax'), 'perms' => $user->hasRight('tax', 'charges', 'lire')), 'selectpaymentsofsalaries'=>array('label'=>'SalariesPayments', 'picto'=>'salary', 'lang'=>'salaries', 'enabled' => isModEnabled('salaries'), 'perms' => $user->hasRight('salaries', 'read')), - 'selectvariouspayment'=>array('label'=>'VariousPayment', 'picto'=>'payment', 'enabled' => isModEnabled('banque'), 'perms' => $user->hasRight('banque', 'lire')), + 'selectvariouspayment'=>array('label'=>'VariousPayment', 'picto'=>'payment', 'enabled' => isModEnabled('bank'), 'perms' => $user->hasRight('banque', 'lire')), 'selectloanspayment'=>array('label'=>'PaymentLoan','picto'=>'loan', 'enabled' => isModEnabled('don'), 'perms' => $user->hasRight('loan', 'read')), ); @@ -643,7 +643,7 @@ if (isModEnabled('multicompany') && is_object($mc)) { print '
'; // Project filter -if (isModEnabled('projet')) { +if (isModEnabled('project')) { $formproject = new FormProjets($db); $langs->load('projects'); print ''.$langs->trans('Project').":"; diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 8ca2d819152..e6eacc582a6 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -1049,9 +1049,9 @@ if ($resql) { $moreforfilter .= '
'; $moreforfilter .= ''; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $langs->load('categories'); // Bank line diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 369749781b5..d6680d09e8e 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbank.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } if (isModEnabled('accounting')) { @@ -477,7 +477,7 @@ if ($action == 'create') { print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1); @@ -762,7 +762,7 @@ if ($action == 'create') { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; @@ -1037,7 +1037,7 @@ if ($action == 'create') { print ''; // Tags-Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $langs->load('categories'); // Bank line diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 97d34c16fba..d88cb100991 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -39,7 +39,7 @@ if (isModEnabled('accounting')) { if (isModEnabled('accounting')) { require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; } -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -61,7 +61,7 @@ $search_status = GETPOST('search_status') ? GETPOST('search_status', 'alpha') : $optioncss = GETPOST('optioncss', 'alpha'); $search_category_list =""; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $search_category_list = GETPOST("search_category_".Categorie::TYPE_ACCOUNT."_list", "array"); } @@ -400,7 +400,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; $moreforfilter = ''; -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $moreforfilter .= $form->getFilterBox(Categorie::TYPE_ACCOUNT, $search_category_list); } diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index 9463e357b42..4b1667cce1d 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -144,7 +144,7 @@ if (empty($reshook)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } - if (isModEnabled("banque") && !$object->accountid > 0) { + if (isModEnabled("bank") && !$object->accountid > 0) { $langs->load('errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors'); $error++; @@ -435,7 +435,7 @@ if ($action == 'create') { print ''; // Bank - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; // Number - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; @@ -687,7 +687,7 @@ if ($id) { $bankaccountnotfound = 0; - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { print ''; print ''; print ''; // Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print '"; @@ -317,7 +317,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "ptva.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); } print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "ptva.amount", "", $param, 'class="right"', $sortfield, $sortorder); @@ -356,7 +356,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print $obj->num_payment.''; // Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 8f212f663ab..12fafdd5205 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -53,7 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (isModEnabled('project')) { @@ -3909,7 +3909,7 @@ if ($action == 'create') { print ''; // Bank Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_ACCOUNT, 1); print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1); diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 3044834f328..d6568fb9855 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1462,7 +1462,7 @@ class Account extends CommonObject $datas['accountancyjournal'] = '
'.$langs->trans('AccountancyJournal').': '.$this->accountancy_journal; } // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (isModEnabled('category') && !$nofetch) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_ACCOUNT, 1); diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 1254809106d..81f5e8e6320 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -472,11 +472,11 @@ class PaymentVarious extends CommonObject $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); return -5; } - if (isModEnabled("banque") && (empty($this->fk_account) || $this->fk_account <= 0)) { + if (isModEnabled("bank") && (empty($this->fk_account) || $this->fk_account <= 0)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount")); return -6; } - if (isModEnabled("banque") && (empty($this->type_payment) || $this->type_payment <= 0)) { + if (isModEnabled("bank") && (empty($this->type_payment) || $this->type_payment <= 0)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); return -7; } @@ -530,7 +530,7 @@ class PaymentVarious extends CommonObject $this->ref = (string) $this->id; if ($this->id > 0) { - if (isModEnabled("banque") && !empty($this->amount)) { + if (isModEnabled("bank") && !empty($this->amount)) { // Insert into llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/bank/line.php b/htdocs/compta/bank/line.php index 09b24fa6c70..c474b6ce2e1 100644 --- a/htdocs/compta/bank/line.php +++ b/htdocs/compta/bank/line.php @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; // Load translation files required by the page $langs->loadLangs(array('banks', 'categories', 'compta', 'bills', 'other')); -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { $langs->load("members"); } if (isModEnabled('don')) { @@ -621,7 +621,7 @@ if ($result) { print "
'; print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); @@ -450,7 +450,7 @@ if ($action == 'create') { print '
'.$langs->trans('BankTransactionLine').''; diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 95850bead49..d750864de6f 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -163,8 +163,8 @@ $arrayfields = array( 'datev' =>array('label'=>"DateValue", 'checked'=>-1, 'position'=>130), 'type' =>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>140), 'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>isModEnabled('project')), - 'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>isModEnabled("banque")), - 'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>isModEnabled("banque")), + 'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>isModEnabled("bank")), + 'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>isModEnabled("bank")), 'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>isModEnabled('accounting')), 'subledger' =>array('label'=>"SubledgerAccount", 'checked'=>1, 'position'=>410, "enabled"=>isModEnabled('accounting')), 'debit' =>array('label'=>"Debit", 'checked'=>1, 'position'=>500), diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 5d78d4ad4be..b67014218f5 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -147,7 +147,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print_liste_field_titre("RefPayment", $_SERVER["PHP_SELF"], "pc.rowid", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Type", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); } print_liste_field_titre("PayedByThisPayment", $_SERVER["PHP_SELF"], "pc.amount", "", $param, 'class="right"', $sortfield, $sortorder); @@ -223,7 +223,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { } print $obj->num_payment.''; if ($obj->fk_bank > 0) { //$accountstatic->fetch($obj->fk_bank); @@ -263,7 +263,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print '   '.price($totalpaid)."'; if ($obj->fk_bank > 0) { //$accountstatic->fetch($obj->fk_bank); @@ -392,7 +392,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print '
'.$langs->trans('BankAccount').''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); print $form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); @@ -4814,7 +4814,7 @@ if ($action == 'create') { } // Bank Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print '
'; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5140,7 +5140,7 @@ if ($action == 'create') { print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5160,7 +5160,7 @@ if ($action == 'create') { print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5183,7 +5183,7 @@ if ($action == 'create') { $i++; } print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5215,7 +5215,7 @@ if ($action == 'create') { print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5229,7 +5229,7 @@ if ($action == 'create') { print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5256,7 +5256,7 @@ if ($action == 'create') { print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -5306,7 +5306,7 @@ if ($action == 'create') { $label = ($langs->trans("PaymentType".$objp->payment_code) != "PaymentType".$objp->payment_code) ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_label; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; @@ -5730,7 +5730,7 @@ if ($action == 'create') { // Create contract if (getDolGlobalString('CONTRACT_CREATE_FROM_INVOICE')) { - if (isModEnabled('contrat') && $object->status == Facture::STATUS_VALIDATED) { + if (isModEnabled('contract') && $object->status == Facture::STATUS_VALIDATED) { $langs->load("contracts"); if ($usercancreatecontract) { diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index a68ceeb3d0f..ee34766b45c 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -1448,7 +1448,7 @@ class Invoices extends DolibarrApi throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if (empty($accountid)) { throw new RestException(400, 'Account ID is mandatory'); } @@ -1506,7 +1506,7 @@ class Invoices extends DolibarrApi throw new RestException(400, 'Payment error : '.$paymentobj->error); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $label = '(CustomerInvoicePayment)'; if ($paymentobj->paiementcode == 'CHQ' && empty($chqemetteur)) { @@ -1569,7 +1569,7 @@ class Invoices extends DolibarrApi } } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if (empty($accountid)) { throw new RestException(400, 'Account ID is mandatory'); } @@ -1653,7 +1653,7 @@ class Invoices extends DolibarrApi $this->db->rollback(); throw new RestException(400, 'Payment error : '.$paymentobj->error); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $label = '(CustomerInvoicePayment)'; if ($paymentobj->paiementcode == 'CHQ' && empty($chqemetteur)) { throw new RestException(400, 'Emetteur is mandatory when payment code is '.$paymentobj->paiementcode); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 12bbd6fa5f0..fc0ff165cd2 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5632,7 +5632,7 @@ class Facture extends CommonInvoice $langs->load("bills"); - if (!isModEnabled('facture')) { // Should not happen. If module disabled, cron job should not be visible. + if (!isModEnabled('invoice')) { // Should not happen. If module disabled, cron job should not be visible. $this->output .= $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Facture")); return 0; } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index d728541b8d9..274ea165a53 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -56,7 +56,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } @@ -1300,7 +1300,7 @@ if ($user->hasRight("user", "user", "lire")) { $moreforfilter .= ''; } // Filter on product tags -if (isModEnabled('categorie') && $user->hasRight("categorie", "lire") && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) { +if (isModEnabled('category') && $user->hasRight("categorie", "lire") && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -1308,7 +1308,7 @@ if (isModEnabled('categorie') && $user->hasRight("categorie", "lire") && ($user- $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1); $moreforfilter .= '
'; } -if (isModEnabled('categorie') && $user->hasRight("categorie", "lire")) { +if (isModEnabled('category') && $user->hasRight("categorie", "lire")) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php index 8e5ca60137a..e49a7c328d4 100644 --- a/htdocs/compta/facture/stats/index.php +++ b/htdocs/compta/facture/stats/index.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -73,7 +73,7 @@ $endyear = $year; /* * View */ -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $langs->load('categories'); } $form = new Form($db); @@ -298,7 +298,7 @@ if ($user->admin) { print '
'; // Category -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { if ($mode == 'customer') { $cat_type = Categorie::TYPE_CUSTOMER; $cat_label = $langs->trans("Category").' '.lcfirst($langs->trans("Customer")); diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index c280a92183e..57748c27950 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'bills')); -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $langs->load("orders"); } @@ -103,7 +103,7 @@ print load_fiche_titre($langs->trans("InvoicesArea"), '', 'bill'); print '
'; -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { print getNumberInvoicesPieChart('customers'); print '
'; } @@ -113,7 +113,7 @@ if (isModEnabled('fournisseur') || isModEnabled('supplier_invoice')) { print '
'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { print getCustomerInvoiceDraftTable($max, $socid); print '
'; } @@ -127,7 +127,7 @@ print '
'; // Latest modified customer invoices -if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { +if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $langs->load("boxes"); $tmpinvoice = new Facture($db); @@ -580,7 +580,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { /* * Customers orders to be billed */ -if (isModEnabled('facture') && isModEnabled('commande') && $user->hasRight("commande", "lire") && !getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) { +if (isModEnabled('invoice') && isModEnabled('order') && $user->hasRight("commande", "lire") && !getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) { $commandestatic = new Commande($db); $langs->load("orders"); diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index f52b3c2f72e..a7a7c5f5898 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -178,7 +178,7 @@ if ($action == 'create') { // Amount print '
'; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Type payment print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if ($object->fk_account > 0) { $bankline = new AccountLine($db); $bankline->fetch($object->fk_bank); diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 67d5b5b561d..ffc1c3314fb 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -485,11 +485,11 @@ class Localtax extends CommonObject $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); return -4; } - if (isModEnabled("banque") && (empty($this->accountid) || $this->accountid <= 0)) { + if (isModEnabled("bank") && (empty($this->accountid) || $this->accountid <= 0)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount")); return -5; } - if (isModEnabled("banque") && (empty($this->paymenttype) || $this->paymenttype <= 0)) { + if (isModEnabled("bank") && (empty($this->paymenttype) || $this->paymenttype <= 0)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); return -5; } @@ -521,7 +521,7 @@ class Localtax extends CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."localtax"); // TODO devrait s'appeler paiementlocaltax if ($this->id > 0) { $ok = 1; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Insertion dans llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 2a593eb6543..83620a7e0ad 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -174,7 +174,7 @@ if (empty($reshook)) { $error++; } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // If bank module is on, account is required to enter a payment if (GETPOST('accountid') <= 0) { setEventMessages($langs->transnoentities('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors'); @@ -251,7 +251,7 @@ if (empty($reshook)) { $multicurrency_tx[$key] = $tmpinvoice->multicurrency_tx; } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // If the bank module is active, an account is required to input a payment if (GETPOSTINT('accountid') <= 0) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors'); @@ -501,7 +501,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Bank account print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if ($facture->type != 2) { print ''; } diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php index bfdd60e522f..23112324c96 100644 --- a/htdocs/compta/paiement/card.php +++ b/htdocs/compta/paiement/card.php @@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php'; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } if (isModEnabled('margin')) { @@ -318,7 +318,7 @@ print ''; */ // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { if ($object->fk_account > 0) { if ($object->type_code == 'CHQ' && $bankline->fk_bordereau > 0) { include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index 9ecab0282c6..b9fb85f148b 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -707,7 +707,7 @@ class Paiement extends CommonObject $error = 0; $bank_line_id = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if ($accountid <= 0) { $this->error = 'Bad value for parameter accountid='.$accountid; dol_syslog(get_class($this).'::addPaymentToBank '.$this->error, LOG_ERR); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index bbded249fb9..769a0bd9ce7 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -103,8 +103,8 @@ $arrayfields = array( 'p.datep' => array('label'=>"Date", 'checked'=>1, 'position'=>20), 's.nom' => array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), 'c.libelle' => array('label'=>"Type", 'checked'=>1, 'position'=>40), - 'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>(isModEnabled("banque"))), - 'ba.label' => array('label'=>"BankAccount", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled("banque"))), + 'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>50, 'enabled'=>(isModEnabled("bank"))), + 'ba.label' => array('label'=>"BankAccount", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled("bank"))), 'p.num_paiement' => array('label'=>"Numero", 'checked'=>1, 'position'=>70, 'tooltip'=>"ChequeOrTransferNumber"), 'p.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>80), 'p.statut' => array('label'=>"Status", 'checked'=>1, 'position'=>90, 'enabled'=>(getDolGlobalString('BILL_ADD_PAYMENT_VALIDATION'))), diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index dce1a7f5d83..44a6cb3fe71 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -72,7 +72,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y $error++; $action = 'create'; } - if (isModEnabled("banque") && !(GETPOST("accountid") > 0)) { + if (isModEnabled("bank") && !(GETPOST("accountid") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors'); $error++; $action = 'create'; diff --git a/htdocs/compta/paiement_vat.php b/htdocs/compta/paiement_vat.php index 30fb1768dc7..20b574adac4 100644 --- a/htdocs/compta/paiement_vat.php +++ b/htdocs/compta/paiement_vat.php @@ -70,7 +70,7 @@ if ($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == 'y $error++; $action = 'create'; } - if (isModEnabled("banque") && !(GETPOSTINT("accountid") > 0)) { + if (isModEnabled("bank") && !(GETPOSTINT("accountid") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToDebit")), null, 'errors'); $error++; $action = 'create'; diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php index 7e6303486d0..55df11fe81b 100644 --- a/htdocs/compta/payment_sc/card.php +++ b/htdocs/compta/payment_sc/card.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php' require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } @@ -146,7 +146,7 @@ print ''; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { if ($object->bank_account) { $bankline = new AccountLine($db); $bankline->fetch($object->bank_line); diff --git a/htdocs/compta/payment_vat/card.php b/htdocs/compta/payment_vat/card.php index f27bec0c8b6..b49e93ebed3 100644 --- a/htdocs/compta/payment_vat/card.php +++ b/htdocs/compta/payment_vat/card.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } @@ -188,7 +188,7 @@ print ''; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { if ($object->bank_account) { $bankline = new AccountLine($db); $bankline->fetch($object->bank_line); diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index 17281ae721c..b65e13561d7 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'; // Load translation files required by the page $langs->load("companies"); -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $langs->load("bills"); } @@ -117,7 +117,7 @@ if ($id > 0) { dol_banner_tab($object, 'socid', '', ($user->socid ? 0 : 1), 'rowid', 'nom', '', '', 0, '', '', 1); print dol_get_fiche_end(); - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { // Invoice list print load_fiche_titre($langs->trans("CustomerPreview")); diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index efa2ed773d4..7c14e3e1d1b 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -1137,7 +1137,7 @@ if ($modecompta == 'BOOKKEEPING') { */ //$conf->global->ACCOUNTING_REPORTS_INCLUDE_VARPAY = 1; - if (getDolGlobalString('ACCOUNTING_REPORTS_INCLUDE_VARPAY') && isModEnabled("banque") && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { + if (getDolGlobalString('ACCOUNTING_REPORTS_INCLUDE_VARPAY') && isModEnabled("bank") && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { $subtotal_ht = 0; $subtotal_ttc = 0; diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 167ca1793f6..bdcca353a85 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -215,7 +215,7 @@ if (isModEnabled('accounting') && $modecompta != 'BOOKKEEPING') { $subtotal_ht = 0; $subtotal_ttc = 0; -if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; @@ -272,7 +272,7 @@ if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta // Nothing from this table } -if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { // On ajoute les paiements clients anciennes version, non lies par paiement_facture if ($modecompta != 'CREANCES-DETTES') { $sql = "SELECT sum(p.amount) as amount_ttc, date_format(p.datep,'%Y-%m') as dm"; @@ -327,7 +327,7 @@ if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta $subtotal_ht = 0; $subtotal_ttc = 0; -if (isModEnabled('facture') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (isModEnabled('invoice') && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { if ($modecompta == 'CREANCES-DETTES') { $sql = "SELECT sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc, date_format(f.datef,'%Y-%m') as dm"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f"; @@ -799,7 +799,7 @@ if (isModEnabled('don') && ($modecompta == 'CREANCES-DETTES' || $modecompta == " * Various Payments */ -if (getDolGlobalString('ACCOUNTING_REPORTS_INCLUDE_VARPAY') && isModEnabled("banque") && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { +if (getDolGlobalString('ACCOUNTING_REPORTS_INCLUDE_VARPAY') && isModEnabled("bank") && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) { // decaiss $sql = "SELECT date_format(p.datep, '%Y-%m') AS dm, SUM(p.amount) AS amount FROM ".MAIN_DB_PREFIX."payment_various as p"; diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 6bb11589a2d..c3fdb7f1296 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -427,7 +427,7 @@ if ($action == 'create') { print ''; // Bank Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; @@ -631,7 +631,7 @@ if ($id > 0) { print ''; // Bank account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''."\n"; -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { // Customer Categories print ''; $order = new Commande($db); $order->fetch($expedition->origin_id); diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 1dfc406a9b9..a5017547c34 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } diff --git a/htdocs/don/class/paymentdonation.class.php b/htdocs/don/class/paymentdonation.class.php index e3e0358fed4..6720301d326 100644 --- a/htdocs/don/class/paymentdonation.class.php +++ b/htdocs/don/class/paymentdonation.class.php @@ -579,7 +579,7 @@ class PaymentDonation extends CommonObject $error = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); diff --git a/htdocs/don/paiement/list.php b/htdocs/don/paiement/list.php index 26a4c4c55c2..32162646c27 100644 --- a/htdocs/don/paiement/list.php +++ b/htdocs/don/paiement/list.php @@ -93,8 +93,8 @@ $arrayfields = array( 's.nom' => array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), 'c.code' => array('label'=>"Type", 'checked'=>1, 'position'=>40), 'pd.num_paiement' => array('label'=>"Numero", 'checked'=>1, 'position'=>50, 'tooltip'=>"ChequeOrTransferNumber"), - 'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled("banque"))), - 'ba.label' => array('label'=>"BankAccount", 'checked'=>1, 'position'=>70, 'enabled'=>(isModEnabled("banque"))), + 'transaction' => array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>60, 'enabled'=>(isModEnabled("bank"))), + 'ba.label' => array('label'=>"BankAccount", 'checked'=>1, 'position'=>70, 'enabled'=>(isModEnabled("bank"))), 'pd.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>80), ); $arrayfields = dol_sort_array($arrayfields, 'position'); diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php index 434d75de273..5c4b6f719ee 100644 --- a/htdocs/don/payment/card.php +++ b/htdocs/don/payment/card.php @@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } @@ -125,7 +125,7 @@ print ''; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { if ($object->bank_account) { $bankline = new AccountLine($db); $bankline->fetch($object->bank_line); diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php index 3f704d8c20f..ebf7a741f80 100644 --- a/htdocs/don/payment/payment.php +++ b/htdocs/don/payment/payment.php @@ -67,7 +67,7 @@ if ($action == 'add_payment') { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors'); $error++; } - if (isModEnabled("banque") && !(GETPOSTINT("accountid") > 0)) { + if (isModEnabled("bank") && !(GETPOSTINT("accountid") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors'); $error++; } diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index cd19a296581..a7560e312cb 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -323,17 +323,17 @@ if (!getDolGlobalString('ECM_AUTO_TREE_HIDEN')) { $rowspan++; $sectionauto[] = array('position'=>30, 'level'=>1, 'module'=>'propal', 'test'=>isModEnabled('propal'), 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals"))); } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $rowspan++; - $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contrat'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); + $sectionauto[] = array('position'=>40, 'level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contract'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); } - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $rowspan++; - $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>isModEnabled('commande'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); + $sectionauto[] = array('position'=>50, 'level'=>1, 'module'=>'order', 'test'=>isModEnabled('order'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $rowspan++; - $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('facture'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); + $sectionauto[] = array('position'=>60, 'level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('invoice'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); } if (isModEnabled('supplier_proposal')) { $langs->load("supplier_proposal"); @@ -366,10 +366,10 @@ if (!getDolGlobalString('ECM_AUTO_TREE_HIDEN')) { $rowspan++; $sectionauto[] = array('position'=>140, 'level'=>1, 'module'=>'project_task', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks"))); } - if (isModEnabled('ficheinter')) { + if (isModEnabled('intervention')) { $langs->load("interventions"); $rowspan++; - $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('ficheinter'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); + $sectionauto[] = array('position'=>150, 'level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('intervention'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); } if (isModEnabled('expensereport')) { $langs->load("trips"); @@ -381,12 +381,12 @@ if (!getDolGlobalString('ECM_AUTO_TREE_HIDEN')) { $rowspan++; $sectionauto[] = array('position'=>170, 'level'=>1, 'module'=>'holiday', 'test'=>isModEnabled('holiday'), 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays"))); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $langs->load("banks"); $rowspan++; - $sectionauto[] = array('position'=>180, 'level'=>1, 'module'=>'banque', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount"))); + $sectionauto[] = array('position'=>180, 'level'=>1, 'module'=>'banque', 'test'=>isModEnabled('bank'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount"))); $rowspan++; - $sectionauto[] = array('position'=>190, 'level'=>1, 'module'=>'chequereceipt', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("CheckReceipt"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("CheckReceipt"))); + $sectionauto[] = array('position'=>190, 'level'=>1, 'module'=>'chequereceipt', 'test'=>isModEnabled('bank'), 'label'=>$langs->trans("CheckReceipt"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("CheckReceipt"))); } if (isModEnabled('mrp')) { $langs->load("mrp"); diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php index 0ade7890db6..33fa81665a3 100644 --- a/htdocs/ecm/search.php +++ b/htdocs/ecm/search.php @@ -127,17 +127,17 @@ if (isModEnabled("propal")) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'propal', 'test'=>isModEnabled('propal'), 'label'=>$langs->trans("Proposals"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Proposals"))); } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contrat'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); + $sectionauto[] = array('level'=>1, 'module'=>'contract', 'test'=>isModEnabled('contract'), 'label'=>$langs->trans("Contracts"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Contracts"))); } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>isModEnabled('commande'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); + $sectionauto[] = array('level'=>1, 'module'=>'order', 'test'=>isModEnabled('order'), 'label'=>$langs->trans("CustomersOrders"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Orders"))); } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('facture'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); + $sectionauto[] = array('level'=>1, 'module'=>'invoice', 'test'=>isModEnabled('invoice'), 'label'=>$langs->trans("CustomersInvoices"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Invoices"))); } if (isModEnabled('supplier_proposal')) { $langs->load("supplier_proposal"); @@ -161,10 +161,10 @@ if (isModEnabled('project')) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>isModEnabled('project'), 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects"))); } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $langs->load("interventions"); $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('ficheinter'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); + $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>isModEnabled('intervention'), 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions"))); } if (isModEnabled('expensereport')) { $langs->load("trips"); @@ -176,10 +176,10 @@ if (isModEnabled('holiday')) { $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'holiday', 'test'=>isModEnabled('holiday'), 'label'=>$langs->trans("Holidays"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Holidays"))); } -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { $langs->load("banks"); $rowspan++; - $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>isModEnabled('banque'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount"))); + $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>isModEnabled('bank'), 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount"))); } if (isModEnabled('mrp')) { $langs->load("mrp"); diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php index a4ed949fc04..06fb0af4299 100644 --- a/htdocs/eventorganization/conferenceorbooth_card.php +++ b/htdocs/eventorganization/conferenceorbooth_card.php @@ -328,7 +328,7 @@ if (!empty($withproject)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/eventorganization/conferenceorbooth_contact.php b/htdocs/eventorganization/conferenceorbooth_contact.php index fd335c1409e..bb19456cd2c 100644 --- a/htdocs/eventorganization/conferenceorbooth_contact.php +++ b/htdocs/eventorganization/conferenceorbooth_contact.php @@ -287,7 +287,7 @@ if (!empty($withproject)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/eventorganization/conferenceorbooth_document.php b/htdocs/eventorganization/conferenceorbooth_document.php index 8b4db60d47d..a82d6a419c2 100644 --- a/htdocs/eventorganization/conferenceorbooth_document.php +++ b/htdocs/eventorganization/conferenceorbooth_document.php @@ -260,7 +260,7 @@ if (!empty($withproject)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index 6b584a30e73..ce211834b8c 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -443,7 +443,7 @@ if ($projectid > 0) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php index 7cd5f1d2e10..a83218f0a12 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_card.php +++ b/htdocs/eventorganization/conferenceorboothattendee_card.php @@ -332,7 +332,7 @@ if (!empty($withproject)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index d844673b9ce..0c9722c4b78 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -35,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php'; require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -543,7 +543,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 15397bf9327..f0e85472b80 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -958,7 +958,7 @@ if ($action == 'create') { // Ref print '
'; print $langs->trans('BankAccount'); @@ -5087,7 +5087,7 @@ if ($action == 'create') { if (isModEnabled('project')) { $nbrows++; } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbrows++; $nbcols++; } @@ -5116,7 +5116,7 @@ if ($action == 'create') { print ''.$langs->trans('ListOfSituationInvoices').''.$langs->trans('Situation').''.$langs->trans('AmountHT').''.$prev_invoice->getNomUrl(1).''.(($prev_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$prev_invoice->situation_counter.''.price($prev_invoice->total_ht).''.$object->getNomUrl(1).''.(($object->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$object->situation_counter.''.price($object->total_ht).''.price($total_global_ht).''.$next_invoice->getNomUrl(1).''.(($next_invoice->type == Facture::TYPE_CREDIT_NOTE) ? $langs->trans('situationInvoiceShortcode_AS') : $langs->trans('situationInvoiceShortcode_S')).$next_invoice->situation_counter.''.price($next_invoice->total_ht).'
'.price($total_global_ht).''.($object->type == Facture::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('Amount').''.dol_escape_htmltag($label.' '.$objp->num_payment).'
'.$langs->trans("Amount").'
'.$langs->trans("PaymentMode").''; print $form->select_types_paiements(GETPOST("paiementtype"), "paiementtype", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx', 1); @@ -247,7 +247,7 @@ if ($id) { print '
'.$langs->trans("Amount").''.price($object->amount).'
'.$langs->trans('AccountToCredit').'
'.$langs->trans('Amount').''.price($object->amount, '', $disable_delete = 0; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { $bankline = new AccountLine($db); if ($object->fk_account > 0) { @@ -360,7 +360,7 @@ print '
'.$langs->trans('Amount').''.price($object->amount, 0, $ print '
'.$langs->trans('Note').''.dol_string_onlythesehtmltags(dol_htmlcleanlastbr($object->note_private)).'
'.$langs->trans('Amount').''.price($object->amount, 0, $ print '
'.$langs->trans('Note').''.dol_string_onlythesehtmltags(dol_htmlcleanlastbr($object->note_private)).'
'.$langs->trans('DefaultBankAccount').''; print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes(GETPOSTINT('fk_account'), 'fk_account', 0, '', 2, '', 0, '', 1); print '
'; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -721,7 +721,7 @@ if ($id > 0) { print '\n"; $labeltype = $langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "\n"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; diff --git a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php index 0adbfcc4eab..13844252901 100644 --- a/htdocs/compta/sociales/class/paymentsocialcontribution.class.php +++ b/htdocs/compta/sociales/class/paymentsocialcontribution.class.php @@ -568,7 +568,7 @@ class PaymentSocialContribution extends CommonObject $error = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index e2f887eb034..951faa2c2b8 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -109,7 +109,7 @@ $arrayfields = array( 'cs.paye' =>array('label'=>"Status", 'checked'=>1, 'position'=>110), ); -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { $arrayfields['cs.fk_account'] = array('checked'=>-1, 'position'=>90, 'label'=>"DefaultBankAccount"); } diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index fb3ecf981cb..dd5a463ecd1 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -226,7 +226,7 @@ print ''; print ''; print ''; print ''; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print ''; print ''; } @@ -246,7 +246,7 @@ print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "pc.datep", "", $pa print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.rowid", "", $param, "", $sortfield, $sortorder); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "pc.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber'); -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "pc.fk_bank", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); } @@ -324,7 +324,7 @@ while ($i < min($num, $limit)) { print ''; // Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Bank transaction print ''; print ''; print ''; print ''; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print ''; print ''; } diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 768867e0ddc..eb69cefa804 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -503,10 +503,10 @@ if (count($amount)) { if (isModEnabled("propal") && $key > 0) { print ' '.img_picto($langs->trans("ProposalStats"), "stats").' '; } - if (isModEnabled('commande') && $key > 0) { + if (isModEnabled('order') && $key > 0) { print ' '.img_picto($langs->trans("OrderStats"), "stats").' '; } - if (isModEnabled('facture') && $key > 0) { + if (isModEnabled('invoice') && $key > 0) { print ' '.img_picto($langs->trans("InvoiceStats"), "stats").' '; } print ''; diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php index afd631a8cdc..6c1b1c3558a 100644 --- a/htdocs/compta/stats/casoc.php +++ b/htdocs/compta/stats/casoc.php @@ -691,10 +691,10 @@ if (count($amount)) { if (isModEnabled("propal") && $key > 0) { print ' '.img_picto($langs->trans("ProposalStats"), "stats").' '; } - if (isModEnabled('commande') && $key > 0) { + if (isModEnabled('order') && $key > 0) { print ' '.img_picto($langs->trans("OrderStats"), "stats").' '; } - if (isModEnabled('facture') && $key > 0) { + if (isModEnabled('invoice') && $key > 0) { print ' '.img_picto($langs->trans("InvoiceStats"), "stats").' '; } print ''; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index df825768fee..a77c5979c9d 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -483,7 +483,7 @@ if ($action == 'create') { print "\n"; print ""; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Bank account print ''; // Bank account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } // Sales orders - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $nblines++; $ret = $product->load_stats_commande($socid); if ($ret < 0) { @@ -514,7 +514,7 @@ function show_stats_for_company($product, $socid) print ''; } // Customer invoices - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $nblines++; $ret = $product->load_stats_facture($socid); if ($ret < 0) { @@ -533,7 +533,7 @@ function show_stats_for_company($product, $socid) print ''; } // Customer template invoices - if (isModEnabled("facture") && $user->hasRight('facture', 'lire')) { + if (isModEnabled("invoice") && $user->hasRight('facture', 'lire')) { $nblines++; $ret = $product->load_stats_facturerec($socid); if ($ret < 0) { @@ -572,7 +572,7 @@ function show_stats_for_company($product, $socid) } // Contracts - if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $nblines++; $ret = $product->load_stats_contrat($socid); if ($ret < 0) { @@ -679,7 +679,7 @@ function show_stats_for_batch($batch, $socid) print ''; // Expeditions - if (isModEnabled('expedition') && $user->hasRight('expedition', 'lire')) { + if (isModEnabled('delivery_note') && $user->hasRight('expedition', 'lire')) { $nblines++; $ret = $batch->loadStatsExpedition($socid); if ($ret < 0) { diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 515542456cc..6b46a4dbfd2 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -127,9 +127,9 @@ function project_prepare_head(Project $project, $moreparam = '') } if (isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice") - || isModEnabled("propal") || isModEnabled('commande') - || isModEnabled('facture') || isModEnabled('contrat') - || isModEnabled('ficheinter') || isModEnabled('agenda') || isModEnabled('deplacement') || isModEnabled('stock')) { + || isModEnabled("propal") || isModEnabled('order') + || isModEnabled('invoice') || isModEnabled('contract') + || isModEnabled('intervention') || isModEnabled('agenda') || isModEnabled('deplacement') || isModEnabled('stock')) { $nbElements = 0; // Enable caching of thirdrparty count Contacts $cachekey = 'count_elements_project_'.$project->id; @@ -143,13 +143,13 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled("propal")) { $nbElements += $project->getElementCount('propal', 'propal'); } - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $nbElements += $project->getElementCount('order', 'commande'); } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $nbElements += $project->getElementCount('invoice', 'facture'); } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $nbElements += $project->getElementCount('invoice_predefined', 'facture_rec'); } if (isModEnabled('supplier_proposal')) { @@ -161,13 +161,13 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled("supplier_invoice")) { $nbElements += $project->getElementCount('invoice_supplier', 'facture_fourn'); } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $nbElements += $project->getElementCount('contract', 'contrat'); } - if (isModEnabled('ficheinter')) { + if (isModEnabled('intervention')) { $nbElements += $project->getElementCount('intervention', 'fichinter'); } - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { $nbElements += $project->getElementCount('shipping', 'expedition'); } if (isModEnabled('mrp')) { @@ -197,7 +197,7 @@ function project_prepare_head(Project $project, $moreparam = '') if (isModEnabled('salaries')) { $nbElements += $project->getElementCount('salaries', 'payment_salary'); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbElements += $project->getElementCount('variouspayment', 'payment_various'); } dol_setcache($cachekey, $nbElements, 120); // If setting cache fails, this is not a problem, so we do not test result. diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index f311fc57967..dceaf0bc8a3 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -42,8 +42,8 @@ function propal_prepare_head($object) $head[$h][2] = 'comm'; $h++; - if ((empty($conf->commande->enabled) && ((isModEnabled("expedition") && getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'lire')) - || (isModEnabled("expedition") && getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'lire'))))) { + if ((empty($conf->commande->enabled) && ((isModEnabled("delivery_note") && getDolGlobalInt('MAIN_SUBMODULE_EXPEDITION') && $user->hasRight('expedition', 'lire')) + || (isModEnabled("delivery_note") && getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && $user->hasRight('expedition', 'delivery', 'lire'))))) { $langs->load("sendings"); $text = ''; $head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id; diff --git a/htdocs/core/menus/standard/auguria.lib.php b/htdocs/core/menus/standard/auguria.lib.php index 0f2d6695ee8..3b49d190016 100644 --- a/htdocs/core/menus/standard/auguria.lib.php +++ b/htdocs/core/menus/standard/auguria.lib.php @@ -356,7 +356,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $newmenu = $menuArbo->menuLeftCharger($newmenu, $mainmenu, $leftmenu, ($user->socid ? 1 : 0), 'auguria', $tabMenu); // We update newmenu for special dynamic menus - if (isModEnabled('banque') && $user->hasRight('banque', 'lire') && $mainmenu == 'bank') { // Entry for each bank account + if (isModEnabled('bank') && $user->hasRight('banque', 'lire') && $mainmenu == 'bank') { // Entry for each bank account include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Required for to get Account::TYPE_CASH for example $sql = "SELECT rowid, label, courant, rappro, courant"; @@ -410,7 +410,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t $nature = ''; // Must match array $sourceList defined into journals_list.php - if ($objp->nature == 2 && isModEnabled('facture') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { + if ($objp->nature == 2 && isModEnabled('invoice') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { $nature = "sells"; } if ($objp->nature == 3 @@ -418,7 +418,7 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_PURCHASES')) { $nature = "purchases"; } - if ($objp->nature == 4 && isModEnabled('banque')) { + if ($objp->nature == 4 && isModEnabled('bank')) { $nature = "bank"; } if ($objp->nature == 5 && isModEnabled('expensereport') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) { diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index df29edca3d5..8f8dd72b20b 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -95,7 +95,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Members $tmpentry = array( - 'enabled' => isModEnabled('adherent'), + 'enabled' => isModEnabled('member'), 'perms' => $user->hasRight('adherent', 'lire'), 'module' => 'adherent' ); @@ -151,7 +151,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Products-Services $tmpentry = array( - 'enabled'=> (isModEnabled('product') || isModEnabled('service') || isModEnabled('expedition')), + 'enabled'=> (isModEnabled('product') || isModEnabled('service') || isModEnabled('delivery_note')), 'perms'=> ($user->hasRight('product', 'read') || $user->hasRight('service', 'read') || $user->hasRight('expedition', 'lire')), 'module'=>'product|service' ); @@ -203,7 +203,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Projects $tmpentry = array( - 'enabled'=> (isModEnabled('projet') ? 1 : 0), + 'enabled'=> (isModEnabled('project') ? 1 : 0), 'perms'=> ($user->hasRight('projet', 'lire') ? 1 : 0), 'module'=>'projet' ); @@ -243,12 +243,12 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $tmpentry = array( 'enabled'=>( isModEnabled('propal') - || isModEnabled('commande') + || isModEnabled('order') || isModEnabled('fournisseur') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') - || isModEnabled('contrat') - || isModEnabled('ficheinter') + || isModEnabled('contract') + || isModEnabled('intervention') ) ? 1 : 0, 'perms'=>( $user->hasRight('propal', 'read') @@ -293,7 +293,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Billing - Financial $tmpentry = array( 'enabled'=>( - isModEnabled('facture') || + isModEnabled('invoice') || isModEnabled('don') || isModEnabled('tax') || isModEnabled('salaries') || @@ -327,7 +327,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Bank $tmpentry = array( - 'enabled'=>(isModEnabled('banque') || isModEnabled('prelevement')), + 'enabled'=>(isModEnabled('bank') || isModEnabled('prelevement')), 'perms'=>($user->hasRight('banque', 'lire') || $user->hasRight('prelevement', 'lire') || $user->hasRight('paymentbybanktransfer', 'read')), 'module'=>'banque|prelevement|paymentbybanktransfer' ); @@ -1211,7 +1211,7 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->hasRight("user", "user", "write") || $user->admin) && !(isModEnabled('multicompany') && $conf->entity > 1 && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')), '', 'home'); $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->hasRight('user', 'user', 'lire') || $user->admin); - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } @@ -1283,7 +1283,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le } // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); if (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') || !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) { // Categories prospects/customers @@ -1320,7 +1320,7 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le //$newmenu->add("/contact/list.php?userid=$user->id", $langs->trans("MyContacts"), 1, $user->hasRight('societe', 'contact', 'lire')); // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); // Categories Contact $newmenu->add("/categories/index.php?leftmenu=catcontact&type=4", $langs->trans("ContactCategoriesShort"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); @@ -1363,7 +1363,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Customers orders - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $langs->load("orders"); $newmenu->add("/commande/index.php?leftmenu=orders", $langs->trans("CustomersOrders"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 200, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); $newmenu->add("/commande/card.php?action=create&leftmenu=orders", $langs->trans("NewOrder"), 1, $user->hasRight('commande', 'creer')); @@ -1371,7 +1371,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left if ($usemenuhider || empty($leftmenu) || $leftmenu == "orders") { $newmenu->add("/commande/list.php?leftmenu=orders&search_status=0", $langs->trans("StatusOrderDraftShort"), 2, $user->hasRight('commande', 'lire')); $newmenu->add("/commande/list.php?leftmenu=orders&search_status=1", $langs->trans("StatusOrderValidated"), 2, $user->hasRight('commande', 'lire')); - if (isModEnabled('expedition')) { + if (isModEnabled('delivery_note')) { $newmenu->add("/commande/list.php?leftmenu=orders&search_status=2", $langs->trans("StatusOrderSentShort"), 2, $user->hasRight('commande', 'lire')); } $newmenu->add("/commande/list.php?leftmenu=orders&search_status=3", $langs->trans("StatusOrderDelivered"), 2, $user->hasRight('commande', 'lire')); @@ -1426,7 +1426,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Contrat - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $langs->load("contracts"); $newmenu->add("/contrat/index.php?leftmenu=contracts", $langs->trans("ContractsSubscriptions"), 0, $user->hasRight('contrat', 'lire'), '', $mainmenu, 'contracts', 2000, '', '', '', img_picto('', 'contract', 'class="paddingright pictofixedwidth"')); $newmenu->add("/contrat/card.php?action=create&leftmenu=contracts", $langs->trans("NewContractSubscription"), 1, $user->hasRight('contrat', 'creer')); @@ -1441,7 +1441,7 @@ function get_left_menu_commercial($mainmenu, &$newmenu, $usemenuhider = 1, $left } // Interventions - if (isModEnabled('ficheinter')) { + if (isModEnabled('intervention')) { $langs->load("interventions"); $newmenu->add("/fichinter/index.php?leftmenu=ficheinter", $langs->trans("Interventions"), 0, $user->hasRight('ficheinter', 'lire'), '', $mainmenu, 'ficheinter', 2200, '', '', '', img_picto('', 'intervention', 'class="paddingright pictofixedwidth"')); $newmenu->add("/fichinter/card.php?action=create&leftmenu=ficheinter", $langs->trans("NewIntervention"), 1, $user->hasRight('ficheinter', 'creer'), '', '', '', 201); @@ -1472,7 +1472,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $langs->load("companies"); // Customers invoices - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $langs->load("bills"); $newmenu->add("/compta/facture/index.php?leftmenu=customers_bills", $langs->trans("BillsCustomers"), 0, $user->hasRight('facture', 'lire'), '', $mainmenu, 'customers_bills', 0, '', '', '', img_picto('', 'bill', 'class="paddingright pictofixedwidth"')); $newmenu->add("/compta/facture/card.php?action=create", $langs->trans("NewBill"), 1, $user->hasRight('facture', 'creer')); @@ -1523,9 +1523,9 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Orders - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $langs->load("orders"); - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $newmenu->add("/commande/list.php?leftmenu=orders&search_status=-3&billed=0&contextpage=billableorders", $langs->trans("MenuOrdersToBill2"), 0, $user->hasRight('commande', 'lire'), '', $mainmenu, 'orders', 0, '', '', '', img_picto('', 'order', 'class="paddingright pictofixedwidth"')); } //if ($usemenuhider || empty($leftmenu) || $leftmenu=="orders") $newmenu->add("/commande/", $langs->trans("StatusOrderToBill"), 1, $user->hasRight('commande', 'lire')); @@ -1625,7 +1625,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen } // Various payment - if (isModEnabled('banque') && !getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT')) { + if (isModEnabled('bank') && !getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT')) { $langs->load("banks"); $newmenu->add("/compta/bank/various_payment/list.php?leftmenu=tax_various&mainmenu=billing", $langs->trans("MenuVariousPayment"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'tax_various', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if ($usemenuhider || empty($leftmenu) || preg_match('/^tax_various/i', $leftmenu)) { @@ -1673,10 +1673,10 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $newmenu->add("/accountancy/admin/account.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("Chartofaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); $newmenu->add("/accountancy/admin/subaccount.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("ChartOfSubaccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_chart', 41); $newmenu->add("/accountancy/admin/defaultaccounts.php?mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuDefaultAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 60); - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { $newmenu->add("/compta/bank/list.php?mainmenu=accountancy&leftmenu=accountancy_admin&search_status=-1", $langs->trans("MenuBankAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_bank', 70); } - if (isModEnabled('facture') || isModEnabled('supplier_invoice')) { + if (isModEnabled('invoice') || isModEnabled('supplier_invoice')) { $newmenu->add("/admin/dict.php?id=10&from=accountancy&search_country_id=".$mysoc->country_id."&mainmenu=accountancy&leftmenu=accountancy_admin", $langs->trans("MenuVatAccounts"), 1, $user->hasRight('accounting', 'chartofaccount'), '', $mainmenu, 'accountancy_admin_default', 80); } if (isModEnabled('tax')) { @@ -1696,7 +1696,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef // Binding // $newmenu->add("", $langs->trans("Binding"), 0, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch'); - if (isModEnabled('facture') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { + if (isModEnabled('invoice') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { $newmenu->add("/accountancy/customer/index.php?leftmenu=accountancy_dispatch_customer&mainmenu=accountancy", $langs->trans("CustomersVentilation"), 1, $user->hasRight('accounting', 'bind', 'write'), '', $mainmenu, 'dispatch_customer'); if ($usemenuhider || empty($leftmenu) || preg_match('/accountancy_dispatch_customer/', $leftmenu)) { $newmenu->add("/accountancy/customer/list.php?mainmenu=accountancy&leftmenu=accountancy_dispatch_customer", $langs->trans("ToBind"), 2, $user->hasRight('accounting', 'bind', 'write')); @@ -1741,7 +1741,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $nature = ''; // Must match array $sourceList defined into journals_list.php - if ($objp->nature == 2 && isModEnabled('facture') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { + if ($objp->nature == 2 && isModEnabled('invoice') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_SALES')) { $nature = "sells"; } if ($objp->nature == 3 @@ -1749,7 +1749,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_PURCHASES')) { $nature = "purchases"; } - if ($objp->nature == 4 && isModEnabled('banque')) { + if ($objp->nature == 4 && isModEnabled('bank')) { $nature = "bank"; } if ($objp->nature == 5 && isModEnabled('expensereport') && !getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) { @@ -1981,7 +1981,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $langs->loadLangs(array("withdrawals", "banks", "bills", "categories")); // Bank-Cash account - if (isModEnabled('banque')) { + if (isModEnabled('bank')) { $newmenu->add("/compta/bank/list.php?leftmenu=bank&mainmenu=bank", $langs->trans("MenuBankCash"), 0, $user->hasRight('banque', 'lire'), '', $mainmenu, 'bank', 0, '', '', '', img_picto('', 'bank_account', 'class="paddingright pictofixedwidth"')); $newmenu->add("/compta/bank/card.php?action=create", $langs->trans("MenuNewFinancialAccount"), 1, $user->hasRight('banque', 'configurer')); @@ -1992,7 +1992,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/compta/bank/transfer.php", $langs->trans("MenuBankInternalTransfer"), 1, $user->hasRight('banque', 'transfer')); } - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?type=5", $langs->trans("Rubriques"), 1, $user->hasRight('categorie', 'creer'), '', $mainmenu, 'tags'); $newmenu->add("/compta/bank/categ.php", $langs->trans("RubriquesTransactions"), 1, $user->hasRight('banque', 'configurer'), '', $mainmenu, 'tags'); @@ -2027,7 +2027,7 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = } // Management of checks - if (!getDolGlobalString('BANK_DISABLE_CHECK_DEPOSIT') && isModEnabled('banque') && (isModEnabled('facture') || getDolGlobalString('MAIN_MENU_CHEQUE_DEPOSIT_ON'))) { + if (!getDolGlobalString('BANK_DISABLE_CHECK_DEPOSIT') && isModEnabled('bank') && (isModEnabled('invoice') || getDolGlobalString('MAIN_MENU_CHEQUE_DEPOSIT_ON'))) { $newmenu->add("/compta/paiement/cheque/index.php?leftmenu=checks&mainmenu=bank", $langs->trans("MenuChequeDeposits"), 0, $user->hasRight('banque', 'cheque'), '', $mainmenu, 'checks', 0, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); if (preg_match('/checks/', $leftmenu)) { $newmenu->add("/compta/paiement/cheque/card.php?leftmenu=checks_bis&action=new&mainmenu=bank", $langs->trans("NewChequeDeposit"), 1, $user->hasRight('banque', 'cheque')); @@ -2076,12 +2076,12 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme if (isModEnabled('variants')) { $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('product', 'read')); } - if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { + if (isModEnabled('propal') || isModEnabled('order') || isModEnabled('invoice') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=0", $langs->trans("Statistics"), 1, $user->hasRight('product', 'read')); } // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire')); @@ -2100,11 +2100,11 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme if (isModEnabled('variants')) { $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('service', 'read')); } - if (isModEnabled('propal') || isModEnabled('commande') || isModEnabled('facture') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { + if (isModEnabled('propal') || isModEnabled('order') || isModEnabled('invoice') || isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) { $newmenu->add("/product/stats/card.php?id=all&leftmenu=stats&type=1", $langs->trans("Statistics"), 1, $user->hasRight('service', 'read')); } // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=cat&type=0", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); //if ($usemenuhider || empty($leftmenu) || $leftmenu=="cat") $newmenu->add("/categories/list.php", $langs->trans("List"), 1, $user->hasRight('categorie', 'lire')); @@ -2126,7 +2126,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); // Categories for warehouses - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $newmenu->add("/categories/index.php?leftmenu=stock&type=9", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } } @@ -2156,7 +2156,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme } // Shipments - if (isModEnabled('expedition')) { + if (isModEnabled('delivery_note')) { $langs->load("sendings"); $newmenu->add("/expedition/index.php?leftmenu=sendings", $langs->trans("Shipments"), 0, $user->hasRight('expedition', 'lire'), '', $mainmenu, 'sendings', 0, '', '', '', img_picto('', 'shipment', 'class="paddingright pictofixedwidth"')); $newmenu->add("/expedition/card.php?action=create2&leftmenu=sendings", $langs->trans("NewSending"), 1, $user->hasRight('expedition', 'creer')); @@ -2238,13 +2238,13 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme global $user, $conf, $langs; if ($mainmenu == 'project') { - if (isModEnabled('projet')) { + if (isModEnabled('project')) { $langs->load("projects"); $search_project_user = GETPOSTINT('search_project_user'); $tmpentry = array( - 'enabled'=>isModEnabled('projet'), + 'enabled'=>isModEnabled('project'), 'perms'=>$user->hasRight('projet', 'lire'), 'module'=>'projet' ); @@ -2279,7 +2279,7 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/projet/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->hasRight('projet', 'lire')); // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=cat&type=6", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'lire'), '', $mainmenu, 'cat'); } @@ -2389,11 +2389,11 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->hasRight('expensereport', 'lire')); $newmenu->add("/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->hasRight('expensereport', 'lire')); } - $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, ($user->hasRight('expensereport', 'lire')) && isModEnabled('banque')); + $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, ($user->hasRight('expensereport', 'lire')) && isModEnabled('bank')); $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('expensereport', 'lire')); } - if (isModEnabled('projet')) { + if (isModEnabled('project')) { if (!getDolGlobalString('PROJECT_HIDE_TASKS')) { $langs->load("projects"); @@ -2469,7 +2469,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen global $user, $conf, $langs; if ($mainmenu == 'members') { - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { // Load translation files required by the page $langs->loadLangs(array("members", "compta")); @@ -2487,7 +2487,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen $newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export')); - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=cat&type=3", $langs->trans("Categories"), 1, $user->hasRight('categorie', 'read'), '', $mainmenu, 'cat'); } diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php index f66eb100208..afdc64bf80c 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard.modules.php @@ -1036,7 +1036,7 @@ class pdf_standard extends ModeleExpenseReport $pdf->MultiCell(15, 3, $outputlangs->transnoentities("Amount"), 0, 'C', 0); $pdf->SetXY($tab3_posx + 35, $tab3_top + 1); $pdf->MultiCell(30, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $pdf->SetXY($tab3_posx + 65, $tab3_top + 1); $pdf->MultiCell(25, 3, $outputlangs->transnoentities("BankAccount"), 0, 'L', 0); } @@ -1076,7 +1076,7 @@ class pdf_standard extends ModeleExpenseReport $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->p_code); $pdf->MultiCell(40, 3, $oper, 0, 'L', 0); - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $pdf->SetXY($tab3_posx + 65, $tab3_top + $y + 1); $pdf->MultiCell(30, 3, $row->baref, 0, 'L', 0); } diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 19339df0ead..fe348963e14 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -248,7 +248,7 @@ class mailing_advthirdparties extends MailingTargets if ($resql) { $num = $this->db->num_rows($resql); - if (!isModEnabled("categorie")) { + if (!isModEnabled("category")) { $num = 0; // Force empty list if category module is not enabled } diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php index 60c1e2ed153..0d1c0b6931e 100644 --- a/htdocs/core/modules/mailings/thirdparties.modules.php +++ b/htdocs/core/modules/mailings/thirdparties.modules.php @@ -290,7 +290,7 @@ class mailing_thirdparties extends MailingTargets if ($resql) { $num = $this->db->num_rows($resql); - if (!isModEnabled("categorie")) { + if (!isModEnabled("category")) { $num = 0; // Force empty list if category module is not enabled } diff --git a/htdocs/core/modules/modCategorie.class.php b/htdocs/core/modules/modCategorie.class.php index 20aced509b9..0ead1e5e844 100644 --- a/htdocs/core/modules/modCategorie.class.php +++ b/htdocs/core/modules/modCategorie.class.php @@ -136,7 +136,7 @@ class modCategorie extends DolibarrModules if (isModEnabled("societe")) { $typeexample .= ($typeexample ? " / " : "")."2=Customer-Prospect"; } - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $typeexample .= ($typeexample ? " / " : "")."3=Member"; } if (isModEnabled("societe")) { @@ -538,7 +538,7 @@ class modCategorie extends DolibarrModules } // 3 Members - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $r++; $this->import_code[$r] = $this->rights_class.'_3_'.Categorie::$MAP_ID_TO_CODE[3]; $this->import_label[$r] = "CatMembersLinks"; // Translation key diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 4fce2b8021f..f571aad44ff 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -275,7 +275,7 @@ class modUser extends DolibarrModules $keyforelement = 'user'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - if (!isModEnabled('adherent')) { + if (!isModEnabled('member')) { unset($this->export_fields_array[$r]['u.fk_member']); unset($this->export_entities_array[$r]['u.fk_member']); } diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 4e37cf0beeb..611bd7f8aa1 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -42,13 +42,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (isModEnabled("supplier_invoice")) { @@ -57,10 +57,10 @@ if (isModEnabled("supplier_invoice")) { if (isModEnabled("supplier_order")) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } if (isModEnabled('deplacement')) { @@ -69,7 +69,7 @@ if (isModEnabled('deplacement')) { if (isModEnabled('agenda')) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; } -if (isModEnabled('expedition')) { +if (isModEnabled('delivery_note')) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } @@ -942,19 +942,19 @@ class doc_generic_project_odt extends ModelePDFProjects 'title' => "ListOrdersAssociatedProject", 'class' => 'Commande', 'table' => 'commande', - 'test' => isModEnabled('commande') && $user->hasRight('commande', 'lire') + 'test' => isModEnabled('order') && $user->hasRight('commande', 'lire') ), 'invoice' => array( 'title' => "ListInvoicesAssociatedProject", 'class' => 'Facture', 'table' => 'facture', - 'test' => isModEnabled('facture') && $user->hasRight('facture', 'lire') + 'test' => isModEnabled('invoice') && $user->hasRight('facture', 'lire') ), 'invoice_predefined' => array( 'title' => "ListPredefinedInvoicesAssociatedProject", 'class' => 'FactureRec', 'table' => 'facture_rec', - 'test' => isModEnabled('facture') && $user->hasRight('facture', 'lire') + 'test' => isModEnabled('invoice') && $user->hasRight('facture', 'lire') ), 'proposal_supplier' => array( 'title' => "ListSupplierProposalsAssociatedProject", @@ -978,21 +978,21 @@ class doc_generic_project_odt extends ModelePDFProjects 'title' => "ListContractAssociatedProject", 'class' => 'Contrat', 'table' => 'contrat', - 'test' => isModEnabled('contrat') && $user->hasRight('contrat', 'lire') + 'test' => isModEnabled('contract') && $user->hasRight('contrat', 'lire') ), 'intervention' => array( 'title' => "ListFichinterAssociatedProject", 'class' => 'Fichinter', 'table' => 'fichinter', 'disableamount' => 1, - 'test' => isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire') + 'test' => isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire') ), 'shipping' => array( 'title' => "ListShippingAssociatedProject", 'class' => 'Expedition', 'table' => 'expedition', 'disableamount' => 1, - 'test' => isModEnabled('expedition') && $user->hasRight('expedition', 'lire') + 'test' => isModEnabled('delivery_note') && $user->hasRight('expedition', 'lire') ), 'trip' => array( 'title' => "ListTripAssociatedProject", diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index d87238de508..021e855e417 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -330,7 +330,7 @@ class pdf_beluga extends ModelePDFProjects 'class'=>'Commande', 'table'=>'commande', 'datefieldname'=>'date_commande', - 'test'=> isModEnabled('commande') && $user->hasRight('commande', 'lire'), + 'test'=> isModEnabled('order') && $user->hasRight('commande', 'lire'), 'lang'=>'orders'), 'invoice'=>array( 'name'=>"CustomersInvoices", @@ -339,7 +339,7 @@ class pdf_beluga extends ModelePDFProjects 'margin'=>'add', 'table'=>'facture', 'datefieldname'=>'datef', - 'test'=> isModEnabled('facture') && $user->hasRight('facture', 'lire'), + 'test'=> isModEnabled('invoice') && $user->hasRight('facture', 'lire'), 'lang'=>'bills'), 'invoice_predefined'=>array( 'name'=>"PredefinedInvoices", @@ -347,7 +347,7 @@ class pdf_beluga extends ModelePDFProjects 'class'=>'FactureRec', 'table'=>'facture_rec', 'datefieldname'=>'datec', - 'test'=> isModEnabled('facture') && $user->hasRight('facture', 'lire'), + 'test'=> isModEnabled('invoice') && $user->hasRight('facture', 'lire'), 'lang'=>'bills'), 'order_supplier'=>array( 'name'=>"SuppliersOrders", @@ -372,7 +372,7 @@ class pdf_beluga extends ModelePDFProjects 'class'=>'Contrat', 'table'=>'contrat', 'datefieldname'=>'date_contrat', - 'test'=> isModEnabled('contrat') && $user->hasRight('contrat', 'lire'), + 'test'=> isModEnabled('contract') && $user->hasRight('contrat', 'lire'), 'lang'=>'contract'), 'intervention'=>array( 'name'=>"Interventions", @@ -381,7 +381,7 @@ class pdf_beluga extends ModelePDFProjects 'table'=>'fichinter', 'datefieldname'=>'date_valid', 'disableamount'=>1, - 'test'=>isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire'), + 'test'=>isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire'), 'lang'=>'interventions'), 'trip'=>array( 'name'=>"TripsAndExpenses", diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 5b51371095b..c070f29ce02 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -43,13 +43,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (isModEnabled("supplier_invoice")) { @@ -58,10 +58,10 @@ if (isModEnabled("supplier_invoice")) { if (isModEnabled("supplier_order")) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } if (isModEnabled('deplacement')) { diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index 1bc82c23810..8bb3ad2444d 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -215,14 +215,14 @@ class pdf_paiement extends CommonDocGenerator $sql .= ", c.code as paiement_code, p.num_paiement as num_payment"; $sql .= ", p.amount as paiement_amount, f.total_ttc as facture_amount"; $sql .= ", pf.amount as pf_amount"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $sql .= ", ba.ref as bankaccount"; } $sql .= ", p.rowid as prowid"; $sql .= " FROM ".MAIN_DB_PREFIX."paiement as p LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_paiement = c.id"; $sql .= ", ".MAIN_DB_PREFIX."facture as f,"; $sql .= " ".MAIN_DB_PREFIX."paiement_facture as pf,"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $sql .= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,"; } $sql .= " ".MAIN_DB_PREFIX."societe as s"; @@ -230,7 +230,7 @@ class pdf_paiement extends CommonDocGenerator $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid AND pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $sql .= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid "; } $sql .= " AND f.entity IN (".getEntity('invoice').")"; @@ -253,14 +253,14 @@ class pdf_paiement extends CommonDocGenerator $sql .= ", c.code as paiement_code, p.num_paiement as num_payment"; $sql .= ", p.amount as paiement_amount, f.total_ttc as facture_amount"; $sql .= ", pf.amount as pf_amount"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $sql .= ", ba.ref as bankaccount"; } $sql .= ", p.rowid as prowid"; $sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn as p LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_paiement = c.id"; $sql .= ", ".MAIN_DB_PREFIX."facture_fourn as f,"; $sql .= " ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf,"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $sql .= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,"; } $sql .= " ".MAIN_DB_PREFIX."societe as s"; @@ -268,7 +268,7 @@ class pdf_paiement extends CommonDocGenerator $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } $sql .= " WHERE f.fk_soc = s.rowid AND pf.fk_facturefourn = f.rowid AND pf.fk_paiementfourn = p.rowid"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $sql .= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid "; } $sql .= " AND f.entity IN (".getEntity('invoice').")"; diff --git a/htdocs/core/tpl/advtarget.tpl.php b/htdocs/core/tpl/advtarget.tpl.php index 8d9b566794e..225707f0828 100644 --- a/htdocs/core/tpl/advtarget.tpl.php +++ b/htdocs/core/tpl/advtarget.tpl.php @@ -17,7 +17,7 @@ * along with this program. If not, see . */ -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -256,7 +256,7 @@ if (getDolGlobalInt('MAIN_MULTILANGS')) { print ''."\n"; } -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { // Customer Categories print '
'; print $langs->trans('DefaultBankAccount'); @@ -663,7 +663,7 @@ if ($id > 0) { print '
'; $nbcols = 3; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbcols++; } @@ -698,7 +698,7 @@ if ($id > 0) { print '
'.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans('BankAccount').''.$langs->trans("Amount").''.dol_print_date($db->jdate($objp->dp), 'day')."".$labeltype.' '.$objp->num_payment."'.$obj->num_payment.''; $accountlinestatic->id = $obj->fk_bank; @@ -380,7 +380,7 @@ print '    
'.$langs->trans("BankAccount").''; print img_picto('', 'bank_account', 'pictofixedwidth'); @@ -633,7 +633,7 @@ if ($id > 0) { print '
'; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -716,7 +716,7 @@ if ($id > 0) { print '\n"; $labeltype = $langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "\n"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; diff --git a/htdocs/compta/tva/class/paymentvat.class.php b/htdocs/compta/tva/class/paymentvat.class.php index be9df9fe313..0d2d82b0dd0 100644 --- a/htdocs/compta/tva/class/paymentvat.class.php +++ b/htdocs/compta/tva/class/paymentvat.class.php @@ -569,7 +569,7 @@ class PaymentVAT extends CommonObject $error = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index d84a5c5c588..568fea68048 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -587,11 +587,11 @@ class Tva extends CommonObject $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")); return -4; } - if (isModEnabled("banque") && (empty($this->accountid) || $this->accountid <= 0)) { + if (isModEnabled("bank") && (empty($this->accountid) || $this->accountid <= 0)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("BankAccount")); return -5; } - if (isModEnabled("banque") && (empty($this->type_payment) || $this->type_payment <= 0)) { + if (isModEnabled("bank") && (empty($this->type_payment) || $this->type_payment <= 0)) { $this->error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("PaymentMode")); return -5; } @@ -648,7 +648,7 @@ class Tva extends CommonObject if ($this->id > 0) { $ok = 1; - if (isModEnabled("banque") && !empty($this->amount)) { + if (isModEnabled("bank") && !empty($this->amount)) { // Insert into llx_bank require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 32c982c080c..31d96758fcc 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -91,7 +91,7 @@ $arrayfields = array( 't.status' =>array('checked'=>1, 'position'=>90, 'label'=>"Status"), ); -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { $arrayfields['t.fk_account'] = array('checked'=>1, 'position'=>60, 'label'=>"DefaultBankAccount"); } diff --git a/htdocs/compta/tva/payments.php b/htdocs/compta/tva/payments.php index b877b472551..52405d5e6ce 100644 --- a/htdocs/compta/tva/payments.php +++ b/htdocs/compta/tva/payments.php @@ -170,7 +170,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print_liste_field_titre("DatePayment", $_SERVER["PHP_SELF"], "ptva.datep", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pct.code", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "ptva.num_paiement", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber'); - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "ptva.fk_bank", "", $param, '', $sortfield, $sortorder); print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "bank.ref", "", $param, '', $sortfield, $sortorder); } @@ -258,7 +258,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { // Chq number print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Bank transaction print ''; // A total here has no sense print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; print ''; } diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index ab35f938890..f20a5c170a4 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -193,7 +193,7 @@ abstract class ActionsContactCardCommon $this->object->load_ref_elements(); - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForOrders"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_commande ? $this->object->ref_commande : $langs->trans("NoContactForAnyOrder"); $i++; @@ -203,12 +203,12 @@ abstract class ActionsContactCardCommon $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_propal ? $this->object->ref_propal : $langs->trans("NoContactForAnyProposal"); $i++; } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForContracts"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_contrat ? $this->object->ref_contrat : $langs->trans("NoContactForAnyContract"); $i++; } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $this->tpl['contact_element'][$i]['linked_element_label'] = $langs->trans("ContactForInvoices"); $this->tpl['contact_element'][$i]['linked_element_value'] = $this->object->ref_facturation ? $this->object->ref_facturation : $langs->trans("NoContactForAnyInvoice"); $i++; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 3ca3250d3c3..0cf70884978 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -873,7 +873,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print ''; // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $arrayselected = array(); print ''; print ''; @@ -1209,13 +1209,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { print ''; } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { print ''; @@ -1436,7 +1436,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print ''; print ''; } - if (isModEnabled('commande') || isModEnabled("expedition")) { + if (isModEnabled('order') || isModEnabled("delivery_note")) { print ''; } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { print ''; } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { print ''; diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php index 21ba9ed848f..9cf303b037e 100644 --- a/htdocs/contact/consumption.php +++ b/htdocs/contact/consumption.php @@ -158,18 +158,18 @@ if (!empty($object->thirdparty->client)) { if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } } -if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire')) { +if (isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire')) { $elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions'); } diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 45a39bfee2f..7d5d3858601 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -1002,7 +1002,7 @@ if ($user->hasRight('societe', 'client', 'voir')) { $moreforfilter .= ''; } -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('ContactCategoriesShort'); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 231f433f3b4..613403d2f44 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2176,7 +2176,7 @@ if ($action == 'create') { // Create ... buttons $arrayofcreatebutton = array(); - if (isModEnabled('commande') && $object->status > 0 && $object->nbofservicesclosed < $nbofservices) { + if (isModEnabled('order') && $object->status > 0 && $object->nbofservicesclosed < $nbofservices) { $arrayofcreatebutton[] = array( 'url' => '/commande/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, 'label' => $langs->trans('AddOrder'), @@ -2184,7 +2184,7 @@ if ($action == 'create') { 'perm' => $user->hasRight('commande', 'creer') ); } - if (isModEnabled('facture') && $object->status > 0 && $soc->client > 0) { + if (isModEnabled('invoice') && $object->status > 0 && $soc->client > 0) { $arrayofcreatebutton[] = array( 'url' => '/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, 'label' => $langs->trans('CreateBill'), diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 584ea7d0697..f4ea37d3d53 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -239,7 +239,7 @@ print "
'; print $langs->trans('BankAccount'); @@ -664,7 +664,7 @@ if ($id > 0) { print '
'; $nbcols = 3; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbcols++; } @@ -699,7 +699,7 @@ if ($id > 0) { print '
'.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans('BankAccount').''.$langs->trans("Amount").''.dol_print_date($db->jdate($objp->dp), 'day')."".$labeltype.' '.$objp->num_payment."' . dol_escape_htmltag($obj->num_payment) . ''; $accountlinestatic->id = $obj->fk_bank; @@ -294,7 +294,7 @@ if (isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) { print '    
'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_CONTACT, null, 'parent', null, null, 1); print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('contcats', $cate_arbo, GETPOST('contcats', 'array'), null, null, null, null, '90%'); @@ -1169,7 +1169,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).''; @@ -1197,7 +1197,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->load_ref_elements(); - if (isModEnabled('commande')) { + if (isModEnabled('order')) { print '
'.$langs->trans("ContactForOrders").''; print $object->ref_commande ? $object->ref_commande : (''.$langs->trans("NoContactForAnyOrder").''); print '
'.$langs->trans("ContactForContracts").''; print $object->ref_contrat ? $object->ref_contrat : (''.$langs->trans("NoContactForAnyContract").''); print '
'.$langs->trans("ContactForInvoices").''; print $object->ref_facturation ? $object->ref_facturation : (''.$langs->trans("NoContactForAnyInvoice").''); print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_CONTACT, 1); @@ -1462,29 +1462,29 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print '
'; - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { print $langs->trans("ContactForOrdersOrShipments"); } else { print $langs->trans("ContactForOrders"); } print ''; $none = $langs->trans("NoContactForAnyOrder"); - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { $none = $langs->trans("NoContactForAnyOrderOrShipments"); } print $object->ref_commande ? $object->ref_commande : $none; print '
'.$langs->trans("ContactForContracts").''; print $object->ref_contrat ? $object->ref_contrat : $langs->trans("NoContactForAnyContract"); print '
'.$langs->trans("ContactForInvoices").''; print $object->ref_facturation ? $object->ref_facturation : $langs->trans("NoContactForAnyInvoice"); print '

"; // Draft contracts -if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { +if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $sql = "SELECT c.rowid, c.ref,"; $sql .= " s.nom as name, s.name_alias, s.logo, s.rowid as socid, s.client, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur"; $sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index 8c5d25cbb97..2b852c38ac6 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -if (isModEnabled("categorie")) { +if (isModEnabled("category")) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -799,7 +799,7 @@ if ($user->hasRight('user', 'user', 'lire')) { $moreforfilter .= ''; } // If the user can view categories of products -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -808,7 +808,7 @@ if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user- $moreforfilter .= '
'; } // Filter on customer categories -if (getDolGlobalString('MAIN_SEARCH_CATEGORY_CUSTOMER_ON_CONTRACT_LIST') && isModEnabled("categorie") && $user->hasRight('categorie', 'lire')) { +if (getDolGlobalString('MAIN_SEARCH_CATEGORY_CUSTOMER_ON_CONTRACT_LIST') && isModEnabled("category") && $user->hasRight('categorie', 'lire')) { $moreforfilter .= '
'; $tmptitle = $langs->transnoentities('CustomersProspectsCategoriesShort'); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"'); diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index eae46a028e6..a0d00d27442 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -528,7 +528,7 @@ $morefilter = ''; $moreforfilter = ''; // If the user can view categories of products -if (isModEnabled('categorie') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { +if (isModEnabled('category') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 1fac2f45c9e..5c37dacedbe 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -189,7 +189,7 @@ if ($action == 'add' && !empty($permissiontoadd)) { $result = $object->create($user); if ($result > 0) { // Creation OK - if (isModEnabled('categorie') && method_exists($object, 'setCategories')) { + if (isModEnabled('category') && method_exists($object, 'setCategories')) { $categories = GETPOST('categories', 'array:int'); $object->setCategories($categories); } @@ -313,7 +313,7 @@ if ($action == 'update' && !empty($permissiontoadd)) { } } - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $categories = GETPOST('categories', 'array'); if (method_exists($object, 'setCategories')) { $object->setCategories($categories); diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index ba7725d06aa..f91e87c8d36 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -69,7 +69,7 @@ $arrayresult = array(); // Define $searchform -if (isModEnabled('adherent') && !getDolGlobalString('MAIN_SEARCHFORM_ADHERENT_DISABLED') && $user->hasRight('adherent', 'lire')) { +if (isModEnabled('member') && !getDolGlobalString('MAIN_SEARCHFORM_ADHERENT_DISABLED') && $user->hasRight('adherent', 'lire')) { $arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } @@ -102,13 +102,13 @@ if (isModEnabled('project') && !getDolGlobalString('MAIN_SEARCHFORM_TASK_DISABLE if (isModEnabled('propal') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED') && $user->hasRight('propal', 'lire')) { $arrayresult['searchintopropal'] = array('position'=>60, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('', 'object_propal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (isModEnabled('commande') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED') && $user->hasRight('commande', 'lire')) { +if (isModEnabled('order') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED') && $user->hasRight('commande', 'lire')) { $arrayresult['searchintoorder'] = array('position'=>70, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('', 'object_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (isModEnabled('expedition') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED') && $user->hasRight('expedition', 'lire')) { +if (isModEnabled('delivery_note') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED') && $user->hasRight('expedition', 'lire')) { $arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (isModEnabled('facture') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED') && $user->hasRight('facture', 'lire')) { +if (isModEnabled('invoice') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED') && $user->hasRight('facture', 'lire')) { $arrayresult['searchintoinvoice'] = array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } @@ -123,7 +123,7 @@ if (((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERM } // Customer payments -if (isModEnabled('facture') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED') && $user->hasRight('facture', 'lire')) { +if (isModEnabled('invoice') && !getDolGlobalString('MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED') && $user->hasRight('facture', 'lire')) { $arrayresult['searchintocustomerpayments'] = array( 'position'=>170, 'img'=>'object_payment', @@ -143,7 +143,7 @@ if (((isModEnabled('fournisseur') && !getDolGlobalString('MAIN_USE_NEW_SUPPLIERM } // Miscellaneous payments -if (isModEnabled('banque') && !getDolGlobalString('MAIN_SEARCHFORM_MISC_PAYMENTS_DISABLED') && $user->hasRight('banque', 'lire')) { +if (isModEnabled('bank') && !getDolGlobalString('MAIN_SEARCHFORM_MISC_PAYMENTS_DISABLED') && $user->hasRight('banque', 'lire')) { $arrayresult['searchintomiscpayments'] = array( 'position'=>180, 'img'=>'object_payment', @@ -152,10 +152,10 @@ if (isModEnabled('banque') && !getDolGlobalString('MAIN_SEARCHFORM_MISC_PAYMENTS 'url'=>DOL_URL_ROOT.'/compta/bank/various_payment/list.php?leftmenu=tax_various'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : '')); } -if (isModEnabled('contrat') && !getDolGlobalString('MAIN_SEARCHFORM_CONTRACT_DISABLED') && $user->hasRight('contrat', 'lire')) { +if (isModEnabled('contract') && !getDolGlobalString('MAIN_SEARCHFORM_CONTRACT_DISABLED') && $user->hasRight('contrat', 'lire')) { $arrayresult['searchintocontract'] = array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('', 'object_contract', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } -if (isModEnabled('ficheinter') && !getDolGlobalString('MAIN_SEARCHFORM_FICHINTER_DISABLED') && $user->hasRight('ficheinter', 'lire')) { +if (isModEnabled('intervention') && !getDolGlobalString('MAIN_SEARCHFORM_FICHINTER_DISABLED') && $user->hasRight('ficheinter', 'lire')) { $arrayresult['searchintointervention'] = array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('', 'object_intervention', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); } if (isModEnabled('knowledgemanagement') && !getDolGlobalString('MAIN_SEARCHFORM_KNOWLEDGEMANAGEMENT_DISABLED') && $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) { diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index b84e74dfe18..88571ed872b 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -53,8 +53,8 @@ class box_activity extends ModeleBoxes $this->enabled = getDolGlobalInt('MAIN_FEATURES_LEVEL'); // Not enabled by default due to bugs (see previous comments) $this->hidden = !( - (isModEnabled('facture') && $user->hasRight('facture', 'read')) - || (isModEnabled('commande') && $user->hasRight('commande', 'read')) + (isModEnabled('invoice') && $user->hasRight('facture', 'read')) + || (isModEnabled('order') && $user->hasRight('commande', 'read')) || (isModEnabled('propal') && $user->hasRight('propal', 'read')) ); } @@ -183,7 +183,7 @@ class box_activity extends ModeleBoxes } // list the summary of the orders - if (isModEnabled('commande') && $user->hasRight("commande", "lire")) { + if (isModEnabled('order') && $user->hasRight("commande", "lire")) { include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $commandestatic = new Commande($this->db); @@ -270,7 +270,7 @@ class box_activity extends ModeleBoxes // list the summary of the bills - if (isModEnabled('facture') && $user->hasRight("facture", "lire")) { + if (isModEnabled('invoice') && $user->hasRight("facture", "lire")) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $facturestatic = new Facture($this->db); diff --git a/htdocs/core/boxes/box_dolibarr_state_board.php b/htdocs/core/boxes/box_dolibarr_state_board.php index a076c096f4c..9785396a49a 100644 --- a/htdocs/core/boxes/box_dolibarr_state_board.php +++ b/htdocs/core/boxes/box_dolibarr_state_board.php @@ -102,7 +102,7 @@ class box_dolibarr_state_board extends ModeleBoxes ); $conditions = array( 'users' => $user->hasRight('user', 'user', 'lire'), - 'members' => isModEnabled('adherent') && $user->hasRight('adherent', 'lire'), + 'members' => isModEnabled('member') && $user->hasRight('adherent', 'lire'), 'customers' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS') && !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS_STATS'), 'prospects' => isModEnabled('societe') && $user->hasRight('societe', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') && !getDolGlobalString('SOCIETE_DISABLE_PROSPECTS_STATS'), 'suppliers' => ( @@ -115,11 +115,11 @@ class box_dolibarr_state_board extends ModeleBoxes 'products' => isModEnabled('product') && $user->hasRight('product', 'read'), 'services' => isModEnabled('service') && $user->hasRight('service', 'read'), 'proposals' => isModEnabled('propal') && $user->hasRight('propal', 'read'), - 'orders' => isModEnabled('commande') && $user->hasRight('commande', 'lire'), - 'invoices' => isModEnabled('facture') && $user->hasRight('facture', 'lire'), + 'orders' => isModEnabled('order') && $user->hasRight('commande', 'lire'), + 'invoices' => isModEnabled('invoice') && $user->hasRight('facture', 'lire'), 'donations' => isModEnabled('don') && $user->hasRight('don', 'lire'), - 'contracts' => isModEnabled('contrat') && $user->hasRight('contrat', 'lire'), - 'interventions' => isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire'), + 'contracts' => isModEnabled('contract') && $user->hasRight('contrat', 'lire'), + 'interventions' => isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire'), 'supplier_orders' => isModEnabled('supplier_order') && $user->hasRight('fournisseur', 'commande', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS'), 'supplier_invoices' => isModEnabled('supplier_invoice') && $user->hasRight('fournisseur', 'facture', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS'), 'supplier_proposals' => isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire') && !getDolGlobalString('SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS'), diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index a90b8604060..079aaff21b2 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -49,8 +49,8 @@ class box_graph_product_distribution extends ModeleBoxes $this->db = $db; $this->hidden = !( - (isModEnabled('facture') && $user->hasRight('facture', 'lire')) - || (isModEnabled('commande') && $user->hasRight('commande', 'lire')) + (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) + || (isModEnabled('order') && $user->hasRight('commande', 'lire')) || (isModEnabled('propal') && $user->hasRight('propal', 'lire')) ); } @@ -96,13 +96,13 @@ class box_graph_product_distribution extends ModeleBoxes $showinvoicenb = 1; $showordernb = 1; } - if (!isModEnabled('facture') || !$user->hasRight('facture', 'lire')) { + if (!isModEnabled('invoice') || !$user->hasRight('facture', 'lire')) { $showinvoicenb = 0; } if (isModEnabled('propal') || !$user->hasRight('propal', 'lire')) { $showpropalnb = 0; } - if (!isModEnabled('commande') || !$user->hasRight('commande', 'lire')) { + if (!isModEnabled('order') || !$user->hasRight('commande', 'lire')) { $showordernb = 0; } @@ -203,7 +203,7 @@ class box_graph_product_distribution extends ModeleBoxes } } - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showordernb) { $langs->load("orders"); @@ -267,7 +267,7 @@ class box_graph_product_distribution extends ModeleBoxes } - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { // Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...) if ($showinvoicenb) { $langs->load("bills"); @@ -358,10 +358,10 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow .= ' '.$langs->trans("ForProposals"); $stringtoshow .= ' '; } - if (isModEnabled('commande') || $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') || $user->hasRight('commande', 'lire')) { $stringtoshow .= ' '.$langs->trans("ForCustomersOrders"); } - if (isModEnabled('facture') || $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') || $user->hasRight('facture', 'lire')) { $stringtoshow .= ' '.$langs->trans("ForCustomersInvoices"); $stringtoshow .= '   '; } @@ -384,13 +384,13 @@ class box_graph_product_distribution extends ModeleBoxes $stringtoshow .= '
'; if (isModEnabled('propal') && $showpropalnb) { $stringtoshow .= $px2->show(); - } elseif (isModEnabled('commande') && $showordernb) { + } elseif (isModEnabled('order') && $showordernb) { $stringtoshow .= $px3->show(); } $stringtoshow .= '
'; - if (isModEnabled('facture') && $showinvoicenb) { + if (isModEnabled('invoice') && $showinvoicenb) { $stringtoshow .= $px1->show(); - } elseif (isModEnabled('commande') && $showordernb) { + } elseif (isModEnabled('order') && $showordernb) { $stringtoshow .= $px3->show(); } $stringtoshow .= '
'; diff --git a/htdocs/core/boxes/box_members_by_tags.php b/htdocs/core/boxes/box_members_by_tags.php index 587d7bdcd53..429b8fba2d7 100644 --- a/htdocs/core/boxes/box_members_by_tags.php +++ b/htdocs/core/boxes/box_members_by_tags.php @@ -58,7 +58,7 @@ class box_members_by_tags extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(isModEnabled('adherent') && $user->hasRight('adherent', 'lire')); + $this->hidden = !(isModEnabled('member') && $user->hasRight('adherent', 'lire')); } /** diff --git a/htdocs/core/boxes/box_members_by_type.php b/htdocs/core/boxes/box_members_by_type.php index 6ce11bfca44..f5412dec5ea 100644 --- a/htdocs/core/boxes/box_members_by_type.php +++ b/htdocs/core/boxes/box_members_by_type.php @@ -58,7 +58,7 @@ class box_members_by_type extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(isModEnabled('adherent') && $user->hasRight('adherent', 'lire')); + $this->hidden = !(isModEnabled('member') && $user->hasRight('adherent', 'lire')); } /** diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php index 0c7ed55eb57..2ef36c822dd 100644 --- a/htdocs/core/boxes/box_members_last_modified.php +++ b/htdocs/core/boxes/box_members_last_modified.php @@ -57,7 +57,7 @@ class box_members_last_modified extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(isModEnabled('adherent') && $user->hasRight('adherent', 'lire')); + $this->hidden = !(isModEnabled('member') && $user->hasRight('adherent', 'lire')); } /** diff --git a/htdocs/core/boxes/box_members_last_subscriptions.php b/htdocs/core/boxes/box_members_last_subscriptions.php index 7375dda6562..92d0413c5e7 100644 --- a/htdocs/core/boxes/box_members_last_subscriptions.php +++ b/htdocs/core/boxes/box_members_last_subscriptions.php @@ -57,7 +57,7 @@ class box_members_last_subscriptions extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(isModEnabled('adherent') && $user->hasRight('adherent', 'lire')); + $this->hidden = !(isModEnabled('member') && $user->hasRight('adherent', 'lire')); } /** diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php index 6cb43a94187..09df79556bb 100644 --- a/htdocs/core/boxes/box_members_subscriptions_by_year.php +++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php @@ -57,7 +57,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes $this->enabled = 0; // disabled for external users } - $this->hidden = !(isModEnabled('adherent') && $user->hasRight('adherent', 'lire')); + $this->hidden = !(isModEnabled('member') && $user->hasRight('adherent', 'lire')); } /** diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 50d22620a20..5c8ea19dc73 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9155,13 +9155,13 @@ class Form // To work with non standard path if ($objecttype == 'facture') { $tplpath = 'compta/' . $element; - if (!isModEnabled('facture')) { + if (!isModEnabled('invoice')) { continue; // Do not show if module disabled } } elseif ($objecttype == 'facturerec') { $tplpath = 'compta/facture'; $tplname = 'linkedobjectblockForRec'; - if (!isModEnabled('facture')) { + if (!isModEnabled('invoice')) { continue; // Do not show if module disabled } } elseif ($objecttype == 'propal') { @@ -9175,7 +9175,7 @@ class Form } } elseif ($objecttype == 'shipping' || $objecttype == 'shipment' || $objecttype == 'expedition') { $tplpath = 'expedition'; - if (!isModEnabled('expedition')) { + if (!isModEnabled('delivery_note')) { continue; // Do not show if module disabled } } elseif ($objecttype == 'reception') { @@ -9185,12 +9185,12 @@ class Form } } elseif ($objecttype == 'delivery') { $tplpath = 'delivery'; - if (!isModEnabled('expedition')) { + if (!isModEnabled('delivery_note')) { continue; // Do not show if module disabled } } elseif ($objecttype == 'ficheinter') { $tplpath = 'fichinter'; - if (!isModEnabled('ficheinter')) { + if (!isModEnabled('intervention')) { continue; // Do not show if module disabled } } elseif ($objecttype == 'invoice_supplier') { @@ -9292,34 +9292,34 @@ class Form 'label' => 'LinkToProposal', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('propal') . ')'), 'shipping' => array( - 'enabled' => isModEnabled('expedition'), + 'enabled' => isModEnabled('delivery_note'), 'perms' => 1, 'label' => 'LinkToExpedition', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "expedition as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('shipping') . ')'), 'order' => array( - 'enabled' => isModEnabled('commande'), + 'enabled' => isModEnabled('order'), 'perms' => 1, 'label' => 'LinkToOrder', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "commande as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('commande') . ')'), 'invoice' => array( - 'enabled' => isModEnabled('facture'), + 'enabled' => isModEnabled('invoice'), 'perms' => 1, 'label' => 'LinkToInvoice', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), 'invoice_template' => array( - 'enabled' => isModEnabled('facture'), + 'enabled' => isModEnabled('invoice'), 'perms' => 1, 'label' => 'LinkToTemplateInvoice', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.titre as ref, t.total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "facture_rec as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('invoice') . ')'), 'contrat' => array( - 'enabled' => isModEnabled('contrat'), + 'enabled' => isModEnabled('contract'), 'perms' => 1, 'label' => 'LinkToContract', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_customer as ref_client, t.ref_supplier, SUM(td.total_ht) as total_ht FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "contrat as t, " . $this->db->prefix() . "contratdet as td WHERE t.fk_soc = s.rowid AND td.fk_contrat = t.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('contract') . ') GROUP BY s.rowid, s.nom, s.client, t.rowid, t.ref, t.ref_customer, t.ref_supplier' ), 'fichinter' => array( - 'enabled' => isModEnabled('ficheinter'), + 'enabled' => isModEnabled('intervention'), 'perms' => 1, 'label' => 'LinkToIntervention', 'sql' => "SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM " . $this->db->prefix() . "societe as s, " . $this->db->prefix() . "fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (" . $this->db->sanitize($listofidcompanytoscan) . ') AND t.entity IN (' . getEntity('intervention') . ')'), diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 731b0514ef9..606becf17c2 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -1917,36 +1917,36 @@ class FormMail extends Form if ($onlinepaymentenabled && getDolGlobalString('PAYMENT_SECURITY_TOKEN')) { $tmparray['__SECUREKEYPAYMENT__'] = getDolGlobalString('PAYMENT_SECURITY_TOKEN'); if (getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) { - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $tmparray['__SECUREKEYPAYMENT_MEMBER__'] = 'SecureKeyPAYMENTUniquePerMember'; } if (isModEnabled('don')) { $tmparray['__SECUREKEYPAYMENT_DONATION__'] = 'SecureKeyPAYMENTUniquePerDonation'; } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $tmparray['__SECUREKEYPAYMENT_INVOICE__'] = 'SecureKeyPAYMENTUniquePerInvoice'; } - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $tmparray['__SECUREKEYPAYMENT_ORDER__'] = 'SecureKeyPAYMENTUniquePerOrder'; } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $tmparray['__SECUREKEYPAYMENT_CONTRACTLINE__'] = 'SecureKeyPAYMENTUniquePerContractLine'; } //Online payment link - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $tmparray['__ONLINEPAYMENTLINK_MEMBER__'] = 'OnlinePaymentLinkUniquePerMember'; } if (isModEnabled('don')) { $tmparray['__ONLINEPAYMENTLINK_DONATION__'] = 'OnlinePaymentLinkUniquePerDonation'; } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $tmparray['__ONLINEPAYMENTLINK_INVOICE__'] = 'OnlinePaymentLinkUniquePerInvoice'; } - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $tmparray['__ONLINEPAYMENTLINK_ORDER__'] = 'OnlinePaymentLinkUniquePerOrder'; } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $tmparray['__ONLINEPAYMENTLINK_CONTRACTLINE__'] = 'OnlinePaymentLinkUniquePerContractLine'; } } diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index b240c62cd7c..4fa8ee3eac6 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -460,7 +460,7 @@ class FormTicket } // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $cate_arbo = $form->select_all_categories(Categorie::TYPE_TICKET, '', 'parent', 64, 0, 1); diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 31f4fa0ef04..49cecafe544 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -121,16 +121,16 @@ $arrayoftype = array( 'thirdparty' => array('langs'=>'companies', 'label' => 'ThirdParties', 'picto'=>'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php"), 'contact' => array('label' => 'Contacts', 'picto'=>'contact', 'ObjectClassName' => 'Contact', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/contact/class/contact.class.php"), 'proposal' => array('label' => 'Proposals', 'picto'=>'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php"), - 'order' => array('label' => 'Orders', 'picto'=>'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('commande'), 'ClassPath' => "/commande/class/commande.class.php"), - 'invoice' => array('langs'=>'facture', 'label' => 'Invoices', 'picto'=>'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('facture'), 'ClassPath' => "/compta/facture/class/facture.class.php"), - 'invoice_template'=>array('label' => 'PredefinedInvoices', 'picto'=>'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('facture'), 'ClassPath' => "/compta/class/facturerec.class.php", 'langs'=>'bills'), - 'contract' => array('label' => 'Contracts', 'picto'=>'contract', 'ObjectClassName' => 'Contrat', 'enabled' => isModEnabled('contrat'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'), - 'contractdet' => array('label' => 'ContractLines', 'picto'=>'contract', 'ObjectClassName' => 'ContratLigne', 'enabled' => isModEnabled('contrat'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'), + 'order' => array('label' => 'Orders', 'picto'=>'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/commande.class.php"), + 'invoice' => array('langs'=>'facture', 'label' => 'Invoices', 'picto'=>'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture.class.php"), + 'invoice_template'=>array('label' => 'PredefinedInvoices', 'picto'=>'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/class/facturerec.class.php", 'langs'=>'bills'), + 'contract' => array('label' => 'Contracts', 'picto'=>'contract', 'ObjectClassName' => 'Contrat', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'), + 'contractdet' => array('label' => 'ContractLines', 'picto'=>'contract', 'ObjectClassName' => 'ContratLigne', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'), 'bom' => array('label' => 'BOM', 'picto'=>'bom', 'ObjectClassName' => 'Bom', 'enabled' => isModEnabled('bom')), 'mrp' => array('label' => 'MO', 'picto'=>'mrp', 'ObjectClassName' => 'Mo', 'enabled' => isModEnabled('mrp'), 'ClassPath' => "/mrp/class/mo.class.php"), 'ticket' => array('label' => 'Ticket', 'picto'=>'ticket', 'ObjectClassName' => 'Ticket', 'enabled' => isModEnabled('ticket')), - 'member' => array('label' => 'Adherent', 'picto'=>'member', 'ObjectClassName' => 'Adherent', 'enabled' => isModEnabled('adherent'), 'ClassPath' => "/adherents/class/adherent.class.php", 'langs'=>'members'), - 'cotisation' => array('label' => 'Subscriptions', 'picto'=>'member', 'ObjectClassName' => 'Subscription', 'enabled' => isModEnabled('adherent'), 'ClassPath' => "/adherents/class/subscription.class.php", 'langs'=>'members'), + 'member' => array('label' => 'Adherent', 'picto'=>'member', 'ObjectClassName' => 'Adherent', 'enabled' => isModEnabled('member'), 'ClassPath' => "/adherents/class/adherent.class.php", 'langs'=>'members'), + 'cotisation' => array('label' => 'Subscriptions', 'picto'=>'member', 'ObjectClassName' => 'Subscription', 'enabled' => isModEnabled('member'), 'ClassPath' => "/adherents/class/subscription.class.php", 'langs'=>'members'), ); diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index efa664e26fc..270742a3c97 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1769,7 +1769,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '', $text = 'Valu print 'mymailmanlist
'; print 'mymailmanlist1,mymailmanlist2
'; print 'TYPE:Type1:mymailmanlist1,TYPE:Type2:mymailmanlist2
'; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print 'CATEG:Categ1:mymailmanlist1,CATEG:Categ2:mymailmanlist2
'; } print '
'; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 3c5df955ae3..73b09437bbb 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -131,7 +131,7 @@ function print_actions_filter( print '
'; } - if (isModEnabled('projet') && $user->hasRight('projet', 'lire')) { + if (isModEnabled('project') && $user->hasRight('projet', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; $formproject = new FormProjets($db); @@ -141,7 +141,7 @@ function print_actions_filter( print ''; } - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $formother = new FormOther($db); diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 515f4f4f443..65373fb5b3e 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -180,7 +180,7 @@ function societe_prepare_head(Societe $object) } // Related items - if ((isModEnabled('commande') || isModEnabled('propal') || isModEnabled('facture') || isModEnabled('ficheinter') || isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) + if ((isModEnabled('order') || isModEnabled('propal') || isModEnabled('invoice') || isModEnabled('intervention') || isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && !getDolGlobalString('THIRDPARTIES_DISABLE_RELATED_OBJECT_TAB')) { $head[$h][0] = DOL_URL_ROOT.'/societe/consumption.php?socid='.$object->id; $head[$h][1] = $langs->trans("Referers"); diff --git a/htdocs/core/lib/contact.lib.php b/htdocs/core/lib/contact.lib.php index 6a6bcd45213..747540dbfde 100644 --- a/htdocs/core/lib/contact.lib.php +++ b/htdocs/core/lib/contact.lib.php @@ -93,7 +93,7 @@ function contact_prepare_head(Contact $object) } // Related items - if (isModEnabled('commande') || isModEnabled("propal") || isModEnabled('facture') || isModEnabled('ficheinter') || isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { + if (isModEnabled('order') || isModEnabled("propal") || isModEnabled('invoice') || isModEnabled('intervention') || isModEnabled("supplier_proposal") || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) { $head[$tab][0] = DOL_URL_ROOT.'/contact/consumption.php?id='.$object->id; $head[$tab][1] = $langs->trans("Referers"); $head[$tab][2] = 'consumption'; diff --git a/htdocs/core/lib/expedition.lib.php b/htdocs/core/lib/expedition.lib.php index f431a292704..78975768664 100644 --- a/htdocs/core/lib/expedition.lib.php +++ b/htdocs/core/lib/expedition.lib.php @@ -35,7 +35,7 @@ function expedition_prepare_head(Expedition $object) { global $langs, $conf, $user; - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { $langs->load("sendings"); } $langs->load("orders"); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 40e1aa39219..216472484e0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8362,7 +8362,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__'; $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__'; } - if (isModEnabled('adherent') && (!is_object($object) || $object->element == 'adherent') && (empty($exclude) || !in_array('member', $exclude)) && (empty($include) || in_array('member', $include))) { + if (isModEnabled('member') && (!is_object($object) || $object->element == 'adherent') && (empty($exclude) || !in_array('member', $exclude)) && (empty($include) || in_array('member', $include))) { $substitutionarray['__MEMBER_ID__'] = '__MEMBER_ID__'; $substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__'; $substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__'; @@ -8396,7 +8396,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, /*$substitutionarray['__PROJECT_NOTE_PUBLIC__'] = '__PROJECT_NOTE_PUBLIC__'; $substitutionarray['__PROJECT_NOTE_PRIVATE__'] = '__PROJECT_NOTE_PRIVATE__';*/ } - if (isModEnabled('contrat') && (!is_object($object) || $object->element == 'contract') && (empty($exclude) || !in_array('contract', $exclude)) && (empty($include) || in_array('contract', $include))) { + if (isModEnabled('contract') && (!is_object($object) || $object->element == 'contract') && (empty($exclude) || !in_array('contract', $exclude)) && (empty($include) || in_array('contract', $include))) { $substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATE__'] = 'Highest date planned for a service start'; $substitutionarray['__CONTRACT_HIGHEST_PLANNED_START_DATETIME__'] = 'Highest date and hour planned for service start'; $substitutionarray['__CONTRACT_LOWEST_EXPIRATION_DATE__'] = 'Lowest data for planned expiration of service'; @@ -8405,7 +8405,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if (isModEnabled("propal") && (!is_object($object) || $object->element == 'propal') && (empty($exclude) || !in_array('propal', $exclude)) && (empty($include) || in_array('propal', $include))) { $substitutionarray['__ONLINE_SIGN_URL__'] = 'ToOfferALinkForOnlineSignature'; } - if (isModEnabled("ficheinter") && (!is_object($object) || $object->element == 'fichinter') && (empty($exclude) || !in_array('intervention', $exclude)) && (empty($include) || in_array('intervention', $include))) { + if (isModEnabled("intervention") && (!is_object($object) || $object->element == 'fichinter') && (empty($exclude) || !in_array('intervention', $exclude)) && (empty($include) || in_array('intervention', $include))) { $substitutionarray['__ONLINE_SIGN_FICHINTER_URL__'] = 'ToOfferALinkForOnlineSignature'; } $substitutionarray['__ONLINE_PAYMENT_URL__'] = 'UrlToPayOnlineIfApplicable'; @@ -8422,7 +8422,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__DIRECTDOWNLOAD_URL_CONTRACT__'] = 'Direct download url of a contract'; $substitutionarray['__DIRECTDOWNLOAD_URL_SUPPLIER_PROPOSAL__'] = 'Direct download url of a supplier proposal'; - if (isModEnabled("expedition") && (!is_object($object) || $object->element == 'shipping')) { + if (isModEnabled("delivery_note") && (!is_object($object) || $object->element == 'shipping')) { $substitutionarray['__SHIPPINGTRACKNUM__'] = 'Shipping tracking number'; $substitutionarray['__SHIPPINGTRACKNUMURL__'] = 'Shipping tracking url'; $substitutionarray['__SHIPPINGMETHOD__'] = 'Shipping method'; diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 9a21f14c45c..9e6a39c63f9 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -344,7 +344,7 @@ function getNumberInvoicesPieChart($mode) { global $conf, $db, $langs, $user; - if (($mode == 'customers' && isModEnabled('facture') && $user->hasRight('facture', 'lire')) + if (($mode == 'customers' && isModEnabled('invoice') && $user->hasRight('facture', 'lire')) || ($mode == 'suppliers' && (isModEnabled('fournisseur') || isModEnabled('supplier_invoice')) && $user->hasRight('fournisseur', 'facture', 'lire')) ) { global $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus8, $badgeStatus11; @@ -490,7 +490,7 @@ function getCustomerInvoiceDraftTable($maxCount = 500, $socid = 0) $result = ''; - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $maxofloop = (!getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD); $tmpinvoice = new Facture($db); @@ -989,7 +989,7 @@ function getCustomerInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) $result = ''; - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $tmpinvoice = new Facture($db); $sql = "SELECT f.rowid, f.ref, f.fk_statut as status, f.datef, f.type, f.total_ht, f.total_tva, f.total_ttc, f.paye, f.tms"; diff --git a/htdocs/core/lib/ldap.lib.php b/htdocs/core/lib/ldap.lib.php index 96d458f01c8..ccf1d9dabe8 100644 --- a/htdocs/core/lib/ldap.lib.php +++ b/htdocs/core/lib/ldap.lib.php @@ -64,14 +64,14 @@ function ldap_prepare_head() $h++; } - if (isModEnabled('adherent') && getDolGlobalString('LDAP_MEMBER_ACTIVE')) { + if (isModEnabled('member') && getDolGlobalString('LDAP_MEMBER_ACTIVE')) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members.php"; $head[$h][1] = $langs->trans("LDAPMembersSynchro"); $head[$h][2] = 'members'; $h++; } - if (isModEnabled('adherent') && getDolGlobalString('LDAP_MEMBER_TYPE_ACTIVE')) { + if (isModEnabled('member') && getDolGlobalString('LDAP_MEMBER_TYPE_ACTIVE')) { $head[$h][0] = DOL_URL_ROOT."/admin/ldap_members_types.php"; $head[$h][1] = $langs->trans("LDAPMembersTypesSynchro"); $head[$h][2] = 'memberstypes'; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 2b39661e6e7..cb3f380fca3 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -34,7 +34,7 @@ function commande_prepare_head(Commande $object) { global $db, $langs, $conf, $user; - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { $langs->load("sendings"); } $langs->load("orders"); @@ -42,7 +42,7 @@ function commande_prepare_head(Commande $object) $h = 0; $head = array(); - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $head[$h][0] = DOL_URL_ROOT.'/commande/card.php?id='.$object->id; $head[$h][1] = $langs->trans("CustomerOrder"); $head[$h][2] = 'order'; @@ -230,7 +230,7 @@ function getCustomerOrderPieChart($socid = 0) $result = ''; - if (!isModEnabled('commande') || !$user->hasRight('commande', 'lire')) { + if (!isModEnabled('order') || !$user->hasRight('commande', 'lire')) { return ''; } diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index cf170a77c75..4cfac0f4413 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -62,7 +62,7 @@ function pdf_admin_prepare_head() // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab complete_head_from_modules($conf, $langs, null, $head, $h, 'pdf_admin'); - if (isModEnabled("propal") || isModEnabled('facture') || isModEnabled('reception')) { + if (isModEnabled("propal") || isModEnabled('invoice') || isModEnabled('reception')) { $head[$h][0] = DOL_URL_ROOT.'/admin/pdf_other.php'; $head[$h][1] = $langs->trans("Others"); $head[$h][2] = 'other'; @@ -1710,7 +1710,7 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0, $libelleproduitservice = $prefix_prodserv.$ref_prodserv.$libelleproduitservice; // Add an additional description for the category products - if (getDolGlobalString('CATEGORY_ADD_DESC_INTO_DOC') && $idprod && isModEnabled('categorie')) { + if (getDolGlobalString('CATEGORY_ADD_DESC_INTO_DOC') && $idprod && isModEnabled('category')) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $categstatic = new Categorie($db); // recovering the list of all the categories linked to product diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index a631d7ff826..976e6c4cf15 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -476,7 +476,7 @@ function show_stats_for_company($product, $socid) print '
'.$langs->trans("CustomersCategoryShort"); if (!empty($array_query['cust_categ'])) { @@ -448,7 +448,7 @@ print '
'; print '
'."\n"; print '
'.$langs->trans("ContactCategoriesShort"); if (!empty($array_query['contact_categ'])) { diff --git a/htdocs/core/tpl/onlinepaymentlinks.tpl.php b/htdocs/core/tpl/onlinepaymentlinks.tpl.php index 0fc08a043f8..b5e24042ee3 100644 --- a/htdocs/core/tpl/onlinepaymentlinks.tpl.php +++ b/htdocs/core/tpl/onlinepaymentlinks.tpl.php @@ -30,7 +30,7 @@ print ''.$langs->trans("FollowingUrlAreAvailableToMakePayments").':
'.$langs->trans("ToOfferALinkForOnlinePaymentOnFreeAmount", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'free')."

\n"; -if (isModEnabled('commande')) { +if (isModEnabled('order')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnOrder", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'order')."
\n"; @@ -52,7 +52,7 @@ if (isModEnabled('commande')) { } print '
'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnInvoice", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'invoice')."
\n"; @@ -74,7 +74,7 @@ if (isModEnabled('facture')) { } print '
'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnContractLine", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'contractline')."
\n"; @@ -96,7 +96,7 @@ if (isModEnabled('contrat')) { } print '
'; } -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { print '
'; print img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePaymentOnMemberSubscription", $servicename).':
'; print ''.getOnlinePaymentUrl(1, 'membersubscription')."
\n"; diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index 945ece57a4b..0de09d491f0 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -73,7 +73,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers // Proposals to order if ($action == 'PROPAL_CLOSE_SIGNED') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (isModEnabled('commande') && getDolGlobalString('WORKFLOW_PROPAL_AUTOCREATE_ORDER')) { + if (isModEnabled('order') && getDolGlobalString('WORKFLOW_PROPAL_AUTOCREATE_ORDER')) { $object->fetchObjectLinked(); if (!empty($object->linkedObjectsIds['commande'])) { if (empty($object->context['closedfromonlinesignature'])) { @@ -104,7 +104,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers // Order to invoice if ($action == 'ORDER_CLOSE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (isModEnabled('facture') && getDolGlobalString('WORKFLOW_ORDER_AUTOCREATE_INVOICE')) { + if (isModEnabled('invoice') && getDolGlobalString('WORKFLOW_ORDER_AUTOCREATE_INVOICE')) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $newobject = new Facture($this->db); @@ -151,7 +151,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // First classify billed the order to allow the proposal classify process - if (isModEnabled('commande') && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER')) { + if (isModEnabled('order') && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER')) { $object->fetchObjectLinked('', 'commande', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; @@ -189,7 +189,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } // Set shipment to "Closed" if WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE is set (deprecated, has been replaced with WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE instead)) - if (isModEnabled("expedition") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE')) { + if (isModEnabled("delivery_note") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE')) { $object->fetchObjectLinked('', 'shipping', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; @@ -210,7 +210,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } - if (isModEnabled("expedition") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE')) { + if (isModEnabled("delivery_note") && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_SHIPPING_CLASSIFY_BILLED_INVOICE')) { $object->fetchObjectLinked('', 'shipping', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; @@ -336,7 +336,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($action == 'BILL_PAYED') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (isModEnabled('commande') && getDolGlobalString('WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER')) { + if (isModEnabled('order') && getDolGlobalString('WORKFLOW_INVOICE_CLASSIFY_BILLED_ORDER')) { $object->fetchObjectLinked('', 'commande', $object->id, $object->element); if (!empty($object->linkedObjects)) { $totalonlinkedelements = 0; @@ -360,7 +360,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if (($action == 'SHIPPING_VALIDATE') || ($action == 'SHIPPING_CLOSED')) { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); - if (isModEnabled('commande') && isModEnabled("expedition") && !empty($conf->workflow->enabled) && + if (isModEnabled('order') && isModEnabled("delivery_note") && !empty($conf->workflow->enabled) && ( (getDolGlobalString('WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING') && ($action == 'SHIPPING_VALIDATE')) || (getDolGlobalString('WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED') && ($action == 'SHIPPING_CLOSED')) @@ -516,7 +516,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers if ($action == 'TICKET_CREATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); // Auto link contract - if (!empty($conf->contract->enabled) && isModEnabled('ticket') && isModEnabled('ficheinter') && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_TICKET_LINK_CONTRACT') && getDolGlobalString('TICKET_PRODUCT_CATEGORY') && !empty($object->fk_soc)) { + if (!empty($conf->contract->enabled) && isModEnabled('ticket') && isModEnabled('intervention') && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_TICKET_LINK_CONTRACT') && getDolGlobalString('TICKET_PRODUCT_CATEGORY') && !empty($object->fk_soc)) { $societe = new Societe($this->db); $company_ids = (!getDolGlobalString('WORKFLOW_TICKET_USE_PARENT_COMPANY_CONTRACTS')) ? [$object->fk_soc] : $societe->getParentsForCompany($object->fk_soc, [$object->fk_soc]); @@ -550,7 +550,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers } } // Automatically create intervention - if (isModEnabled('ficheinter') && isModEnabled('ticket') && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_TICKET_CREATE_INTERVENTION')) { + if (isModEnabled('intervention') && isModEnabled('ticket') && !empty($conf->workflow->enabled) && getDolGlobalString('WORKFLOW_TICKET_CREATE_INTERVENTION')) { $fichinter = new Fichinter($this->db); $fichinter->socid = (int) $object->fk_soc; $fichinter->fk_project = (int) $object->fk_project; diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index d3441ebec91..a056d47b48d 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -155,9 +155,9 @@ class InterfaceNotification extends DolibarrTriggers $qualified = 0; } elseif ($element == 'withdraw' && !isModEnabled('prelevement')) { $qualified = 0; - } elseif ($element == 'shipping' && !isModEnabled('expedition')) { + } elseif ($element == 'shipping' && !isModEnabled('delivery_note')) { $qualified = 0; - } elseif ($element == 'member' && !isModEnabled('adherent')) { + } elseif ($element == 'member' && !isModEnabled('member')) { $qualified = 0; } elseif (($element == 'expense_report' || $element == 'expensereport') && !isModEnabled('expensereport')) { $qualified = 0; diff --git a/htdocs/datapolicy/admin/setup.php b/htdocs/datapolicy/admin/setup.php index 5bbfe34f6a1..de7ec5c5b50 100644 --- a/htdocs/datapolicy/admin/setup.php +++ b/htdocs/datapolicy/admin/setup.php @@ -51,7 +51,7 @@ if (getDolGlobalString('DATAPOLICY_USE_SPECIFIC_DELAY_FOR_CONTACT')) { 'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')), ); } -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { $arrayofparameters['Member'] = array( 'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'member', 'class="pictofixedwidth"')), ); diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 218ef5ec4a3..7dccbfbdd44 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (isModEnabled("product") || isModEnabled("service")) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; } -if (isModEnabled('expedition')) { +if (isModEnabled('delivery_note')) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } if (isModEnabled('stock')) { @@ -311,7 +311,7 @@ if ($action == 'create') { * Delivery */ - if ($typeobject == 'commande' && $expedition->origin_id > 0 && isModEnabled('commande')) { + if ($typeobject == 'commande' && $expedition->origin_id > 0 && isModEnabled('order')) { $objectsrc = new Commande($db); $objectsrc->fetch($expedition->origin_id); } @@ -391,7 +391,7 @@ if ($action == 'create') { */ // Document origine - if ($typeobject == 'commande' && $expedition->origin_id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $expedition->origin_id && isModEnabled('order')) { print '
'.$langs->trans("RefOrder").'
'.$langs->trans('Amount').''.price($object->amount, 0, $ print '
'.$langs->trans('Note').''.dol_string_onlythesehtmltags(dol_htmlcleanlastbr($object->note_public)).'
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($project->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'; - if ($origin == 'commande' && isModEnabled('commande')) { + if ($origin == 'commande' && isModEnabled('order')) { print $langs->trans("RefOrder"); } if ($origin == 'propal' && isModEnabled("propal")) { @@ -1869,7 +1869,7 @@ if ($action == 'create') { $totalWeight = $tmparray['weight']; $totalVolume = $tmparray['volume']; - if (!empty($typeobject) && $typeobject === 'commande' && is_object($object->$typeobject) && $object->$typeobject->id && isModEnabled('commande')) { + if (!empty($typeobject) && $typeobject === 'commande' && is_object($object->$typeobject) && $object->$typeobject->id && isModEnabled('order')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } @@ -1920,7 +1920,7 @@ if ($action == 'create') { print ''; // Linked documents - if (!empty($typeobject) && $typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if (!empty($typeobject) && $typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { print ''; print '
'; print $langs->trans("RefOrder").''; @@ -2677,7 +2677,7 @@ if ($action == 'create') { } // Create bill - if (isModEnabled('facture') && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) { + if (isModEnabled('invoice') && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) { if ($user->hasRight('facture', 'creer')) { if (getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0') { print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, ''); diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index e4d0918ea1f..70a7b3a6a2d 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -40,7 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionlinebatch.class.php'; diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 86b3c547e5a..13403d14a3a 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -55,7 +55,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } @@ -191,7 +191,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { print '
'; $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php index 2a72c02ead0..8334b30bdef 100644 --- a/htdocs/expedition/dispatch.php +++ b/htdocs/expedition/dispatch.php @@ -423,7 +423,7 @@ if ($object->id > 0 || !empty($object->ref)) { // Print form confirm print $formconfirm; - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } @@ -474,7 +474,7 @@ if ($object->id > 0 || !empty($object->ref)) { print ''; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { print ''; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -1973,7 +1973,7 @@ if ($action == 'create') { $labeltype = $langs->trans("PaymentType".$objp->payment_code) != "PaymentType".$objp->payment_code ? $langs->trans("PaymentType".$objp->payment_code) : $objp->payment_type; print "\n"; // Bank account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; @@ -2782,7 +2782,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'editline') { } // If bank module is used - if ($user->hasRight('expensereport', 'to_paid') && isModEnabled("banque") && $object->status == ExpenseReport::STATUS_APPROVED) { + if ($user->hasRight('expensereport', 'to_paid') && isModEnabled("bank") && $object->status == ExpenseReport::STATUS_APPROVED) { // Pay if ($remaintopay == 0) { print '
'.$langs->trans('DoPayment').'
'; @@ -2792,7 +2792,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'editline') { } // If bank module is not used - if (($user->hasRight('expensereport', 'to_paid') || empty(isModEnabled("banque"))) && $object->status == ExpenseReport::STATUS_APPROVED) { + if (($user->hasRight('expensereport', 'to_paid') || empty(isModEnabled("bank"))) && $object->status == ExpenseReport::STATUS_APPROVED) { //if ((round($remaintopay) == 0 || !isModEnabled("banque")) && $object->paid == 0) if ($object->paid == 0) { print '"; diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php index d8e650fb88d..464ca7edf60 100644 --- a/htdocs/expensereport/class/api_expensereports.class.php +++ b/htdocs/expensereport/class/api_expensereports.class.php @@ -634,7 +634,7 @@ class ExpenseReports extends DolibarrApi if ($paymentExpenseReport->create(DolibarrApiAccess::$user) < 0) { throw new RestException(500, 'Error creating paymentExpenseReport', array_merge(array($paymentExpenseReport->error), $paymentExpenseReport->errors)); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $paymentExpenseReport->addPaymentToBank( DolibarrApiAccess::$user, 'payment_expensereport', diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index 0bcb616ba36..ca7da95f824 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -533,7 +533,7 @@ class PaymentExpenseReport extends CommonObject $error = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php index caccb13d9d6..8edcfe60ca0 100644 --- a/htdocs/expensereport/payment/card.php +++ b/htdocs/expensereport/payment/card.php @@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/expensereport/class/paymentexpensereport.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/expensereport/modules_expensereport.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expensereport.lib.php'; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } @@ -121,7 +121,7 @@ print '\n"; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; print ''; print '"; // Contract - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $langs->load('contracts'); print ''; print ''; print_liste_field_titre("Ref", $_SERVER['PHP_SELF'], "f.titre", "", "", 'width="200px"', $sortfield, $sortorder, 'left '); print_liste_field_titre("Company", $_SERVER['PHP_SELF'], "s.nom", "", "", 'width="200px"', $sortfield, $sortorder, 'left '); - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { print_liste_field_titre("Contract", $_SERVER['PHP_SELF'], "f.fk_contrat", "", "", 'width="100px"', $sortfield, $sortorder, 'left '); } if (isModEnabled('project')) { @@ -861,7 +861,7 @@ if ($action == 'create') { print ''; } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { print ''; // Contract - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $langs->load('contracts'); print ''; print '"; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Default bank account for payments print '
'; print $langs->trans("RefOrder").''; diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index 50cbd1f0380..1f1f33c6151 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -77,7 +77,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index b1d33238f15..de32d3fc972 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -652,7 +652,7 @@ if ($user->hasRight('user', 'user', 'lire')) { $moreforfilter .= ''; } // If the user can view prospects other than his' -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -663,7 +663,7 @@ if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user- $moreforfilter .= '
'; } -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php index bec93d8c8dc..d05220c1eda 100644 --- a/htdocs/expedition/note.php +++ b/htdocs/expedition/note.php @@ -52,7 +52,7 @@ if ($id > 0 || !empty($ref)) { } // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { $objectsrc = new Commande($db); $objectsrc->fetch($object->$typeobject->id); } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index b8bae69f698..d5bdbdb3fb6 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -1919,7 +1919,7 @@ if ($action == 'create') { // List of payments already done $nbcols = 3; $nbrows = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbrows++; $nbcols++; } @@ -1930,7 +1930,7 @@ if ($action == 'create') { print '
'.$langs->trans('Payments').''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('Amount').'".$labeltype.' '.$objp->num_payment."
'.$langs->trans('Note').'
'.$langs->trans('AccountToDebit').''; diff --git a/htdocs/fichinter/card-rec.php b/htdocs/fichinter/card-rec.php index 1ac2095ad1f..8d4303b9e8d 100644 --- a/htdocs/fichinter/card-rec.php +++ b/htdocs/fichinter/card-rec.php @@ -43,7 +43,7 @@ if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php'; } @@ -267,7 +267,7 @@ llxHeader('', $langs->trans("RepeatableIntervention"), $help_url); $form = new Form($db); $companystatic = new Societe($db); -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $contratstatic = new Contrat($db); } if (isModEnabled('project')) { @@ -302,7 +302,7 @@ if ($action == 'create') { if (isModEnabled('project') && $object->fk_project > 0) { $rowspan++; } - if (isModEnabled('contrat') && $object->fk_contrat > 0) { + if (isModEnabled('contract') && $object->fk_contrat > 0) { $rowspan++; } @@ -355,7 +355,7 @@ if ($action == 'create') { } // Contrat - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $formcontract = new FormContract($db); print "
".$langs->trans("Contract").""; $contractid = GETPOST('contractid') ? GETPOST('contractid') : (!empty($object->fk_contrat) ? $object->fk_contrat : 0) ; @@ -566,7 +566,7 @@ if ($action == 'create') { print '
'.$langs->trans("Description").''.nl2br($object->description)."
'; @@ -827,7 +827,7 @@ if ($action == 'create') { print '
'.$langs->trans("None").''; if ($objp->fk_contrat > 0) { $contratstatic->fetch($objp->fk_contrat); diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 91926349cd9..c5d1ad93933 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -43,7 +43,7 @@ if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT."/core/class/html.formcontract.class.php"; require_once DOL_DOCUMENT_ROOT."/contrat/class/contrat.class.php"; } @@ -813,7 +813,7 @@ if (empty($reshook)) { $form = new Form($db); $formfile = new FormFile($db); -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $formcontract = new FormContract($db); } if (isModEnabled('project')) { @@ -959,7 +959,7 @@ if ($action == 'create') { } // Contract - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $langs->load("contracts"); print '
'.$langs->trans("Contract").''; $numcontrat = $formcontract->select_contract($soc->id, GETPOSTINT('contratid'), 'contratid', 0, 1, 1); @@ -1272,7 +1272,7 @@ if ($action == 'create') { print '
'; @@ -1701,7 +1701,7 @@ if ($action == 'create') { } // Invoicing - if (isModEnabled('facture') && $object->statut > Fichinter::STATUS_DRAFT) { + if (isModEnabled('invoice') && $object->statut > Fichinter::STATUS_DRAFT) { $langs->load("bills"); if ($object->statut < Fichinter::STATUS_BILLED) { if ($user->hasRight('facture', 'creer')) { diff --git a/htdocs/fichinter/index.php b/htdocs/fichinter/index.php index 05d125f0d0a..335d5608727 100644 --- a/htdocs/fichinter/index.php +++ b/htdocs/fichinter/index.php @@ -172,7 +172,7 @@ if ($resql) { /* * Draft orders */ -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $sql = "SELECT f.rowid, f.ref, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; @@ -295,7 +295,7 @@ if ($resql) { * interventions to process */ -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $sql = "SELECT f.rowid, f.ref, f.fk_statut, s.nom as name, s.rowid as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 64da4f12882..ddc8d0c332b 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; if (isModEnabled('project')) { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } @@ -48,7 +48,7 @@ $langs->loadLangs(array('companies', 'bills', 'interventions')); if (isModEnabled('project')) { $langs->load("projects"); } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $langs->load("contracts"); } @@ -226,7 +226,7 @@ $companystatic = new Societe($db); if (isModEnabled('project')) { $projetstatic = new Project($db); } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $contratstatic = new Contrat($db); } @@ -258,7 +258,7 @@ $sql .= " s.nom as name, s.rowid as socid, s.client, s.fournisseur, s.email, s.s if (isModEnabled('project')) { $sql .= ", pr.rowid as projet_id, pr.ref as projet_ref, pr.title as projet_title"; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $sql .= ", c.rowid as contrat_id, c.ref as contrat_ref, c.ref_customer as contrat_ref_customer, c.ref_supplier as contrat_ref_supplier"; } // Add fields from extrafields @@ -278,7 +278,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."fichinter as f"; if (isModEnabled('project')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr on f.fk_projet = pr.rowid"; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contrat as c on f.fk_contrat = c.rowid"; } if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 818b1e5c0cd..56954e78e16 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -37,10 +37,10 @@ require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } if (!empty($conf->accounting->enabled)) { @@ -330,7 +330,7 @@ if ($object->id > 0) { print "
'; print ''; print ''; diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php index c9c674d2c76..00ba4fa8532 100644 --- a/htdocs/fourn/class/api_supplier_invoices.class.php +++ b/htdocs/fourn/class/api_supplier_invoices.class.php @@ -435,7 +435,7 @@ class SupplierInvoices extends DolibarrApi throw new RestException(404, 'Invoice not found'); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if (empty($accountid)) { throw new RestException(400, 'Bank account ID is mandatory'); } @@ -484,7 +484,7 @@ class SupplierInvoices extends DolibarrApi throw new RestException(400, 'Payment error : ' . $paiement->error); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $result = $paiement->addPaymentToBank(DolibarrApiAccess::$user, 'payment_supplier', '(SupplierInvoicePayment)', $accountid, $chqemetteur, $chqbank); if ($result < 0) { $this->db->rollback(); diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 74438fdcc70..059e04db6b7 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1775,7 +1775,7 @@ if ($action == 'create') { print ''; // Bank Account - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') && isModEnabled("bank")) { $langs->load("bank"); print '
'; @@ -397,7 +397,7 @@ if ($object->id > 0) { } // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $langs->load("categories"); print '
'.$langs->trans("SuppliersCategoriesShort").''; @@ -410,7 +410,7 @@ if ($object->id > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Module Adherent - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $langs->load("members"); $langs->load("users"); print '
'.$langs->trans("LinkedToDolibarrMember").'
'.$langs->trans('BankAccount').''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); @@ -2248,7 +2248,7 @@ if ($action == 'create') { } // Bank Account - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER') && isModEnabled("bank")) { print '
'; print ''; // Bank Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print '
'; print $langs->trans('BankAccount'); @@ -2642,7 +2642,7 @@ if ($action == 'create') { // Classify billed manually (need one invoice if module invoice is on, no condition on invoice if not) if ($usercancreate && $object->statut >= 2 && $object->statut != 7 && $object->billed != 1) { // statut 2 means approved - if (!isModEnabled('facture')) { + if (!isModEnabled('invoice')) { print ''.$langs->trans("ClassifyBilled").''; } else { if (!empty($object->linkedObjectsIds['invoice_supplier'])) { diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 9630614fd9d..ab1f551519e 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -1308,7 +1308,7 @@ if ($resql) { $moreforfilter .= ''; } // If the user can view prospects other than his' - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2cab1b323d6..2210f2c1493 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -2667,7 +2667,7 @@ if ($action == 'create') { print '
'.$langs->trans('BankAccount').''; // when bank account is empty (means not override by payment mode form a other object, like third-party), try to use default value print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($fk_account, 'fk_account', 0, '', 1, '', 0, 'maxwidth200 widthcentpercentminusx', 1); @@ -3431,7 +3431,7 @@ if ($action == 'create') { } // Bank Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print '
'; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -3680,7 +3680,7 @@ if ($action == 'create') { print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 59f7d3d7916..5fa0373d095 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -1030,7 +1030,7 @@ if ($user->hasRight("user", "user", "lire")) { $moreforfilter .= ''; } // If the user can view prospects other than his' -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); @@ -1039,7 +1039,7 @@ if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user- $moreforfilter .= '
'; } -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('SuppliersCategoriesShort'); diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 730442f4935..92ac2fa8987 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -226,7 +226,7 @@ if (empty($reshook)) { $error++; } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // If bank module is on, account is required to enter a payment if (GETPOST('accountid') <= 0) { setEventMessages($langs->transnoentities('ErrorFieldRequired', $langs->transnoentities('AccountToCredit')), null, 'errors'); @@ -514,7 +514,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
'; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print '"; diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index a2e0fa51aef..c20ccb99e2c 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -491,7 +491,7 @@ $moreforfilter.= '';*/ // Filter on categories $moreforfilter = ''; -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_KNOWLEDGEMANAGEMENT, $searchCategoryKnowledgemanagementList, 'minwidth300', $searchCategoryKnowledgemanagementList ? $searchCategoryKnowledgemanagementList : 0); /* diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 34f035e9d37..fc41bac9d6b 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -290,7 +290,7 @@ if ($action == 'create') { print ''; // Bank account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index ec0a8dcbe29..b0064f2a62c 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -504,7 +504,7 @@ class PaymentLoan extends CommonObject $error = 0; $this->db->begin(); - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php index 1ec4aacd72d..ec20266337e 100644 --- a/htdocs/loan/payment/card.php +++ b/htdocs/loan/payment/card.php @@ -25,7 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php'; require_once DOL_DOCUMENT_ROOT.'/loan/class/paymentloan.class.php'; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; } @@ -130,7 +130,7 @@ print ''; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { if ($payment->bank_account) { $bankline = new AccountLine($db); $bankline->fetch($payment->bank_line); diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 9e6cda0866d..508d37fcf55 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -106,7 +106,7 @@ if ($action == 'add_payment') { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Date")), null, 'errors'); $error++; } - if (isModEnabled("banque") && !GETPOSTINT('accountid') > 0) { + if (isModEnabled("bank") && !GETPOSTINT('accountid') > 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToCredit")), null, 'errors'); $error++; } diff --git a/htdocs/mailmanspip/class/mailmanspip.class.php b/htdocs/mailmanspip/class/mailmanspip.class.php index b7ef7d99eb9..462e553847e 100644 --- a/htdocs/mailmanspip/class/mailmanspip.class.php +++ b/htdocs/mailmanspip/class/mailmanspip.class.php @@ -306,7 +306,7 @@ class MailmanSpip return -1; } - if (isModEnabled('adherent')) { // Synchro for members + if (isModEnabled('member')) { // Synchro for members if (getDolGlobalString('ADHERENT_MAILMAN_URL')) { if ($listes == '' && getDolGlobalString('ADHERENT_MAILMAN_LISTS')) { $lists = explode(',', getDolGlobalString('ADHERENT_MAILMAN_LISTS')); @@ -376,7 +376,7 @@ class MailmanSpip return -1; } - if (isModEnabled('adherent')) { // Synchro for members + if (isModEnabled('member')) { // Synchro for members if (getDolGlobalString('ADHERENT_MAILMAN_UNSUB_URL')) { if ($listes == '' && getDolGlobalString('ADHERENT_MAILMAN_LISTS')) { $lists = explode(',', getDolGlobalString('ADHERENT_MAILMAN_LISTS')); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4e1867a4f4c..7e41e0b4d40 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2738,7 +2738,7 @@ function printDropdownQuickadd() "title" => "MenuNewMember@members", "name" => "Adherent@members", "picto" => "object_member", - "activation" => isModEnabled('adherent') && $user->hasRight("adherent", "write"), // vs hooking + "activation" => isModEnabled('member') && $user->hasRight("adherent", "write"), // vs hooking "position" => 5, ), array( @@ -2771,7 +2771,7 @@ function printDropdownQuickadd() "title" => "NewOrder@orders", "name" => "Order@orders", "picto" => "object_order", - "activation" => isModEnabled('commande') && $user->hasRight("commande", "write"), // vs hooking + "activation" => isModEnabled('order') && $user->hasRight("commande", "write"), // vs hooking "position" => 40, ), array( @@ -2779,7 +2779,7 @@ function printDropdownQuickadd() "title" => "NewBill@bills", "name" => "Bill@bills", "picto" => "object_bill", - "activation" => isModEnabled('facture') && $user->hasRight("facture", "write"), // vs hooking + "activation" => isModEnabled('invoice') && $user->hasRight("facture", "write"), // vs hooking "position" => 50, ), array( @@ -2787,7 +2787,7 @@ function printDropdownQuickadd() "title" => "NewContractSubscription@contracts", "name" => "Contract@contracts", "picto" => "object_contract", - "activation" => isModEnabled('contrat') && $user->hasRight("contrat", "write"), // vs hooking + "activation" => isModEnabled('contract') && $user->hasRight("contrat", "write"), // vs hooking "position" => 60, ), array( @@ -2827,7 +2827,7 @@ function printDropdownQuickadd() "title" => "NewIntervention@interventions", "name" => "Intervention@interventions", "picto" => "intervention", - "activation" => isModEnabled('ficheinter') && $user->hasRight("ficheinter", "creer"), // vs hooking + "activation" => isModEnabled('intervention') && $user->hasRight("ficheinter", "creer"), // vs hooking "position" => 110, ), array( diff --git a/htdocs/paybox/admin/paybox.php b/htdocs/paybox/admin/paybox.php index 820c29bc2c1..6f82bac1e10 100644 --- a/htdocs/paybox/admin/paybox.php +++ b/htdocs/paybox/admin/paybox.php @@ -227,7 +227,7 @@ print '
'.$langs->trans("Example").': '.$mysoc->n print ''; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print ''; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print '"; //} - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { // Categories print '"; @@ -2988,7 +2988,7 @@ if (getDolGlobalString('PRODUCT_ADD_FORM_ADD_TO') && $object->id && ($action == } // Commande - if (isModEnabled('commande') && $user->hasRight('commande', 'creer')) { + if (isModEnabled('order') && $user->hasRight('commande', 'creer')) { $commande = new Commande($db); $langs->load("orders"); @@ -3008,7 +3008,7 @@ if (getDolGlobalString('PRODUCT_ADD_FORM_ADD_TO') && $object->id && ($action == } // Factures - if (isModEnabled('facture') && $user->hasRight('facture', 'creer')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'creer')) { $invoice = new Facture($db); $langs->load("bills"); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 5b69e98fdd7..e097e270fb3 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5365,7 +5365,7 @@ class Product extends CommonObject } } // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (isModEnabled('category') && !$nofetch) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1); @@ -5865,14 +5865,14 @@ class Product extends CommonObject //dol_syslog("load_virtual_stock"); - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $result = $this->load_stats_commande(0, '1,2', 1); if ($result < 0) { dol_print_error($this->db, $this->error); } $stock_commande_client = $this->stats_commande['qty']; } - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; $filterShipmentStatus = ''; if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')) { diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index f8d5f38a59c..54310e0d759 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -197,7 +197,7 @@ if ($action == 'search') { } $sql .= natural_search($params, $key); } - if (isModEnabled('categorie') && !empty($parent) && $parent != -1) { + if (isModEnabled('category') && !empty($parent) && $parent != -1) { $sql .= " AND cp.fk_categorie ='".$db->escape($parent)."'"; } $sql .= " ORDER BY p.ref ASC"; @@ -625,7 +625,7 @@ if ($id > 0 || !empty($ref)) { print '
'; $rowspan = 1; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $rowspan++; } @@ -638,7 +638,7 @@ if ($id > 0 || !empty($ref)) { print $langs->trans("KeywordFilter").': '; print '   '; print ''; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; print '
'.$langs->trans("CategoryFilter").': '; print $form->select_all_categories(Categorie::TYPE_PRODUCT, $parent, 'parent').'  
'; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 397b1660505..28af89a6246 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -215,7 +215,7 @@ if ((isModEnabled("product") || isModEnabled("service")) && ($user->hasRight("pr } -if (isModEnabled('categorie') && getDolGlobalString('CATEGORY_GRAPHSTATS_ON_PRODUCTS')) { +if (isModEnabled('category') && getDolGlobalString('CATEGORY_GRAPHSTATS_ON_PRODUCTS')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; print '
'; print '
'; diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 119a1be77f3..38e51960c08 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -474,7 +474,7 @@ $moreforfilter.= $langs->trans('MyFilter') . ': '; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index c09fe7a6cbf..008ee43e68a 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -560,14 +560,14 @@ if ($search_categ > 0) { // Filter on categories $moreforfilter = ''; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('ProductsCategoriesShort'), 'category', 'class="pictofixedwidth"'); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1, $langs->trans("ProductsCategoryShort"), 'maxwidth400'); $moreforfilter .= '
'; } // Filter on warehouse categories -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('StockCategoriesShort'), 'category', 'class="pictofixedwidth"'); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_WAREHOUSE, $search_warehouse_categ, 'search_warehouse_categ', 1, $langs->trans("StockCategoriesShort"), 'maxwidth400'); diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php index 7021413e3b8..b9413e921bc 100644 --- a/htdocs/product/stats/card.php +++ b/htdocs/product/stats/card.php @@ -214,7 +214,7 @@ if ($result || !($id > 0)) { print ''; // Tag - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
"; @@ -961,7 +961,7 @@ if ($action == 'create') { } // Tags-Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 672ca04fcba..07ff350b921 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -780,7 +780,7 @@ if ($id > 0 || $ref) { $found = 0; $helpondiff = ''.$langs->trans("StockDiffPhysicTeoric").':
'; // Number of sales orders running - if (isModEnabled('commande')) { + if (isModEnabled('order')) { if ($found) { $helpondiff .= '
'; } else { @@ -795,7 +795,7 @@ if ($id > 0 || $ref) { } // Number of product from sales order already sent (partial shipping) - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; $filterShipmentStatus = ''; if (getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')) { diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 14b8a9b7c45..1adc5d07f47 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -415,7 +415,7 @@ if (getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrep $sql .= ', s.fk_product'; if ($usevirtualstock) { - if (isModEnabled('commande')) { + if (isModEnabled('order')) { $sqlCommandesCli = "(SELECT ".$db->ifsql("SUM(cd1.qty) IS NULL", "0", "SUM(cd1.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlCommandesCli .= " FROM ".MAIN_DB_PREFIX."commandedet as cd1, ".MAIN_DB_PREFIX."commande as c1"; $sqlCommandesCli .= " WHERE c1.rowid = cd1.fk_commande AND c1.entity IN (".getEntity(getDolGlobalString('STOCK_CALCULATE_VIRTUAL_STOCK_TRANSVERSE_MODE') ? 'stock' : 'commande').")"; @@ -425,7 +425,7 @@ if ($usevirtualstock) { $sqlCommandesCli = '0'; } - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { $sqlExpeditionsCli = "(SELECT ".$db->ifsql("SUM(ed2.qty) IS NULL", "0", "SUM(ed2.qty)")." as qty"; // We need the ifsql because if result is 0 for product p.rowid, we must return 0 and not NULL $sqlExpeditionsCli .= " FROM ".MAIN_DB_PREFIX."expedition as e2,"; $sqlExpeditionsCli .= " ".MAIN_DB_PREFIX."expeditiondet as ed2,"; diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 3b6a798fe3a..84cd7ade199 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -878,7 +878,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { $doleditor->Create(); print ''; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { // Categories print ''; // Tags-Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $arrayselected = array(); print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; @@ -1645,13 +1645,13 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { if (!getDolGlobalString('PROJECT_HIDE_CREATE_OBJECT_BUTTON')) { $arrayforbutaction = array( 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("commande"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("facture"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("order"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("invoice"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 40 => array('lang'=>'supplier_proposal', 'enabled'=>isModEnabled("supplier_proposal"), 'perm'=>$user->hasRight('supplier_proposal', 'creer'), 'label' => 'AddSupplierProposal', 'url'=>'/supplier_proposal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 50 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_order"), 'perm'=>$user->hasRight('fournisseur', 'commande', 'creer'), 'label' => 'AddSupplierOrder', 'url'=>'/fourn/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 60 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_invoice"), 'perm'=>$user->hasRight('fournisseur', 'facture', 'creer'), 'label' => 'AddSupplierInvoice', 'url'=>'/fourn/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 70 => array('lang'=>'interventions', 'enabled'=>isModEnabled("ficheinter"), 'perm'=>$user->hasRight('fichinter', 'creer'), 'label' => 'AddIntervention', 'url'=>'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), - 80 => array('lang'=>'contracts', 'enabled'=>isModEnabled("contrat"), 'perm'=>$user->hasRight('contrat', 'creer'), 'label' => 'AddContract', 'url'=>'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 70 => array('lang'=>'interventions', 'enabled'=>isModEnabled("intervention"), 'perm'=>$user->hasRight('fichinter', 'creer'), 'label' => 'AddIntervention', 'url'=>'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), + 80 => array('lang'=>'contracts', 'enabled'=>isModEnabled("contract"), 'perm'=>$user->hasRight('contrat', 'creer'), 'label' => 'AddContract', 'url'=>'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 90 => array('lang'=>'trips', 'enabled'=>isModEnabled("expensereport"), 'perm'=>$user->hasRight('expensereport', 'creer'), 'label' => 'AddTrip', 'url'=>'/expensereport/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), 100 => array('lang'=>'donations', 'enabled'=>isModEnabled("don"), 'perm'=>$user->hasRight('don', 'creer'), 'label' => 'AddDonation', 'url'=>'/don/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid), ); diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php index b8201e7c6e7..48803930572 100644 --- a/htdocs/projet/comment.php +++ b/htdocs/projet/comment.php @@ -174,7 +174,7 @@ print nl2br($object->description); print ''; // Categories -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index 0b76bd6b620..c9c32359711 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -483,7 +483,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 6f519a921e3..dd053b04549 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -41,16 +41,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; if (isModEnabled('agenda')) { require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; } -if (isModEnabled('banque')) { +if (isModEnabled('bank')) { require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php'; } -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; } if (isModEnabled('deplacement')) { @@ -59,17 +59,17 @@ if (isModEnabled('deplacement')) { if (isModEnabled('don')) { require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php'; } -if (isModEnabled('expedition')) { +if (isModEnabled('delivery_note')) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } if (isModEnabled('expensereport')) { require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php'; } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; } if (isModEnabled('loan')) { @@ -110,16 +110,16 @@ if (isModEnabled('stocktransfer')) { // Load translation files required by the page $langs->loadLangs(array('projects', 'companies', 'suppliers', 'compta')); -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $langs->load("bills"); } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { $langs->load("orders"); } if (isModEnabled("propal")) { $langs->load("propal"); } -if (isModEnabled('ficheinter')) { +if (isModEnabled('intervention')) { $langs->load("interventions"); } if (isModEnabled('deplacement')) { @@ -358,7 +358,7 @@ print dol_htmlentitiesbr($object->description); print ''; // Categories -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { print '"; @@ -415,7 +415,7 @@ $listofreferent = array( 'lang'=>'orders', 'buttonnew'=>'CreateOrder', 'testnew'=>$user->hasRight('commande', 'creer'), - 'test'=>isModEnabled('commande') && $user->hasRight('commande', 'lire') + 'test'=>isModEnabled('order') && $user->hasRight('commande', 'lire') ), 'invoice'=>array( 'name'=>"CustomersInvoices", @@ -428,7 +428,7 @@ $listofreferent = array( 'lang'=>'bills', 'buttonnew'=>'CreateBill', 'testnew'=>$user->hasRight('facture', 'creer'), - 'test'=>isModEnabled('facture') && $user->hasRight('facture', 'lire') + 'test'=>isModEnabled('invoice') && $user->hasRight('facture', 'lire') ), 'invoice_predefined'=>array( 'name'=>"PredefinedInvoices", @@ -440,7 +440,7 @@ $listofreferent = array( 'lang'=>'bills', 'buttonnew'=>'CreateBill', 'testnew'=>$user->hasRight('facture', 'creer'), - 'test'=>isModEnabled('facture') && $user->hasRight('facture', 'lire') + 'test'=>isModEnabled('invoice') && $user->hasRight('facture', 'lire') ), 'proposal_supplier'=>array( 'name'=>"SupplierProposals", @@ -489,7 +489,7 @@ $listofreferent = array( 'lang'=>'contracts', 'buttonnew'=>'AddContract', 'testnew'=>$user->hasRight('contrat', 'creer'), - 'test'=>isModEnabled('contrat') && $user->hasRight('contrat', 'lire') + 'test'=>isModEnabled('contract') && $user->hasRight('contrat', 'lire') ), 'intervention'=>array( 'name'=>"Interventions", @@ -503,7 +503,7 @@ $listofreferent = array( 'lang'=>'interventions', 'buttonnew'=>'AddIntervention', 'testnew'=>$user->hasRight('ficheinter', 'creer'), - 'test'=>isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire') + 'test'=>isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire') ), 'shipping'=>array( 'name'=>"Shippings", @@ -515,7 +515,7 @@ $listofreferent = array( 'lang'=>'sendings', 'buttonnew'=>'CreateShipment', 'testnew'=>0, - 'test'=>isModEnabled('expedition') && $user->hasRight('expedition', 'lire') + 'test'=>isModEnabled('delivery_note') && $user->hasRight('expedition', 'lire') ), 'mrp'=>array( 'name'=>"MO", @@ -651,7 +651,7 @@ $listofreferent = array( 'lang'=>'banks', 'buttonnew'=>'AddVariousPayment', 'testnew'=>$user->hasRight('banque', 'modifier'), - 'test'=>isModEnabled("banque") && $user->hasRight('banque', 'lire') && !getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT') + 'test'=>isModEnabled("bank") && $user->hasRight('banque', 'lire') && !getDolGlobalString('BANK_USE_OLD_VARIOUS_PAYMENT') ), /* No need for this, available on dedicated tab "Agenda/Events" 'agenda'=>array( diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index b1f74cc5cbc..63bbbc3ff6e 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -222,7 +222,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index e1fd9a43b35..ddeb182586f 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -37,7 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -178,7 +178,7 @@ $search_date_modif_end = dol_mktime(23, 59, 59, $search_date_modif_endmonth, $se $search_category_array = array(); -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $search_category_array = GETPOST("search_category_".Categorie::TYPE_PROJECT."_list", "array"); } @@ -1123,13 +1123,13 @@ if ($user->hasRight('user', 'user', 'lire')) { } // Filter on categories -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array, 'minwidth300imp minwidth300 widthcentpercentminusx'); } // Filter on customer categories -if (getDolGlobalString('MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST') && isModEnabled("categorie") && $user->hasRight('categorie', 'lire')) { +if (getDolGlobalString('MAIN_SEARCH_CATEGORY_CUSTOMER_ON_PROJECT_LIST') && isModEnabled("category") && $user->hasRight('categorie', 'lire')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_CUSTOMER, $searchCategoryCustomerList, 'minwidth300', $searchCategoryCustomerList ? $searchCategoryCustomerList : 0); /*$moreforfilter .= '
'; diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 98ed8f1b357..d8c6ca3b391 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -672,7 +672,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
"; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index c36cd2e6d30..8363c284ba2 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -258,7 +258,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index abb5653d4e7..3ae0f6d39e5 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -294,7 +294,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 2d0632eea77..33d0ec29877 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -251,7 +251,7 @@ if ($object->id > 0) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index 8cfe753056a..8524b0ccb1e 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -781,7 +781,7 @@ if ($search_all) { $moreforfilter = ''; // Filter on categories -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('ProjectCategories'); @@ -810,7 +810,7 @@ $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form- $moreforfilter .= '
'; // Filter on customer categories -if (getDolGlobalString('MAIN_SEARCH_CATEGORY_CUSTOMER_ON_TASK_LIST') && isModEnabled("categorie") && $user->hasRight('categorie', 'lire')) { +if (getDolGlobalString('MAIN_SEARCH_CATEGORY_CUSTOMER_ON_TASK_LIST') && isModEnabled("category") && $user->hasRight('categorie', 'lire')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_CUSTOMER, $searchCategoryCustomerList, 'minwidth300', $searchCategoryCustomerList ? $searchCategoryCustomerList : 0); /* diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index 1f54ef3f26d..5ef996d2ae5 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -241,7 +241,7 @@ if ($object->id > 0) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index ca98bc5330b..d9face5c16a 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -367,7 +367,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 6065cda5c24..e55a8f4fd3d 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1049,7 +1049,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '"; @@ -1110,7 +1110,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser //'builddoc'=>$langs->trans("PDFMerge"), ); } - if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'creer')) { + if (isModEnabled('intervention') && $user->hasRight('ficheinter', 'creer')) { $langs->load("interventions"); $arrayofmassactions['generateinter'] = $langs->trans("GenerateInter"); } diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 5fb856036fe..9d2c29f6068 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -81,7 +81,7 @@ $error = 0; $langs->loadLangs(array("main", "members", "companies", "install", "other", "errors")); // Security check -if (!isModEnabled('adherent')) { +if (!isModEnabled('member')) { httponly_accessforbidden('Module Membership not enabled'); } diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index 65b6065a698..ead24c23bd1 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -53,7 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Security check -if (!isModEnabled('adherent')) { +if (!isModEnabled('member')) { httponly_accessforbidden('Module Membership not enabled'); } diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index b9b388a718b..a39d3670b03 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -49,7 +49,7 @@ if (is_numeric($entity)) { require '../../main.inc.php'; // Security check -if (!isModEnabled('adherent')) { +if (!isModEnabled('member')) { httponly_accessforbidden('Module Membership not enabled'); } diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index fc9d9acd0d4..d31715b03ca 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -591,11 +591,11 @@ if ($ispaymentok) { $emetteur_banque = ''; // Define default choice for complementary actions $option = ''; - if (getDolGlobalString('ADHERENT_BANK_USE') == 'bankviainvoice' && isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) { + if (getDolGlobalString('ADHERENT_BANK_USE') == 'bankviainvoice' && isModEnabled("bank") && isModEnabled("societe") && isModEnabled('invoice')) { $option = 'bankviainvoice'; - } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'bankdirect' && isModEnabled("banque")) { + } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'bankdirect' && isModEnabled("bank")) { $option = 'bankdirect'; - } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'invoiceonly' && isModEnabled("banque") && isModEnabled("societe") && isModEnabled('facture')) { + } elseif (getDolGlobalString('ADHERENT_BANK_USE') == 'invoiceonly' && isModEnabled("bank") && isModEnabled("societe") && isModEnabled('invoice')) { $option = 'invoiceonly'; } if (empty($option)) { @@ -905,7 +905,7 @@ if ($ispaymentok) { } } - if (!$error && isModEnabled("banque")) { + if (!$error && isModEnabled("bank")) { $bankaccountid = 0; if ($paymentmethod == 'paybox') { $bankaccountid = getDolGlobalString('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS'); @@ -994,7 +994,7 @@ if ($ispaymentok) { } // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $invoice = new Facture($db); @@ -1033,7 +1033,7 @@ if ($ispaymentok) { } } - if (!$error && isModEnabled("banque")) { + if (!$error && isModEnabled("bank")) { $bankaccountid = 0; if ($paymentmethod == 'paybox') { $bankaccountid = getDolGlobalString('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS'); @@ -1170,7 +1170,7 @@ if ($ispaymentok) { } } - if (!$error && isModEnabled("banque")) { + if (!$error && isModEnabled("bank")) { $bankaccountid = 0; if ($paymentmethod == 'paybox') { $bankaccountid = getDolGlobalString('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS'); @@ -1300,7 +1300,7 @@ if ($ispaymentok) { } } - if (!$error && isModEnabled("banque")) { + if (!$error && isModEnabled("bank")) { $bankaccountid = 0; if ($paymentmethod == 'paybox') { $bankaccountid = getDolGlobalString('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS'); @@ -1530,7 +1530,7 @@ if ($ispaymentok) { } } - if (!$error && isModEnabled("banque")) { + if (!$error && isModEnabled("bank")) { $bankaccountid = 0; if ($paymentmethod == 'paybox') { $bankaccountid = getDolGlobalString('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS'); @@ -1702,7 +1702,7 @@ if ($ispaymentok) { $contract_lines = (array_key_exists('COL', $tmptag) && $tmptag['COL'] > 0) ? $tmptag['COL'] : null; // Do action only if $FinalPaymentAmt is set (session variable is cleaned after this page to avoid duplicate actions when page is POST a second time) - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { if (!empty($FinalPaymentAmt) && $paymentTypeId > 0) { include_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $invoice = new Facture($db); @@ -1741,7 +1741,7 @@ if ($ispaymentok) { } } - if (!$error && isModEnabled("banque")) { + if (!$error && isModEnabled("bank")) { $bankaccountid = 0; if ($paymentmethod == 'paybox') { $bankaccountid = getDolGlobalString('PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS'); diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index 93825adf77a..3888b247006 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -466,7 +466,7 @@ if ($event->type == 'payout.created') { } } - if (!$error && isModEnabled('banque')) { + if (!$error && isModEnabled('bank')) { // Search again the payment to see if it is already linked to a bank payment record (We should always find the payment that was created before). $ispaymentdone = 0; $sql = "SELECT p.rowid, p.fk_bank FROM llx_paiement as p"; diff --git a/htdocs/public/webportal/tpl/home.tpl.php b/htdocs/public/webportal/tpl/home.tpl.php index a0c201ca6dc..e1c83c75f3a 100644 --- a/htdocs/public/webportal/tpl/home.tpl.php +++ b/htdocs/public/webportal/tpl/home.tpl.php @@ -18,13 +18,13 @@ global $conf, $langs; getControllerUrl('propallist') . '" title="' . $langs->trans('WebPortalPropalListDesc') . '">' . $langs->trans('WebPortalPropalListTitle') . ''; ?> - + - +
'; print $langs->trans('BankAccount'); @@ -3609,7 +3609,7 @@ if ($action == 'create') { if (isModEnabled('project')) { $nbrows++; } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbrows++; $nbcols++; } @@ -3651,7 +3651,7 @@ if ($action == 'create') { print ''.($object->type == FactureFournisseur::TYPE_CREDIT_NOTE ? $langs->trans("PaymentsBack") : $langs->trans('Payments')).''.$langs->trans('Date').''.$langs->trans('Type').''.$langs->trans('BankAccount').''.$langs->trans('Amount').''; print $s; print '
'.$langs->trans('PaymentMode').''; $form->select_types_paiements(!GETPOST('paiementid') ? $obj->fk_mode_reglement : GETPOST('paiementid'), 'paiementid'); print '
'.$langs->trans('Account').''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); print $form->select_comptes(empty($accountid) ? $obj->fk_account : $accountid, 'accountid', 0, '', 2, '', 0, 'widthcentpercentminusx maxwidth500', 1); diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php index 19f94afdd9b..d4ad615ee18 100644 --- a/htdocs/fourn/paiement/card.php +++ b/htdocs/fourn/paiement/card.php @@ -231,7 +231,7 @@ if ($result > 0) { $allow_delete = 1; // Bank account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if ($object->fk_account) { $bankline = new AccountLine($db); $bankline->fetch($object->bank_line); diff --git a/htdocs/fourn/paiement/document.php b/htdocs/fourn/paiement/document.php index 6bdecf49b37..540ef560f3c 100644 --- a/htdocs/fourn/paiement/document.php +++ b/htdocs/fourn/paiement/document.php @@ -130,7 +130,7 @@ if ($object->id > 0) { $allow_delete = 1; // Bank account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { if ($object->fk_account) { $bankline = new AccountLine($db); $bankline->fetch($object->bank_line); diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 835025ebd38..49c9a20a1c4 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -102,7 +102,7 @@ $arrayfields = array( 's.nom' =>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30), 'c.libelle' =>array('label'=>"Type", 'checked'=>1, 'position'=>40), 'p.num_paiement' =>array('label'=>"Numero", 'checked'=>1, 'position'=>50, 'tooltip'=>"ChequeOrTransferNumber"), - 'ba.label' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled("banque"))), + 'ba.label' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>60, 'enable'=>(isModEnabled("bank"))), 'p.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>70), ); $arrayfields = dol_sort_array($arrayfields, 'position'); diff --git a/htdocs/index.php b/htdocs/index.php index 516afe06f43..0cb2d4a260c 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -206,7 +206,7 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) { } // Number of sales orders - if (isModEnabled('commande') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('commande', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; $board = new Commande($db); // Number of customer orders to be shipped (validated and in progress) @@ -228,7 +228,7 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) { } // Number of contract / services enabled (delayed) - if (isModEnabled('contrat') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CONTRACT') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CONTRACT') && $user->hasRight('contrat', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; $board = new Contrat($db); $dashboardlines[$board->element.'_inactive'] = $board->load_board($user, "inactive"); @@ -246,7 +246,7 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) { } // Number of invoices customers (paid) - if (isModEnabled('facture') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && !getDolGlobalString('MAIN_DISABLE_BLOCK_CUSTOMER') && $user->hasRight('facture', 'lire')) { include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $board = new Facture($db); $dashboardlines[$board->element] = $board->load_board($user); @@ -260,7 +260,7 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) { } // Number of transactions to conciliate - if (isModEnabled('banque') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) { + if (isModEnabled('bank') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) { include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $board = new Account($db); $nb = $board->countAccountToReconcile(); // Get nb of account to reconciliate @@ -271,7 +271,7 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) { // Number of cheque to send - if (isModEnabled('banque') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) { + if (isModEnabled('bank') && !getDolGlobalString('MAIN_DISABLE_BLOCK_BANK') && $user->hasRight('banque', 'lire') && !$user->socid) { if (!getDolGlobalString('BANK_DISABLE_CHECK_DEPOSIT')) { include_once DOL_DOCUMENT_ROOT . '/compta/paiement/cheque/class/remisecheque.class.php'; $board = new RemiseCheque($db); @@ -290,7 +290,7 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD')) { } // Number of foundation members - if (isModEnabled('adherent') && !getDolGlobalString('MAIN_DISABLE_BLOCK_ADHERENT') && $user->hasRight('adherent', 'lire') && !$user->socid) { + if (isModEnabled('member') && !getDolGlobalString('MAIN_DISABLE_BLOCK_ADHERENT') && $user->hasRight('adherent', 'lire') && !$user->socid) { include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $board = new Adherent($db); $dashboardlines[$board->element.'_shift'] = $board->load_board($user, 'shift'); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 9941d21ce26..f7d513d4e3f 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -2040,7 +2040,7 @@ function migrate_modeles($db, $langs, $conf) dolibarr_install_syslog("upgrade2::migrate_modeles"); - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { include_once DOL_DOCUMENT_ROOT.'/core/modules/facture/modules_facture.php'; $modellist = ModelePDFFactures::liste_modeles($db); if (count($modellist) == 0) { @@ -2053,7 +2053,7 @@ function migrate_modeles($db, $langs, $conf) } } - if (isModEnabled('commande')) { + if (isModEnabled('order')) { include_once DOL_DOCUMENT_ROOT.'/core/modules/commande/modules_commande.php'; $modellist = ModelePDFCommandes::liste_modeles($db); if (count($modellist) == 0) { @@ -2066,7 +2066,7 @@ function migrate_modeles($db, $langs, $conf) } } - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { include_once DOL_DOCUMENT_ROOT.'/core/modules/expedition/modules_expedition.php'; $modellist = ModelePdfExpedition::liste_modeles($db); if (count($modellist) == 0) { diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 6ed03ae11f5..b8148c97f43 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -746,7 +746,7 @@ class KnowledgeRecord extends CommonObject $labellang = ($this->lang ? $langs->trans('Language_'.$this->lang) : ''); $datas['lang'] = '
'.$langs->trans('Language').': ' . picto_from_langcode($this->lang, 'class="paddingrightonly saturatemedium opacitylow"') . $labellang; // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (isModEnabled('category') && !$nofetch) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1); diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index b44d5c3e5c5..1fa1a8a20f1 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -191,7 +191,7 @@ if ($action == 'create') { include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php'; $object->fields['answer']['enabled'] = 1; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1); if (count($cate_arbo)) { @@ -248,7 +248,7 @@ if (($id || $ref) && $action == 'edit') { include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php'; $object->fields['answer']['enabled'] = 1; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 1); if (count($cate_arbo)) { @@ -433,7 +433,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $object->fields['answer']['enabled'] = 1; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1); print "
'.$langs->trans("Label").'
'.$langs->trans("BankAccount").''; $form->select_comptes(GETPOST("accountid"), "accountid", 0, "courant=1", 1); // Show list of bank account with courant print '
'.$langs->trans('NotePrivate').''.nl2br($payment->note_p print '
'.$langs->trans('NotePublic').''.nl2br($payment->note_public).'
'; print $langs->trans("BankAccount").''; $form->select_comptes($conf->global->PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYBOX_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1); diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index 83fa2eecf3b..305a9960abf 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -245,7 +245,7 @@ print ''.$langs->trans("Example").': '.$mysoc->name.''; print '
'; print $langs->trans("BankAccount").''; print img_picto('', 'bank_account').' '; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index cae180fd850..d9a95678e81 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -60,10 +60,10 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (isModEnabled('propal')) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } if (isModEnabled('accounting')) { @@ -83,7 +83,7 @@ $langs->loadLangs(array('products', 'other')); if (isModEnabled('stock')) { $langs->load("stocks"); } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $langs->load("bills"); } if (isModEnabled('productbatch')) { @@ -1685,7 +1685,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1); @@ -2295,7 +2295,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Tags-Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', 'parent', 64, 0, 1); $c = new Categorie($db); @@ -2825,7 +2825,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PRODUCT, 1); print "
'.$langs->trans("Categories").''; $moreforfilter .= img_picto($langs->trans("Categories"), 'category', 'class="pictofixedwidth"'); $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1, 1, 'widthcentpercentminusx maxwidth400'); @@ -368,7 +368,7 @@ if ($result || !($id > 0)) { 'label' => $langs->transnoentitiesnoconv($arrayforlabel[$mode], $langs->transnoentitiesnoconv("SuppliersOrders"))); } - if (isModEnabled('facture')) { + if (isModEnabled('invoice')) { $graphfiles['invoices'] = array('modulepart'=>'productstats_invoices', 'file' => $object->id.'/invoices12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png', 'label' => $langs->transnoentitiesnoconv($arrayforlabel[$mode], $langs->transnoentitiesnoconv("Invoices"))); @@ -380,7 +380,7 @@ if ($result || !($id > 0)) { 'label' => $langs->transnoentitiesnoconv($arrayforlabel[$mode], $langs->transnoentitiesnoconv("SupplierInvoices"))); } - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $graphfiles['contracts'] = array('modulepart'=>'productstats_contracts', 'file' => $object->id.'/contracts12m'.((string) $type != '' ? '_type'.$type : '').'_'.$mode.($search_year > 0 ? '_year'.$search_year : '').'.png', 'label' => $langs->transnoentitiesnoconv($arrayforlabel[$mode], $langs->transnoentitiesnoconv("Contracts"))); diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 9225e9aebd8..1a4aedaefa6 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -382,7 +382,7 @@ if ($action == 'create') { // Other attributes include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { // Categories print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_WAREHOUSE, '', 'parent', 64, 0, 1); @@ -555,7 +555,7 @@ if ($action == 'create') { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_WAREHOUSE, 1); print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_WAREHOUSE, '', 'parent', 64, 0, 1); $c = new Categorie($db); diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 5e7bb9e8c6d..010d657cb93 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -737,7 +737,7 @@ class Entrepot extends CommonObject $datas['locationsummary'] = '
'.$langs->trans('LocationSummary').': '.$this->lieu; } // show categories for this record only in ajax to not overload lists - if (!$nofetch && isModEnabled('categorie')) { + if (!$nofetch && isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories_warehouse'] = '
' . $form->showCategories($this->id, Categorie::TYPE_WAREHOUSE, 1, 1); diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 931da124450..5eab969d4ce 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -29,7 +29,7 @@ // Load Dolibarr environment require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -55,7 +55,7 @@ $search_label = GETPOST("snom", "alpha") ? GETPOST("snom", "alpha") : GETPOST("s $search_status = GETPOSTINT("search_status"); $search_category_list = array(); -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $search_category_list = GETPOST("search_category_".Categorie::TYPE_WAREHOUSE."_list", "array"); } @@ -496,7 +496,7 @@ if ($search_all) { $moreforfilter = ''; -if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { +if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_WAREHOUSE, $search_category_list); } diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 9eff95f02b0..234271ac2fb 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -939,7 +939,7 @@ if ($warehouse->id > 0) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php'; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($warehouse->id, Categorie::TYPE_WAREHOUSE, 1); print "
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); @@ -1270,7 +1270,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { print '
'.$langs->trans("Categories").''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_PROJECT, '', 'parent', 64, 0, 1); @@ -1442,7 +1442,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_PROJECT, 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'.$langs->trans("Categories").''; print $form->showCategories($projectstatic->id, 'project', 1); print "
' . $langs->trans("Categories") . ''; print $form->showCategories($projectstatic->id, 'project', 1); print "
'; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { print ''; print '
'; print $langs->trans("RefOrder").''; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index ee2587cc04e..2ab50c297f4 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonincoterm.class.php'; if (isModEnabled("propal")) { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; } -if (isModEnabled('commande')) { +if (isModEnabled('order')) { require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; } diff --git a/htdocs/reception/dispatch.php b/htdocs/reception/dispatch.php index a212ad31953..ab5e4dc9972 100644 --- a/htdocs/reception/dispatch.php +++ b/htdocs/reception/dispatch.php @@ -389,7 +389,7 @@ if ($id > 0 || !empty($ref)) { print ''; // Linked documents - if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('commande')) { + if ($typeobject == 'commande' && $object->$typeobject->id && isModEnabled('order')) { print ''; print ''."\n"; // Date payment // Bank - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; // Number - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Number print ''; // Default Bank Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print '
'; print $langs->trans("RefOrder").''; diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index ebe929ffc6c..a44e82e6eb9 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -282,7 +282,7 @@ if ($action == 'add' && empty($cancel)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors'); $error++; } - if (isModEnabled("banque") && !empty($auto_create_paiement) && !$object->accountid > 0) { + if (isModEnabled("bank") && !empty($auto_create_paiement) && !$object->accountid > 0) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")), null, 'errors'); $error++; } @@ -622,7 +622,7 @@ if ($action == 'create' && $permissiontoadd) { print '
'; print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).''; print img_picto('', 'bank_account', 'class="paddingrighonly"'); @@ -650,7 +650,7 @@ if ($action == 'create' && $permissiontoadd) { print '
'; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -1032,7 +1032,7 @@ if ($id > 0) { print '\n"; $labeltype = $langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "\n"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; diff --git a/htdocs/salaries/class/api_salaries.class.php b/htdocs/salaries/class/api_salaries.class.php index 693c1978b31..fad592803c4 100644 --- a/htdocs/salaries/class/api_salaries.class.php +++ b/htdocs/salaries/class/api_salaries.class.php @@ -330,7 +330,7 @@ class Salaries extends DolibarrApi if ($paymentsalary->create(DolibarrApiAccess::$user, 1) < 0) { throw new RestException(500, 'Error creating paymentsalary', array_merge(array($paymentsalary->error), $paymentsalary->errors)); } - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $paymentsalary->addPaymentToBank( DolibarrApiAccess::$user, 'payment_salary', @@ -444,7 +444,7 @@ class Salaries extends DolibarrApi { $paymentsalary = array(); $fields = Salaries::$FIELDSPAYMENT; - if (isModEnabled("banque")) array_push($fields, "accountid"); + if (isModEnabled("bank")) array_push($fields, "accountid"); foreach ($fields as $field) { if (!isset($data[$field])) { throw new RestException(400, "$field field missing"); diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 7c27aa44b28..ef54b12b43a 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -596,7 +596,7 @@ class PaymentSalary extends CommonObject $error = 0; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $acc = new Account($this->db); diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index d8569747e30..91f57d2d880 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -527,7 +527,7 @@ print $form->select_types_paiements($search_type_id, 'search_type_id', '', 0, 1, print ''; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print ''; @@ -581,7 +581,7 @@ print_liste_field_titre("Employee", $_SERVER["PHP_SELF"], "u.lastname", "", $par $totalarray['nbfield']++; print_liste_field_titre("DefaultPaymentMode", $_SERVER["PHP_SELF"], "type", "", $param, 'class="left"', $sortfield, $sortorder); $totalarray['nbfield']++; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print_liste_field_titre("DefaultBankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); $totalarray['nbfield']++; } @@ -731,7 +731,7 @@ while ($i < $imaxinloop) { } // Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php index 2fda40dddc6..6e5b19c857e 100644 --- a/htdocs/salaries/paiement_salary.php +++ b/htdocs/salaries/paiement_salary.php @@ -78,7 +78,7 @@ if (($action == 'add_payment' || ($action == 'confirm_paiement' && $confirm == ' $error++; $action = 'create'; } - if (isModEnabled("banque") && !(GETPOSTINT("accountid") > 0)) { + if (isModEnabled("bank") && !(GETPOSTINT("accountid") > 0)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("AccountToDebit")), null, 'errors'); $error++; $action = 'create'; diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php index 2d84cace617..16dc023c176 100644 --- a/htdocs/salaries/payment_salary/card.php +++ b/htdocs/salaries/payment_salary/card.php @@ -172,7 +172,7 @@ print ''; // Bank account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { if ($object->bank_account) { $bankline = new AccountLine($db); $bankline->fetch($object->bank_line); diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index a00707b039b..2b77863cb04 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -482,7 +482,7 @@ print ''; // Chq number print ''; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { // Bank transaction print ''; // Default Bank Account -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print '
'; print $langs->trans('DefaultBankAccount'); @@ -974,7 +974,7 @@ if ($id > 0) { print '
'; $nbcols = 3; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $nbcols++; } @@ -1008,7 +1008,7 @@ if ($id > 0) { print '
'.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans('BankAccount').''.$langs->trans("Amount").''.dol_print_date($db->jdate($objp->dp), 'dayhour', 'tzuserrel')."".$labeltype.' '.$objp->num_payment."'; print $form->select_comptes($search_account, 'search_account', 0, '', 1, '', 0, 'maxwidth125', 1); print ''; if ($obj->fk_account > 0) { //$accountstatic->fetch($obj->fk_bank); @@ -820,7 +820,7 @@ if ($num == 0) { } }*/ $colspan = 9; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $colspan++; } print '
'.$langs->trans("NoRecordFound").'
'.$langs->trans('Amount').''.price($object->amount, 0, $ print '
'.$langs->trans('Note').''.dol_string_onlythesehtmltags(dol_htmlcleanlastbr($object->note_private)).'
'; print ''; @@ -539,7 +539,7 @@ print_liste_field_titre("PaymentMode", $_SERVER["PHP_SELF"], "pst.code", "", $pa $totalarray['nbfield']++; print_liste_field_titre("Numero", $_SERVER["PHP_SELF"], "s.num_payment", "", $param, '', $sortfield, $sortorder, '', 'ChequeOrTransferNumber'); $totalarray['nbfield']++; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print_liste_field_titre("BankTransactionLine", $_SERVER["PHP_SELF"], "s.fk_bank", "", $param, '', $sortfield, $sortorder); $totalarray['nbfield']++; print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder); @@ -702,7 +702,7 @@ while ($i < $imaxinloop) { } // Account - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { // Bank transaction print ''; $accountlinestatic->id = $obj->fk_bank; diff --git a/htdocs/salaries/virement_request.php b/htdocs/salaries/virement_request.php index b640d1f3c58..2c9b444655e 100644 --- a/htdocs/salaries/virement_request.php +++ b/htdocs/salaries/virement_request.php @@ -313,7 +313,7 @@ if ($action == 'editmode') { print '
'; print ''; print ''; print ''; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { print ''; } print ''; @@ -391,7 +391,7 @@ if ($resql) { print '\n"; $labeltype = $langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type; print "\n"; - if (isModEnabled("banque")) { + if (isModEnabled("bank")) { $bankaccountstatic->id = $objp->baid; $bankaccountstatic->ref = $objp->baref; $bankaccountstatic->label = $objp->baref; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index b432cd98235..1000eaf142a 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -874,7 +874,7 @@ if (getDolGlobalString('CONTACT_SHOW_EMAIL_PHONE_TOWN_SELECTLIST')) { print ''; print ''; -if (isModEnabled("expedition")) { +if (isModEnabled("delivery_note")) { if (getDolGlobalInt('MAIN_FEATURES_LEVEL') > 0) { // Visible on experimental only because seems to not be implemented everywhere (only on proposal) print ''; print ''; diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index a98680cfeb9..5125bfdc389 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -345,7 +345,7 @@ abstract class ActionsCardCommon } // Linked member - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $langs->load("members"); $adh = new Adherent($this->db); $result = $adh->fetch('', '', $this->object->id); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ef713898c70..facb6cc3d9c 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } if (isModEnabled('accounting')) { @@ -77,10 +77,10 @@ if ($mysoc->country_code == 'GR') { $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { $langs->load("members"); } -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $langs->load("categories"); } if (isModEnabled('incoterm')) { @@ -1692,7 +1692,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $langs->load('categories'); // Customer @@ -2446,7 +2446,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio } // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { // Customer print ''; print ''; // Bank Account - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) { print ''; } // Shipping Method - if (isModEnabled("expedition")) { + if (isModEnabled("delivery_note")) { print ''; }*/ - if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("banque")) { + if (getDolGlobalString('BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL') && isModEnabled("bank")) { // Bank Account print ''; // Timing (Duration sum of linked fichinter) - if (isModEnabled('ficheinter')) { + if (isModEnabled('intervention')) { $object->fetchObjectLinked(); $num = count($object->linkedObjects); $timing = 0; @@ -1197,7 +1197,7 @@ if ($action == 'create' || $action == 'presend') { print ''; // Categories - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { print '
'; print '
'; print $langs->trans('DefaultBankAccount'); @@ -375,7 +375,7 @@ if ($resql) { print ''.$langs->trans("RefPayment").''.$langs->trans("Date").''.$langs->trans("Type").''.$langs->trans('BankAccount').''.$langs->trans("Amount").''.dol_print_date($db->jdate($objp->dp), 'dayhour', 'tzuserrel')."".$labeltype.' '.$objp->num_payment."
'.$langs->trans("AskForPreferredShippingMethod").'
'.$form->editfieldkey('CustomersCategoriesShort', 'custcats', '', $object, 0).''; @@ -2902,7 +2902,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print ''; // Tags / categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { // Customer if ($object->prospect || $object->client || getDolGlobalString('THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT')) { print ''; @@ -3069,7 +3069,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio include DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'; // Module Adherent - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $langs->load("members"); print ''; print '
'.$langs->trans("CustomersCategoriesShort").'
'.$langs->trans("LinkedToDolibarrMember").''; @@ -3145,7 +3145,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?socid='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd); - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $adh = new Adherent($db); $result = $adh->fetch('', '', $object->id); if ($result == 0 && ($object->client == 1 || $object->client == 3) && getDolGlobalString('MEMBER_CAN_CONVERT_CUSTOMERS_TO_MEMBERS')) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 3405b222938..118dca102bf 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1664,7 +1664,7 @@ class Societe extends CommonObject if (!$error && $nbrowsaffected) { // Update information on linked member if it is an update - if (!$nosyncmember && isModEnabled('adherent')) { + if (!$nosyncmember && isModEnabled('member')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; dol_syslog(get_class($this)."::update update linked member"); @@ -2835,7 +2835,7 @@ class Societe extends CommonObject $datas['accountancycustomercode'] = '
'.$langs->trans('CustomerAccountancyCode').': '.($this->code_compta ? $this->code_compta : $this->code_compta_client); } // show categories for this record only in ajax to not overload lists - if (!$nofetch && isModEnabled('categorie') && $this->client) { + if (!$nofetch && isModEnabled('category') && $this->client) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories_customer'] = '
' . $form->showCategories($this->id, Categorie::TYPE_CUSTOMER, 1, 1); @@ -2848,7 +2848,7 @@ class Societe extends CommonObject $datas['accountancysuppliercode'] = '
'.$langs->trans('SupplierAccountancyCode').': '.$this->code_compta_fournisseur; } // show categories for this record only in ajax to not overload lists - if (!$nofetch && isModEnabled('categorie') && $this->fournisseur) { + if (!$nofetch && isModEnabled('category') && $this->fournisseur) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories_supplier'] = '
' . $form->showCategories($this->id, Categorie::TYPE_SUPPLIER, 1, 1); diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 6da2a9aa73c..8a828fb6c39 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -172,18 +172,18 @@ if ($object->client) { if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } } -if (isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire')) { +if (isModEnabled('intervention') && $user->hasRight('ficheinter', 'lire')) { $elementTypeArray['fichinter'] = $langs->transnoentitiesnoconv('Interventions'); } diff --git a/htdocs/societe/contact.php b/htdocs/societe/contact.php index 3f121f52749..1fd810a9793 100644 --- a/htdocs/societe/contact.php +++ b/htdocs/societe/contact.php @@ -43,14 +43,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } // Load translation files required by the page $langs->loadLangs(array("companies", "commercial", "bills", "banks", "users")); -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { $langs->load("categories"); } if (isModEnabled('incoterm')) { diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index d9dd58c3887..3f008867bd3 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -203,7 +203,7 @@ $thirdpartygraph .= '
'; $thirdpartygraph .= ''; $thirdpartycateggraph = ''; -if (isModEnabled('categorie') && getDolGlobalString('CATEGORY_GRAPHSTATS_ON_THIRDPARTIES')) { +if (isModEnabled('category') && getDolGlobalString('CATEGORY_GRAPHSTATS_ON_THIRDPARTIES')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $elementtype = 'societe'; diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 2ef9b22fe40..1864043e62b 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/client.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcategory.class.php'; } @@ -1214,14 +1214,14 @@ if ($search_all) { // Filter on categories $moreforfilter = ''; if (empty($type) || $type == 'c' || $type == 'p') { - if (isModEnabled('categorie') && $user->hasRight('categorie', 'read')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'read')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_CUSTOMER, $searchCategoryCustomerList, 'minwidth300', $searchCategoryCustomerOperator ? $searchCategoryCustomerOperator : 0); } } if (empty($type) || $type == 'f') { - if (isModEnabled("fournisseur") && isModEnabled('categorie') && $user->hasRight('categorie', 'read')) { + if (isModEnabled("fournisseur") && isModEnabled('category') && $user->hasRight('categorie', 'read')) { $formcategory = new FormCategory($db); $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_SUPPLIER, $searchCategorySupplierList, 'minwidth300', $searchCategorySupplierOperator ? $searchCategorySupplierOperator : 0); } diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 6af4a946941..665a76d03da 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -972,13 +972,13 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (isModEnabled("propal") && $user->hasRight('propal', 'lire')) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } @@ -1068,13 +1068,13 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' if (isModEnabled('propal') && $user->hasRight('propal', 'lire')) { $elementTypeArray['propal'] = $langs->transnoentitiesnoconv('Proposals'); } - if (isModEnabled('commande') && $user->hasRight('commande', 'lire')) { + if (isModEnabled('order') && $user->hasRight('commande', 'lire')) { $elementTypeArray['order'] = $langs->transnoentitiesnoconv('Orders'); } - if (isModEnabled('facture') && $user->hasRight('facture', 'lire')) { + if (isModEnabled('invoice') && $user->hasRight('facture', 'lire')) { $elementTypeArray['invoice'] = $langs->transnoentitiesnoconv('Invoices'); } - if (isModEnabled('contrat') && $user->hasRight('contrat', 'lire')) { + if (isModEnabled('contract') && $user->hasRight('contrat', 'lire')) { $elementTypeArray['contract'] = $langs->transnoentitiesnoconv('Contracts'); } } diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 70db93aebc8..3dc6e26dee1 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -205,7 +205,7 @@ if ($id > 0 || !empty($ref)) { } // additional list with adherents of company - if (isModEnabled('adherent') && $user->hasRight('adherent', 'lire')) { + if (isModEnabled('member') && $user->hasRight('adherent', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 2500d9d00e1..e8fc5bf25d1 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1321,14 +1321,14 @@ if ($action == 'create') { print '
'.$langs->trans('BankAccount').''; $form->select_comptes(GETPOST('fk_account') > 0 ? GETPOSTINT('fk_account') : $fk_account, 'fk_account', 0, '', 1); print '
'.$langs->trans('SendingMethod').''; print img_picto('', 'dolly', 'class="pictofixedwidth"'); $form->selectShippingMethod(GETPOST('shipping_method_id') > 0 ? GETPOSTINT('shipping_method_id') : "", 'shipping_method_id', '', 1); @@ -1791,7 +1791,7 @@ if ($action == 'create') { print '
'; print ''; $atleastonefound = 0; -if (isModEnabled("banque")) { +if (isModEnabled("bank")) { print ''; print ''; print '
'; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 3916568fcd1..3fb07664ffa 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -696,7 +696,7 @@ if ($resql) { $moreforfilter .= ''; } // If the user can view products - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) { include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('IncludingProductWithTag'); diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 469c96e90da..f417c2a9988 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -216,7 +216,7 @@ print ajax_constantonoff("TAKEPOS_FORBID_SALES_TO_DEFAULT_CUSTOMER", array(), $c print '
'.$langs->trans("CashDeskBankAccountForSell").''; print img_picto('', 'bank_account', 'class="pictofixedwidth"'); @@ -527,7 +527,7 @@ print '
'; print ''; -if ($atleastonefound == 0 && isModEnabled("banque")) { +if ($atleastonefound == 0 && isModEnabled("bank")) { print info_admin($langs->trans("AtLeastOneDefaultBankAccountMandatory"), 0, 0, 'error'); } diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index f3dda5ffb83..c3a1f934e2d 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -1310,7 +1310,7 @@ if (isset($_SESSION["takeposterminal"]) && $_SESSION["takeposterminal"]) { } } - if (empty($paiementsModes) && isModEnabled("banque")) { + if (empty($paiementsModes) && isModEnabled("bank")) { $langs->load('errors'); setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors'); setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors'); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 1e0faeb2b44..6e6e7739411 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -195,7 +195,7 @@ if (empty($reshook)) { } } - if ($bankaccount <= 0 && $pay != "delayed" && isModEnabled("banque")) { + if ($bankaccount <= 0 && $pay != "delayed" && isModEnabled("bank")) { $errormsg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BankAccount")); $error++; } @@ -1438,7 +1438,7 @@ $( document ).ready(function() { // Module Adherent $s = ''; - if (isModEnabled('adherent') && $invoice->socid > 0 && $invoice->socid != getDolGlobalInt($constforcompanyid)) { + if (isModEnabled('member') && $invoice->socid > 0 && $invoice->socid != getDolGlobalInt($constforcompanyid)) { $s = ''; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; $langs->load("members"); diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index cb39394006c..e0858b6b45c 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -246,7 +246,7 @@ if ($resql) { $arrayOfValidBankAccount[getDolGlobalInt($accountname)] = getDolGlobalInt($accountname); $arrayOfValidPaymentModes[] = $obj; } - if (!isModEnabled('banque')) { + if (!isModEnabled('bank')) { if ($paycode == 'CASH' || $paycode == 'CB') { $arrayOfValidPaymentModes[] = $obj; } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 5ab6dfa2363..f595ae566cf 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -44,7 +44,7 @@ if (isModEnabled('project')) { include_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; } -if (isModEnabled('contrat')) { +if (isModEnabled('contract')) { include_once DOL_DOCUMENT_ROOT.'/core/class/html.formcontract.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php'; include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php'; @@ -1010,7 +1010,7 @@ if ($action == 'create' || $action == 'presend') { // Contract if (getDolGlobalString('TICKET_LINK_TO_CONTRACT_WITH_HARDLINK')) { // Deprecated. Duplicate feature. Ticket can already be linked to contract with the generic "Link to" feature. - if (isModEnabled('contrat')) { + if (isModEnabled('contract')) { $langs->load('contracts'); $morehtmlref .= '
'; if ($permissiontoedit) { @@ -1158,7 +1158,7 @@ if ($action == 'create' || $action == 'presend') { print '
'; print ''; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 001d4b55bb7..4b0ba6f813d 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1559,7 +1559,7 @@ class Ticket extends CommonObject $datas['date_modification'] = '
'.$langs->trans('DateModification').': '.dol_print_date($this->date_modification, 'dayhour'); } // show categories for this record only in ajax to not overload lists - if (isModEnabled('categorie') && !$nofetch) { + if (isModEnabled('category') && !$nofetch) { require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; $form = new Form($this->db); $datas['categories'] = '
' . $form->showCategories($this->id, Categorie::TYPE_TICKET, 1); @@ -1927,7 +1927,7 @@ class Ticket extends CommonObject $error = 0; // Valid and close fichinter linked - if (isModEnabled('ficheinter') && getDolGlobalString('WORKFLOW_TICKET_CLOSE_INTERVENTION')) { + if (isModEnabled('intervention') && getDolGlobalString('WORKFLOW_TICKET_CLOSE_INTERVENTION')) { dol_syslog("We have closed the ticket, so we close all linked interventions"); $this->fetchObjectLinked($this->id, $this->element, null, 'fichinter'); if ($this->linkedObjectsIds) { diff --git a/htdocs/user/card.php b/htdocs/user/card.php index afe86b1760d..8f8cf80e2aa 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -53,10 +53,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php'; if (isModEnabled('ldap')) { require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; } -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; } -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } if (isModEnabled('stock')) { @@ -357,7 +357,7 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); $action = "create"; // Go back to create page } else { - if (isModEnabled("categorie")) { + if (isModEnabled("category")) { // Categories association $usercats = GETPOST('usercats', 'array'); $object->setCategories($usercats); @@ -1265,7 +1265,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Categories - if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { + if (isModEnabled('category') && $user->hasRight("categorie", "read")) { print ''; print ''; print ''; // Categories - if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { + if (isModEnabled('category') && $user->hasRight("categorie", "read")) { print ''; print ''; print ''; // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { $langs->load('categories'); if (!GETPOSTISSET('categories')) { @@ -4704,7 +4704,7 @@ if ($mode == 'replacesite' || $massaction == 'replace') { print ''; // Categories - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { print '
'; print '
'; print $langs->trans("Category"); @@ -4841,7 +4841,7 @@ if ($mode == 'replacesite' || $massaction == 'replace') { // Categories - Tags print '
'.$form->editfieldkey('Categories', 'usercats', '', $object, 0).''; $cate_arbo = $form->select_all_categories('user', null, 'parent', null, null, 1); print img_picto('', 'category', 'class="pictofixedwidth"').$form->multiselectarray('usercats', $cate_arbo, GETPOST('usercats', 'array'), 0, 0, 'maxwdith300 widthcentpercentminusx', 0, '90%'); @@ -1734,7 +1734,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Categories - if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { + if (isModEnabled('category') && $user->hasRight("categorie", "read")) { print '
'.$langs->trans("Categories").''; print $form->showCategories($object->id, Categorie::TYPE_USER, 1); @@ -1814,7 +1814,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Module Adherent - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $langs->load("members"); print '
'.$langs->trans("LinkedToDolibarrMember").''; @@ -2693,7 +2693,7 @@ if ($action == 'create' || $action == 'adduserldap') { print '
'.$form->editfieldkey('Categories', 'usercats', '', $object, 0).''; print img_picto('', 'category', 'class="pictofixedwidth"'); @@ -2748,7 +2748,7 @@ if ($action == 'create' || $action == 'adduserldap') { } // Module Adherent - if (isModEnabled('adherent')) { + if (isModEnabled('member')) { $langs->load("members"); print '
'.$langs->trans("LinkedToDolibarrMember").''; diff --git a/htdocs/user/list.php b/htdocs/user/list.php index 0d924c142cf..cb40dba7c17 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -28,7 +28,7 @@ // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; -if (isModEnabled('categorie')) { +if (isModEnabled('category')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; } @@ -701,7 +701,7 @@ $moreforfilter = ''; $moreforfilter.= '';*/ // Filter on categories -if (isModEnabled('categorie') && $user->hasRight("categorie", "read")) { +if (isModEnabled('category') && $user->hasRight("categorie", "read")) { $moreforfilter .= '
'; $tmptitle = $langs->trans('Category'); $moreforfilter .= img_picto($langs->trans("Category"), 'category', 'class="pictofixedwidth"').$formother->select_categories(Categorie::TYPE_USER, $search_categ, 'search_categ', 1, $tmptitle); diff --git a/htdocs/user/param_ihm.php b/htdocs/user/param_ihm.php index 6ec1f7e3a2d..c59313ec708 100644 --- a/htdocs/user/param_ihm.php +++ b/htdocs/user/param_ihm.php @@ -209,16 +209,16 @@ if (isModEnabled('holiday') || isModEnabled('expensereport')) { if (isModEnabled("product") || isModEnabled("service")) { $tmparray['product/index.php?mainmenu=products&leftmenu='] = array('label'=>'ProductsAndServicesArea', 'picto'=>'product'); } -if (isModEnabled("propal") || isModEnabled('commande') || isModEnabled('ficheinter') || isModEnabled('contrat')) { +if (isModEnabled("propal") || isModEnabled('order') || isModEnabled('intervention') || isModEnabled('contract')) { $tmparray['comm/index.php?mainmenu=commercial&leftmenu='] = array('label'=>'CommercialArea', 'picto'=>'commercial'); } -if (isModEnabled('facture')) { +if (isModEnabled('invoice')) { $tmparray['compta/index.php?mainmenu=billing&leftmenu='] = array('label'=>'InvoicesArea', 'picto'=>'bill'); } if (isModEnabled('comptabilite') || isModEnabled('accounting')) { $tmparray['compta/index.php?mainmenu=accountancy&leftmenu='] = array('label'=>'AccountancyTreasuryArea', 'picto'=>'bill'); } -if (isModEnabled('adherent')) { +if (isModEnabled('member')) { $tmparray['adherents/index.php?mainmenu=members&leftmenu='] = array('label'=>'MembersArea', 'picto'=>'member'); } if (isModEnabled('agenda')) { diff --git a/htdocs/webportal/class/html.formcardwebportal.class.php b/htdocs/webportal/class/html.formcardwebportal.class.php index d0d9531436e..702d4dfb3cb 100644 --- a/htdocs/webportal/class/html.formcardwebportal.class.php +++ b/htdocs/webportal/class/html.formcardwebportal.class.php @@ -382,7 +382,7 @@ class FormCardWebPortal } } - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { $categories = GETPOST('categories', 'array'); if (method_exists($object, 'setCategories')) { $object->setCategories($categories); diff --git a/htdocs/webportal/controllers/invoicelist.controller.class.php b/htdocs/webportal/controllers/invoicelist.controller.class.php index a58b5be7cb4..3f8fa6ff31b 100644 --- a/htdocs/webportal/controllers/invoicelist.controller.class.php +++ b/htdocs/webportal/controllers/invoicelist.controller.class.php @@ -40,7 +40,7 @@ class InvoiceListController extends Controller */ public function checkAccess() { - $this->accessRight = isModEnabled('facture') && getDolGlobalInt('WEBPORTAL_INVOICE_LIST_ACCESS'); + $this->accessRight = isModEnabled('invoice') && getDolGlobalInt('WEBPORTAL_INVOICE_LIST_ACCESS'); return parent::checkAccess(); } diff --git a/htdocs/webportal/controllers/membercard.controller.class.php b/htdocs/webportal/controllers/membercard.controller.class.php index a984d66f1bb..d3415f04086 100644 --- a/htdocs/webportal/controllers/membercard.controller.class.php +++ b/htdocs/webportal/controllers/membercard.controller.class.php @@ -43,7 +43,7 @@ class MemberCardController extends Controller { $context = Context::getInstance(); $cardAccess = getDolGlobalString('WEBPORTAL_MEMBER_CARD_ACCESS'); - $this->accessRight = isModEnabled('adherent') && in_array($cardAccess, array('visible', 'edit')) && $context->logged_member && $context->logged_member->id > 0; + $this->accessRight = isModEnabled('member') && in_array($cardAccess, array('visible', 'edit')) && $context->logged_member && $context->logged_member->id > 0; return parent::checkAccess(); } @@ -72,8 +72,8 @@ class MemberCardController extends Controller // set form card $cardAccess = getDolGlobalString('WEBPORTAL_MEMBER_CARD_ACCESS'); - $permissiontoread = (int) isModEnabled('adherent') && in_array($cardAccess, array('visible', 'edit')); - $permissiontoadd = (int) isModEnabled('adherent') && in_array($cardAccess, array('edit')); + $permissiontoread = (int) isModEnabled('member') && in_array($cardAccess, array('visible', 'edit')); + $permissiontoadd = (int) isModEnabled('member') && in_array($cardAccess, array('edit')); $permissiontodelete = 0; $permissionnote = 0; $permissiondellink = 0; diff --git a/htdocs/webportal/controllers/orderlist.controller.class.php b/htdocs/webportal/controllers/orderlist.controller.class.php index 204f00db2ba..5d104cb344c 100644 --- a/htdocs/webportal/controllers/orderlist.controller.class.php +++ b/htdocs/webportal/controllers/orderlist.controller.class.php @@ -42,7 +42,7 @@ class OrderListController extends Controller */ public function checkAccess() { - $this->accessRight = isModEnabled('commande') && getDolGlobalInt('WEBPORTAL_ORDER_LIST_ACCESS'); + $this->accessRight = isModEnabled('order') && getDolGlobalInt('WEBPORTAL_ORDER_LIST_ACCESS'); return parent::checkAccess(); } diff --git a/htdocs/webportal/controllers/propallist.controller.class.php b/htdocs/webportal/controllers/propallist.controller.class.php index 533327a42b6..5c6ca9668db 100644 --- a/htdocs/webportal/controllers/propallist.controller.class.php +++ b/htdocs/webportal/controllers/propallist.controller.class.php @@ -64,7 +64,7 @@ class PropalListController extends Controller // Load translation files required by the page $langs->loadLangs(array('companies', 'propal', 'compta', 'bills', 'orders', 'products', 'deliveries', 'categories')); - if (isModEnabled('expedition')) { + if (isModEnabled('delivery_note')) { $langs->loadLangs(array('sendings')); } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index d55b81d1151..25fe96f7efe 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3074,7 +3074,7 @@ if (!GETPOST('hide_websitemenu')) { print dolButtonToOpenUrlInDialogPopup('file_manager', $langs->transnoentitiesnoconv("MediaFiles"), '', '/website/index.php?action=file_manager&website='.urlencode($website->ref).'§ion_dir='.urlencode('image/'.$website->ref.'/'), $disabled); - if (isModEnabled('categorie')) { + if (isModEnabled('category')) { //print ''; print dolButtonToOpenUrlInDialogPopup('categories', $langs->transnoentitiesnoconv("Categories"), '', '/categories/index.php?leftmenu=website&nosearch=1&type=website_page&website='.urlencode($website->ref), $disabled); } @@ -4376,7 +4376,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties print '
'; - if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire')) { + if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { // Get current categories $existing = $c->containing($answerrecord->id, Categorie::TYPE_WEBSITE_PAGE, 'object'); if (is_array($existing)) { From 049eaa18201953c91859be4a820edb5cd74cc5ce Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Feb 2024 15:33:48 +0100 Subject: [PATCH 82/84] Compact code --- htdocs/accountancy/admin/account.php | 4 ++-- htdocs/modulebuilder/template/myobject_list.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index f02c1e9f555..85f230168c3 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -66,10 +66,10 @@ if (!$user->hasRight('accounting', 'chartofaccount')) { } // Load variable for pagination -$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; +$limit = GETPOSTINT('limit', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 0086243bff2..41264b0a467 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -106,7 +106,7 @@ $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); // Load variable for pagination -$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$limit = GETPOSTINT('limit', $conf->liste_limit); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page'); From 8af8fc98daeeacb56b6a0dc07fade33e00f04d21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Feb 2024 16:42:09 +0100 Subject: [PATCH 83/84] fix phpstan (#28461) --- htdocs/core/class/html.formbarcode.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/html.formbarcode.class.php b/htdocs/core/class/html.formbarcode.class.php index 6d58b9a6198..ff8fb505202 100644 --- a/htdocs/core/class/html.formbarcode.class.php +++ b/htdocs/core/class/html.formbarcode.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2008-2012 Laurent Destailleur - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2024 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -57,7 +57,7 @@ class FormBarCode * @param int $selected Id code pre-selected * @param array $barcodelist Array of barcodes generators * @param int $code_id Id du code barre - * @param int $idForm Id du formulaire + * @param string $idForm Id of html form, ex id="idform" * @return string HTML select string */ public function setBarcodeEncoder($selected, $barcodelist, $code_id, $idForm = 'formbarcode') @@ -118,7 +118,7 @@ class FormBarCode * @return void * @deprecated */ - public function select_barcode_type($selected = '', $htmlname = 'barcodetype_id', $useempty = 0) + public function select_barcode_type($selected = 0, $htmlname = 'barcodetype_id', $useempty = 0) { // phpcs:enable print $this->selectBarcodeType($selected, $htmlname, $useempty); @@ -132,7 +132,7 @@ class FormBarCode * @param int $useempty Display empty value in select * @return string */ - public function selectBarcodeType($selected = '', $htmlname = 'barcodetype_id', $useempty = 0) + public function selectBarcodeType($selected = 0, $htmlname = 'barcodetype_id', $useempty = 0) { global $langs, $conf; @@ -187,7 +187,7 @@ class FormBarCode * @return void * @deprecated */ - public function form_barcode_type($page, $selected = '', $htmlname = 'barcodetype_id') + public function form_barcode_type($page, $selected = 0, $htmlname = 'barcodetype_id') { // phpcs:enable print $this->formBarcodeType($page, $selected, $htmlname); @@ -201,7 +201,7 @@ class FormBarCode * @param string $htmlname Nom du formulaire select * @return string */ - public function formBarcodeType($page, $selected = '', $htmlname = 'barcodetype_id') + public function formBarcodeType($page, $selected = 0, $htmlname = 'barcodetype_id') { global $langs, $conf; $out = ''; From 92e790effe7586ef8b57fe09d8070ad89f41c653 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 27 Feb 2024 16:43:04 +0100 Subject: [PATCH 84/84] Fix: GETPOST -> GETPOSTINT (#28460) --- htdocs/core/customreports.php | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index 49cecafe544..1ada4100484 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -55,10 +55,10 @@ if (!defined('USE_CUSTOM_REPORT_AS_INCLUDE')) { $search_graph = GETPOST('search_graph', 'restricthtml'); // Load variable for pagination - $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; + $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); - $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); + $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOSTINT("page"); if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action @@ -118,24 +118,24 @@ $head = array(); $ObjectClassName = ''; // Objects available by default $arrayoftype = array( - 'thirdparty' => array('langs'=>'companies', 'label' => 'ThirdParties', 'picto'=>'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php"), - 'contact' => array('label' => 'Contacts', 'picto'=>'contact', 'ObjectClassName' => 'Contact', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/contact/class/contact.class.php"), - 'proposal' => array('label' => 'Proposals', 'picto'=>'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php"), - 'order' => array('label' => 'Orders', 'picto'=>'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/commande.class.php"), - 'invoice' => array('langs'=>'facture', 'label' => 'Invoices', 'picto'=>'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture.class.php"), - 'invoice_template'=>array('label' => 'PredefinedInvoices', 'picto'=>'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/class/facturerec.class.php", 'langs'=>'bills'), - 'contract' => array('label' => 'Contracts', 'picto'=>'contract', 'ObjectClassName' => 'Contrat', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'), - 'contractdet' => array('label' => 'ContractLines', 'picto'=>'contract', 'ObjectClassName' => 'ContratLigne', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs'=>'contracts'), - 'bom' => array('label' => 'BOM', 'picto'=>'bom', 'ObjectClassName' => 'Bom', 'enabled' => isModEnabled('bom')), - 'mrp' => array('label' => 'MO', 'picto'=>'mrp', 'ObjectClassName' => 'Mo', 'enabled' => isModEnabled('mrp'), 'ClassPath' => "/mrp/class/mo.class.php"), - 'ticket' => array('label' => 'Ticket', 'picto'=>'ticket', 'ObjectClassName' => 'Ticket', 'enabled' => isModEnabled('ticket')), - 'member' => array('label' => 'Adherent', 'picto'=>'member', 'ObjectClassName' => 'Adherent', 'enabled' => isModEnabled('member'), 'ClassPath' => "/adherents/class/adherent.class.php", 'langs'=>'members'), - 'cotisation' => array('label' => 'Subscriptions', 'picto'=>'member', 'ObjectClassName' => 'Subscription', 'enabled' => isModEnabled('member'), 'ClassPath' => "/adherents/class/subscription.class.php", 'langs'=>'members'), + 'thirdparty' => array('langs' => 'companies', 'label' => 'ThirdParties', 'picto' => 'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php"), + 'contact' => array('label' => 'Contacts', 'picto' => 'contact', 'ObjectClassName' => 'Contact', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/contact/class/contact.class.php"), + 'proposal' => array('label' => 'Proposals', 'picto' => 'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php"), + 'order' => array('label' => 'Orders', 'picto' => 'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('order'), 'ClassPath' => "/commande/class/commande.class.php"), + 'invoice' => array('langs' => 'facture', 'label' => 'Invoices', 'picto' => 'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/facture/class/facture.class.php"), + 'invoice_template' => array('label' => 'PredefinedInvoices', 'picto' => 'bill', 'ObjectClassName' => 'FactureRec', 'enabled' => isModEnabled('invoice'), 'ClassPath' => "/compta/class/facturerec.class.php", 'langs' => 'bills'), + 'contract' => array('label' => 'Contracts', 'picto' => 'contract', 'ObjectClassName' => 'Contrat', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs' => 'contracts'), + 'contractdet' => array('label' => 'ContractLines', 'picto' => 'contract', 'ObjectClassName' => 'ContratLigne', 'enabled' => isModEnabled('contract'), 'ClassPath' => "/contrat/class/contrat.class.php", 'langs' => 'contracts'), + 'bom' => array('label' => 'BOM', 'picto' => 'bom', 'ObjectClassName' => 'Bom', 'enabled' => isModEnabled('bom')), + 'mrp' => array('label' => 'MO', 'picto' => 'mrp', 'ObjectClassName' => 'Mo', 'enabled' => isModEnabled('mrp'), 'ClassPath' => "/mrp/class/mo.class.php"), + 'ticket' => array('label' => 'Ticket', 'picto' => 'ticket', 'ObjectClassName' => 'Ticket', 'enabled' => isModEnabled('ticket')), + 'member' => array('label' => 'Adherent', 'picto' => 'member', 'ObjectClassName' => 'Adherent', 'enabled' => isModEnabled('member'), 'ClassPath' => "/adherents/class/adherent.class.php", 'langs' => 'members'), + 'cotisation' => array('label' => 'Subscriptions', 'picto' => 'member', 'ObjectClassName' => 'Subscription', 'enabled' => isModEnabled('member'), 'ClassPath' => "/adherents/class/subscription.class.php", 'langs' => 'members'), ); // Complete $arrayoftype by external modules -$parameters = array('objecttype'=>$objecttype, 'tabfamily'=>$tabfamily); +$parameters = array('objecttype' => $objecttype, 'tabfamily' => $tabfamily); $reshook = $hookmanager->executeHooks('loadDataForCustomReports', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -586,7 +586,7 @@ if (!defined('MAIN_CUSTOM_REPORT_KEEP_GRAPH_ONLY')) { jQuery(document).ready(function() { jQuery("#objecttype").change(function() { console.log("Reload for "+jQuery("#objecttype").val()); - location.href = "'.$_SERVER["PHP_SELF"].'?objecttype="+jQuery("#objecttype").val()+"'.($tabfamily ? '&tabfamily='.urlencode($tabfamily) : '').(GETPOST('show_search_component_params_hidden', 'int') ? '&show_search_component_params_hidden='.((int) GETPOST('show_search_component_params_hidden', 'int')) : '').'"; + location.href = "'.$_SERVER["PHP_SELF"].'?objecttype="+jQuery("#objecttype").val()+"'.($tabfamily ? '&tabfamily='.urlencode($tabfamily) : '').(GETPOSTINT('show_search_component_params_hidden') ? '&show_search_component_params_hidden='.((int) GETPOSTINT('show_search_component_params_hidden')) : '').'"; }); }); '; @@ -1225,28 +1225,28 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu $arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-sum'] = array( 'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Sum").')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val), - 'position' => ($position+($count * 100000)).'.1', + 'position' => ($position + ($count * 100000)).'.1', 'table' => $object->table_element, 'tablefromt' => $tablepath ); $arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-average'] = array( 'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Average").')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val), - 'position' => ($position+($count * 100000)).'.2', + 'position' => ($position + ($count * 100000)).'.2', 'table' => $object->table_element, 'tablefromt' => $tablepath ); $arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-min'] = array( 'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Minimum").')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val), - 'position' => ($position+($count * 100000)).'.3', + 'position' => ($position + ($count * 100000)).'.3', 'table' => $object->table_element, 'tablefromt' => $tablepath ); $arrayofmesures[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-max'] = array( 'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($extrafields->attributes[$object->table_element]['label'][$key]).' ('.$langs->trans("Maximum").')', 'labelnohtml' => $labelofobject.': '.$langs->trans($val), - 'position' => ($position+($count * 100000)).'.4', + 'position' => ($position + ($count * 100000)).'.4', 'table' => $object->table_element, 'tablefromt' => $tablepath );