From b511a056f4684ff291d9a5e88c24962e59decd4a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Dec 2018 11:48:21 +0100 Subject: [PATCH] Fix phpcs --- htdocs/comm/propal/list.php | 17 +++-------------- htdocs/commande/list.php | 13 ++----------- htdocs/compta/deplacement/list.php | 6 +----- htdocs/compta/facture/list.php | 14 +++----------- htdocs/compta/paiement/list.php | 1 - htdocs/expensereport/list.php | 15 ++++----------- htdocs/fourn/commande/list.php | 14 ++------------ htdocs/fourn/facture/list.php | 2 -- htdocs/holiday/list.php | 22 +++------------------- htdocs/supplier_proposal/list.php | 2 -- 10 files changed, 18 insertions(+), 88 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index f42c77176dc..52a3a1562d3 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -329,20 +329,9 @@ if ($viewstatut != '' && $viewstatut != '-1') { $sql.= ' AND p.fk_statut IN ('.$db->escape($viewstatut).')'; } - -$sql.= dolSqlDateFilter( - "p.datep", - $search_day, $search_month, $search_year -); -$sql.= dolSqlDateFilter( - "p.fin_validite", - $search_dayfin, $search_month_end, $search_yearfin -); -$sql.= dolSqlDateFilter( - "p.date_livraison", - $search_daydelivery, $search_monthdelivery, $search_yeardelivery -); - +$sql.= dolSqlDateFilter("p.datep", $search_day, $search_month, $search_year); +$sql.= dolSqlDateFilter("p.fin_validite", $search_dayfin, $search_month_end, $search_yearfin); +$sql.= dolSqlDateFilter("p.date_livraison", $search_daydelivery, $search_monthdelivery, $search_yeardelivery); if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$db->escape($search_sale); if ($search_user > 0) { diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index d59618e7541..a5ff8bf0dc8 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -303,17 +303,8 @@ if ($viewstatut <> '') $sql .= ' AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))'; // validated, in process or closed but not billed } } - -$sql.= dolSqlDateFilter( - "c.date_commande", - $search_orderday, $search_ordermonth, $search_orderyear -); - -$sql.= dolSqlDateFilter( - "c.date_livraison", - $search_deliveryday, $search_deliverymonth, $search_deliveryyear -); - +$sql.= dolSqlDateFilter("c.date_commande", $search_orderday, $search_ordermonth, $search_orderyear); +$sql.= dolSqlDateFilter("c.date_livraison", $search_deliveryday, $search_deliverymonth, $search_deliveryyear); if ($search_town) $sql.= natural_search('s.town', $search_town); if ($search_zip) $sql.= natural_search("s.zip",$search_zip); if ($search_state) $sql.= natural_search("state.nom",$search_state); diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 74d30692c3f..d6d599d7ece 100644 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -105,11 +105,7 @@ if ($search_company) { $sql .= natural_search('s.nom', $search_company); } -// if ($search_amount) $sql.=" AND d.km='".$db->escape(price2num(trim($search_amount)))."'"; - -$sql.= dolSqlDateFilter( - "d.dated", $day, $month, $year -); +$sql.= dolSqlDateFilter("d.dated", $day, $month, $year); $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index f141f065e4d..235f7a75dbd 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -451,18 +451,10 @@ if ($search_status != '-1' && $search_status != '') } } if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$db->escape($search_paymentmode); - -$sql.= dolSqlDateFilter( - "f.datef", - $search_day, $search_month, $search_year -); -$sql.= dolSqlDateFilter( - "f.date_lim_reglement", - $search_day_lim, $search_month_lim, $search_year_lim -); - +$sql.= dolSqlDateFilter("f.datef", $search_day, $search_month, $search_year); +$sql.= dolSqlDateFilter("f.date_lim_reglement", $search_day_lim, $search_month_lim, $search_year_lim); if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'"; -if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale; +if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale; if ($search_user > 0) { $sql.= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='facture' AND tc.source='internal' AND ec.element_id = f.rowid AND ec.fk_socpeople = ".$search_user; diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 460393e8bc4..12669947cff 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -165,7 +165,6 @@ else } // Search criteria $sql.= dolSqlDateFilter("p.datep", $day, $month, $year); - if ($search_ref) $sql .= natural_search('p.ref', $search_ref); if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account; if ($search_paymenttype != "") $sql .=" AND c.code='".$db->escape($search_paymenttype)."'"; diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 38e050b1673..34a28442e45 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -276,16 +276,9 @@ if (!empty($sall)) $sql.= natural_search(array_keys($fieldstosearchall), $sall); // Ref if (!empty($search_ref)) $sql.= natural_search('d.ref', $search_ref); // Date Start -$sql.= dolSqlDateFilter( - "d.date_debut", - $day_start, $month_start, $year_start -); - +$sql.= dolSqlDateFilter("d.date_debut", $day_start, $month_start, $year_start); // Date End -$sql.= dolSqlDateFilter( - "d.date_fin", - $day_end, $month_end, $year_end -); +$sql.= dolSqlDateFilter("d.date_fin", $day_end, $month_end, $year_end); if ($search_amount_ht != '') $sql.= natural_search('d.total_ht', $search_amount_ht, 1); if ($search_amount_ttc != '') $sql.= natural_search('d.total_ttc', $search_amount_ttc, 1); @@ -527,7 +520,7 @@ if ($resql) if (! empty($arrayfields['d.date_debut']['checked'])) { print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; @@ -538,7 +531,7 @@ if ($resql) if (! empty($arrayfields['d.date_fin']['checked'])) { print ''; - if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; print ''; $formother->select_year($year_end,'year_end',1, $min_year, $max_year); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index bd1430f2d40..a8ea0b63f6d 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -520,23 +520,13 @@ if ($search_company) $sql .= natural_search('s.nom', $search_company); if ($search_request_author) $sql.=natural_search(array('u.lastname','u.firstname','u.login'), $search_request_author) ; if ($search_billed != '' && $search_billed >= 0) $sql .= " AND cf.billed = ".$db->escape($search_billed); if ($search_product_category > 0) $sql.= " AND cp.fk_categorie = ".$search_product_category; - //Required triple check because statut=0 means draft filter if (GETPOST('statut', 'intcomma') !== '') $sql .= " AND cf.fk_statut IN (".$db->escape($db->escape(GETPOST('statut', 'intcomma'))).")"; - if ($search_status != '' && $search_status >= 0) $sql.=" AND cf.fk_statut IN (".$db->escape($search_status).")"; - -$sql.= dolSqlDateFilter( - "cf.date_commande", - $search_orderday, $search_ordermonth, $search_orderyear -); -$sql.= dolSqlDateFilter( - "cf.date_livraison", - $search_deliveryday, $search_deliverymonth, $search_deliveryyear -); - +$sql.= dolSqlDateFilter("cf.date_commande", $search_orderday, $search_ordermonth, $search_orderyear); +$sql.= dolSqlDateFilter("cf.date_livraison", $search_deliveryday, $search_deliverymonth, $search_deliveryyear); if ($search_town) $sql.= natural_search('s.town', $search_town); if ($search_zip) $sql.= natural_search("s.zip",$search_zip); if ($search_state) $sql.= natural_search("state.nom",$search_state); diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index a05b93bb7da..9286c038507 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -330,10 +330,8 @@ if ($search_montant_localtax2 != '') $sql.= natural_search('f.localtax2', $searc if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1); if ($search_status != '' && $search_status >= 0) $sql.= " AND f.fk_statut = ".$db->escape($search_status); if ($search_paymentmode > 0) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmode.""; - $sql.= dolSqlDateFilter( "f.datef", $day, $month, $year); $sql.= dolSqlDateFilter( "f.date_lim_reglement", $day_lim, $month_lim, $year_lim); - if ($option == 'late') $sql.=" AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->fournisseur->warning_delay)."'"; if ($search_label) $sql .= natural_search('f.libelle', $search_label); if ($search_status != '' && $search_status >= 0) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index f638a7e5015..1cb76abf4ec 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -189,40 +189,24 @@ if(!empty($search_ref)) { $filter.= " AND cp.rowid = ".(int) $db->escape($search_ref); } - // Start date -$sql.= dolSqlDateFilter( - "cp.date_debut", - $search_day_start, $search_month_start, $search_year_start -); - +$filter.= dolSqlDateFilter("cp.date_debut", $search_day_start, $search_month_start, $search_year_start); // End date -$sql.= dolSqlDateFilter( - "cp.date_fin", - $search_day_end, $search_month_end, $search_year_end -); - +$filter.= dolSqlDateFilter("cp.date_fin", $search_day_end, $search_month_end, $search_year_end); // Create date -$sql.= dolSqlDateFilter( - "cp.date_create", - $search_day_create, $search_month_create, $search_year_create -); - +$filter.= dolSqlDateFilter("cp.date_create", $search_day_create, $search_month_create, $search_year_create); // Employee if(!empty($search_employee) && $search_employee != -1) { $filter.= " AND cp.fk_user = '".$db->escape($search_employee)."'\n"; } - // Validator if(!empty($search_valideur) && $search_valideur != -1) { $filter.= " AND cp.fk_validator = '".$db->escape($search_valideur)."'\n"; } - // Type if (!empty($search_type) && $search_type != -1) { $filter.= ' AND cp.fk_type IN ('.$db->escape($search_type).')'; } - // Status if(!empty($search_statut) && $search_statut != -1) { $filter.= " AND cp.statut = '".$db->escape($search_statut)."'\n"; diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index 1eee5ebf60e..1fe96bc4def 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -289,10 +289,8 @@ if ($search_montant_ttc != '') $sql.= natural_search("sp.total", $search_montant if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); if ($socid) $sql.= ' AND s.rowid = '.$socid; if ($search_status >= 0 && $search_status != '') $sql.= ' AND sp.fk_statut IN ('.$db->escape($search_status).')'; - $sql.= dolSqlDateFilter("sp.date_livraison", $day, $month, $year); $sql.= dolSqlDateFilter("sp.date_valid", $dayvalid, $monthvalid, $yearvalid); - if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$search_sale; if ($search_user > 0) {