move phpcs:ignore

This commit is contained in:
Frédéric FRANCE 2018-09-02 23:01:14 +02:00
parent 2a9ef8dc05
commit 47e73bfd8e
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
11 changed files with 186 additions and 109 deletions

View File

@ -94,6 +94,7 @@ abstract class CommonStickerGenerator
$this->db = $db; $this->db = $db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to build PDF on disk, then output on HTTP strem. * 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 * @param string $outputdir Output directory for pdf file
* @return int 1=OK, 0=KO * @return int 1=OK, 0=KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
abstract function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$outputdir=''); 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) * 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); abstract function addSticker(&$pdf,$outputlangs,$param);
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Methode qui permet de modifier la taille des caracteres * Methode qui permet de modifier la taille des caracteres
* Cela modiera aussi l'espace entre chaque ligne * Cela modiera aussi l'espace entre chaque ligne
@ -124,9 +126,9 @@ abstract class CommonStickerGenerator
* @param int $pt point * @param int $pt point
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function Set_Char_Size(&$pdf,$pt) function Set_Char_Size(&$pdf,$pt)
{ {
// phpcs:enable
if ($pt > 3) { if ($pt > 3) {
$this->_Char_Size = $pt; $this->_Char_Size = $pt;
$this->_Line_Height = $this->_Get_Height_Chars($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 * protected Print dot line
* *
@ -146,9 +149,9 @@ abstract class CommonStickerGenerator
* @param int $nbPointilles Nb pointilles * @param int $nbPointilles Nb pointilles
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _Pointille(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$nbPointilles=15) function _Pointille(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$nbPointilles=15)
{ {
// phpcs:enable
$pdf->SetLineWidth($epaisseur); $pdf->SetLineWidth($epaisseur);
$length=abs($x1-$x2); $length=abs($x1-$x2);
$hauteur=abs($y1-$y2); $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 * protected Function realisant une croix aux 4 coins des cartes
* *
@ -188,9 +192,9 @@ abstract class CommonStickerGenerator
* @param int $taille Size * @param int $taille Size
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _Croix(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$taille=4) function _Croix(&$pdf,$x1=0,$y1=0,$x2=210,$y2=297,$epaisseur=1,$taille=4)
{ {
// phpcs:enable
$pdf->SetDrawColor(192,192,192); $pdf->SetDrawColor(192,192,192);
$pdf->SetLineWidth($epaisseur); $pdf->SetLineWidth($epaisseur);
@ -211,6 +215,7 @@ abstract class CommonStickerGenerator
$pdf->SetDrawColor(0,0,0); $pdf->SetDrawColor(0,0,0);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* protected Convert units (in to mm, mm to in) * protected Convert units (in to mm, mm to in)
* $src and $dest must be 'in' or 'mm' * $src and $dest must be 'in' or 'mm'
@ -220,9 +225,9 @@ abstract class CommonStickerGenerator
* @param string $dest to * @param string $dest to
* @return float value value after conversion * @return float value value after conversion
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _Convert_Metric($value, $src, $dest) function _Convert_Metric($value, $src, $dest)
{ {
// phpcs:enable
if ($src != $dest) { if ($src != $dest) {
$tab['in'] = 39.37008; $tab['in'] = 39.37008;
$tab['mm'] = 1000; $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. * protected Give the height for a char size given.
* *
* @param int $pt Point * @param int $pt Point
* @return int Height chars * @return int Height chars
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _Get_Height_Chars($pt) function _Get_Height_Chars($pt)
{ {
// phpcs:enable
// Tableau de concordance entre la hauteur des caracteres et de l'espacement entre les lignes // 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); $_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))) { 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 * protected Set format
* *
@ -257,9 +264,9 @@ abstract class CommonStickerGenerator
* @param string $format Format * @param string $format Format
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _Set_Format(&$pdf, $format) function _Set_Format(&$pdf, $format)
{ {
// phpcs:enable
$this->_Metric = $format['metric']; $this->_Metric = $format['metric'];
$this->_Avery_Name = $format['name']; $this->_Avery_Name = $format['name'];
$this->_Avery_Code = $format['code']; $this->_Avery_Code = $format['code'];

View File

@ -32,7 +32,7 @@ class DiscountAbsolute
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
/** /**
* @var string Error code (or message) * @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. * 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. * 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) * @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 * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function link_to_invoice($rowidline,$rowidinvoice) function link_to_invoice($rowidline,$rowidinvoice)
{ {
// phpcs:enable
// Check parameters // Check parameters
if (! $rowidline && ! $rowidinvoice) 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. * Link the discount to a particular invoice line or a particular invoice.
* Do not call this if discount is linked to a reconcialiated invoice * Do not call this if discount is linked to a reconcialiated invoice
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function unlink_invoice() function unlink_invoice()
{ {
// phpcs:enable
$sql ="UPDATE ".MAIN_DB_PREFIX."societe_remise_except"; $sql ="UPDATE ".MAIN_DB_PREFIX."societe_remise_except";
if(! empty($this->discount_type)) { if(! empty($this->discount_type)) {
$sql.=" SET fk_invoice_supplier_line = NULL, fk_invoice_supplier = NULL"; $sql.=" SET fk_invoice_supplier_line = NULL, fk_invoice_supplier = NULL";

View File

@ -137,6 +137,7 @@ class DolEditor
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output edit area inside the HTML stream. * Output edit area inside the HTML stream.
* Output depends on this->tool (fckeditor, ckeditor, textarea, ...) * 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', ...) * @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', ...)
* @return void|string * @return void|string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function Create($noprint=0, $morejs='', $disallowAnyContent=true, $titlecontent='', $option='') function Create($noprint=0, $morejs='', $disallowAnyContent=true, $titlecontent='', $option='')
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$fullpage=false; $fullpage=false;

View File

@ -69,7 +69,7 @@ class DolGraph
var $showpercent=0; var $showpercent=0;
var $combine=0; // 0.05 if you want to combine records < 5% into "other" var $combine=0; // 0.05 if you want to combine records < 5% into "other"
var $graph; // Objet Graph (Artichow, Phplot...) var $graph; // Objet Graph (Artichow, Phplot...)
/** /**
* @var string Error code (or message) * @var string Error code (or message)
*/ */
@ -128,120 +128,130 @@ class DolGraph
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set Y precision * Set Y precision
* *
* @param float $which_prec Precision * @param float $which_prec Precision
* @return boolean * @return boolean
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetPrecisionY($which_prec) function SetPrecisionY($which_prec)
{ {
// phpcs:enable
$this->PrecisionY = $which_prec; $this->PrecisionY = $which_prec;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
* *
* @param float $xi Xi * @param float $xi Xi
* @return boolean True * @return boolean True
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetHorizTickIncrement($xi) function SetHorizTickIncrement($xi)
{ {
// phpcs:enable
$this->horizTickIncrement = $xi; $this->horizTickIncrement = $xi;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2 * Utiliser SetNumTicks ou SetHorizTickIncrement mais pas les 2
* *
* @param float $xt Xt * @param float $xt Xt
* @return boolean True * @return boolean True
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetNumXTicks($xt) function SetNumXTicks($xt)
{ {
// phpcs:enable
$this->SetNumXTicks = $xt; $this->SetNumXTicks = $xt;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set label interval to reduce number of labels * Set label interval to reduce number of labels
* *
* @param float $x Label interval * @param float $x Label interval
* @return boolean True * @return boolean True
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetLabelInterval($x) function SetLabelInterval($x)
{ {
// phpcs:enable
$this->labelInterval = $x; $this->labelInterval = $x;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Hide X grid * Hide X grid
* *
* @param boolean $bool XGrid or not * @param boolean $bool XGrid or not
* @return boolean true * @return boolean true
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetHideXGrid($bool) function SetHideXGrid($bool)
{ {
// phpcs:enable
$this->hideXGrid = $bool; $this->hideXGrid = $bool;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Hide Y grid * Hide Y grid
* *
* @param boolean $bool YGrid or not * @param boolean $bool YGrid or not
* @return boolean true * @return boolean true
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetHideYGrid($bool) function SetHideYGrid($bool)
{ {
// phpcs:enable
$this->hideYGrid = $bool; $this->hideYGrid = $bool;
return true; return true;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set y label * Set y label
* *
* @param string $label Y label * @param string $label Y label
* @return boolean|null True * @return boolean|null True
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetYLabel($label) function SetYLabel($label)
{ {
// phpcs:enable
$this->YLabel = $label; $this->YLabel = $label;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set width * Set width
* *
* @param int $w Width * @param int $w Width
* @return boolean|null True * @return boolean|null True
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetWidth($w) function SetWidth($w)
{ {
// phpcs:enable
$this->width = $w; $this->width = $w;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set title * Set title
* *
* @param string $title Title * @param string $title Title
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetTitle($title) function SetTitle($title)
{ {
// phpcs:enable
$this->title = $title; $this->title = $title;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set data * Set data
* *
@ -249,161 +259,174 @@ class DolGraph
* @return void * @return void
* @see draw_jflot for syntax of data array * @see draw_jflot for syntax of data array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetData($data) function SetData($data)
{ {
// phpcs:enable
$this->data = $data; $this->data = $data;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set data * Set data
* *
* @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...) * @param array $datacolor Data color array(array(R,G,B),array(R,G,B)...)
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetDataColor($datacolor) function SetDataColor($datacolor)
{ {
// phpcs:enable
$this->datacolor = $datacolor; $this->datacolor = $datacolor;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set type * Set type
* *
* @param array $type Array with type for each serie. Example: array('pie'), array('lines',...,'bars') * @param array $type Array with type for each serie. Example: array('pie'), array('lines',...,'bars')
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetType($type) function SetType($type)
{ {
// phpcs:enable
$this->type = $type; $this->type = $type;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set legend * Set legend
* *
* @param array $legend Legend. Example: array('seriename1','seriname2',...) * @param array $legend Legend. Example: array('seriename1','seriname2',...)
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetLegend($legend) function SetLegend($legend)
{ {
// phpcs:enable
$this->Legend = $legend; $this->Legend = $legend;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set min width * Set min width
* *
* @param int $legendwidthmin Min width * @param int $legendwidthmin Min width
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetLegendWidthMin($legendwidthmin) function SetLegendWidthMin($legendwidthmin)
{ {
// phpcs:enable
$this->LegendWidthMin = $legendwidthmin; $this->LegendWidthMin = $legendwidthmin;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set max value * Set max value
* *
* @param int $max Max value * @param int $max Max value
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetMaxValue($max) function SetMaxValue($max)
{ {
// phpcs:enable
$this->MaxValue = $max; $this->MaxValue = $max;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get max value * Get max value
* *
* @return int Max value * @return int Max value
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetMaxValue() function GetMaxValue()
{ {
// phpcs:enable
return $this->MaxValue; return $this->MaxValue;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set min value * Set min value
* *
* @param int $min Min value * @param int $min Min value
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetMinValue($min) function SetMinValue($min)
{ {
// phpcs:enable
$this->MinValue = $min; $this->MinValue = $min;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get min value * Get min value
* *
* @return int Max value * @return int Max value
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetMinValue() function GetMinValue()
{ {
// phpcs:enable
return $this->MinValue; return $this->MinValue;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set height * Set height
* *
* @param int $h Height * @param int $h Height
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetHeight($h) function SetHeight($h)
{ {
// phpcs:enable
$this->height = $h; $this->height = $h;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set shading * Set shading
* *
* @param string $s Shading * @param string $s Shading
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetShading($s) function SetShading($s)
{ {
// phpcs:enable
$this->SetShading = $s; $this->SetShading = $s;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set shading * Set shading
* *
* @param string $s Shading * @param string $s Shading
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetCssPrefix($s) function SetCssPrefix($s)
{ {
// phpcs:enable
$this->cssprefix = $s; $this->cssprefix = $s;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Reset bg color * Reset bg color
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ResetBgColor() function ResetBgColor()
{ {
// phpcs:enable
unset($this->bgcolor); unset($this->bgcolor);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Reset bgcolorgrid * Reset bgcolorgrid
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ResetBgColorGrid() function ResetBgColorGrid()
{ {
// phpcs:enable
unset($this->bgcolorgrid); unset($this->bgcolorgrid);
} }
@ -452,15 +475,16 @@ class DolGraph
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define background color of complete image * Define background color of complete image
* *
* @param array $bg_color array(R,G,B) ou 'onglet' ou 'default' * @param array $bg_color array(R,G,B) ou 'onglet' ou 'default'
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetBgColor($bg_color = array(255,255,255)) function SetBgColor($bg_color = array(255,255,255))
{ {
// phpcs:enable
global $theme_bgcolor,$theme_bgcoloronglet; global $theme_bgcolor,$theme_bgcoloronglet;
if (! is_array($bg_color)) if (! is_array($bg_color))
@ -481,15 +505,16 @@ class DolGraph
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Define background color of grid * Define background color of grid
* *
* @param array $bg_colorgrid array(R,G,B) ou 'onglet' ou 'default' * @param array $bg_colorgrid array(R,G,B) ou 'onglet' ou 'default'
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetBgColorGrid($bg_colorgrid = array(255,255,255)) function SetBgColorGrid($bg_colorgrid = array(255,255,255))
{ {
// phpcs:enable
global $theme_bgcolor,$theme_bgcoloronglet; global $theme_bgcolor,$theme_bgcoloronglet;
if (! is_array($bg_colorgrid)) if (! is_array($bg_colorgrid))
@ -510,25 +535,27 @@ class DolGraph
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Reset data color * Reset data color
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ResetDataColor() function ResetDataColor()
{ {
// phpcs:enable
unset($this->datacolor); unset($this->datacolor);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get max value * Get max value
* *
* @return int Max value * @return int Max value
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetMaxValueInData() function GetMaxValueInData()
{ {
// phpcs:enable
$k = 0; $k = 0;
$vals = array(); $vals = array();
@ -547,14 +574,15 @@ class DolGraph
return $vals[0]; return $vals[0];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return min value of all data * Return min value of all data
* *
* @return int Min value of all data * @return int Min value of all data
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetMinValueInData() function GetMinValueInData()
{ {
// phpcs:enable
$k = 0; $k = 0;
$vals = array(); $vals = array();
@ -573,14 +601,15 @@ class DolGraph
return $vals[0]; return $vals[0];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return max value of all data * Return max value of all data
* *
* @return int Max value of all data * @return int Max value of all data
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetCeilMaxValue() function GetCeilMaxValue()
{ {
// phpcs:enable
$max = $this->GetMaxValueInData(); $max = $this->GetMaxValueInData();
if ($max != 0) $max++; if ($max != 0) $max++;
$size=dol_strlen(abs(ceil($max))); $size=dol_strlen(abs(ceil($max)));
@ -597,14 +626,15 @@ class DolGraph
return $res; return $res;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return min value of all data * Return min value of all data
* *
* @return double Max value of all data * @return double Max value of all data
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetFloorMinValue() function GetFloorMinValue()
{ {
// phpcs:enable
$min = $this->GetMinValueInData(); $min = $this->GetMinValueInData();
if ($min == '') $min=0; if ($min == '') $min=0;
if ($min != 0) $min--; if ($min != 0) $min--;
@ -659,7 +689,7 @@ class DolGraph
* @param string $fileurl Url path to show image if saved onto disk * @param string $fileurl Url path to show image if saved onto disk
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private function draw_artichow($file,$fileurl) private function draw_artichow($file,$fileurl)
{ {
global $artichow_defaultfont; 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: * Build a graph using JFlot library. Input when calling this method should be:
* $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB)); * $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. * @param string $fileurl Url path to show image if saved onto disk. Never used here.
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private function draw_jflot($file,$fileurl) private function draw_jflot($file,$fileurl)
{ {
// phpcs:enable
global $artichow_defaultfont; global $artichow_defaultfont;
dol_syslog(get_class($this)."::draw_jflot this->type=".join(',',$this->type)." this->MaxValue=".$this->MaxValue); dol_syslog(get_class($this)."::draw_jflot this->type=".join(',',$this->type)." this->MaxValue=".$this->MaxValue);

View File

@ -105,25 +105,25 @@ class dolReceiptPrinter extends Escpos
const CONNECTOR_NETWORK_PRINT = 3; const CONNECTOR_NETWORK_PRINT = 3;
const CONNECTOR_WINDOWS_PRINT = 4; const CONNECTOR_WINDOWS_PRINT = 4;
//const CONNECTOR_JAVA = 5; //const CONNECTOR_JAVA = 5;
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
var $tags; var $tags;
var $printer; var $printer;
var $template; var $template;
/** /**
* @var string Error code (or message) * @var string Error code (or message)
*/ */
public $error=''; public $error='';
/** /**
* @var string[] Error codes (or messages) * @var string[] Error codes (or messages)
*/ */
public $errors = array(); public $errors = array();
@ -350,6 +350,7 @@ class dolReceiptPrinter extends Escpos
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Add a printer in db * Function to Add a printer in db
* *
@ -359,9 +360,9 @@ class dolReceiptPrinter extends Escpos
* @param string $parameter Printer parameter * @param string $parameter Printer parameter
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function AddPrinter($name, $type, $profile, $parameter) function AddPrinter($name, $type, $profile, $parameter)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt'; $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt';
@ -375,6 +376,7 @@ class dolReceiptPrinter extends Escpos
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Update a printer in db * Function to Update a printer in db
* *
@ -385,9 +387,9 @@ class dolReceiptPrinter extends Escpos
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function UpdatePrinter($name, $type, $profile, $parameter, $printerid) function UpdatePrinter($name, $type, $profile, $parameter, $printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt'; $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt';
@ -404,15 +406,16 @@ class dolReceiptPrinter extends Escpos
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Delete a printer from db * Function to Delete a printer from db
* *
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DeletePrinter($printerid) function DeletePrinter($printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt'; $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'printer_receipt';
@ -425,6 +428,7 @@ class dolReceiptPrinter extends Escpos
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Update a printer template in db * Function to Update a printer template in db
* *
@ -433,9 +437,9 @@ class dolReceiptPrinter extends Escpos
* @param int $templateid Template id * @param int $templateid Template id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function UpdateTemplate($name, $template, $templateid) function UpdateTemplate($name, $template, $templateid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt_template'; $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 * Function to Send Test page to Printer
* *
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SendTestToPrinter($printerid) function SendTestToPrinter($printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$img = new EscposImage(DOL_DOCUMENT_ROOT .'/theme/common/dolibarr_logo_bw.png'); $img = new EscposImage(DOL_DOCUMENT_ROOT .'/theme/common/dolibarr_logo_bw.png');
@ -486,6 +491,7 @@ class dolReceiptPrinter extends Escpos
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to Print Receipt Ticket * Function to Print Receipt Ticket
* *
@ -494,9 +500,9 @@ class dolReceiptPrinter extends Escpos
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SendToPrinter($object, $templateid, $printerid) function SendToPrinter($object, $templateid, $printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error = 0; $error = 0;
$ret = $this->loadTemplate($templateid); $ret = $this->loadTemplate($templateid);
@ -650,15 +656,16 @@ class dolReceiptPrinter extends Escpos
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function Init Printer * Function Init Printer
* *
* @param int $printerid Printer id * @param int $printerid Printer id
* @return int 0 if OK; >0 if KO * @return int 0 if OK; >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function InitPrinter($printerid) function InitPrinter($printerid)
{ {
// phpcs:enable
global $conf; global $conf;
$error=0; $error=0;
$sql = 'SELECT rowid, name, fk_type, fk_profile, parameter'; $sql = 'SELECT rowid, name, fk_type, fk_profile, parameter';

View File

@ -39,7 +39,7 @@ class FormAccounting extends Form
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
/** /**
* @var string Error code (or message) * @var string Error code (or message)
*/ */
@ -55,6 +55,7 @@ class FormAccounting extends Form
$this->db = $db; $this->db = $db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of journals with label by nature * Return list of journals with label by nature
* *
@ -69,9 +70,9 @@ class FormAccounting extends Form
* @param int $disabledajaxcombo Disable ajax combo box. * @param int $disabledajaxcombo Disable ajax combo box.
* @return string String with HTML select * @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) 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; global $conf,$langs;
$out = ''; $out = '';
@ -137,6 +138,7 @@ class FormAccounting extends Form
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of accounting category. * Return list of accounting category.
* Use mysoc->country_id or mysoc->country_code so they must be defined. * 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 * @param int $allcountries All countries
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_accounting_category($selected='',$htmlname='account_category', $useempty=0, $maxlen=0, $help=1, $allcountries=0) function select_accounting_category($selected='',$htmlname='account_category', $useempty=0, $maxlen=0, $help=1, $allcountries=0)
{ {
// phpcs:enable
global $db,$langs,$user,$mysoc; global $db,$langs,$user,$mysoc;
if (empty($mysoc->country_id) && empty($mysoc->country_code) && empty($allcountries)) if (empty($mysoc->country_id) && empty($mysoc->country_code) && empty($allcountries))
@ -218,6 +220,7 @@ class FormAccounting extends Form
print $out; print $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return select filter with date of transaction * Return select filter with date of transaction
* *
@ -225,9 +228,9 @@ class FormAccounting extends Form
* @param string $selectedkey Value * @param string $selectedkey Value
* @return string HTML edit field * @return string HTML edit field
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '') function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '')
{ {
// phpcs:enable
$options = array(); $options = array();
$sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping'; $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); return Form::selectarray($htmlname, $options, $selectedkey);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of accounts with label by chart of accounts * 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. * @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 * @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='') 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; global $conf, $langs;
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
@ -342,6 +346,7 @@ class FormAccounting extends Form
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of auxilary thirdparty accounts * Return list of auxilary thirdparty accounts
* *
@ -351,9 +356,9 @@ class FormAccounting extends Form
* @param string $morecss More css * @param string $morecss More css
* @return string String with HTML select * @return string String with HTML select
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200') function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200')
{ {
// phpcs:enable
$aux_account = array(); $aux_account = array();
@ -403,6 +408,7 @@ class FormAccounting extends Form
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return HTML combo list of years existing into book keepping * 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 * @param string $output_format (html/opton (for option html only)/array (to return options arrays
* @return string/array * @return string/array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html') function selectyear_accountancy_bookkepping($selected = '', $htmlname = 'yearid', $useempty = 0, $output_format = 'html')
{ {
// phpcs:enable
global $conf; global $conf;
$out_array = array(); $out_array = array();

View File

@ -33,7 +33,7 @@ class FormActions
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
/** /**
* @var string Error code (or message) * @var string Error code (or message)
*/ */
@ -52,6 +52,7 @@ class FormActions
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show list of action status * Show list of action status
* *
@ -64,9 +65,9 @@ class FormActions
* @param string $morecss More css on select field * @param string $morecss More css on select field
* @return void * @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') function form_select_status_action($formname, $selected, $canedit=1, $htmlname='complete', $showempty=0, $onlyselect=0, $morecss='maxwidth100')
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
$listofstatus = array( $listofstatus = array(
@ -314,6 +315,7 @@ class FormActions
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output html select list of type of event * Output html select list of type of event
* *
@ -326,9 +328,9 @@ class FormActions
* @param int $nooutput 1=No output * @param int $nooutput 1=No output
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_type_actions($selected='', $htmlname='actioncode', $excludetype='', $onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0) function select_type_actions($selected='', $htmlname='actioncode', $excludetype='', $onlyautoornot=0, $hideinfohelp=0, $multiselect=0, $nooutput=0)
{ {
// phpcs:enable
global $langs,$user,$form,$conf; global $langs,$user,$form,$conf;
if (! is_object($form)) $form=new Form($db); if (! is_object($form)) $form=new Form($db);

View File

@ -29,15 +29,8 @@
*/ */
class FormAdmin class FormAdmin
{ {
/** var $db;
* @var DoliDB Database handler. var $error;
*/
public $db;
/**
* @var string Error code (or message)
*/
public $error='';
/** /**
@ -51,6 +44,7 @@ class FormAdmin
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return html select list with available languages (key='en_US', value='United States' for example) * 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) * @param int $forcecombo Force to use combo box (so no ajax beautify effect)
* @return string Return HTML select string with list of languages * @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) 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; global $langs;
$langs_available=$langs->get_available_languages(DOL_DOCUMENT_ROOT,12); $langs_available=$langs->get_available_languages(DOL_DOCUMENT_ROOT,12);
@ -127,6 +121,7 @@ class FormAdmin
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of available menus (eldy_backoffice, ...) * Return list of available menus (eldy_backoffice, ...)
* *
@ -136,9 +131,9 @@ class FormAdmin
* @param string $moreattrib More attributes on html select tag * @param string $moreattrib More attributes on html select tag
* @return integer|null * @return integer|null
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib='') function select_menu($selected, $htmlname, $dirmenuarray, $moreattrib='')
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
// Clean parameters // Clean parameters
@ -217,6 +212,7 @@ class FormAdmin
print '</select>'; print '</select>';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return combo list of available menu families * Return combo list of available menu families
* *
@ -225,9 +221,9 @@ class FormAdmin
* @param string[] $dirmenuarray Directories to scan * @param string[] $dirmenuarray Directories to scan
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_menu_families($selected, $htmlname, $dirmenuarray) function select_menu_families($selected, $htmlname, $dirmenuarray)
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
//$expdevmenu=array('smartphone_backoffice.php','smartphone_frontoffice.php'); // Menu to disable if $conf->global->MAIN_FEATURES_LEVEL is not set //$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 * Return a HTML select list of timezones
* *
@ -296,9 +293,9 @@ class FormAdmin
* @param string $htmlname Nom de la zone select * @param string $htmlname Nom de la zone select
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_timezone($selected,$htmlname) function select_timezone($selected,$htmlname)
{ {
// phpcs:enable
global $langs,$conf; global $langs,$conf;
print '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">'; print '<select class="flat" id="'.$htmlname.'" name="'.$htmlname.'">';
@ -342,6 +339,7 @@ class FormAdmin
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return html select list with available languages (key='en_US', value='United States' for example) * Return html select list with available languages (key='en_US', value='United States' for example)
* *
@ -351,9 +349,9 @@ class FormAdmin
* @param int $showempty Add empty value * @param int $showempty Add empty value
* @return string Return HTML output * @return string Return HTML output
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_paper_format($selected='',$htmlname='paperformat_id',$filter=0,$showempty=0) function select_paper_format($selected='',$htmlname='paperformat_id',$filter=0,$showempty=0)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load("dict"); $langs->load("dict");

View File

@ -32,7 +32,7 @@ class FormCron extends Form
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
/** /**
* @var string Error code (or message) * @var string Error code (or message)
*/ */
@ -50,6 +50,7 @@ class FormCron extends Form
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Display On Off selector * Display On Off selector
* *
@ -58,9 +59,9 @@ class FormCron extends Form
* @param integer $readonly Select is read only or not * @param integer $readonly Select is read only or not
* @return string HTML select field * @return string HTML select field
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_typejob($htmlname,$selected=0,$readonly=0) function select_typejob($htmlname,$selected=0,$readonly=0)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load('cron@cron'); $langs->load('cron@cron');

View File

@ -45,63 +45,68 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetOpenIDServer * SetOpenIDServer
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetOpenIDServer($a) function SetOpenIDServer($a)
{ {
// phpcs:enable
$this->URLs['openid_server'] = $a; $this->URLs['openid_server'] = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetOpenIDServer * SetOpenIDServer
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetTrustRoot($a) function SetTrustRoot($a)
{ {
// phpcs:enable
$this->URLs['trust_root'] = $a; $this->URLs['trust_root'] = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetOpenIDServer * SetOpenIDServer
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetCancelURL($a) function SetCancelURL($a)
{ {
// phpcs:enable
$this->URLs['cancel'] = $a; $this->URLs['cancel'] = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetApprovedURL * SetApprovedURL
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetApprovedURL($a) function SetApprovedURL($a)
{ {
// phpcs:enable
$this->URLs['approved'] = $a; $this->URLs['approved'] = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetRequiredFields * SetRequiredFields
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetRequiredFields($a) function SetRequiredFields($a)
{ {
// phpcs:enable
if (is_array($a)) { if (is_array($a)) {
$this->fields['required'] = $a; $this->fields['required'] = $a;
} else { } else {
@ -109,15 +114,16 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetOptionalFields * SetOptionalFields
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetOptionalFields($a) function SetOptionalFields($a)
{ {
// phpcs:enable
if (is_array($a)) { if (is_array($a)) {
$this->fields['optional'] = $a; $this->fields['optional'] = $a;
} else { } else {
@ -125,15 +131,16 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetIdentity * SetIdentity
* *
* @param string $a Server * @param string $a Server
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetIdentity($a) function SetIdentity($a)
{ {
// phpcs:enable
// Set Identity URL // Set Identity URL
if ((stripos($a, 'http://') === false) if ((stripos($a, 'http://') === false)
&& (stripos($a, 'https://') === false)) { && (stripos($a, 'https://') === false)) {
@ -155,30 +162,33 @@ class SimpleOpenID
$this->openid_url_identity = $a; $this->openid_url_identity = $a;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* GetIdentity * GetIdentity
* *
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetIdentity() function GetIdentity()
{ {
// phpcs:enable
// Get Identity // Get Identity
return $this->openid_url_identity; return $this->openid_url_identity;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* SetOpenIDServer * SetOpenIDServer
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetError() function GetError()
{ {
// phpcs:enable
$e = $this->error; $e = $this->error;
return array('code'=>$e[0],'description'=>$e[1]); return array('code'=>$e[0],'description'=>$e[1]);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* ErrorStore * ErrorStore
* *
@ -186,9 +196,9 @@ class SimpleOpenID
* @param string $desc Description * @param string $desc Description
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ErrorStore($code, $desc = null) function ErrorStore($code, $desc = null)
{ {
// phpcs:enable
$errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server TAG on Identity page.'; $errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server TAG on Identity page.';
if ($desc == null){ if ($desc == null){
$desc = $errs[$code]; $desc = $errs[$code];
@ -196,14 +206,15 @@ class SimpleOpenID
$this->error = array($code,$desc); $this->error = array($code,$desc);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* IsError * IsError
* *
* @return boolean * @return boolean
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function IsError() function IsError()
{ {
// phpcs:enable
if (count($this->error) > 0) if (count($this->error) > 0)
{ {
return true; return true;
@ -234,15 +245,16 @@ class SimpleOpenID
return $r; return $r;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* OpenID_Standarize * OpenID_Standarize
* *
* @param string $openid_identity Server * @param string $openid_identity Server
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function OpenID_Standarize($openid_identity = null) function OpenID_Standarize($openid_identity = null)
{ {
// phpcs:enable
if ($openid_identity === null) if ($openid_identity === null)
$openid_identity = $this->openid_url_identity; $openid_identity = $this->openid_url_identity;
@ -280,6 +292,7 @@ class SimpleOpenID
return $query; return $query;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* FSOCK_Request * FSOCK_Request
* *
@ -288,9 +301,9 @@ class SimpleOpenID
* @param string $params Params * @param string $params Params
* @return boolean|unknown * @return boolean|unknown
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function FSOCK_Request($url, $method="GET", $params = "") function FSOCK_Request($url, $method="GET", $params = "")
{ {
// phpcs:enable
$fp = fsockopen("ssl://www.myopenid.com", 443, $errno, $errstr, 3); // Connection timeout is 3 seconds $fp = fsockopen("ssl://www.myopenid.com", 443, $errno, $errstr, 3); // Connection timeout is 3 seconds
if (!$fp) { if (!$fp) {
$this->ErrorStore('OPENID_SOCKETERROR', $errstr); $this->ErrorStore('OPENID_SOCKETERROR', $errstr);
@ -313,6 +326,7 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* CURL_Request * CURL_Request
* *
@ -321,9 +335,9 @@ class SimpleOpenID
* @param string $params Params * @param string $params Params
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function CURL_Request($url, $method="GET", $params = "") function CURL_Request($url, $method="GET", $params = "")
{ {
// phpcs:enable
// Remember, SSL MUST BE SUPPORTED // Remember, SSL MUST BE SUPPORTED
if (is_array($params)) $params = $this->array2url($params); if (is_array($params)) $params = $this->array2url($params);
@ -345,15 +359,16 @@ class SimpleOpenID
return $response; return $response;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* HTML2OpenIDServer * HTML2OpenIDServer
* *
* @param string $content Content * @param string $content Content
* @return array Array of servers * @return array Array of servers
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function HTML2OpenIDServer($content) function HTML2OpenIDServer($content)
{ {
// phpcs:enable
$get = array(); $get = array();
// Get details of their OpenID server and (optional) delegate // Get details of their OpenID server and (optional) delegate
@ -372,15 +387,16 @@ class SimpleOpenID
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get openid server * Get openid server
* *
* @param string $url Url to found endpoint * @param string $url Url to found endpoint
* @return string Endpoint * @return string Endpoint
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetOpenIDServer($url='') function GetOpenIDServer($url='')
{ {
// phpcs:enable
global $conf; global $conf;
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
@ -401,14 +417,15 @@ class SimpleOpenID
return $servers[0]; return $servers[0];
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* GetRedirectURL * GetRedirectURL
* *
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetRedirectURL() function GetRedirectURL()
{ {
// phpcs:enable
$params = array(); $params = array();
$params['openid.return_to'] = urlencode($this->URLs['approved']); $params['openid.return_to'] = urlencode($this->URLs['approved']);
$params['openid.mode'] = 'checkid_setup'; $params['openid.mode'] = 'checkid_setup';
@ -426,14 +443,15 @@ class SimpleOpenID
return $this->URLs['openid_server'] . "?". $this->array2url($params); return $this->URLs['openid_server'] . "?". $this->array2url($params);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Redirect * Redirect
* *
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function Redirect() function Redirect()
{ {
// phpcs:enable
$redirect_to = $this->GetRedirectURL(); $redirect_to = $this->GetRedirectURL();
if (headers_sent()) if (headers_sent())
{ // Use JavaScript to redirect if content has been previously sent (not recommended, but safe) { // Use JavaScript to redirect if content has been previously sent (not recommended, but safe)
@ -447,14 +465,15 @@ class SimpleOpenID
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* ValidateWithServer * ValidateWithServer
* *
* @return boolean * @return boolean
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ValidateWithServer() function ValidateWithServer()
{ {
// phpcs:enable
$params = array( $params = array(
'openid.assoc_handle' => urlencode($_GET['openid_assoc_handle']), 'openid.assoc_handle' => urlencode($_GET['openid_assoc_handle']),
'openid.signed' => urlencode($_GET['openid_signed']), 'openid.signed' => urlencode($_GET['openid_signed']),

View File

@ -756,6 +756,7 @@ class Translate
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of all available languages * Return list of all available languages
* *
@ -764,9 +765,9 @@ class Translate
* @param int $usecode 1=Show code instead of country name for language variant, 2=Show only code * @param int $usecode 1=Show code instead of country name for language variant, 2=Show only code
* @return array List of languages * @return array List of languages
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_available_languages($langdir=DOL_DOCUMENT_ROOT,$maxlength=0,$usecode=0) function get_available_languages($langdir=DOL_DOCUMENT_ROOT,$maxlength=0,$usecode=0)
{ {
// phpcs:enable
global $conf; global $conf;
// We scan directory langs to detect available languages // We scan directory langs to detect available languages
@ -796,6 +797,7 @@ class Translate
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return if a filename $filename exists for current language (or alternate language) * Return if a filename $filename exists for current language (or alternate language)
* *
@ -803,9 +805,9 @@ class Translate
* @param integer $searchalt Search also alernate language file * @param integer $searchalt Search also alernate language file
* @return boolean true if exists and readable * @return boolean true if exists and readable
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function file_exists($filename,$searchalt=0) function file_exists($filename,$searchalt=0)
{ {
// phpcs:enable
// Test si fichier dans repertoire de la langue // Test si fichier dans repertoire de la langue
foreach($this->dir as $searchdir) foreach($this->dir as $searchdir)
{ {
@ -1020,15 +1022,16 @@ class Translate
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return an array with content of all loaded translation keys (found into this->tab_translate) so * Return an array with content of all loaded translation keys (found into this->tab_translate) so
* we get a substitution array we can use for substitutions (for mail or ODT generation for example) * we get a substitution array we can use for substitutions (for mail or ODT generation for example)
* *
* @return array Array of translation keys lang_key => string_translation_loaded * @return array Array of translation keys lang_key => string_translation_loaded
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_translations_for_substitutions() function get_translations_for_substitutions()
{ {
// phpcs:enable
$substitutionarray = array(); $substitutionarray = array();
foreach($this->tab_translate as $code => $label) { foreach($this->tab_translate as $code => $label) {