move phpcs:ignore

This commit is contained in:
Frédéric FRANCE 2018-09-04 22:52:55 +02:00
parent 3847df1de6
commit 7799774ca1
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
16 changed files with 173 additions and 122 deletions

View File

@ -294,6 +294,7 @@ class Account extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Add a link between bank line record and its source * Add a link between bank line record and its source
* *
@ -304,9 +305,9 @@ class Account extends CommonObject
* @param string $type Type of link ('payment', 'company', 'member', ...) * @param string $type Type of link ('payment', 'company', 'member', ...)
* @return int <0 if KO, id line if OK * @return int <0 if KO, id line if OK
*/ */
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function add_url_line($line_id, $url_id, $url, $label, $type) function add_url_line($line_id, $url_id, $url, $label, $type)
{ {
// phpcs:enable
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url (";
$sql.= "fk_bank"; $sql.= "fk_bank";
$sql.= ", url_id"; $sql.= ", url_id";
@ -334,6 +335,7 @@ class Account extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* TODO Move this into AccountLine * TODO Move this into AccountLine
* Return array with links from llx_bank_url * Return array with links from llx_bank_url
@ -343,9 +345,9 @@ class Account extends CommonObject
* @param string $type To search using type * @param string $type To search using type
* @return array|-1 Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error * @return array|-1 Array of links array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> ) or -1 on error
*/ */
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_url($fk_bank='', $url_id='', $type='') function get_url($fk_bank='', $url_id='', $type='')
{ {
// phpcs:enable
$lines = array(); $lines = array();
// Check parameters // Check parameters
@ -784,15 +786,16 @@ class Account extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update BBAN (RIB) account fields * Update BBAN (RIB) account fields
* *
* @param User $user Object user making update * @param User $user Object user making update
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function update_bban(User $user = null) function update_bban(User $user = null)
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
// Clean parameters // Clean parameters
@ -1071,6 +1074,7 @@ class Account extends CommonObject
return $this->LibStatut($this->clos,$mode); return $this->LibStatut($this->clos,$mode);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return label of given object status * Return label of given object status
* *
@ -1078,9 +1082,9 @@ class Account extends CommonObject
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=short label + picto, 6=Long label + picto
* @return string Label * @return string Label
*/ */
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function LibStatut($statut, $mode = 0) function LibStatut($statut, $mode = 0)
{ {
// phpcs:enable
global $langs; global $langs;
$langs->load('banks'); $langs->load('banks');
@ -1109,14 +1113,15 @@ class Account extends CommonObject
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi si un compte peut etre supprimer ou non (sans mouvements) * Renvoi si un compte peut etre supprimer ou non (sans mouvements)
* *
* @return boolean vrai si peut etre supprime, faux sinon * @return boolean vrai si peut etre supprime, faux sinon
*/ */
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function can_be_deleted() function can_be_deleted()
{ {
// phpcs:enable
$can_be_deleted=false; $can_be_deleted=false;
$sql = "SELECT COUNT(rowid) as nb"; $sql = "SELECT COUNT(rowid) as nb";
@ -1177,6 +1182,7 @@ class Account extends CommonObject
return $solde; return $solde;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Load indicators for dashboard (this->nbtodo and this->nbtodolate) * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
* *
@ -1184,9 +1190,9 @@ class Account extends CommonObject
* @param int $filteraccountid To get info for a particular account id * @param int $filteraccountid To get info for a particular account id
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
*/ */
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_board(User $user, $filteraccountid = 0) function load_board(User $user, $filteraccountid = 0)
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
@ -1233,14 +1239,15 @@ class Account extends CommonObject
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Charge indicateurs this->nb de tableau de bord * Charge indicateurs this->nb de tableau de bord
* @param int $filteraccountid To get info for a particular account id * @param int $filteraccountid To get info for a particular account id
* @return int <0 if ko, >0 if ok * @return int <0 if ko, >0 if ok
*/ */
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function load_state_board($filteraccountid = 0) function load_state_board($filteraccountid = 0)
{ {
// phpcs:enable
global $user; global $user;
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe

View File

@ -58,6 +58,7 @@ class FormFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show form to upload a new file. * Show form to upload a new file.
* *
@ -77,9 +78,9 @@ class FormFile
* @param string $sectiondir If upload must be done inside a particular directory (is sectiondir defined, sectionid must not be) * @param string $sectiondir If upload must be done inside a particular directory (is sectiondir defined, sectionid must not be)
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile', $accept='', $sectiondir='') function form_attach_new_file($url, $title='', $addcancel=0, $sectionid=0, $perm=1, $size=50, $object='', $options='', $useajax=1, $savingdocmask='', $linkfiles=1, $htmlname='formuserfile', $accept='', $sectiondir='')
{ {
// phpcs:enable
global $conf,$langs, $hookmanager; global $conf,$langs, $hookmanager;
$hookmanager->initHooks(array('formfile')); $hookmanager->initHooks(array('formfile'));
@ -231,6 +232,7 @@ class FormFile
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show the box with list of available documents for object * Show the box with list of available documents for object
* *
@ -253,9 +255,9 @@ class FormFile
* @return int <0 if KO, number of shown files if OK * @return int <0 if KO, number of shown files if OK
* @deprecated Use print xxx->showdocuments() instead. * @deprecated Use print xxx->showdocuments() instead.
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='') function show_documents($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$notused=0,$noform=0,$param='',$title='',$buttonlabel='',$codelang='')
{ {
// phpcs:enable
$this->numoffiles=0; $this->numoffiles=0;
print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$notused,$noform,$param,$title,$buttonlabel,$codelang); print $this->showdocuments($modulepart,$modulesubdir,$filedir,$urlsource,$genallowed,$delallowed,$modelselected,$allowgenifempty,$forcenomultilang,$iconPDF,$notused,$noform,$param,$title,$buttonlabel,$codelang);
return $this->numoffiles; return $this->numoffiles;
@ -981,6 +983,7 @@ class FormFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show list of documents in $filearray (may be they are all in same directory but may not) * Show list of documents in $filearray (may be they are all in same directory but may not)
* This also sync database if $upload_dir is defined. * This also sync database if $upload_dir is defined.
@ -1010,9 +1013,9 @@ class FormFile
* @return int <0 if KO, nb of files shown if OK * @return int <0 if KO, nb of files shown if OK
* @see list_of_autoecmfiles * @see list_of_autoecmfiles
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1, $addfilterfields=0) function list_of_documents($filearray,$object,$modulepart,$param='',$forcedownload=0,$relativepath='',$permonobject=1,$useinecm=0,$textifempty='',$maxlength=0,$title='',$url='', $showrelpart=0, $permtoeditline=-1,$upload_dir='',$sortfield='',$sortorder='ASC', $disablemove=1, $addfilterfields=0)
{ {
// phpcs:enable
global $user, $conf, $langs, $hookmanager; global $user, $conf, $langs, $hookmanager;
global $sortfield, $sortorder, $maxheightmini; global $sortfield, $sortorder, $maxheightmini;
global $dolibarr_main_url_root; global $dolibarr_main_url_root;
@ -1379,6 +1382,7 @@ class FormFile
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show list of documents in a directory * Show list of documents in a directory
* *
@ -1397,9 +1401,9 @@ class FormFile
* @return int <0 if KO, nb of files shown if OK * @return int <0 if KO, nb of files shown if OK
* @see list_of_documents * @see list_of_documents
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload=0, $relativepath='', $permtodelete=1, $useinecm=0, $textifempty='', $maxlength=0, $url='', $addfilterfields=0) function list_of_autoecmfiles($upload_dir, $filearray, $modulepart, $param, $forcedownload=0, $relativepath='', $permtodelete=1, $useinecm=0, $textifempty='', $maxlength=0, $url='', $addfilterfields=0)
{ {
// phpcs:enable
global $user, $conf, $langs, $form; global $user, $conf, $langs, $form;
global $sortfield, $sortorder; global $sortfield, $sortorder;
global $search_doc_ref; global $search_doc_ref;

View File

@ -31,7 +31,7 @@ class FormSocialContrib
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
/** /**
* @var string Error code (or message) * @var string Error code (or message)
*/ */
@ -48,9 +48,10 @@ class FormSocialContrib
$this->db = $db; $this->db = $db;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of social contributions. * Return list of social contributions.
* 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.
* *
* @param string $selected Preselected type * @param string $selected Preselected type
* @param string $htmlname Name of field in form * @param string $htmlname Name of field in form
@ -60,9 +61,9 @@ class FormSocialContrib
* @param string $morecss Add more CSS on select * @param string $morecss Add more CSS on select
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_type_socialcontrib($selected='',$htmlname='actioncode', $useempty=0, $maxlen=40, $help=1, $morecss='minwidth300') function select_type_socialcontrib($selected='',$htmlname='actioncode', $useempty=0, $maxlen=40, $help=1, $morecss='minwidth300')
{ {
// phpcs:enable
global $conf,$db,$langs,$user,$mysoc; global $conf,$db,$langs,$user,$mysoc;
if (empty($mysoc->country_id) && empty($mysoc->country_code)) if (empty($mysoc->country_id) && empty($mysoc->country_code))

View File

@ -30,7 +30,7 @@ class RssParser
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
public $db; public $db;
/** /**
* @var string Error code (or message) * @var string Error code (or message)
*/ */
@ -461,6 +461,7 @@ class RssParser
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Triggered when opened tag is found * Triggered when opened tag is found
* *
@ -469,9 +470,9 @@ class RssParser
* @param array $attrs Attributes of tags * @param array $attrs Attributes of tags
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function feed_start_element($p, $element, &$attrs) function feed_start_element($p, $element, &$attrs)
{ {
// phpcs:enable
$el = $element = strtolower($element); $el = $element = strtolower($element);
$attrs = array_change_key_case($attrs, CASE_LOWER); $attrs = array_change_key_case($attrs, CASE_LOWER);
@ -582,6 +583,7 @@ class RssParser
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Triggered when CDATA is found * Triggered when CDATA is found
* *
@ -589,9 +591,9 @@ class RssParser
* @param string $text Tag * @param string $text Tag
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function feed_cdata($p, $text) function feed_cdata($p, $text)
{ {
// phpcs:enable
if ($this->_format == 'atom' and $this->incontent) if ($this->_format == 'atom' and $this->incontent)
{ {
$this->append_content($text); $this->append_content($text);
@ -603,6 +605,7 @@ class RssParser
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Triggered when closed tag is found * Triggered when closed tag is found
* *
@ -610,9 +613,9 @@ class RssParser
* @param string $el Tag * @param string $el Tag
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function feed_end_element($p, $el) function feed_end_element($p, $el)
{ {
// phpcs:enable
$el = strtolower($el); $el = strtolower($el);
if ($el == 'item' or $el == 'entry') if ($el == 'item' or $el == 'entry')
@ -673,15 +676,16 @@ class RssParser
$str1 .= $str2; $str1 .= $str2;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Enter description here ... * Enter description here ...
* *
* @param string $text Text * @param string $text Text
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function append_content($text) function append_content($text)
{ {
// phpcs:enable
if ( $this->initem ) { if ( $this->initem ) {
$this->concat($this->current_item[ $this->incontent ], $text); $this->concat($this->current_item[ $this->incontent ], $text);
} }
@ -759,7 +763,7 @@ function xml2php($xml)
} }
//Let see if the new child is not in the array //Let see if the new child is not in the array
if($tab==false && in_array($key,array_keys($array))) if ($tab==false && in_array($key,array_keys($array)))
{ {
//If this element is already in the array we will create an indexed array //If this element is already in the array we will create an indexed array
$tmp = $array[$key]; $tmp = $array[$key];
@ -783,7 +787,7 @@ function xml2php($xml)
} }
if($fils==0) if ($fils==0)
{ {
return (string) $xml; return (string) $xml;
} }

View File

@ -296,17 +296,18 @@ class DoliDBSqlite3 extends DoliDB
return $line; return $line;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Select a database * Select a database
* *
* @param string $database Name of database * @param string $database Name of database
* @return boolean true if OK, false if KO * @return boolean true if OK, false if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_db($database) function select_db($database)
{ {
// phpcs:enable
dol_syslog(get_class($this)."::select_db database=".$database, LOG_DEBUG); dol_syslog(get_class($this)."::select_db database=".$database, LOG_DEBUG);
// sqlite_select_db() does not exist // sqlite_select_db() does not exist
//return sqlite_select_db($this->db,$database); //return sqlite_select_db($this->db,$database);
return true; return true;
} }
@ -491,15 +492,16 @@ class DoliDBSqlite3 extends DoliDB
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie la ligne courante (comme un objet) pour le curseur resultset * Renvoie la ligne courante (comme un objet) pour le curseur resultset
* *
* @param SQLite3Result $resultset Curseur de la requete voulue * @param SQLite3Result $resultset Curseur de la requete voulue
* @return false|object Object result line or false if KO or end of cursor * @return false|object Object result line or false if KO or end of cursor
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_object($resultset) function fetch_object($resultset)
{ {
// phpcs:enable
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion // Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
if (! is_object($resultset)) { $resultset=$this->_results; } if (! is_object($resultset)) { $resultset=$this->_results; }
//return $resultset->fetch(PDO::FETCH_OBJ); //return $resultset->fetch(PDO::FETCH_OBJ);
@ -511,15 +513,16 @@ class DoliDBSqlite3 extends DoliDB
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return datas as an array * Return datas as an array
* *
* @param SQLite3Result $resultset Resultset of request * @param SQLite3Result $resultset Resultset of request
* @return false|array Array or false if KO or end of cursor * @return false|array Array or false if KO or end of cursor
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_array($resultset) function fetch_array($resultset)
{ {
// phpcs:enable
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_object($resultset)) { $resultset=$this->_results; } if (! is_object($resultset)) { $resultset=$this->_results; }
//return $resultset->fetch(PDO::FETCH_ASSOC); //return $resultset->fetch(PDO::FETCH_ASSOC);
@ -527,15 +530,16 @@ class DoliDBSqlite3 extends DoliDB
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return datas as an array * Return datas as an array
* *
* @param SQLite3Result $resultset Resultset of request * @param SQLite3Result $resultset Resultset of request
* @return false|array Array or false if KO or end of cursor * @return false|array Array or false if KO or end of cursor
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_row($resultset) function fetch_row($resultset)
{ {
// phpcs:enable
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_bool($resultset)) if (! is_bool($resultset))
{ {
@ -549,6 +553,7 @@ class DoliDBSqlite3 extends DoliDB
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return number of lines for result of a SELECT * Return number of lines for result of a SELECT
* *
@ -556,10 +561,10 @@ class DoliDBSqlite3 extends DoliDB
* @return int Nb of lines * @return int Nb of lines
* @see affected_rows * @see affected_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function num_rows($resultset) function num_rows($resultset)
{ {
// FIXME: SQLite3Result does not have a queryString member // phpcs:enable
// FIXME: SQLite3Result does not have a queryString member
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_object($resultset)) { $resultset=$this->_results; } if (! is_object($resultset)) { $resultset=$this->_results; }
@ -569,6 +574,7 @@ class DoliDBSqlite3 extends DoliDB
return 0; return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return number of lines for result of a SELECT * Return number of lines for result of a SELECT
* *
@ -576,10 +582,10 @@ class DoliDBSqlite3 extends DoliDB
* @return int Nb of lines * @return int Nb of lines
* @see affected_rows * @see affected_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function affected_rows($resultset) function affected_rows($resultset)
{ {
// FIXME: SQLite3Result does not have a queryString member // phpcs:enable
// FIXME: SQLite3Result does not have a queryString member
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_object($resultset)) { $resultset=$this->_results; } if (! is_object($resultset)) { $resultset=$this->_results; }
@ -698,6 +704,7 @@ class DoliDBSqlite3 extends DoliDB
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get last ID after an insert INSERT * Get last ID after an insert INSERT
* *
@ -705,9 +712,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $fieldid Field name * @param string $fieldid Field name
* @return int Id of row * @return int Id of row
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function last_insert_id($tab,$fieldid='rowid') function last_insert_id($tab,$fieldid='rowid')
{ {
// phpcs:enable
return $this->db->lastInsertRowId(); return $this->db->lastInsertRowId();
} }
@ -780,18 +787,20 @@ class DoliDBSqlite3 extends DoliDB
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return connexion ID * Return connexion ID
* *
* @return string Id connexion * @return string Id connexion
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLGetConnectId() function DDLGetConnectId()
{ {
// phpcs:enable
return '?'; return '?';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a new database * Create a new database
* Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated * Do not use function xxx_create_db (xxx=mysql, ...) as they are deprecated
@ -803,9 +812,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $owner Username of database owner * @param string $owner Username of database owner
* @return SQLite3Result resource defined if OK, null if KO * @return SQLite3Result resource defined if OK, null if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateDb($database,$charset='',$collation='',$owner='') function DDLCreateDb($database,$charset='',$collation='',$owner='')
{ {
// phpcs:enable
if (empty($charset)) $charset=$this->forcecharset; if (empty($charset)) $charset=$this->forcecharset;
if (empty($collation)) $collation=$this->forcecollate; if (empty($collation)) $collation=$this->forcecollate;
@ -825,6 +834,7 @@ class DoliDBSqlite3 extends DoliDB
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List tables into a database * List tables into a database
* *
@ -832,9 +842,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $table Name of table filter ('xxx%') * @param string $table Name of table filter ('xxx%')
* @return array List of tables in an array * @return array List of tables in an array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLListTables($database, $table='') function DDLListTables($database, $table='')
{ {
// phpcs:enable
$listtables=array(); $listtables=array();
$like = ''; $like = '';
@ -852,16 +862,17 @@ class DoliDBSqlite3 extends DoliDB
return $listtables; return $listtables;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List information of columns into a table. * List information of columns into a table.
* *
* @param string $table Name of table * @param string $table Name of table
* @return array Tableau des informations des champs de la table * @return array Tableau des informations des champs de la table
* TODO modify for sqlite * TODO modify for sqlite
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLInfoTable($table) function DDLInfoTable($table)
{ {
// phpcs:enable
$infotables=array(); $infotables=array();
$sql="SHOW FULL COLUMNS FROM ".$table.";"; $sql="SHOW FULL COLUMNS FROM ".$table.";";
@ -878,6 +889,7 @@ class DoliDBSqlite3 extends DoliDB
return $infotables; return $infotables;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a table into database * Create a table into database
* *
@ -890,10 +902,10 @@ class DoliDBSqlite3 extends DoliDB
* @param array $keys Tableau des champs cles noms => valeur * @param array $keys Tableau des champs cles noms => valeur
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null) function DDLCreateTable($table,$fields,$primary_key,$type,$unique_keys=null,$fulltext_keys=null,$keys=null)
{ {
// FIXME: $fulltext_keys parameter is unused // phpcs:enable
// FIXME: $fulltext_keys parameter is unused
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra // cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
// ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); // ex. : $fields['rowid'] = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
@ -957,15 +969,16 @@ class DoliDBSqlite3 extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Drop a table into database * Drop a table into database
* *
* @param string $table Name of table * @param string $table Name of table
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDropTable($table) function DDLDropTable($table)
{ {
// phpcs:enable
$sql = "DROP TABLE ".$table; $sql = "DROP TABLE ".$table;
if (! $this->query($sql)) if (! $this->query($sql))
@ -974,6 +987,7 @@ class DoliDBSqlite3 extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a pointer of line with description of a table or field * Return a pointer of line with description of a table or field
* *
@ -981,9 +995,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $field Optionnel : Name of field if we want description of field * @param string $field Optionnel : Name of field if we want description of field
* @return SQLite3Result Resource * @return SQLite3Result Resource
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDescTable($table,$field="") function DDLDescTable($table,$field="")
{ {
// phpcs:enable
$sql="DESC ".$table." ".$field; $sql="DESC ".$table." ".$field;
dol_syslog(get_class($this)."::DDLDescTable ".$sql,LOG_DEBUG); dol_syslog(get_class($this)."::DDLDescTable ".$sql,LOG_DEBUG);
@ -991,6 +1005,7 @@ class DoliDBSqlite3 extends DoliDB
return $this->_results; return $this->_results;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a new field into table * Create a new field into table
* *
@ -1000,9 +1015,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $field_position Optionnel ex.: "after champtruc" * @param string $field_position Optionnel ex.: "after champtruc"
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLAddField($table,$field_name,$field_desc,$field_position="") function DDLAddField($table,$field_name,$field_desc,$field_position="")
{ {
// phpcs:enable
// cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra // cles recherchees dans le tableau des descriptions (field_desc) : type,value,attribute,null,default,extra
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment'); // ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
$sql= "ALTER TABLE ".$table." ADD ".$field_name." "; $sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
@ -1035,6 +1050,7 @@ class DoliDBSqlite3 extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update format of a field into a table * Update format of a field into a table
* *
@ -1043,9 +1059,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $field_desc Array with description of field format * @param string $field_desc Array with description of field format
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLUpdateField($table,$field_name,$field_desc) function DDLUpdateField($table,$field_name,$field_desc)
{ {
// phpcs:enable
$sql = "ALTER TABLE ".$table; $sql = "ALTER TABLE ".$table;
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type']; $sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
@ -1058,6 +1074,7 @@ class DoliDBSqlite3 extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Drop a field from table * Drop a field from table
* *
@ -1065,9 +1082,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $field_name Name of field to drop * @param string $field_name Name of field to drop
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDropField($table,$field_name) function DDLDropField($table,$field_name)
{ {
// phpcs:enable
$sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`"; $sql= "ALTER TABLE ".$table." DROP COLUMN `".$field_name."`";
dol_syslog(get_class($this)."::DDLDropField ".$sql,LOG_DEBUG); dol_syslog(get_class($this)."::DDLDropField ".$sql,LOG_DEBUG);
if (! $this->query($sql)) if (! $this->query($sql))
@ -1079,8 +1096,9 @@ class DoliDBSqlite3 extends DoliDB
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a user and privileges to connect to database (even if database does not exists yet) * Create a user and privileges to connect to database (even if database does not exists yet)
* *
* @param string $dolibarr_main_db_host Ip serveur * @param string $dolibarr_main_db_host Ip serveur
* @param string $dolibarr_main_db_user Nom user a creer * @param string $dolibarr_main_db_user Nom user a creer
@ -1088,9 +1106,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $dolibarr_main_db_name Database name where user must be granted * @param string $dolibarr_main_db_name Database name where user must be granted
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name) function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name)
{ {
// phpcs:enable
$sql = "INSERT INTO user "; $sql = "INSERT INTO user ";
$sql.= "(Host,User,password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv,Lock_tables_priv)"; $sql.= "(Host,User,password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Index_Priv,Alter_priv,Lock_tables_priv)";
$sql.= " VALUES ('".$this->escape($dolibarr_main_db_host)."','".$this->escape($dolibarr_main_db_user)."',password('".addslashes($dolibarr_main_db_pass)."')"; $sql.= " VALUES ('".$this->escape($dolibarr_main_db_host)."','".$this->escape($dolibarr_main_db_user)."',password('".addslashes($dolibarr_main_db_pass)."')";
@ -1312,6 +1330,7 @@ class DoliDBSqlite3 extends DoliDB
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* calc_daynr * calc_daynr
* *
@ -1320,9 +1339,9 @@ class DoliDBSqlite3 extends DoliDB
* @param int $day Day * @param int $day Day
* @return int Formatted date * @return int Formatted date
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private static function calc_daynr($year, $month, $day) private static function calc_daynr($year, $month, $day)
{ {
// phpcs:enable
$y = $year; $y = $year;
if ($y == 0 && $month == 0) return 0; if ($y == 0 && $month == 0) return 0;
$num = (365* $y + 31 * ($month - 1) + $day); $num = (365* $y + 31 * ($month - 1) + $day);
@ -1335,6 +1354,7 @@ class DoliDBSqlite3 extends DoliDB
return $num + floor($y / 4) - $temp; return $num + floor($y / 4) - $temp;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* calc_weekday * calc_weekday
* *
@ -1342,25 +1362,27 @@ class DoliDBSqlite3 extends DoliDB
* @param bool $sunday_first_day_of_week ??? * @param bool $sunday_first_day_of_week ???
* @return int * @return int
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private static function calc_weekday($daynr, $sunday_first_day_of_week) private static function calc_weekday($daynr, $sunday_first_day_of_week)
{ {
$ret = floor(($daynr + 5 + ($sunday_first_day_of_week ? 1 : 0)) % 7); // phpcs:enable
return $ret; $ret = floor(($daynr + 5 + ($sunday_first_day_of_week ? 1 : 0)) % 7);
return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* calc_days_in_year * calc_days_in_year
* *
* @param string $year Year * @param string $year Year
* @return int Nb of days in year * @return int Nb of days in year
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private static function calc_days_in_year($year) private static function calc_days_in_year($year)
{ {
return (($year & 3) == 0 && ($year%100 || ($year%400 == 0 && $year)) ? 366 : 365); // phpcs:enable
return (($year & 3) == 0 && ($year%100 || ($year%400 == 0 && $year)) ? 366 : 365);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* calc_week * calc_week
* *
@ -1371,9 +1393,9 @@ class DoliDBSqlite3 extends DoliDB
* @param string $calc_year ??? * @param string $calc_year ???
* @return string ??? * @return string ???
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
private static function calc_week($year, $month, $day, $week_behaviour, &$calc_year) private static function calc_week($year, $month, $day, $week_behaviour, &$calc_year)
{ {
// phpcs:enable
$daynr=self::calc_daynr($year,$month,$day); $daynr=self::calc_daynr($year,$month,$day);
$first_daynr=self::calc_daynr($year,1,1); $first_daynr=self::calc_daynr($year,1,1);
$monday_first= ($week_behaviour & self::WEEK_MONDAY_FIRST) ? 1 : 0; $monday_first= ($week_behaviour & self::WEEK_MONDAY_FIRST) ? 1 : 0;

View File

@ -85,6 +85,7 @@ class pdf_ban extends ModeleBankAccountDoc
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Fonction generant le projet sur le disque * Fonction generant le projet sur le disque
* *
@ -92,9 +93,9 @@ class pdf_ban extends ModeleBankAccountDoc
* @param Translate $outputlangs Lang output object * @param Translate $outputlangs Lang output object
* @return int 1 if OK, <=0 if KO * @return int 1 if OK, <=0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($object,$outputlangs) function write_file($object,$outputlangs)
{ {
// phpcs:enable
global $conf, $hookmanager, $langs, $user; global $conf, $hookmanager, $langs, $user;
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;

View File

@ -159,7 +159,8 @@ class pdf_strato extends ModelePDFContract
$this->posxdesc=$this->marge_gauche+1; $this->posxdesc=$this->marge_gauche+1;
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to build pdf onto disk * Function to build pdf onto disk
* *
* @param CommonObject $object Id of object to generate * @param CommonObject $object Id of object to generate
@ -170,9 +171,9 @@ class pdf_strato extends ModelePDFContract
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return int 1=OK, 0=KO * @return int 1=OK, 0=KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{ {
// phpcs:enable
global $user,$langs,$conf,$hookmanager,$mysoc; global $user,$langs,$conf,$hookmanager,$mysoc;
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;

View File

@ -135,16 +135,17 @@ class mod_contract_serpis extends ModelNumRefContracts
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return next value * Return next value
* *
* @param Societe $objsoc third party object * @param Societe $objsoc third party object
* @param Object $objforref contract object * @param Object $objforref contract object
* @return string Value if OK, 0 if KO * @return string Value if OK, 0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function contract_get_num($objsoc,$objforref) function contract_get_num($objsoc,$objforref)
{ {
// phpcs:enable
return $this->getNextValue($objsoc,$objforref); return $this->getNextValue($objsoc,$objforref);
} }
} }

View File

@ -36,17 +36,17 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
*/ */
class pdf_rouget extends ModelePdfExpedition class pdf_rouget extends ModelePdfExpedition
{ {
/** /**
* @var DoliDb Database handler * @var DoliDb Database handler
*/ */
public $db; public $db;
/** /**
* @var string model name * @var string model name
*/ */
public $name; public $name;
/** /**
* @var string model description (short text) * @var string model description (short text)
*/ */
public $description; public $description;
@ -173,6 +173,7 @@ class pdf_rouget extends ModelePdfExpedition
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to build pdf onto disk * Function to build pdf onto disk
* *
@ -184,9 +185,9 @@ class pdf_rouget extends ModelePdfExpedition
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return int 1=OK, 0=KO * @return int 1=OK, 0=KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{ {
// phpcs:enable
global $user,$conf,$langs,$hookmanager; global $user,$conf,$langs,$hookmanager;
$object->fetch_thirdparty(); $object->fetch_thirdparty();
@ -652,6 +653,7 @@ class pdf_rouget extends ModelePdfExpedition
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show total to pay * Show total to pay
* *
@ -662,9 +664,9 @@ class pdf_rouget extends ModelePdfExpedition
* @param Translate $outputlangs Objet langs * @param Translate $outputlangs Objet langs
* @return int Position pour suite * @return int Position pour suite
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs) function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
{ {
// phpcs:enable
global $conf,$mysoc; global $conf,$mysoc;
$sign=1; $sign=1;

View File

@ -190,7 +190,8 @@ class pdf_standard extends ModeleExpenseReport
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Function to build pdf onto disk * Function to build pdf onto disk
* *
* @param Object $object Object to generate * @param Object $object Object to generate
@ -201,9 +202,9 @@ class pdf_standard extends ModeleExpenseReport
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return int 1=OK, 0=KO * @return int 1=OK, 0=KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0) function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
{ {
// phpcs:enable
global $user,$langs,$conf,$mysoc,$db,$hookmanager; global $user,$langs,$conf,$mysoc,$db,$hookmanager;
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;

View File

@ -31,7 +31,7 @@ class mailing_thirdparties extends MailingTargets
var $require_module=array("societe"); // This module allows to select by categories must be also enabled if category module is not activated var $require_module=array("societe"); // This module allows to select by categories must be also enabled if category module is not activated
var $picto='company'; var $picto='company';
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
*/ */
@ -52,6 +52,7 @@ class mailing_thirdparties extends MailingTargets
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* This is the main function that returns the array of emails * This is the main function that returns the array of emails
* *
@ -59,9 +60,9 @@ class mailing_thirdparties extends MailingTargets
* @param array $filtersarray If you used the formFilter function. Empty otherwise. * @param array $filtersarray If you used the formFilter function. Empty otherwise.
* @return int <0 if error, number of emails added if ok * @return int <0 if error, number of emails added if ok
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function add_to_target($mailing_id, $filtersarray=array())
function add_to_target($mailing_id,$filtersarray=array())
{ {
// phpcs:enable
global $conf, $langs; global $conf, $langs;
$cibles = array(); $cibles = array();
@ -96,53 +97,53 @@ class mailing_thirdparties extends MailingTargets
$sql.= " AND c.rowid='".$this->db->escape($_POST['filter'])."'"; $sql.= " AND c.rowid='".$this->db->escape($_POST['filter'])."'";
} }
$addDescription= ""; $addDescription= "";
if (isset($_POST["filter_client"]) && $_POST["filter_client"] <> '-1') if (isset($_POST["filter_client"]) && $_POST["filter_client"] <> '-1')
{ {
$sql.= " AND s.client=" . $_POST["filter_client"]; $sql.= " AND s.client=" . $_POST["filter_client"];
$addDescription= $langs->trans('ProspectCustomer')."="; $addDescription= $langs->trans('ProspectCustomer')."=";
if ($_POST["filter_client"] == 0) if ($_POST["filter_client"] == 0)
{ {
$addDescription.= $langs->trans('NorProspectNorCustomer'); $addDescription.= $langs->trans('NorProspectNorCustomer');
} }
else if ($_POST["filter_client"] == 1) elseif ($_POST["filter_client"] == 1)
{ {
$addDescription.= $langs->trans('Customer'); $addDescription.= $langs->trans('Customer');
} }
else if ($_POST["filter_client"] == 2) elseif ($_POST["filter_client"] == 2)
{ {
$addDescription.= $langs->trans('Prospect'); $addDescription.= $langs->trans('Prospect');
} }
else if ($_POST["filter_client"] == 3) elseif ($_POST["filter_client"] == 3)
{ {
$addDescription.= $langs->trans('ProspectCustomer'); $addDescription.= $langs->trans('ProspectCustomer');
} }
else else
{ {
$addDescription.= "Unknown status ".$_POST["filter_client"]; $addDescription.= "Unknown status ".$_POST["filter_client"];
} }
} }
if (isset($_POST["filter_status"])) if (isset($_POST["filter_status"]))
{ {
if (strlen($addDescription) > 0) if (strlen($addDescription) > 0)
{ {
$addDescription.= ";"; $addDescription.= ";";
} }
$addDescription.= $langs->trans("Status")."="; $addDescription.= $langs->trans("Status")."=";
if ($_POST["filter_status"] == '1') if ($_POST["filter_status"] == '1')
{ {
$sql.= " AND s.status=1"; $sql.= " AND s.status=1";
$addDescription.= $langs->trans("Enabled"); $addDescription.= $langs->trans("Enabled");
} }
else else
{ {
$sql.= " AND s.status=0"; $sql.= " AND s.status=0";
$addDescription.= $langs->trans("Disabled"); $addDescription.= $langs->trans("Disabled");
} }
} }
$sql.= " ORDER BY email"; $sql.= " ORDER BY email";
// Stock recipients emails into targets table // Stock recipients emails into targets table
$result=$this->db->query($sql); $result=$this->db->query($sql);
if ($result) if ($result)
{ {
@ -313,7 +314,7 @@ class mailing_thirdparties extends MailingTargets
} }
/** /**
* Can include an URL link on each record provided by selector shown on target page. * Can include an URL link on each record provided by selector shown on target page.
* *
* @param int $id ID * @param int $id ID

View File

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

View File

@ -198,14 +198,15 @@ class mod_codeproduct_elephant extends ModeleProductCode
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Check if mask/numbering use prefix * Check if mask/numbering use prefix
* *
* @return int 0 or 1 * @return int 0 or 1
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function verif_prefixIsUsed() function verif_prefixIsUsed()
{ {
// phpcs:enable
global $conf; global $conf;
$mask = $conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT; $mask = $conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT;
@ -274,6 +275,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoi si un code est pris ou non (par autre tiers) * Renvoi si un code est pris ou non (par autre tiers)
* *
@ -282,9 +284,9 @@ class mod_codeproduct_elephant extends ModeleProductCode
* @param Product $product Objet product * @param Product $product Objet product
* @return int 0 if available, <0 if KO * @return int 0 if available, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function verif_dispo($db, $code, $product) function verif_dispo($db, $code, $product)
{ {
// phpcs:enable
$sql = "SELECT ref FROM ".MAIN_DB_PREFIX."product"; $sql = "SELECT ref FROM ".MAIN_DB_PREFIX."product";
$sql.= " WHERE ref = '".$code."'"; $sql.= " WHERE ref = '".$code."'";
if ($product->id > 0) $sql.= " AND rowid <> ".$product->id; if ($product->id > 0) $sql.= " AND rowid <> ".$product->id;

View File

@ -146,6 +146,7 @@ class pdf_standard extends ModelePDFStock
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Function to build a document on disk using the generic odt module. * Function to build a document on disk using the generic odt module.
* *
@ -157,9 +158,9 @@ class pdf_standard extends ModelePDFStock
* @param int $hideref Do not show ref * @param int $hideref Do not show ref
* @return int 1 if OK, <=0 if KO * @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) function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0)
{ {
// phpcs:enable
global $user,$langs,$conf,$mysoc,$db,$hookmanager; global $user,$langs,$conf,$mysoc,$db,$hookmanager;
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;

View File

@ -36,6 +36,7 @@ abstract class ModelePDFMovement extends CommonDocGenerator
public $error=''; public $error='';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
@ -43,9 +44,9 @@ abstract class ModelePDFMovement extends CommonDocGenerator
* @param integer $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function liste_modeles($db,$maxfilenamelength=0) static function liste_modeles($db,$maxfilenamelength=0)
{ {
// phpcs:enable
global $conf; global $conf;
$type='mouvement'; $type='mouvement';

View File

@ -29,16 +29,17 @@ abstract class ModelePDFStock extends CommonDocGenerator
public $error=''; public $error='';
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of active generation modules * Return list of active generation modules
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param integer $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of templates * @return array List of templates
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function liste_modeles($db,$maxfilenamelength=0) static function liste_modeles($db,$maxfilenamelength=0)
{ {
// phpcs:enable
global $conf; global $conf;
$type='stock'; $type='stock';