move phpcs:ignore
This commit is contained in:
parent
cbf4a20a13
commit
70ba223788
@ -35,7 +35,7 @@ class FormCompany
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
@ -54,6 +54,7 @@ class FormCompany
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of labels (translated) of third parties type
|
||||
*
|
||||
@ -61,9 +62,9 @@ class FormCompany
|
||||
* @param string $filter Add a SQL filter to select
|
||||
* @return array Array of types
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function typent_array($mode=0, $filter='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs,$mysoc;
|
||||
|
||||
$effs = array();
|
||||
@ -96,6 +97,7 @@ class FormCompany
|
||||
return $effs;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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
|
||||
* @return array Array of types d'effectifs
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function effectif_array($mode=0, $filter='')
|
||||
{
|
||||
// phpcs:enable
|
||||
$effs = array();
|
||||
|
||||
$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
|
||||
*
|
||||
@ -144,9 +147,9 @@ class FormCompany
|
||||
* @param int $empty Add empty value in list
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function form_prospect_level($page, $selected='', $htmlname='prospect_level_id', $empty=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $langs;
|
||||
|
||||
print '<form method="post" action="'.$page.'">';
|
||||
@ -185,6 +188,7 @@ class FormCompany
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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.
|
||||
@ -197,12 +201,13 @@ class FormCompany
|
||||
* @param string $htmlname Id of department
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_departement($selected='',$country_codeid=0, $htmlname='state_id')
|
||||
{
|
||||
// phpcs:enable
|
||||
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.
|
||||
* 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
|
||||
* @see select_country
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_state($selected='',$country_codeid=0, $htmlname='state_id')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$user;
|
||||
|
||||
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
|
||||
* 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
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_region($selected='',$htmlname='region_id')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
$langs->load("dict");
|
||||
|
||||
@ -385,6 +391,7 @@ class FormCompany
|
||||
}
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return combo list with people title
|
||||
*
|
||||
@ -393,9 +400,9 @@ class FormCompany
|
||||
* @param string $morecss Add more css on SELECT element
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_civility($selected='',$htmlname='civility_id',$morecss='maxwidth100')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$user;
|
||||
$langs->load("dict");
|
||||
|
||||
@ -442,6 +449,7 @@ class FormCompany
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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.
|
||||
@ -453,12 +461,13 @@ class FormCompany
|
||||
* @deprecated Use print xxx->select_juridicalstatus instead
|
||||
* @see select_juridicalstatus()
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_forme_juridique($selected='', $country_codeid=0, $filter='')
|
||||
{
|
||||
// phpcs:enable
|
||||
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.
|
||||
* 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
|
||||
* @return string String with HTML select
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_juridicalstatus($selected='', $country_codeid=0, $filter='', $htmlname='forme_juridique_code')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$user;
|
||||
$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
|
||||
*
|
||||
@ -766,9 +776,9 @@ class FormCompany
|
||||
* @param string $morecss More css
|
||||
* @return string
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_ziptown($selected='', $htmlname='zipcode', $fields='', $fieldsize=0, $disableautocomplete=0, $moreattrib='',$morecss='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$out='';
|
||||
@ -786,6 +796,7 @@ class FormCompany
|
||||
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...)
|
||||
*
|
||||
@ -796,9 +807,9 @@ class FormCompany
|
||||
* @param string $morecss More css
|
||||
* @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')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
||||
$formlength=0;
|
||||
@ -837,6 +848,7 @@ class FormCompany
|
||||
return $out;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return a HTML select with localtax values for thirdparties
|
||||
*
|
||||
@ -845,13 +857,13 @@ class FormCompany
|
||||
* @param string $htmlname HTML select name
|
||||
* @return void
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
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);
|
||||
$i = 0;
|
||||
$num = $this->db->num_rows($tax);
|
||||
$i = 0;
|
||||
if ($num)
|
||||
{
|
||||
$valors=explode(":", $tax);
|
||||
|
||||
@ -344,14 +344,15 @@ class SMTPs
|
||||
$_aryToList = $this->getTO();
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Attempt a connection to mail server
|
||||
*
|
||||
* @return mixed $_retVal Boolean indicating success or failure on connection
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _server_connect()
|
||||
{
|
||||
// phpcs:enable
|
||||
// Default return value
|
||||
$_retVal = true;
|
||||
|
||||
@ -407,14 +408,15 @@ class SMTPs
|
||||
return $_retVal;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Attempt mail server authentication for a secure connection
|
||||
*
|
||||
* @return boolean|null $_retVal Boolean indicating success or failure of authentication
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _server_authenticate()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
// Send the RFC2554 specified EHLO.
|
||||
@ -1038,6 +1040,7 @@ class SMTPs
|
||||
$this->_msgRecipients = $aryHost;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Returns an array of the various parts of an email address
|
||||
* This assumes a well formed address:
|
||||
@ -1054,9 +1057,9 @@ class SMTPs
|
||||
* @param string $_strAddr Email address
|
||||
* @return array An array of the various parts of an email address
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _strip_email($_strAddr)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Keep the orginal
|
||||
$_aryEmail['org'] = $_strAddr;
|
||||
|
||||
@ -1090,6 +1093,7 @@ class SMTPs
|
||||
return $_aryEmail;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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
|
||||
@ -1097,9 +1101,9 @@ class SMTPs
|
||||
*
|
||||
* @return array Returns an array of bares addresses
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_RCPT_list()
|
||||
{
|
||||
// phpcs:enable
|
||||
/**
|
||||
* An array of bares addresses for use with 'RCPT TO:'
|
||||
*/
|
||||
@ -1121,15 +1125,16 @@ class SMTPs
|
||||
return $_RCPT_list;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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')
|
||||
* @return string|false Array of emaill address
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_email_list($_which = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
// We need to know which address segment to pull
|
||||
if ( $_which )
|
||||
{
|
||||
@ -1750,6 +1755,7 @@ class SMTPs
|
||||
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
|
||||
* 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"
|
||||
* @return boolean True or false
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function server_parse($socket, $response)
|
||||
{
|
||||
// phpcs:enable
|
||||
/**
|
||||
* Returns constructed SELECT Object string or boolean upon failure
|
||||
* Default value is set at true
|
||||
@ -1792,6 +1798,7 @@ class SMTPs
|
||||
return $_retVal;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Send str
|
||||
*
|
||||
@ -1800,9 +1807,9 @@ class SMTPs
|
||||
* @param string $CRLF CRLF
|
||||
* @return boolean|null True or false
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function socket_send_str( $_strSend, $_returnCode = null, $CRLF = "\r\n" )
|
||||
{
|
||||
// phpcs:enable
|
||||
if ($this->_debug) $this->log.=$_strSend; // @CHANGE LDR for log
|
||||
fputs($this->socket, $_strSend . $CRLF);
|
||||
if ($this->_debug) $this->log.=' ('.$_returnCode.')' . $CRLF;
|
||||
|
||||
@ -359,20 +359,24 @@ class DoliDBPgsql extends DoliDB
|
||||
return $line;
|
||||
}
|
||||
|
||||
/**
|
||||
* Select a database
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Select a database
|
||||
* 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
|
||||
*
|
||||
* @param string $database Name of database
|
||||
* @return bool true if OK, false if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function select_db($database)
|
||||
{
|
||||
if ($database == $this->database_name) return true;
|
||||
else return false;
|
||||
}
|
||||
// phpcs:enable
|
||||
if ($database == $this->database_name) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Connexion to server
|
||||
@ -541,63 +545,68 @@ class DoliDBPgsql extends DoliDB
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoie la ligne courante (comme un objet) pour le curseur resultset
|
||||
*
|
||||
* @param resource $resultset Curseur de la requete voulue
|
||||
* @return false|object Object result line or false if KO or end of cursor
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_object($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
return pg_fetch_object($resultset);
|
||||
}
|
||||
|
||||
/**
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return datas as an array
|
||||
*
|
||||
* @param resource $resultset Resultset of request
|
||||
* @return false|array Array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_array($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
return pg_fetch_array($resultset);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return datas as an array
|
||||
*
|
||||
* @param resource $resultset Resultset of request
|
||||
* @return false|array Array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function fetch_row($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
return pg_fetch_row($resultset);
|
||||
}
|
||||
|
||||
/**
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return number of lines for result of a SELECT
|
||||
*
|
||||
* @param resourse $resultset Resulset of requests
|
||||
* @return int Nb of lines, -1 on error
|
||||
* @see affected_rows
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
*/
|
||||
function num_rows($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
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
|
||||
*
|
||||
@ -605,9 +614,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @return int Nb of lines
|
||||
* @see num_rows
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function affected_rows($resultset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// If resultset not provided, we take the last used by connexion
|
||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||
// pgsql necessite un resultset pour cette fonction contrairement
|
||||
@ -760,6 +769,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return pg_last_error($this->db);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get last ID after an insert INSERT
|
||||
*
|
||||
@ -767,9 +777,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param string $fieldid Field name
|
||||
* @return string Id of row
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
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 currval('".$tab."_".$fieldid."_seq')");
|
||||
if (! $result)
|
||||
@ -826,19 +836,21 @@ class DoliDBPgsql extends DoliDB
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return connexion ID
|
||||
*
|
||||
* @return string Id connexion
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLGetConnectId()
|
||||
{
|
||||
// phpcs:enable
|
||||
return '?';
|
||||
}
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a new database
|
||||
* 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
|
||||
* @return false|resource resource defined if OK, null if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLCreateDb($database,$charset='',$collation='',$owner='')
|
||||
{
|
||||
// phpcs:enable
|
||||
if (empty($charset)) $charset=$this->forcecharset;
|
||||
if (empty($collation)) $collation=$this->forcecollate;
|
||||
|
||||
@ -865,6 +877,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List tables into a database
|
||||
*
|
||||
@ -872,9 +885,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param string $table Name of table filter ('xxx%')
|
||||
* @return array List of tables in an array
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLListTables($database, $table='')
|
||||
{
|
||||
{
|
||||
// phpcs:enable
|
||||
$listtables=array();
|
||||
|
||||
$like = '';
|
||||
@ -890,6 +903,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return $listtables;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLInfoTable($table)
|
||||
{
|
||||
// phpcs:enable
|
||||
$infotables=array();
|
||||
|
||||
$sql="SELECT ";
|
||||
@ -931,6 +945,7 @@ class DoliDBPgsql extends DoliDB
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a table into database
|
||||
*
|
||||
@ -943,9 +958,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param array $keys Tableau des champs cles noms => valeur
|
||||
* @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)
|
||||
{
|
||||
// phpcs:enable
|
||||
// FIXME: $fulltext_keys parameter is unused
|
||||
|
||||
// cles recherchees dans le tableau des descriptions (fields) : type,value,attribute,null,default,extra
|
||||
@ -1011,15 +1026,16 @@ class DoliDBPgsql extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Drop a table into database
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDropTable($table)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "DROP TABLE ".$table;
|
||||
|
||||
if (! $this->query($sql))
|
||||
@ -1028,6 +1044,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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
|
||||
* @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)
|
||||
{
|
||||
// phpcs:enable
|
||||
// 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)."'";
|
||||
|
||||
@ -1053,6 +1070,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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
|
||||
* @return false|resource Resultset x (x->attname)
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDescTable($table,$field="")
|
||||
{
|
||||
// phpcs:enable
|
||||
$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')";
|
||||
if ($field) $sql.= " AND attname = '".$field."'";
|
||||
@ -1072,6 +1090,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return $this->_results;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Create a new field into table
|
||||
*
|
||||
@ -1081,37 +1100,38 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param string $field_position Optionnel ex.: "after champtruc"
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
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
|
||||
// ex. : $field_desc = array('type'=>'int','value'=>'11','null'=>'not null','extra'=> 'auto_increment');
|
||||
$sql= "ALTER TABLE ".$table." ADD ".$field_name." ";
|
||||
$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')))
|
||||
{
|
||||
$sql.= "(".$field_desc['value'].")";
|
||||
}
|
||||
if (preg_match("/^[^\s]/i",$field_desc['attribute']))
|
||||
$sql .= " ".$field_desc['attribute'];
|
||||
$sql .= " ".$field_desc['attribute'];
|
||||
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("/null/i",$field_desc['default']))
|
||||
$sql .= " default ".$field_desc['default'];
|
||||
else
|
||||
$sql .= " default '".$field_desc['default']."'";
|
||||
if (preg_match("/null/i",$field_desc['default']))
|
||||
$sql .= " default ".$field_desc['default'];
|
||||
else
|
||||
$sql .= " default '".$field_desc['default']."'";
|
||||
if (preg_match("/^[^\s]/i",$field_desc['extra']))
|
||||
$sql .= " ".$field_desc['extra'];
|
||||
$sql .= " ".$field_desc['extra'];
|
||||
$sql .= " ".$field_position;
|
||||
|
||||
dol_syslog($sql,LOG_DEBUG);
|
||||
if(! $this -> query($sql))
|
||||
if (! $this -> query($sql))
|
||||
return -1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLUpdateField($table,$field_name,$field_desc)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql = "ALTER TABLE ".$table;
|
||||
$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') {
|
||||
@ -1156,6 +1176,7 @@ class DoliDBPgsql extends DoliDB
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Drop a field from table
|
||||
*
|
||||
@ -1163,9 +1184,9 @@ class DoliDBPgsql extends DoliDB
|
||||
* @param string $field_name Name of field to drop
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function DDLDropField($table,$field_name)
|
||||
{
|
||||
// phpcs:enable
|
||||
$sql= "ALTER TABLE ".$table." DROP COLUMN ".$field_name;
|
||||
dol_syslog($sql,LOG_DEBUG);
|
||||
if (! $this->query($sql))
|
||||
|
||||
@ -98,6 +98,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
*/
|
||||
function write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $hookmanager, $langs, $user, $mysoc;
|
||||
|
||||
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
|
||||
*
|
||||
@ -473,9 +475,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc
|
||||
* @param Translate $outputlangs Objet langs
|
||||
* @return int Position pour suite
|
||||
*/
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function _signature_area(&$pdf, $object, $posy, $outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs);
|
||||
$tab_top = $posy + 4;
|
||||
$tab_hl = 4;
|
||||
|
||||
@ -131,13 +131,14 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
$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
|
||||
else $num = sprintf("%04s",$max+1);
|
||||
else $num = sprintf("%04s", $max+1);
|
||||
|
||||
dol_syslog("mod_commande_marbre::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
return $this->prefix.$yymm."-".$num;
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return next free value
|
||||
*
|
||||
@ -145,9 +146,9 @@ class mod_commande_marbre extends ModeleNumRefCommandes
|
||||
* @param string $objforref Object for number to search
|
||||
* @return string Next free value
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function commande_get_num($objsoc,$objforref)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->getNextValue($objsoc,$objforref);
|
||||
}
|
||||
}
|
||||
|
||||
@ -117,16 +117,17 @@ class mod_contract_magre extends ModelNumRefContracts
|
||||
return $numFinal;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return next value
|
||||
* Return next value
|
||||
*
|
||||
* @param Societe $objsoc third party object
|
||||
* @param Object $objforref contract object
|
||||
* @return string Value if OK, 0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function contract_get_num($objsoc,$objforref)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->getNextValue($objsoc,$objforref);
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,6 +145,7 @@ class ExportTsv extends ModeleExports
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Open output file
|
||||
*
|
||||
@ -152,14 +153,14 @@ class ExportTsv extends ModeleExports
|
||||
* @param Translate $outputlangs Output language object
|
||||
* @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;
|
||||
|
||||
dol_syslog("ExportTsv::open_file file=".$file);
|
||||
|
||||
$ret=1;
|
||||
$ret=1;
|
||||
|
||||
$outputlangs->load("exports");
|
||||
$this->handle = fopen($file, "wt");
|
||||
@ -173,20 +174,22 @@ class ExportTsv extends ModeleExports
|
||||
return $ret;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Output header into file
|
||||
*
|
||||
* @param Translate $outputlangs Output language object
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_header($outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Output title line into file
|
||||
*
|
||||
* @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
|
||||
* @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)
|
||||
{
|
||||
// phpcs:enable
|
||||
foreach($array_selected_sorted as $code => $value)
|
||||
{
|
||||
$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
|
||||
*
|
||||
@ -219,9 +223,9 @@ class ExportTsv extends ModeleExports
|
||||
* @param array $array_types Array with types of fields
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_record($array_selected_sorted,$objp,$outputlangs,$array_types)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$this->col=0;
|
||||
@ -253,40 +257,43 @@ class ExportTsv extends ModeleExports
|
||||
return 0;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Output footer into file
|
||||
*
|
||||
* @param Translate $outputlangs Output language object
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_footer($outputlangs)
|
||||
{
|
||||
// phpcs:enable
|
||||
return 0;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Close file handle
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function close_file()
|
||||
{
|
||||
// phpcs:enable
|
||||
fclose($this->handle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Clean a cell to respect rules of TSV file cells
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function tsv_clean($newvalue, $charset)
|
||||
{
|
||||
// phpcs:enable
|
||||
// Rule Dolibarr: No HTML
|
||||
$newvalue=dol_string_nohtmltag($newvalue, 1, $charset);
|
||||
|
||||
@ -300,6 +307,6 @@ class ExportTsv extends ModeleExports
|
||||
$newvalue=str_replace("\t"," ",$newvalue);
|
||||
}
|
||||
|
||||
return $newvalue;
|
||||
return $newvalue;
|
||||
}
|
||||
}
|
||||
|
||||
@ -151,6 +151,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$this->posxdesc=$this->marge_gauche+1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Function to build pdf onto disk
|
||||
*
|
||||
@ -162,9 +163,9 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
* @param int $hideref Do not show ref
|
||||
* @return int 1=OK, 0=KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user,$langs,$conf,$mysoc,$db,$hookmanager;
|
||||
|
||||
if (! is_object($outputlangs)) $outputlangs=$langs;
|
||||
|
||||
@ -143,16 +143,17 @@ class ModeleImports
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Charge en memoire et renvoie la liste des modeles actifs
|
||||
*
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Charge en memoire et renvoie la liste des modeles actifs
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param integer $maxfilenamelength Max length of value to show
|
||||
* @return array List of templates
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function liste_modeles($db,$maxfilenamelength=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
dol_syslog(get_class($this)."::liste_modeles");
|
||||
|
||||
$dir=DOL_DOCUMENT_ROOT."/core/modules/import/";
|
||||
|
||||
@ -327,16 +327,17 @@ class mailing_contacts1 extends MailingTargets
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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)
|
||||
* @return int <0 si erreur, nb ajout si ok
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function add_to_target($mailing_id,$filtersarray=array())
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
$filter = GETPOST('filter','alpha');
|
||||
|
||||
@ -37,7 +37,7 @@ class mailing_example extends MailingTargets
|
||||
|
||||
var $require_module=array();
|
||||
var $picto='';
|
||||
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
@ -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
|
||||
*
|
||||
@ -63,9 +64,9 @@ class mailing_example extends MailingTargets
|
||||
* @param array $filtersarray If you used the formFilter function. Empty otherwise.
|
||||
* @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())
|
||||
{
|
||||
// phpcs:enable
|
||||
$target = array();
|
||||
|
||||
// CHANGE THIS
|
||||
@ -112,7 +113,7 @@ class mailing_example extends MailingTargets
|
||||
*/
|
||||
function getNbOfRecipients($sql='')
|
||||
{
|
||||
// CHANGE THIS: Optionnal
|
||||
// CHANGE THIS: Optionnal
|
||||
|
||||
// Example: return parent::getNbOfRecipients("SELECT count(*) as nb from dolibarr_table");
|
||||
// Example: return 500;
|
||||
@ -127,7 +128,7 @@ class mailing_example extends MailingTargets
|
||||
*/
|
||||
function formFilter()
|
||||
{
|
||||
// CHANGE THIS: Optionnal
|
||||
// CHANGE THIS: Optionnal
|
||||
|
||||
$s='';
|
||||
return $s;
|
||||
@ -143,7 +144,7 @@ class mailing_example extends MailingTargets
|
||||
*/
|
||||
function url($id)
|
||||
{
|
||||
// CHANGE THIS: Optionnal
|
||||
// CHANGE THIS: Optionnal
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
@ -146,6 +146,7 @@ class mailing_pomme extends MailingTargets
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Ajoute destinataires dans table des cibles
|
||||
*
|
||||
@ -153,9 +154,9 @@ class mailing_pomme extends MailingTargets
|
||||
* @param array $filtersarray Requete sql de selection des destinataires
|
||||
* @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
|
||||
if ($filtersarray) {
|
||||
dol_syslog(__METHOD__ . ": filtersarray parameter is deprecated", LOG_WARNING);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -35,7 +35,7 @@ class PrintingDriver
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
public $db;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?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
|
||||
* 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
|
||||
* \ingroup mailing
|
||||
* \ingroup printing
|
||||
* \brief File to provide printing with PrintIPP
|
||||
*/
|
||||
|
||||
@ -40,17 +40,17 @@ class printing_printipp extends PrintingDriver
|
||||
var $userid; /* user login */
|
||||
var $user;
|
||||
var $password;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
/**
|
||||
* @var string[] Error codes (or messages)
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
* @var string[] Error codes (or messages)
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
/**
|
||||
* @var DoliDB Database handler.
|
||||
*/
|
||||
@ -78,6 +78,7 @@ class printing_printipp extends PrintingDriver
|
||||
$this->conf[] = array('enabled'=>1, 'type'=>'submit');
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Print selected file
|
||||
*
|
||||
@ -87,9 +88,9 @@ class printing_printipp extends PrintingDriver
|
||||
*
|
||||
* @return int 0 if OK, >0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function print_file($file, $module, $subdir='')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
$error = 0;
|
||||
|
||||
@ -118,11 +119,11 @@ class printing_printipp extends PrintingDriver
|
||||
{
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
$this->errors[] = 'NoDefaultPrinterDefined';
|
||||
$error++;
|
||||
return $error;
|
||||
@ -195,24 +196,25 @@ class printing_printipp extends PrintingDriver
|
||||
$html.= img_picto($langs->trans("Default"),'on');
|
||||
}
|
||||
else
|
||||
{
|
||||
$html.= '<a href="'.$_SERVER["PHP_SELF"].'?action=setvalue&mode=test&varname=PRINTIPP_URI_DEFAULT&driver=printipp&value='.urlencode($value).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
$html.= '</td>';
|
||||
{
|
||||
$html.= '<a href="'.$_SERVER["PHP_SELF"].'?action=setvalue&mode=test&varname=PRINTIPP_URI_DEFAULT&driver=printipp&value='.urlencode($value).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
|
||||
}
|
||||
$html.= '</td>';
|
||||
$html.= '</tr>'."\n";
|
||||
}
|
||||
$this->resprint = $html;
|
||||
return $error;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of available printers
|
||||
*
|
||||
* @return array list of printers
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function getlist_available_printers()
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$db;
|
||||
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
|
||||
$ipp = new CupsPrintIPP();
|
||||
@ -225,15 +227,16 @@ class printing_printipp extends PrintingDriver
|
||||
return $ipp->available_printers;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Get printer detail
|
||||
*
|
||||
* @param string $uri URI
|
||||
* @return array List of attributes
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_printer_detail($uri)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$db;
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/includes/printipp/CupsPrintIPP.php';
|
||||
@ -248,6 +251,7 @@ class printing_printipp extends PrintingDriver
|
||||
return $ipp->printer_attributes;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* List jobs print
|
||||
*
|
||||
@ -255,9 +259,9 @@ class printing_printipp extends PrintingDriver
|
||||
*
|
||||
* @return int 0 if OK, >0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function list_jobs($module)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $db, $bc;
|
||||
$error = 0;
|
||||
$html = '';
|
||||
|
||||
@ -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
|
||||
{
|
||||
@ -40,16 +40,17 @@ class ModelePDFLabels
|
||||
public $error='';
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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
|
||||
* @return array List of templates
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function liste_modeles($db,$maxfilenamelength=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$type='members_labels';
|
||||
@ -63,6 +64,7 @@ class ModelePDFLabels
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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
|
||||
* @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')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
$langs->load("members");
|
||||
|
||||
|
||||
@ -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 Project $project Object project
|
||||
* @return string Next not used reference
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function project_get_num($objsoc=0,$project='')
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->getNextValue($objsoc,$project);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 Task $object Object task
|
||||
* @return string Next not used reference
|
||||
* @param Societe $objsoc Object third party
|
||||
* @param Task $object Object task
|
||||
* @return string Next not used reference
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function task_get_num($objsoc=0,$object='')
|
||||
{
|
||||
return $this->getNextValue($objsoc,$object);
|
||||
|
||||
@ -164,6 +164,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
||||
return $texte;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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
|
||||
* @return int 1 if OK, <=0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function write_file($object,$outputlangs,$srctemplatepath,$hidedetails=0,$hidedesc=0,$hideref=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user,$langs,$conf,$mysoc,$hookmanager;
|
||||
|
||||
if (empty($srctemplatepath))
|
||||
|
||||
@ -38,23 +38,24 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* 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
|
||||
* @return array List of templates
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
static function liste_modeles($db,$maxfilenamelength=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$type='company';
|
||||
$liste=array();
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
$liste=getListOfModels($db,$type,$maxfilenamelength);
|
||||
$liste = getListOfModels($db,$type,$maxfilenamelength);
|
||||
|
||||
return $liste;
|
||||
}
|
||||
@ -67,7 +68,7 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator
|
||||
abstract class ModeleThirdPartyCode
|
||||
{
|
||||
/**
|
||||
* @var string Error code (or message)
|
||||
* @var string Error code (or message)
|
||||
*/
|
||||
public $error='';
|
||||
|
||||
@ -144,6 +145,7 @@ abstract class ModeleThirdPartyCode
|
||||
return $langs->trans("NotAvailable");
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Renvoie la liste des modeles de numérotation
|
||||
*
|
||||
@ -151,9 +153,9 @@ abstract class ModeleThirdPartyCode
|
||||
* @param integer $maxfilenamelength Max length of value to show
|
||||
* @return array List of numbers
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
static function liste_modeles($db,$maxfilenamelength=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$liste=array();
|
||||
$sql ="";
|
||||
|
||||
@ -177,12 +179,12 @@ abstract class ModeleThirdPartyCode
|
||||
}
|
||||
|
||||
/**
|
||||
* Return description of module parameters
|
||||
* Return description of module parameters
|
||||
*
|
||||
* @param Translate $langs Output language
|
||||
* @param Societe $soc Third party object
|
||||
* @param int $type -1=Nothing, 0=Customer, 1=Supplier
|
||||
* @return string HTML translated description
|
||||
* @param Translate $langs Output language
|
||||
* @param Societe $soc Third party object
|
||||
* @param int $type -1=Nothing, 0=Customer, 1=Supplier
|
||||
* @return string HTML translated description
|
||||
*/
|
||||
function getToolTip($langs,$soc,$type)
|
||||
{
|
||||
@ -243,14 +245,15 @@ abstract class ModeleThirdPartyCode
|
||||
return $s;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Check if mask/numbering use prefix
|
||||
*
|
||||
* @return int 0=no, 1=yes
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function verif_prefixIsUsed()
|
||||
{
|
||||
// phpcs:enable
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -355,6 +358,7 @@ abstract class ModeleAccountancyCode
|
||||
return $s;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Set accountancy account code for a third party into this->code
|
||||
*
|
||||
@ -363,10 +367,10 @@ abstract class ModeleAccountancyCode
|
||||
* @param int $type 'customer' or 'supplier'
|
||||
* @return int >=0 if OK, <0 if KO
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
function get_code($db, $societe, $type='')
|
||||
{
|
||||
global $langs;
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
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.
|
||||
*
|
||||
@ -389,9 +394,9 @@ abstract class ModeleAccountancyCode
|
||||
* @deprecated Use the new function generateDocument of Facture class
|
||||
* @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)
|
||||
{
|
||||
// phpcs:enable
|
||||
dol_syslog(__METHOD__ . " is deprecated", LOG_WARNING);
|
||||
|
||||
return $object->generateDocument($modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
|
||||
@ -42,16 +42,17 @@ abstract class ModelePDFSupplierProposal extends CommonDocGenerator
|
||||
public $error='';
|
||||
|
||||
|
||||
/**
|
||||
* Return list of active generation modules
|
||||
*
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
/**
|
||||
* Return list of active generation modules
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param integer $maxfilenamelength Max length of value to show
|
||||
* @return array List of templates
|
||||
*/
|
||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||
static function liste_modeles($db,$maxfilenamelength=0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$type='supplier_proposal';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user