From f7c3ca9d20ade10cfaa9bd7f670b028041263b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 5 Sep 2018 18:49:06 +0200 Subject: [PATCH] move phpcs:ignore --- htdocs/core/class/html.formother.class.php | 60 +++++++++------ .../modules/cheque/mod_chequereceipt_mint.php | 3 +- .../cheque/mod_chequereceipt_thyme.php | 3 +- .../doc/doc_generic_order_odt.modules.php | 3 +- .../doc/doc_generic_contract_odt.modules.php | 3 +- .../expedition/mod_expedition_ribera.php | 3 +- .../expedition/mod_expedition_safor.php | 3 +- .../modules/import/import_csv.modules.php | 42 +++++++---- .../modules/mailings/modules_mailings.php | 15 ++-- .../modules/member/doc/pdf_standard.class.php | 6 +- .../doc/pdf_standardlabel.class.php | 26 ++++--- .../doc/doc_generic_product_odt.modules.php | 3 +- .../societe/mod_codeclient_elephant.php | 6 +- ..._generic_supplier_proposal_odt.modules.php | 3 +- .../user/doc/doc_generic_user_odt.modules.php | 6 +- htdocs/projet/class/task.class.php | 75 ++++++++++--------- 16 files changed, 156 insertions(+), 104 deletions(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index ed371cc1e23..93b17669c2c 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -58,6 +58,7 @@ class FormOther } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return HTML select list of export models * @@ -68,13 +69,13 @@ class FormOther * @param int $fk_user Utilisateur créant le modèle * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_export_model($selected='', $htmlname='exportmodelid', $type='', $useempty=0, $fk_user=null) { + // phpcs:enable $sql = "SELECT rowid, label"; $sql.= " FROM ".MAIN_DB_PREFIX."export_model"; $sql.= " WHERE type = '".$type."'"; - if(!empty($fk_user))$sql.=" AND fk_user=".$fk_user; + if (!empty($fk_user)) $sql.=" AND fk_user=".$fk_user; $sql.= " ORDER BY rowid"; $result = $this->db->query($sql); if ($result) @@ -110,6 +111,7 @@ class FormOther } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of export models * @@ -119,9 +121,9 @@ class FormOther * @param int $useempty Affiche valeur vide dans liste * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_import_model($selected='', $htmlname='importmodelid', $type='', $useempty=0) { + // phpcs:enable $sql = "SELECT rowid, label"; $sql.= " FROM ".MAIN_DB_PREFIX."import_model"; $sql.= " WHERE type = '".$type."'"; @@ -160,6 +162,7 @@ class FormOther } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of ecotaxes with label * @@ -167,9 +170,9 @@ class FormOther * @param string $htmlname Name of combo list * @return integer */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_ecotaxes($selected='', $htmlname='ecotaxe_id') { + // phpcs:enable global $langs; $sql = "SELECT e.rowid, e.code, e.label, e.price, e.organization,"; @@ -217,6 +220,7 @@ class FormOther } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of revenue stamp for country * @@ -225,9 +229,9 @@ class FormOther * @param string $country_code Country Code * @return string HTML select list */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_revenue_stamp($selected='', $htmlname='revenuestamp', $country_code='') { + // phpcs:enable global $langs; $out=''; @@ -275,6 +279,7 @@ class FormOther } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a HTML select list to select a percent * @@ -287,9 +292,9 @@ class FormOther * @param int $showempty Add also an empty line * @return string HTML select string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100,$showempty=0) { + // phpcs:enable $return = ''; if ($useempty) @@ -829,6 +841,7 @@ class FormOther return $select_week; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return HTML combo list of month * @@ -839,9 +852,9 @@ class FormOther * @param string $morecss More Css * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_month($selected='', $htmlname='monthid', $useempty=0, $longlabel=0, $morecss='') { + // phpcs:enable global $langs; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; @@ -871,6 +884,7 @@ class FormOther return $select_month; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return HTML combo list of years * @@ -885,9 +899,9 @@ class FormOther * @param string $morecss More CSS * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='valignmiddle widthauto') { + // phpcs:enable print $this->selectyear($selected,$htmlname,$useempty,$min_year,$max_year,$offset,$invert,$option,$morecss); } @@ -944,6 +958,7 @@ class FormOther return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show form to select address * @@ -955,9 +970,9 @@ class FormOther * @param int $originid Id de l'origine * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_address($page, $selected, $socid, $htmlname='address_id', $origin='', $originid='') { + // phpcs:enable global $langs,$conf; global $form; @@ -1206,6 +1221,7 @@ class FormOther } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a HTML select list of a dictionary * @@ -1218,9 +1234,9 @@ class FormOther * @param string $moreattrib More attributes on HTML select tag * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_dictionary($htmlname,$dictionarytable,$keyfield='code',$labelfield='label',$selected='',$useempty=0,$moreattrib='') { + // phpcs:enable global $langs, $conf; $langs->load("admin"); diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php index 32e0d373631..b3b6fb96b66 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php @@ -138,6 +138,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * @@ -145,9 +146,9 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts * @param string $objforref Object for number to search * @return string Next free value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function chequereceipt_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php index ec276d52935..caf063da7d4 100644 --- a/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php +++ b/htdocs/core/modules/cheque/mod_chequereceipt_thyme.php @@ -124,6 +124,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * @@ -131,9 +132,9 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts * @param string $objforref Object for number to search * @return string Next free value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function chequereceipt_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 166c7f389d1..f7f51302972 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -177,6 +177,7 @@ class doc_generic_order_odt extends ModelePDFCommandes return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -188,9 +189,9 @@ class doc_generic_order_odt extends ModelePDFCommandes * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index b58a67a2cb0..413daf7ba25 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -167,6 +167,7 @@ class doc_generic_contract_odt extends ModelePDFContract return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -178,9 +179,9 @@ class doc_generic_contract_odt extends ModelePDFContract * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/expedition/mod_expedition_ribera.php b/htdocs/core/modules/expedition/mod_expedition_ribera.php index 8865fed7d77..dadde0fd814 100644 --- a/htdocs/core/modules/expedition/mod_expedition_ribera.php +++ b/htdocs/core/modules/expedition/mod_expedition_ribera.php @@ -121,6 +121,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition return $numFinal; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * @@ -128,9 +129,9 @@ class mod_expedition_ribera extends ModelNumRefExpedition * @param Object $objforref Shipment object * @return string Next free value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function expedition_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/expedition/mod_expedition_safor.php b/htdocs/core/modules/expedition/mod_expedition_safor.php index c74d621f01d..2a20c22a88d 100644 --- a/htdocs/core/modules/expedition/mod_expedition_safor.php +++ b/htdocs/core/modules/expedition/mod_expedition_safor.php @@ -133,6 +133,7 @@ class mod_expedition_safor extends ModelNumRefExpedition return $this->prefix.$yymm."-".$num; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * @@ -140,9 +141,9 @@ class mod_expedition_safor extends ModelNumRefExpedition * @param Object $objforref Shipment object * @return string Next free value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function expedition_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 36a5d3d70ba..2b8d2825f75 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -109,18 +109,20 @@ class ImportCsv extends ModeleImports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output header of an example file for this format * * @param Translate $outputlangs Output language * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_header_example($outputlangs) { + // phpcs:enable return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output title line of an example file for this format * @@ -128,13 +130,14 @@ class ImportCsv extends ModeleImports * @param array $headerlinefields Array of fields name * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_title_example($outputlangs,$headerlinefields) { + // phpcs:enable $s=join($this->separator,array_map('cleansep',$headerlinefields)); return $s."\n"; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output record of an example file for this format * @@ -142,36 +145,38 @@ class ImportCsv extends ModeleImports * @param array $contentlinevalues Array of lines * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_record_example($outputlangs,$contentlinevalues) { + // phpcs:enable $s=join($this->separator,array_map('cleansep',$contentlinevalues)); return $s."\n"; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output footer of an example file for this format * * @param Translate $outputlangs Output language * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_footer_example($outputlangs) { + // phpcs:enable return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Open input file * * @param string $file Path of filename * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_open_file($file) { + // phpcs:enable global $langs; $ret=1; @@ -195,39 +200,42 @@ class ImportCsv extends ModeleImports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return nb of records. File must be closed. * * @param string $file Path of filename * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_get_nb_of_lines($file) { - return dol_count_nb_of_line($file); + // phpcs:enable + return dol_count_nb_of_line($file); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Input header line from file * * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_read_header() { + // phpcs:enable return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return array of next record in input file. * * @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_read_record() { + // phpcs:enable global $conf; $arrayres=fgetcsv($this->handle,100000,$this->separator,$this->enclosure,$this->escape); @@ -276,19 +284,21 @@ class ImportCsv extends ModeleImports return $newarrayres; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Close file handle * * @return integer */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_close_file() { + // phpcs:enable fclose($this->handle); return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Insert a record into database * @@ -300,9 +310,9 @@ class ImportCsv extends ModeleImports * @param array $updatekeys Array of keys to use to try to do an update first before insert. This field are defined into the module descriptor. * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid,$updatekeys) { + // phpcs:enable global $langs,$conf,$user; global $thirdparty_static; // Specific to thirdparty import global $tablewithentity_cache; // Cache to avoid to call desc at each rows on tables @@ -577,9 +587,13 @@ class ImportCsv extends ModeleImports $listfields[] = $fieldname; // Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert - if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) $listvalues[] = ($newval=='0'?$newval:"null"); - elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) $listvalues[] = "''"; - else $listvalues[] = "'".$this->db->escape($newval)."'"; + if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) { + $listvalues[] = ($newval=='0'?$newval:"null"); + } elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) { + $listvalues[] = "''"; + } else { + $listvalues[] = "'".$this->db->escape($newval)."'"; + } } $i++; } diff --git a/htdocs/core/modules/mailings/modules_mailings.php b/htdocs/core/modules/mailings/modules_mailings.php index 9d1a0458e88..e0316a75390 100644 --- a/htdocs/core/modules/mailings/modules_mailings.php +++ b/htdocs/core/modules/mailings/modules_mailings.php @@ -35,12 +35,12 @@ class MailingTargets // This can't be abstract as it is used for some method * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ public $error=''; - + var $tooltip=''; @@ -117,15 +117,16 @@ class MailingTargets // This can't be abstract as it is used for some method return ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Met a jour nombre de destinataires * * @param int $mailing_id Id of emailing * @return int < 0 si erreur, nb destinataires si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_nb($mailing_id) { + // phpcs:enable // Mise a jour nombre de destinataire dans table des mailings $sql = "SELECT COUNT(*) nb FROM ".MAIN_DB_PREFIX."mailing_cibles"; $sql .= " WHERE fk_mailing = ".$mailing_id; @@ -150,6 +151,7 @@ class MailingTargets // This can't be abstract as it is used for some method return $nb; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Ajoute destinataires dans table des cibles * @@ -157,9 +159,9 @@ class MailingTargets // This can't be abstract as it is used for some method * @param array $cibles Array with targets * @return int < 0 si erreur, nb ajout si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target($mailing_id, $cibles) { + // phpcs:enable global $conf; $this->db->begin(); @@ -234,15 +236,16 @@ class MailingTargets // This can't be abstract as it is used for some method return $j; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Supprime tous les destinataires de la table des cibles * - * @param int $mailing_id Id of emailing + * @param int $mailing_id Id of emailing * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function clear_target($mailing_id) { + // phpcs:enable $sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles"; $sql .= " WHERE fk_mailing = ".$mailing_id; diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php index 1531248d746..524d1446427 100644 --- a/htdocs/core/modules/member/doc/pdf_standard.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard.class.php @@ -47,6 +47,7 @@ class pdf_standard extends CommonStickerGenerator // use this method in future refactoring } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) * - __LOGO__ is replace with company logo @@ -62,9 +63,9 @@ class pdf_standard extends CommonStickerGenerator * @param string $photo Photo (full path to image file used as replacement for key __PHOTOS__ into left, right, header or footer text) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Add_PDF_card(&$pdf,$textleft,$header,$footer,$outputlangs,$textright='',$idmember=0,$photo='') { + // phpcs:enable global $db,$mysoc,$conf,$langs; global $forceimgscalewidth,$forceimgscaleheight; @@ -236,6 +237,7 @@ class pdf_standard extends CommonStickerGenerator } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build PDF on disk, then output on HTTP stream. * @@ -246,9 +248,9 @@ class pdf_standard extends CommonStickerGenerator * @param int $nooutput 1=Generate only file on disk and do not return it on response * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object, $outputlangs, $srctemplatepath, $mode='member', $nooutput=0) { + // phpcs:enable global $user,$conf,$langs,$mysoc,$_Avery_Labels; $this->code=$srctemplatepath; diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 1ca929c08cf..0047dda7669 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -1,10 +1,10 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2006-2013 Laurent Destailleur - * Copyright (C) 2015 Francis Appels +/* Copyright (C) 2003 Steve Dillon + * Copyright (C) 2003 Laurent Passebecq + * Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2006-2013 Laurent Destailleur + * Copyright (C) 2015 Francis Appels * * 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 @@ -21,15 +21,15 @@ */ /** - * \file htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php - * \ingroup core - * \brief Fichier de la classe permettant d'editer au format PDF des etiquettes au format Avery ou personnalise + * \file htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php + * \ingroup core + * \brief Fichier de la classe permettant d'editer au format PDF des etiquettes au format Avery ou personnalise */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonstickergenerator.class.php'; /** - * Class to generate stick sheet with format Avery or other personalised + * Class to generate stick sheet with format Avery or other personalised */ class pdf_standardlabel extends CommonStickerGenerator { @@ -46,6 +46,7 @@ class pdf_standardlabel extends CommonStickerGenerator // use this method in future refactoring } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) * - %LOGO% is replace with company logo @@ -60,9 +61,9 @@ class pdf_standardlabel extends CommonStickerGenerator * @param string $photo Photo (full path to image file used as replacement for key %PHOTOS% into left, right, header or footer text) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Add_PDF_label(&$pdf,$textleft,$header,$footer,$outputlangs,$textright='',$photo='') { + // phpcs:enable global $mysoc, $conf, $langs; global $forceimgscalewidth, $forceimgscaleheight; @@ -226,6 +227,7 @@ class pdf_standardlabel extends CommonStickerGenerator + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build PDF on disk, then output on HTTP strem. * @@ -236,9 +238,9 @@ class pdf_standardlabel extends CommonStickerGenerator * @param string $filename Short file name of PDF output file * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$outputdir='',$filename='tmp_address_sheet.pdf') { + // phpcs:enable global $user,$conf,$langs,$mysoc,$_Avery_Labels; $this->code=$srctemplatepath; diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php index c93e4b50fe3..b92c05e6f48 100644 --- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php +++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php @@ -191,6 +191,7 @@ class doc_generic_product_odt extends ModelePDFProduct return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -202,9 +203,9 @@ class doc_generic_product_odt extends ModelePDFProduct * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $product,$langs,$conf,$mysoc,$hookmanager,$user; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php index b8d3ad53092..5aba06db359 100644 --- a/htdocs/core/modules/societe/mod_codeclient_elephant.php +++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php @@ -216,14 +216,15 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Check if mask/numbering use prefix * * @return int 0 or 1 */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_prefixIsUsed() { + // phpcs:enable global $conf; $mask = $conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER; @@ -292,6 +293,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi si un code est pris ou non (par autre tiers) * @@ -301,9 +303,9 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode * @param int $type 0 = customer/prospect , 1 = supplier * @return int 0 if available, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_dispo($db, $code, $soc, $type=0) { + // phpcs:enable $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe"; if ($type == 1) $sql.= " WHERE code_fournisseur = '".$code."'"; else $sql.= " WHERE code_client = '".$code."'"; diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index a95ad54ba02..da3eb6ef734 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -207,6 +207,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -218,9 +219,9 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php index 2ba83623020..5318220beb8 100644 --- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php +++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php @@ -190,6 +190,7 @@ class doc_generic_user_odt extends ModelePDFUser return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -201,9 +202,9 @@ class doc_generic_user_odt extends ModelePDFUser * @param int $hideref Do not show ref * @return int 1 if OK, <=0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0) { + // phpcs:enable global $user,$langs,$conf,$mysoc,$hookmanager; if (empty($srctemplatepath)) @@ -423,6 +424,7 @@ class doc_generic_user_odt extends ModelePDFUser return -1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * get substitution array for object * @@ -431,9 +433,9 @@ class doc_generic_user_odt extends ModelePDFUser * @param string $array_key key for array * @return array array of substitutions */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_substitutionarray_object($object,$outputlangs,$array_key='object') { + // phpcs:enable $array_other = array(); foreach($object as $key => $value) { if (!is_array($value) && !is_object($value)) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index a908f3315fd..aec0f40443e 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1719,6 +1719,7 @@ class Task extends CommonObject return $this->LibStatut($this->fk_statut, $mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return status label for an object * @@ -1726,9 +1727,9 @@ class Task extends CommonObject * @param integer $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut, $mode=0) { + // phpcs:enable // list of Statut of the task $this->statuts[0]='Draft'; $this->statuts[1]='ToDo'; @@ -1747,59 +1748,59 @@ class Task extends CommonObject { return $langs->trans($this->statuts[$statut]); } - if ($mode == 1) + elseif ($mode == 1) { return $langs->trans($this->statuts_short[$statut]); } - if ($mode == 2) + elseif ($mode == 2) { if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); - if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts_short[$statut]); + elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts_short[$statut]); + elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts_short[$statut]); + elseif ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); + elseif ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]); + elseif ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts_short[$statut]); } - if ($mode == 3) + elseif ($mode == 3) { if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); - if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); - if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); - if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); + elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); + elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); + elseif ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + elseif ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + elseif ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]); - if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); - if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]); - if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); - if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); - if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]); + elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]); + elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]); + elseif ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); + elseif ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]); + elseif ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]); } - if ($mode == 5) + elseif ($mode == 5) { /*if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); - if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); - if ($statut==2) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); - if ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==4) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); + elseif ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); + elseif ($statut==2) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); + elseif ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + elseif ($statut==4) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + elseif ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); */ - //return $this->progress.' %'; + //else return $this->progress.' %'; return ' '; } - if ($mode == 6) + elseif ($mode == 6) { /*if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0'); - if ($statut==1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); - if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); - if ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==4) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); - if ($statut==5) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); + elseif ($statut==1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1'); + elseif ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3'); + elseif ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + elseif ($statut==4) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6'); + elseif ($statut==5) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5'); */ - //return $this->progress.' %'; + //else return $this->progress.' %'; return ' '; } } @@ -1837,15 +1838,16 @@ class Task extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Objet user * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_board($user) { + // phpcs:enable global $conf, $langs; // For external user, no check is done on company because readability is managed by public status of project and assignement. @@ -1911,14 +1913,15 @@ class Task extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Charge indicateurs this->nb de tableau de bord * * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $user; $mine=0; $socid=$user->societe_id;