move phpcs:ignore

This commit is contained in:
Frédéric FRANCE 2018-09-06 21:27:18 +02:00
parent cbf4a20a13
commit 70ba223788
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
20 changed files with 213 additions and 143 deletions

View File

@ -54,6 +54,7 @@ class FormCompany
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of labels (translated) of third parties type * Return list of labels (translated) of third parties type
* *
@ -61,9 +62,9 @@ class FormCompany
* @param string $filter Add a SQL filter to select * @param string $filter Add a SQL filter to select
* @return array Array of types * @return array Array of types
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function typent_array($mode=0, $filter='') function typent_array($mode=0, $filter='')
{ {
// phpcs:enable
global $langs,$mysoc; global $langs,$mysoc;
$effs = array(); $effs = array();
@ -96,6 +97,7 @@ class FormCompany
return $effs; return $effs;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie la liste des types d'effectifs possibles (pas de traduction car nombre) * Renvoie la liste des types d'effectifs possibles (pas de traduction car nombre)
* *
@ -103,9 +105,9 @@ class FormCompany
* @param string $filter Add a SQL filter to select * @param string $filter Add a SQL filter to select
* @return array Array of types d'effectifs * @return array Array of types d'effectifs
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function effectif_array($mode=0, $filter='') function effectif_array($mode=0, $filter='')
{ {
// phpcs:enable
$effs = array(); $effs = array();
$sql = "SELECT id, code, libelle"; $sql = "SELECT id, code, libelle";
@ -135,6 +137,7 @@ class FormCompany
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Affiche formulaire de selection des modes de reglement * Affiche formulaire de selection des modes de reglement
* *
@ -144,9 +147,9 @@ class FormCompany
* @param int $empty Add empty value in list * @param int $empty Add empty value in list
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function form_prospect_level($page, $selected='', $htmlname='prospect_level_id', $empty=0) function form_prospect_level($page, $selected='', $htmlname='prospect_level_id', $empty=0)
{ {
// phpcs:enable
global $user, $langs; global $user, $langs;
print '<form method="post" action="'.$page.'">'; print '<form method="post" action="'.$page.'">';
@ -185,6 +188,7 @@ class FormCompany
print '</form>'; print '</form>';
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne. * Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne.
* Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays. * Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays.
@ -197,12 +201,13 @@ class FormCompany
* @param string $htmlname Id of department * @param string $htmlname Id of department
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_departement($selected='',$country_codeid=0, $htmlname='state_id') function select_departement($selected='',$country_codeid=0, $htmlname='state_id')
{ {
// phpcs:enable
print $this->select_state($selected,$country_codeid, $htmlname); print $this->select_state($selected,$country_codeid, $htmlname);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne. * Retourne la liste deroulante des departements/province/cantons tout pays confondu ou pour un pays donne.
* Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays. * Dans le cas d'une liste tout pays confondus, l'affichage fait une rupture sur le pays.
@ -216,9 +221,9 @@ class FormCompany
* @return string String with HTML select * @return string String with HTML select
* @see select_country * @see select_country
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_state($selected='',$country_codeid=0, $htmlname='state_id') function select_state($selected='',$country_codeid=0, $htmlname='state_id')
{ {
// phpcs:enable
global $conf,$langs,$user; global $conf,$langs,$user;
dol_syslog(get_class($this)."::select_departement selected=".$selected.", country_codeid=".$country_codeid,LOG_DEBUG); dol_syslog(get_class($this)."::select_departement selected=".$selected.", country_codeid=".$country_codeid,LOG_DEBUG);
@ -318,6 +323,7 @@ class FormCompany
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste deroulante des regions actives dont le pays est actif * Retourne la liste deroulante des regions actives dont le pays est actif
* La cle de la liste est le code (il peut y avoir plusieurs entree pour * La cle de la liste est le code (il peut y avoir plusieurs entree pour
@ -328,9 +334,9 @@ class FormCompany
* @param string $htmlname Name of HTML select field * @param string $htmlname Name of HTML select field
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_region($selected='',$htmlname='region_id') function select_region($selected='',$htmlname='region_id')
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$langs->load("dict"); $langs->load("dict");
@ -385,6 +391,7 @@ class FormCompany
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return combo list with people title * Return combo list with people title
* *
@ -393,9 +400,9 @@ class FormCompany
* @param string $morecss Add more css on SELECT element * @param string $morecss Add more css on SELECT element
* @return string String with HTML select * @return string String with HTML select
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100') function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100')
{ {
// phpcs:enable
global $conf,$langs,$user; global $conf,$langs,$user;
$langs->load("dict"); $langs->load("dict");
@ -442,6 +449,7 @@ class FormCompany
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne.
* Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays. * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays.
@ -453,12 +461,13 @@ class FormCompany
* @deprecated Use print xxx->select_juridicalstatus instead * @deprecated Use print xxx->select_juridicalstatus instead
* @see select_juridicalstatus() * @see select_juridicalstatus()
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_forme_juridique($selected='', $country_codeid=0, $filter='') function select_forme_juridique($selected='', $country_codeid=0, $filter='')
{ {
// phpcs:enable
print $this->select_juridicalstatus($selected, $country_codeid, $filter); print $this->select_juridicalstatus($selected, $country_codeid, $filter);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne. * Retourne la liste deroulante des formes juridiques tous pays confondus ou pour un pays donne.
* Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays * Dans le cas d'une liste tous pays confondu, on affiche une rupture sur le pays
@ -469,9 +478,9 @@ class FormCompany
* @param string $htmlname HTML name of select * @param string $htmlname HTML name of select
* @return string String with HTML select * @return string String with HTML select
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_juridicalstatus($selected='', $country_codeid=0, $filter='', $htmlname='forme_juridique_code') function select_juridicalstatus($selected='', $country_codeid=0, $filter='', $htmlname='forme_juridique_code')
{ {
// phpcs:enable
global $conf,$langs,$user; global $conf,$langs,$user;
$langs->load("dict"); $langs->load("dict");
@ -754,6 +763,7 @@ class FormCompany
} }
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a select list with zip codes and their town * Return a select list with zip codes and their town
* *
@ -766,9 +776,9 @@ class FormCompany
* @param string $morecss More css * @param string $morecss More css
* @return string * @return string
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='',$morecss='') function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='',$morecss='')
{ {
// phpcs:enable
global $conf; global $conf;
$out=''; $out='';
@ -786,6 +796,7 @@ class FormCompany
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return HTML string to use as input of professional id into a HTML page (siren, siret, etc...) * Return HTML string to use as input of professional id into a HTML page (siren, siret, etc...)
* *
@ -796,9 +807,9 @@ class FormCompany
* @param string $morecss More css * @param string $morecss More css
* @return string HTML string with prof id * @return string HTML string with prof id
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_input_id_prof($idprof,$htmlname,$preselected,$country_code,$morecss='maxwidth100onsmartphone quatrevingtpercent') function get_input_id_prof($idprof,$htmlname,$preselected,$country_code,$morecss='maxwidth100onsmartphone quatrevingtpercent')
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$formlength=0; $formlength=0;
@ -837,6 +848,7 @@ class FormCompany
return $out; return $out;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return a HTML select with localtax values for thirdparties * Return a HTML select with localtax values for thirdparties
* *
@ -845,13 +857,13 @@ class FormCompany
* @param string $htmlname HTML select name * @param string $htmlname HTML select name
* @return void * @return void
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_localtax($local, $selected, $htmlname) function select_localtax($local, $selected, $htmlname)
{ {
$tax=get_localtax_by_third($local); // phpcs:enable
$tax=get_localtax_by_third($local);
$num = $this->db->num_rows($tax); $num = $this->db->num_rows($tax);
$i = 0; $i = 0;
if ($num) if ($num)
{ {
$valors=explode(":", $tax); $valors=explode(":", $tax);

View File

@ -344,14 +344,15 @@ class SMTPs
$_aryToList = $this->getTO(); $_aryToList = $this->getTO();
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Attempt a connection to mail server * Attempt a connection to mail server
* *
* @return mixed $_retVal Boolean indicating success or failure on connection * @return mixed $_retVal Boolean indicating success or failure on connection
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _server_connect() function _server_connect()
{ {
// phpcs:enable
// Default return value // Default return value
$_retVal = true; $_retVal = true;
@ -407,14 +408,15 @@ class SMTPs
return $_retVal; return $_retVal;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Attempt mail server authentication for a secure connection * Attempt mail server authentication for a secure connection
* *
* @return boolean|null $_retVal Boolean indicating success or failure of authentication * @return boolean|null $_retVal Boolean indicating success or failure of authentication
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _server_authenticate() function _server_authenticate()
{ {
// phpcs:enable
global $conf; global $conf;
// Send the RFC2554 specified EHLO. // Send the RFC2554 specified EHLO.
@ -1038,6 +1040,7 @@ class SMTPs
$this->_msgRecipients = $aryHost; $this->_msgRecipients = $aryHost;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns an array of the various parts of an email address * Returns an array of the various parts of an email address
* This assumes a well formed address: * This assumes a well formed address:
@ -1054,9 +1057,9 @@ class SMTPs
* @param string $_strAddr Email address * @param string $_strAddr Email address
* @return array An array of the various parts of an email address * @return array An array of the various parts of an email address
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _strip_email($_strAddr) function _strip_email($_strAddr)
{ {
// phpcs:enable
// Keep the orginal // Keep the orginal
$_aryEmail['org'] = $_strAddr; $_aryEmail['org'] = $_strAddr;
@ -1090,6 +1093,7 @@ class SMTPs
return $_aryEmail; return $_aryEmail;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns an array of bares addresses for use with 'RCPT TO:' * Returns an array of bares addresses for use with 'RCPT TO:'
* This is a "build as you go" method. Each time this method is called * This is a "build as you go" method. Each time this method is called
@ -1097,9 +1101,9 @@ class SMTPs
* *
* @return array Returns an array of bares addresses * @return array Returns an array of bares addresses
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_RCPT_list() function get_RCPT_list()
{ {
// phpcs:enable
/** /**
* An array of bares addresses for use with 'RCPT TO:' * An array of bares addresses for use with 'RCPT TO:'
*/ */
@ -1121,15 +1125,16 @@ class SMTPs
return $_RCPT_list; return $_RCPT_list;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Returns an array of addresses for a specific type; TO, CC or BCC * Returns an array of addresses for a specific type; TO, CC or BCC
* *
* @param string $_which Which collection of addresses to return ('to', 'cc', 'bcc') * @param string $_which Which collection of addresses to return ('to', 'cc', 'bcc')
* @return string|false Array of emaill address * @return string|false Array of emaill address
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_email_list($_which = null) function get_email_list($_which = null)
{ {
// phpcs:enable
// We need to know which address segment to pull // We need to know which address segment to pull
if ( $_which ) if ( $_which )
{ {
@ -1750,6 +1755,7 @@ class SMTPs
else if ($type == 'alternative') return $this->_smtpsAlternativeBoundary; else if ($type == 'alternative') return $this->_smtpsAlternativeBoundary;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* This function has been modified as provided by SirSir to allow multiline responses when * This function has been modified as provided by SirSir to allow multiline responses when
* using SMTP Extensions * using SMTP Extensions
@ -1758,9 +1764,9 @@ class SMTPs
* @param string $response Response. Example: "550 5.7.1 https://support.google.com/a/answer/6140680#invalidcred j21sm814390wre.3" * @param string $response Response. Example: "550 5.7.1 https://support.google.com/a/answer/6140680#invalidcred j21sm814390wre.3"
* @return boolean True or false * @return boolean True or false
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function server_parse($socket, $response) function server_parse($socket, $response)
{ {
// phpcs:enable
/** /**
* Returns constructed SELECT Object string or boolean upon failure * Returns constructed SELECT Object string or boolean upon failure
* Default value is set at true * Default value is set at true
@ -1792,6 +1798,7 @@ class SMTPs
return $_retVal; return $_retVal;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Send str * Send str
* *
@ -1800,9 +1807,9 @@ class SMTPs
* @param string $CRLF CRLF * @param string $CRLF CRLF
* @return boolean|null True or false * @return boolean|null True or false
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function socket_send_str( $_strSend, $_returnCode = null, $CRLF = "\r\n" ) function socket_send_str( $_strSend, $_returnCode = null, $CRLF = "\r\n" )
{ {
// phpcs:enable
if ($this->_debug) $this->log.=$_strSend; // @CHANGE LDR for log if ($this->_debug) $this->log.=$_strSend; // @CHANGE LDR for log
fputs($this->socket, $_strSend . $CRLF); fputs($this->socket, $_strSend . $CRLF);
if ($this->_debug) $this->log.=' ('.$_returnCode.')' . $CRLF; if ($this->_debug) $this->log.=' ('.$_returnCode.')' . $CRLF;

View File

@ -359,20 +359,24 @@ class DoliDBPgsql extends DoliDB
return $line; return $line;
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
* Select a database /**
* Select a database
* Ici postgresql n'a aucune fonction equivalente de mysql_select_db * Ici postgresql n'a aucune fonction equivalente de mysql_select_db
* On compare juste manuellement si la database choisie est bien celle activee par la connexion * On compare juste manuellement si la database choisie est bien celle activee par la connexion
* *
* @param string $database Name of database * @param string $database Name of database
* @return bool true if OK, false if KO * @return bool true if OK, false if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function select_db($database) function select_db($database)
{ {
if ($database == $this->database_name) return true; // phpcs:enable
else return false; if ($database == $this->database_name) {
} return true;
} else {
return false;
}
}
/** /**
* Connexion to server * Connexion to server
@ -541,63 +545,68 @@ class DoliDBPgsql 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 resource $resultset Curseur de la requete voulue * @param resource $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
// If resultset not provided, we take the last used by connexion // If resultset not provided, we take the last used by connexion
if (! is_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
return pg_fetch_object($resultset); return pg_fetch_object($resultset);
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return datas as an array * Return datas as an array
* *
* @param resource $resultset Resultset of request * @param resource $resultset Resultset of request
* @return false|array Array * @return false|array Array
*/ */
// 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_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
return pg_fetch_array($resultset); return pg_fetch_array($resultset);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return datas as an array * Return datas as an array
* *
* @param resource $resultset Resultset of request * @param resource $resultset Resultset of request
* @return false|array Array * @return false|array Array
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function fetch_row($resultset) function fetch_row($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_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
return pg_fetch_row($resultset); return pg_fetch_row($resultset);
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Return number of lines for result of a SELECT * Return number of lines for result of a SELECT
* *
* @param resourse $resultset Resulset of requests * @param resourse $resultset Resulset of requests
* @return int Nb of lines, -1 on error * @return int Nb of lines, -1 on error
* @see affected_rows * @see affected_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function num_rows($resultset) function num_rows($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_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
return pg_num_rows($resultset); return pg_num_rows($resultset);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE * Renvoie le nombre de lignes dans le resultat d'une requete INSERT, DELETE ou UPDATE
* *
@ -605,9 +614,9 @@ class DoliDBPgsql extends DoliDB
* @return int Nb of lines * @return int Nb of lines
* @see num_rows * @see num_rows
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function affected_rows($resultset) function affected_rows($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_resource($resultset)) { $resultset=$this->_results; } if (! is_resource($resultset)) { $resultset=$this->_results; }
// pgsql necessite un resultset pour cette fonction contrairement // pgsql necessite un resultset pour cette fonction contrairement
@ -760,6 +769,7 @@ class DoliDBPgsql extends DoliDB
return pg_last_error($this->db); return pg_last_error($this->db);
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get last ID after an insert INSERT * Get last ID after an insert INSERT
* *
@ -767,9 +777,9 @@ class DoliDBPgsql extends DoliDB
* @param string $fieldid Field name * @param string $fieldid Field name
* @return string Id of row * @return string 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
//$result = pg_query($this->db,"SELECT MAX(".$fieldid.") FROM ".$tab); //$result = pg_query($this->db,"SELECT MAX(".$fieldid.") FROM ".$tab);
$result = pg_query($this->db,"SELECT currval('".$tab."_".$fieldid."_seq')"); $result = pg_query($this->db,"SELECT currval('".$tab."_".$fieldid."_seq')");
if (! $result) if (! $result)
@ -826,19 +836,21 @@ class DoliDBPgsql 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
@ -850,9 +862,9 @@ class DoliDBPgsql extends DoliDB
* @param string $owner Username of database owner * @param string $owner Username of database owner
* @return false|resource resource defined if OK, null if KO * @return false|resource 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;
@ -865,6 +877,7 @@ class DoliDBPgsql extends DoliDB
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List tables into a database * List tables into a database
* *
@ -872,9 +885,9 @@ class DoliDBPgsql 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 = '';
@ -890,6 +903,7 @@ class DoliDBPgsql 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.
* *
@ -897,9 +911,9 @@ class DoliDBPgsql extends DoliDB
* @return array Tableau des informations des champs de la table * @return array Tableau des informations des champs de la table
* *
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLInfoTable($table) function DDLInfoTable($table)
{ {
// phpcs:enable
$infotables=array(); $infotables=array();
$sql="SELECT "; $sql="SELECT ";
@ -931,6 +945,7 @@ class DoliDBPgsql extends DoliDB
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a table into database * Create a table into database
* *
@ -943,9 +958,9 @@ class DoliDBPgsql 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)
{ {
// phpcs:enable
// FIXME: $fulltext_keys parameter is unused // 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
@ -1011,15 +1026,16 @@ class DoliDBPgsql 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))
@ -1028,6 +1044,7 @@ class DoliDBPgsql extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a user to connect to database * Create a user to connect to database
* *
@ -1037,9 +1054,9 @@ class DoliDBPgsql 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
// Note: using ' on user does not works with pgsql // Note: using ' on user does not works with pgsql
$sql = "CREATE USER ".$this->escape($dolibarr_main_db_user)." with password '".$this->escape($dolibarr_main_db_pass)."'"; $sql = "CREATE USER ".$this->escape($dolibarr_main_db_user)." with password '".$this->escape($dolibarr_main_db_pass)."'";
@ -1053,6 +1070,7 @@ class DoliDBPgsql 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
* *
@ -1060,9 +1078,9 @@ class DoliDBPgsql 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 false|resource Resultset x (x->attname) * @return false|resource Resultset x (x->attname)
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function DDLDescTable($table,$field="") function DDLDescTable($table,$field="")
{ {
// phpcs:enable
$sql ="SELECT attname FROM pg_attribute, pg_type WHERE typname = '".$table."' AND attrelid = typrelid"; $sql ="SELECT attname FROM pg_attribute, pg_type WHERE typname = '".$table."' AND attrelid = typrelid";
$sql.=" AND attname NOT IN ('cmin', 'cmax', 'ctid', 'oid', 'tableoid', 'xmin', 'xmax')"; $sql.=" AND attname NOT IN ('cmin', 'cmax', 'ctid', 'oid', 'tableoid', 'xmin', 'xmax')";
if ($field) $sql.= " AND attname = '".$field."'"; if ($field) $sql.= " AND attname = '".$field."'";
@ -1072,6 +1090,7 @@ class DoliDBPgsql 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
* *
@ -1081,37 +1100,38 @@ class DoliDBPgsql 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." ";
$sql .= $field_desc['type']; $sql .= $field_desc['type'];
if(preg_match("/^[^\s]/i",$field_desc['value'])) if (preg_match("/^[^\s]/i",$field_desc['value']))
if (! in_array($field_desc['type'],array('int','date','datetime'))) if (! in_array($field_desc['type'],array('int','date','datetime')))
{ {
$sql.= "(".$field_desc['value'].")"; $sql.= "(".$field_desc['value'].")";
} }
if (preg_match("/^[^\s]/i",$field_desc['attribute'])) if (preg_match("/^[^\s]/i",$field_desc['attribute']))
$sql .= " ".$field_desc['attribute']; $sql .= " ".$field_desc['attribute'];
if (preg_match("/^[^\s]/i",$field_desc['null'])) if (preg_match("/^[^\s]/i",$field_desc['null']))
$sql .= " ".$field_desc['null']; $sql .= " ".$field_desc['null'];
if (preg_match("/^[^\s]/i",$field_desc['default'])) if (preg_match("/^[^\s]/i",$field_desc['default']))
if (preg_match("/null/i",$field_desc['default'])) if (preg_match("/null/i",$field_desc['default']))
$sql .= " default ".$field_desc['default']; $sql .= " default ".$field_desc['default'];
else else
$sql .= " default '".$field_desc['default']."'"; $sql .= " default '".$field_desc['default']."'";
if (preg_match("/^[^\s]/i",$field_desc['extra'])) if (preg_match("/^[^\s]/i",$field_desc['extra']))
$sql .= " ".$field_desc['extra']; $sql .= " ".$field_desc['extra'];
$sql .= " ".$field_position; $sql .= " ".$field_position;
dol_syslog($sql,LOG_DEBUG); dol_syslog($sql,LOG_DEBUG);
if(! $this -> query($sql)) if (! $this -> query($sql))
return -1; return -1;
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
* *
@ -1120,9 +1140,9 @@ class DoliDBPgsql 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'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') { if ($field_desc['type'] == 'double' || $field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
@ -1156,6 +1176,7 @@ class DoliDBPgsql extends DoliDB
return 1; return 1;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Drop a field from table * Drop a field from table
* *
@ -1163,9 +1184,9 @@ class DoliDBPgsql 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($sql,LOG_DEBUG); dol_syslog($sql,LOG_DEBUG);
if (! $this->query($sql)) if (! $this->query($sql))

View File

@ -98,6 +98,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
*/ */
function write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null) function write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
{ {
// phpcs:enable
global $conf, $hookmanager, $langs, $user, $mysoc; global $conf, $hookmanager, $langs, $user, $mysoc;
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;
@ -464,6 +465,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Show area for the customer to sign * Show area for the customer to sign
* *
@ -473,9 +475,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc
* @param Translate $outputlangs Objet langs * @param Translate $outputlangs Objet langs
* @return int Position pour suite * @return int Position pour suite
*/ */
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function _signature_area(&$pdf, $object, $posy, $outputlangs) function _signature_area(&$pdf, $object, $posy, $outputlangs)
{ {
// phpcs:enable
$default_font_size = pdf_getPDFFontSize($outputlangs); $default_font_size = pdf_getPDFFontSize($outputlangs);
$tab_top = $posy + 4; $tab_top = $posy + 4;
$tab_hl = 4; $tab_hl = 4;

View File

@ -131,13 +131,14 @@ class mod_commande_marbre extends ModeleNumRefCommandes
$yymm = strftime("%y%m",$date); $yymm = strftime("%y%m",$date);
if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is if ($max >= (pow(10, 4) - 1)) $num=$max+1; // If counter > 9999, we do not format on 4 chars, we take number as it is
else $num = sprintf("%04s",$max+1); else $num = sprintf("%04s", $max+1);
dol_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num); dol_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);
return $this->prefix.$yymm."-".$num; return $this->prefix.$yymm."-".$num;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return next free value * Return next free value
* *
@ -145,9 +146,9 @@ class mod_commande_marbre extends ModeleNumRefCommandes
* @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

@ -117,16 +117,17 @@ class mod_contract_magre extends ModelNumRefContracts
return $numFinal; return $numFinal;
} }
// 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

@ -145,6 +145,7 @@ class ExportTsv extends ModeleExports
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Open output file * Open output file
* *
@ -152,14 +153,14 @@ class ExportTsv extends ModeleExports
* @param Translate $outputlangs Output language object * @param Translate $outputlangs Output language object
* @return int <0 if KO, >=0 if OK * @return int <0 if KO, >=0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps function open_file($file,$outputlangs)
function open_file($file,$outputlangs)
{ {
// phpcs:enable
global $langs; global $langs;
dol_syslog("ExportTsv::open_file file=".$file); dol_syslog("ExportTsv::open_file file=".$file);
$ret=1; $ret=1;
$outputlangs->load("exports"); $outputlangs->load("exports");
$this->handle = fopen($file, "wt"); $this->handle = fopen($file, "wt");
@ -173,20 +174,22 @@ class ExportTsv extends ModeleExports
return $ret; return $ret;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output header into file * Output header into file
* *
* @param Translate $outputlangs Output language object * @param Translate $outputlangs Output language object
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_header($outputlangs) function write_header($outputlangs)
{ {
// phpcs:enable
return 0; return 0;
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/**
* Output title line into file * Output title line into file
* *
* @param array $array_export_fields_label Array with list of label of fields * @param array $array_export_fields_label Array with list of label of fields
@ -195,9 +198,9 @@ class ExportTsv extends ModeleExports
* @param array $array_types Array with types of fields * @param array $array_types Array with types of fields
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs,$array_types) function write_title($array_export_fields_label,$array_selected_sorted,$outputlangs,$array_types)
{ {
// phpcs:enable
foreach($array_selected_sorted as $code => $value) foreach($array_selected_sorted as $code => $value)
{ {
$newvalue=$outputlangs->transnoentities($array_export_fields_label[$code]); // newvalue is now $outputlangs->charset_output encoded $newvalue=$outputlangs->transnoentities($array_export_fields_label[$code]); // newvalue is now $outputlangs->charset_output encoded
@ -210,6 +213,7 @@ class ExportTsv extends ModeleExports
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output record line into file * Output record line into file
* *
@ -219,9 +223,9 @@ class ExportTsv extends ModeleExports
* @param array $array_types Array with types of fields * @param array $array_types Array with types of fields
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_record($array_selected_sorted,$objp,$outputlangs,$array_types) function write_record($array_selected_sorted,$objp,$outputlangs,$array_types)
{ {
// phpcs:enable
global $conf; global $conf;
$this->col=0; $this->col=0;
@ -253,40 +257,43 @@ class ExportTsv extends ModeleExports
return 0; return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Output footer into file * Output footer into file
* *
* @param Translate $outputlangs Output language object * @param Translate $outputlangs Output language object
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function write_footer($outputlangs) function write_footer($outputlangs)
{ {
// phpcs:enable
return 0; return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Close file handle * Close file handle
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function close_file() function close_file()
{ {
// phpcs:enable
fclose($this->handle); fclose($this->handle);
return 0; return 0;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Clean a cell to respect rules of TSV file cells * Clean a cell to respect rules of TSV file cells
* *
* @param string $newvalue String to clean * @param string $newvalue String to clean
* @param string $charset Input AND Output character set * @param string $charset Input AND Output character set
* @return string Value cleaned * @return string Value cleaned
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function tsv_clean($newvalue, $charset) function tsv_clean($newvalue, $charset)
{ {
// phpcs:enable
// Rule Dolibarr: No HTML // Rule Dolibarr: No HTML
$newvalue=dol_string_nohtmltag($newvalue, 1, $charset); $newvalue=dol_string_nohtmltag($newvalue, 1, $charset);
@ -300,6 +307,6 @@ class ExportTsv extends ModeleExports
$newvalue=str_replace("\t"," ",$newvalue); $newvalue=str_replace("\t"," ",$newvalue);
} }
return $newvalue; return $newvalue;
} }
} }

View File

@ -151,6 +151,7 @@ class pdf_soleil extends ModelePDFFicheinter
$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
* *
@ -162,9 +163,9 @@ class pdf_soleil extends ModelePDFFicheinter
* @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

@ -143,16 +143,17 @@ class ModeleImports
} }
/** // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
* Charge en memoire et renvoie la liste des modeles actifs /**
* * Charge en memoire et renvoie la liste des modeles actifs
*
* @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
function liste_modeles($db,$maxfilenamelength=0) function liste_modeles($db,$maxfilenamelength=0)
{ {
// phpcs:enable
dol_syslog(get_class($this)."::liste_modeles"); dol_syslog(get_class($this)."::liste_modeles");
$dir=DOL_DOCUMENT_ROOT."/core/modules/import/"; $dir=DOL_DOCUMENT_ROOT."/core/modules/import/";

View File

@ -327,16 +327,17 @@ class mailing_contacts1 extends MailingTargets
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Ajoute destinataires dans table des cibles * Ajoute destinataires dans table des cibles
* *
* @param int $mailing_id Id of emailing * @param int $mailing_id Id of emailing
* @param array $filtersarray Optional filter data (deprecated) * @param array $filtersarray Optional filter data (deprecated)
* @return int <0 si erreur, nb ajout si ok * @return int <0 si erreur, nb ajout si 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;
$filter = GETPOST('filter','alpha'); $filter = GETPOST('filter','alpha');

View File

@ -56,6 +56,7 @@ class mailing_example 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
* *
@ -63,9 +64,9 @@ class mailing_example 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
$target = array(); $target = array();
// CHANGE THIS // CHANGE THIS
@ -112,7 +113,7 @@ class mailing_example extends MailingTargets
*/ */
function getNbOfRecipients($sql='') function getNbOfRecipients($sql='')
{ {
// CHANGE THIS: Optionnal // CHANGE THIS: Optionnal
// Example: return parent::getNbOfRecipients("SELECT count(*) as nb from dolibarr_table"); // Example: return parent::getNbOfRecipients("SELECT count(*) as nb from dolibarr_table");
// Example: return 500; // Example: return 500;
@ -127,7 +128,7 @@ class mailing_example extends MailingTargets
*/ */
function formFilter() function formFilter()
{ {
// CHANGE THIS: Optionnal // CHANGE THIS: Optionnal
$s=''; $s='';
return $s; return $s;
@ -143,7 +144,7 @@ class mailing_example extends MailingTargets
*/ */
function url($id) function url($id)
{ {
// CHANGE THIS: Optionnal // CHANGE THIS: Optionnal
return ''; return '';
} }

View File

@ -146,6 +146,7 @@ class mailing_pomme extends MailingTargets
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Ajoute destinataires dans table des cibles * Ajoute destinataires dans table des cibles
* *
@ -153,9 +154,9 @@ class mailing_pomme extends MailingTargets
* @param array $filtersarray Requete sql de selection des destinataires * @param array $filtersarray Requete sql de selection des destinataires
* @return int < 0 si erreur, nb ajout si ok * @return int < 0 si erreur, nb ajout si 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
// Deprecation warning // Deprecation warning
if ($filtersarray) { if ($filtersarray) {
dol_syslog(__METHOD__ . ": filtersarray parameter is deprecated", LOG_WARNING); dol_syslog(__METHOD__ . ": filtersarray parameter is deprecated", LOG_WARNING);

View File

@ -1,6 +1,6 @@
<?php <?php
/* /*
* Copyright (C) 2014-2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2014-2018 Frederic France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by

View File

@ -1,6 +1,6 @@
<?php <?php
/* /*
* Copyright (C) 2014-2015 Frederic France <frederic.france@free.fr> * Copyright (C) 2014-2018 Frederic France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -19,7 +19,7 @@
/** /**
* \file htdocs/core/modules/printing/printipp.modules.php * \file htdocs/core/modules/printing/printipp.modules.php
* \ingroup mailing * \ingroup printing
* \brief File to provide printing with PrintIPP * \brief File to provide printing with PrintIPP
*/ */
@ -42,14 +42,14 @@ class printing_printipp extends PrintingDriver
var $password; var $password;
/** /**
* @var string Error code (or message) * @var string Error code (or message)
*/ */
public $error=''; public $error='';
/** /**
* @var string[] Error codes (or messages) * @var string[] Error codes (or messages)
*/ */
public $errors = array(); public $errors = array();
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
@ -78,6 +78,7 @@ class printing_printipp extends PrintingDriver
$this->conf[] = array('enabled'=>1, 'type'=>'submit'); $this->conf[] = array('enabled'=>1, 'type'=>'submit');
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Print selected file * Print selected file
* *
@ -87,9 +88,9 @@ class printing_printipp extends PrintingDriver
* *
* @return int 0 if OK, >0 if KO * @return int 0 if OK, >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function print_file($file, $module, $subdir='') function print_file($file, $module, $subdir='')
{ {
// phpcs:enable
global $conf, $user; global $conf, $user;
$error = 0; $error = 0;
@ -118,11 +119,11 @@ class printing_printipp extends PrintingDriver
{ {
if (! empty($conf->global->PRINTIPP_URI_DEFAULT)) if (! empty($conf->global->PRINTIPP_URI_DEFAULT))
{ {
dol_syslog("Will use default printer conf->global->PRINTIPP_URI_DEFAULT = ".$conf->global->PRINTIPP_URI_DEFAULT); dol_syslog("Will use default printer conf->global->PRINTIPP_URI_DEFAULT = ".$conf->global->PRINTIPP_URI_DEFAULT);
$ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT); $ipp->setPrinterURI($conf->global->PRINTIPP_URI_DEFAULT);
} }
else else
{ {
$this->errors[] = 'NoDefaultPrinterDefined'; $this->errors[] = 'NoDefaultPrinterDefined';
$error++; $error++;
return $error; return $error;
@ -195,24 +196,25 @@ class printing_printipp extends PrintingDriver
$html.= img_picto($langs->trans("Default"),'on'); $html.= img_picto($langs->trans("Default"),'on');
} }
else else
{ {
$html.= '<a href="'.$_SERVER["PHP_SELF"].'?action=setvalue&amp;mode=test&amp;varname=PRINTIPP_URI_DEFAULT&amp;driver=printipp&amp;value='.urlencode($value).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>'; $html.= '<a href="'.$_SERVER["PHP_SELF"].'?action=setvalue&amp;mode=test&amp;varname=PRINTIPP_URI_DEFAULT&amp;driver=printipp&amp;value='.urlencode($value).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
} }
$html.= '</td>'; $html.= '</td>';
$html.= '</tr>'."\n"; $html.= '</tr>'."\n";
} }
$this->resprint = $html; $this->resprint = $html;
return $error; return $error;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return list of available printers * Return list of available printers
* *
* @return array list of printers * @return array list of printers
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function getlist_available_printers() function getlist_available_printers()
{ {
// phpcs:enable
global $conf,$db; global $conf,$db;
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php'; include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
$ipp = new CupsPrintIPP(); $ipp = new CupsPrintIPP();
@ -225,15 +227,16 @@ class printing_printipp extends PrintingDriver
return $ipp->available_printers; return $ipp->available_printers;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Get printer detail * Get printer detail
* *
* @param string $uri URI * @param string $uri URI
* @return array List of attributes * @return array List of attributes
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_printer_detail($uri) function get_printer_detail($uri)
{ {
// phpcs:enable
global $conf,$db; global $conf,$db;
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php'; include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
@ -248,6 +251,7 @@ class printing_printipp extends PrintingDriver
return $ipp->printer_attributes; return $ipp->printer_attributes;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* List jobs print * List jobs print
* *
@ -255,9 +259,9 @@ class printing_printipp extends PrintingDriver
* *
* @return int 0 if OK, >0 if KO * @return int 0 if OK, >0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function list_jobs($module) function list_jobs($module)
{ {
// phpcs:enable
global $conf, $db, $bc; global $conf, $db, $bc;
$error = 0; $error = 0;
$html = ''; $html = '';

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
/** /**
* Parent class of document generator for address sheet. * Parent class of document generator for address sheet.
*/ */
class ModelePDFLabels class ModelePDFLabels
{ {
@ -40,16 +40,17 @@ class ModelePDFLabels
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
function liste_modeles($db,$maxfilenamelength=0) function liste_modeles($db,$maxfilenamelength=0)
{ {
// phpcs:enable
global $conf; global $conf;
$type='members_labels'; $type='members_labels';
@ -63,6 +64,7 @@ class ModelePDFLabels
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a document onto disk according to template module. * Create a document onto disk according to template module.
* *
@ -75,9 +77,9 @@ class ModelePDFLabels
* @param string $filename Short file name of PDF output file * @param string $filename Short file name of PDF output file
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outputdir='', $template='standardlabel', $filename='tmp_address_sheet.pdf') function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outputdir='', $template='standardlabel', $filename='tmp_address_sheet.pdf')
{ {
// phpcs:enable
global $conf,$langs; global $conf,$langs;
$langs->load("members"); $langs->load("members");

View File

@ -143,16 +143,17 @@ class mod_project_simple extends ModeleNumRefProjects
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return next reference not yet used as a reference * Return next reference not yet used as a reference
* *
* @param Societe $objsoc Object third party * @param Societe $objsoc Object third party
* @param Project $project Object project * @param Project $project Object project
* @return string Next not used reference * @return string Next not used reference
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function project_get_num($objsoc=0,$project='') function project_get_num($objsoc=0,$project='')
{ {
// phpcs:enable
return $this->getNextValue($objsoc,$project); return $this->getNextValue($objsoc,$project);
} }
} }

View File

@ -143,14 +143,14 @@ class mod_task_simple extends ModeleNumRefTask
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Return next reference not yet used as a reference * Return next reference not yet used as a reference
* *
* @param Societe $objsoc Object third party * @param Societe $objsoc Object third party
* @param Task $object Object task * @param Task $object Object task
* @return string Next not used reference * @return string Next not used reference
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function task_get_num($objsoc=0,$object='') function task_get_num($objsoc=0,$object='')
{ {
return $this->getNextValue($objsoc,$object); return $this->getNextValue($objsoc,$object);

View File

@ -164,6 +164,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
return $texte; return $texte;
} }
// 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.
* *
@ -175,9 +176,9 @@ class doc_generic_odt extends ModeleThirdPartyDoc
* @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,$hookmanager; global $user,$langs,$conf,$mysoc,$hookmanager;
if (empty($srctemplatepath)) if (empty($srctemplatepath))

View File

@ -38,23 +38,24 @@ abstract class ModeleThirdPartyDoc 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='company'; $type='company';
$liste=array(); $liste=array();
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$liste=getListOfModels($db,$type,$maxfilenamelength); $liste = getListOfModels($db,$type,$maxfilenamelength);
return $liste; return $liste;
} }
@ -67,7 +68,7 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator
abstract class ModeleThirdPartyCode abstract class ModeleThirdPartyCode
{ {
/** /**
* @var string Error code (or message) * @var string Error code (or message)
*/ */
public $error=''; public $error='';
@ -144,6 +145,7 @@ abstract class ModeleThirdPartyCode
return $langs->trans("NotAvailable"); return $langs->trans("NotAvailable");
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Renvoie la liste des modeles de numérotation * Renvoie la liste des modeles de numérotation
* *
@ -151,9 +153,9 @@ abstract class ModeleThirdPartyCode
* @param integer $maxfilenamelength Max length of value to show * @param integer $maxfilenamelength Max length of value to show
* @return array List of numbers * @return array List of numbers
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
static function liste_modeles($db,$maxfilenamelength=0) static function liste_modeles($db,$maxfilenamelength=0)
{ {
// phpcs:enable
$liste=array(); $liste=array();
$sql =""; $sql ="";
@ -177,12 +179,12 @@ abstract class ModeleThirdPartyCode
} }
/** /**
* Return description of module parameters * Return description of module parameters
* *
* @param Translate $langs Output language * @param Translate $langs Output language
* @param Societe $soc Third party object * @param Societe $soc Third party object
* @param int $type -1=Nothing, 0=Customer, 1=Supplier * @param int $type -1=Nothing, 0=Customer, 1=Supplier
* @return string HTML translated description * @return string HTML translated description
*/ */
function getToolTip($langs,$soc,$type) function getToolTip($langs,$soc,$type)
{ {
@ -243,14 +245,15 @@ abstract class ModeleThirdPartyCode
return $s; return $s;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Check if mask/numbering use prefix * Check if mask/numbering use prefix
* *
* @return int 0=no, 1=yes * @return int 0=no, 1=yes
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function verif_prefixIsUsed() function verif_prefixIsUsed()
{ {
// phpcs:enable
return 0; return 0;
} }
} }
@ -355,6 +358,7 @@ abstract class ModeleAccountancyCode
return $s; return $s;
} }
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Set accountancy account code for a third party into this->code * Set accountancy account code for a third party into this->code
* *
@ -363,10 +367,10 @@ abstract class ModeleAccountancyCode
* @param int $type 'customer' or 'supplier' * @param int $type 'customer' or 'supplier'
* @return int >=0 if OK, <0 if KO * @return int >=0 if OK, <0 if KO
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function get_code($db, $societe, $type='') function get_code($db, $societe, $type='')
{ {
global $langs; // phpcs:enable
global $langs;
return $langs->trans("NotAvailable"); return $langs->trans("NotAvailable");
} }
@ -374,6 +378,7 @@ abstract class ModeleAccountancyCode
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Create a document onto disk according to template module. * Create a document onto disk according to template module.
* *
@ -389,9 +394,9 @@ abstract class ModeleAccountancyCode
* @deprecated Use the new function generateDocument of Facture class * @deprecated Use the new function generateDocument of Facture class
* @see Societe::generateDocument() * @see Societe::generateDocument()
*/ */
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function thirdparty_doc_create(DoliDB $db, Societe $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0) function thirdparty_doc_create(DoliDB $db, Societe $object, $message, $modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
{ {
// phpcs:enable
dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING); dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);
return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref); return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);

View File

@ -42,16 +42,17 @@ abstract class ModelePDFSupplierProposal 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='supplier_proposal'; $type='supplier_proposal';