';
- $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 '';
@@ -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 '| '.$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 ' |
';
// 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 '| '.$langs->trans("RemainderToPay").' | '.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).' |
';*/
print '| '.$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 " | ";
@@ -218,7 +218,7 @@ if ($action == 'create') {
print ''.$langs->trans('AccountToDebit').' | ';
print '';
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 ' |
';
// 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 '| '.$langs->trans("RemainderToPay").' | '.price($total-$sumpaid,0,$outputlangs,1,-1,-1,$conf->currency).' |
';*/
print '| '.$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 " | ";
print '
';
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 " | \n";
print '
';
@@ -216,7 +216,7 @@ if ($action == 'create') {
print ''.$langs->trans('AccountToDebit').' | ';
print '';
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 ' | ';
// 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 '| '.$langs->trans("RefusedReason").' | ';
print '';
- print $form->selectarray("motif", $rej->motifs, GETPOSTISSET('motif') ? GETPOST('motif', 'int') : '');
+ print $form->selectarray("motif", $rej->motifs, GETPOSTISSET('motif') ? GETPOSTINT('motif') : '');
print ' |
';
//Facturer
@@ -247,7 +247,7 @@ if ($id) {
print $form->textwithpicto($langs->trans("RefusedInvoicing"), $langs->trans("DirectDebitRefusedInvoicingDesc"));
print '';
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 ' | ';
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 '