move phpcs:ignore
This commit is contained in:
parent
7799774ca1
commit
ecc6c118a6
@ -682,6 +682,7 @@ class DolGraph
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Build a graph onto disk using Artichow library and return img string to it
|
* Build a graph onto disk using Artichow library and return img string to it
|
||||||
*
|
*
|
||||||
@ -689,9 +690,9 @@ class DolGraph
|
|||||||
* @param string $fileurl Url path to show image if saved onto disk
|
* @param string $fileurl Url path to show image if saved onto disk
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
private function draw_artichow($file,$fileurl)
|
private function draw_artichow($file,$fileurl)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $artichow_defaultfont;
|
global $artichow_defaultfont;
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::draw_artichow this->type=".join(',',$this->type));
|
dol_syslog(get_class($this)."::draw_artichow this->type=".join(',',$this->type));
|
||||||
|
|||||||
@ -32,17 +32,17 @@ class FormBarCode
|
|||||||
* @var DoliDB Database handler.
|
* @var DoliDB Database handler.
|
||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Error code (or message)
|
* @var string Error code (or message)
|
||||||
*/
|
*/
|
||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param DoliDB $db Database handler
|
* @param DoliDB $db Database handler
|
||||||
*/
|
*/
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
@ -103,6 +103,7 @@ class FormBarCode
|
|||||||
return $select_encoder;
|
return $select_encoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return form to select type of barcode
|
* Return form to select type of barcode
|
||||||
*
|
*
|
||||||
@ -111,9 +112,9 @@ class FormBarCode
|
|||||||
* @param int $useempty Affiche valeur vide dans liste
|
* @param int $useempty Affiche valeur vide dans liste
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function select_barcode_type($selected='',$htmlname='barcodetype_id',$useempty=0)
|
function select_barcode_type($selected='',$htmlname='barcodetype_id',$useempty=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
|
|
||||||
$sql = "SELECT rowid, code, libelle";
|
$sql = "SELECT rowid, code, libelle";
|
||||||
@ -163,6 +164,7 @@ class FormBarCode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Show form to select type of barcode
|
* Show form to select type of barcode
|
||||||
*
|
*
|
||||||
@ -171,9 +173,9 @@ class FormBarCode
|
|||||||
* @param string $htmlname Nom du formulaire select
|
* @param string $htmlname Nom du formulaire select
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function form_barcode_type($page, $selected='', $htmlname='barcodetype_id')
|
function form_barcode_type($page, $selected='', $htmlname='barcodetype_id')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs,$conf;
|
global $langs,$conf;
|
||||||
if ($htmlname != "none")
|
if ($htmlname != "none")
|
||||||
{
|
{
|
||||||
|
|||||||
@ -139,15 +139,16 @@ class DoliDBMssql extends DoliDB
|
|||||||
return $line;
|
return $line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Select a database
|
* Select a database
|
||||||
*
|
*
|
||||||
* @param string $database Name of database
|
* @param string $database Name of database
|
||||||
* @return boolean true if OK, false if KO
|
* @return boolean true if OK, false if KO
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function select_db($database)
|
function select_db($database)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return @mssql_select_db($database, $this->db);
|
return @mssql_select_db($database, $this->db);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,49 +461,53 @@ class DoliDBMssql 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 object|false Object result line or false if KO or end of cursor
|
* @return object|false Object result line or false if KO or end of cursor
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_object($resultset)
|
function fetch_object($resultset)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
|
// Si le resultset n'est pas fourni, on prend le dernier utilise sur cette connexion
|
||||||
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
if (! is_resource($resultset)) { $resultset=$this->_results; }
|
||||||
return mssql_fetch_object($resultset);
|
return mssql_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 array|false Array or false if KO or end of cursor
|
* @return array|false Array or false if KO or end of cursor
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_array($resultset)
|
function fetch_array($resultset)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
// 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 mssql_fetch_array($resultset);
|
return mssql_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 array|false Array or false if KO or end of cursor
|
* @return array|false Array or false if KO or end of cursor
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_row($resultset)
|
function fetch_row($resultset)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
// 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 @mssql_fetch_row($resultset);
|
return @mssql_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
|
||||||
*
|
*
|
||||||
@ -510,14 +515,15 @@ class DoliDBMssql extends DoliDB
|
|||||||
* @return int Nb of lines
|
* @return int Nb of lines
|
||||||
* @see affected_rows
|
* @see affected_rows
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function num_rows($resultset)
|
function num_rows($resultset)
|
||||||
{
|
{
|
||||||
|
// 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 mssql_num_rows($resultset);
|
return mssql_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
|
||||||
*
|
*
|
||||||
@ -525,9 +531,9 @@ class DoliDBMssql extends DoliDB
|
|||||||
* @return int Nombre de lignes
|
* @return int Nombre de lignes
|
||||||
* @see num_rows
|
* @see num_rows
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function affected_rows($resultset)
|
function affected_rows($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; }
|
||||||
// mssql necessite un link de base pour cette fonction contrairement
|
// mssql necessite un link de base pour cette fonction contrairement
|
||||||
@ -645,6 +651,7 @@ class DoliDBMssql extends DoliDB
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Get last ID after an insert INSERT
|
* Get last ID after an insert INSERT
|
||||||
*
|
*
|
||||||
@ -652,9 +659,9 @@ class DoliDBMssql extends DoliDB
|
|||||||
* @param string $fieldid Field name
|
* @param string $fieldid Field name
|
||||||
* @return int Id of row or -1 on error
|
* @return int Id of row or -1 on error
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function last_insert_id($tab,$fieldid='rowid')
|
function last_insert_id($tab,$fieldid='rowid')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$res = $this->query("SELECT @@IDENTITY as id");
|
$res = $this->query("SELECT @@IDENTITY as id");
|
||||||
if ($res && $data = $this->fetch_array($res))
|
if ($res && $data = $this->fetch_array($res))
|
||||||
{
|
{
|
||||||
@ -709,14 +716,15 @@ class DoliDBMssql 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
|
||||||
$resql=$this->query('SELECT CONNECTION_ID()');
|
$resql=$this->query('SELECT CONNECTION_ID()');
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -726,6 +734,7 @@ class DoliDBMssql extends DoliDB
|
|||||||
else return '?';
|
else 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
|
||||||
@ -737,9 +746,9 @@ class DoliDBMssql extends DoliDB
|
|||||||
* @param string $owner Username of database owner
|
* @param string $owner Username of database owner
|
||||||
* @return false|resource|true resource defined if OK, false if KO
|
* @return false|resource|true resource defined if OK, false 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;
|
||||||
*/
|
*/
|
||||||
@ -763,6 +772,7 @@ class DoliDBMssql extends DoliDB
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* List tables into a database
|
* List tables into a database
|
||||||
*
|
*
|
||||||
@ -770,22 +780,23 @@ class DoliDBMssql extends DoliDB
|
|||||||
* @param string $table Nmae of table filter ('xxx%')
|
* @param string $table Nmae 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
|
||||||
$this->_results = mssql_list_tables($database, $this->db);
|
$this->_results = mssql_list_tables($database, $this->db);
|
||||||
return $this->_results;
|
return $this->_results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* List information of columns into a table.
|
* List information of columns into a table.
|
||||||
*
|
*
|
||||||
* @param string $table Name of table
|
* @param string $table Name of table
|
||||||
* @return array Tableau des informations des champs de la table
|
* @return array Tableau des informations des champs de la table
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function DDLInfoTable($table)
|
function DDLInfoTable($table)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
|
|
||||||
// FIXME: Dummy method
|
// FIXME: Dummy method
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
@ -795,6 +806,7 @@ class DoliDBMssql extends DoliDB
|
|||||||
return $infotables;
|
return $infotables;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Create a table into database
|
* Create a table into database
|
||||||
*
|
*
|
||||||
@ -807,9 +819,9 @@ class DoliDBMssql 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
|
||||||
@ -875,15 +887,16 @@ class DoliDBMssql 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))
|
||||||
@ -892,6 +905,7 @@ class DoliDBMssql 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
|
||||||
*
|
*
|
||||||
@ -899,9 +913,9 @@ class DoliDBMssql 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|true Resource
|
* @return false|resource|true Resource
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function DDLDescTable($table,$field="")
|
function DDLDescTable($table,$field="")
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql="DESC ".$table." ".$field;
|
$sql="DESC ".$table." ".$field;
|
||||||
|
|
||||||
dol_syslog($sql);
|
dol_syslog($sql);
|
||||||
@ -909,6 +923,7 @@ class DoliDBMssql 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
|
||||||
*
|
*
|
||||||
@ -918,9 +933,9 @@ class DoliDBMssql 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." ";
|
||||||
@ -946,6 +961,7 @@ class DoliDBMssql extends DoliDB
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update format of a field into a table
|
* Update format of a field into a table
|
||||||
*
|
*
|
||||||
@ -954,9 +970,9 @@ class DoliDBMssql extends DoliDB
|
|||||||
* @param string $field_desc Array with description of field format
|
* @param string $field_desc Array with description of field format
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function DDLUpdateField($table,$field_name,$field_desc)
|
function DDLUpdateField($table,$field_name,$field_desc)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql = "ALTER TABLE ".$table;
|
$sql = "ALTER TABLE ".$table;
|
||||||
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
|
$sql .= " MODIFY COLUMN ".$field_name." ".$field_desc['type'];
|
||||||
if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
|
if ($field_desc['type'] == 'tinyint' || $field_desc['type'] == 'int' || $field_desc['type'] == 'varchar') {
|
||||||
@ -970,6 +986,7 @@ class DoliDBMssql extends DoliDB
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Drop a field from table
|
* Drop a field from table
|
||||||
*
|
*
|
||||||
@ -977,9 +994,9 @@ class DoliDBMssql 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))
|
||||||
@ -990,6 +1007,7 @@ class DoliDBMssql extends DoliDB
|
|||||||
else return 1;
|
else return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Create a user and privileges to connect to database (even if database does not exists yet)
|
* Create a user and privileges to connect to database (even if database does not exists yet)
|
||||||
*
|
*
|
||||||
@ -999,10 +1017,10 @@ class DoliDBMssql 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)
|
||||||
{
|
{
|
||||||
$sql = "CREATE LOGIN ".$this->EscapeFieldName($dolibarr_main_db_user)." WITH PASSWORD='$dolibarr_main_db_pass'";
|
// phpcs:enable
|
||||||
|
$sql = "CREATE LOGIN ".$this->EscapeFieldName($dolibarr_main_db_user)." WITH PASSWORD='$dolibarr_main_db_pass'";
|
||||||
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
|
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
|
||||||
$resql=$this->query($sql);
|
$resql=$this->query($sql);
|
||||||
if (! $resql)
|
if (! $resql)
|
||||||
@ -1150,19 +1168,21 @@ class DoliDBMssql extends DoliDB
|
|||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Escape a field name according to escape's syntax
|
* Escape a field name according to escape's syntax
|
||||||
*
|
*
|
||||||
* @param string $fieldname Field's name to escape
|
* @param string $fieldname Field's name to escape
|
||||||
* @return string field's name escaped
|
* @return string field's name escaped
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function EscapeFieldName($fieldname)
|
function EscapeFieldName($fieldname)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return "[".$fieldname."]";
|
return "[".$fieldname."]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Get information on field
|
* Get information on field
|
||||||
*
|
*
|
||||||
@ -1170,9 +1190,9 @@ class DoliDBMssql extends DoliDB
|
|||||||
* @param mixed $fields String for one field or array of string for multiple field
|
* @param mixed $fields String for one field or array of string for multiple field
|
||||||
* @return false|object
|
* @return false|object
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function GetFieldInformation($table,$fields)
|
function GetFieldInformation($table,$fields)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql="SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='".$this->escape($table)."' AND COLUMN_NAME";
|
$sql="SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='".$this->escape($table)."' AND COLUMN_NAME";
|
||||||
if (is_array($fields))
|
if (is_array($fields))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -53,7 +53,7 @@ class mailing_fraise extends MailingTargets
|
|||||||
*/
|
*/
|
||||||
function __construct($db)
|
function __construct($db)
|
||||||
{
|
{
|
||||||
$this->db=$db;
|
$this->db = $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -219,6 +219,7 @@ class mailing_fraise extends MailingTargets
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Ajoute destinataires dans table des cibles
|
* Ajoute destinataires dans table des cibles
|
||||||
*
|
*
|
||||||
@ -226,9 +227,9 @@ class mailing_fraise extends MailingTargets
|
|||||||
* @param array $filtersarray Param to filter sql request. Deprecated. Should use $_POST instead.
|
* @param array $filtersarray Param to filter sql request. Deprecated. Should use $_POST instead.
|
||||||
* @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);
|
||||||
@ -269,8 +270,8 @@ class mailing_fraise extends MailingTargets
|
|||||||
// Filter on type
|
// Filter on type
|
||||||
if ($_POST['filter_type']) $sql.= " AND ta.rowid='".$_POST['filter_type']."'";
|
if ($_POST['filter_type']) $sql.= " AND ta.rowid='".$_POST['filter_type']."'";
|
||||||
// Filter on category
|
// Filter on category
|
||||||
if ($_POST['filter_category']) $sql.= " AND c.rowid='".$_POST['filter_category']."'";
|
if ($_POST['filter_category']) $sql.= " AND c.rowid='".$_POST['filter_category']."'";
|
||||||
$sql.= " ORDER BY a.email";
|
$sql.= " ORDER BY a.email";
|
||||||
//print $sql;
|
//print $sql;
|
||||||
|
|
||||||
// Add targets into table
|
// Add targets into table
|
||||||
|
|||||||
@ -103,6 +103,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Define array with couple substitution key => substitution value
|
* Define array with couple substitution key => substitution value
|
||||||
*
|
*
|
||||||
@ -111,9 +112,9 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
* @param string $array_key Name of the key for return array
|
* @param string $array_key Name of the key for return array
|
||||||
* @return array Array of substitution
|
* @return array Array of substitution
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_substitutionarray_object($object,$outputlangs,$array_key='object')
|
function get_substitutionarray_object($object,$outputlangs,$array_key='object')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$resarray=array(
|
$resarray=array(
|
||||||
@ -141,6 +142,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
return $resarray;
|
return $resarray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Define array with couple substitution key => substitution value
|
* Define array with couple substitution key => substitution value
|
||||||
*
|
*
|
||||||
@ -148,9 +150,9 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
* @param Translate $outputlangs Lang object to use for output
|
* @param Translate $outputlangs Lang object to use for output
|
||||||
* @return array Return a substitution array
|
* @return array Return a substitution array
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_substitutionarray_tasks($task,$outputlangs)
|
function get_substitutionarray_tasks($task,$outputlangs)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$resarray = array(
|
$resarray = array(
|
||||||
@ -181,6 +183,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
return $resarray;
|
return $resarray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Define array with couple substitution key => substitution value
|
* Define array with couple substitution key => substitution value
|
||||||
*
|
*
|
||||||
@ -188,9 +191,9 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
* @param Translate $outputlangs Lang object to use for output
|
* @param Translate $outputlangs Lang object to use for output
|
||||||
* @return array Return a substitution array
|
* @return array Return a substitution array
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_substitutionarray_project_contacts($contact,$outputlangs)
|
function get_substitutionarray_project_contacts($contact,$outputlangs)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
$pc='projcontacts_'; // prefix to avoid typos
|
$pc='projcontacts_'; // prefix to avoid typos
|
||||||
|
|
||||||
@ -238,6 +241,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Define array with couple substitution key => substitution value
|
* Define array with couple substitution key => substitution value
|
||||||
*
|
*
|
||||||
@ -245,9 +249,9 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
* @param Translate $outputlangs Lang object to use for output
|
* @param Translate $outputlangs Lang object to use for output
|
||||||
* @return array Return a substitution array
|
* @return array Return a substitution array
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_substitutionarray_project_file($file,$outputlangs)
|
function get_substitutionarray_project_file($file,$outputlangs)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
@ -257,6 +261,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Define array with couple substitution key => substitution value
|
* Define array with couple substitution key => substitution value
|
||||||
*
|
*
|
||||||
@ -264,9 +269,9 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
* @param Translate $outputlangs Lang object to use for output
|
* @param Translate $outputlangs Lang object to use for output
|
||||||
* @return array Return a substitution array
|
* @return array Return a substitution array
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_substitutionarray_project_reference($refdetail,$outputlangs)
|
function get_substitutionarray_project_reference($refdetail,$outputlangs)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
@ -280,6 +285,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Define array with couple substitution key => substitution value
|
* Define array with couple substitution key => substitution value
|
||||||
*
|
*
|
||||||
@ -287,9 +293,9 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
* @param Translate $outputlangs Lang object to use for output
|
* @param Translate $outputlangs Lang object to use for output
|
||||||
* @return array Return a substitution array
|
* @return array Return a substitution array
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_substitutionarray_tasksressource($taskressource,$outputlangs)
|
function get_substitutionarray_tasksressource($taskressource,$outputlangs)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
//dol_syslog(get_class($this).'::get_substitutionarray_tasksressource taskressource='.var_export($taskressource,true),LOG_DEBUG);
|
//dol_syslog(get_class($this).'::get_substitutionarray_tasksressource taskressource='.var_export($taskressource,true),LOG_DEBUG);
|
||||||
return array(
|
return array(
|
||||||
@ -303,6 +309,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Define array with couple substitution key => substitution value
|
* Define array with couple substitution key => substitution value
|
||||||
*
|
*
|
||||||
@ -310,9 +317,9 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
* @param Translate $outputlangs Lang object to use for output
|
* @param Translate $outputlangs Lang object to use for output
|
||||||
* @return array Return a substitution array
|
* @return array Return a substitution array
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_substitutionarray_taskstime($tasktime,$outputlangs)
|
function get_substitutionarray_taskstime($tasktime,$outputlangs)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
@ -331,6 +338,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Define array with couple substitution key => substitution value
|
* Define array with couple substitution key => substitution value
|
||||||
*
|
*
|
||||||
@ -338,9 +346,9 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
* @param Translate $outputlangs Lang object to use for output
|
* @param Translate $outputlangs Lang object to use for output
|
||||||
* @return array Return a substitution array
|
* @return array Return a substitution array
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_substitutionarray_task_file($file,$outputlangs)
|
function get_substitutionarray_task_file($file,$outputlangs)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
@ -440,6 +448,7 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
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.
|
||||||
*
|
*
|
||||||
@ -448,9 +457,9 @@ class doc_generic_project_odt extends ModelePDFProjects
|
|||||||
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
||||||
* @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)
|
function write_file($object,$outputlangs,$srctemplatepath)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $user,$langs,$conf,$mysoc,$hookmanager;
|
global $user,$langs,$conf,$mysoc,$hookmanager;
|
||||||
|
|
||||||
if (empty($srctemplatepath))
|
if (empty($srctemplatepath))
|
||||||
|
|||||||
@ -110,6 +110,7 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Fonction generant le projet sur le disque
|
* Fonction generant le projet sur le disque
|
||||||
*
|
*
|
||||||
@ -117,9 +118,9 @@ class pdf_beluga extends ModelePDFProjects
|
|||||||
* @param Translate $outputlangs Lang output object
|
* @param Translate $outputlangs Lang output object
|
||||||
* @return int 1 if OK, <=0 if KO
|
* @return int 1 if OK, <=0 if KO
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function write_file($object,$outputlangs)
|
function write_file($object,$outputlangs)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf, $hookmanager, $langs, $user;
|
global $conf, $hookmanager, $langs, $user;
|
||||||
|
|
||||||
$formproject=new FormProjets($this->db);
|
$formproject=new FormProjets($this->db);
|
||||||
|
|||||||
@ -38,6 +38,7 @@ abstract class ModelePDFTask extends CommonDocGenerator
|
|||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of active generation modules
|
* Return list of active generation modules
|
||||||
*
|
*
|
||||||
@ -45,9 +46,9 @@ abstract class ModelePDFTask extends CommonDocGenerator
|
|||||||
* @param integer $maxfilenamelength Max length of value to show
|
* @param integer $maxfilenamelength Max length of value to show
|
||||||
* @return array List of templates
|
* @return array List of templates
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
static function liste_modeles($db,$maxfilenamelength=0)
|
static function liste_modeles($db,$maxfilenamelength=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$type='project_task';
|
$type='project_task';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user