@@ -990,7 +990,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
print '| ';
if (! empty($conf->global->MAIN_MULTILANGS))
{
- $selectedlang = $langs->defaultlang;
+ $selectedlang = GETPOSTISSET('langcode','aZ09')?GETPOST('langcode','aZ09'):$langs->defaultlang;
if ($context == 'edit') $selectedlang = $obj->{$fieldlist[$field]};
print $formadmin->select_language($selectedlang, 'langcode', 0, null, 1, 0, 0, 'maxwidth150');
}
diff --git a/htdocs/api/class/api.class.php b/htdocs/api/class/api.class.php
index c1de096fc7a..a0100abf58d 100644
--- a/htdocs/api/class/api.class.php
+++ b/htdocs/api/class/api.class.php
@@ -94,10 +94,12 @@ class DolibarrApi
* @param object $object Object to clean
* @return array Array of cleaned object properties
*/
- function _cleanObjectDatas($object) {
+ function _cleanObjectDatas($object)
+ {
// Remove $db object property for object
unset($object->db);
+ unset($object->isextrafieldmanaged);
unset($object->ismultientitymanaged);
unset($object->restrictiononfksoc);
@@ -220,7 +222,8 @@ class DolibarrApi
* @return bool
* @throws RestException
*/
- static function _checkAccessToResource($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid') {
+ static function _checkAccessToResource($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')
+ {
// Features/modules to check
$featuresarray = array($resource);
diff --git a/htdocs/api/class/api_login.class.php b/htdocs/api/class/api_login.class.php
index 56808819b3f..797cd2429d5 100644
--- a/htdocs/api/class/api_login.class.php
+++ b/htdocs/api/class/api_login.class.php
@@ -26,7 +26,8 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
class Login
{
- function __construct() {
+ function __construct()
+ {
global $db;
$this->db = $db;
}
@@ -51,7 +52,8 @@ class Login
* @url GET /
* @url POST /
*/
- public function index($login, $password, $entity='', $reset=0) {
+ public function index($login, $password, $entity='', $reset=0)
+ {
global $conf, $dolibarr_main_authentication, $dolibarr_auto_user;
diff --git a/htdocs/api/class/api_status.class.php b/htdocs/api/class/api_status.class.php
index 22f20c0aa34..3ade4ea51b8 100644
--- a/htdocs/api/class/api_status.class.php
+++ b/htdocs/api/class/api_status.class.php
@@ -26,19 +26,21 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/functions.lib.php';
*/
class Status
{
- /**
+ /**
* Get status (Dolibarr version)
+ *
* @return array
- */
- function index() {
- global $conf;
+ */
+ function index()
+ {
+ global $conf;
- return array(
- 'success' => array(
- 'code' => 200,
- 'dolibarr_version' => DOL_VERSION,
- 'access_locked' => (empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)?'0':$conf->global->MAIN_ONLY_LOGIN_ALLOWED)
- )
- );
+ return array(
+ 'success' => array(
+ 'code' => 200,
+ 'dolibarr_version' => DOL_VERSION,
+ 'access_locked' => (empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)?'0':$conf->global->MAIN_ONLY_LOGIN_ALLOWED),
+ ),
+ );
}
}
diff --git a/htdocs/blockedlog/class/authority.class.php b/htdocs/blockedlog/class/authority.class.php
index a1539923117..11bb3aa2d0f 100644
--- a/htdocs/blockedlog/class/authority.class.php
+++ b/htdocs/blockedlog/class/authority.class.php
@@ -50,7 +50,8 @@ class BlockedLogAuthority
*
* @param DoliDB $db Database handler
*/
- public function __construct($db) {
+ public function __construct($db)
+ {
$this->db = $db;
@@ -61,7 +62,8 @@ class BlockedLogAuthority
*
* @return string blockchain
*/
- public function getLocalBlockChain() {
+ public function getLocalBlockChain()
+ {
$block_static = new BlockedLog($this->db);
@@ -84,7 +86,8 @@ class BlockedLogAuthority
*
* @return string hash md5 of blockchain
*/
- public function getBlockchainHash() {
+ public function getBlockchainHash()
+ {
return md5($this->signature.$this->blockchain);
@@ -96,7 +99,8 @@ class BlockedLogAuthority
* @param string $hash hash md5 of blockchain to test
* @return boolean
*/
- public function checkBlockchain($hash) {
+ public function checkBlockchain($hash)
+ {
return ($hash === $this->getBlockchainHash() );
@@ -108,7 +112,8 @@ class BlockedLogAuthority
* @param string $block new block to chain
* @return void
*/
- public function addBlock($block) {
+ public function addBlock($block)
+ {
$this->blockchain.=$block;
@@ -120,7 +125,8 @@ class BlockedLogAuthority
* @param string $block new block to chain
* @return boolean
*/
- public function checkBlock($block) {
+ public function checkBlock($block)
+ {
if(strlen($block)!=64) return false;
@@ -142,7 +148,8 @@ class BlockedLogAuthority
* @param string $signature Signature of object to load
* @return int >0 if OK, <0 if KO, 0 if not found
*/
- public function fetch($id, $signature='') {
+ public function fetch($id, $signature='')
+ {
global $langs;
@@ -199,7 +206,8 @@ class BlockedLogAuthority
* @param User $user Object user that create
* @return int <0 if KO, >0 if OK
*/
- public function create($user) {
+ public function create($user)
+ {
global $conf,$langs,$hookmanager;
@@ -253,7 +261,8 @@ class BlockedLogAuthority
* @param User $user Object user that create
* @return int <0 if KO, >0 if OK
*/
- public function update($user) {
+ public function update($user)
+ {
global $conf,$langs,$hookmanager;
@@ -290,7 +299,8 @@ class BlockedLogAuthority
*
* @return int <0 if KO, >0 if OK
*/
- public function syncSignatureWithAuthority() {
+ public function syncSignatureWithAuthority()
+ {
global $conf, $langs;
//TODO create cron task on activation
@@ -331,4 +341,4 @@ class BlockedLogAuthority
return 1;
}
-}
\ No newline at end of file
+}
diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php
index bada3f2951d..4d7c5e5c3c4 100644
--- a/htdocs/blockedlog/class/blockedlog.class.php
+++ b/htdocs/blockedlog/class/blockedlog.class.php
@@ -608,7 +608,8 @@ class BlockedLog
* @param int $id Id of object to load
* @return int >0 if OK, <0 if KO, 0 if not found
*/
- public function fetch($id) {
+ public function fetch($id)
+ {
global $langs;
@@ -704,7 +705,8 @@ class BlockedLog
*
* @return boolean
*/
- public function setCertified() {
+ public function setCertified()
+ {
$res = $this->db->query("UPDATE ".MAIN_DB_PREFIX."blockedlog SET certified=1 WHERE rowid=".$this->id);
if($res===false) return false;
@@ -721,7 +723,8 @@ class BlockedLog
* @param int $forcesignature Force signature (for example '0000000000' when we disabled the module)
* @return int <0 if KO, >0 if OK
*/
- public function create($user, $forcesignature='') {
+ public function create($user, $forcesignature='')
+ {
global $conf,$langs,$hookmanager;
diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php
index a0e992e9da9..ac26a326962 100644
--- a/htdocs/cashdesk/class/Facturation.class.php
+++ b/htdocs/cashdesk/class/Facturation.class.php
@@ -310,7 +310,7 @@ class Facturation
* @return string Ref
*/
public function ref($aRef=null)
- {
+ {
if (is_null($aRef))
{
@@ -652,7 +652,7 @@ class Facturation
{
return $this->prix_total_ttc;
}
- else if ( $aTotalTtc == 'RESET' )
+ elseif ( $aTotalTtc == 'RESET' )
{
$this->prix_total_ttc = null;
}
@@ -663,4 +663,3 @@ class Facturation
}
}
-
diff --git a/htdocs/categories/class/api_categories.class.php b/htdocs/categories/class/api_categories.class.php
index c559d760f0f..843e2fc0ee6 100644
--- a/htdocs/categories/class/api_categories.class.php
+++ b/htdocs/categories/class/api_categories.class.php
@@ -103,7 +103,8 @@ class Categories extends DolibarrApi
*
* @throws RestException
*/
- function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $sqlfilters = '') {
+ function index($sortfield = "t.rowid", $sortorder = 'ASC', $limit = 100, $page = 0, $type = '', $sqlfilters = '')
+ {
global $db, $conf;
$obj_ret = array();
@@ -266,7 +267,8 @@ class Categories extends DolibarrApi
* @param Categorie $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/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php
index f5d9c7db762..e5818a9f462 100644
--- a/htdocs/comm/action/class/api_agendaevents.class.php
+++ b/htdocs/comm/action/class/api_agendaevents.class.php
@@ -46,8 +46,8 @@ class AgendaEvents extends DolibarrApi
*/
function __construct()
{
- global $db, $conf;
- $this->db = $db;
+ global $db, $conf;
+ $this->db = $db;
$this->actioncomm = new ActionComm($this->db);
}
@@ -99,13 +99,14 @@ class AgendaEvents extends DolibarrApi
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.label:like:'%dol%') and (t.datec:<:'20160101')"
* @return array Array of Agenda Events objects
*/
- function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '') {
+ function index($sortfield = "t.id", $sortorder = 'ASC', $limit = 100, $page = 0, $user_ids = 0, $sqlfilters = '')
+ {
global $db, $conf;
$obj_ret = array();
if (! DolibarrApiAccess::$user->rights->agenda->myactions->read) {
- throw new RestException(401, "Insuffisant rights to read events");
+ throw new RestException(401, "Insuffisant rights to read events");
}
// case of external user
@@ -226,7 +227,8 @@ class AgendaEvents extends DolibarrApi
* @return int
*/
/*
- function put($id, $request_data = null) {
+ function put($id, $request_data = null)
+ {
if (! DolibarrApiAccess::$user->rights->agenda->myactions->create) {
throw new RestException(401, "Insuffisant rights to create your Agenda Event");
}
@@ -319,7 +321,8 @@ class AgendaEvents 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/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php
index d8496a9a4ff..22b7b6fa26c 100644
--- a/htdocs/comm/action/class/cactioncomm.class.php
+++ b/htdocs/comm/action/class/cactioncomm.class.php
@@ -28,7 +28,11 @@
*/
class CActionComm
{
- var $error;
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
+
var $db;
var $id;
diff --git a/htdocs/comm/mailing/class/advtargetemailing.class.php b/htdocs/comm/mailing/class/advtargetemailing.class.php
index 50d9faf0637..9ef7ba75a9f 100644
--- a/htdocs/comm/mailing/class/advtargetemailing.class.php
+++ b/htdocs/comm/mailing/class/advtargetemailing.class.php
@@ -30,8 +30,17 @@ class AdvanceTargetingMailing extends CommonObject
{
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 code (or message)
+ */
+ public $error='';
+
+
+ /**
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array();
+
var $element='advtargetemailing'; //!< Id that identify managed objects
var $table_element='advtargetemailing'; //!< Name of table without prefix where object is stored
@@ -916,7 +925,8 @@ class AdvanceTargetingMailing extends CommonObject
* For exemple jean;joe;jim%%;!jimo;!jima%> will target all jean, joe, start with jim but not jimo and not everythnig taht start by jima
* @return string Sql to use for the where condition
*/
- public function transformToSQL($column_to_test,$criteria) {
+ public function transformToSQL($column_to_test,$criteria)
+ {
$return_sql_criteria = '(';
//This is a multiple value test
diff --git a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
index 7408bb27d37..76054a95879 100644
--- a/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
+++ b/htdocs/comm/mailing/class/html.formadvtargetemailing.class.php
@@ -27,14 +27,18 @@
class FormAdvTargetEmailing extends Form
{
var $db;
- var $error;
+ /**
+ * @var string Error code (or message)
+ */
+ public $error='';
/**
* Constructor
*
* @param DoliDB $db handler
*/
- function __construct($db) {
+ function __construct($db)
+ {
global $langs;
$this->db = $db;
@@ -47,7 +51,8 @@ class FormAdvTargetEmailing extends Form
* @param string $htmlname select field
* @return string select field
*/
- function multiselectProspectionStatus($selected_array = array(), $htmlname = 'cust_prospect_status') {
+ function multiselectProspectionStatus($selected_array = array(), $htmlname = 'cust_prospect_status')
+ {
global $conf, $langs;
$options_array = array();
@@ -83,7 +88,8 @@ class FormAdvTargetEmailing extends Form
* @param array $selected_array or Code or Label of preselected country
* @return string HTML string with select
*/
- function multiselectCountry($htmlname = 'country_id', $selected_array=array()) {
+ function multiselectCountry($htmlname = 'country_id', $selected_array=array())
+ {
global $conf, $langs;
$langs->load("dict");
@@ -143,7 +149,8 @@ class FormAdvTargetEmailing extends Form
* @param User $user User action
* @return string combo list code
*/
- function multiselectselectSalesRepresentatives($htmlname, $selected_array, $user) {
+ function multiselectselectSalesRepresentatives($htmlname, $selected_array, $user)
+ {
global $conf;
@@ -184,7 +191,8 @@ class FormAdvTargetEmailing extends Form
* @param array $selected_array selected array
* @return string combo list code
*/
- function multiselectselectLanguage($htmlname='', $selected_array=array()) {
+ function multiselectselectLanguage($htmlname='', $selected_array=array())
+ {
global $conf,$langs;
@@ -330,7 +338,8 @@ class FormAdvTargetEmailing extends Form
* @param int $showempty show empty
* @return string HTML combo
*/
- function advMultiselectarray($htmlname, $options_array = array(), $selected_array = array(), $showempty = 0) {
+ function advMultiselectarray($htmlname, $options_array = array(), $selected_array = array(), $showempty = 0)
+ {
global $conf, $langs;
$form=new Form($this->db);
@@ -417,7 +426,8 @@ class FormAdvTargetEmailing extends Form
* @param string $type_element Type element. Example: 'mailing'
* @return string HTML combo
*/
- public function selectAdvtargetemailingTemplate($htmlname='template_id', $selected=0, $showempty=0, $type_element='mailing') {
+ public function selectAdvtargetemailingTemplate($htmlname='template_id', $selected=0, $showempty=0, $type_element='mailing')
+ {
global $conf, $user, $langs;
$out = '';
@@ -460,4 +470,4 @@ class FormAdvTargetEmailing extends Form
$this->db->free ( $resql );
return $out;
}
-}
\ No newline at end of file
+}
diff --git a/htdocs/comm/propal/class/api_proposals.class.php b/htdocs/comm/propal/class/api_proposals.class.php
index 39857d88365..0313add9cae 100644
--- a/htdocs/comm/propal/class/api_proposals.class.php
+++ b/htdocs/comm/propal/class/api_proposals.class.php
@@ -97,7 +97,8 @@ class Proposals extends DolibarrApi
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.datec:<:'20160101')"
* @return array Array of order objects
*/
- 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();
@@ -215,7 +216,8 @@ class Proposals extends DolibarrApi
*
* @return int
*/
- function getLines($id) {
+ function getLines($id)
+ {
if(! DolibarrApiAccess::$user->rights->propal->lire) {
throw new RestException(401);
}
@@ -381,7 +383,8 @@ class Proposals extends DolibarrApi
* @throws 401
* @throws 404
*/
- function deleteLine($id, $lineid) {
+ function deleteLine($id, $lineid)
+ {
if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401);
}
@@ -415,7 +418,8 @@ class Proposals extends DolibarrApi
*
* @return int
*/
- function put($id, $request_data = null) {
+ function put($id, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->propal->creer) {
throw new RestException(401);
}
@@ -703,23 +707,24 @@ class Proposals extends DolibarrApi
}
- /**
- * Clean sensible object datas
- *
- * @param object $object Object to clean
- * @return array Array of cleaned object properties
- */
- function _cleanObjectDatas($object) {
+ /**
+ * Clean sensible object datas
+ *
+ * @param object $object Object to clean
+ * @return array Array of cleaned object properties
+ */
+ function _cleanObjectDatas($object)
+ {
- $object = parent::_cleanObjectDatas($object);
+ $object = parent::_cleanObjectDatas($object);
- unset($object->note);
- unset($object->name);
- unset($object->lastname);
- unset($object->firstname);
- unset($object->civility_id);
- unset($object->address);
+ unset($object->note);
+ unset($object->name);
+ unset($object->lastname);
+ unset($object->firstname);
+ unset($object->civility_id);
+ unset($object->address);
- return $object;
- }
+ return $object;
+ }
}
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 12fe76a522a..848ac60d822 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -1337,10 +1337,10 @@ class Propal extends CommonObject
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON p.fk_incoterms = i.rowid';
if ($ref) {
- $sql.= " AND p.entity IN (".getEntity('propal').")"; // Dont't use entity if you use rowid
+ $sql.= " WHERE p.entity IN (".getEntity('propal').")"; // Dont't use entity if you use rowid
$sql.= " AND p.ref='".$this->db->escape($ref)."'";
}
- else $sql.= " AND p.rowid=".$rowid;
+ else $sql.= " WHERE p.rowid=".$rowid;
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
$resql=$this->db->query($sql);
@@ -3144,7 +3144,7 @@ class Propal extends CommonObject
$clause = " WHERE";
- $sql = "SELECT p.rowid, p.ref, p.datec as datec, p.fin_validite as datefin";
+ $sql = "SELECT p.rowid, p.ref, p.datec as datec, p.fin_validite as datefin, p.total_ht";
$sql.= " FROM ".MAIN_DB_PREFIX."propal as p";
if (!$user->rights->societe->client->voir && !$user->societe_id)
{
@@ -3188,6 +3188,8 @@ class Propal extends CommonObject
while ($obj=$this->db->fetch_object($resql))
{
$response->nbtodo++;
+ $response->total+=$obj->total_ht;
+
if ($mode == 'opened')
{
$datelimit = $this->db->jdate($obj->datefin);
diff --git a/htdocs/commande/class/api_orders.class.php b/htdocs/commande/class/api_orders.class.php
index d43325f9c58..c0266d76d70 100644
--- a/htdocs/commande/class/api_orders.class.php
+++ b/htdocs/commande/class/api_orders.class.php
@@ -97,9 +97,10 @@ class Orders 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 order objects
*
- * @throws RestException
+ * @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();
@@ -218,7 +219,8 @@ class Orders extends DolibarrApi
*
* @return int
*/
- function getLines($id) {
+ function getLines($id)
+ {
if(! DolibarrApiAccess::$user->rights->commande->lire) {
throw new RestException(401);
}
@@ -249,7 +251,8 @@ class Orders extends DolibarrApi
*
* @return int
*/
- function postLine($id, $request_data = null) {
+ function postLine($id, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->commande->creer) {
throw new RestException(401);
}
@@ -311,7 +314,8 @@ class Orders extends DolibarrApi
*
* @return object
*/
- function putLine($id, $lineid, $request_data = null) {
+ function putLine($id, $lineid, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->commande->creer) {
throw new RestException(401);
}
@@ -371,7 +375,8 @@ class Orders extends DolibarrApi
* @throws 401
* @throws 404
*/
- function deleteLine($id, $lineid) {
+ function deleteLine($id, $lineid)
+ {
if(! DolibarrApiAccess::$user->rights->commande->creer) {
throw new RestException(401);
}
@@ -403,7 +408,8 @@ class Orders extends DolibarrApi
*
* @return int
*/
- function put($id, $request_data = null) {
+ function put($id, $request_data = null)
+ {
if (! DolibarrApiAccess::$user->rights->commande->creer) {
throw new RestException(401);
}
@@ -544,7 +550,8 @@ class Orders extends DolibarrApi
* @throws 404
* @throws 405
*/
- function reopen($id) {
+ function reopen($id)
+ {
if(! DolibarrApiAccess::$user->rights->commande->creer) {
throw new RestException(401);
@@ -581,7 +588,8 @@ class Orders extends DolibarrApi
* @throws 404
* @throws 405
*/
- function setinvoiced($id) {
+ function setinvoiced($id)
+ {
if(! DolibarrApiAccess::$user->rights->commande->creer) {
throw new RestException(401);
@@ -706,21 +714,22 @@ class Orders extends DolibarrApi
}
- /**
- * Create an order using an existing proposal.
- *
- *
- * @param int $proposalid Id of the proposal
- *
- * @url POST /createfromproposal/{proposalid}
- *
- * @return int
- * @throws 400
- * @throws 401
- * @throws 404
- * @throws 405
- */
- function createOrderFromProposal($proposalid) {
+ /**
+ * Create an order using an existing proposal.
+ *
+ *
+ * @param int $proposalid Id of the proposal
+ *
+ * @url POST /createfromproposal/{proposalid}
+ *
+ * @return int
+ * @throws 400
+ * @throws 401
+ * @throws 404
+ * @throws 405
+ */
+ function createOrderFromProposal($proposalid)
+ {
require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php';
@@ -756,7 +765,8 @@ class Orders 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/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 941c061eea1..8ee90b6d583 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3243,7 +3243,7 @@ class Commande extends CommonOrder
$clause = " WHERE";
- $sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.date_livraison as delivery_date, c.fk_statut";
+ $sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.date_livraison as delivery_date, c.fk_statut, c.total_ht";
$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id)
{
@@ -3270,6 +3270,7 @@ class Commande extends CommonOrder
while ($obj=$this->db->fetch_object($resql))
{
$response->nbtodo++;
+ $response->total+= $obj->total_ht;
$generic_commande->statut = $obj->fk_statut;
$generic_commande->date_commande = $this->db->jdate($obj->date_commande);
diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index 6c2ad4ef302..ff5a3b2fffd 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -1423,14 +1423,14 @@ if ($resql)
if (! empty($arrayfields['b.conciliated']['checked']))
{
- print ' | ';
+ print ' | ';
print $objp->conciliated?$langs->trans("Yes"):$langs->trans("No");
print ' | ';
if (! $i) $totalarray['nbfield']++;
}
// Action edit/delete
- print '';
+ print ' | ';
// Transaction reconciliated or edit link
if ($objp->conciliated && $bankaccount->canBeConciliated() > 0) // If line not conciliated and account can be conciliated
{
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index f51fa829912..247cecb2eea 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -945,7 +945,8 @@ class Account 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/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php
index 2b8ebd57d06..ab2903c95b4 100644
--- a/htdocs/compta/facture/class/api_invoices.class.php
+++ b/htdocs/compta/facture/class/api_invoices.class.php
@@ -32,7 +32,7 @@ class Invoices extends DolibarrApi
* @var array $FIELDS Mandatory fields, checked when create and update object
*/
static $FIELDS = array(
- 'socid'
+ 'socid',
);
/**
@@ -104,7 +104,8 @@ class Invoices 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();
@@ -245,7 +246,8 @@ class Invoices extends DolibarrApi
* @throws 404
* @throws 405
*/
- function createInvoiceFromOrder($orderid) {
+ function createInvoiceFromOrder($orderid)
+ {
require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php';
@@ -282,7 +284,8 @@ class Invoices extends DolibarrApi
*
* @return int
*/
- function getLines($id) {
+ function getLines($id)
+ {
if(! DolibarrApiAccess::$user->rights->facture->lire) {
throw new RestException(401);
}
@@ -319,7 +322,8 @@ class Invoices extends DolibarrApi
* @throws 401
* @throws 404
*/
- function putLine($id, $lineid, $request_data = null) {
+ function putLine($id, $lineid, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->facture->creer) {
throw new RestException(401);
}
@@ -383,7 +387,8 @@ class Invoices extends DolibarrApi
* @throws 404
* @throws 405
*/
- function deleteLine($id, $lineid) {
+ function deleteLine($id, $lineid)
+ {
if(! DolibarrApiAccess::$user->rights->facture->creer) {
throw new RestException(401);
@@ -511,7 +516,8 @@ class Invoices extends DolibarrApi
* @throws 404
* @throws 400
*/
- function postLine($id, $request_data = null) {
+ function postLine($id, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->facture->creer) {
throw new RestException(401);
}
@@ -849,7 +855,8 @@ class Invoices extends DolibarrApi
* @throws 404
* @throws 405
*/
- function useDiscount($id, $discountid) {
+ function useDiscount($id, $discountid)
+ {
if(! DolibarrApiAccess::$user->rights->facture->creer) {
throw new RestException(401);
@@ -894,7 +901,8 @@ class Invoices extends DolibarrApi
* @throws 404
* @throws 405
*/
- function useCreditNote($id, $discountid) {
+ function useCreditNote($id, $discountid)
+ {
require_once DOL_DOCUMENT_ROOT . '/core/class/discount.class.php';
@@ -938,7 +946,8 @@ class Invoices extends DolibarrApi
* @throws 404
* @throws 405
*/
- function getPayments($id) {
+ function getPayments($id)
+ {
if(! DolibarrApiAccess::$user->rights->facture->lire) {
throw new RestException(401);
@@ -985,8 +994,9 @@ class Invoices extends DolibarrApi
* @throws 401
* @throws 404
*/
- function addPayment($id, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement='', $comment='', $chqemetteur='', $chqbank='') {
- global $conf;
+ function addPayment($id, $datepaye, $paiementid, $closepaidinvoices, $accountid, $num_paiement='', $comment='', $chqemetteur='', $chqbank='')
+ {
+ global $conf;
require_once DOL_DOCUMENT_ROOT . '/compta/paiement/class/paiement.class.php';
@@ -1215,18 +1225,19 @@ class Invoices 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);
+ $object = parent::_cleanObjectDatas($object);
unset($object->note);
- unset($object->address);
- unset($object->barcode_type);
- unset($object->barcode_type_code);
- unset($object->barcode_type_label);
- unset($object->barcode_type_coder);
+ unset($object->address);
+ unset($object->barcode_type);
+ unset($object->barcode_type_code);
+ unset($object->barcode_type_label);
+ unset($object->barcode_type_coder);
- return $object;
+ return $object;
}
/**
@@ -1241,8 +1252,9 @@ class Invoices extends DolibarrApi
{
$invoice = array();
foreach (Invoices::$FIELDS as $field) {
- if (!isset($data[$field]))
+ if (!isset($data[$field])) {
throw new RestException(400, "$field field missing");
+ }
$invoice[$field] = $data[$field];
}
return $invoice;
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index b09c0435bcd..af3597de447 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -3726,7 +3726,7 @@ class Facture extends CommonInvoice
$clause = " WHERE";
- $sql = "SELECT f.rowid, f.date_lim_reglement as datefin,f.fk_statut";
+ $sql = "SELECT f.rowid, f.date_lim_reglement as datefin,f.fk_statut, f.total";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
if (!$user->rights->societe->client->voir && !$user->societe_id)
{
@@ -3759,6 +3759,7 @@ class Facture extends CommonInvoice
$generic_facture->statut = $obj->fk_statut;
$response->nbtodo++;
+ $response->total += $obj->total;
if ($generic_facture->hasDelay()) {
$response->nbtodolate++;
diff --git a/htdocs/compta/facture/class/paymentterm.class.php b/htdocs/compta/facture/class/paymentterm.class.php
index 3697a61672b..61d477522dc 100644
--- a/htdocs/compta/facture/class/paymentterm.class.php
+++ b/htdocs/compta/facture/class/paymentterm.class.php
@@ -30,7 +30,12 @@ class PaymentTerm // extends CommonObject
{
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();
+
//public $element='c_payment_term'; //!< Id that identify managed objects
//public $table_element='c_payment_term'; //!< Name of table without prefix where object is stored
var $context =array();
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index a46b79d7d1b..00dd78ca1bd 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -1513,7 +1513,7 @@ else
//var_dump(dol_print_date($object->date_when+60, 'dayhour').' - '.dol_print_date($now, 'dayhour'));
if (! $object->isMaxNbGenReached())
{
- if ($action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) print img_warning($langs->trans("Late"));
+ if (! $object->suspended && $action != 'editdate_when' && $object->frequency > 0 && $object->date_when && $object->date_when < $now) print img_warning($langs->trans("Late"));
}
else
{
diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index 0cfb0347a2d..cf41f864f05 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -607,7 +607,7 @@ if ($resql)
print ($objp->frequency ? ($invoicerectmp->isMaxNbGenReached()?'':'').dol_print_date($db->jdate($objp->date_when),'day').($invoicerectmp->isMaxNbGenReached()?'':'') : ''.$langs->trans('NA').'');
if (! $invoicerectmp->isMaxNbGenReached())
{
- if ($objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late"));
+ if (! $objp->suspended && $objp->frequency > 0 && $db->jdate($objp->date_when) && $db->jdate($objp->date_when) < $now) print img_warning($langs->trans("Late"));
}
else
{
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 6ae531db133..f9d8bd1b250 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -923,6 +923,9 @@ if ($resql)
$facturestatic->id=$obj->id;
$facturestatic->ref=$obj->ref;
$facturestatic->type=$obj->type;
+ $facturestatic->total_ht=$obj->total_ht;
+ $facturestatic->total_tva=$obj->total_vat;
+ $facturestatic->total_ttc=$obj->total_ttc;
$facturestatic->statut=$obj->fk_statut;
$facturestatic->date_lim_reglement=$db->jdate($obj->datelimite);
$facturestatic->note_public=$obj->note_public;
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index ebaef08c7b5..ea43c270b5f 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -722,7 +722,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
$reshook=$hookmanager->executeHooks('printFieldListWhereCustomerOrderToBill',$parameters);
$sql.=$hookmanager->resPrint;
- $sql.= " GROUP BY s.nom, s.rowid, s.email, s.code_client, s.code_compta, c.rowid, c.ref, c.facture, c.fk_statut, c.tva, c.total_ht, c.total_ttc";
+ $sql.= " GROUP BY s.nom, s.email, s.rowid, s.code_client, s.code_compta, c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.tva, c.total_ttc, cc.rowid, cc.code";
$resql = $db->query($sql);
if ( $resql )
diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php
index ba96c865d1a..921c9e60580 100644
--- a/htdocs/contact/canvas/actions_contactcard_common.class.php
+++ b/htdocs/contact/canvas/actions_contactcard_common.class.php
@@ -39,8 +39,12 @@ abstract class ActionsContactCardCommon
var $object;
//! Error string
var $error;
- //! Error array
- var $errors=array();
+
+
+ /**
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array();
/**
diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php
index f5303074e63..8c206554ee1 100644
--- a/htdocs/contrat/class/api_contracts.class.php
+++ b/htdocs/contrat/class/api_contracts.class.php
@@ -100,7 +100,8 @@ class Contracts 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();
@@ -216,7 +217,8 @@ class Contracts extends DolibarrApi
*
* @return int
*/
- function getLines($id) {
+ function getLines($id)
+ {
if(! DolibarrApiAccess::$user->rights->contrat->lire) {
throw new RestException(401);
}
@@ -247,7 +249,8 @@ class Contracts extends DolibarrApi
*
* @return int
*/
- function postLine($id, $request_data = null) {
+ function postLine($id, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401);
}
@@ -300,7 +303,8 @@ class Contracts extends DolibarrApi
*
* @return object
*/
- function putLine($id, $lineid, $request_data = null) {
+ function putLine($id, $lineid, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401);
}
@@ -359,7 +363,8 @@ class Contracts extends DolibarrApi
*
* @return object
*/
- function activateLine($id, $lineid, $datestart, $dateend = null, $comment = null) {
+ function activateLine($id, $lineid, $datestart, $dateend = null, $comment = null)
+ {
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401);
}
@@ -396,7 +401,8 @@ class Contracts extends DolibarrApi
*
* @return object
*/
- function unactivateLine($id, $lineid, $datestart, $comment = null) {
+ function unactivateLine($id, $lineid, $datestart, $comment = null)
+ {
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401);
}
@@ -436,7 +442,8 @@ class Contracts extends DolibarrApi
* @throws 401
* @throws 404
*/
- function deleteLine($id, $lineid) {
+ function deleteLine($id, $lineid)
+ {
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401);
}
@@ -470,7 +477,8 @@ class Contracts extends DolibarrApi
*
* @return int
*/
- function put($id, $request_data = null) {
+ function put($id, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->contrat->creer) {
throw new RestException(401);
}
@@ -632,7 +640,8 @@ class Contracts 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/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php
index a867d8937c9..1fb2bb3afa6 100644
--- a/htdocs/contrat/class/contrat.class.php
+++ b/htdocs/contrat/class/contrat.class.php
@@ -2350,7 +2350,8 @@ class Contrat extends CommonObject
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int New id of clone
*/
- function createFromClone($socid = 0, $notrigger=0) {
+ function createFromClone($socid = 0, $notrigger=0)
+ {
global $db, $user, $langs, $conf, $hookmanager;
dol_include_once('/projet/class/project.class.php');
diff --git a/htdocs/core/actions_printing.inc.php b/htdocs/core/actions_printing.inc.php
index 62b61e531bf..302ad161241 100644
--- a/htdocs/core/actions_printing.inc.php
+++ b/htdocs/core/actions_printing.inc.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2014 Frederic France
+ * Copyright (C) 2014-2018 Frederic France
*
* 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
@@ -28,7 +28,7 @@
// Filename to print must be provided into 'file' parameter
// Print file
-if ($action == 'print_file' and $user->rights->printing->read)
+if ($action == 'print_file' && $user->rights->printing->read)
{
$langs->load("printing");
require_once DOL_DOCUMENT_ROOT . '/core/modules/printing/modules_printing.php';
diff --git a/htdocs/core/class/antivir.class.php b/htdocs/core/class/antivir.class.php
index b5f4f0e5539..a530da66e3d 100644
--- a/htdocs/core/class/antivir.class.php
+++ b/htdocs/core/class/antivir.class.php
@@ -26,13 +26,17 @@
*/
/**
- * \class AntiVir
- * \brief Class to scan for virus
+ * Class to scan for virus
*/
class AntiVir
{
var $error;
- var $errors;
+
+ /**
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array();
+
var $output;
var $db;
diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php
index d9c496add4f..3fed7cb722e 100644
--- a/htdocs/core/class/canvas.class.php
+++ b/htdocs/core/class/canvas.class.php
@@ -30,7 +30,11 @@ class Canvas
{
var $db;
var $error;
- var $errors=array();
+
+ /**
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array();
var $actiontype;
diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php
index 7964510c91c..43d63ebb1d9 100644
--- a/htdocs/core/class/ccountry.class.php
+++ b/htdocs/core/class/ccountry.class.php
@@ -34,7 +34,12 @@ class Ccountry // extends CommonObject
{
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 $element='ccountry'; //!< Id that identify managed objects
//var $table_element='ccountry'; //!< Name of table without prefix where object is stored
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index 70058ae4a7c..629bc19e390 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -42,9 +42,10 @@ abstract class CommonDocGenerator
*
* @param DoliDB $db Database handler
*/
- public function __construct($db) {
- $this->db = $db;
- }
+ public function __construct($db)
+ {
+ $this->db = $db;
+ }
/**
@@ -228,7 +229,8 @@ abstract class CommonDocGenerator
* @param array_key $array_key Name of the key for return array
* @return array of substitution key->code
*/
- function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object') {
+ function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object')
+ {
global $conf;
if(empty($object->country) && ! empty($object->country_code))
@@ -652,7 +654,8 @@ abstract class CommonDocGenerator
* @param boolean $recursive Want to fetch child array or child object
* @return array Array of substitution key->code
*/
- function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true) {
+ function get_substitutionarray_each_var_object(&$object,$outputlangs,$recursive=true)
+ {
$array_other = array();
if(!empty($object)) {
foreach($object as $key => $value) {
@@ -769,10 +772,9 @@ abstract class CommonDocGenerator
*/
function printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
{
- if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y);
- $pdf->line($x+$l, $y, $x+$l, $y+$h);
- if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h);
- $pdf->line($x, $y+$h, $x, $y);
+ if (empty($hidetop) || $hidetop==-1) $pdf->line($x, $y, $x+$l, $y);
+ $pdf->line($x+$l, $y, $x+$l, $y+$h);
+ if (empty($hidebottom)) $pdf->line($x+$l, $y+$h, $x, $y+$h);
+ $pdf->line($x, $y+$h, $x, $y);
}
}
-
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 6b190d5ec72..05de2d6d789 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -6874,7 +6874,8 @@ abstract class CommonObject
* @param array $fieldsentry Properties of field
* @return string
*/
- protected function quote($value, $fieldsentry) {
+ protected function quote($value, $fieldsentry)
+ {
if (is_null($value)) return 'NULL';
else if (preg_match('/^(int|double|real)/i', $fieldsentry['type'])) return $this->db->escape("$value");
else return "'".$this->db->escape($value)."'";
diff --git a/htdocs/core/class/commonstickergenerator.class.php b/htdocs/core/class/commonstickergenerator.class.php
index 1091962f6ea..efd0f491162 100644
--- a/htdocs/core/class/commonstickergenerator.class.php
+++ b/htdocs/core/class/commonstickergenerator.class.php
@@ -93,7 +93,7 @@ abstract class CommonStickerGenerator
{
$this->db = $db;
}
-
+
/**
* Function to build PDF on disk, then output on HTTP strem.
*
@@ -114,7 +114,7 @@ abstract class CommonStickerGenerator
* @return void
*/
abstract function addSticker(&$pdf,$outputlangs,$param);
-
+
/**
* Methode qui permet de modifier la taille des caracteres
* Cela modiera aussi l'espace entre chaque ligne
@@ -130,7 +130,7 @@ abstract class CommonStickerGenerator
$this->_Line_Height = $this->_Get_Height_Chars($pt);
$pdf->SetFont('','',$pt);
}
- }
+ }
/**
* protected Print dot line
@@ -216,7 +216,7 @@ abstract class CommonStickerGenerator
* @param string $dest to
* @return float value value after conversion
*/
- function _Convert_Metric ($value, $src, $dest)
+ function _Convert_Metric($value, $src, $dest)
{
if ($src != $dest) {
$tab['in'] = 39.37008;
@@ -251,7 +251,7 @@ abstract class CommonStickerGenerator
* @param string $format Format
* @return void
*/
- function _Set_Format(&$pdf, $format)
+ function _Set_Format(&$pdf, $format)
{
$this->_Metric = $format['metric'];
$this->_Avery_Name = $format['name'];
diff --git a/htdocs/core/class/cstate.class.php b/htdocs/core/class/cstate.class.php
index ae2adde87d4..7a853cdf18a 100644
--- a/htdocs/core/class/cstate.class.php
+++ b/htdocs/core/class/cstate.class.php
@@ -34,7 +34,12 @@ class Cstate // extends CommonObject
{
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 $element='cstate'; //!< Id that identify managed objects
//var $table_element='cstate'; //!< Name of table without prefix where object is stored
diff --git a/htdocs/core/class/ctypent.class.php b/htdocs/core/class/ctypent.class.php
index b3bb750bd80..c69b70c7c35 100644
--- a/htdocs/core/class/ctypent.class.php
+++ b/htdocs/core/class/ctypent.class.php
@@ -29,7 +29,12 @@ class Ctypent // extends CommonObject
{
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 $element='ctypent'; //!< Id that identify managed objects
//var $table_element='ctypent'; //!< Name of table without prefix where object is stored
diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php
index 2499176b58b..fbf05c99358 100644
--- a/htdocs/core/class/dolreceiptprinter.class.php
+++ b/htdocs/core/class/dolreceiptprinter.class.php
@@ -110,7 +110,11 @@ class dolReceiptPrinter extends Escpos
var $printer;
var $template;
var $error;
- var $errors;
+ /**
+ *
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array ();
diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php
index 439e31caae1..2ba7f966712 100644
--- a/htdocs/core/class/hookmanager.class.php
+++ b/htdocs/core/class/hookmanager.class.php
@@ -31,7 +31,11 @@ class HookManager
{
var $db;
var $error;
- var $errors=array();
+
+ /**
+ * @var string[] Error codes (or messages)
+ */
+ public $errors = array();
// Context hookmanager was created for ('thirdpartycard', 'thirdpartydao', ...)
var $contextarray=array();
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 6fe2dffd3d3..146c544b32e 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1347,7 +1347,7 @@ class Form
* @param string $moreclass Add more class to class style
* @param bool $options_only Return options only (for ajax treatment)
* @param integer $showsoc Add company into label
- * @param int $forcecombo Force to use combo box
+ * @param int $forcecombo Force to use combo box (so no ajax beautify effect)
* @param array $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container
* @param string $htmlid Html id to use instead of htmlname
@@ -1554,7 +1554,7 @@ class Form
else $sql.= " WHERE u.entity IS NOT NULL";
}
else
- {
+ {
if (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ug";
@@ -3689,7 +3689,7 @@ class Form
// Now add questions
$more.=''."\n";
- $more.='| '.(! empty($formquestion['text'])?$formquestion['text']:'').' | '."\n";
+ if (! empty($formquestion['text'])) $more.='| '.$formquestion['text'].' | '."\n";
foreach ($formquestion as $key => $input)
{
if (is_array($input) && ! empty($input))
@@ -3700,29 +3700,28 @@ class Form
if ($input['type'] == 'text')
{
- $more.='| '.$input['label'].' | | '."\n";
+ $more.='| '.$input['label'].' | | '."\n";
}
else if ($input['type'] == 'password')
{
- $more.='| '.$input['label'].' | | '."\n";
+ $more.='| '.$input['label'].' | | '."\n";
}
else if ($input['type'] == 'select')
{
- $more.='| ';
- if (! empty($input['label'])) $more.=$input['label'].' | ';
+ $more.=' | | ';
+ if (! empty($input['label'])) $more.=$input['label'].' | ';
$more.=$this->selectarray($input['name'],$input['values'],$input['default'],1,0,0,$moreattr,0,0,0,'',$morecss);
$more.=' | '."\n";
}
else if ($input['type'] == 'checkbox')
{
$more.='';
- $more.='| '.$input['label'].' | ';
+ $more.=' | '.$input['label'].' | ';
$more.=' | ';
- $more.=' | ';
$more.=' '."\n";
}
else if ($input['type'] == 'radio')
@@ -3731,12 +3730,11 @@ class Form
foreach($input['values'] as $selkey => $selval)
{
$more.='';
- if ($i==0) $more.='| '.$input['label'].' | ';
- else $more.=' | ';
- $more.=''.$input['label'].' | ';
+ else $more.=' | ';
+ $more.=' | ';
- $more.='';
+ $more.=' /> ';
$more.=$selval;
$more.=' | '."\n";
$i++;
@@ -3744,8 +3742,8 @@ class Form
}
else if ($input['type'] == 'date')
{
- $more.='| '.$input['label'].' | ';
- $more.='';
+ $more.=' | | '.$input['label'].' | ';
+ $more.='';
$more.=$this->select_date($input['value'],$input['name'],0,0,0,'',1,0,1);
$more.=' | '."\n";
$formquestion[] = array('name'=>$input['name'].'day');
@@ -3756,15 +3754,15 @@ class Form
}
else if ($input['type'] == 'other')
{
- $more.='| ';
- if (! empty($input['label'])) $more.=$input['label'].' | ';
+ $more.=' | | ';
+ if (! empty($input['label'])) $more.=$input['label'].' | ';
$more.=$input['value'];
$more.=' | '."\n";
}
else if ($input['type'] == 'onecolumn')
{
- $more.='| ';
+ $more.=' | | ';
$more.=$input['value'];
$more.=' | '."\n";
}
@@ -3818,14 +3816,14 @@ class Form
$( "#'.$dialogconfirm.'" ).dialog(
{
autoOpen: '.($autoOpen ? "true" : "false").',';
- if ($newselectedchoice == 'no')
- {
- $formconfirm.='
+ if ($newselectedchoice == 'no')
+ {
+ $formconfirm.='
open: function() {
$(this).parent().find("button.ui-button:eq(2)").focus();
},';
- }
- $formconfirm.='
+ }
+ $formconfirm.='
resizable: false,
height: "'.$height.'",
width: "'.$width.'",
diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php
index 17e437f5223..b6030809d6f 100644
--- a/htdocs/core/class/html.formaccounting.class.php
+++ b/htdocs/core/class/html.formaccounting.class.php
@@ -216,7 +216,8 @@ class FormAccounting extends Form
* @param string $selectedkey Value
* @return string HTML edit field
*/
- function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '') {
+ function select_bookkeeping_importkey($htmlname = 'importkey', $selectedkey = '')
+ {
$options = array();
$sql = 'SELECT DISTINCT import_key from ' . MAIN_DB_PREFIX . 'accounting_bookkeeping';
@@ -339,7 +340,8 @@ class FormAccounting extends Form
* @param string $morecss More css
* @return string String with HTML select
*/
- function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200') {
+ function select_auxaccount($selectid, $htmlname='account_num_aux', $showempty=0, $morecss='maxwidth200')
+ {
$aux_account = array();
@@ -428,4 +430,3 @@ class FormAccounting extends Form
}
}
}
-
diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php
index fd0470c63f4..8c2af9c9f3a 100644
--- a/htdocs/core/class/html.formadmin.class.php
+++ b/htdocs/core/class/html.formadmin.class.php
@@ -56,9 +56,10 @@ class FormAdmin
* @param int $disabled Disable edit of select
* @param string $morecss Add more css styles
* @param int $showcode Add language code into label
+ * @param int $forcecombo Force to use combo box (so no ajax beautify effect)
* @return string Return HTML select string with list of languages
*/
- function select_language($selected='', $htmlname='lang_id', $showauto=0, $filter=null, $showempty='', $showwarning=0, $disabled=0, $morecss='', $showcode=0)
+ function select_language($selected='', $htmlname='lang_id', $showauto=0, $filter=null, $showempty='', $showwarning=0, $disabled=0, $morecss='', $showcode=0, $forcecombo=0)
{
global $langs;
@@ -109,8 +110,11 @@ class FormAdmin
$out.= '';
// Make select dynamic
- include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
- $out.= ajax_combobox($htmlname);
+ if (! $forcecombo)
+ {
+ include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
+ $out.= ajax_combobox($htmlname);
+ }
return $out;
}
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 7c457accadf..117ec484c15 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -778,7 +778,8 @@ class FormFile
$out.= '';
if ($delallowed)
{
- $out.= 'numoffiles++;
}
- // Loop on each file found
+ // Loop on each link found
if (is_array($link_list))
{
$colspan=2;
@@ -1304,8 +1305,7 @@ class FormFile
if (! empty($conf->dol_use_jmobile)) $useajax=0;
if (empty($conf->use_javascript_ajax)) $useajax=0;
if (! empty($conf->global->MAIN_ECM_DISABLE_JS)) $useajax=0;
-
- print ''.img_delete().'';
+ print ''.img_delete().'';
}
print " | ";
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 4ce4bfee824..c477b6bea69 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -286,7 +286,7 @@ class FormMail extends Form
$disablebademails=1;
- // Define output language
+ // Define output language
$outputlangs = $langs;
$newlang = '';
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang = $this->param['langsmodels'];
@@ -1082,7 +1082,7 @@ class FormMail extends Form
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // Get all public or private owned
if ($active >= 0) $sql.=" AND active = ".$active;
if ($label) $sql.=" AND label ='".$db->escape($label)."'";
- if (is_object($outputlangs)) $sql.= " AND (lang = '".$db->escape($outputlangs->defaultlang)."' OR lang IS NULL OR lang = '')";
+ if (! ($id > 0) && is_object($outputlangs)) $sql.= " AND (lang = '".$db->escape($outputlangs->defaultlang)."' OR lang IS NULL OR lang = '')";
if ($id > 0) $sql.= " AND rowid=".$id;
if ($id == -1) $sql.= " AND position=0";
if (is_object($outputlangs)) $sql.= $db->order("position,lang,label","ASC,DESC,ASC"); // We want line with lang set first, then with lang null or ''
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 655969d73f6..e6325df8836 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 f54caacff8b..cd1f4a64c17 100644
--- a/htdocs/core/class/ldap.class.php
+++ b/htdocs/core/class/ldap.class.php
@@ -370,7 +370,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;
@@ -381,7 +382,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 d46481a0c60..7d36df58b81 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(),
);
/**
@@ -126,7 +126,8 @@ class SimpleOpenID
* @return void
*/
function SetIdentity($a)
- { // Set Identity URL
+ {
+ // Set Identity URL
if ((stripos($a, 'http://') === false)
&& (stripos($a, 'https://') === false)){
$a = 'http://'.$a;
@@ -153,7 +154,8 @@ class SimpleOpenID
* @return string
*/
function GetIdentity()
- { // Get Identity
+ {
+ // Get Identity
return $this->openid_url_identity;
}
@@ -254,7 +256,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;
}
@@ -306,7 +309,8 @@ class SimpleOpenID
* @return string
*/
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 : ""));
@@ -361,7 +365,7 @@ class SimpleOpenID
*/
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;
@@ -522,4 +526,3 @@ class SimpleOpenID
}
}
-
diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php
index 7f0f8143cbd..c18e2232c01 100644
--- a/htdocs/core/class/smtps.class.php
+++ b/htdocs/core/class/smtps.class.php
@@ -1650,7 +1650,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 ) ) )
@@ -1814,12 +1814,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
@@ -2049,4 +2051,3 @@ class SMTPs
* - basic shell with some commets
*
*/
-
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 4734c3364b5..be980c306ec 100644
--- a/htdocs/core/db/mssql.class.php
+++ b/htdocs/core/db/mssql.class.php
@@ -1138,7 +1138,8 @@ class DoliDBMssql extends DoliDB
* @param string $fieldname Field's name to escape
* @return string field's name escaped
*/
- function EscapeFieldName($fieldname) {
+ function EscapeFieldName($fieldname)
+ {
return "[".$fieldname."]";
}
@@ -1150,7 +1151,8 @@ class DoliDBMssql extends DoliDB
* @param mixed $fields String for one field or array of string for multiple field
* @return false|object
*/
- 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))
{
@@ -1176,4 +1178,3 @@ class DoliDBMssql extends DoliDB
}
}
-
diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php
index 78762f282b4..a08756f786a 100644
--- a/htdocs/core/db/sqlite3.class.php
+++ b/htdocs/core/db/sqlite3.class.php
@@ -1302,7 +1302,8 @@ class DoliDBSqlite3 extends DoliDB
* @param int $day Day
* @return int Formatted date
*/
- 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);
@@ -1322,7 +1323,8 @@ class DoliDBSqlite3 extends DoliDB
* @param bool $sunday_first_day_of_week ???
* @return int
*/
- 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;
}
@@ -1348,7 +1350,8 @@ class DoliDBSqlite3 extends DoliDB
* @param string $calc_year ???
* @return string ???
*/
- 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;
@@ -1388,4 +1391,3 @@ class DoliDBSqlite3 extends DoliDB
}
}
-
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/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/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..0d46dc7eacc 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;
@@ -329,7 +331,7 @@ function htmlPrintOnlinePaymentFooter($fromcompany, $langs, $addformmessage=0, $
print '
'."\n";
print $fromcompany->name.' ';
print $line1;
- if (strlen($line1+$line2) > 50) print ' ';
+ if (strlen($line1.$line2) > 50) print ' ';
else print ' - ';
print $line2;
print ''."\n";
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index e11fd409a6e..db1aff3d444 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -104,9 +104,24 @@ function project_prepare_head($object)
$head[$h][2] = 'tasks';
$h++;
+ $nbTimeSpent=0;
+ $sql = "SELECT t.rowid";
+ //$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u";
+ //$sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid";
+ $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt";
+ $sql .= " WHERE t.fk_task = pt.rowid";
+ $sql .= " AND pt.fk_projet =".$object->id;
+ $resql = $db->query($sql);
+ if ($resql)
+ {
+ $obj = $db->fetch_object($resql);
+ if ($obj) $nbTimeSpent=1;
+ }
+ else dol_print_error($db);
+
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.$object->id;
$head[$h][1] = $langs->trans("TimeSpent");
- //if ($nbTasks > 0) $head[$h][1].= ' '.($nbTasks).'';
+ if ($nbTimeSpent > 0) $head[$h][1].= ' ...';
$head[$h][2] = 'timespent';
$h++;
}
@@ -165,9 +180,10 @@ function task_prepare_head($object)
// Is there timespent ?
$nbTimeSpent=0;
$sql = "SELECT t.rowid";
- $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u";
- $sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid";
- $sql .= " AND t.fk_task =".$object->id;
+ //$sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t, ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."user as u";
+ //$sql .= " WHERE t.fk_user = u.rowid AND t.fk_task = pt.rowid";
+ $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t";
+ $sql .= " WHERE t.fk_task =".$object->id;
$resql = $db->query($sql);
if ($resql)
{
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 2971b6f59ee..d4c55ce6bdc 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 b0a121d7dc5..703f61cda10 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 680357ce9bb..8906bdcc14f 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 bbf20761f5f..6d9e359c859 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 9941811006b..69c25f73d68 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 aa6da728f56..1e58104c9ca 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
@@ -71,7 +74,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 5dcb8a72baa..1f85e4d57fc 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 47a882b7b56..f0af2e7f78a 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='';
/**
@@ -67,7 +70,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 4949cce94e1..f2cba175a60 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
@@ -63,7 +66,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 826ba6665c4..e9e0adc7e39 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 f46fa33c5f1..0fc12428d62 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='';
/**
@@ -66,7 +69,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 e97766b38f6..f60899eee0a 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='';
/**
@@ -73,7 +76,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 5d7e0ecac84..c154420f554 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 b5d9a2397cc..47b4506bdb4 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
@@ -65,7 +68,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 7e60a6aed4b..2461d8a074d 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 8bcb2990bdb..619f2b888bc 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='';
/**
@@ -64,7 +67,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 3b77230f77f..9031c31036d 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 901a7531cbe..6449f48d96f 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='';
/**
@@ -68,7 +71,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 a6473eaeb8e..aeaa6e58db2 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 7f222f523ca..0c610f469b0 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 a433f42930d..13d83939afb 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
@@ -67,7 +70,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 49acce1e2d6..6a723ce0553 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
}
@@ -323,7 +324,7 @@ class pdf_standard extends CommonStickerGenerator
if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
-
+
// Load traductions files requiredby by page
$outputlangs->loadLangs(array("main", "dict", "companies", "admin", "members"));
diff --git a/htdocs/core/modules/member/modules_cards.php b/htdocs/core/modules/member/modules_cards.php
index f7ef8b94590..4e3e1a2dac4 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/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php
index 74f61fd288f..de84c653060 100644
--- a/htdocs/core/modules/modAdherent.class.php
+++ b/htdocs/core/modules/modAdherent.class.php
@@ -349,12 +349,12 @@ class modAdherent extends DolibarrModules
// Cronjobs
$this->cronjobs = array(
0=>array(
- 'label'=>'SendReminderForExpiredSubscription',
+ 'label'=>'SendReminderForExpiredSubscriptionTitle',
'jobtype'=>'method', 'class'=>'adherents/class/adherent.class.php',
'objectname'=>'Adherent',
'method'=>'sendReminderForExpiredSubscription',
'parameters'=>'10',
- 'comment'=>'sendReminderForExpiredSubscription',
+ 'comment'=>'SendReminderForExpiredSubscription',
'frequency'=>1,
'unitfrequency'=> 3600 * 24,
'priority'=>50,
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 77c3f8feef7..f6c34f030a0 100644
--- a/htdocs/core/modules/modDav.class.php
+++ b/htdocs/core/modules/modDav.class.php
@@ -68,7 +68,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 8fc05b6cdd8..5111d0fc9be 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 7cda95174c2..8e4eafeb7b8 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 94d14426b55..168c411ec29 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 d76b397ace8..550f401f90b 100644
--- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php
+++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php
@@ -41,10 +41,11 @@ 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
}
-
+
/**
* Output a sticker on page at position _COUNTX, _COUNTY (_COUNTX and _COUNTY start from 0)
* - %LOGO% is replace with company logo
@@ -254,7 +255,7 @@ class pdf_standardlabel extends CommonStickerGenerator
if (! is_object($outputlangs)) $outputlangs=$langs;
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
-
+
// Load traductions files requiredby by page
$outputlangs->loadLangs(array("main", "dict", "companies", "admin"));
diff --git a/htdocs/core/modules/printsheet/modules_labels.php b/htdocs/core/modules/printsheet/modules_labels.php
index bac32ec45d2..047d7aeed76 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 83fc444f258..3b0324a8460 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='';
/**
@@ -58,7 +61,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 94818d17531..df94c98871f 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/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php
index 05256a3e61f..ccf4de57d5a 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 5f7ef3d5756..898cb202744 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='';
/**
@@ -62,7 +65,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 1a0aa3e3445..55ecf2db518 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 7d14ae12a3e..11fa9b38326 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='';
/**
@@ -63,7 +66,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 c2d52923e4f..55f7a028e23 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='';
/**
@@ -66,7 +69,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 0ed5eace2e2..c5a1901635b 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
@@ -63,7 +66,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
*
@@ -255,7 +261,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 806f500dab7..4009d235b59 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 a0740b50f54..a5e0c2e5d7f 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 7762d8ce6a5..edc3f3c7428 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='';
/**
@@ -64,7 +67,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 4bd262d67fb..d20229fd650 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='';
/**
@@ -69,7 +72,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 9b0012ec089..94521f99c5e 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 56c5bd94ae0..7a6e26e770b 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='';
/**
@@ -54,7 +57,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 b324a1b03a8..13ca149fde8 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='';
/**
@@ -66,7 +69,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 a2c15780e35..9e05292fb5a 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
@@ -409,7 +409,7 @@ class doc_generic_user_odt extends ModelePDFUser
$odfHandler=null; // Destroy object
$this->result = array('fullpath'=>$file);
-
+
return 1; // Success
}
else
@@ -422,7 +422,8 @@ class doc_generic_user_odt extends ModelePDFUser
return -1;
}
- 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)) {
@@ -433,4 +434,3 @@ class doc_generic_user_odt extends ModelePDFUser
}
}
-
diff --git a/htdocs/core/modules/user/modules_user.class.php b/htdocs/core/modules/user/modules_user.class.php
index 3e94ece9372..33844eb938c 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 26edb08d57c..d6735de5cad 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/cron/card.php b/htdocs/cron/card.php
index 6b052ca59d4..855620756a7 100644
--- a/htdocs/cron/card.php
+++ b/htdocs/cron/card.php
@@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT."/core/class/html.formcron.class.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php';
// Load translation files required by the page
-$langs->loadLangs(array('admin', 'cron'));
+$langs->loadLangs(array('admin', 'cron', 'members'));
if (!$user->rights->cron->create) accessforbidden();
diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php
index 238bd17d5c5..cc3b8e879ed 100644
--- a/htdocs/cron/list.php
+++ b/htdocs/cron/list.php
@@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/cron/class/cronjob.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php';
// Load translation files required by the page
-$langs->loadLangs(array("admin","cron","bills"));
+$langs->loadLangs(array("admin","cron","bills","members"));
if (!$user->rights->cron->read) accessforbidden();
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 d14419f49b0..789a351c776 100644
--- a/htdocs/fichinter/class/fichinter.class.php
+++ b/htdocs/fichinter/class/fichinter.class.php
@@ -278,6 +278,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 c8b64790061..e5c4faf4d12 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -418,7 +418,7 @@ class Holiday extends CommonObject
}
else
{
- // SQL Error
+ // SQL Error
$this->error="Error ".$this->db->lasterror();
return -1;
}
@@ -542,7 +542,7 @@ class Holiday extends CommonObject
}
else
{
- // SQL Error
+ // SQL Error
$this->error="Error ".$this->db->lasterror();
return -1;
}
@@ -985,7 +985,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;
@@ -1019,7 +1020,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."'";
@@ -1247,7 +1249,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";
@@ -1308,7 +1311,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."'";
@@ -1632,7 +1636,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 f8754193515..875efc27410 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/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/modulebuilder/template/class/api_mymodule.class.php b/htdocs/modulebuilder/template/class/api_mymodule.class.php
index b4abf60861e..50527690bbb 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,34 +109,37 @@ 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();
$socid = DolibarrApiAccess::$user->societe_id ? DolibarrApiAccess::$user->societe_id : '';
+ $restictonsocid = 0; // Set to 1 if there is a field socid in table of object
+
// If the internal user must only see his customers, force searching by him
- if (! DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) $search_sale = DolibarrApiAccess::$user->id;
+ if ($restictonsocid && ! DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) $search_sale = DolibarrApiAccess::$user->id;
- $sql = "SELECT s.rowid";
- if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
- $sql.= " FROM ".MAIN_DB_PREFIX."myobject as s";
+ $sql = "SELECT t.rowid";
+ if ($restictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
+ $sql.= " FROM ".MAIN_DB_PREFIX."myobject_mytable as t";
- if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
- $sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st";
- $sql.= " WHERE s.fk_stcomm = st.id";
+ if ($restictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale
+ $sql.= " WHERE 1 = 1";
- // 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)";
- $sql.= ' AND s.entity IN ('.getEntity('myobject').')';
- if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.fk_soc = sc.fk_soc";
- if ($socid) $sql.= " AND s.fk_soc = ".$socid;
- if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
+ $tmpobject = new MyObject($db);
+ if ($tmpobject->ismultientitymanaged) $sql.= ' AND t.entity IN ('.getEntity('myobject').')';
+ if ($restictonsocid && (!DolibarrApiAccess::$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND t.fk_soc = sc.fk_soc";
+ if ($restictonsocid && $socid) $sql.= " AND t.fk_soc = ".$socid;
+ if ($restictonsocid && $search_sale > 0) $sql.= " AND t.rowid = sc.fk_soc"; // Join for the needed table to filter by sale
// Insert sale filter
- if ($search_sale > 0)
+ if ($restictonsocid && $search_sale > 0)
{
$sql .= " AND sc.fk_user = ".$search_sale;
}
@@ -170,7 +173,7 @@ class MyModuleApi extends DolibarrApi
$obj = $db->fetch_object($result);
$myobject_static = new MyObject($db);
if($myobject_static->fetch($obj->rowid)) {
- $obj_ret[] = parent::_cleanObjectDatas($myobject_static);
+ $obj_ret[] = $this->_cleanObjectDatas($myobject_static);
}
$i++;
}
@@ -195,8 +198,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 +224,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 ) {
@@ -253,7 +256,7 @@ class MyModuleApi extends DolibarrApi
*/
function delete($id)
{
- if(! DolibarrApiAccess::$user->rights->myobject->supprimer) {
+ if(! DolibarrApiAccess::$user->rights->myobject->delete) {
throw new RestException(401);
}
$result = $this->myobject->fetch($id);
@@ -261,11 +264,11 @@ 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))
+ if( !$this->myobject->delete(DolibarrApiAccess::$user, 0))
{
throw new RestException(500);
}
@@ -279,6 +282,27 @@ class MyModuleApi extends DolibarrApi
}
+
+ /**
+ * Clean sensible object datas
+ *
+ * @param object $object Object to clean
+ * @return array Array of cleaned object properties
+ */
+ function _cleanObjectDatas($object)
+ {
+ $object = parent::_cleanObjectDatas($object);
+
+ /*unset($object->note);
+ unset($object->address);
+ unset($object->barcode_type);
+ unset($object->barcode_type_code);
+ unset($object->barcode_type_label);
+ unset($object->barcode_type_coder);*/
+
+ return $object;
+ }
+
/**
* Validate fields before create or update object
*
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index c6cd6fae901..d468c543df4 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -66,6 +66,7 @@ class MyObject extends CommonObject
* 'position' is the sort order of field.
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
* 'isameasure' must be set to 1 if you want to have a total on list for this field. Field type must be summable like integer or double(24,8).
+ * 'css' is the CSS style to use on field. For example: 'maxwidth200'
* 'help' is a string visible as a tooltip on field
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
@@ -285,7 +286,7 @@ class MyObject extends CommonObject
*/
function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
{
- global $db, $conf, $langs, $hoomanager;
+ global $db, $conf, $langs, $hookmanager;
global $dolibarr_main_authentication, $dolibarr_main_demo;
global $menumanager;
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index 3f2d9b14dac..04de3e1e40e 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -122,7 +122,7 @@ if (empty($reshook))
$permissiontoadd = $user->rights->mymodule->write;
$permissiontodelete = $user->rights->mymodule->delete;
- if (empty($backtopage)) $backtopage = dol_buildpath('/mymodule/myobject_card.php',1).'?id=__ID__';
+ if (empty($backtopage)) $backtopage = dol_buildpath('/mymodule/myobject_card.php',1).'?id='.($id > 0 ? $id : '__ID__');
$backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1);
$triggermodname = 'MYMODULE_MYOBJECT_MODIFY'; // Name of trigger action code to execute when we modify record
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 6ae31645a50..b34f4a88b2d 100644
--- a/htdocs/product/class/html.formproduct.class.php
+++ b/htdocs/product/class/html.formproduct.class.php
@@ -167,7 +167,8 @@ class FormProduct
* @param String $final_label full label with all parents, separated by ' >> ' (completed on each call)
* @return String full label with all parents, separated by ' >> '
*/
- 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 1e4d95e802a..a6db67c7709 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -4506,7 +4506,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 fdff7b1fe6d..56b5004d31b 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;
@@ -342,7 +344,7 @@ class Productcustomerprice extends CommonObject
$sql .= " AND prod.rowid=t.fk_product ";
$sql .= " AND prod.entity IN (" . getEntity('product') . ")";
$sql .= " AND t.entity IN (" . getEntity('productprice') . ")";
-
+
// Manage filter
if (count($filter) > 0) {
foreach ( $filter as $key => $value ) {
@@ -522,7 +524,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;
@@ -719,7 +722,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;
@@ -811,7 +815,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;
@@ -864,7 +869,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;
@@ -914,7 +920,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 92c6ffadca4..641a8f155b7 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 5ce3068c144..039f74302e8 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 f4595062098..37a3e116683 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 '';
- if (preg_match('/([^a-z]+)[a-z]/i',$obj->duration))
+ // Duration
+ if (! empty($arrayfields['p.duration']['checked']))
{
- if (preg_match('/([^a-z]+)y/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear");
- elseif (preg_match('/([^a-z]+)m/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationMonth");
- elseif (preg_match('/([^a-z]+)w/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationWeek");
- elseif (preg_match('/([^a-z]+)d/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationDay");
- //elseif (preg_match('/([^a-z]+)h/i',$obj->duration,$regs)) print $regs[1].' '.$langs->trans("DurationHour");
- else print $obj->duration;
+ print ' | ';
+
+ if (preg_match('/([^a-z]+)[a-z]$/i',$obj->duration))
+ {
+ $duration_value = substr($obj->duration,0,dol_strlen($obj->duration)-1);
+ $duration_unit = substr($obj->duration,-1);
+
+ if ((float) $duration_value > 1)
+ {
+ $dur=array("i"=>$langs->trans("Minutes"),"h"=>$langs->trans("Hours"),"d"=>$langs->trans("Days"),"w"=>$langs->trans("Weeks"),"m"=>$langs->trans("Months"),"y"=>$langs->trans("Years"));
+ }
+ else if ((float) $duration_value > 0)
+ {
+ $dur=array("i"=>$langs->trans("Minute"),"h"=>$langs->trans("Hour"),"d"=>$langs->trans("Day"),"w"=>$langs->trans("Week"),"m"=>$langs->trans("Month"),"y"=>$langs->trans("Year"));
+ }
+ print $duration_value;
+ print (! empty($duration_unit) && isset($dur[$duration_unit]) ? ' '.$langs->trans($dur[$duration_unit]) : '');
+ }
+ else
+ {
+ print $obj->duration;
+ }
+ print ' | ';
+ if (! $i) $totalarray['nbfield']++;
}
- print ' | ';
- if (! $i) $totalarray['nbfield']++;
- }
// Sell price
if (! empty($arrayfields['p.sellprice']['checked']))
diff --git a/htdocs/product/stock/class/api_stockmovements.class.php b/htdocs/product/stock/class/api_stockmovements.class.php
index 16d21c02eb3..2dc45a262ab 100644
--- a/htdocs/product/stock/class/api_stockmovements.class.php
+++ b/htdocs/product/stock/class/api_stockmovements.class.php
@@ -93,7 +93,8 @@ class StockMovements extends DolibarrApi
*
* @throws RestException
*/
- 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();
@@ -153,15 +154,15 @@ class StockMovements extends DolibarrApi
return $obj_ret;
}
-/*
- * @param int $product_id Id product id {@min 1}
- * @param int $warehouse_id Id warehouse {@min 1}
- * @param float $qty Qty to add (Use negative value for a stock decrease) {@min 0} {@message qty must be higher than 0}
- * @param string $lot Lot
- * @param string $movementcode Movement code {@example INV123}
- * @param string $movementlabel Movement label {@example Inventory number 123}
- * @param string $price To update AWP (Average Weighted Price) when you make a stock increase (qty must be higher then 0).
- */
+ /*
+ * @param int $product_id Id product id {@min 1}
+ * @param int $warehouse_id Id warehouse {@min 1}
+ * @param float $qty Qty to add (Use negative value for a stock decrease) {@min 0} {@message qty must be higher than 0}
+ * @param string $lot Lot
+ * @param string $movementcode Movement code {@example INV123}
+ * @param string $movementlabel Movement label {@example Inventory number 123}
+ * @param string $price To update AWP (Average Weighted Price) when you make a stock increase (qty must be higher then 0).
+ */
/**
@@ -279,7 +280,8 @@ class StockMovements extends DolibarrApi
* @param MouvementStock $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/stock/class/api_warehouses.class.php b/htdocs/product/stock/class/api_warehouses.class.php
index 10b76d22a25..91ee105acb7 100644
--- a/htdocs/product/stock/class/api_warehouses.class.php
+++ b/htdocs/product/stock/class/api_warehouses.class.php
@@ -92,7 +92,8 @@ class Warehouses extends DolibarrApi
*
* @throws RestException
*/
- 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();
@@ -248,7 +249,8 @@ class Warehouses extends DolibarrApi
* @param Entrepot $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/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php
index 039918ea66c..bae42639d28 100644
--- a/htdocs/product/stock/class/entrepot.class.php
+++ b/htdocs/product/stock/class/entrepot.class.php
@@ -690,7 +690,8 @@ class Entrepot extends CommonObject
* @param array() $TChildWarehouses array which will contain all children (param by reference)
* @return array() $TChildWarehouses array which will contain all children
*/
- function get_children_warehouses($id, &$TChildWarehouses) {
+ function get_children_warehouses($id, &$TChildWarehouses)
+ {
$sql = 'SELECT rowid
FROM '.MAIN_DB_PREFIX.'entrepot
@@ -707,7 +708,7 @@ class Entrepot extends CommonObject
return $TChildWarehouses;
}
-
+
/**
* Create object on disk
*
diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php
index 7e13da391f2..bc5d03c7296 100644
--- a/htdocs/product/stock/replenish.php
+++ b/htdocs/product/stock/replenish.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2013-2016 Laurent Destaileur
+ * Copyright (C) 2013-2018 Laurent Destaileur
* Copyright (C) 2014 Regis Houssin
* Copyright (C) 2016 Juanjo Menent
* Copyright (C) 2016 ATM Consulting
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 2a5793a3c0e..bc674b2ba95 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -64,6 +64,7 @@ if ($id > 0 || ! empty($ref))
$ret = $object->fetch($id,$ref); // If we create project, ref may be defined into POST but record does not yet exists into database
if ($ret > 0) {
$object->fetch_thirdparty();
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
$id=$object->id;
}
}
diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php
index ab157bf237c..e5a73590d75 100644
--- a/htdocs/projet/class/api_projects.class.php
+++ b/htdocs/projet/class/api_projects.class.php
@@ -98,7 +98,8 @@ class Projects 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 project objects
*/
- 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();
@@ -214,7 +215,8 @@ class Projects extends DolibarrApi
*
* @url GET {id}/tasks
*/
- function getLines($id, $includetimespent=0) {
+ function getLines($id, $includetimespent=0)
+ {
if(! DolibarrApiAccess::$user->rights->projet->lire) {
throw new RestException(401);
}
@@ -256,7 +258,8 @@ class Projects extends DolibarrApi
*
* @return int
*/
- function getRoles($id, $userid=0) {
+ function getRoles($id, $userid=0)
+ {
global $db;
if(! DolibarrApiAccess::$user->rights->projet->lire) {
@@ -300,7 +303,8 @@ class Projects extends DolibarrApi
* @return int
*/
/*
- function postLine($id, $request_data = null) {
+ function postLine($id, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->projet->creer) {
throw new RestException(401);
}
@@ -362,7 +366,8 @@ class Projects extends DolibarrApi
* @return object
*/
/*
- function putLine($id, $lineid, $request_data = null) {
+ function putLine($id, $lineid, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->projet->creer) {
throw new RestException(401);
}
@@ -418,7 +423,8 @@ class Projects extends DolibarrApi
*
* @return int
*/
- function put($id, $request_data = null) {
+ function put($id, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->projet->creer) {
throw new RestException(401);
}
@@ -535,7 +541,8 @@ class Projects 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/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php
index 3125546c10a..cd79a12cecc 100644
--- a/htdocs/projet/class/api_tasks.class.php
+++ b/htdocs/projet/class/api_tasks.class.php
@@ -106,7 +106,8 @@ class Tasks 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 project objects
*/
- 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();
@@ -221,7 +222,8 @@ class Tasks extends DolibarrApi
* @url GET {id}/tasks
*/
/*
- function getLines($id, $includetimespent=0) {
+ function getLines($id, $includetimespent=0)
+ {
if(! DolibarrApiAccess::$user->rights->projet->lire) {
throw new RestException(401);
}
@@ -263,7 +265,8 @@ class Tasks extends DolibarrApi
*
* @return int
*/
- function getRoles($id, $userid=0) {
+ function getRoles($id, $userid=0)
+ {
global $db;
if(! DolibarrApiAccess::$user->rights->projet->lire) {
@@ -305,7 +308,8 @@ class Tasks extends DolibarrApi
* @return int
*/
/*
- function postLine($id, $request_data = null) {
+ function postLine($id, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->projet->creer) {
throw new RestException(401);
}
@@ -367,7 +371,8 @@ class Tasks extends DolibarrApi
* @return object
*/
/*
- function putLine($id, $lineid, $request_data = null) {
+ function putLine($id, $lineid, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->projet->creer) {
throw new RestException(401);
}
@@ -422,7 +427,8 @@ class Tasks extends DolibarrApi
*
* @return int
*/
- function put($id, $request_data = null) {
+ function put($id, $request_data = null)
+ {
if(! DolibarrApiAccess::$user->rights->projet->creer) {
throw new RestException(401);
}
@@ -550,7 +556,8 @@ class Tasks 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/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index dbd2ee57103..b53e7c30208 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -454,18 +454,12 @@ class Project extends CommonObject
// fetch optionals attributes and labels
$this->fetch_optionals();
- if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT))
- {
- $this->fetchComments();
- }
-
return 1;
}
$this->db->free($resql);
- if ($num_rows) return 1;
- else return 0;
+ return 0;
}
else
{
@@ -653,9 +647,8 @@ class Project extends CommonObject
$this->getLinesArray($user);
// Delete tasks
- foreach($this->lines as &$task) {
- $task->delete($user);
- }
+ $ret = $this->deleteTasks($user);
+ if ($ret < 0) $error++;
// Delete project
if (! $error)
@@ -731,6 +724,40 @@ class Project extends CommonObject
return -1;
}
}
+
+ /**
+ * Delete tasks with no children first, then task with children recursively
+ *
+ * @param User $user User
+ * @return int <0 if KO, 1 if OK
+ */
+ function deleteTasks($user)
+ {
+ $countTasks = count($this->lines);
+ $deleted = false;
+ if ($countTasks)
+ {
+ foreach($this->lines as $task)
+ {
+ if ($task->hasChildren() <= 0) { // If there is no children (or error to detect them)
+ $deleted = true;
+ $ret = $task->delete($user);
+ if ($ret <= 0)
+ {
+ $this->errors[] = $this->db->lasterror();
+ return -1;
+ }
+ }
+ }
+ }
+ $this->getLinesArray($user);
+ if ($deleted && count($this->lines) < $countTasks)
+ {
+ if (count($this->lines)) $this->deleteTasks($this->lines);
+ }
+
+ return 1;
+ }
/**
* Validate a project
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 46f04b08932..a0477461b4e 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -194,7 +194,7 @@ class Task extends CommonObject
*/
function fetch($id, $ref='', $loadparentdata=0)
{
- global $langs;
+ global $langs, $conf;
$sql = "SELECT";
$sql.= " t.rowid,";
@@ -267,7 +267,6 @@ class Task extends CommonObject
}
// Retreive all extrafield
- // fetch optionals attributes and labels
$this->fetch_optionals();
}
diff --git a/htdocs/projet/comment.php b/htdocs/projet/comment.php
index 7f547feffb3..f6cd6ac0005 100644
--- a/htdocs/projet/comment.php
+++ b/htdocs/projet/comment.php
@@ -67,6 +67,7 @@ if ($id > 0 || ! empty($ref))
$ret = $object->fetch($id,$ref); // If we create project, ref may be defined into POST but record does not yet exists into database
if ($ret > 0) {
$object->fetch_thirdparty();
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
$id=$object->id;
}
}
diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php
index f7edf686eb2..68c9b530c88 100644
--- a/htdocs/projet/contact.php
+++ b/htdocs/projet/contact.php
@@ -43,6 +43,7 @@ $mine = GETPOST('mode')=='mine' ? 1 : 0;
$object = new Project($db);
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
+if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
// Security check
$socid=0;
@@ -140,6 +141,7 @@ $userstatic=new User($db);
if ($id > 0 || ! empty($ref))
{
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
// To verify role of users
//$userAccess = $object->restrictedProjectArea($user,'read');
$userWrite = $object->restrictedProjectArea($user,'write');
diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php
index 3af813ba698..e585acd7d85 100644
--- a/htdocs/projet/document.php
+++ b/htdocs/projet/document.php
@@ -48,6 +48,7 @@ $result=restrictedArea($user,'projet',$id,'projet&project');
$object = new Project($db);
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
+if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
if ($id > 0 || ! empty($ref)) {
$upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($object->ref);
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index 28cc833eeb2..23ecadd9939 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -97,6 +97,7 @@ $projectid=$id; // For backward compatibility
$object = new Project($db);
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
+if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
// Security check
$socid=$object->socid;
diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php
index a1ac7c32aaa..00f568271e0 100644
--- a/htdocs/projet/ganttview.php
+++ b/htdocs/projet/ganttview.php
@@ -42,6 +42,7 @@ $mine = ($mode == 'mine' ? 1 : 0);
$object = new Project($db);
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
+if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
// Security check
$socid=0;
diff --git a/htdocs/projet/info.php b/htdocs/projet/info.php
index 31d633e70d1..7aa0dccd67d 100644
--- a/htdocs/projet/info.php
+++ b/htdocs/projet/info.php
@@ -98,6 +98,7 @@ if ($id > 0 || ! empty($ref))
{
$object->fetch($id, $ref);
$object->fetch_thirdparty();
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
$object->info($object->id);
}
diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php
index 96dce3da63f..4d455bdcbc7 100644
--- a/htdocs/projet/note.php
+++ b/htdocs/projet/note.php
@@ -39,6 +39,7 @@ $mine = $_REQUEST['mode']=='mine' ? 1 : 0;
$object = new Project($db);
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
+if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
// Security check
$socid=0;
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 17d245f94bf..c10dc2b9c42 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -64,6 +64,7 @@ $extrafields_project = new ExtraFields($db);
$extrafields_task = new ExtraFields($db);
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
+if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
if ($id > 0 || ! empty($ref))
{
diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php
index 6c4b7f56d3f..19ba461fbe4 100644
--- a/htdocs/projet/tasks/comment.php
+++ b/htdocs/projet/tasks/comment.php
@@ -106,6 +106,7 @@ if ($id > 0 || ! empty($ref))
$result=$projectstatic->fetch($object->fk_project);
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) $projectstatic->fetchComments();
$object->project = clone $projectstatic;
@@ -278,6 +279,6 @@ if ($id > 0 || ! empty($ref))
}
}
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index f27ff3393f5..3272c43ad10 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -173,9 +173,11 @@ if ($id > 0 || ! empty($ref))
{
if ($object->fetch($id, $ref) > 0)
{
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
$id = $object->id; // So when doing a search from ref, id is also set correctly.
$result=$projectstatic->fetch($object->fk_project);
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) $projectstatic->fetchComments();
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
$object->project = clone $projectstatic;
diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php
index 4e8e1319aa3..a186c89988f 100644
--- a/htdocs/projet/tasks/document.php
+++ b/htdocs/projet/tasks/document.php
@@ -91,7 +91,9 @@ if ($id > 0 || ! empty($ref))
{
if ($object->fetch($id,$ref) > 0)
{
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
$projectstatic->fetch($object->fk_project);
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) $projectstatic->fetchComments();
if (! empty($projectstatic->socid)) {
$projectstatic->fetch_thirdparty();
diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php
index ebd4210ff6e..668c2a96d83 100644
--- a/htdocs/projet/tasks/note.php
+++ b/htdocs/projet/tasks/note.php
@@ -51,7 +51,9 @@ if ($id > 0 || ! empty($ref))
{
if ($object->fetch($id,$ref) > 0)
{
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
$projectstatic->fetch($object->fk_project);
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) $projectstatic->fetchComments();
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
$object->project = clone $projectstatic;
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 7b4a9d25537..b7588257455 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -211,8 +211,10 @@ if ($id > 0 || ! empty($ref))
if ($object->fetch($id,$ref) > 0)
{
$res=$object->fetch_optionals();
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
$result=$projectstatic->fetch($object->fk_project);
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) $projectstatic->fetchComments();
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
$object->project = clone $projectstatic;
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 4c2e60f05b2..18adfc47bed 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -71,7 +71,7 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortfield) $sortfield='t.task_date,t.task_datehour,t.rowid';
-if (! $sortorder) $sortorder='DESC';
+if (! $sortorder) $sortorder='DESC,DESC,DESC';
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
//$object = new TaskTime($db);
@@ -158,7 +158,7 @@ if ($action == 'addtimespent' && $user->rights->projet->lire)
else
{
$object->timespent_note = $_POST["timespent_note"];
- $object->progress = GETPOST('progress', 'int');
+ if (GETPOST('progress', 'int') > 0) $object->progress = GETPOST('progress', 'int'); // If progress is -1 (not defined), we do not change value
$object->timespent_duration = $_POST["timespent_durationhour"]*60*60; // We store duration in seconds
$object->timespent_duration+= ($_POST["timespent_durationmin"]?$_POST["timespent_durationmin"]:0)*60; // We store duration in seconds
if (GETPOST("timehour") != '' && GETPOST("timehour") >= 0) // If hour was entered
@@ -307,7 +307,9 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
}
elseif ($object->fetch($id, $ref) >= 0)
{
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK) && method_exists($object, 'fetchComments') && empty($object->comments)) $object->fetchComments();
$result=$projectstatic->fetch($object->fk_project);
+ if(! empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) $projectstatic->fetchComments();
if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty();
$res=$projectstatic->fetch_optionals();
@@ -422,7 +424,16 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
{
if ($projectstatic->public || $userWrite > 0)
{
- $linktocreatetime = ''.$langs->trans('AddTimeSpent').'';
+ if (! empty($projectidforalltimes)) // We are on tab 'Time Spent' of project
+ {
+ $backtourl = $_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.($withproject?'&withproject=1':'');
+ $linktocreatetime = ''.$langs->trans('AddTimeSpent').'';
+ }
+ else // We are on tab 'Time Spent' of task
+ {
+ $backtourl = $_SERVER['PHP_SELF'].'?id='.$object->id.($withproject?'&withproject=1':'');
+ $linktocreatetime = ''.$langs->trans('AddTimeSpent').'';
+ }
}
else
{
@@ -600,7 +611,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
// Progress declared
print '';
- print $formother->select_percent(GETPOST('progress')?GETPOST('progress'):$object->progress,'progress');
+ print $formother->select_percent(GETPOST('progress')?GETPOST('progress'):$object->progress, 'progress', 0, 5, 0, 100, 1);
print ' | ';
print '';
@@ -785,7 +796,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
// Progress declared
print ' | ';
- print $formother->select_percent(GETPOST('progress')?GETPOST('progress'):$object->progress,'progress');
+ print $formother->select_percent(GETPOST('progress')?GETPOST('progress'):$object->progress, 'progress', 0, 5, 0, 100, 1);
print ' | ';
print '';
diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php
index 72f1a6b9242..6e08f06d630 100644
--- a/htdocs/public/agenda/agendaexport.php
+++ b/htdocs/public/agenda/agendaexport.php
@@ -42,13 +42,19 @@ if (! defined('NOCSRFCHECK')) define("NOCSRFCHECK",1); // We accept to go on
*
* @return void
*/
-function llxHeaderVierge() { print 'Export agenda cal'; }
+function llxHeaderVierge()
+{
+ print 'Export agenda cal';
+}
/**
* Footer function
*
* @return void
*/
-function llxFooterVierge() { print ''; }
+function llxFooterVierge()
+{
+ print '';
+}
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php
index 3d8057cbe85..3705c9945bc 100644
--- a/htdocs/public/donations/donateurs_code.php
+++ b/htdocs/public/donations/donateurs_code.php
@@ -30,13 +30,19 @@ define("NOCSRFCHECK",1); // We accept to go on this page from external web site.
*
* @return void
*/
-function llxHeaderVierge() { print 'Export agenda cal'; }
+function llxHeaderVierge()
+{
+ print 'Export agenda cal';
+}
/**
* Header function
*
* @return void
*/
-function llxFooterVierge() { print ''; }
+function llxFooterVierge()
+{
+ print '';
+}
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT .'/don/class/don.class.php';
diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php
index 4aa388ecf24..23511974137 100644
--- a/htdocs/public/emailing/mailing-read.php
+++ b/htdocs/public/emailing/mailing-read.php
@@ -36,13 +36,17 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no
*
* @return void
*/
-function llxHeader() { }
+function llxHeader()
+{
+}
/**
* Footer empty
*
* @return void
*/
-function llxFooter() { }
+function llxFooter()
+{
+}
require '../../main.inc.php';
diff --git a/htdocs/public/emailing/mailing-unsubscribe.php b/htdocs/public/emailing/mailing-unsubscribe.php
index 61e8ccdb0d6..1dc1477e7b4 100644
--- a/htdocs/public/emailing/mailing-unsubscribe.php
+++ b/htdocs/public/emailing/mailing-unsubscribe.php
@@ -35,13 +35,17 @@ if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); // If there is no
*
* @return void
*/
-function llxHeader() { }
+function llxHeader()
+{
+}
/**
* Footer empty
*
* @return void
*/
-function llxFooter() { }
+function llxFooter()
+{
+}
require '../../main.inc.php';
diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php
index 0250bb2c39f..614b10c976a 100644
--- a/htdocs/public/test/test_forms.php
+++ b/htdocs/public/test/test_forms.php
@@ -94,6 +94,6 @@ $array=array(1=>'Value 1',2=>'Value 2',3=>'Value 3');
$arrayselected=array(1,3);
print $form->multiselectarray('testmulti', $array, $arrayselected, '', 0, '', 0, 250);
-
+// End of page
llxFooter();
$db->close();
diff --git a/htdocs/public/website/index.php b/htdocs/public/website/index.php
index 436e352819a..862d8ada71a 100644
--- a/htdocs/public/website/index.php
+++ b/htdocs/public/website/index.php
@@ -34,13 +34,17 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
*
* @return void
*/
-function llxHeader() { }
+function llxHeader()
+{
+}
/**
* Footer empty
*
* @return void
*/
-function llxFooter() { }
+function llxFooter()
+{
+}
require '../../master.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -204,4 +208,3 @@ print ' |