move phpcs:ignore

This commit is contained in:
Frédéric FRANCE 2018-09-05 18:49:06 +02:00
parent ecc6c118a6
commit f7c3ca9d20
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
16 changed files with 156 additions and 104 deletions

View File

@ -58,6 +58,7 @@ class FormOther
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return HTML select list of export models
*
@ -68,13 +69,13 @@ class FormOther
* @param int $fk_user Utilisateur créant le modèle
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_export_model($selected='', $htmlname='exportmodelid', $type='', $useempty=0, $fk_user=null)
{
// phpcs:enable
$sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."export_model";
$sql.= " WHERE type = '".$type."'";
if(!empty($fk_user))$sql.=" AND fk_user=".$fk_user;
if (!empty($fk_user)) $sql.=" AND fk_user=".$fk_user;
$sql.= " ORDER BY rowid";
$result = $this->db->query($sql);
if ($result)
@ -110,6 +111,7 @@ class FormOther
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return list of export models
*
@ -119,9 +121,9 @@ class FormOther
* @param int $useempty Affiche valeur vide dans liste
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_import_model($selected='', $htmlname='importmodelid', $type='', $useempty=0)
{
// phpcs:enable
$sql = "SELECT rowid, label";
$sql.= " FROM ".MAIN_DB_PREFIX."import_model";
$sql.= " WHERE type = '".$type."'";
@ -160,6 +162,7 @@ class FormOther
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return list of ecotaxes with label
*
@ -167,9 +170,9 @@ class FormOther
* @param string $htmlname Name of combo list
* @return integer
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_ecotaxes($selected='', $htmlname='ecotaxe_id')
{
// phpcs:enable
global $langs;
$sql = "SELECT e.rowid, e.code, e.label, e.price, e.organization,";
@ -217,6 +220,7 @@ class FormOther
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return list of revenue stamp for country
*
@ -225,9 +229,9 @@ class FormOther
* @param string $country_code Country Code
* @return string HTML select list
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_revenue_stamp($selected='', $htmlname='revenuestamp', $country_code='')
{
// phpcs:enable
global $langs;
$out='';
@ -275,6 +279,7 @@ class FormOther
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return a HTML select list to select a percent
*
@ -287,9 +292,9 @@ class FormOther
* @param int $showempty Add also an empty line
* @return string HTML select string
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_percent($selected=0,$htmlname='percent',$disabled=0,$increment=5,$start=0,$end=100,$showempty=0)
{
// phpcs:enable
$return = '<select class="flat" name="'.$htmlname.'" '.($disabled?'disabled':'').'>';
if ($showempty) $return.='<option value="-1"'.(($selected == -1 || $selected == '')?' selected':'').'>&nbsp;</option>';
@ -312,6 +317,7 @@ class FormOther
return $return;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return select list for categories (to use in form search selectors)
*
@ -324,9 +330,9 @@ class FormOther
* @return string Html combo list code
* @see select_all_categories
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_categories($type, $selected=0, $htmlname='search_categ', $nocateg=0, $showempty=1, $morecss='')
{
// phpcs:enable
global $conf, $langs;
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
@ -373,6 +379,7 @@ class FormOther
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return select list for categories (to use in form search selectors)
*
@ -384,9 +391,9 @@ class FormOther
* @param string $morecss More CSS
* @return string Html combo list code
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_salesrepresentatives($selected,$htmlname,$user,$showstatus=0,$showempty=1,$morecss='')
{
// phpcs:enable
global $conf,$langs;
$langs->load('users');
@ -628,6 +635,7 @@ class FormOther
else print $textifnotdefined;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Output a HTML code to select a color
*
@ -640,9 +648,9 @@ class FormOther
* @deprecated Use instead selectColor
* @see selectColor()
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_color($set_color='', $prefix='f_color', $form_name='', $showcolorbox=1, $arrayofcolors='')
{
// phpcs:enable
print $this->selectColor($set_color, $prefix, $form_name, $showcolorbox, $arrayofcolors);
}
@ -746,6 +754,7 @@ class FormOther
return $out;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Creation d'un icone de couleur
*
@ -756,9 +765,9 @@ class FormOther
* @param int $y Hauteur de l'image en pixels
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function CreateColorIcon($color,$module,$name,$x='12',$y='12')
{
// phpcs:enable
global $conf;
$file = $conf->$module->dir_temp.'/'.$name.'.png';
@ -786,6 +795,7 @@ class FormOther
ImageDestroy($image);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return HTML combo list of week
*
@ -794,18 +804,20 @@ class FormOther
* @param int $useempty Affiche valeur vide dans liste
* @return string
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_dayofweek($selected='',$htmlname='weekid',$useempty=0)
{
// phpcs:enable
global $langs;
$week = array( 0=>$langs->trans("Day0"),
1=>$langs->trans("Day1"),
2=>$langs->trans("Day2"),
3=>$langs->trans("Day3"),
4=>$langs->trans("Day4"),
5=>$langs->trans("Day5"),
6=>$langs->trans("Day6"));
$week = array(
0=>$langs->trans("Day0"),
1=>$langs->trans("Day1"),
2=>$langs->trans("Day2"),
3=>$langs->trans("Day3"),
4=>$langs->trans("Day4"),
5=>$langs->trans("Day5"),
6=>$langs->trans("Day6")
);
$select_week = '<select class="flat" name="'.$htmlname.'">';
if ($useempty)
@ -829,6 +841,7 @@ class FormOther
return $select_week;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return HTML combo list of month
*
@ -839,9 +852,9 @@ class FormOther
* @param string $morecss More Css
* @return string
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_month($selected='', $htmlname='monthid', $useempty=0, $longlabel=0, $morecss='')
{
// phpcs:enable
global $langs;
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
@ -871,6 +884,7 @@ class FormOther
return $select_month;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return HTML combo list of years
*
@ -885,9 +899,9 @@ class FormOther
* @param string $morecss More CSS
* @return string
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_year($selected='',$htmlname='yearid',$useempty=0, $min_year=10, $max_year=5, $offset=0, $invert=0, $option='', $morecss='valignmiddle widthauto')
{
// phpcs:enable
print $this->selectyear($selected,$htmlname,$useempty,$min_year,$max_year,$offset,$invert,$option,$morecss);
}
@ -944,6 +958,7 @@ class FormOther
return $out;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Show form to select address
*
@ -955,9 +970,9 @@ class FormOther
* @param int $originid Id de l'origine
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_address($page, $selected, $socid, $htmlname='address_id', $origin='', $originid='')
{
// phpcs:enable
global $langs,$conf;
global $form;
@ -1206,6 +1221,7 @@ class FormOther
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return a HTML select list of a dictionary
*
@ -1218,9 +1234,9 @@ class FormOther
* @param string $moreattrib More attributes on HTML select tag
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_dictionary($htmlname,$dictionarytable,$keyfield='code',$labelfield='label',$selected='',$useempty=0,$moreattrib='')
{
// phpcs:enable
global $langs, $conf;
$langs->load("admin");

View File

@ -138,6 +138,7 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return next free value
*
@ -145,9 +146,9 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
* @param string $objforref Object for number to search
* @return string Next free value
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function chequereceipt_get_num($objsoc,$objforref)
{
// phpcs:enable
return $this->getNextValue($objsoc,$objforref);
}
}

View File

@ -124,6 +124,7 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return next free value
*
@ -131,9 +132,9 @@ class mod_chequereceipt_thyme extends ModeleNumRefChequeReceipts
* @param string $objforref Object for number to search
* @return string Next free value
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function chequereceipt_get_num($objsoc,$objforref)
{
// phpcs:enable
return $this->getNextValue($objsoc,$objforref);
}
}

View File

@ -177,6 +177,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
return $texte;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
*
@ -188,9 +189,9 @@ class doc_generic_order_odt extends ModelePDFCommandes
* @param int $hideref Do not show ref
* @return int 1 if OK, <=0 if KO
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0)
{
// phpcs:enable
global $user,$langs,$conf,$mysoc,$hookmanager;
if (empty($srctemplatepath))

View File

@ -167,6 +167,7 @@ class doc_generic_contract_odt extends ModelePDFContract
return $texte;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
*
@ -178,9 +179,9 @@ class doc_generic_contract_odt extends ModelePDFContract
* @param int $hideref Do not show ref
* @return int 1 if OK, <=0 if KO
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0)
{
// phpcs:enable
global $user,$langs,$conf,$mysoc,$hookmanager;
if (empty($srctemplatepath))

View File

@ -121,6 +121,7 @@ class mod_expedition_ribera extends ModelNumRefExpedition
return $numFinal;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return next free value
*
@ -128,9 +129,9 @@ class mod_expedition_ribera extends ModelNumRefExpedition
* @param Object $objforref Shipment object
* @return string Next free value
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function expedition_get_num($objsoc,$objforref)
{
// phpcs:enable
return $this->getNextValue($objsoc,$objforref);
}
}

View File

@ -133,6 +133,7 @@ class mod_expedition_safor extends ModelNumRefExpedition
return $this->prefix.$yymm."-".$num;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return next free value
*
@ -140,9 +141,9 @@ class mod_expedition_safor extends ModelNumRefExpedition
* @param Object $objforref Shipment object
* @return string Next free value
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function expedition_get_num($objsoc,$objforref)
{
// phpcs:enable
return $this->getNextValue($objsoc,$objforref);
}
}

View File

@ -109,18 +109,20 @@ class ImportCsv extends ModeleImports
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Output header of an example file for this format
*
* @param Translate $outputlangs Output language
* @return string
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_header_example($outputlangs)
{
// phpcs:enable
return '';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Output title line of an example file for this format
*
@ -128,13 +130,14 @@ class ImportCsv extends ModeleImports
* @param array $headerlinefields Array of fields name
* @return string
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_title_example($outputlangs,$headerlinefields)
{
// phpcs:enable
$s=join($this->separator,array_map('cleansep',$headerlinefields));
return $s."\n";
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Output record of an example file for this format
*
@ -142,36 +145,38 @@ class ImportCsv extends ModeleImports
* @param array $contentlinevalues Array of lines
* @return string
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_record_example($outputlangs,$contentlinevalues)
{
// phpcs:enable
$s=join($this->separator,array_map('cleansep',$contentlinevalues));
return $s."\n";
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Output footer of an example file for this format
*
* @param Translate $outputlangs Output language
* @return string
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_footer_example($outputlangs)
{
// phpcs:enable
return '';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Open input file
*
* @param string $file Path of filename
* @return int <0 if KO, >=0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function import_open_file($file)
{
// phpcs:enable
global $langs;
$ret=1;
@ -195,39 +200,42 @@ class ImportCsv extends ModeleImports
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return nb of records. File must be closed.
*
* @param string $file Path of filename
* @return int <0 if KO, >=0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function import_get_nb_of_lines($file)
{
return dol_count_nb_of_line($file);
// phpcs:enable
return dol_count_nb_of_line($file);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Input header line from file
*
* @return int <0 if KO, >=0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function import_read_header()
{
// phpcs:enable
return 0;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return array of next record in input file.
*
* @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function import_read_record()
{
// phpcs:enable
global $conf;
$arrayres=fgetcsv($this->handle,100000,$this->separator,$this->enclosure,$this->escape);
@ -276,19 +284,21 @@ class ImportCsv extends ModeleImports
return $newarrayres;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Close file handle
*
* @return integer
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function import_close_file()
{
// phpcs:enable
fclose($this->handle);
return 0;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Insert a record into database
*
@ -300,9 +310,9 @@ class ImportCsv extends ModeleImports
* @param array $updatekeys Array of keys to use to try to do an update first before insert. This field are defined into the module descriptor.
* @return int <0 if KO, >0 if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function import_insert($arrayrecord,$array_match_file_to_database,$objimport,$maxfields,$importid,$updatekeys)
{
// phpcs:enable
global $langs,$conf,$user;
global $thirdparty_static; // Specific to thirdparty import
global $tablewithentity_cache; // Cache to avoid to call desc at each rows on tables
@ -577,9 +587,13 @@ class ImportCsv extends ModeleImports
$listfields[] = $fieldname;
// Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert
if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) $listvalues[] = ($newval=='0'?$newval:"null");
elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) $listvalues[] = "''";
else $listvalues[] = "'".$this->db->escape($newval)."'";
if (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) {
$listvalues[] = ($newval=='0'?$newval:"null");
} elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) {
$listvalues[] = "''";
} else {
$listvalues[] = "'".$this->db->escape($newval)."'";
}
}
$i++;
}

View File

@ -35,12 +35,12 @@ class MailingTargets // This can't be abstract as it is used for some method
* @var DoliDB Database handler.
*/
public $db;
/**
* @var string Error code (or message)
*/
public $error='';
var $tooltip='';
@ -117,15 +117,16 @@ class MailingTargets // This can't be abstract as it is used for some method
return '';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Met a jour nombre de destinataires
*
* @param int $mailing_id Id of emailing
* @return int < 0 si erreur, nb destinataires si ok
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_nb($mailing_id)
{
// phpcs:enable
// Mise a jour nombre de destinataire dans table des mailings
$sql = "SELECT COUNT(*) nb FROM ".MAIN_DB_PREFIX."mailing_cibles";
$sql .= " WHERE fk_mailing = ".$mailing_id;
@ -150,6 +151,7 @@ class MailingTargets // This can't be abstract as it is used for some method
return $nb;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Ajoute destinataires dans table des cibles
*
@ -157,9 +159,9 @@ class MailingTargets // This can't be abstract as it is used for some method
* @param array $cibles Array with targets
* @return int < 0 si erreur, nb ajout si ok
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_to_target($mailing_id, $cibles)
{
// phpcs:enable
global $conf;
$this->db->begin();
@ -234,15 +236,16 @@ class MailingTargets // This can't be abstract as it is used for some method
return $j;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Supprime tous les destinataires de la table des cibles
*
* @param int $mailing_id Id of emailing
* @param int $mailing_id Id of emailing
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function clear_target($mailing_id)
{
// phpcs:enable
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing_cibles";
$sql .= " WHERE fk_mailing = ".$mailing_id;

View File

@ -47,6 +47,7 @@ class pdf_standard extends CommonStickerGenerator
// use this method in future refactoring
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0)
* - __LOGO__ is replace with company logo
@ -62,9 +63,9 @@ class pdf_standard extends CommonStickerGenerator
* @param string $photo Photo (full path to image file used as replacement for key __PHOTOS__ into left, right, header or footer text)
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function Add_PDF_card(&$pdf,$textleft,$header,$footer,$outputlangs,$textright='',$idmember=0,$photo='')
{
// phpcs:enable
global $db,$mysoc,$conf,$langs;
global $forceimgscalewidth,$forceimgscaleheight;
@ -236,6 +237,7 @@ class pdf_standard extends CommonStickerGenerator
}
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to build PDF on disk, then output on HTTP stream.
*
@ -246,9 +248,9 @@ class pdf_standard extends CommonStickerGenerator
* @param int $nooutput 1=Generate only file on disk and do not return it on response
* @return int 1=OK, 0=KO
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($object, $outputlangs, $srctemplatepath, $mode='member', $nooutput=0)
{
// phpcs:enable
global $user,$conf,$langs,$mysoc,$_Avery_Labels;
$this->code=$srctemplatepath;

View File

@ -1,10 +1,10 @@
<?php
/* Copyright (C) 2003 Steve Dillon
* Copyright (C) 2003 Laurent Passebecq
* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Francis Appels <francis.appels@yahoo.com>
/* Copyright (C) 2003 Steve Dillon
* Copyright (C) 2003 Laurent Passebecq
* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Francis Appels <francis.appels@yahoo.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -21,15 +21,15 @@
*/
/**
* \file htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php
* \ingroup core
* \brief Fichier de la classe permettant d'editer au format PDF des etiquettes au format Avery ou personnalise
* \file htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php
* \ingroup core
* \brief Fichier de la classe permettant d'editer au format PDF des etiquettes au format Avery ou personnalise
*/
require_once DOL_DOCUMENT_ROOT.'/core/class/commonstickergenerator.class.php';
/**
* Class to generate stick sheet with format Avery or other personalised
* Class to generate stick sheet with format Avery or other personalised
*/
class pdf_standardlabel extends CommonStickerGenerator
{
@ -46,6 +46,7 @@ class pdf_standardlabel extends CommonStickerGenerator
// use this method in future refactoring
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0)
* - %LOGO% is replace with company logo
@ -60,9 +61,9 @@ class pdf_standardlabel extends CommonStickerGenerator
* @param string $photo Photo (full path to image file used as replacement for key %PHOTOS% into left, right, header or footer text)
* @return void
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function Add_PDF_label(&$pdf,$textleft,$header,$footer,$outputlangs,$textright='',$photo='')
{
// phpcs:enable
global $mysoc, $conf, $langs;
global $forceimgscalewidth, $forceimgscaleheight;
@ -226,6 +227,7 @@ class pdf_standardlabel extends CommonStickerGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to build PDF on disk, then output on HTTP strem.
*
@ -236,9 +238,9 @@ class pdf_standardlabel extends CommonStickerGenerator
* @param string $filename Short file name of PDF output file
* @return int 1=OK, 0=KO
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($arrayofrecords,$outputlangs,$srctemplatepath,$outputdir='',$filename='tmp_address_sheet.pdf')
{
// phpcs:enable
global $user,$conf,$langs,$mysoc,$_Avery_Labels;
$this->code=$srctemplatepath;

View File

@ -191,6 +191,7 @@ class doc_generic_product_odt extends ModelePDFProduct
return $texte;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
*
@ -202,9 +203,9 @@ class doc_generic_product_odt extends ModelePDFProduct
* @param int $hideref Do not show ref
* @return int 1 if OK, <=0 if KO
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0)
{
// phpcs:enable
global $product,$langs,$conf,$mysoc,$hookmanager,$user;
if (empty($srctemplatepath))

View File

@ -216,14 +216,15 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Check if mask/numbering use prefix
*
* @return int 0 or 1
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function verif_prefixIsUsed()
{
// phpcs:enable
global $conf;
$mask = $conf->global->COMPANY_ELEPHANT_MASK_CUSTOMER;
@ -292,6 +293,7 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Renvoi si un code est pris ou non (par autre tiers)
*
@ -301,9 +303,9 @@ class mod_codeclient_elephant extends ModeleThirdPartyCode
* @param int $type 0 = customer/prospect , 1 = supplier
* @return int 0 if available, <0 if KO
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function verif_dispo($db, $code, $soc, $type=0)
{
// phpcs:enable
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe";
if ($type == 1) $sql.= " WHERE code_fournisseur = '".$code."'";
else $sql.= " WHERE code_client = '".$code."'";

View File

@ -207,6 +207,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
return $texte;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
*
@ -218,9 +219,9 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
* @param int $hideref Do not show ref
* @return int 1 if OK, <=0 if KO
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0)
{
// phpcs:enable
global $user,$langs,$conf,$mysoc,$hookmanager;
if (empty($srctemplatepath))

View File

@ -190,6 +190,7 @@ class doc_generic_user_odt extends ModelePDFUser
return $texte;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to build a document on disk using the generic odt module.
*
@ -201,9 +202,9 @@ class doc_generic_user_odt extends ModelePDFUser
* @param int $hideref Do not show ref
* @return int 1 if OK, <=0 if KO
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0)
{
// phpcs:enable
global $user,$langs,$conf,$mysoc,$hookmanager;
if (empty($srctemplatepath))
@ -423,6 +424,7 @@ class doc_generic_user_odt extends ModelePDFUser
return -1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* get substitution array for object
*
@ -431,9 +433,9 @@ class doc_generic_user_odt extends ModelePDFUser
* @param string $array_key key for array
* @return array array of substitutions
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_substitutionarray_object($object,$outputlangs,$array_key='object')
{
// phpcs:enable
$array_other = array();
foreach($object as $key => $value) {
if (!is_array($value) && !is_object($value)) {

View File

@ -1719,6 +1719,7 @@ class Task extends CommonObject
return $this->LibStatut($this->fk_statut, $mode);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return status label for an object
*
@ -1726,9 +1727,9 @@ class Task extends CommonObject
* @param integer $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
* @return string Label
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut, $mode=0)
{
// phpcs:enable
// list of Statut of the task
$this->statuts[0]='Draft';
$this->statuts[1]='ToDo';
@ -1747,59 +1748,59 @@ class Task extends CommonObject
{
return $langs->trans($this->statuts[$statut]);
}
if ($mode == 1)
elseif ($mode == 1)
{
return $langs->trans($this->statuts_short[$statut]);
}
if ($mode == 2)
elseif ($mode == 2)
{
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts_short[$statut]);
elseif ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts_short[$statut]);
}
if ($mode == 3)
elseif ($mode == 3)
{
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
elseif ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
elseif ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
elseif ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
}
if ($mode == 4)
elseif ($mode == 4)
{
if ($statut==0) return img_picto($langs->trans($this->statuts_short[$statut]),'statut0').' '.$langs->trans($this->statuts[$statut]);
if ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
if ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
if ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
if ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
if ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==1) return img_picto($langs->trans($this->statuts_short[$statut]),'statut1').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==2) return img_picto($langs->trans($this->statuts_short[$statut]),'statut3').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==3) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==4) return img_picto($langs->trans($this->statuts_short[$statut]),'statut6').' '.$langs->trans($this->statuts[$statut]);
elseif ($statut==5) return img_picto($langs->trans($this->statuts_short[$statut]),'statut5').' '.$langs->trans($this->statuts[$statut]);
}
if ($mode == 5)
elseif ($mode == 5)
{
/*if ($statut==0) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
if ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
if ($statut==2) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
if ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
if ($statut==4) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
if ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
elseif ($statut==1) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
elseif ($statut==2) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
elseif ($statut==3) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
elseif ($statut==4) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
elseif ($statut==5) return $langs->trans($this->statuts_short[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
*/
//return $this->progress.' %';
//else return $this->progress.' %';
return '&nbsp;';
}
if ($mode == 6)
elseif ($mode == 6)
{
/*if ($statut==0) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut0');
if ($statut==1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
if ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
if ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
if ($statut==4) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
if ($statut==5) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
elseif ($statut==1) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut1');
elseif ($statut==2) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut3');
elseif ($statut==3) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
elseif ($statut==4) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut6');
elseif ($statut==5) return $langs->trans($this->statuts[$statut]).' '.img_picto($langs->trans($this->statuts_short[$statut]),'statut5');
*/
//return $this->progress.' %';
//else return $this->progress.' %';
return '&nbsp;';
}
}
@ -1837,15 +1838,16 @@ class Task extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
*
* @param User $user Objet user
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_board($user)
{
// phpcs:enable
global $conf, $langs;
// For external user, no check is done on company because readability is managed by public status of project and assignement.
@ -1911,14 +1913,15 @@ class Task extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Charge indicateurs this->nb de tableau de bord
*
* @return int <0 if ko, >0 if ok
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_state_board()
{
// phpcs:enable
global $user;
$mine=0; $socid=$user->societe_id;