From 489074af5c3253b1dba3f06390062de55433677c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 23:25:10 +0200 Subject: [PATCH] move phpcs:ignore --- .../stock/doc/pdf_stdmovement.modules.php | 3 +- .../modules_supplier_payment.php | 3 +- htdocs/fichinter/class/fichinter.class.php | 43 ++++++----- htdocs/livraison/class/livraison.class.php | 52 +++++++------ htdocs/ticket/class/ticket.class.php | 74 +++++++++---------- 5 files changed, 95 insertions(+), 80 deletions(-) diff --git a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php index 3380b27095f..a4795926cc4 100644 --- a/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_stdmovement.modules.php @@ -149,6 +149,7 @@ class pdf_stdmovement extends ModelePDFMovement } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build a document on disk using the generic odt module. * @@ -160,9 +161,9 @@ class pdf_stdmovement extends ModelePDFMovement * @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,$db,$hookmanager; if (! is_object($outputlangs)) $outputlangs=$langs; diff --git a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php index a457d120aab..8eb706dc0ce 100644 --- a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php +++ b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php @@ -28,6 +28,7 @@ abstract class ModelePDFSuppliersPayments extends CommonDocGenerator public $error=''; + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of active generation models * @@ -35,9 +36,9 @@ abstract class ModelePDFSuppliersPayments extends CommonDocGenerator * @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 global $conf; $type='supplier_payment'; diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 9c40dad3d0c..4a983d02104 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -39,12 +39,12 @@ class Fichinter extends CommonObject * @var string ID to identify managed object */ public $element='fichinter'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='fichinter'; - + public $fk_element='fk_fichinter'; public $table_element_line='fichinterdet'; public $picto = 'intervention'; @@ -101,14 +101,15 @@ class Fichinter extends CommonObject $this->products = array(); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load indicators into this->nb for board * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function load_state_board() { + // phpcs:enable global $user; $this->nb=array(); @@ -630,6 +631,7 @@ class Fichinter extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Returns the label of a statut * @@ -637,9 +639,9 @@ class Fichinter extends CommonObject * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode=0) { + // phpcs:enable // Init/load array of translation of status if (empty($this->statuts) || empty($this->statuts_short)) { @@ -662,17 +664,17 @@ class Fichinter extends CommonObject if ($mode == 0) return $this->statuts[$statut]; - if ($mode == 1) + elseif ($mode == 1) return $this->statuts_short[$statut]; - if ($mode == 2) + elseif ($mode == 2) return img_picto($this->statuts_short[$statut], $this->statuts_logo[$statut]).' '.$this->statuts_short[$statut]; - if ($mode == 3) + elseif ($mode == 3) return img_picto($this->statuts_short[$statut], $this->statuts_logo[$statut]); - if ($mode == 4) + elseif ($mode == 4) return img_picto($this->statuts_short[$statut], $this->statuts_logo[$statut]).' '.$this->statuts[$statut]; - if ($mode == 5) + elseif ($mode == 5) return ''.$this->statuts_short[$statut].' '.img_picto($this->statuts[$statut],$this->statuts_logo[$statut]); - if ($mode == 6) + elseif ($mode == 6) return ''.$this->statuts[$statut].' '.img_picto($this->statuts[$statut],$this->statuts_logo[$statut]); return ''; @@ -973,6 +975,7 @@ class Fichinter extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Defines a delivery date of intervention * @@ -980,9 +983,9 @@ class Fichinter extends CommonObject * @param date $date_delivery date of delivery * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_date_delivery($user, $date_delivery) { + // phpcs:enable global $conf; if ($user->rights->ficheinter->creer) @@ -1006,6 +1009,7 @@ class Fichinter extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define the label of the intervention * @@ -1013,9 +1017,9 @@ class Fichinter extends CommonObject * @param string $description description * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_description($user, $description) { + // phpcs:enable global $conf; if ($user->rights->ficheinter->creer) @@ -1040,6 +1044,7 @@ class Fichinter extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Link intervention to a contract * @@ -1047,9 +1052,9 @@ class Fichinter extends CommonObject * @param int $contractid Description * @return int <0 if ko, >0 if ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_contrat($user, $contractid) { + // phpcs:enable global $conf; if ($user->rights->ficheinter->creer) @@ -1249,14 +1254,15 @@ class Fichinter extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load array lines ->lines * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines() { + // phpcs:enable $this->lines = array(); $sql = 'SELECT rowid, description, duree, date, rang'; @@ -1326,7 +1332,7 @@ class FichinterLigne extends CommonObjectLine * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -1343,12 +1349,12 @@ class FichinterLigne extends CommonObjectLine * @var string ID to identify managed object */ public $element='fichinterdet'; - + /** * @var string Name of table without prefix where object is stored */ public $table_element='fichinterdet'; - + public $fk_element='fk_fichinter'; /** @@ -1561,14 +1567,15 @@ class FichinterLigne extends CommonObjectLine } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update total duration into llx_fichinter * * @return int <0 si ko, >0 si ok */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_total() { + // phpcs:enable global $conf; $this->db->begin(); diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index 474447f6de0..70fd069356b 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -43,14 +43,14 @@ class Livraison extends CommonObject * @var string ID to identify managed object */ public $element="delivery"; - + public $fk_element="fk_livraison"; - + /** * @var string Name of table without prefix where object is stored */ public $table_element="livraison"; - + public $table_element_line="livraisondet"; var $brouillon; @@ -221,6 +221,7 @@ class Livraison extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Create a line * @@ -230,9 +231,9 @@ class Livraison extends CommonObject * @param string $description Description * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function create_line($origin_id, $qty, $fk_product, $description) { + // phpcs:enable $error = 0; $idprod = $fk_product; $j = 0; @@ -493,6 +494,7 @@ class Livraison extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Cree le bon de livraison depuis une expedition existante * @@ -500,9 +502,9 @@ class Livraison extends CommonObject * @param int $sending_id Id de l'expedition qui sert de modele * @return integer */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function create_from_sending($user, $sending_id) { + // phpcs:enable $expedition = new Expedition($this->db); $result=$expedition->fetch($sending_id); @@ -539,6 +541,7 @@ class Livraison extends CommonObject return $this->create($user); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Update a livraison line (only extrafields) * @@ -546,9 +549,9 @@ class Livraison extends CommonObject * @param array $array_options extrafields array * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function update_line($id, $array_options=0) { + // phpcs:enable global $conf; $error = 0; @@ -737,14 +740,15 @@ class Livraison extends CommonObject return $result; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Load lines * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function fetch_lines() { + // phpcs:enable $this->lines = array(); $sql = "SELECT ld.rowid, ld.fk_product, ld.description, ld.subprice, ld.total_ht, ld.qty as qty_shipped, ld.fk_origin_line, "; @@ -807,6 +811,7 @@ class Livraison extends CommonObject return $this->LibStatut($this->statut,$mode); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Renvoi le libelle d'un statut donne * @@ -814,34 +819,34 @@ class Livraison extends CommonObject * @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto * @return string Label */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function LibStatut($statut,$mode) { + // phpcs:enable global $langs; if ($mode==0) { if ($statut==-1) return $langs->trans('StatusDeliveryCanceled'); - if ($statut==0) return $langs->trans('StatusDeliveryDraft'); - if ($statut==1) return $langs->trans('StatusDeliveryValidated'); + elseif ($statut==0) return $langs->trans('StatusDeliveryDraft'); + elseif ($statut==1) return $langs->trans('StatusDeliveryValidated'); } - if ($mode==1) + elseif ($mode==1) { if ($statut==-1) return $langs->trans($this->statuts[$statut]); - if ($statut==0) return $langs->trans($this->statuts[$statut]); - if ($statut==1) return $langs->trans($this->statuts[$statut]); + elseif ($statut==0) return $langs->trans($this->statuts[$statut]); + elseif ($statut==1) return $langs->trans($this->statuts[$statut]); } - if ($mode == 4) + elseif ($mode == 4) { if ($statut==-1) return img_picto($langs->trans('StatusDeliveryCanceled'),'statut5').' '.$langs->trans('StatusDeliveryCanceled'); - if ($statut==0) return img_picto($langs->trans('StatusDeliveryDraft'),'statut0').' '.$langs->trans('StatusDeliveryDraft'); - if ($statut==1) return img_picto($langs->trans('StatusDeliveryValidated'),'statut4').' '.$langs->trans('StatusDeliveryValidated'); + elseif ($statut==0) return img_picto($langs->trans('StatusDeliveryDraft'),'statut0').' '.$langs->trans('StatusDeliveryDraft'); + elseif ($statut==1) return img_picto($langs->trans('StatusDeliveryValidated'),'statut4').' '.$langs->trans('StatusDeliveryValidated'); } - if ($mode == 6) + elseif ($mode == 6) { if ($statut==-1) return $langs->trans('StatusDeliveryCanceled').' '.img_picto($langs->trans('StatusDeliveryCanceled'),'statut5'); - if ($statut==0) return $langs->trans('StatusDeliveryDraft').' '.img_picto($langs->trans('StatusDeliveryDraft'),'statut0'); - if ($statut==1) return $langs->trans('StatusDeliveryValidated').' '.img_picto($langs->trans('StatusDeliveryValidated'),'statut4'); + elseif ($statut==0) return $langs->trans('StatusDeliveryDraft').' '.img_picto($langs->trans('StatusDeliveryDraft'),'statut0'); + elseif ($statut==1) return $langs->trans('StatusDeliveryValidated').' '.img_picto($langs->trans('StatusDeliveryValidated'),'statut4'); } } @@ -979,6 +984,7 @@ class Livraison extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set the planned delivery date * @@ -986,9 +992,9 @@ class Livraison extends CommonObject * @param timestamp $date_livraison Date de livraison * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function set_date_livraison($user, $date_livraison) { + // phpcs:enable if ($user->rights->expedition->creer) { $sql = "UPDATE ".MAIN_DB_PREFIX."livraison"; @@ -1083,12 +1089,12 @@ class LivraisonLigne extends CommonObjectLine var $price; var $fk_product; var $origin_id; - + /** * @var string proper name for given parameter */ public $label; - + var $description; // Description produit /** * @deprecated @@ -1108,7 +1114,7 @@ class LivraisonLigne extends CommonObjectLine * @var string ID to identify managed object */ public $element='livraisondet'; - + /** * @var string Name of table without prefix where object is stored */ diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 74f5c825e6c..cd6820cbe1c 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -216,8 +216,6 @@ class Ticket extends CommonObject const STATUS_CANCELED = 9; - - /** * Constructor * @@ -1169,6 +1167,7 @@ class Ticket extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return status label of object * @@ -1176,146 +1175,146 @@ class Ticket extends CommonObject * @param int $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 global $langs; if ($mode == 0) { 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.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 1) { + elseif ($statut == 1) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 3) { + elseif ($statut == 3) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 4) { + elseif ($statut == 4) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 5) { + elseif ($statut == 5) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 6) { + elseif ($statut == 6) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 8) { + elseif ($statut == 8) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 9) { + elseif ($statut == 9) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket') . ' ' . $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.png@ticket'); } - if ($statut == 1) { + elseif ($statut == 1) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket'); } - if ($statut == 3) { + elseif ($statut == 3) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket'); } - if ($statut == 4) { + elseif ($statut == 4) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket'); } - if ($statut == 5) { + elseif ($statut == 5) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket'); } - if ($statut == 6) { + elseif ($statut == 6) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket'); } - if ($statut == 8) { + elseif ($statut == 8) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket'); } - if ($statut == 9) { + elseif ($statut == 9) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket'); } } - if ($mode == 4) { + elseif ($mode == 4) { if ($statut == 0) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut0.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 1) { + elseif ($statut == 1) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 3) { + elseif ($statut == 3) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 4) { + elseif ($statut == 4) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 5) { + elseif ($statut == 5) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 6) { + elseif ($statut == 6) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 8) { + elseif ($statut == 8) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket') . ' ' . $langs->trans($this->statuts_short[$statut]); } - if ($statut == 9) { + elseif ($statut == 9) { return img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket') . ' ' . $langs->trans($this->statuts_short[$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.png@ticket'); } - if ($statut == 1) { + elseif ($statut == 1) { return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut1.png@ticket'); } - if ($statut == 3) { + elseif ($statut == 3) { return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut3.png@ticket'); } - if ($statut == 4) { + elseif ($statut == 4) { return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut4.png@ticket'); } - if ($statut == 5) { + elseif ($statut == 5) { return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut5.png@ticket'); } - if ($statut == 6) { + elseif ($statut == 6) { return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut6.png@ticket'); } - if ($statut == 8) { + elseif ($statut == 8) { return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut8.png@ticket'); } - if ($statut == 9) { + elseif ($statut == 9) { return $langs->trans($this->statuts_short[$statut]) . ' ' . img_picto($langs->trans($this->statuts_short[$statut]), 'statut9.png@ticket'); } } @@ -2447,15 +2446,16 @@ class Ticket extends CommonObject } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return if at least one photo is available * * @param string $sdir Directory to scan * @return boolean True if at least one photo is available, False if not */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function is_photo_available($sdir) { + // phpcs:enable include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; global $conf;