";
diff --git a/htdocs/core/class/html.formmailing.class.php b/htdocs/core/class/html.formmailing.class.php
index e3e6ce4cbf9..c0cadfba460 100644
--- a/htdocs/core/class/html.formmailing.class.php
+++ b/htdocs/core/class/html.formmailing.class.php
@@ -23,7 +23,7 @@
require_once DOL_DOCUMENT_ROOT .'/core/class/html.form.class.php';
/**
- * Class to offer components to list and upload files
+ * Class to offer components to list and upload files
*/
class FormMailing extends Form
{
@@ -37,7 +37,8 @@ class FormMailing extends Form
* @param integer $show_empty Show empty option
* @return string HTML select
*/
- public function selectDestinariesStatus($selectedid='',$htmlname='dest_status', $show_empty=0) {
+ public function selectDestinariesStatus($selectedid='', $htmlname='dest_status', $show_empty=0)
+ {
global $langs;
$langs->load("mails");
@@ -54,5 +55,5 @@ class FormMailing extends Form
$options = $options + $mailing->statut_dest;
return Form::selectarray($htmlname, $options, $selectedid, 0, 0, 0, '', 1);
- }
+ }
}
diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php
index 3a8a147f4db..67ac8691a19 100644
--- a/htdocs/core/class/interfaces.class.php
+++ b/htdocs/core/class/interfaces.class.php
@@ -33,7 +33,11 @@ class Interfaces
{
var $db;
var $dir; // Directory with all core and external triggers files
- var $errors = array(); // Array for errors
+ /**
+ *
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array ();
/**
* Constructor
diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php
index 1b3e667c68d..c480bda1f07 100644
--- a/htdocs/core/class/ldap.class.php
+++ b/htdocs/core/class/ldap.class.php
@@ -371,7 +371,8 @@ class Ldap
*
* @return boolean version
*/
- function setVersion() {
+ function setVersion()
+ {
// LDAP_OPT_PROTOCOL_VERSION est une constante qui vaut 17
$ldapsetversion = ldap_set_option($this->connection, LDAP_OPT_PROTOCOL_VERSION, $this->ldapProtocolVersion);
return $ldapsetversion;
@@ -382,7 +383,8 @@ class Ldap
*
* @return boolean referrals
*/
- function setReferrals() {
+ function setReferrals()
+ {
// LDAP_OPT_REFERRALS est une constante qui vaut ?
$ldapreferrals = ldap_set_option($this->connection, LDAP_OPT_REFERRALS, 0);
return $ldapreferrals;
diff --git a/htdocs/core/class/notify.class.php b/htdocs/core/class/notify.class.php
index 1cd676fe70b..f3beece9794 100644
--- a/htdocs/core/class/notify.class.php
+++ b/htdocs/core/class/notify.class.php
@@ -33,7 +33,11 @@ class Notify
var $id;
var $db;
var $error;
- var $errors=array();
+
+ /**
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array();
var $author;
var $ref;
diff --git a/htdocs/core/class/openid.class.php b/htdocs/core/class/openid.class.php
index 8edd5911bad..37c46f3b64e 100644
--- a/htdocs/core/class/openid.class.php
+++ b/htdocs/core/class/openid.class.php
@@ -30,8 +30,8 @@ class SimpleOpenID
var $URLs = array();
var $error = array();
var $fields = array(
- 'required' => array(),
- 'optional' => array(),
+ 'required' => array(),
+ 'optional' => array(),
);
/**
@@ -133,7 +133,8 @@ class SimpleOpenID
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function SetIdentity($a)
- { // Set Identity URL
+ {
+ // Set Identity URL
if ((stripos($a, 'http://') === false)
&& (stripos($a, 'https://') === false)) {
$a = 'http://'.$a;
@@ -162,6 +163,7 @@ class SimpleOpenID
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetIdentity()
{
+ // Get Identity
return $this->openid_url_identity;
}
@@ -266,7 +268,8 @@ class SimpleOpenID
* @return false|string false if KO, string of url if OK
*/
function array2url($arr)
- { // converts associated array to URL Query String
+ {
+ // converts associated array to URL Query String
if (!is_array($arr)){
return false;
}
@@ -320,7 +323,8 @@ class SimpleOpenID
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function CURL_Request($url, $method="GET", $params = "")
- { // Remember, SSL MUST BE SUPPORTED
+ {
+ // Remember, SSL MUST BE SUPPORTED
if (is_array($params)) $params = $this->array2url($params);
$curl = curl_init($url . ($method == "GET" && $params != "" ? "?" . $params : ""));
@@ -377,7 +381,7 @@ class SimpleOpenID
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
function GetOpenIDServer($url='')
{
- global $conf;
+ global $conf;
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
if (empty($url)) $url=$conf->global->MAIN_AUTHENTICATION_OPENID_URL;
diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php
index 4f220470f1f..eeb84b87f38 100644
--- a/htdocs/core/class/smtps.class.php
+++ b/htdocs/core/class/smtps.class.php
@@ -1655,7 +1655,7 @@ class SMTPs
* @param integer $_value Message Priority
* @return void
*/
- function setPriority ( $_value = 3 )
+ function setPriority( $_value = 3 )
{
if ( ( is_numeric($_value) ) &&
( ( $_value >= 0 ) && ( $_value <= 5 ) ) )
@@ -1821,12 +1821,14 @@ class SMTPs
* @param int $_errNum Error Code Number
* @param string $_errMsg Error Message
* @return void
- */
- function _setErr ( $_errNum, $_errMsg )
- {
- $this->_smtpsErrors[] = array( 'num' => $_errNum,
- 'msg' => $_errMsg );
- }
+ */
+ function _setErr( $_errNum, $_errMsg )
+ {
+ $this->_smtpsErrors[] = array(
+ 'num' => $_errNum,
+ 'msg' => $_errMsg,
+ );
+ }
/**
* Returns errors codes and messages for Class
diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php
index 3a7a79122c9..b9a9ad6f4bf 100644
--- a/htdocs/core/class/utils.class.php
+++ b/htdocs/core/class/utils.class.php
@@ -677,7 +677,8 @@ class Utils
*
* @return int 0 if OK, < 0 if KO
*/
- function compressSyslogs() {
+ function compressSyslogs()
+ {
global $conf;
if(empty($conf->loghandlers['mod_syslog_file'])) { // File Syslog disabled
diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php
index 8bdeb3e43b7..81fcb25e2b4 100644
--- a/htdocs/core/class/vcard.class.php
+++ b/htdocs/core/class/vcard.class.php
@@ -111,12 +111,13 @@ class vCard
* mise en forme de la photo
* warning NON TESTE !
*
- * @param string $type Type
- * @param string $photo Photo
- * @return void
- */
+ * @param string $type Type
+ * @param string $photo Photo
+ * @return void
+ */
function setPhoto($type, $photo)
- { // $type = "GIF" | "JPEG"
+ {
+ // $type = "GIF" | "JPEG"
$this->properties["PHOTO;TYPE=$type;ENCODING=BASE64"] = base64_encode($photo);
}
@@ -155,7 +156,7 @@ class vCard
* @return void
*/
function setBirthday($date)
- {
+ {
// $date format is YYYY-MM-DD - RFC 2425 and RFC 2426
$this->properties["BDAY"] = dol_print_date($date, 'dayrfc');
}
@@ -200,7 +201,8 @@ class vCard
* @param string $type Type
* @return void
*/
- function setLabel($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL") {
+ function setLabel($postoffice="", $extended="", $street="", $city="", $region="", $zip="", $country="", $type="HOME;POSTAL")
+ {
$label = "";
if ($postoffice!="") $label.= "$postoffice\r\n";
if ($extended!="") $label.= "$extended\r\n";
diff --git a/htdocs/core/class/workboardresponse.class.php b/htdocs/core/class/workboardresponse.class.php
index 13de74281ff..62d84e11186 100644
--- a/htdocs/core/class/workboardresponse.class.php
+++ b/htdocs/core/class/workboardresponse.class.php
@@ -1,6 +1,7 @@
+ * Copyright (C) 2018 Charlene Benke
*
* 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
@@ -66,4 +67,10 @@ class WorkboardResponse
*/
public $nbtodolate = 0;
-}
\ No newline at end of file
+ /**
+ * total price of items
+ * @var int
+ */
+ public $total = 0;
+
+}
diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php
index adf4fb151ce..096979f56ef 100644
--- a/htdocs/core/db/mssql.class.php
+++ b/htdocs/core/db/mssql.class.php
@@ -1157,7 +1157,8 @@ class DoliDBMssql extends DoliDB
* @return string field's name escaped
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
- function EscapeFieldName($fieldname) {
+ function EscapeFieldName($fieldname)
+ {
return "[".$fieldname."]";
}
@@ -1170,7 +1171,8 @@ class DoliDBMssql extends DoliDB
* @return false|object
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
- function GetFieldInformation($table,$fields) {
+ function GetFieldInformation($table,$fields)
+ {
$sql="SELECT * from INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='".$this->escape($table)."' AND COLUMN_NAME";
if (is_array($fields))
{
diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php
index e5e0dd8cc5a..8a8846088e3 100644
--- a/htdocs/core/db/sqlite3.class.php
+++ b/htdocs/core/db/sqlite3.class.php
@@ -1321,7 +1321,8 @@ class DoliDBSqlite3 extends DoliDB
* @return int Formatted date
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
- private static function calc_daynr($year, $month, $day) {
+ private static function calc_daynr($year, $month, $day)
+ {
$y = $year;
if ($y == 0 && $month == 0) return 0;
$num = (365* $y + 31 * ($month - 1) + $day);
@@ -1342,7 +1343,8 @@ class DoliDBSqlite3 extends DoliDB
* @return int
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
- private static function calc_weekday($daynr, $sunday_first_day_of_week) {
+ private static function calc_weekday($daynr, $sunday_first_day_of_week)
+ {
$ret = floor(($daynr + 5 + ($sunday_first_day_of_week ? 1 : 0)) % 7);
return $ret;
}
@@ -1370,7 +1372,8 @@ class DoliDBSqlite3 extends DoliDB
* @return string ???
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
- private static function calc_week($year, $month, $day, $week_behaviour, &$calc_year) {
+ private static function calc_week($year, $month, $day, $week_behaviour, &$calc_year)
+ {
$daynr=self::calc_daynr($year,$month,$day);
$first_daynr=self::calc_daynr($year,1,1);
$monday_first= ($week_behaviour & self::WEEK_MONDAY_FIRST) ? 1 : 0;
diff --git a/htdocs/core/filemanagerdol/connectors/php/io.php b/htdocs/core/filemanagerdol/connectors/php/io.php
index 66d024edce8..3ac325ed5d4 100644
--- a/htdocs/core/filemanagerdol/connectors/php/io.php
+++ b/htdocs/core/filemanagerdol/connectors/php/io.php
@@ -24,7 +24,7 @@
/**
* CombinePaths
- *
+ *
* @param string $sBasePath sBasePath
* @param string $sFolder sFolder
* @return string Combined path
@@ -393,13 +393,13 @@ EOF;
// This is the function that sends the results of the uploading process to CKE.
/**
* SendCKEditorResults
- *
+ *
* @param string $callback callback
* @param string $sFileUrl sFileUrl
* @param string $customMsg customMsg
* @return void
*/
-function SendCKEditorResults ($callback, $sFileUrl, $customMsg = '')
+function SendCKEditorResults($callback, $sFileUrl, $customMsg = '')
{
echo '';
}
-
-
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 0e7203ba748..884dbaa120c 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -108,27 +108,36 @@ function versiondolibarrarray()
/**
- * Launch a sql file. Function used by:
+ * Launch a sql file. Function is used by:
* - Migrate process (dolibarr-xyz-abc.sql)
* - Loading sql menus (auguria)
* - Running specific Sql by a module init
+ * - Loading sql file of website import package
* Install process however does not use it.
- * Note that Sql files must have all comments at start of line.
+ * Note that Sql files must have all comments at start of line. Also this function take ';' as the char to detect end of sql request
*
- * @param string $sqlfile Full path to sql file
- * @param int $silent 1=Do not output anything, 0=Output line for update page
- * @param int $entity Entity targeted for multicompany module
- * @param int $usesavepoint 1=Run a savepoint before each request and a rollback to savepoint if error (this allow to have some request with errors inside global transactions).
- * @param string $handler Handler targeted for menu
- * @param string $okerror Family of errors we accept ('default', 'none')
- * @return int <=0 if KO, >0 if OK
+ * @param string $sqlfile Full path to sql file
+ * @param int $silent 1=Do not output anything, 0=Output line for update page
+ * @param int $entity Entity targeted for multicompany module
+ * @param int $usesavepoint 1=Run a savepoint before each request and a rollback to savepoint if error (this allow to have some request with errors inside global transactions).
+ * @param string $handler Handler targeted for menu (replace __HANDLER__ with this value)
+ * @param string $okerror Family of errors we accept ('default', 'none')
+ * @param int $linelengthlimit Limit for length of each line (Use 0 if unknown, may be faster if defined)
+ * @param int $nocommentremoval Do no try to remove comments (in such a case, we consider that each line is a request, so use also $linelengthlimit=0)
+ * @return int <=0 if KO, >0 if OK
*/
-function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$okerror='default')
+function run_sql($sqlfile, $silent=1, $entity='', $usesavepoint=1, $handler='', $okerror='default', $linelengthlimit=32768, $nocommentremoval=0)
{
global $db, $conf, $langs, $user;
dol_syslog("Admin.lib::run_sql run sql file ".$sqlfile." silent=".$silent." entity=".$entity." usesavepoint=".$usesavepoint." handler=".$handler." okerror=".$okerror, LOG_DEBUG);
+ if (! is_numeric($linelengthlimit))
+ {
+ dol_syslog("Admin.lib::run_sql param linelengthlimit is not a numeric", LOG_ERR);
+ return -1;
+ }
+
$ok=0;
$error=0;
$i=0;
@@ -143,7 +152,9 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
{
while (! feof($fp))
{
- $buf = fgets($fp, 32768);
+ // Warning fgets with second parameter that is null or 0 hang.
+ if ($linelengthlimit > 0) $buf = fgets($fp, $linelengthlimit);
+ else $buf = fgets($fp);
// Test if request must be ran only for particular database or version (if yes, we must remove the -- comment)
if (preg_match('/^--\sV(MYSQL|PGSQL)([^\s]*)/i',$buf,$reg))
@@ -191,13 +202,13 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
}
// Add line buf to buffer if not a comment
- if (! preg_match('/^\s*--/',$buf))
+ if ($nocommentremoval || ! preg_match('/^\s*--/',$buf))
{
- $buf=preg_replace('/([,;ERLT\)])\s*--.*$/i','\1',$buf); //remove comment from a line that not start with -- before add it to the buffer
+ if (empty($nocommentremoval)) $buf=preg_replace('/([,;ERLT\)])\s*--.*$/i','\1',$buf); //remove comment from a line that not start with -- before add it to the buffer
$buffer .= trim($buf);
}
- // print $buf.' ';
+ //print $buf.' ';exit;
if (preg_match('/;/',$buffer)) // If string contains ';', it's end of a request string, we save it in arraysql.
{
@@ -229,7 +240,7 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
if (! isset($listofmaxrowid[$table]))
{
//var_dump($db);
- $sqlgetrowid='SELECT MAX(rowid) as max from '.$table;
+ $sqlgetrowid='SELECT MAX(rowid) as max from '.preg_replace('/^llx_/', MAIN_DB_PREFIX, $table);
$resql=$db->query($sqlgetrowid);
if ($resql)
{
@@ -246,9 +257,10 @@ function run_sql($sqlfile,$silent=1,$entity='',$usesavepoint=1,$handler='',$oker
break;
}
}
+ // Replace __+MAX_llx_table__ with +999
$from='__+MAX_'.$table.'__';
$to='+'.$listofmaxrowid[$table];
- $newsql=str_replace($from,$to,$newsql);
+ $newsql=str_replace($from, $to, $newsql);
dol_syslog('Admin.lib::run_sql New Request '.($i+1).' (replacing '.$from.' to '.$to.')', LOG_DEBUG);
$arraysql[$i]=$newsql;
diff --git a/htdocs/core/lib/bank.lib.php b/htdocs/core/lib/bank.lib.php
index 28584b60e32..3116d85287a 100644
--- a/htdocs/core/lib/bank.lib.php
+++ b/htdocs/core/lib/bank.lib.php
@@ -161,7 +161,8 @@ function bank_admin_prepare_head($object)
* @param Object $object Object related to tabs
* @return array Array of tabs to shoc
*/
-function various_payment_prepare_head($object) {
+function various_payment_prepare_head($object)
+{
global $db, $langs, $conf;
@@ -358,7 +359,7 @@ function checkES($IentOfi, $InumCta)
for ($i = 0; $i < 11; $i++) {
$sum += $values[$i] * (int) substr($InumCta, $i, 1);//int to cast result of substr to a number
}
-
+
$key = 11 - $sum % 11;
if ($key == 10)
@@ -369,4 +370,3 @@ function checkES($IentOfi, $InumCta)
$keycontrol .= $key;
return $keycontrol;
}
-
diff --git a/htdocs/core/lib/expensereport.lib.php b/htdocs/core/lib/expensereport.lib.php
index 1efdc73f247..779e6c9e174 100644
--- a/htdocs/core/lib/expensereport.lib.php
+++ b/htdocs/core/lib/expensereport.lib.php
@@ -67,7 +67,7 @@ function expensereport_prepare_head($object)
$head[$h][2] = 'note';
$h++;
}
-
+
$head[$h][0] = DOL_URL_ROOT . '/expensereport/info.php?id=' . $object->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
@@ -81,11 +81,12 @@ function expensereport_prepare_head($object)
/**
* Returns an array with the tabs for the "Expense report payment" section
* It loads tabs from modules looking for the entity payment
- *
+ *
* @param Paiement $object Current payment object
* @return array Tabs for the payment section
*/
-function payment_expensereport_prepare_head(PaymentExpenseReport $object) {
+function payment_expensereport_prepare_head(PaymentExpenseReport $object)
+{
global $langs, $conf;
@@ -139,7 +140,7 @@ function expensereport_admin_prepare_head()
$head[$h][2] = 'expenseik';
$h++;
}
-
+
if (!empty($conf->global->MAIN_USE_EXPENSE_RULE))
{
$head[$h][0] = DOL_URL_ROOT."/admin/expensereport_rules.php";
@@ -147,7 +148,7 @@ function expensereport_admin_prepare_head()
$head[$h][2] = 'expenserules';
$h++;
}
-
+
// Show more tabs from modules
// Entries must be declared in modules descriptor with line
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
@@ -168,5 +169,5 @@ function expensereport_admin_prepare_head()
complete_head_from_modules($conf,$langs,null,$head,$h,'expensereport_admin','remove');
- return $head;
+ return $head;
}
diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php
index fcb14be9c67..8d5cd9c8495 100644
--- a/htdocs/core/lib/fichinter.lib.php
+++ b/htdocs/core/lib/fichinter.lib.php
@@ -76,11 +76,11 @@ function fichinter_prepare_head($object)
foreach($resources as $resource_obj)
{
$linked_resources = $object->getElementResources('fichinter',$object->id,$resource_obj);
-
+
}
}
}
-
+
$head[$h][0] = DOL_URL_ROOT.'/resource/element_resource.php?element=fichinter&element_id='.$object->id;
$head[$h][1] = $langs->trans("Resources");
if ($nbResource > 0) $head[$h][1].= ' '.$nbResource.'';
@@ -163,13 +163,13 @@ function fichinter_admin_prepare_head()
return $head;
}
-function fichinter_rec_prepare_head ($object)
+function fichinter_rec_prepare_head($object)
{
global $langs, $conf; //, $user;
-
+
$h = 0;
$head = array();
-
+
$head[$h][0] = DOL_URL_ROOT.'/fichinter/card-rec.php?id='.$object->id;
$head[$h][1] = $langs->trans("CardFichinter");
$head[$h][2] = 'card';
@@ -182,4 +182,3 @@ function fichinter_rec_prepare_head ($object)
return $head;
}
-
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 15e8c003417..a7001d357b8 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -574,7 +574,7 @@ function dol_filemtime($pathoffile)
* @param array $arrayreplacement Array with strings to replace. Example: array('valuebefore'=>'valueafter', ...)
* @param string $destfile Destination file (can't be a directory). If empty, will be same than source file.
* @param int $newmask Mask for new file (0 by default means $conf->global->MAIN_UMASK). Example: '0666'
- * @param int $indexdatabase Index new file into database.
+ * @param int $indexdatabase 1=index new file into database.
* @return int <0 if error, 0 if nothing done (dest file already exists), >0 if OK
* @see dol_copy dolReplaceRegExInFile
*/
@@ -611,7 +611,7 @@ function dolReplaceInFile($srcfile, $arrayreplacement, $destfile='', $newmask=0,
dol_delete_file($tmpdestfile);
// Create $newpathoftmpdestfile from $newpathofsrcfile
- $content=file_get_contents($newpathofsrcfile, 'r');
+ $content = file_get_contents($newpathofsrcfile, 'r');
$content = make_substitutions($content, $arrayreplacement, null);
@@ -1509,7 +1509,7 @@ function dol_init_file_process($pathtoscan='', $trackid='')
*
* @param string $upload_dir Directory where to store uploaded file (note: used to forge $destpath = $upload_dir + filename)
* @param int $allowoverwrite 1=Allow overwrite existing file
- * @param int $donotupdatesession 1=Do no edit _SESSION variable but update database index. 0=Update _SESSION and not database index.
+ * @param int $donotupdatesession 1=Do no edit _SESSION variable but update database index. 0=Update _SESSION and not database index. -1=Do not update SESSION neither db.
* @param string $varfiles _FILES var name
* @param string $savingdocmask Mask to use to define output filename. For example 'XXXXX-__YYYYMMDD__-__file__'
* @param string $link Link to add (to add a link instead of a file)
@@ -1591,7 +1591,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
}
// Update table of files
- if ($donotupdatesession)
+ if ($donotupdatesession == 1)
{
$result = addFileIntoDatabaseIndex($upload_dir, basename($destfile), $TFile['name'][$i], 'uploaded', 0);
if ($result < 0)
@@ -1656,7 +1656,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
* All information used are in db, conf, langs, user and _FILES.
*
* @param int $filenb File nb to delete
- * @param int $donotupdatesession 1=Do not edit _SESSION variable
+ * @param int $donotupdatesession -1 or 1 = Do not update _SESSION variable
* @param int $donotdeletefile 1=Do not delete physically file
* @param string $trackid Track id (used to prefix name of session vars to avoid conflict)
* @return void
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 226619b90e1..92cab65b7b2 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3125,8 +3125,8 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo
* @param boolean|int $pictoisfullpath If true or 1, image path is a full path
* @param int $srconly Return only content of the src attribute of img.
* @param int $notitle 1=Disable tag title. Use it if you add js tooltip, to avoid duplicate tooltip.
- * @param string $alt Force alt for bind peoplae
- * @param string $morecss Add more class css on img tag (For example 'myclascss')
+ * @param string $alt Force alt for bind people
+ * @param string $morecss Add more class css on img tag (For example 'myclascss'). Work only if $moreatt is empty.
* @return string Return img tag
* @see #img_object, #img_picto_common
*/
@@ -3282,7 +3282,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
//$title=$tmparray[0];
//$alt=empty($tmparray[1])?'':$tmparray[1];
$title = $titlealt;
- return ''; // Alt is used for accessibility, title for popup
+ return ''; // Alt is used for accessibility, title for popup
}
}
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index 219719b3232..ea596294bf7 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -1167,7 +1167,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
return $numFinal;
}
-function get_string_between($string, $start, $end){
+function get_string_between($string, $start, $end)
+{
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
@@ -2197,7 +2198,8 @@ function colorStringToArray($stringcolor,$colorifnotfound=array(88,88,88))
* @param array $input Array of products
* @return array Array of combinations
*/
-function cartesianArray(array $input) {
+function cartesianArray(array $input)
+{
// filter out empty values
$input = array_filter($input);
@@ -2305,8 +2307,9 @@ function getModuleDirForApiClass($module)
* @param $max int Between 0 and 255
* @return String
*/
-function random_color_part($min=0,$max=255) {
- return str_pad( dechex( mt_rand( $min, $max) ), 2, '0', STR_PAD_LEFT);
+function random_color_part($min=0,$max=255)
+{
+ return str_pad( dechex( mt_rand( $min, $max) ), 2, '0', STR_PAD_LEFT);
}
/*
@@ -2316,6 +2319,7 @@ function random_color_part($min=0,$max=255) {
* @param $max int Between 0 and 255
* @return String
*/
-function random_color($min=0, $max=255) {
- return random_color_part($min, $max) . random_color_part($min, $max) . random_color_part($min, $max);
+function random_color($min=0, $max=255)
+{
+ return random_color_part($min, $max) . random_color_part($min, $max) . random_color_part($min, $max);
}
diff --git a/htdocs/core/lib/payments.lib.php b/htdocs/core/lib/payments.lib.php
index 1819d8e80c5..855c70ef05e 100644
--- a/htdocs/core/lib/payments.lib.php
+++ b/htdocs/core/lib/payments.lib.php
@@ -24,7 +24,8 @@
* @param Paiement $object Current payment object
* @return array Tabs for the payment section
*/
-function payment_prepare_head(Paiement $object) {
+function payment_prepare_head(Paiement $object)
+{
global $langs, $conf;
@@ -59,7 +60,8 @@ function payment_prepare_head(Paiement $object) {
* @param Paiement $object Current payment object
* @return array Tabs for the payment section
*/
-function payment_supplier_prepare_head(Paiement $object) {
+function payment_supplier_prepare_head(Paiement $object)
+{
global $langs, $conf;
diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php
index c50661de831..5f207999cd8 100644
--- a/htdocs/core/lib/propal.lib.php
+++ b/htdocs/core/lib/propal.lib.php
@@ -48,6 +48,7 @@ function propal_prepare_head($object)
|| (! empty($conf->livraison_bon->enabled) && $user->rights->expedition->livraison->lire))))
{
$langs->load("sendings");
+ $text = '';
$head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id;
if ($conf->expedition_bon->enabled) $text=$langs->trans("Shipment");
if ($conf->livraison_bon->enabled) $text.='/'.$langs->trans("Receivings");
diff --git a/htdocs/core/lib/resource.lib.php b/htdocs/core/lib/resource.lib.php
index 6ab25c5b57f..bf586b83f88 100644
--- a/htdocs/core/lib/resource.lib.php
+++ b/htdocs/core/lib/resource.lib.php
@@ -87,7 +87,8 @@ function resource_prepare_head($object)
return $head;
}
-function resource_admin_prepare_head() {
+function resource_admin_prepare_head()
+{
global $langs, $conf, $user;
diff --git a/htdocs/core/lib/salaries.lib.php b/htdocs/core/lib/salaries.lib.php
index eaaa90a710e..0c121c308d3 100644
--- a/htdocs/core/lib/salaries.lib.php
+++ b/htdocs/core/lib/salaries.lib.php
@@ -20,14 +20,15 @@
/**
* Returns an array with the tabs for the "salaries" section
* It loads tabs from modules looking for the entity salaries
- *
+ *
* @param Paiement $object Current salaries object
* @return array Tabs for the salaries section
*/
-function salaries_prepare_head($object) {
-
+function salaries_prepare_head($object)
+{
+
global $db, $langs, $conf;
-
+
$h = 0;
$head = array();
@@ -57,7 +58,7 @@ function salaries_prepare_head($object) {
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
-
+
complete_head_from_modules($conf,$langs,$object,$head,$h,'salaries', 'remove');
return $head;
diff --git a/htdocs/core/modules/action/modules_action.php b/htdocs/core/modules/action/modules_action.php
index 8e9d2200f36..8c4df5552db 100644
--- a/htdocs/core/modules/action/modules_action.php
+++ b/htdocs/core/modules/action/modules_action.php
@@ -28,7 +28,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
abstract class ModeleAction extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return list of active generation modules
diff --git a/htdocs/core/modules/bank/modules_bank.php b/htdocs/core/modules/bank/modules_bank.php
index 91ab575b7ca..300b06896b7 100644
--- a/htdocs/core/modules/bank/modules_bank.php
+++ b/htdocs/core/modules/bank/modules_bank.php
@@ -31,7 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
abstract class ModeleBankAccountDoc extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
diff --git a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php
index d04c6a70c04..86c292ee80d 100644
--- a/htdocs/core/modules/barcode/doc/phpbarcode.modules.php
+++ b/htdocs/core/modules/barcode/doc/phpbarcode.modules.php
@@ -33,7 +33,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/barcode.lib.php'; // This is to inc
class modPhpbarcode extends ModeleBarCode
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
- var $error='';
+
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
diff --git a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php
index 5b9422b15e7..741c247579d 100644
--- a/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php
+++ b/htdocs/core/modules/barcode/doc/tcpdfbarcode.modules.php
@@ -32,7 +32,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/barcode.lib.php'; // This is to inc
class modTcpdfbarcode extends ModeleBarCode
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
- var $error='';
+
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
+
var $is2d = false;
/**
diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php
index 4720ffb1341..279a5f0abf8 100644
--- a/htdocs/core/modules/barcode/modules_barcode.class.php
+++ b/htdocs/core/modules/barcode/modules_barcode.class.php
@@ -29,7 +29,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
*/
abstract class ModeleBarCode
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -50,7 +53,10 @@ abstract class ModeleBarCode
*/
abstract class ModeleNumRefBarCode
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/** Return default description of numbering model
*
diff --git a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php
index ac30024c924..d62be900266 100644
--- a/htdocs/core/modules/cheque/mod_chequereceipt_mint.php
+++ b/htdocs/core/modules/cheque/mod_chequereceipt_mint.php
@@ -31,7 +31,10 @@ class mod_chequereceipt_mint extends ModeleNumRefChequeReceipts
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='CHK';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $name='Mint';
diff --git a/htdocs/core/modules/cheque/modules_chequereceipts.php b/htdocs/core/modules/cheque/modules_chequereceipts.php
index b51a70992df..b31ebc34d01 100644
--- a/htdocs/core/modules/cheque/modules_chequereceipts.php
+++ b/htdocs/core/modules/cheque/modules_chequereceipts.php
@@ -36,7 +36,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requ
*/
abstract class ModeleNumRefChequeReceipts
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
@@ -119,7 +122,10 @@ abstract class ModeleNumRefChequeReceipts
*/
abstract class ModeleChequeReceipts extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return list of active generation modules
diff --git a/htdocs/core/modules/commande/mod_commande_marbre.php b/htdocs/core/modules/commande/mod_commande_marbre.php
index 1adbf255a9c..13ad87d6531 100644
--- a/htdocs/core/modules/commande/mod_commande_marbre.php
+++ b/htdocs/core/modules/commande/mod_commande_marbre.php
@@ -31,7 +31,10 @@ class mod_commande_marbre extends ModeleNumRefCommandes
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='CO';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $nom='Marbre';
diff --git a/htdocs/core/modules/commande/modules_commande.php b/htdocs/core/modules/commande/modules_commande.php
index 4dffcdbc236..e3a755fa523 100644
--- a/htdocs/core/modules/commande/modules_commande.php
+++ b/htdocs/core/modules/commande/modules_commande.php
@@ -39,7 +39,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
*/
abstract class ModelePDFCommandes extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return list of active generation modules
@@ -72,7 +75,10 @@ abstract class ModelePDFCommandes extends CommonDocGenerator
abstract class ModeleNumRefCommandes
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/contract/mod_contract_serpis.php b/htdocs/core/modules/contract/mod_contract_serpis.php
index 4febe6bd9e2..f43c054cb89 100644
--- a/htdocs/core/modules/contract/mod_contract_serpis.php
+++ b/htdocs/core/modules/contract/mod_contract_serpis.php
@@ -30,7 +30,10 @@ class mod_contract_serpis extends ModelNumRefContracts
{
var $version='dolibarr';
var $prefix='CT';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $nom='Serpis';
var $code_auto=1;
diff --git a/htdocs/core/modules/contract/modules_contract.php b/htdocs/core/modules/contract/modules_contract.php
index 5fd1fee8ee5..014d4a62cc9 100644
--- a/htdocs/core/modules/contract/modules_contract.php
+++ b/htdocs/core/modules/contract/modules_contract.php
@@ -37,7 +37,10 @@
*/
abstract class ModelePDFContract extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -68,7 +71,10 @@ abstract class ModelePDFContract extends CommonDocGenerator
*/
class ModelNumRefContracts
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/dons/modules_don.php b/htdocs/core/modules/dons/modules_don.php
index b0bc1bdb96b..07bb84ef5d6 100644
--- a/htdocs/core/modules/dons/modules_don.php
+++ b/htdocs/core/modules/dons/modules_don.php
@@ -34,7 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
*/
abstract class ModeleDon extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return list of active generation modules
@@ -64,7 +67,10 @@ abstract class ModeleDon extends CommonDocGenerator
*/
abstract class ModeleNumRefDons
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/expedition/mod_expedition_safor.php b/htdocs/core/modules/expedition/mod_expedition_safor.php
index 47d51e3cde5..fed13ba70d0 100644
--- a/htdocs/core/modules/expedition/mod_expedition_safor.php
+++ b/htdocs/core/modules/expedition/mod_expedition_safor.php
@@ -30,7 +30,10 @@ class mod_expedition_safor extends ModelNumRefExpedition
{
var $version='dolibarr';
var $prefix='SH';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $nom='Safor';
diff --git a/htdocs/core/modules/expedition/modules_expedition.php b/htdocs/core/modules/expedition/modules_expedition.php
index e42045ca54f..37cd11260f3 100644
--- a/htdocs/core/modules/expedition/modules_expedition.php
+++ b/htdocs/core/modules/expedition/modules_expedition.php
@@ -36,7 +36,10 @@
*/
abstract class ModelePdfExpedition extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -67,7 +70,10 @@ abstract class ModelePdfExpedition extends CommonDocGenerator
*/
abstract class ModelNumRefExpedition
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/** Return if a model can be used or not
*
diff --git a/htdocs/core/modules/expensereport/mod_expensereport_jade.php b/htdocs/core/modules/expensereport/mod_expensereport_jade.php
index c6153d422eb..b1e01d40bb9 100644
--- a/htdocs/core/modules/expensereport/mod_expensereport_jade.php
+++ b/htdocs/core/modules/expensereport/mod_expensereport_jade.php
@@ -30,7 +30,10 @@ class mod_expensereport_jade extends ModeleNumRefExpenseReport
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='ER';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $nom='Jade';
diff --git a/htdocs/core/modules/expensereport/modules_expensereport.php b/htdocs/core/modules/expensereport/modules_expensereport.php
index 6490570386c..a90ead9a5eb 100644
--- a/htdocs/core/modules/expensereport/modules_expensereport.php
+++ b/htdocs/core/modules/expensereport/modules_expensereport.php
@@ -23,7 +23,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
abstract class ModeleExpenseReport extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -75,7 +78,10 @@ function expensereport_pdf_create(DoliDB $db, ExpenseReport $object, $message, $
abstract class ModeleNumRefExpenseReport
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/export/modules_export.php b/htdocs/core/modules/export/modules_export.php
index a5203d8cf73..e669a0c9b9b 100644
--- a/htdocs/core/modules/export/modules_export.php
+++ b/htdocs/core/modules/export/modules_export.php
@@ -30,7 +30,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
class ModeleExports extends CommonDocGenerator // This class can't be abstract as there is instance propreties loaded by liste_modeles
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $driverlabel=array();
var $driverversion=array();
diff --git a/htdocs/core/modules/facture/mod_facture_mars.php b/htdocs/core/modules/facture/mod_facture_mars.php
index 831dce5d3e4..c6bba0a6232 100644
--- a/htdocs/core/modules/facture/mod_facture_mars.php
+++ b/htdocs/core/modules/facture/mod_facture_mars.php
@@ -35,7 +35,10 @@ class mod_facture_mars extends ModeleNumRefFactures
var $prefixreplacement='FR';
var $prefixdeposit='AC';
var $prefixcreditnote='AV';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
diff --git a/htdocs/core/modules/facture/mod_facture_terre.php b/htdocs/core/modules/facture/mod_facture_terre.php
index 174d8314784..53ae127b734 100644
--- a/htdocs/core/modules/facture/mod_facture_terre.php
+++ b/htdocs/core/modules/facture/mod_facture_terre.php
@@ -33,7 +33,10 @@ class mod_facture_terre extends ModeleNumRefFactures
var $prefixinvoice='FA';
var $prefixcreditnote='AV';
var $prefixdeposit='AC';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
diff --git a/htdocs/core/modules/facture/modules_facture.php b/htdocs/core/modules/facture/modules_facture.php
index bcd21fff431..521e6471561 100644
--- a/htdocs/core/modules/facture/modules_facture.php
+++ b/htdocs/core/modules/facture/modules_facture.php
@@ -37,7 +37,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requ
*/
abstract class ModelePDFFactures extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return list of active generation modules
@@ -66,7 +69,10 @@ abstract class ModelePDFFactures extends CommonDocGenerator
*/
abstract class ModeleNumRefFactures
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/fichinter/mod_pacific.php b/htdocs/core/modules/fichinter/mod_pacific.php
index 43bf23b4731..ac953499bc0 100644
--- a/htdocs/core/modules/fichinter/mod_pacific.php
+++ b/htdocs/core/modules/fichinter/mod_pacific.php
@@ -32,7 +32,10 @@ class mod_pacific extends ModeleNumRefFicheinter
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='FI';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $nom = 'pacific';
diff --git a/htdocs/core/modules/fichinter/modules_fichinter.php b/htdocs/core/modules/fichinter/modules_fichinter.php
index 56b57485837..bc08063ea21 100644
--- a/htdocs/core/modules/fichinter/modules_fichinter.php
+++ b/htdocs/core/modules/fichinter/modules_fichinter.php
@@ -34,7 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
abstract class ModelePDFFicheinter extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -65,7 +68,10 @@ abstract class ModelePDFFicheinter extends CommonDocGenerator
*/
abstract class ModeleNumRefFicheinter
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/holiday/mod_holiday_madonna.php b/htdocs/core/modules/holiday/mod_holiday_madonna.php
index b36200ef9d4..0ec68d8778b 100644
--- a/htdocs/core/modules/holiday/mod_holiday_madonna.php
+++ b/htdocs/core/modules/holiday/mod_holiday_madonna.php
@@ -31,7 +31,10 @@ class mod_holiday_madonna extends ModelNumRefHolidays
{
var $version='dolibarr';
var $prefix='HL';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $nom='Madonna';
var $code_auto=1;
diff --git a/htdocs/core/modules/holiday/modules_holiday.php b/htdocs/core/modules/holiday/modules_holiday.php
index 4e03e184738..160c84b84db 100644
--- a/htdocs/core/modules/holiday/modules_holiday.php
+++ b/htdocs/core/modules/holiday/modules_holiday.php
@@ -38,7 +38,10 @@
*/
abstract class ModelePDFHoliday extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -69,7 +72,10 @@ abstract class ModelePDFHoliday extends CommonDocGenerator
*/
class ModelNumRefHolidays
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php
index db604a5159e..5a65c5a2883 100644
--- a/htdocs/core/modules/import/import_csv.modules.php
+++ b/htdocs/core/modules/import/import_csv.modules.php
@@ -36,8 +36,16 @@ class ImportCsv extends ModeleImports
var $db;
var $datatoimport;
- var $error='';
- var $errors=array();
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
+
+ /**
+ *
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array ();
var $id; // Id of driver
var $label; // Label of driver
diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php
index 75e9e0c5c7b..81d3272cb3c 100644
--- a/htdocs/core/modules/import/import_xlsx.modules.php
+++ b/htdocs/core/modules/import/import_xlsx.modules.php
@@ -36,8 +36,16 @@ class ImportXlsx extends ModeleImports
var $db;
var $datatoimport;
- var $error='';
- var $errors=array();
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
+
+ /**
+ *
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array ();
var $id; // Id of driver
var $label; // Label of driver
diff --git a/htdocs/core/modules/livraison/modules_livraison.php b/htdocs/core/modules/livraison/modules_livraison.php
index 9c15b337f9f..ab38adb46af 100644
--- a/htdocs/core/modules/livraison/modules_livraison.php
+++ b/htdocs/core/modules/livraison/modules_livraison.php
@@ -36,7 +36,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return list of active generation modules
@@ -68,7 +71,10 @@ abstract class ModelePDFDeliveryOrder extends CommonDocGenerator
*/
abstract class ModeleNumRefDeliveryOrder
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/member/doc/pdf_standard.class.php b/htdocs/core/modules/member/doc/pdf_standard.class.php
index 85d61432dc4..2638f387823 100644
--- a/htdocs/core/modules/member/doc/pdf_standard.class.php
+++ b/htdocs/core/modules/member/doc/pdf_standard.class.php
@@ -42,7 +42,8 @@ class pdf_standard extends CommonStickerGenerator
* @param array $param Associative array containing label content and optional parameters
* @return void
*/
- function addSticker(&$pdf,$outputlangs,$param) {
+ function addSticker(&$pdf,$outputlangs,$param)
+ {
// use this method in future refactoring
}
diff --git a/htdocs/core/modules/member/modules_cards.php b/htdocs/core/modules/member/modules_cards.php
index 9ecbff756aa..071ceeb8def 100644
--- a/htdocs/core/modules/member/modules_cards.php
+++ b/htdocs/core/modules/member/modules_cards.php
@@ -34,7 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
*/
class ModelePDFCards
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php
index 07331bcbc3c..0cfa4b8d95a 100644
--- a/htdocs/core/modules/modBlockedLog.class.php
+++ b/htdocs/core/modules/modBlockedLog.class.php
@@ -51,7 +51,7 @@ class modBlockedLog extends DolibarrModules
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable a log on some business events into a non reversible log. This module may be mandatory for some countries.";
- // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
@@ -145,7 +145,8 @@ class modBlockedLog extends DolibarrModules
*
* @return boolean True if already used, otherwise False
*/
- function alreadyUsed() {
+ function alreadyUsed()
+ {
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
$b=new BlockedLog($this->db);
@@ -204,7 +205,8 @@ class modBlockedLog extends DolibarrModules
* @param string $options Options when enabling module ('', 'noboxes')
* @return int 1 if OK, 0 if KO
*/
- function remove($options = '') {
+ function remove($options = '')
+ {
global $conf, $user;
diff --git a/htdocs/core/modules/modDav.class.php b/htdocs/core/modules/modDav.class.php
index d15aed7cc30..329a77437e0 100644
--- a/htdocs/core/modules/modDav.class.php
+++ b/htdocs/core/modules/modDav.class.php
@@ -64,7 +64,7 @@ class modDav extends DolibarrModules
$this->descriptionlong = "davDescription";
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
- $this->version = 'experimental';
+ $this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where DAV is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of image file used for this module.
diff --git a/htdocs/core/modules/modModuleBuilder.class.php b/htdocs/core/modules/modModuleBuilder.class.php
index 60afb99afc5..3f106de6c78 100644
--- a/htdocs/core/modules/modModuleBuilder.class.php
+++ b/htdocs/core/modules/modModuleBuilder.class.php
@@ -49,7 +49,7 @@ class modModuleBuilder extends DolibarrModules
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "A RAD (Rapid Application Development) tool to help developers to build their own module.";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
- $this->version = 'experimental';
+ $this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of image file used for this module.
diff --git a/htdocs/core/modules/modOauth.class.php b/htdocs/core/modules/modOauth.class.php
index 3f2ecc0ac72..74689230525 100644
--- a/htdocs/core/modules/modOauth.class.php
+++ b/htdocs/core/modules/modOauth.class.php
@@ -40,7 +40,7 @@ class modOauth extends DolibarrModules
*
* @param DoliDB $db Database handler
*/
- function __construct($db)
+ function __construct($db)
{
$this->db = $db ;
$this->numero = 66000;
@@ -52,7 +52,7 @@ class modOauth extends DolibarrModules
$this->name = preg_replace('/^mod/i','',get_class($this));
// Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
$this->description = "Enable OAuth authentication";
- // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
+ // Possible values for version are: 'development', 'experimental', 'dolibarr' or 'dolibarr_deprecated' or version
$this->version = 'dolibarr';
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of image file used for this module.
diff --git a/htdocs/core/modules/modPrinting.class.php b/htdocs/core/modules/modPrinting.class.php
index 17d2f398e2b..ea086e2dbbe 100644
--- a/htdocs/core/modules/modPrinting.class.php
+++ b/htdocs/core/modules/modPrinting.class.php
@@ -40,7 +40,7 @@ class modPrinting extends DolibarrModules
*
* @param DoliDB $db Database handler
*/
- function __construct($db)
+ function __construct($db)
{
$this->db = $db ;
$this->numero = 64000;
@@ -50,7 +50,7 @@ class modPrinting extends DolibarrModules
$this->module_position = 520;
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i','',get_class($this));
- // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
+ // Module description, used if translation string 'ModuleXXXDesc' not found (where XXX is value of numeric property 'numero' of module)
$this->description = "Enable Direct Printing System.";
$this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
diff --git a/htdocs/core/modules/modReceiptPrinter.class.php b/htdocs/core/modules/modReceiptPrinter.class.php
index 77f264f0d52..b2ed975a404 100644
--- a/htdocs/core/modules/modReceiptPrinter.class.php
+++ b/htdocs/core/modules/modReceiptPrinter.class.php
@@ -40,7 +40,7 @@ class modReceiptPrinter extends DolibarrModules
*
* @param DoliDB $db Database handler
*/
- function __construct($db)
+ function __construct($db)
{
$this->db = $db ;
$this->numero = 67000;
diff --git a/htdocs/core/modules/modWebsite.class.php b/htdocs/core/modules/modWebsite.class.php
index f684985917a..7d0b0540ed2 100644
--- a/htdocs/core/modules/modWebsite.class.php
+++ b/htdocs/core/modules/modWebsite.class.php
@@ -51,7 +51,7 @@ class modWebsite extends DolibarrModules
$this->name = preg_replace('/^mod/i','',get_class($this));
$this->description = "Enable to build and serve public web sites with CMS features";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
- $this->version = 'experimental';
+ $this->version = 'dolibarr';
// Key used in llx_const table to save module status enabled/disabled (where MYMODULE is value of property name of module in uppercase)
$this->const_name = 'MAIN_MODULE_'.strtoupper($this->name);
// Name of image file used for this module.
diff --git a/htdocs/core/modules/payment/mod_payment_cicada.php b/htdocs/core/modules/payment/mod_payment_cicada.php
index 951b71a0d56..c05b42064f4 100644
--- a/htdocs/core/modules/payment/mod_payment_cicada.php
+++ b/htdocs/core/modules/payment/mod_payment_cicada.php
@@ -31,7 +31,10 @@ class mod_payment_cicada extends ModeleNumRefPayments
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='PAY';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $nom='Cicada';
diff --git a/htdocs/core/modules/payment/modules_payment.php b/htdocs/core/modules/payment/modules_payment.php
index c9023a9fc65..d9cf9b1260f 100644
--- a/htdocs/core/modules/payment/modules_payment.php
+++ b/htdocs/core/modules/payment/modules_payment.php
@@ -23,7 +23,10 @@
abstract class ModeleNumRefPayments
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/printing/printgcp.modules.php b/htdocs/core/modules/printing/printgcp.modules.php
index f5591e66e9b..3337d715d14 100644
--- a/htdocs/core/modules/printing/printgcp.modules.php
+++ b/htdocs/core/modules/printing/printgcp.modules.php
@@ -43,7 +43,12 @@ class printing_printgcp extends PrintingDriver
var $google_id = '';
var $google_secret = '';
var $error;
- var $errors = array();
+ /**
+ *
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array ();
+
var $db;
private $OAUTH_SERVICENAME_GOOGLE = 'Google';
diff --git a/htdocs/core/modules/printing/printipp.modules.php b/htdocs/core/modules/printing/printipp.modules.php
index b725a6a3965..f2837e3d943 100644
--- a/htdocs/core/modules/printing/printipp.modules.php
+++ b/htdocs/core/modules/printing/printipp.modules.php
@@ -41,7 +41,12 @@ class printing_printipp extends PrintingDriver
var $user;
var $password;
var $error;
- var $errors = array();
+ /**
+ *
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array ();
+
var $db;
diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php
index 7577d4820a8..1ca929c08cf 100644
--- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php
+++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php
@@ -41,7 +41,8 @@ class pdf_standardlabel extends CommonStickerGenerator
* @param array $param Associative array containing label content and optional parameters
* @return void
*/
- function addSticker(&$pdf,$outputlangs,$param) {
+ function addSticker(&$pdf,$outputlangs,$param)
+ {
// use this method in future refactoring
}
diff --git a/htdocs/core/modules/printsheet/modules_labels.php b/htdocs/core/modules/printsheet/modules_labels.php
index 8149ea03a1b..d1f9f2e8bbb 100644
--- a/htdocs/core/modules/printsheet/modules_labels.php
+++ b/htdocs/core/modules/printsheet/modules_labels.php
@@ -34,7 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
*/
class ModelePDFLabels
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php
index 8b0495be89f..7dff50cacad 100644
--- a/htdocs/core/modules/product/modules_product.class.php
+++ b/htdocs/core/modules/product/modules_product.class.php
@@ -33,7 +33,10 @@
*/
abstract class ModelePDFProduct extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -59,7 +62,10 @@ abstract class ModelePDFProduct extends CommonDocGenerator
abstract class ModeleProductCode
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/** Renvoi la description par defaut du modele de numerotation
*
diff --git a/htdocs/core/modules/product_batch/modules_product_batch.class.php b/htdocs/core/modules/product_batch/modules_product_batch.class.php
index b51f735467e..02e3be660b8 100644
--- a/htdocs/core/modules/product_batch/modules_product_batch.class.php
+++ b/htdocs/core/modules/product_batch/modules_product_batch.class.php
@@ -38,7 +38,10 @@
*/
abstract class ModelePDFProductBatch extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index 3c8ea0ea151..b7257ac5115 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -162,6 +162,7 @@ class doc_generic_project_odt extends ModelePDFProjects
'task_description'=>$task->description,
'task_fk_parent'=>$task->fk_parent,
'task_duration'=>$task->duration,
+ 'task_duration_hour'=>convertSecondToTime($task->duration,'all'),
'task_progress'=>$task->progress,
'task_public'=>$task->public,
'task_date_start'=>dol_print_date($task->date_start,'day'),
@@ -324,7 +325,10 @@ class doc_generic_project_odt extends ModelePDFProjects
'tasktime_fk_user'=>$tasktime['fk_user'],
'tasktime_user_name'=>$tasktime['name'],
'tasktime_user_first'=>$tasktime['firstname'],
- 'tasktime_fullcivname'=>$tasktime['fullcivname']
+ 'tasktime_fullcivname'=>$tasktime['fullcivname'],
+ 'tasktime_amountht'=>$tasktime['amountht'],
+ 'tasktime_amountttc'=>$tasktime['amountttc'],
+ 'tasktime_thm'=>$tasktime['thm'],
);
}
@@ -707,7 +711,7 @@ class doc_generic_project_odt extends ModelePDFProjects
//Time ressources
$sql = "SELECT t.rowid, t.task_date, t.task_duration, t.fk_user, t.note";
- $sql.= ", u.lastname, u.firstname";
+ $sql.= ", u.lastname, u.firstname, t.thm";
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
$sql .= " , ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE t.fk_task =".$task->id;
@@ -721,6 +725,35 @@ class doc_generic_project_odt extends ModelePDFProjects
$i = 0;
$tasks = array();
$listlinestasktime = $listlines->__get('taskstimes');
+ if (empty($num)) {
+ $row['rowid']='';
+ $row['task_date']='';
+ $row['task_duration']='';
+ $row['$tasktime']='';
+ $row['note']='';
+ $row['fk_user']='';
+ $row['name']='';
+ $row['firstname']='';
+ $row['fullcivname']='';
+ $row['amountht']='';
+ $row['amountttc']='';
+ $row['thm']='';
+ $tmparray=$this->get_substitutionarray_taskstime($row,$outputlangs);
+ foreach($tmparray as $key => $val)
+ {
+ try
+ {
+ $listlinestasktime->setVars($key, $val, true, 'UTF-8');
+ }
+ catch(OdfException $e)
+ {
+ }
+ catch(SegmentException $e)
+ {
+ }
+ }
+ $listlinestasktime->merge();
+ }
while ($i < $num)
{
$row = $this->db->fetch_array($resql);
@@ -732,6 +765,16 @@ class doc_generic_project_odt extends ModelePDFProjects
$row['fullcivname']='';
}
+ if (!empty($row['thm'])) {
+ $row['amountht']=($row['task_duration'] / 3600) * $row['thm'];
+ $defaultvat = get_default_tva($mysoc, $mysoc);
+ $row['amountttc']=price2num($row['amountht'] * (1 + ($defaultvat / 100)),'MT');;
+ } else {
+ $row['amountht']=0;
+ $row['amountttc']=0;
+ $row['thm']=0;
+ }
+
$tmparray=$this->get_substitutionarray_taskstime($row,$outputlangs);
foreach($tmparray as $key => $val)
@@ -893,60 +936,114 @@ class doc_generic_project_odt extends ModelePDFProjects
//List of referent
- $listofreferent=array(
- 'propal'=>array(
- 'title'=>"ListProposalsAssociatedProject",
- 'class'=>'Propal',
- 'table'=>'propal',
- 'test'=>$conf->propal->enabled && $user->rights->propale->lire),
- 'order'=>array(
- 'title'=>"ListOrdersAssociatedProject",
- 'class'=>'Commande',
- 'table'=>'commande',
- 'test'=>$conf->commande->enabled && $user->rights->commande->lire),
- 'invoice'=>array(
- 'title'=>"ListInvoicesAssociatedProject",
- 'class'=>'Facture',
- 'table'=>'facture',
- 'test'=>$conf->facture->enabled && $user->rights->facture->lire),
- 'invoice_predefined'=>array(
- 'title'=>"ListPredefinedInvoicesAssociatedProject",
- 'class'=>'FactureRec',
- 'table'=>'facture_rec',
- 'test'=>$conf->facture->enabled && $user->rights->facture->lire),
- 'order_supplier'=>array(
- 'title'=>"ListSupplierOrdersAssociatedProject",
- 'table'=>'commande_fournisseur',
- 'class'=>'CommandeFournisseur',
- 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire),
- 'invoice_supplier'=>array(
- 'title'=>"ListSupplierInvoicesAssociatedProject",
- 'table'=>'facture_fourn',
- 'class'=>'FactureFournisseur',
- 'test'=>$conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire),
- 'contract'=>array(
- 'title'=>"ListContractAssociatedProject",
- 'class'=>'Contrat',
- 'table'=>'contrat',
- 'test'=>$conf->contrat->enabled && $user->rights->contrat->lire),
- 'intervention'=>array(
- 'title'=>"ListFichinterAssociatedProject",
- 'class'=>'Fichinter',
- 'table'=>'fichinter',
- 'disableamount'=>1,
- 'test'=>$conf->ficheinter->enabled && $user->rights->ficheinter->lire),
- 'trip'=>array(
- 'title'=>"ListTripAssociatedProject",
- 'class'=>'Deplacement',
- 'table'=>'deplacement',
- 'disableamount'=>1,
- 'test'=>$conf->deplacement->enabled && $user->rights->deplacement->lire),
- 'agenda'=>array(
- 'title'=>"ListActionsAssociatedProject",
- 'class'=>'ActionComm',
- 'table'=>'actioncomm',
- 'disableamount'=>1,
- 'test'=>$conf->agenda->enabled && $user->rights->agenda->allactions->lire)
+ $listofreferent = array(
+ 'propal' => array(
+ 'title' => "ListProposalsAssociatedProject",
+ 'class' => 'Propal',
+ 'table' => 'propal',
+ 'test' => $conf->propal->enabled && $user->rights->propale->lire
+ ),
+ 'order' => array(
+ 'title' => "ListOrdersAssociatedProject",
+ 'class' => 'Commande',
+ 'table' => 'commande',
+ 'test' => $conf->commande->enabled && $user->rights->commande->lire
+ ),
+ 'invoice' => array(
+ 'title' => "ListInvoicesAssociatedProject",
+ 'class' => 'Facture',
+ 'table' => 'facture',
+ 'test' => $conf->facture->enabled && $user->rights->facture->lire
+ ),
+ 'invoice_predefined' => array(
+ 'title' => "ListPredefinedInvoicesAssociatedProject",
+ 'class' => 'FactureRec',
+ 'table' => 'facture_rec',
+ 'test' => $conf->facture->enabled && $user->rights->facture->lire
+ ),
+ 'proposal_supplier' => array(
+ 'title' => "ListSupplierProposalsAssociatedProject",
+ 'class' => 'SupplierProposal',
+ 'table' => 'supplier_proposal',
+ 'test' => $conf->supplier_proposal->enabled && $user->rights->supplier_proposal->lire
+ ),
+ 'order_supplier' => array(
+ 'title' => "ListSupplierOrdersAssociatedProject",
+ 'table' => 'commande_fournisseur',
+ 'class' => 'CommandeFournisseur',
+ 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire
+ ),
+ 'invoice_supplier' => array(
+ 'title' => "ListSupplierInvoicesAssociatedProject",
+ 'table' => 'facture_fourn',
+ 'class' => 'FactureFournisseur',
+ 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire
+ ),
+ 'contract' => array(
+ 'title' => "ListContractAssociatedProject",
+ 'class' => 'Contrat',
+ 'table' => 'contrat',
+ 'test' => $conf->contrat->enabled && $user->rights->contrat->lire
+ ),
+ 'intervention' => array(
+ 'title' => "ListFichinterAssociatedProject",
+ 'class' => 'Fichinter',
+ 'table' => 'fichinter',
+ 'disableamount' => 1,
+ 'test' => $conf->ficheinter->enabled && $user->rights->ficheinter->lire
+ ),
+ 'shipping' => array(
+ 'title' => "ListShippingAssociatedProject",
+ 'class' => 'Expedition',
+ 'table' => 'expedition',
+ 'disableamount' => 1,
+ 'test' => $conf->expedition->enabled && $user->rights->expedition->lire
+ ),
+ 'trip' => array(
+ 'title' => "ListTripAssociatedProject",
+ 'class' => 'Deplacement',
+ 'table' => 'deplacement',
+ 'disableamount' => 1,
+ 'test' => $conf->deplacement->enabled && $user->rights->deplacement->lire
+ ),
+ 'expensereport' => array(
+ 'title' => "ListExpenseReportsAssociatedProject",
+ 'class' => 'ExpenseReportLine',
+ 'table' => 'expensereport_det',
+ 'test' => $conf->expensereport->enabled && $user->rights->expensereport->lire
+ ),
+ 'donation' => array(
+ 'title' => "ListDonationsAssociatedProject",
+ 'class' => 'Don',
+ 'table' => 'don',
+ 'test' => $conf->don->enabled && $user->rights->don->lire
+ ),
+ 'loan' => array(
+ 'title' => "ListLoanAssociatedProject",
+ 'class' => 'Loan',
+ 'table' => 'loan',
+ 'test' => $conf->loan->enabled && $user->rights->loan->read
+ ),
+ 'chargesociales' => array(
+ 'title' => "ListSocialContributionAssociatedProject",
+ 'class' => 'ChargeSociales',
+ 'table' => 'chargesociales',
+ 'urlnew' => DOL_URL_ROOT . '/compta/sociales/card.php?action=create&projectid=' . $id,
+ 'test' => $conf->tax->enabled && $user->rights->tax->charges->lire
+ ),
+ 'stock_mouvement' => array(
+ 'title' => "ListMouvementStockProject",
+ 'class' => 'MouvementStock',
+ 'table' => 'stock_mouvement',
+ 'test' => ($conf->stock->enabled && $user->rights->stock->mouvement->lire && ! empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW))
+ ),
+ 'agenda' => array(
+ 'title' => "ListActionsAssociatedProject",
+ 'class' => 'ActionComm',
+ 'table' => 'actioncomm',
+ 'disableamount' => 1,
+ 'test' => $conf->agenda->enabled && $user->rights->agenda->allactions->lire
+ )
);
//Insert reference
diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php
index 1f4656f5ebe..adb0c821390 100644
--- a/htdocs/core/modules/project/mod_project_simple.php
+++ b/htdocs/core/modules/project/mod_project_simple.php
@@ -33,7 +33,10 @@ class mod_project_simple extends ModeleNumRefProjects
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='PJ';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $nom = "Simple";
var $name = "Simple";
diff --git a/htdocs/core/modules/project/modules_project.php b/htdocs/core/modules/project/modules_project.php
index 3f7c1526f9e..3053230a6a9 100644
--- a/htdocs/core/modules/project/modules_project.php
+++ b/htdocs/core/modules/project/modules_project.php
@@ -31,7 +31,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
abstract class ModelePDFProjects extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -63,7 +66,10 @@ abstract class ModelePDFProjects extends CommonDocGenerator
*/
abstract class ModeleNumRefProjects
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php
index 85f361f4bc2..539683e8c18 100644
--- a/htdocs/core/modules/project/task/mod_task_simple.php
+++ b/htdocs/core/modules/project/task/mod_task_simple.php
@@ -33,7 +33,10 @@ class mod_task_simple extends ModeleNumRefTask
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='TK';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $nom = "Simple";
var $name = "Simple";
diff --git a/htdocs/core/modules/project/task/modules_task.php b/htdocs/core/modules/project/task/modules_task.php
index b08c083b4c1..8857d4fbd81 100644
--- a/htdocs/core/modules/project/task/modules_task.php
+++ b/htdocs/core/modules/project/task/modules_task.php
@@ -32,7 +32,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
abstract class ModelePDFTask extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -64,7 +67,10 @@ abstract class ModelePDFTask extends CommonDocGenerator
*/
abstract class ModeleNumRefTask
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/propale/mod_propale_marbre.php b/htdocs/core/modules/propale/mod_propale_marbre.php
index 0e1700da500..cac76d47b5a 100644
--- a/htdocs/core/modules/propale/mod_propale_marbre.php
+++ b/htdocs/core/modules/propale/mod_propale_marbre.php
@@ -33,7 +33,10 @@ class mod_propale_marbre extends ModeleNumRefPropales
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='PR';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $nom = "Marbre";
diff --git a/htdocs/core/modules/propale/modules_propale.php b/htdocs/core/modules/propale/modules_propale.php
index d65ce8316d4..0c046746486 100644
--- a/htdocs/core/modules/propale/modules_propale.php
+++ b/htdocs/core/modules/propale/modules_propale.php
@@ -36,7 +36,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requ
*/
abstract class ModelePDFPropales extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -67,7 +70,10 @@ abstract class ModelePDFPropales extends CommonDocGenerator
*/
abstract class ModeleNumRefPropales
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php
index 96041bcac2c..39b3d54ea30 100644
--- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php
+++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php
@@ -72,7 +72,7 @@ class modGeneratePassPerso extends ModeleGenPassword
$this->langs=$langs;
$this->user=$user;
- if(empty($conf->global->USER_PASSWORD_PATTERN)){
+ if (empty($conf->global->USER_PASSWORD_PATTERN)) {
// default value (8carac, 1maj, 1digit, 1spe, 3 repeat, no ambi at auto generation.
dolibarr_set_const($db, "USER_PASSWORD_PATTERN", '8;1;1;1;3;1','chaine',0,'',$conf->entity);
}
@@ -201,7 +201,8 @@ class modGeneratePassPerso extends ModeleGenPassword
* @param string $password Password to check
* @return int 0 if KO, >0 if OK
*/
- function consecutiveInterationSameCharacter($password){
+ function consecutiveInterationSameCharacter($password)
+ {
$last = "";
$count = 0;
$char = str_split($password);
@@ -220,4 +221,3 @@ class modGeneratePassPerso extends ModeleGenPassword
return 1;
}
}
-
diff --git a/htdocs/core/modules/security/generate/modules_genpassword.php b/htdocs/core/modules/security/generate/modules_genpassword.php
index 3129a341926..60378cf03a4 100644
--- a/htdocs/core/modules/security/generate/modules_genpassword.php
+++ b/htdocs/core/modules/security/generate/modules_genpassword.php
@@ -30,7 +30,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
*/
abstract class ModeleGenPassword
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php
index ccb9006df02..6d3d136e46c 100644
--- a/htdocs/core/modules/societe/modules_societe.class.php
+++ b/htdocs/core/modules/societe/modules_societe.class.php
@@ -33,7 +33,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
abstract class ModeleThirdPartyDoc extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return list of active generation modules
@@ -64,7 +67,10 @@ abstract class ModeleThirdPartyDoc extends CommonDocGenerator
*/
abstract class ModeleThirdPartyCode
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/** Renvoi la description par defaut du modele de numerotation
*
@@ -258,7 +264,10 @@ abstract class ModeleThirdPartyCode
*/
abstract class ModeleAccountancyCode
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/** Return description of module
diff --git a/htdocs/core/modules/stock/modules_movement.php b/htdocs/core/modules/stock/modules_movement.php
index f7882246739..e6a3f0dcf03 100644
--- a/htdocs/core/modules/stock/modules_movement.php
+++ b/htdocs/core/modules/stock/modules_movement.php
@@ -30,7 +30,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
abstract class ModelePDFMovement extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
diff --git a/htdocs/core/modules/stock/modules_stock.php b/htdocs/core/modules/stock/modules_stock.php
index 279ff5b21fe..914facb4ed0 100644
--- a/htdocs/core/modules/stock/modules_stock.php
+++ b/htdocs/core/modules/stock/modules_stock.php
@@ -23,7 +23,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
abstract class ModelePDFStock extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
diff --git a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php
index e57ffd2ec0b..285bccf9048 100644
--- a/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php
+++ b/htdocs/core/modules/supplier_invoice/modules_facturefournisseur.php
@@ -34,7 +34,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
*/
abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -65,7 +68,10 @@ abstract class ModelePDFSuppliersInvoices extends CommonDocGenerator
*/
abstract class ModeleNumRefSuppliersInvoices
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/** Return if a model can be used or not
*
diff --git a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php
index f5c2fb2381c..1cbeca5dac7 100644
--- a/htdocs/core/modules/supplier_order/modules_commandefournisseur.php
+++ b/htdocs/core/modules/supplier_order/modules_commandefournisseur.php
@@ -37,7 +37,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // requir
*/
abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -70,7 +73,10 @@ abstract class ModelePDFSuppliersOrders extends CommonDocGenerator
*/
abstract class ModeleNumRefSuppliersOrders
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/** Return if a model can be used or not
*
diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php
index e4d6b82b8a0..162ddda7f7f 100644
--- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php
+++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_bronan.php
@@ -31,7 +31,10 @@ class mod_supplier_payment_bronan extends ModeleNumRefSupplierPayments
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='SPAY';
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $nom='Bronan';
diff --git a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php
index 7e4c954817e..7f4e2fcf84b 100644
--- a/htdocs/core/modules/supplier_payment/modules_supplier_payment.php
+++ b/htdocs/core/modules/supplier_payment/modules_supplier_payment.php
@@ -22,7 +22,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
*/
abstract class ModelePDFSuppliersPayments extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -55,7 +58,10 @@ abstract class ModelePDFSuppliersPayments extends CommonDocGenerator
abstract class ModeleNumRefSupplierPayments
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php
index fa8cf6c6460..372b3189292 100644
--- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php
+++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_marbre.php
@@ -33,7 +33,10 @@ class mod_supplier_proposal_marbre extends ModeleNumRefSupplierProposal
{
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $prefix='RQ'; // RQ = Request for quotation
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
var $nom = "Marbre";
diff --git a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php
index 46a5a095511..da9b826cab3 100644
--- a/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php
+++ b/htdocs/core/modules/supplier_proposal/modules_supplier_proposal.php
@@ -36,7 +36,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; // Requ
*/
abstract class ModelePDFSupplierProposal extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
@@ -67,7 +70,10 @@ abstract class ModelePDFSupplierProposal extends CommonDocGenerator
*/
abstract class ModeleNumRefSupplierProposal
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Return if a module can be used or not
diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
index ada697b1209..724f09083c5 100644
--- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
+++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
@@ -424,7 +424,8 @@ class doc_generic_user_odt extends ModelePDFUser
}
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
- function get_substitutionarray_object($object,$outputlangs, $array_key='object') {
+ function get_substitutionarray_object($object,$outputlangs,$array_key='object')
+ {
$array_other=array();
foreach($object as $key => $value) {
if (!is_array($value) && !is_object($value)) {
diff --git a/htdocs/core/modules/user/modules_user.class.php b/htdocs/core/modules/user/modules_user.class.php
index f0d18535dac..8ba2b638c38 100644
--- a/htdocs/core/modules/user/modules_user.class.php
+++ b/htdocs/core/modules/user/modules_user.class.php
@@ -38,7 +38,10 @@
*/
abstract class ModelePDFUser extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
diff --git a/htdocs/core/modules/usergroup/modules_usergroup.class.php b/htdocs/core/modules/usergroup/modules_usergroup.class.php
index a2c4dcde5de..ec976239b9b 100644
--- a/htdocs/core/modules/usergroup/modules_usergroup.class.php
+++ b/htdocs/core/modules/usergroup/modules_usergroup.class.php
@@ -38,7 +38,10 @@
*/
abstract class ModelePDFUserGroup extends CommonDocGenerator
{
- var $error='';
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
diff --git a/htdocs/core/triggers/dolibarrtriggers.class.php b/htdocs/core/triggers/dolibarrtriggers.class.php
index 61a89b083f8..f47daa0d419 100644
--- a/htdocs/core/triggers/dolibarrtriggers.class.php
+++ b/htdocs/core/triggers/dolibarrtriggers.class.php
@@ -80,11 +80,12 @@ abstract class DolibarrTriggers
*
* @param DoliDB $db Database handler
*/
- public function __construct(DoliDB $db) {
+ public function __construct(DoliDB $db)
+ {
$this->db = $db;
- if (empty($this->name))
+ if (empty($this->name))
{
$this->name = preg_replace('/^Interface/i', '', get_class($this));
}
diff --git a/htdocs/dav/fileserver.php b/htdocs/dav/fileserver.php
index 2fc4485dc76..bfdc81887ff 100644
--- a/htdocs/dav/fileserver.php
+++ b/htdocs/dav/fileserver.php
@@ -58,8 +58,7 @@ $tmpDir = $conf->dav->dir_temp;
//var_dump($tmpDir);exit;
// Authentication callback function
-$authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function ($username, $password)
-{
+$authBackend = new \Sabre\DAV\Auth\Backend\BasicCallBack(function ($username, $password) {
global $user;
global $conf;
global $dolibarr_main_authentication;
diff --git a/htdocs/document.php b/htdocs/document.php
index 725d079a9f6..81c8d00a9f7 100644
--- a/htdocs/document.php
+++ b/htdocs/document.php
@@ -64,13 +64,17 @@ if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias'))
*
* @return void
*/
-function llxHeader() { }
+function llxHeader()
+{
+}
/**
* Footer empty
*
* @return void
*/
-function llxFooter() { }
+function llxFooter()
+{
+}
require 'main.inc.php'; // Load $user and permissions
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php
index 87596e59613..0e07c3706a4 100644
--- a/htdocs/expedition/class/api_shipments.class.php
+++ b/htdocs/expedition/class/api_shipments.class.php
@@ -35,7 +35,7 @@ class Shipments extends DolibarrApi
static $FIELDS = array(
'socid',
'origin_id',
- 'origin_type'
+ 'origin_type',
);
/**
@@ -99,7 +99,8 @@ class Shipments extends DolibarrApi
*
* @throws RestException
*/
- function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') {
+ function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
+ {
global $db, $conf;
$obj_ret = array();
@@ -217,7 +218,8 @@ class Shipments extends DolibarrApi
* @return int
*/
/*
- function getLines($id) {
+ function getLines($id)
+ {
if(! DolibarrApiAccess::$user->rights->expedition->lire) {
throw new RestException(401);
}
@@ -250,7 +252,8 @@ class Shipments extends DolibarrApi
* @return int
*/
/*
- function postLine($id, $request_data = null) {
+ function postLine($id, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->expedition->creer) {
throw new RestException(401);
}
@@ -312,7 +315,8 @@ class Shipments extends DolibarrApi
* @return object
*/
/*
- function putLine($id, $lineid, $request_data = null) {
+ function putLine($id, $lineid, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->expedition->creer) {
throw new RestException(401);
}
@@ -372,7 +376,8 @@ class Shipments extends DolibarrApi
* @throws 401
* @throws 404
*/
- function deleteLine($id, $lineid) {
+ function deleteLine($id, $lineid)
+ {
if(! DolibarrApiAccess::$user->rights->expedition->creer) {
throw new RestException(401);
}
@@ -407,7 +412,8 @@ class Shipments extends DolibarrApi
*
* @return int
*/
- function put($id, $request_data = null) {
+ function put($id, $request_data = null)
+ {
if (! DolibarrApiAccess::$user->rights->expedition->creer) {
throw new RestException(401);
}
@@ -537,7 +543,8 @@ class Shipments extends DolibarrApi
* @throws 404
* @throws 405
*/
-/* function setinvoiced($id) {
+/* function setinvoiced($id)
+ {
if(! DolibarrApiAccess::$user->rights->expedition->creer) {
throw new RestException(401);
@@ -573,7 +580,8 @@ class Shipments extends DolibarrApi
* @throws 405
*/
/*
- function createShipmentFromOrder($orderid) {
+ function createShipmentFromOrder($orderid)
+ {
require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
@@ -608,7 +616,8 @@ class Shipments extends DolibarrApi
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
- function _cleanObjectDatas($object) {
+ function _cleanObjectDatas($object)
+ {
$object = parent::_cleanObjectDatas($object);
diff --git a/htdocs/expensereport/class/api_expensereports.class.php b/htdocs/expensereport/class/api_expensereports.class.php
index 726aa158413..d83714356a2 100644
--- a/htdocs/expensereport/class/api_expensereports.class.php
+++ b/htdocs/expensereport/class/api_expensereports.class.php
@@ -94,7 +94,8 @@ class ExpenseReports extends DolibarrApi
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
* @return array Array of Expense Report objects
*/
- function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '') {
+ function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '')
+ {
global $db, $conf;
$obj_ret = array();
@@ -195,7 +196,8 @@ class ExpenseReports extends DolibarrApi
* @return int
*/
/*
- function getLines($id) {
+ function getLines($id)
+ {
if(! DolibarrApiAccess::$user->rights->expensereport->lire) {
throw new RestException(401);
}
@@ -228,7 +230,8 @@ class ExpenseReports extends DolibarrApi
* @return int
*/
/*
- function postLine($id, $request_data = null) {
+ function postLine($id, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401);
}
@@ -290,7 +293,8 @@ class ExpenseReports extends DolibarrApi
* @return object
*/
/*
- function putLine($id, $lineid, $request_data = null) {
+ function putLine($id, $lineid, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401);
}
@@ -348,7 +352,8 @@ class ExpenseReports extends DolibarrApi
* @return int
*/
/*
- function deleteLine($id, $lineid) {
+ function deleteLine($id, $lineid)
+ {
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401);
}
@@ -380,7 +385,8 @@ class ExpenseReports extends DolibarrApi
*
* @return int
*/
- function put($id, $request_data = null) {
+ function put($id, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->expensereport->creer) {
throw new RestException(401);
}
@@ -490,7 +496,8 @@ class ExpenseReports extends DolibarrApi
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
- function _cleanObjectDatas($object) {
+ function _cleanObjectDatas($object)
+ {
$object = parent::_cleanObjectDatas($object);
diff --git a/htdocs/fichinter/class/api_interventions.class.php b/htdocs/fichinter/class/api_interventions.class.php
index 8b21b534856..7701af5fe91 100644
--- a/htdocs/fichinter/class/api_interventions.class.php
+++ b/htdocs/fichinter/class/api_interventions.class.php
@@ -35,7 +35,7 @@ class Interventions extends DolibarrApi
static $FIELDS = array(
'socid',
'fk_project',
- 'description'
+ 'description',
);
/**
@@ -44,7 +44,7 @@ class Interventions extends DolibarrApi
static $FIELDSLINE = array(
'description',
'date',
- 'duree'
+ 'duree',
);
/**
@@ -106,7 +106,8 @@ class Interventions extends DolibarrApi
*
* @throws RestException
*/
- function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '') {
+ function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids = '', $sqlfilters = '')
+ {
global $db, $conf;
$obj_ret = array();
@@ -217,7 +218,8 @@ class Interventions extends DolibarrApi
* @return int
*/
/* TODO
- function getLines($id) {
+ function getLines($id)
+ {
if(! DolibarrApiAccess::$user->rights->ficheinter->lire) {
throw new RestException(401);
}
@@ -424,7 +426,8 @@ class Interventions extends DolibarrApi
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
- function _cleanObjectDatas($object) {
+ function _cleanObjectDatas($object)
+ {
$object = parent::_cleanObjectDatas($object);
diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php
index a30a8b302ac..cb2759f6895 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -279,6 +279,7 @@ class Fichinter extends CommonObject
*/
function update($user, $notrigger=0)
{
+ global $conf;
if (! is_numeric($this->duration)) {
$this->duration = 0;
}
diff --git a/htdocs/fourn/class/api_supplier_invoices.class.php b/htdocs/fourn/class/api_supplier_invoices.class.php
index 68bb902b8fb..3b3ac43c496 100644
--- a/htdocs/fourn/class/api_supplier_invoices.class.php
+++ b/htdocs/fourn/class/api_supplier_invoices.class.php
@@ -33,7 +33,7 @@ class SupplierInvoices extends DolibarrApi
* @var array $FIELDS Mandatory fields, checked when create and update object
*/
static $FIELDS = array(
- 'socid'
+ 'socid',
);
/**
@@ -96,7 +96,8 @@ class SupplierInvoices extends DolibarrApi
*
* @throws RestException
*/
- function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '') {
+ function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '')
+ {
global $db, $conf;
$obj_ret = array();
@@ -152,8 +153,7 @@ class SupplierInvoices extends DolibarrApi
}
$result = $db->query($sql);
- if ($result)
- {
+ if ($result) {
$i = 0;
$num = $db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit));
@@ -170,10 +170,10 @@ class SupplierInvoices extends DolibarrApi
else {
throw new RestException(503, 'Error when retrieve supplier invoice list : '.$db->lasterror());
}
- if( ! count($obj_ret)) {
+ if ( ! count($obj_ret)) {
throw new RestException(404, 'No supplier invoice found');
}
- return $obj_ret;
+ return $obj_ret;
}
/**
@@ -332,7 +332,8 @@ class SupplierInvoices extends DolibarrApi
* @param Object $object Object to clean
* @return array Array of cleaned object properties
*/
- function _cleanObjectDatas($object) {
+ function _cleanObjectDatas($object)
+ {
$object = parent::_cleanObjectDatas($object);
diff --git a/htdocs/fourn/class/api_supplier_orders.class.php b/htdocs/fourn/class/api_supplier_orders.class.php
index d9596bf3958..ac5c825856c 100644
--- a/htdocs/fourn/class/api_supplier_orders.class.php
+++ b/htdocs/fourn/class/api_supplier_orders.class.php
@@ -46,8 +46,8 @@ class SupplierOrders extends DolibarrApi
*/
function __construct()
{
- global $db, $conf;
- $this->db = $db;
+ global $db, $conf;
+ $this->db = $db;
$this->order = new CommandeFournisseur($this->db);
}
@@ -68,11 +68,11 @@ class SupplierOrders extends DolibarrApi
}
$result = $this->order->fetch($id);
- if( ! $result ) {
+ if ( ! $result ) {
throw new RestException(404, 'Supplier order not found');
}
- if( ! DolibarrApi::_checkAccessToResource('fournisseur',$this->order->id,'','commande')) {
+ if ( ! DolibarrApi::_checkAccessToResource('fournisseur',$this->order->id,'','commande')) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
@@ -96,7 +96,8 @@ class SupplierOrders extends DolibarrApi
*
* @throws RestException
*/
- function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '') {
+ function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $thirdparty_ids='', $status='', $sqlfilters = '')
+ {
global $db, $conf;
$obj_ret = array();
@@ -336,7 +337,8 @@ class SupplierOrders extends DolibarrApi
* @param Object $object Object to clean
* @return array Array of cleaned object properties
*/
- function _cleanObjectDatas($object) {
+ function _cleanObjectDatas($object)
+ {
$object = parent::_cleanObjectDatas($object);
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index 51a547fb940..7dec3c42470 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -986,7 +986,8 @@ class Holiday extends CommonObject
* @param string $htmlname Name of HTML select field
* @return string Show select of status
*/
- function selectStatutCP($selected='', $htmlname='select_statut') {
+ function selectStatutCP($selected='', $htmlname='select_statut')
+ {
global $langs;
@@ -1020,7 +1021,8 @@ class Holiday extends CommonObject
* @param string $value vrai si mise à jour OK sinon faux
* @return boolean ok or ko
*/
- function updateConfCP($name,$value) {
+ function updateConfCP($name,$value)
+ {
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
$sql.= " value = '".$value."'";
@@ -1248,7 +1250,8 @@ class Holiday extends CommonObject
* @param string $name name du paramètre de configuration
* @return string retourne checked si > 0
*/
- function getCheckOption($name) {
+ function getCheckOption($name)
+ {
$sql = "SELECT value";
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_config";
@@ -1309,7 +1312,8 @@ class Holiday extends CommonObject
* @param int $user_id ID de l'utilisateur à supprimer
* @return boolean Vrai si pas d'erreur, faut si Erreur
*/
- function deleteCPuser($user_id) {
+ function deleteCPuser($user_id)
+ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."holiday_users";
$sql.= " WHERE fk_user = '".$user_id."'";
@@ -1634,7 +1638,8 @@ class Holiday extends CommonObject
*
* @return int retourne le nombre d'utilisateur
*/
- function countActiveUsersWithoutCP() {
+ function countActiveUsersWithoutCP()
+ {
$sql = "SELECT count(u.rowid) as compteur";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u LEFT OUTER JOIN ".MAIN_DB_PREFIX."holiday_users hu ON (hu.fk_user=u.rowid)";
diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php
index bb7143f8dc6..2d9b27b7b12 100644
--- a/htdocs/imports/class/import.class.php
+++ b/htdocs/imports/class/import.class.php
@@ -44,7 +44,11 @@ class Import
var $array_import_run_sql_after;
var $error;
- var $errors;
+
+ /**
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array();
/**
diff --git a/htdocs/imports/emptyexample.php b/htdocs/imports/emptyexample.php
index ffb270a6306..f11ad902de6 100644
--- a/htdocs/imports/emptyexample.php
+++ b/htdocs/imports/emptyexample.php
@@ -22,9 +22,15 @@
*/
// This file is a wrapper, so empty header
-function llxHeader() { print 'Build an import example file'; }
+function llxHeader()
+{
+ print 'Build an import example file';
+}
// This file is a wrapper, so empty footer
-function llxFooter() { print ''; }
+function llxFooter()
+{
+ print '';
+}
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -86,4 +92,3 @@ foreach($fieldstarget as $code=>$label)
//var_dump($contentlinevalues);
print $objimport->build_example_file($format,$headerlinefields,$contentlinevalues,$datatoimport);
-
diff --git a/htdocs/index.php b/htdocs/index.php
index 902ea6882a6..df1c18176e7 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -565,6 +565,10 @@ if (! empty($valid_dashboardlines))
$sep=($conf->dol_use_jmobile?' ':' ');
$boxwork .= ''.$board->img.' '.$board->label.' ';
$boxwork .= ''.$board->nbtodo.'';
+ if ($board->total > 0 && ! empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX))
+ {
+ $boxwork .= ' / '.price($board->total) .'';
+ }
$boxwork .= '';
if ($board->nbtodolate > 0)
{
diff --git a/htdocs/install/doctemplates/projects/template_project.odt b/htdocs/install/doctemplates/projects/template_project.odt
index fca796a26dd..b6fd0349ea4 100644
Binary files a/htdocs/install/doctemplates/projects/template_project.odt and b/htdocs/install/doctemplates/projects/template_project.odt differ
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 41554cfd45d..16ca7cc7201 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -477,6 +477,8 @@ davDescription=Add a component to be a DAV server
DAVSetup=Setup of module DAV
DAV_ALLOW_PUBLIC_DIR=Enable the public directory (WebDav directory with no login required)
DAV_ALLOW_PUBLIC_DIRTooltip=The WebDav public directory is a WebDAV directory everybody can access to (in read and write mode), with no need to have/use an existing login/password account.
+DAV_ALLOW_ECM_DIR=Enable the root directy of DMS/ECM module (login required)
+DAV_ALLOW_ECM_DIRTooltip=The root directory where all files are manually uploaded when using the DMS/ECM module. Like for the feature from the web interface, you will need a valid login/password with granted permissions to access it.
# Modules
Module0Name=Users & Groups
Module0Desc=Users / Employees and Groups management
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index 8a720bd422b..6e4de1188a6 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -5,10 +5,10 @@ SelectThirdParty=Select a third party
ConfirmDeleteCompany=Are you sure you want to delete this company and all inherited information?
DeleteContact=Delete a contact/address
ConfirmDeleteContact=Are you sure you want to delete this contact and all inherited information?
-MenuNewThirdParty=new Third Party
-MenuNewCustomer=new Customer
-MenuNewProspect=new Prospect
-MenuNewSupplier=new Vendor
+MenuNewThirdParty=New Third Party
+MenuNewCustomer=New Customer
+MenuNewProspect=Nnew Prospect
+MenuNewSupplier=New Vendor
MenuNewPrivateIndividual=New private individual
NewCompany=New company (prospect, customer, vendor)
NewThirdParty=New Third Party (prospect, customer, vendor)
@@ -333,7 +333,7 @@ NoContactForAnyProposal=This contact is not a contact for any commercial proposa
NoContactForAnyContract=This contact is not a contact for any contract
NoContactForAnyInvoice=This contact is not a contact for any invoice
NewContact=New contact
-NewContactAddress=new Contact/Address
+NewContactAddress=New Contact/Address
MyContacts=My contacts
Capital=Capital
CapitalOf=Capital of %s
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 5b5382480a1..cf88cf65cc9 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -209,6 +209,7 @@ ErrorFileNotFoundWithSharedLink=File was not found. May be the share key was mod
ErrorProductBarCodeAlreadyExists=The product barcode %s already exists on another product reference.
ErrorNoteAlsoThatSubProductCantBeFollowedByLot=Note also that using virtual product to have auto increase/decrease of subproducts is not possible when at least one subproduct (or subproduct of subproducts) needs a serial/lot number.
ErrorDescRequiredForFreeProductLines=Description is mandatory for lines with free product
+ErrorAPageWithThisNameOrAliasAlreadyExists=The page/container %s has the same name or alternative alias that the one your try to use
# Warnings
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.
@@ -231,4 +232,4 @@ WarningSomeLinesWithNullHourlyRate=Some times were recorded by some users while
WarningYourLoginWasModifiedPleaseLogin=Your login was modified. For security purpose you will have to login with your new login before next action.
WarningAnEntryAlreadyExistForTransKey=An entry already exists for the translation key for this language
WarningNumberOfRecipientIsRestrictedInMassAction=Warning, number of different recipient is limited to %s when using the mass actions on lists
-WarningDateOfLineMustBeInExpenseReportRange=Warning, the date of line is not in the range of the expense report
\ No newline at end of file
+WarningDateOfLineMustBeInExpenseReportRange=Warning, the date of line is not in the range of the expense report
diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index 9ab397f190c..c87bac6bab1 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -168,8 +168,9 @@ TypeContact_project_task_external_TASKCONTRIBUTOR=Contributor
SelectElement=Select element
AddElement=Link to element
# Documents models
-DocumentModelBeluga=Project template for linked objects overview
-DocumentModelBaleine=Project report template for tasks
+DocumentModelBeluga=Project document template for linked objects overview
+DocumentModelBaleine=Project document template for tasks
+DocumentModelTimeSpent=Project report template for time spent
PlannedWorkload=Planned workload
PlannedWorkloadShort=Workload
ProjectReferers=Related items
@@ -229,3 +230,4 @@ DontHavePermissionForCloseProject=You do not have permissions to close the proje
DontHaveTheValidateStatus=The project %s must be open to be closed
RecordsClosed=%s project(s) closed
SendProjectRef=Information project %s
+ModuleSalaryToDefineHourlyRateMustBeEnabled=Module 'Payment of employee wages' must be enabled to define employee hourly rate to have time spent valorized
diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang
index fe3a4b7cf92..ef2b70b685a 100644
--- a/htdocs/langs/en_US/website.lang
+++ b/htdocs/langs/en_US/website.lang
@@ -47,6 +47,7 @@ PreviewSiteServedByWebServer=Preview %s in a new tab.
The %s will
PreviewSiteServedByDolibarr=Preview %s in a new tab.
The %s will be served by Dolibarr server so it does not need any extra web server (like Apache, Nginx, IIS) to be installed. The inconvenient is that URL of pages are not user friendly and start with path of your Dolibarr. URL served by Dolibarr: %s
To use your own external web server to serve this web site, create a virtual host on your web server that point on directory %s then enter the name of this virtual server and click on the other preview button.
VirtualHostUrlNotDefined=URL of the virtual host served by external web server not defined
NoPageYet=No pages yet
+YouCanCreatePageOrImportTemplate=You can create a new page or import a full website template
SyntaxHelp=Help on specific syntax tips
YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor.
YouCanEditHtmlSource= You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $langs, $db, $mysoc, $user, $website.
You can also include content of another Page/Container with the following syntax: <?php includeContainer('alias_of_container_to_include'); ?>
You can make a redirect to another Page/Container with the following syntax: <?php redirectToContainer('alias_of_container_to_redirect_to'); ?>
To include a link to download a file stored into the documents directory, use the document.php wrapper: Example, for a file into documents/ecm (need to be logged), syntax is: <a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext"> For a file into documents/medias (open directory for public access), syntax is: <a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext"> For a file shared with a share link (open access using the sharing hash key of file), syntax is: <a href="/document.php?hashp=publicsharekeyoffile">
To include an image stored into the documents directory, use the viewimage.php wrapper: Example, for an image into documents/medias (open access), syntax is: <a href="/viewimage.php?modulepart=medias&file=[relative_dir/]filename.ext">
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index acb04734234..26dcb94a0ba 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1170,12 +1170,15 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
$ext='layout='.$conf->browser->layout.'&version='.urlencode(DOL_VERSION);
print "\n";
+
if (GETPOST('dol_basehref','alpha')) print ''."\n";
+
// Displays meta
print ''."\n";
print ''."\n"; // Do not index
print ''."\n"; // Scale for mobile device
print ''."\n";
+
// Favicon
$favicon=dol_buildpath('/theme/'.$conf->theme.'/img/favicon.ico',1);
if (! empty($conf->global->MAIN_FAVICON_URL)) $favicon=$conf->global->MAIN_FAVICON_URL;
@@ -1184,6 +1187,9 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n";
//if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) print ''."\n";
+ // Auto refresh page
+ if (GETPOST('autorefresh','int') > 0) print '';
+
// Displays title
$appli=constant('DOL_APPLICATION_TITLE');
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE;
diff --git a/htdocs/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php
index b4abf60861e..1aa164bd33c 100644
--- a/htdocs/modulebuilder/template/class/api_mymodule.class.php
+++ b/htdocs/modulebuilder/template/class/api_mymodule.class.php
@@ -41,7 +41,7 @@ class MyModuleApi extends DolibarrApi
* @var array $FIELDS Mandatory fields, checked when create and update object
*/
static $FIELDS = array(
- 'name'
+ 'name',
);
@@ -109,7 +109,8 @@ class MyModuleApi extends DolibarrApi
*
* @url GET /myobjects/
*/
- function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '') {
+ function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $sqlfilters = '')
+ {
global $db, $conf;
$obj_ret = array();
@@ -127,7 +128,7 @@ class MyModuleApi extends DolibarrApi
$sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st";
$sql.= " WHERE s.fk_stcomm = st.id";
- // Example of use $mode
+ // Example of use $mode
//if ($mode == 1) $sql.= " AND s.client IN (1, 3)";
//if ($mode == 2) $sql.= " AND s.client IN (2, 3)";
@@ -195,8 +196,8 @@ class MyModuleApi extends DolibarrApi
function post($request_data = null)
{
if(! DolibarrApiAccess::$user->rights->myobject->create) {
- throw new RestException(401);
- }
+ throw new RestException(401);
+ }
// Check mandatory fields
$result = $this->_validate($request_data);
@@ -221,8 +222,8 @@ class MyModuleApi extends DolibarrApi
function put($id, $request_data = null)
{
if(! DolibarrApiAccess::$user->rights->myobject->create) {
- throw new RestException(401);
- }
+ throw new RestException(401);
+ }
$result = $this->myobject->fetch($id);
if( ! $result ) {
@@ -261,9 +262,9 @@ class MyModuleApi extends DolibarrApi
throw new RestException(404, 'MyObject not found');
}
- if( ! DolibarrApi::_checkAccessToResource('myobject',$this->myobject->id)) {
- throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
- }
+ if( ! DolibarrApi::_checkAccessToResource('myobject',$this->myobject->id)) {
+ throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
+ }
if( !$this->myobject->delete($id))
{
diff --git a/htdocs/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php
index 46b56a2600f..926fb20098b 100644
--- a/htdocs/multicurrency/class/multicurrency.class.php
+++ b/htdocs/multicurrency/class/multicurrency.class.php
@@ -412,16 +412,15 @@ class MultiCurrency extends CommonObject
$this->rate = null;
return -1;
}
- }
+ }
- /**
- * Try get label of code in llx_currency then add rate
- *
- * @param string $code currency code
- * @param double $rate new rate
- *
- * @return int -1 if KO, 1 if OK, 2 if label found and OK
- */
+ /**
+ * Try get label of code in llx_currency then add rate
+ *
+ * @param string $code currency code
+ * @param double $rate new rate
+ * @return int -1 if KO, 1 if OK, 2 if label found and OK
+ */
function addRateFromDolibarr($code, $rate)
{
global $db, $user;
@@ -539,62 +538,62 @@ class MultiCurrency extends CommonObject
return array(0, 1);
}
- }
+ }
- /**
- * Get the conversion of amount with invoice rate
- *
- * @param int $fk_facture id of facture
- * @param double $amount amount to convert
- * @param string $way dolibarr mean the amount is in dolibarr currency
- * @param string $table facture or facture_fourn
- *
- * @return double amount converted
- */
- public static function getAmountConversionFromInvoiceRate($fk_facture, $amount, $way='dolibarr', $table='facture')
- {
- global $db;
+ /**
+ * Get the conversion of amount with invoice rate
+ *
+ * @param int $fk_facture id of facture
+ * @param double $amount amount to convert
+ * @param string $way dolibarr mean the amount is in dolibarr currency
+ * @param string $table facture or facture_fourn
+ * @return double amount converted
+ */
+ public static function getAmountConversionFromInvoiceRate($fk_facture, $amount, $way='dolibarr', $table='facture')
+ {
+ global $db;
- $multicurrency_tx = self::getInvoiceRate($fk_facture, $table);
+ $multicurrency_tx = self::getInvoiceRate($fk_facture, $table);
- if ($multicurrency_tx)
- {
+ if ($multicurrency_tx)
+ {
if ($way == 'dolibarr') return $amount * $multicurrency_tx;
else return $amount / $multicurrency_tx;
- }
- else return $amount;
- }
+ }
+ else return $amount;
+ }
- /**
- * Get current invoite rate
- *
- * @param int $fk_facture id of facture
- * @param string $table facture or facture_fourn
+ /**
+ * Get current invoite rate
+ *
+ * @param int $fk_facture id of facture
+ * @param string $table facture or facture_fourn
* @return bool
- */
- public static function getInvoiceRate($fk_facture, $table='facture')
- {
- global $db;
+ */
+ public static function getInvoiceRate($fk_facture, $table='facture')
+ {
+ global $db;
- $sql = 'SELECT multicurrency_tx FROM '.MAIN_DB_PREFIX.$table.' WHERE rowid = '.$fk_facture;
+ $sql = 'SELECT multicurrency_tx FROM '.MAIN_DB_PREFIX.$table.' WHERE rowid = '.$fk_facture;
- dol_syslog(__METHOD__,LOG_DEBUG);
- $resql = $db->query($sql);
- if ($resql && ($line = $db->fetch_object($resql)))
- {
+ dol_syslog(__METHOD__,LOG_DEBUG);
+ $resql = $db->query($sql);
+ if ($resql && ($line = $db->fetch_object($resql)))
+ {
return $line->multicurrency_tx;
- }
+ }
+
+ return false;
+ }
- return false;
- }
/**
* With free account we can't set source then recalcul all rates to force another source
*
- * @param stdClass $TRate Object containing all currencies rates
+ * @param stdClass $TRate Object containing all currencies rates
* @return -1 if KO, 0 if nothing, 1 if OK
*/
- public static function recalculRates(&$TRate)
+ public static function recalculRates(&$TRate)
{
global $conf;
diff --git a/htdocs/opensurvey/fonctions.php b/htdocs/opensurvey/fonctions.php
index d2f401813a0..6cd05444445 100644
--- a/htdocs/opensurvey/fonctions.php
+++ b/htdocs/opensurvey/fonctions.php
@@ -29,7 +29,8 @@
* @param Opensurveysondage $object Current viewing poll
* @return array Tabs for the opensurvey section
*/
-function opensurvey_prepare_head(Opensurveysondage $object) {
+function opensurvey_prepare_head(Opensurveysondage $object)
+{
global $langs, $conf;
diff --git a/htdocs/product/admin/price_rules.php b/htdocs/product/admin/price_rules.php
index 3c6bf5abe8a..e0faaaf83e5 100644
--- a/htdocs/product/admin/price_rules.php
+++ b/htdocs/product/admin/price_rules.php
@@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
- *
+ *
* Page to set how to autocalculate price for each level when option
* PRODUCT_MULTIPRICE is on.
*/
@@ -145,7 +145,7 @@ for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
$price_options[$i] = $langs->trans('SellingPrice').' '.$i;
}
-$genPriceOptions = function($level) use ($price_options) {
+$genPriceOptions = function ($level) use ($price_options) {
$return = array();
@@ -190,14 +190,14 @@ $genPriceOptions = function($level) use ($price_options) {
-
';
-
+
print '';
// End of page
diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php
index 8ba4eaaecc8..ce6928c7331 100644
--- a/htdocs/product/class/api_products.class.php
+++ b/htdocs/product/class/api_products.class.php
@@ -102,7 +102,8 @@ class Products extends DolibarrApi
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.tobuy:=:0) and (t.tosell:=:1)"
* @return array Array of product objects
*/
- function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode=0, $category=0, $sqlfilters = '') {
+ function index($sortfield = "t.ref", $sortorder = 'ASC', $limit = 100, $page = 0, $mode=0, $category=0, $sqlfilters = '')
+ {
global $db, $conf;
$obj_ret = array();
@@ -340,7 +341,7 @@ class Products extends DolibarrApi
}
if ($result < 0) {
- throw new RestException(503, 'Error when retrieve category list : '.array_merge(array($categories->error), $categories->errors));
+ throw new RestException(503, 'Error when retrieve category list : '.array_merge(array($categories->error), $categories->errors));
}
return $result;
@@ -467,7 +468,8 @@ class Products extends DolibarrApi
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
- function _cleanObjectDatas($object) {
+ function _cleanObjectDatas($object)
+ {
$object = parent::_cleanObjectDatas($object);
diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php
index 1bbfb8f7aa5..14eebdffc94 100644
--- a/htdocs/product/class/html.formproduct.class.php
+++ b/htdocs/product/class/html.formproduct.class.php
@@ -168,7 +168,8 @@ class FormProduct
* @return String full label with all parents, separated by ' >> '
*/
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
- private function get_parent_path($tab, $final_label='') {
+ private function get_parent_path($tab, $final_label='')
+ {
if(empty($final_label)) $final_label = $tab['label'];
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 3724abbf5d8..091cfa722ed 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -4551,7 +4551,8 @@ class Product extends CommonObject
* @param int[]|int $categories Category or categories IDs
* @return void
*/
- public function setCategories($categories) {
+ public function setCategories($categories)
+ {
// Handle single category
if (! is_array($categories)) {
$categories = array($categories);
diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php
index e1eddde724d..9a53d495a4e 100644
--- a/htdocs/product/class/productcustomerprice.class.php
+++ b/htdocs/product/class/productcustomerprice.class.php
@@ -54,7 +54,8 @@ class Productcustomerprice extends CommonObject
*
* @param DoliDb $db handler
*/
- function __construct($db) {
+ function __construct($db)
+ {
$this->db = $db;
return 1;
@@ -68,7 +69,8 @@ class Productcustomerprice extends CommonObject
* @param int $forceupdateaffiliate update price on each soc child
* @return int <0 if KO, Id of created object if OK
*/
- function create($user, $notrigger = 0, $forceupdateaffiliate = 0) {
+ function create($user, $notrigger = 0, $forceupdateaffiliate = 0)
+ {
global $conf, $langs;
$error = 0;
@@ -524,7 +526,8 @@ class Productcustomerprice extends CommonObject
* @param int $forceupdateaffiliate update price on each soc child
* @return int <0 if KO, >0 if OK
*/
- function update($user = 0, $notrigger = 0, $forceupdateaffiliate = 0) {
+ function update($user = 0, $notrigger = 0, $forceupdateaffiliate = 0)
+ {
global $conf, $langs;
$error = 0;
@@ -721,7 +724,8 @@ class Productcustomerprice extends CommonObject
* @param int $forceupdateaffiliate update price on each soc child
* @return int <0 if KO, >0 if OK
*/
- function setPriceOnAffiliateThirdparty($user, $forceupdateaffiliate) {
+ function setPriceOnAffiliateThirdparty($user, $forceupdateaffiliate)
+ {
$error = 0;
@@ -813,7 +817,8 @@ class Productcustomerprice extends CommonObject
* @param int $notrigger triggers after, 1=disable triggers
* @return int <0 if KO, >0 if OK
*/
- function delete($user, $notrigger = 0) {
+ function delete($user, $notrigger = 0)
+ {
global $conf, $langs;
$error = 0;
@@ -866,7 +871,8 @@ class Productcustomerprice extends CommonObject
* @param int $fromid of object to clone
* @return int id of clone
*/
- function createFromClone($fromid) {
+ function createFromClone($fromid)
+ {
global $user, $langs;
@@ -916,7 +922,8 @@ class Productcustomerprice extends CommonObject
*
* @return void
*/
- function initAsSpecimen() {
+ function initAsSpecimen()
+ {
$this->id = 0;
diff --git a/htdocs/product/class/propalmergepdfproduct.class.php b/htdocs/product/class/propalmergepdfproduct.class.php
index c82cbf279aa..15555a347d2 100644
--- a/htdocs/product/class/propalmergepdfproduct.class.php
+++ b/htdocs/product/class/propalmergepdfproduct.class.php
@@ -647,7 +647,8 @@ class PropalmergepdfproductLine
var $tms='';
var $import_key;
- function __construct() {
- return 1;
- }
+ function __construct()
+ {
+ return 1;
+ }
}
diff --git a/htdocs/product/dynamic_price/class/price_expression.class.php b/htdocs/product/dynamic_price/class/price_expression.class.php
index b3f47b4a224..6a655772810 100644
--- a/htdocs/product/dynamic_price/class/price_expression.class.php
+++ b/htdocs/product/dynamic_price/class/price_expression.class.php
@@ -31,7 +31,12 @@ class PriceExpression
{
var $db; //!< To store db handler
var $error; //!< To return error code (or message)
- var $errors=array(); //!< To return several error codes (or messages)
+
+ /**
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array();
+
var $id;
var $title;
var $expression;
diff --git a/htdocs/product/dynamic_price/class/price_global_variable.class.php b/htdocs/product/dynamic_price/class/price_global_variable.class.php
index 97a3ee1f4e6..1432afcfdeb 100644
--- a/htdocs/product/dynamic_price/class/price_global_variable.class.php
+++ b/htdocs/product/dynamic_price/class/price_global_variable.class.php
@@ -31,7 +31,12 @@ class PriceGlobalVariable
{
var $db; //!< To store db handler
var $error; //!< To return error code (or message)
- var $errors=array(); //!< To return several error codes (or messages)
+ /**
+ *
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array ();
+
var $id;
var $code;
var $description;
diff --git a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php
index d68c7e5318c..964702f8737 100644
--- a/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php
+++ b/htdocs/product/dynamic_price/class/price_global_variable_updater.class.php
@@ -31,7 +31,12 @@ class PriceGlobalVariableUpdater
{
var $db; //!< To store db handler
var $error; //!< To return error code (or message)
- var $errors=array(); //!< To return several error codes (or messages)
+ /**
+ *
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array ();
+
var $types=array(0, 1); //!< Updater types
var $update_min = 5; //!< Minimal update rate
var $id;
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index 593711290d3..9b26eecc426 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -744,22 +744,34 @@ if ($resql)
if (! $i) $totalarray['nbfield']++;
}
- // Duration
- if (! empty($arrayfields['p.duration']['checked']))
- {
- print '