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;
}
// 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'];

View File

@ -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";

View File

@ -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;

View File

@ -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);

View File

@ -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';

View File

@ -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();

View File

@ -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);

View File

@ -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 '</select>';
}
// 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 '<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)
*
@ -351,9 +349,9 @@ class FormAdmin
* @param int $showempty Add empty value
* @return string Return HTML output
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_paper_format($selected='',$htmlname='paperformat_id',$filter=0,$showempty=0)
{
// phpcs:enable
global $langs;
$langs->load("dict");

View File

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

View File

@ -45,63 +45,68 @@ class SimpleOpenID
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* SetOpenIDServer
*
* @param string $a Server
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetOpenIDServer($a)
{
// phpcs:enable
$this->URLs['openid_server'] = $a;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* SetOpenIDServer
*
* @param string $a Server
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetTrustRoot($a)
{
// phpcs:enable
$this->URLs['trust_root'] = $a;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* SetOpenIDServer
*
* @param string $a Server
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetCancelURL($a)
{
// phpcs:enable
$this->URLs['cancel'] = $a;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* SetApprovedURL
*
* @param string $a Server
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetApprovedURL($a)
{
// phpcs:enable
$this->URLs['approved'] = $a;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* SetRequiredFields
*
* @param string $a Server
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetRequiredFields($a)
{
// phpcs:enable
if (is_array($a)) {
$this->fields['required'] = $a;
} else {
@ -109,15 +114,16 @@ class SimpleOpenID
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* SetOptionalFields
*
* @param string $a Server
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetOptionalFields($a)
{
// phpcs:enable
if (is_array($a)) {
$this->fields['optional'] = $a;
} else {
@ -125,15 +131,16 @@ class SimpleOpenID
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* SetIdentity
*
* @param string $a Server
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetIdentity($a)
{
// phpcs:enable
// Set Identity URL
if ((stripos($a, 'http://') === false)
&& (stripos($a, 'https://') === false)) {
@ -155,30 +162,33 @@ class SimpleOpenID
$this->openid_url_identity = $a;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* GetIdentity
*
* @return string
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetIdentity()
{
// phpcs:enable
// Get Identity
return $this->openid_url_identity;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* SetOpenIDServer
*
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetError()
{
// phpcs:enable
$e = $this->error;
return array('code'=>$e[0],'description'=>$e[1]);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* ErrorStore
*
@ -186,9 +196,9 @@ class SimpleOpenID
* @param string $desc Description
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ErrorStore($code, $desc = null)
{
// phpcs:enable
$errs['OPENID_NOSERVERSFOUND'] = 'Cannot find OpenID Server TAG on Identity page.';
if ($desc == null){
$desc = $errs[$code];
@ -196,14 +206,15 @@ class SimpleOpenID
$this->error = array($code,$desc);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* IsError
*
* @return boolean
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function IsError()
{
// phpcs:enable
if (count($this->error) > 0)
{
return true;
@ -234,15 +245,16 @@ class SimpleOpenID
return $r;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* OpenID_Standarize
*
* @param string $openid_identity Server
* @return string
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function OpenID_Standarize($openid_identity = null)
{
// phpcs:enable
if ($openid_identity === null)
$openid_identity = $this->openid_url_identity;
@ -280,6 +292,7 @@ class SimpleOpenID
return $query;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* FSOCK_Request
*
@ -288,9 +301,9 @@ class SimpleOpenID
* @param string $params Params
* @return boolean|unknown
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function FSOCK_Request($url, $method="GET", $params = "")
{
// phpcs:enable
$fp = fsockopen("ssl://www.myopenid.com", 443, $errno, $errstr, 3); // Connection timeout is 3 seconds
if (!$fp) {
$this->ErrorStore('OPENID_SOCKETERROR', $errstr);
@ -313,6 +326,7 @@ class SimpleOpenID
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* CURL_Request
*
@ -321,9 +335,9 @@ class SimpleOpenID
* @param string $params Params
* @return string
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function CURL_Request($url, $method="GET", $params = "")
{
// phpcs:enable
// Remember, SSL MUST BE SUPPORTED
if (is_array($params)) $params = $this->array2url($params);
@ -345,15 +359,16 @@ class SimpleOpenID
return $response;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* HTML2OpenIDServer
*
* @param string $content Content
* @return array Array of servers
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function HTML2OpenIDServer($content)
{
// phpcs:enable
$get = array();
// Get details of their OpenID server and (optional) delegate
@ -372,15 +387,16 @@ class SimpleOpenID
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Get openid server
*
* @param string $url Url to found endpoint
* @return string Endpoint
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetOpenIDServer($url='')
{
// phpcs:enable
global $conf;
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
@ -401,14 +417,15 @@ class SimpleOpenID
return $servers[0];
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* GetRedirectURL
*
* @return string
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetRedirectURL()
{
// phpcs:enable
$params = array();
$params['openid.return_to'] = urlencode($this->URLs['approved']);
$params['openid.mode'] = 'checkid_setup';
@ -426,14 +443,15 @@ class SimpleOpenID
return $this->URLs['openid_server'] . "?". $this->array2url($params);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Redirect
*
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function Redirect()
{
// phpcs:enable
$redirect_to = $this->GetRedirectURL();
if (headers_sent())
{ // 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
*
* @return boolean
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function ValidateWithServer()
{
// phpcs:enable
$params = array(
'openid.assoc_handle' => urlencode($_GET['openid_assoc_handle']),
'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
*
@ -764,9 +765,9 @@ class Translate
* @param int $usecode 1=Show code instead of country name for language variant, 2=Show only code
* @return array List of languages
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_available_languages($langdir=DOL_DOCUMENT_ROOT,$maxlength=0,$usecode=0)
{
// phpcs:enable
global $conf;
// 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)
*
@ -803,9 +805,9 @@ class Translate
* @param integer $searchalt Search also alernate language file
* @return boolean true if exists and readable
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function file_exists($filename,$searchalt=0)
{
// phpcs:enable
// Test si fichier dans repertoire de la langue
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
* 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
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_translations_for_substitutions()
{
// phpcs:enable
$substitutionarray = array();
foreach($this->tab_translate as $code => $label) {