From 70ba223788856f9104d0dfde65bb822bd177ec0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 6 Sep 2018 21:27:18 +0200 Subject: [PATCH] move phpcs:ignore --- htdocs/core/class/html.formcompany.class.php | 44 +++++---- htdocs/core/class/smtps.class.php | 21 +++-- htdocs/core/db/pgsql.class.php | 93 ++++++++++++------- .../bank/doc/pdf_sepamandate.modules.php | 4 +- .../modules/commande/mod_commande_marbre.php | 5 +- .../modules/contract/mod_contract_magre.php | 5 +- .../modules/export/export_tsv.modules.php | 31 ++++--- .../fichinter/doc/pdf_soleil.modules.php | 3 +- htdocs/core/modules/import/modules_import.php | 9 +- .../modules/mailings/contacts1.modules.php | 5 +- .../core/modules/mailings/example.modules.php | 11 ++- .../core/modules/mailings/pomme.modules.php | 5 +- .../modules/printing/modules_printing.php | 4 +- .../modules/printing/printipp.modules.php | 46 ++++----- .../modules/printsheet/modules_labels.php | 10 +- .../modules/project/mod_project_simple.php | 5 +- .../modules/project/task/mod_task_simple.php | 10 +- .../societe/doc/doc_generic_odt.modules.php | 3 +- .../modules/societe/modules_societe.class.php | 33 ++++--- .../modules_supplier_proposal.php | 9 +- 20 files changed, 213 insertions(+), 143 deletions(-) diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 78b06048ee4..5c39bc0cef4 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -35,7 +35,7 @@ class FormCompany * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -54,6 +54,7 @@ class FormCompany } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of labels (translated) of third parties type * @@ -61,9 +62,9 @@ class FormCompany * @param string $filter Add a SQL filter to select * @return array Array of types */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function typent_array($mode=0, $filter='') { + // phpcs:enable global $langs,$mysoc; $effs = array(); @@ -96,6 +97,7 @@ class FormCompany return $effs; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la liste des types d'effectifs possibles (pas de traduction car nombre) * @@ -103,9 +105,9 @@ class FormCompany * @param string $filter Add a SQL filter to select * @return array Array of types d'effectifs */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function effectif_array($mode=0, $filter='') { + // phpcs:enable $effs = array(); $sql = "SELECT id, code, libelle"; @@ -135,6 +137,7 @@ class FormCompany } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Affiche formulaire de selection des modes de reglement * @@ -144,9 +147,9 @@ class FormCompany * @param int $empty Add empty value in list * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_prospect_level($page, $selected='', $htmlname='prospect_level_id', $empty=0) { + // phpcs:enable global $user, $langs; print '
'; @@ -185,6 +188,7 @@ class FormCompany print '
'; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne. * Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays. @@ -197,12 +201,13 @@ class FormCompany * @param string $htmlname Id of department * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_departement($selected='',$country_codeid=0, $htmlname='state_id') { + // phpcs:enable print $this->select_state($selected,$country_codeid, $htmlname); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne. * Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays. @@ -216,9 +221,9 @@ class FormCompany * @return string String with HTML select * @see select_country */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_state($selected='',$country_codeid=0, $htmlname='state_id') { + // phpcs:enable global $conf,$langs,$user; dol_syslog(get_class($this)."::select_departement selected=".$selected.", country_codeid=".$country_codeid,LOG_DEBUG); @@ -318,6 +323,7 @@ class FormCompany } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne la liste deroulante des regions actives dont le pays est actif * La cle de la liste est le code (il peut y avoir plusieurs entree pour @@ -328,9 +334,9 @@ class FormCompany * @param string $htmlname Name of HTML select field * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_region($selected='',$htmlname='region_id') { + // phpcs:enable global $conf,$langs; $langs->load("dict"); @@ -385,6 +391,7 @@ class FormCompany } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return combo list with people title * @@ -393,9 +400,9 @@ class FormCompany * @param string $morecss Add more css on SELECT element * @return string String with HTML select */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100') { + // phpcs:enable global $conf,$langs,$user; $langs->load("dict"); @@ -442,6 +449,7 @@ class FormCompany return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays. @@ -453,12 +461,13 @@ class FormCompany * @deprecated Use print xxx->select_juridicalstatus instead * @see select_juridicalstatus() */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_forme_juridique($selected='', $country_codeid=0, $filter='') { + // phpcs:enable print $this->select_juridicalstatus($selected, $country_codeid, $filter); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays @@ -469,9 +478,9 @@ class FormCompany * @param string $htmlname HTML name of select * @return string String with HTML select */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_juridicalstatus($selected='', $country_codeid=0, $filter='', $htmlname='forme_juridique_code') { + // phpcs:enable global $conf,$langs,$user; $langs->load("dict"); @@ -754,6 +763,7 @@ class FormCompany } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a select list with zip codes and their town * @@ -766,9 +776,9 @@ class FormCompany * @param string $morecss More css * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='',$morecss='') { + // phpcs:enable global $conf; $out=''; @@ -786,6 +796,7 @@ class FormCompany return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return HTML string to use as input of professional id into a HTML page (siren, siret, etc...) * @@ -796,9 +807,9 @@ class FormCompany * @param string $morecss More css * @return string HTML string with prof id */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_input_id_prof($idprof,$htmlname,$preselected,$country_code,$morecss='maxwidth100onsmartphone quatrevingtpercent') { + // phpcs:enable global $conf,$langs; $formlength=0; @@ -837,6 +848,7 @@ class FormCompany return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a HTML select with localtax values for thirdparties * @@ -845,13 +857,13 @@ class FormCompany * @param string $htmlname HTML select name * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_localtax($local, $selected, $htmlname) { - $tax=get_localtax_by_third($local); + // phpcs:enable + $tax=get_localtax_by_third($local); - $num = $this->db->num_rows($tax); - $i = 0; + $num = $this->db->num_rows($tax); + $i = 0; if ($num) { $valors=explode(":", $tax); diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php index 2481e9b457b..113f5a6f278 100644 --- a/htdocs/core/class/smtps.class.php +++ b/htdocs/core/class/smtps.class.php @@ -344,14 +344,15 @@ class SMTPs $_aryToList = $this->getTO(); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Attempt a connection to mail server * * @return mixed $_retVal Boolean indicating success or failure on connection */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _server_connect() { + // phpcs:enable // Default return value $_retVal = true; @@ -407,14 +408,15 @@ class SMTPs return $_retVal; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Attempt mail server authentication for a secure connection * * @return boolean|null $_retVal Boolean indicating success or failure of authentication */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _server_authenticate() { + // phpcs:enable global $conf; // Send the RFC2554 specified EHLO. @@ -1038,6 +1040,7 @@ class SMTPs $this->_msgRecipients = $aryHost; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns an array of the various parts of an email address * This assumes a well formed address: @@ -1054,9 +1057,9 @@ class SMTPs * @param string $_strAddr Email address * @return array An array of the various parts of an email address */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _strip_email($_strAddr) { + // phpcs:enable // Keep the orginal $_aryEmail['org'] = $_strAddr; @@ -1090,6 +1093,7 @@ class SMTPs return $_aryEmail; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns an array of bares addresses for use with 'RCPT TO:' * This is a "build as you go" method. Each time this method is called @@ -1097,9 +1101,9 @@ class SMTPs * * @return array Returns an array of bares addresses */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_RCPT_list() { + // phpcs:enable /** * An array of bares addresses for use with 'RCPT TO:' */ @@ -1121,15 +1125,16 @@ class SMTPs return $_RCPT_list; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns an array of addresses for a specific type; TO, CC or BCC * * @param string $_which Which collection of addresses to return ('to', 'cc', 'bcc') * @return string|false Array of emaill address */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_email_list($_which = null) { + // phpcs:enable // We need to know which address segment to pull if ( $_which ) { @@ -1750,6 +1755,7 @@ class SMTPs else if ($type == 'alternative') return $this->_smtpsAlternativeBoundary; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * This function has been modified as provided by SirSir to allow multiline responses when * using SMTP Extensions @@ -1758,9 +1764,9 @@ class SMTPs * @param string $response Response. Example: "550 5.7.1 https://support.google.com/a/answer/6140680#invalidcred j21sm814390wre.3" * @return boolean True or false */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function server_parse($socket, $response) { + // phpcs:enable /** * Returns constructed SELECT Object string or boolean upon failure * Default value is set at true @@ -1792,6 +1798,7 @@ class SMTPs return $_retVal; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Send str * @@ -1800,9 +1807,9 @@ class SMTPs * @param string $CRLF CRLF * @return boolean|null True or false */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function socket_send_str( $_strSend, $_returnCode = null, $CRLF = "\r\n" ) { + // phpcs:enable if ($this->_debug) $this->log.=$_strSend; // @CHANGE LDR for log fputs($this->socket, $_strSend . $CRLF); if ($this->_debug) $this->log.=' ('.$_returnCode.')' . $CRLF; diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index be6bb0888d2..78a3b91279e 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -359,20 +359,24 @@ class DoliDBPgsql extends DoliDB return $line; } - /** - * Select a database + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Select a database * Ici postgresql n'a aucune fonction equivalente de mysql_select_db * On compare juste manuellement si la database choisie est bien celle activee par la connexion * * @param string $database Name of database * @return bool true if OK, false if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_db($database) { - if ($database == $this->database_name) return true; - else return false; - } + // phpcs:enable + if ($database == $this->database_name) { + return true; + } else { + return false; + } + } /** * Connexion to server @@ -541,63 +545,68 @@ class DoliDBPgsql extends DoliDB return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la ligne courante (comme un objet) pour le curseur resultset * * @param resource $resultset Curseur de la requete voulue * @return false|object Object result line or false if KO or end of cursor */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_object($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_resource($resultset)) { $resultset=$this->_results; } return pg_fetch_object($resultset); } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Return datas as an array * * @param resource $resultset Resultset of request * @return false|array Array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_array($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_resource($resultset)) { $resultset=$this->_results; } return pg_fetch_array($resultset); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return datas as an array * * @param resource $resultset Resultset of request * @return false|array Array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_row($resultset) { + // phpcs:enable // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion if (! is_resource($resultset)) { $resultset=$this->_results; } return pg_fetch_row($resultset); } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Return number of lines for result of a SELECT * * @param resourse $resultset Resulset of requests * @return int Nb of lines, -1 on error * @see affected_rows - */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + */ function num_rows($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_resource($resultset)) { $resultset=$this->_results; } return pg_num_rows($resultset); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * @@ -605,9 +614,9 @@ class DoliDBPgsql extends DoliDB * @return int Nb of lines * @see num_rows */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function affected_rows($resultset) { + // phpcs:enable // If resultset not provided, we take the last used by connexion if (! is_resource($resultset)) { $resultset=$this->_results; } // pgsql necessite un resultset pour cette fonction contrairement @@ -760,6 +769,7 @@ class DoliDBPgsql extends DoliDB return pg_last_error($this->db); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get last ID after an insert INSERT * @@ -767,9 +777,9 @@ class DoliDBPgsql extends DoliDB * @param string $fieldid Field name * @return string Id of row */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function last_insert_id($tab,$fieldid='rowid') { + // phpcs:enable //$result = pg_query($this->db,"SELECT MAX(".$fieldid.") FROM ".$tab); $result = pg_query($this->db,"SELECT currval('".$tab."_".$fieldid."_seq')"); if (! $result) @@ -826,19 +836,21 @@ class DoliDBPgsql extends DoliDB } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return connexion ID * * @return string Id connexion */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLGetConnectId() { + // phpcs:enable return '?'; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a new database * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated @@ -850,9 +862,9 @@ class DoliDBPgsql extends DoliDB * @param string $owner Username of database owner * @return false|resource resource defined if OK, null if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateDb($database,$charset='',$collation='',$owner='') { + // phpcs:enable if (empty($charset)) $charset=$this->forcecharset; if (empty($collation)) $collation=$this->forcecollate; @@ -865,6 +877,7 @@ class DoliDBPgsql extends DoliDB return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List tables into a database * @@ -872,9 +885,9 @@ class DoliDBPgsql extends DoliDB * @param string $table Name of table filter ('xxx%') * @return array List of tables in an array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLListTables($database, $table='') - { + { + // phpcs:enable $listtables=array(); $like = ''; @@ -890,6 +903,7 @@ class DoliDBPgsql extends DoliDB return $listtables; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List information of columns into a table. * @@ -897,9 +911,9 @@ class DoliDBPgsql extends DoliDB * @return array Tableau des informations des champs de la table * */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLInfoTable($table) { + // phpcs:enable $infotables=array(); $sql="SELECT "; @@ -931,6 +945,7 @@ class DoliDBPgsql extends DoliDB } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a table into database * @@ -943,9 +958,9 @@ class DoliDBPgsql extends DoliDB * @param array $keys Tableau des champs cles noms => valeur * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) { + // phpcs:enable // FIXME: $fulltext_keys parameter is unused // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra @@ -1011,15 +1026,16 @@ class DoliDBPgsql extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Drop a table into database * * @param string $table Name of table * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDropTable($table) { + // phpcs:enable $sql = "DROP TABLE ".$table; if (! $this->query($sql)) @@ -1028,6 +1044,7 @@ class DoliDBPgsql extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a user to connect to database * @@ -1037,9 +1054,9 @@ class DoliDBPgsql extends DoliDB * @param string $dolibarr_main_db_name Database name where user must be granted * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) { + // phpcs:enable // Note: using ' on user does not works with pgsql $sql = "CREATE USER ".$this->escape($dolibarr_main_db_user)." with password '".$this->escape($dolibarr_main_db_pass)."'"; @@ -1053,6 +1070,7 @@ class DoliDBPgsql extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a pointer of line with description of a table or field * @@ -1060,9 +1078,9 @@ class DoliDBPgsql extends DoliDB * @param string $field Optionnel : Name of field if we want description of field * @return false|resource Resultset x (x->attname) */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDescTable($table,$field="") { + // phpcs:enable $sql ="SELECT attname FROM pg_attribute, pg_type WHERE typname = '".$table."' AND attrelid = typrelid"; $sql.=" AND attname NOT IN ('cmin', 'cmax', 'ctid', 'oid', 'tableoid', 'xmin', 'xmax')"; if ($field) $sql.= " AND attname = '".$field."'"; @@ -1072,6 +1090,7 @@ class DoliDBPgsql extends DoliDB return $this->_results; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a new field into table * @@ -1081,37 +1100,38 @@ class DoliDBPgsql extends DoliDB * @param string $field_position Optionnel ex.: "after champtruc" * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLAddField($table,$field_name,$field_desc,$field_position="") { + // phpcs:enable // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); $sql= "ALTER TABLE ".$table." ADD ".$field_name." "; $sql .= $field_desc['type']; - if(preg_match("/^[^\s]/i",$field_desc['value'])) + if (preg_match("/^[^\s]/i",$field_desc['value'])) if (! in_array($field_desc['type'],array('int','date','datetime'))) { $sql.= "(".$field_desc['value'].")"; } if (preg_match("/^[^\s]/i",$field_desc['attribute'])) - $sql .= " ".$field_desc['attribute']; + $sql .= " ".$field_desc['attribute']; if (preg_match("/^[^\s]/i",$field_desc['null'])) - $sql .= " ".$field_desc['null']; + $sql .= " ".$field_desc['null']; if (preg_match("/^[^\s]/i",$field_desc['default'])) - if (preg_match("/null/i",$field_desc['default'])) - $sql .= " default ".$field_desc['default']; - else - $sql .= " default '".$field_desc['default']."'"; + if (preg_match("/null/i",$field_desc['default'])) + $sql .= " default ".$field_desc['default']; + else + $sql .= " default '".$field_desc['default']."'"; if (preg_match("/^[^\s]/i",$field_desc['extra'])) - $sql .= " ".$field_desc['extra']; + $sql .= " ".$field_desc['extra']; $sql .= " ".$field_position; dol_syslog($sql,LOG_DEBUG); - if(! $this -> query($sql)) + if (! $this -> query($sql)) return -1; return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update format of a field into a table * @@ -1120,9 +1140,9 @@ class DoliDBPgsql extends DoliDB * @param string $field_desc Array with description of field format * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLUpdateField($table,$field_name,$field_desc) { + // phpcs:enable $sql = "ALTER TABLE ".$table; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { @@ -1156,6 +1176,7 @@ class DoliDBPgsql extends DoliDB return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Drop a field from table * @@ -1163,9 +1184,9 @@ class DoliDBPgsql extends DoliDB * @param string $field_name Name of field to drop * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DDLDropField($table,$field_name) { + // phpcs:enable $sql= "ALTER TABLE ".$table." DROP COLUMN ".$field_name; dol_syslog($sql,LOG_DEBUG); if (! $this->query($sql)) diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index f7d0ce19f61..0e954cfc28e 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -98,6 +98,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc */ function write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) { + // phpcs:enable global $conf, $hookmanager, $langs, $user, $mysoc; if (! is_object($outputlangs)) $outputlangs=$langs; @@ -464,6 +465,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show area for the customer to sign * @@ -473,9 +475,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc * @param Translate $outputlangs Objet langs * @return int Position pour suite */ - // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _signature_area(&$pdf, $object, $posy, $outputlangs) { + // phpcs:enable $default_font_size = pdf_getPDFFontSize($outputlangs); $tab_top = $posy + 4; $tab_hl = 4; diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php index a66c2c9f985..8ff489cc5fa 100644 --- a/htdocs/core/modules/commande/mod_commande_marbre.php +++ b/htdocs/core/modules/commande/mod_commande_marbre.php @@ -131,13 +131,14 @@ class mod_commande_marbre extends ModeleNumRefCommandes $yymm = strftime("%y%m",$date); if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is - else $num = sprintf("%04s",$max+1); + else $num = sprintf("%04s", $max+1); dol_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return next free value * @@ -145,9 +146,9 @@ class mod_commande_marbre extends ModeleNumRefCommandes * @param string $objforref Object for number to search * @return string Next free value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function commande_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php index ffa75f4f3ba..72c8c5bef23 100644 --- a/htdocs/core/modules/contract/mod_contract_magre.php +++ b/htdocs/core/modules/contract/mod_contract_magre.php @@ -117,16 +117,17 @@ class mod_contract_magre extends ModelNumRefContracts return $numFinal; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Return next value + * Return next value * * @param Societe $objsoc third party object * @param Object $objforref contract object * @return string Value if OK, 0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function contract_get_num($objsoc,$objforref) { + // phpcs:enable return $this->getNextValue($objsoc,$objforref); } } diff --git a/htdocs/core/modules/export/export_tsv.modules.php b/htdocs/core/modules/export/export_tsv.modules.php index db96382a04a..4b57d5f7fcf 100644 --- a/htdocs/core/modules/export/export_tsv.modules.php +++ b/htdocs/core/modules/export/export_tsv.modules.php @@ -145,6 +145,7 @@ class ExportTsv extends ModeleExports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Open output file * @@ -152,14 +153,14 @@ class ExportTsv extends ModeleExports * @param Translate $outputlangs Output language object * @return int <0 if KO, >=0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function open_file($file,$outputlangs) + function open_file($file,$outputlangs) { + // phpcs:enable global $langs; dol_syslog("ExportTsv::open_file file=".$file); - $ret=1; + $ret=1; $outputlangs->load("exports"); $this->handle = fopen($file, "wt"); @@ -173,20 +174,22 @@ class ExportTsv extends ModeleExports return $ret; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output header into file * * @param Translate $outputlangs Output language object * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_header($outputlangs) { + // phpcs:enable return 0; } - /** + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** * Output title line into file * * @param array $array_export_fields_label Array with list of label of fields @@ -195,9 +198,9 @@ class ExportTsv extends ModeleExports * @param array $array_types Array with types of fields * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs,$array_types) { + // phpcs:enable foreach($array_selected_sorted as $code => $value) { $newvalue=$outputlangs->transnoentities($array_export_fields_label[$code]); // newvalue is now $outputlangs->charset_output encoded @@ -210,6 +213,7 @@ class ExportTsv extends ModeleExports } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output record line into file * @@ -219,9 +223,9 @@ class ExportTsv extends ModeleExports * @param array $array_types Array with types of fields * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_record($array_selected_sorted,$objp,$outputlangs,$array_types) { + // phpcs:enable global $conf; $this->col=0; @@ -253,40 +257,43 @@ class ExportTsv extends ModeleExports return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output footer into file * * @param Translate $outputlangs Output language object * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function write_footer($outputlangs) { + // phpcs:enable return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Close file handle * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function close_file() { + // phpcs:enable fclose($this->handle); return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Clean a cell to respect rules of TSV file cells * * @param string $newvalue String to clean - * @param string $charset Input AND Output character set + * @param string $charset Input AND Output character set * @return string Value cleaned */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function tsv_clean($newvalue, $charset) { + // phpcs:enable // Rule Dolibarr: No HTML $newvalue=dol_string_nohtmltag($newvalue, 1, $charset); @@ -300,6 +307,6 @@ class ExportTsv extends ModeleExports $newvalue=str_replace("\t"," ",$newvalue); } - return $newvalue; + return $newvalue; } } diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index aaec15d6672..c51e0452481 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -151,6 +151,7 @@ class pdf_soleil extends ModelePDFFicheinter $this->posxdesc=$this->marge_gauche+1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build pdf onto disk * @@ -162,9 +163,9 @@ class pdf_soleil extends ModelePDFFicheinter * @param int $hideref Do not show ref * @return int 1=OK, 0=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,$db,$hookmanager; if (! is_object($outputlangs)) $outputlangs=$langs; diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php index 5bf74ba48d1..a5d73031b7a 100644 --- a/htdocs/core/modules/import/modules_import.php +++ b/htdocs/core/modules/import/modules_import.php @@ -143,16 +143,17 @@ class ModeleImports } - /** - * Charge en memoire et renvoie la liste des modeles actifs - * + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Charge en memoire et renvoie la liste des modeles actifs + * * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable dol_syslog(get_class($this)."::liste_modeles"); $dir=DOL_DOCUMENT_ROOT."/core/modules/import/"; diff --git a/htdocs/core/modules/mailings/contacts1.modules.php b/htdocs/core/modules/mailings/contacts1.modules.php index 45f404f276e..ace0c97401a 100644 --- a/htdocs/core/modules/mailings/contacts1.modules.php +++ b/htdocs/core/modules/mailings/contacts1.modules.php @@ -327,16 +327,17 @@ class mailing_contacts1 extends MailingTargets } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Ajoute destinataires dans table des cibles * - * @param int $mailing_id Id of emailing + * @param int $mailing_id Id of emailing * @param array $filtersarray Optional filter data (deprecated) * @return int <0 si erreur, nb ajout si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target($mailing_id,$filtersarray=array()) { + // phpcs:enable global $conf, $langs; $filter = GETPOST('filter','alpha'); diff --git a/htdocs/core/modules/mailings/example.modules.php b/htdocs/core/modules/mailings/example.modules.php index af4073038cd..0af52dc5bd2 100644 --- a/htdocs/core/modules/mailings/example.modules.php +++ b/htdocs/core/modules/mailings/example.modules.php @@ -37,7 +37,7 @@ class mailing_example extends MailingTargets var $require_module=array(); var $picto=''; - + /** * @var DoliDB Database handler. */ @@ -56,6 +56,7 @@ class mailing_example extends MailingTargets } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * This is the main function that returns the array of emails * @@ -63,9 +64,9 @@ class mailing_example extends MailingTargets * @param array $filtersarray If you used the formFilter function. Empty otherwise. * @return int <0 if error, number of emails added if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target($mailing_id,$filtersarray=array()) { + // phpcs:enable $target = array(); // CHANGE THIS @@ -112,7 +113,7 @@ class mailing_example extends MailingTargets */ function getNbOfRecipients($sql='') { - // CHANGE THIS: Optionnal + // CHANGE THIS: Optionnal // Example: return parent::getNbOfRecipients("SELECT count(*) as nb from dolibarr_table"); // Example: return 500; @@ -127,7 +128,7 @@ class mailing_example extends MailingTargets */ function formFilter() { - // CHANGE THIS: Optionnal + // CHANGE THIS: Optionnal $s=''; return $s; @@ -143,7 +144,7 @@ class mailing_example extends MailingTargets */ function url($id) { - // CHANGE THIS: Optionnal + // CHANGE THIS: Optionnal return ''; } diff --git a/htdocs/core/modules/mailings/pomme.modules.php b/htdocs/core/modules/mailings/pomme.modules.php index 29e8de8bb98..11ff4812d67 100644 --- a/htdocs/core/modules/mailings/pomme.modules.php +++ b/htdocs/core/modules/mailings/pomme.modules.php @@ -146,6 +146,7 @@ class mailing_pomme extends MailingTargets } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Ajoute destinataires dans table des cibles * @@ -153,9 +154,9 @@ class mailing_pomme extends MailingTargets * @param array $filtersarray Requete sql de selection des destinataires * @return int < 0 si erreur, nb ajout si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps - function add_to_target($mailing_id,$filtersarray=array()) + function add_to_target($mailing_id, $filtersarray=array()) { + // phpcs:enable // Deprecation warning if ($filtersarray) { dol_syslog(__METHOD__ . ": filtersarray parameter is deprecated", LOG_WARNING); diff --git a/htdocs/core/modules/printing/modules_printing.php b/htdocs/core/modules/printing/modules_printing.php index 97cd483e680..afd46919598 100644 --- a/htdocs/core/modules/printing/modules_printing.php +++ b/htdocs/core/modules/printing/modules_printing.php @@ -1,6 +1,6 @@ + * Copyright (C) 2014-2018 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,7 +35,7 @@ class PrintingDriver * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php index 3363755139f..e70cfd76211 100644 --- a/htdocs/core/modules/printing/printipp.modules.php +++ b/htdocs/core/modules/printing/printipp.modules.php @@ -1,6 +1,6 @@ + * Copyright (C) 2014-2018 Frederic France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ /** * \file htdocs/core/modules/printing/printipp.modules.php - * \ingroup mailing + * \ingroup printing * \brief File to provide printing with PrintIPP */ @@ -40,17 +40,17 @@ class printing_printipp extends PrintingDriver var $userid; /* user login */ var $user; var $password; - + /** - * @var string Error code (or message) - */ - public $error=''; - + * @var string Error code (or message) + */ + public $error=''; + /** - * @var string[] Error codes (or messages) - */ - public $errors = array(); - + * @var string[] Error codes (or messages) + */ + public $errors = array(); + /** * @var DoliDB Database handler. */ @@ -78,6 +78,7 @@ class printing_printipp extends PrintingDriver $this->conf[] = array('enabled'=>1, 'type'=>'submit'); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Print selected file * @@ -87,9 +88,9 @@ class printing_printipp extends PrintingDriver * * @return int 0 if OK, >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function print_file($file, $module, $subdir='') { + // phpcs:enable global $conf, $user; $error = 0; @@ -118,11 +119,11 @@ class printing_printipp extends PrintingDriver { if (! empty($conf->global->PRINTIPP_URI_DEFAULT)) { - dol_syslog("Will use default printer conf->global->PRINTIPP_URI_DEFAULT = ".$conf->global->PRINTIPP_URI_DEFAULT); + dol_syslog("Will use default printer conf->global->PRINTIPP_URI_DEFAULT = ".$conf->global->PRINTIPP_URI_DEFAULT); $ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT); } else - { + { $this->errors[] = 'NoDefaultPrinterDefined'; $error++; return $error; @@ -195,24 +196,25 @@ class printing_printipp extends PrintingDriver $html.= img_picto($langs->trans("Default"),'on'); } else - { - $html.= ''.img_picto($langs->trans("Disabled"),'off').''; - } - $html.= ''; + { + $html.= ''.img_picto($langs->trans("Disabled"),'off').''; + } + $html.= ''; $html.= ''."\n"; } $this->resprint = $html; return $error; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of available printers * * @return array list of printers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function getlist_available_printers() { + // phpcs:enable global $conf,$db; include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php'; $ipp = new CupsPrintIPP(); @@ -225,15 +227,16 @@ class printing_printipp extends PrintingDriver return $ipp->available_printers; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get printer detail * * @param string $uri URI * @return array List of attributes */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_printer_detail($uri) { + // phpcs:enable global $conf,$db; include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php'; @@ -248,6 +251,7 @@ class printing_printipp extends PrintingDriver return $ipp->printer_attributes; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * List jobs print * @@ -255,9 +259,9 @@ class printing_printipp extends PrintingDriver * * @return int 0 if OK, >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function list_jobs($module) { + // phpcs:enable global $conf, $db, $bc; $error = 0; $html = ''; diff --git a/htdocs/core/modules/printsheet/modules_labels.php b/htdocs/core/modules/printsheet/modules_labels.php index 8c86e4ec5d1..ddf061d95e9 100644 --- a/htdocs/core/modules/printsheet/modules_labels.php +++ b/htdocs/core/modules/printsheet/modules_labels.php @@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; /** - * Parent class of document generator for address sheet. + * Parent class of document generator for address sheet. */ class ModelePDFLabels { @@ -40,16 +40,17 @@ class ModelePDFLabels public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='members_labels'; @@ -63,6 +64,7 @@ class ModelePDFLabels } +// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a document onto disk according to template module. * @@ -75,9 +77,9 @@ class ModelePDFLabels * @param string $filename Short file name of PDF output file * @return int <0 if KO, >0 if OK */ -// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outputdir='', $template='standardlabel', $filename='tmp_address_sheet.pdf') { + // phpcs:enable global $conf,$langs; $langs->load("members"); diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php index adb0c821390..33fce830397 100644 --- a/htdocs/core/modules/project/mod_project_simple.php +++ b/htdocs/core/modules/project/mod_project_simple.php @@ -143,16 +143,17 @@ class mod_project_simple extends ModeleNumRefProjects } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Return next reference not yet used as a reference + * Return next reference not yet used as a reference * * @param Societe $objsoc Object third party * @param Project $project Object project * @return string Next not used reference */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function project_get_num($objsoc=0,$project='') { + // phpcs:enable return $this->getNextValue($objsoc,$project); } } diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php index 539683e8c18..76cade72785 100644 --- a/htdocs/core/modules/project/task/mod_task_simple.php +++ b/htdocs/core/modules/project/task/mod_task_simple.php @@ -143,14 +143,14 @@ class mod_task_simple extends ModeleNumRefTask } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** - * Return next reference not yet used as a reference + * Return next reference not yet used as a reference * - * @param Societe $objsoc Object third party - * @param Task $object Object task - * @return string Next not used reference + * @param Societe $objsoc Object third party + * @param Task $object Object task + * @return string Next not used reference */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function task_get_num($objsoc=0,$object='') { return $this->getNextValue($objsoc,$object); diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php index 285b7b2db82..ebefc97da43 100644 --- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php +++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php @@ -164,6 +164,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc return $texte; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -175,9 +176,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc * @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/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php index c0ff3b0e5fc..692dcbf185c 100644 --- a/htdocs/core/modules/societe/modules_societe.class.php +++ b/htdocs/core/modules/societe/modules_societe.class.php @@ -38,23 +38,24 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator */ public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation modules * - * @param DoliDB $db Database handler + * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='company'; $liste=array(); include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; - $liste=getListOfModels($db,$type,$maxfilenamelength); + $liste = getListOfModels($db,$type,$maxfilenamelength); return $liste; } @@ -67,7 +68,7 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator abstract class ModeleThirdPartyCode { /** - * @var string Error code (or message) + * @var string Error code (or message) */ public $error=''; @@ -144,6 +145,7 @@ abstract class ModeleThirdPartyCode return $langs->trans("NotAvailable"); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoie la liste des modeles de numérotation * @@ -151,9 +153,9 @@ abstract class ModeleThirdPartyCode * @param integer $maxfilenamelength Max length of value to show * @return array List of numbers */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable $liste=array(); $sql =""; @@ -177,12 +179,12 @@ abstract class ModeleThirdPartyCode } /** - * Return description of module parameters + * Return description of module parameters * - * @param Translate $langs Output language - * @param Societe $soc Third party object - * @param int $type -1=Nothing, 0=Customer, 1=Supplier - * @return string HTML translated description + * @param Translate $langs Output language + * @param Societe $soc Third party object + * @param int $type -1=Nothing, 0=Customer, 1=Supplier + * @return string HTML translated description */ function getToolTip($langs,$soc,$type) { @@ -243,14 +245,15 @@ abstract class ModeleThirdPartyCode return $s; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Check if mask/numbering use prefix * * @return int 0=no, 1=yes */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function verif_prefixIsUsed() { + // phpcs:enable return 0; } } @@ -355,6 +358,7 @@ abstract class ModeleAccountancyCode return $s; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set accountancy account code for a third party into this->code * @@ -363,10 +367,10 @@ abstract class ModeleAccountancyCode * @param int $type 'customer' or 'supplier' * @return int >=0 if OK, <0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function get_code($db, $societe, $type='') { - global $langs; + // phpcs:enable + global $langs; return $langs->trans("NotAvailable"); } @@ -374,6 +378,7 @@ abstract class ModeleAccountancyCode +// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a document onto disk according to template module. * @@ -389,9 +394,9 @@ abstract class ModeleAccountancyCode * @deprecated Use the new function generateDocument of Facture class * @see Societe::generateDocument() */ -// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function thirdparty_doc_create(DoliDB $db, Societe $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) { + // phpcs:enable dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING); return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref); diff --git a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php index da9b826cab3..df7c5ba7553 100644 --- a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php +++ b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php @@ -42,16 +42,17 @@ abstract class ModelePDFSupplierProposal extends CommonDocGenerator public $error=''; - /** - * Return list of active generation modules - * + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps + /** + * Return list of active generation modules + * * @param DoliDB $db Database handler * @param integer $maxfilenamelength Max length of value to show * @return array List of templates */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps static function liste_modeles($db,$maxfilenamelength=0) { + // phpcs:enable global $conf; $type='supplier_proposal';