From 625ade1a534eb97cc1d4eb4122dcff160273f778 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 31 Mar 2021 12:41:44 +0200 Subject: [PATCH] Clean log --- htdocs/admin/company.php | 4 ++-- htdocs/cashdesk/facturation_verif.php | 28 +++++++++++++-------------- htdocs/cashdesk/validation_verif.php | 2 +- htdocs/core/ajax/selectobject.php | 5 ----- htdocs/core/ajax/ziptown.php | 9 ++++----- htdocs/imports/import.php | 4 ++-- htdocs/product/ajax/products.php | 2 -- htdocs/projet/ajax/projects.php | 1 - htdocs/societe/ajax/company.php | 2 -- htdocs/societe/ajaxcompanies.php | 2 -- htdocs/societe/ajaxcountries.php | 2 -- 11 files changed, 23 insertions(+), 38 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index f0bb3ea9067..d8af6ac1b4f 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -288,8 +288,8 @@ if ($action == 'addthumb' || $action == 'addthumbsquarred') { // Regenerate thu } else { $error++; $langs->load("errors"); - setEventMessages($langs->trans("ErrorFileDoesNotExists", $_GET["file"]), null, 'errors'); - dol_syslog($langs->transnoentities("ErrorFileDoesNotExists", $_GET["file"]), LOG_WARNING); + setEventMessages($langs->trans("ErrorFileDoesNotExists", GETPOST("file")), null, 'errors'); + dol_syslog($langs->transnoentities("ErrorFileDoesNotExists", GETPOST("file")), LOG_WARNING); } } diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php index eed48555e20..f51cda3e77b 100644 --- a/htdocs/cashdesk/facturation_verif.php +++ b/htdocs/cashdesk/facturation_verif.php @@ -1,7 +1,7 @@ * Copyright (C) 2008-2010 Laurent Destailleur - * Copyright (C) 2018 Juanjo Menent + * Copyright (C) 2018 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,14 +45,14 @@ if (empty($user->rights->cashdesk->run)) { switch ($action) { default: - if ($_POST['hdnSource'] != 'NULL') { + if (GETPOST('hdnSource') != 'NULL') { $sql = "SELECT p.rowid, p.ref, p.price, p.tva_tx, p.default_vat_code, p.recuperableonly"; if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) { $sql .= ", ps.reel"; } $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; if (!empty($conf->stock->enabled) && !empty($conf_fkentrepot)) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".$conf_fkentrepot; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = ".((int) $conf_fkentrepot); } $sql .= " WHERE p.entity IN (".getEntity('product').")"; @@ -164,18 +164,18 @@ switch ($action) { $obj_facturation->vatrate = $vatrate; // Save vat rate (full text vat with code) // Definition du filtre pour n'afficher que le produit concerne - if ($_POST['hdnSource'] == 'LISTE') { + if (GETPOST('hdnSource') == 'LISTE') { $filtre = $ret['ref']; - } elseif ($_POST['hdnSource'] == 'REF') { - $filtre = $_POST['txtRef']; + } elseif (GETPOST('hdnSource') == 'REF') { + $filtre = GETPOST('txtRef'); } - $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation&filtre='.$filtre; + $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation&filtre='.urlencode($filtre); } else { $obj_facturation->raz(); - if ($_POST['hdnSource'] == 'REF') { - $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation&filtre='.$_POST['txtRef']; + if (GETPOST('hdnSource') == 'REF') { + $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation&filtre='.urlencode(GETPOST('txtRef')); } else { $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation'; } @@ -200,10 +200,10 @@ switch ($action) { case 'ajout_article': if (!empty($obj_facturation->id)) { // A product was previously selected and stored in session, so we can add it - dol_syslog("facturation_verif save vat ".$_POST['selTva']); - $obj_facturation->qte($_POST['txtQte']); - $obj_facturation->tva($_POST['selTva']); // id of vat. Saved so we can use it for next product - $obj_facturation->remisePercent($_POST['txtRemise']); + dol_syslog("facturation_verif save vat ".GETPOST('selTva')); + $obj_facturation->qte(GETPOST('txtQte')); + $obj_facturation->tva(GETPOST('selTva')); // id of vat. Saved so we can use it for next product + $obj_facturation->remisePercent(GETPOST('txtRemise')); $obj_facturation->ajoutArticle(); // This add an entry into $_SESSION['poscart'] // We update prixTotalTtc } @@ -212,7 +212,7 @@ switch ($action) { break; case 'suppr_article': - $obj_facturation->supprArticle($_GET['suppr_id']); + $obj_facturation->supprArticle(GETPOST('suppr_id')); $redirection = DOL_URL_ROOT.'/cashdesk/affIndex.php?menutpl=facturation'; break; diff --git a/htdocs/cashdesk/validation_verif.php b/htdocs/cashdesk/validation_verif.php index 76cba5d3d95..0c9758d9a29 100644 --- a/htdocs/cashdesk/validation_verif.php +++ b/htdocs/cashdesk/validation_verif.php @@ -165,7 +165,7 @@ switch ($action) { if (empty($cond_reglement_id)) { $cond_reglement_id = 0; // If cond_reglement_id not found } - $note .= $_POST['txtaNotes']; + $note .= GETPOST('txtaNotes', 'alphanohtml'); dol_syslog("obj_facturation->getSetPaymentMode()=".$obj_facturation->getSetPaymentMode()." mode_reglement_id=".$mode_reglement_id." cond_reglement_id=".$cond_reglement_id); $error = 0; diff --git a/htdocs/core/ajax/selectobject.php b/htdocs/core/ajax/selectobject.php index c491ad63749..c8c3e13ea3d 100644 --- a/htdocs/core/ajax/selectobject.php +++ b/htdocs/core/ajax/selectobject.php @@ -43,9 +43,7 @@ require '../../main.inc.php'; $objectdesc = GETPOST('objectdesc', 'alpha'); $htmlname = GETPOST('htmlname', 'aZ09'); -$sqlfilter = GETPOST('sqlfilter', 'alpha'); $outjson = (GETPOST('outjson', 'int') ? GETPOST('outjson', 'int') : 0); -$action = GETPOST('action', 'aZ09'); $id = GETPOST('id', 'int'); @@ -54,11 +52,8 @@ $id = GETPOST('id', 'int'); */ //print ''."\n"; - -dol_syslog(join(',', $_GET)); //print_r($_GET); - require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; $form = new Form($db); diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php index 44c7bc0760b..aa9474ce142 100644 --- a/htdocs/core/ajax/ziptown.php +++ b/htdocs/core/ajax/ziptown.php @@ -59,17 +59,17 @@ top_httphead(); //print ''."\n"; -dol_syslog("GET is ".join(',', $_GET).', MAIN_USE_ZIPTOWN_DICTIONNARY='.(empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY) ? '' : $conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)); +dol_syslog('ziptown call with MAIN_USE_ZIPTOWN_DICTIONNARY='.(empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY) ? '' : $conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)); //var_dump($_GET); // Generation of list of zip-town -if (!empty($_GET['zipcode']) || !empty($_GET['town'])) { +if (GETPOST('zipcode') || GETPOST('town')) { $return_arr = array(); $formcompany = new FormCompany($db); // Define filter on text typed - $zipcode = $_GET['zipcode'] ? $_GET['zipcode'] : ''; - $town = $_GET['town'] ? $_GET['town'] : ''; + $zipcode = GETPOST('zipcode'); + $town = GETPOST('town'); if (!empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) { // Use zip-town table $sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country"; @@ -141,7 +141,6 @@ if (!empty($_GET['zipcode']) || !empty($_GET['town'])) { } echo json_encode($return_arr); -} else { } $db->close(); diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 50ab14dfce5..f484e3b0901 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -307,8 +307,8 @@ if ($step == 4 && $action == 'select_model') { if ($action == 'saveorder') { // Enregistrement de la position des champs - dol_syslog("boxorder=".$_GET['boxorder']." datatoimport=".$_GET["datatoimport"], LOG_DEBUG); - $part = explode(':', $_GET['boxorder']); + dol_syslog("boxorder=".GETPOST('boxorder')." datatoimport=".GETPOST("datatoimport"), LOG_DEBUG); + $part = explode(':', GETPOST('boxorder')); $colonne = $part[0]; $list = $part[1]; dol_syslog('column='.$colonne.' list='.$list); diff --git a/htdocs/product/ajax/products.php b/htdocs/product/ajax/products.php index 9dacb4e547d..b09c29f75da 100644 --- a/htdocs/product/ajax/products.php +++ b/htdocs/product/ajax/products.php @@ -68,8 +68,6 @@ $hidepriceinlabel = GETPOST('hidepriceinlabel', 'int'); */ // print ''."\n"; - -dol_syslog(join(',', $_GET)); // print_r($_GET); if (!empty($action) && $action == 'fetch' && !empty($id)) { diff --git a/htdocs/projet/ajax/projects.php b/htdocs/projet/ajax/projects.php index 22f58f62c90..5264fa02596 100644 --- a/htdocs/projet/ajax/projects.php +++ b/htdocs/projet/ajax/projects.php @@ -61,7 +61,6 @@ restrictedArea($user, 'projet', 0, 'projet&project'); */ dol_syslog("Call ajax projet/ajax/projects.php"); -//dol_syslog(join(',', $_GET)); require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php index 57edbcebc1d..86e6f68c16c 100644 --- a/htdocs/societe/ajax/company.php +++ b/htdocs/societe/ajax/company.php @@ -57,8 +57,6 @@ $showtype = GETPOST('showtype', 'int'); */ //print ''."\n"; - -dol_syslog(join(',', $_GET)); //print_r($_GET); if (!empty($action) && $action == 'fetch' && !empty($id)) { diff --git a/htdocs/societe/ajaxcompanies.php b/htdocs/societe/ajaxcompanies.php index 28b105df9a0..cc327b155fa 100644 --- a/htdocs/societe/ajaxcompanies.php +++ b/htdocs/societe/ajaxcompanies.php @@ -58,8 +58,6 @@ top_httphead(); //print ''."\n"; -dol_syslog(join(',', $_GET)); - // Generation liste des societes if (GETPOST('newcompany') || GETPOST('socid', 'int') || GETPOST('id_fourn')) { diff --git a/htdocs/societe/ajaxcountries.php b/htdocs/societe/ajaxcountries.php index a4efc4ecc94..aa6cbf70de8 100644 --- a/htdocs/societe/ajaxcountries.php +++ b/htdocs/societe/ajaxcountries.php @@ -59,8 +59,6 @@ top_httphead(); print ''."\n"; -dol_syslog(join(',', $_POST)); - // Generate list of countries if (!empty($country)) { global $langs;