From 47e73bfd8e937950925025067c6a22405f83da66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 2 Sep 2018 23:01:14 +0200 Subject: [PATCH] move phpcs:ignore --- .../class/commonstickergenerator.class.php | 21 ++-- htdocs/core/class/discount.class.php | 8 +- htdocs/core/class/doleditor.class.php | 3 +- htdocs/core/class/dolgraph.class.php | 97 ++++++++++++------- htdocs/core/class/dolreceiptprinter.class.php | 41 ++++---- .../core/class/html.formaccounting.class.php | 20 ++-- htdocs/core/class/html.formactions.class.php | 8 +- htdocs/core/class/html.formadmin.class.php | 26 +++-- htdocs/core/class/html.formcron.class.php | 5 +- htdocs/core/class/openid.class.php | 57 +++++++---- htdocs/core/class/translate.class.php | 9 +- 11 files changed, 186 insertions(+), 109 deletions(-) diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php index 26227048782..6d4c32d82bb 100644 --- a/htdocs/core/class/commonstickergenerator.class.php +++ b/htdocs/core/class/commonstickergenerator.class.php @@ -94,6 +94,7 @@ abstract class CommonStickerGenerator $this->db = $db; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to build PDF on disk, then output on HTTP strem. * @@ -103,8 +104,8 @@ abstract class CommonStickerGenerator * @param string $outputdir Output directory for pdf file * @return int 1=OK, 0=KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps abstract function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$outputdir=''); + // phpcs:enable /** * Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0) @@ -116,6 +117,7 @@ abstract class CommonStickerGenerator */ abstract function addSticker(&$pdf,$outputlangs,$param); + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Methode qui permet de modifier la taille des caracteres * Cela modiera aussi l'espace entre chaque ligne @@ -124,9 +126,9 @@ abstract class CommonStickerGenerator * @param int $pt point * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Set_Char_Size(&$pdf,$pt) { + // phpcs:enable if ($pt > 3) { $this->_Char_Size = $pt; $this->_Line_Height = $this->_Get_Height_Chars($pt); @@ -134,6 +136,7 @@ abstract class CommonStickerGenerator } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * protected Print dot line * @@ -146,9 +149,9 @@ abstract class CommonStickerGenerator * @param int $nbPointilles Nb pointilles * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _Pointille(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$nbPointilles=15) { + // phpcs:enable $pdf->SetLineWidth($epaisseur); $length=abs($x1-$x2); $hauteur=abs($y1-$y2); @@ -176,6 +179,7 @@ abstract class CommonStickerGenerator } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * protected Function realisant une croix aux 4 coins des cartes * @@ -188,9 +192,9 @@ abstract class CommonStickerGenerator * @param int $taille Size * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _Croix(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$taille=4) { + // phpcs:enable $pdf->SetDrawColor(192,192,192); $pdf->SetLineWidth($epaisseur); @@ -211,6 +215,7 @@ abstract class CommonStickerGenerator $pdf->SetDrawColor(0,0,0); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * protected Convert units (in to mm, mm to in) * $src and $dest must be 'in' or 'mm' @@ -220,9 +225,9 @@ abstract class CommonStickerGenerator * @param string $dest to * @return float value value after conversion */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _Convert_Metric($value, $src, $dest) { + // phpcs:enable if ($src != $dest) { $tab['in'] = 39.37008; $tab['mm'] = 1000; @@ -232,15 +237,16 @@ abstract class CommonStickerGenerator } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * protected Give the height for a char size given. * * @param int $pt Point * @return int Height chars */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _Get_Height_Chars($pt) { + // phpcs:enable // Tableau de concordance entre la hauteur des caracteres et de l'espacement entre les lignes $_Table_Hauteur_Chars = array(6=>2, 7=>2.5, 8=>3, 9=>3.5, 10=>4, 11=>6, 12=>7, 13=>8, 14=>9, 15=>10); if (in_array($pt, array_keys($_Table_Hauteur_Chars))) { @@ -250,6 +256,7 @@ abstract class CommonStickerGenerator } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * protected Set format * @@ -257,9 +264,9 @@ abstract class CommonStickerGenerator * @param string $format Format * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function _Set_Format(&$pdf, $format) { + // phpcs:enable $this->_Metric = $format['metric']; $this->_Avery_Name = $format['name']; $this->_Avery_Code = $format['code']; diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index a2ac7a1f458..b1a92ae0f5f 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -32,7 +32,7 @@ class DiscountAbsolute * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -344,6 +344,7 @@ class DiscountAbsolute + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Link the discount to a particular invoice line or a particular invoice. * When discount is a global discount used as an invoice line, we link using rowidline. @@ -353,9 +354,9 @@ class DiscountAbsolute * @param int $rowidinvoice Invoice id (To use discount as a credit note to reduc payment of invoice) * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function link_to_invoice($rowidline,$rowidinvoice) { + // phpcs:enable // Check parameters if (! $rowidline && ! $rowidinvoice) { @@ -399,15 +400,16 @@ class DiscountAbsolute } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Link the discount to a particular invoice line or a particular invoice. * Do not call this if discount is linked to a reconcialiated invoice * * @return int <0 if KO, >0 if OK */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function unlink_invoice() { + // phpcs:enable $sql ="UPDATE ".MAIN_DB_PREFIX."societe_remise_except"; if(! empty($this->discount_type)) { $sql.=" SET fk_invoice_supplier_line = NULL, fk_invoice_supplier = NULL"; diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 52d9b47ecdf..548721be05f 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -137,6 +137,7 @@ class DolEditor } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output edit area inside the HTML stream. * Output depends on this->tool (fckeditor, ckeditor, textarea, ...) @@ -148,9 +149,9 @@ class DolEditor * @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', ...) * @return void|string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function Create($noprint=0, $morejs='', $disallowAnyContent=true, $titlecontent='', $option='') { + // phpcs:enable global $conf,$langs; $fullpage=false; diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php index 55ecc77291a..f3d6041515c 100644 --- a/htdocs/core/class/dolgraph.class.php +++ b/htdocs/core/class/dolgraph.class.php @@ -69,7 +69,7 @@ class DolGraph var $showpercent=0; var $combine=0; // 0.05 if you want to combine records < 5% into "other" var $graph; // Objet Graph (Artichow, Phplot...) - + /** * @var string Error code (or message) */ @@ -128,120 +128,130 @@ class DolGraph } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set Y precision * * @param float $which_prec Precision * @return boolean */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetPrecisionY($which_prec) { + // phpcs:enable $this->PrecisionY = $which_prec; return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 * * @param float $xi Xi * @return boolean True */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetHorizTickIncrement($xi) { + // phpcs:enable $this->horizTickIncrement = $xi; return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 * * @param float $xt Xt * @return boolean True */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetNumXTicks($xt) { + // phpcs:enable $this->SetNumXTicks = $xt; return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set label interval to reduce number of labels * * @param float $x Label interval * @return boolean True */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetLabelInterval($x) { + // phpcs:enable $this->labelInterval = $x; return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Hide X grid * * @param boolean $bool XGrid or not * @return boolean true */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetHideXGrid($bool) { + // phpcs:enable $this->hideXGrid = $bool; return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Hide Y grid * * @param boolean $bool YGrid or not * @return boolean true */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetHideYGrid($bool) { + // phpcs:enable $this->hideYGrid = $bool; return true; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set y label * * @param string $label Y label * @return boolean|null True */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetYLabel($label) { + // phpcs:enable $this->YLabel = $label; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set width * * @param int $w Width * @return boolean|null True */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetWidth($w) { + // phpcs:enable $this->width = $w; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set title * * @param string $title Title * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetTitle($title) { + // phpcs:enable $this->title = $title; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set data * @@ -249,161 +259,174 @@ class DolGraph * @return void * @see draw_jflot for syntax of data array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetData($data) { + // phpcs:enable $this->data = $data; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set data * * @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetDataColor($datacolor) { + // phpcs:enable $this->datacolor = $datacolor; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set type * * @param array $type Array with type for each serie. Example: array('pie'), array('lines',...,'bars') * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetType($type) { + // phpcs:enable $this->type = $type; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set legend * * @param array $legend Legend. Example: array('seriename1','seriname2',...) * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetLegend($legend) { + // phpcs:enable $this->Legend = $legend; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set min width * * @param int $legendwidthmin Min width * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetLegendWidthMin($legendwidthmin) { + // phpcs:enable $this->LegendWidthMin = $legendwidthmin; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set max value * * @param int $max Max value * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetMaxValue($max) { + // phpcs:enable $this->MaxValue = $max; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get max value * * @return int Max value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetMaxValue() { + // phpcs:enable return $this->MaxValue; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set min value * * @param int $min Min value * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetMinValue($min) { + // phpcs:enable $this->MinValue = $min; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get min value * * @return int Max value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetMinValue() { + // phpcs:enable return $this->MinValue; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set height * * @param int $h Height * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetHeight($h) { + // phpcs:enable $this->height = $h; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set shading * * @param string $s Shading * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetShading($s) { + // phpcs:enable $this->SetShading = $s; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Set shading * * @param string $s Shading * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetCssPrefix($s) { + // phpcs:enable $this->cssprefix = $s; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Reset bg color * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function ResetBgColor() { + // phpcs:enable unset($this->bgcolor); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Reset bgcolorgrid * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function ResetBgColorGrid() { + // phpcs:enable unset($this->bgcolorgrid); } @@ -452,15 +475,16 @@ class DolGraph + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define background color of complete image * * @param array $bg_color array(R,G,B) ou 'onglet' ou 'default' * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetBgColor($bg_color = array(255,255,255)) { + // phpcs:enable global $theme_bgcolor,$theme_bgcoloronglet; if (! is_array($bg_color)) @@ -481,15 +505,16 @@ class DolGraph } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Define background color of grid * * @param array $bg_colorgrid array(R,G,B) ou 'onglet' ou 'default' * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SetBgColorGrid($bg_colorgrid = array(255,255,255)) { + // phpcs:enable global $theme_bgcolor,$theme_bgcoloronglet; if (! is_array($bg_colorgrid)) @@ -510,25 +535,27 @@ class DolGraph } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Reset data color * * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function ResetDataColor() { + // phpcs:enable unset($this->datacolor); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Get max value * * @return int Max value */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetMaxValueInData() { + // phpcs:enable $k = 0; $vals = array(); @@ -547,14 +574,15 @@ class DolGraph return $vals[0]; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return min value of all data * * @return int Min value of all data */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetMinValueInData() { + // phpcs:enable $k = 0; $vals = array(); @@ -573,14 +601,15 @@ class DolGraph return $vals[0]; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return max value of all data * * @return int Max value of all data */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetCeilMaxValue() { + // phpcs:enable $max = $this->GetMaxValueInData(); if ($max != 0) $max++; $size=dol_strlen(abs(ceil($max))); @@ -597,14 +626,15 @@ class DolGraph return $res; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return min value of all data * * @return double Max value of all data */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function GetFloorMinValue() { + // phpcs:enable $min = $this->GetMinValueInData(); if ($min == '') $min=0; if ($min != 0) $min--; @@ -659,7 +689,7 @@ class DolGraph * @param string $fileurl Url path to show image if saved onto disk * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private function draw_artichow($file,$fileurl) { global $artichow_defaultfont; @@ -832,6 +862,7 @@ class DolGraph } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Build a graph using JFlot library. Input when calling this method should be: * $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB)); @@ -848,9 +879,9 @@ class DolGraph * @param string $fileurl Url path to show image if saved onto disk. Never used here. * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps private function draw_jflot($file,$fileurl) { + // phpcs:enable global $artichow_defaultfont; dol_syslog(get_class($this)."::draw_jflot this->type=".join(',',$this->type)." this->MaxValue=".$this->MaxValue); diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php index a00da884aba..36881b76f84 100644 --- a/htdocs/core/class/dolreceiptprinter.class.php +++ b/htdocs/core/class/dolreceiptprinter.class.php @@ -105,25 +105,25 @@ class dolReceiptPrinter extends Escpos const CONNECTOR_NETWORK_PRINT = 3; const CONNECTOR_WINDOWS_PRINT = 4; //const CONNECTOR_JAVA = 5; - + /** * @var DoliDB Database handler. */ public $db; - + var $tags; var $printer; var $template; - + /** - * @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(); @@ -350,6 +350,7 @@ class dolReceiptPrinter extends Escpos } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to Add a printer in db * @@ -359,9 +360,9 @@ class dolReceiptPrinter extends Escpos * @param string $parameter Printer parameter * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function AddPrinter($name, $type, $profile, $parameter) { + // phpcs:enable global $conf; $error = 0; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt'; @@ -375,6 +376,7 @@ class dolReceiptPrinter extends Escpos return $error; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to Update a printer in db * @@ -385,9 +387,9 @@ class dolReceiptPrinter extends Escpos * @param int $printerid Printer id * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function UpdatePrinter($name, $type, $profile, $parameter, $printerid) { + // phpcs:enable global $conf; $error = 0; $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt'; @@ -404,15 +406,16 @@ class dolReceiptPrinter extends Escpos return $error; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to Delete a printer from db * * @param int $printerid Printer id * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function DeletePrinter($printerid) { + // phpcs:enable global $conf; $error = 0; $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt'; @@ -425,6 +428,7 @@ class dolReceiptPrinter extends Escpos return $error; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to Update a printer template in db * @@ -433,9 +437,9 @@ class dolReceiptPrinter extends Escpos * @param int $templateid Template id * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function UpdateTemplate($name, $template, $templateid) { + // phpcs:enable global $conf; $error = 0; $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt_template'; @@ -451,15 +455,16 @@ class dolReceiptPrinter extends Escpos } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to Send Test page to Printer * * @param int $printerid Printer id * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SendTestToPrinter($printerid) { + // phpcs:enable global $conf; $error = 0; $img = new EscposImage(DOL_DOCUMENT_ROOT .'/theme/common/dolibarr_logo_bw.png'); @@ -486,6 +491,7 @@ class dolReceiptPrinter extends Escpos return $error; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function to Print Receipt Ticket * @@ -494,9 +500,9 @@ class dolReceiptPrinter extends Escpos * @param int $printerid Printer id * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function SendToPrinter($object, $templateid, $printerid) { + // phpcs:enable global $conf; $error = 0; $ret = $this->loadTemplate($templateid); @@ -650,15 +656,16 @@ class dolReceiptPrinter extends Escpos } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Function Init Printer * * @param int $printerid Printer id * @return int 0 if OK; >0 if KO */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function InitPrinter($printerid) { + // phpcs:enable global $conf; $error=0; $sql = 'SELECT rowid, name, fk_type, fk_profile, parameter'; diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 64e33cd5023..5ffaf0463a6 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -39,7 +39,7 @@ class FormAccounting extends Form * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -55,6 +55,7 @@ class FormAccounting extends Form $this->db = $db; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of journals with label by nature * @@ -69,9 +70,9 @@ class FormAccounting extends Form * @param int $disabledajaxcombo Disable ajax combo box. * @return string String with HTML select */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_journal($selectid, $htmlname = 'journal', $nature=0, $showempty = 0, $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='', $disabledajaxcombo=0) { + // phpcs:enable global $conf,$langs; $out = ''; @@ -137,6 +138,7 @@ class FormAccounting extends Form return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of accounting category. * Use mysoc->country_id or mysoc->country_code so they must be defined. @@ -149,9 +151,9 @@ class FormAccounting extends Form * @param int $allcountries All countries * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_accounting_category($selected='',$htmlname='account_category', $useempty=0, $maxlen=0, $help=1, $allcountries=0) { + // phpcs:enable global $db,$langs,$user,$mysoc; if (empty($mysoc->country_id) && empty($mysoc->country_code) && empty($allcountries)) @@ -218,6 +220,7 @@ class FormAccounting extends Form print $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return select filter with date of transaction * @@ -225,9 +228,9 @@ class FormAccounting extends Form * @param string $selectedkey Value * @return string HTML edit field */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '') { + // phpcs:enable $options = array(); $sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping'; @@ -250,6 +253,7 @@ class FormAccounting extends Form return Form::selectarray($htmlname, $options, $selectedkey); } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of accounts with label by chart of accounts * @@ -263,9 +267,9 @@ class FormAccounting extends Form * @param string $usecache Key to use to store result into a cache. Next call with same key will reuse the cache. * @return string String with HTML select */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $morecss='maxwidth300 maxwidthonsmartphone', $usecache='') { + // phpcs:enable global $conf, $langs; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; @@ -342,6 +346,7 @@ class FormAccounting extends Form return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of auxilary thirdparty accounts * @@ -351,9 +356,9 @@ class FormAccounting extends Form * @param string $morecss More css * @return string String with HTML select */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200') { + // phpcs:enable $aux_account = array(); @@ -403,6 +408,7 @@ class FormAccounting extends Form return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return HTML combo list of years existing into book keepping * @@ -412,9 +418,9 @@ class FormAccounting extends Form * @param string $output_format (html/opton (for option html only)/array (to return options arrays * @return string/array */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html') { + // phpcs:enable global $conf; $out_array = array(); diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index 7fc07ab46ed..e01e1f2ad65 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -33,7 +33,7 @@ class FormActions * @var DoliDB Database handler. */ public $db; - + /** * @var string Error code (or message) */ @@ -52,6 +52,7 @@ class FormActions } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Show list of action status * @@ -64,9 +65,9 @@ class FormActions * @param string $morecss More css on select field * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function form_select_status_action($formname, $selected, $canedit=1, $htmlname='complete', $showempty=0, $onlyselect=0, $morecss='maxwidth100') { + // phpcs:enable global $langs,$conf; $listofstatus = array( @@ -314,6 +315,7 @@ class FormActions } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Output html select list of type of event * @@ -326,9 +328,9 @@ class FormActions * @param int $nooutput 1=No output * @return string */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_type_actions($selected='', $htmlname='actioncode', $excludetype='', $onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0) { + // phpcs:enable global $langs,$user,$form,$conf; if (! is_object($form)) $form=new Form($db); diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index fd9bc3ab3f9..22fa73741ce 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -29,15 +29,8 @@ */ class FormAdmin { - /** - * @var DoliDB Database handler. - */ - public $db; - - /** - * @var string Error code (or message) - */ - public $error=''; + var $db; + var $error; /** @@ -51,6 +44,7 @@ class FormAdmin return 1; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return html select list with available languages (key='en_US', value='United States' for example) * @@ -66,9 +60,9 @@ class FormAdmin * @param int $forcecombo Force to use combo box (so no ajax beautify effect) * @return string Return HTML select string with list of languages */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_language($selected='', $htmlname='lang_id', $showauto=0, $filter=null, $showempty='', $showwarning=0, $disabled=0, $morecss='', $showcode=0, $forcecombo=0) { + // phpcs:enable global $langs; $langs_available=$langs->get_available_languages(DOL_DOCUMENT_ROOT,12); @@ -127,6 +121,7 @@ class FormAdmin return $out; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return list of available menus (eldy_backoffice, ...) * @@ -136,9 +131,9 @@ class FormAdmin * @param string $moreattrib More attributes on html select tag * @return integer|null */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib='') { + // phpcs:enable global $langs,$conf; // Clean parameters @@ -217,6 +212,7 @@ class FormAdmin print ''; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return combo list of available menu families * @@ -225,9 +221,9 @@ class FormAdmin * @param string[] $dirmenuarray Directories to scan * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_menu_families($selected, $htmlname, $dirmenuarray) { + // phpcs:enable global $langs,$conf; //$expdevmenu=array('smartphone_backoffice.php','smartphone_frontoffice.php'); // Menu to disable if $conf->global->MAIN_FEATURES_LEVEL is not set @@ -289,6 +285,7 @@ class FormAdmin } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps /** * Return a HTML select list of timezones * @@ -296,9 +293,9 @@ class FormAdmin * @param string $htmlname Nom de la zone select * @return void */ - // phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function select_timezone($selected,$htmlname) { + // phpcs:enable global $langs,$conf; print '