';
print '
';
diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php
index 06eb51043b1..7bf46c30b86 100644
--- a/htdocs/hrm/class/evaluation.class.php
+++ b/htdocs/hrm/class/evaluation.class.php
@@ -30,8 +30,7 @@
// Put here all includes required by your class file
require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluationdet.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
+
/**
* Class for Evaluation
@@ -104,24 +103,24 @@ class Evaluation extends CommonObject
// BEGIN MODULEBUILDER PROPERTIES
/**
- * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
- 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"),
- 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => '1', 'position' => 20, 'notnull' => 1, 'visible' => 4, 'noteditable' => '1', 'default' => '(PROV)', 'index' => 1, 'searchall' => 1, 'showoncombobox' => '1', 'comment' => "Reference of object"),
- 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => '1', 'position' => 30, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => '2',),
- 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => '1', 'position' => 60, 'notnull' => 0, 'visible' => 3,),
- 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => '1', 'position' => 61, 'notnull' => 0, 'visible' => 0,),
- 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => '1', 'position' => 62, 'notnull' => 0, 'visible' => 0,),
- 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 500, 'notnull' => 1, 'visible' => -2,),
- 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 501, 'notnull' => 0, 'visible' => -2,),
- 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'UserAuthor', 'enabled' => '1', 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
- 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'UserModif', 'enabled' => '1', 'position' => 511, 'notnull' => -1, 'visible' => -2,),
- 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => '1', 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
- 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => '1', 'position' => 1000, 'notnull' => 1, 'default' => 0, 'visible' => 5, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '6' => 'Closed'),),
- 'date_eval' => array('type' => 'date', 'label' => 'DateEval', 'enabled' => '1', 'position' => 502, 'notnull' => 1, 'visible' => 1,),
- 'fk_user' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'Employee', 'enabled' => '1', 'position' => 504, 'notnull' => 1, 'visible' => 1, 'picto' => 'user', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'),
- 'fk_job' => array('type' => 'integer:Job:/hrm/class/job.class.php', 'label' => 'JobProfile', 'enabled' => '1', 'position' => 505, 'notnull' => 1, 'visible' => 1, 'picto' => 'jobprofile', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'),
+ 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
+ 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 4, 'noteditable' => 1, 'default' => '(PROV)', 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'comment' => "Reference of object"),
+ 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 0, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => '2',),
+ 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 3,),
+ 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 61, 'notnull' => 0, 'visible' => 0,),
+ 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 62, 'notnull' => 0, 'visible' => 0,),
+ 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2,),
+ 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2,),
+ 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
+ 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2,),
+ 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
+ 'status' => array('type' => 'smallint', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'default' => '0', 'visible' => 5, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '6' => 'Closed'),),
+ 'date_eval' => array('type' => 'date', 'label' => 'DateEval', 'enabled' => 1, 'position' => 502, 'notnull' => 1, 'visible' => 1,),
+ 'fk_user' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'Employee', 'enabled' => 1, 'position' => 504, 'notnull' => 1, 'visible' => 1, 'picto' => 'user', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'),
+ 'fk_job' => array('type' => 'integer:Job:/hrm/class/job.class.php', 'label' => 'JobProfile', 'enabled' => 1, 'position' => 505, 'notnull' => 1, 'visible' => 1, 'picto' => 'jobprofile', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'),
);
public $rowid;
public $ref;
@@ -322,8 +321,7 @@ class Evaluation extends CommonObject
$result = $object->createCommon($user);
if ($result < 0) {
$error++;
- $this->error = $object->error;
- $this->errors = $object->errors;
+ $this->setErrorsFromObject($object);
}
if (!$error) {
@@ -920,8 +918,7 @@ class Evaluation extends CommonObject
$result = $objectline->fetchAll('ASC', '', 0, 0, '(fk_evaluation:=:'.((int) $this->id).')');
if (is_numeric($result)) {
- $this->error = $objectline->error;
- $this->errors = $objectline->errors;
+ $this->setErrorsFromObject($objectline);
return $result;
} else {
$this->lines = $result;
@@ -1022,36 +1019,6 @@ class Evaluation extends CommonObject
return $result;
}
- /**
- * Action executed by scheduler
- * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
- * Use public function doScheduledJob($param1, $param2, ...) to get parameters
- *
- * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
- */
- public function doScheduledJob()
- {
- global $conf, $langs;
-
- //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log';
-
- $error = 0;
- $this->output = '';
- $this->error = '';
-
- dol_syslog(__METHOD__, LOG_DEBUG);
-
- $now = dol_now();
-
- $this->db->begin();
-
- // ...
-
- $this->db->commit();
-
- return $error;
- }
-
/**
* Return clicable link of object (with eventually picto)
*
diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php
index f0f2612d0c1..ad7c91c86d9 100644
--- a/htdocs/hrm/class/evaluationdet.class.php
+++ b/htdocs/hrm/class/evaluationdet.class.php
@@ -28,10 +28,9 @@
*/
// Put here all includes required by your class file
-require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
+require_once DOL_DOCUMENT_ROOT . '/core/class/commonobjectline.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/skillrank.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
+
/**
* Class for EvaluationLine
@@ -103,19 +102,19 @@ class EvaluationLine extends CommonObjectLine
// BEGIN MODULEBUILDER PROPERTIES
/**
- * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
- 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"),
- 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 500, 'notnull' => 1, 'visible' => -2,),
- 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 501, 'notnull' => 0, 'visible' => -2,),
- 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => '1', 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
- 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => '1', 'position' => 511, 'notnull' => -1, 'visible' => -2,),
- 'fk_skill' => array('type' => 'integer:Skill:hrm/class/skill.class.php:1', 'label' => 'Skill', 'enabled' => '1', 'position' => 3, 'notnull' => 1, 'visible' => 1, 'index' => 1,),
- 'fk_evaluation' => array('type' => 'integer:Evaluation:hrm/class/evaluation.class.php:1', 'label' => 'Evaluation', 'enabled' => '1', 'position' => 3, 'notnull' => 1, 'visible' => 1, 'index' => 1,),
- 'rankorder' => array('type' => 'integer', 'label' => 'Rank', 'enabled' => '1', 'position' => 4, 'notnull' => 1, 'visible' => 1,),
- 'required_rank' => array('type' => 'integer', 'label' => 'requiredRank', 'enabled' => '1', 'position' => 5, 'notnull' => 1, 'visible' => 1,),
- 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => '1', 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
+ 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
+ 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2,),
+ 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2,),
+ 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
+ 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2,),
+ 'fk_skill' => array('type' => 'integer:Skill:hrm/class/skill.class.php:1', 'label' => 'Skill', 'enabled' => 1, 'position' => 3, 'notnull' => 1, 'visible' => 1, 'index' => 1,),
+ 'fk_evaluation' => array('type' => 'integer:Evaluation:hrm/class/evaluation.class.php:1', 'label' => 'Evaluation', 'enabled' => 1, 'position' => 3, 'notnull' => 1, 'visible' => 1, 'index' => 1,),
+ 'rankorder' => array('type' => 'integer', 'label' => 'Rank', 'enabled' => 1, 'position' => 4, 'notnull' => 1, 'visible' => 1,),
+ 'required_rank' => array('type' => 'integer', 'label' => 'requiredRank', 'enabled' => 1, 'position' => 5, 'notnull' => 1, 'visible' => 1,),
+ 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
);
public $rowid;
public $date_creation;
@@ -288,8 +287,7 @@ class EvaluationLine extends CommonObjectLine
$result = $object->createCommon($user);
if ($result < 0) {
$error++;
- $this->error = $object->error;
- $this->errors = $object->errors;
+ $this->setErrorsFromObject($object);
}
if (!$error) {
@@ -890,8 +888,7 @@ class EvaluationLine extends CommonObjectLine
$result = $objectline->fetchAll('ASC', 'position', 0, 0, '(fk_evaluationdet:=:'.((int) $this->id).')');
if (is_numeric($result)) {
- $this->error = $objectline->error;
- $this->errors = $objectline->errors;
+ $this->setErrorsFromObject($objectline);
return $result;
} else {
$this->lines = $result;
@@ -992,37 +989,4 @@ class EvaluationLine extends CommonObjectLine
return $result;
}
-
- /**
- * Action executed by scheduler
- * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
- * Use public function doScheduledJob($param1, $param2, ...) to get parameters
- *
- * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
- */
- public function doScheduledJob()
- {
- global $conf, $langs;
-
- //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log';
-
- $error = 0;
- $this->output = '';
- $this->error = '';
-
- dol_syslog(__METHOD__, LOG_DEBUG);
-
- $now = dol_now();
-
- $this->db->begin();
-
- // ...
-
- $this->db->commit();
-
- return $error;
- }
}
-
-
-require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php
index c0ec08939d4..e1a355b54cd 100644
--- a/htdocs/hrm/class/job.class.php
+++ b/htdocs/hrm/class/job.class.php
@@ -29,8 +29,7 @@
// Put here all includes required by your class file
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
+
/**
* Class for Job
@@ -102,19 +101,19 @@ class Job extends CommonObject
// BEGIN MODULEBUILDER PROPERTIES
/**
- * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
- 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"),
- 'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => '1', 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => '1', 'comment' => "Label of object"),
- 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => '1', 'position' => 21, 'notnull' => 0, 'visible' => 1,),
- 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 500, 'notnull' => 1, 'visible' => 2,),
- 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 501, 'notnull' => 0, 'visible' => 2,),
- 'deplacement' => array('type' => 'select', 'required' => 1,'label' => 'NeedBusinessTravels', 'enabled' => 1, 'position' => 90, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => "No", 1 => "Yes"), 'default' => 0),
- 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => '1', 'position' => 70, 'notnull' => 0, 'visible' => 0,),
- 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => '1', 'position' => 71, 'notnull' => 0, 'visible' => 0,),
- 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => '1', 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
- 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => '1', 'position' => 511, 'notnull' => -1, 'visible' => -2,),
+ 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
+ 'label' => array('type' => 'varchar(128)', 'label' => 'Label', 'enabled' => 1, 'position' => 20, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'searchall' => 1, 'showoncombobox' => 1, 'comment' => "Label of object"),
+ 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 21, 'notnull' => 0, 'visible' => 1,),
+ 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => 2,),
+ 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => 2,),
+ 'deplacement' => array('type' => 'select', 'required' => 1,'label' => 'NeedBusinessTravels', 'enabled' => 1, 'position' => 90, 'notnull' => 1, 'visible' => 1, 'arrayofkeyval' => array(0 => "No", 1 => "Yes"), 'default' => '0'),
+ 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => 0,),
+ 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 71, 'notnull' => 0, 'visible' => 0,),
+ 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
+ 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2,),
);
public $rowid;
public $ref;
@@ -148,7 +147,7 @@ class Job extends CommonObject
// public $class_element_line = 'Jobline';
// /**
- // * @var array List of child tables. To test if we can delete object.
+ // * @var string[] List of child tables. To test if we can delete object.
// */
protected $childtables = array('hrm_evaluation', 'hrm_job_user');
@@ -292,8 +291,7 @@ class Job extends CommonObject
$result = $object->createCommon($user);
if ($result < 0) {
$error++;
- $this->error = $object->error;
- $this->errors = $object->errors;
+ $this->setErrorsFromObject($object);
}
if (!$error) {
@@ -928,8 +926,7 @@ class Job extends CommonObject
$result = $objectline->fetchAll('ASC', 'position', 0, 0, '(fk_job:=:'.((int) $this->id).')');
if (is_numeric($result)) {
- $this->error = $objectline->error;
- $this->errors = $objectline->errors;
+ $this->setErrorsFromObject($objectline);
return $result;
} else {
$this->lines = $result;
@@ -1031,36 +1028,6 @@ class Job extends CommonObject
return $result;
}
- /**
- * Action executed by scheduler
- * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
- * Use public function doScheduledJob($param1, $param2, ...) to get parameters
- *
- * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
- */
- public function doScheduledJob()
- {
- global $conf, $langs;
-
- //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log';
-
- $error = 0;
- $this->output = '';
- $this->error = '';
-
- dol_syslog(__METHOD__, LOG_DEBUG);
-
- $now = dol_now();
-
- $this->db->begin();
-
- // ...
-
- $this->db->commit();
-
- return $error;
- }
-
/**
* Return clicable link of object (with eventually picto)
*
@@ -1097,6 +1064,7 @@ class Job extends CommonObject
$return .= '
';
return $return;
}
+
/**
* function for get required skills associate to job object
* @param int $id Id of object
diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php
index f15e98131ca..f96cb1539a2 100644
--- a/htdocs/hrm/class/position.class.php
+++ b/htdocs/hrm/class/position.class.php
@@ -29,8 +29,6 @@
// Put here all includes required by your class file
require_once DOL_DOCUMENT_ROOT . '/core/class/commonobject.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
/**
* Class for Position
@@ -102,24 +100,24 @@ class Position extends CommonObject
// BEGIN MODULEBUILDER PROPERTIES
/**
- * @var array
|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
- 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 2, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
+ 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 2, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
//'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"),
- 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 500, 'notnull' => 1, 'visible' => -2,),
- 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 501, 'notnull' => 0, 'visible' => -2,),
+ 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2,),
+ 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2,),
'fk_contrat' => array('type' => 'integer:Contrat:contrat/class/contrat.class.php', 'label' => 'fk_contrat', 'enabled' => 'isModEnabled("contract")', 'position' => 50, 'notnull' => 0, 'visible' => 0,),
- 'fk_user' => array('type' => 'integer:User:user/class/user.class.php:0:(t.statut:=:1)', 'label' => 'Employee', 'enabled' => '1', 'position' => 55, 'notnull' => 1, 'visible' => 1, 'default' => 0, 'picto' => 'user', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'),
- 'fk_job' => array('type' => 'integer:Job:/hrm/class/job.class.php', 'label' => 'JobProfile', 'enabled' => '1', 'position' => 56, 'notnull' => 1, 'visible' => 1, 'picto' => 'jobprofile', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'),
- 'date_start' => array('type' => 'date', 'label' => 'DateStart', 'enabled' => '1', 'position' => 101, 'notnull' => 1, 'visible' => 1,),
- 'date_end' => array('type' => 'date', 'label' => 'DateEnd', 'enabled' => '1', 'position' => 102, 'notnull' => 0, 'visible' => 1,),
- 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => '1', 'position' => 120, 'notnull' => 0, 'visible' => 3,),
+ 'fk_user' => array('type' => 'integer:User:user/class/user.class.php:0:(t.statut:=:1)', 'label' => 'Employee', 'enabled' => 1, 'position' => 55, 'notnull' => 1, 'visible' => 1, 'default' => '0', 'picto' => 'user', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'),
+ 'fk_job' => array('type' => 'integer:Job:/hrm/class/job.class.php', 'label' => 'JobProfile', 'enabled' => 1, 'position' => 56, 'notnull' => 1, 'visible' => 1, 'picto' => 'jobprofile', 'css' => 'maxwidth300 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'),
+ 'date_start' => array('type' => 'date', 'label' => 'DateStart', 'enabled' => 1, 'position' => 101, 'notnull' => 1, 'visible' => 1,),
+ 'date_end' => array('type' => 'date', 'label' => 'DateEnd', 'enabled' => 1, 'position' => 102, 'notnull' => 0, 'visible' => 1,),
+ 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 120, 'notnull' => 0, 'visible' => 3,),
'abort_comment' => array('type' => 'varchar(255)', 'label' => 'AbandonmentComment', 'enabled' => 'getDolGlobalInt("HRM_JOB_POSITON_ENDING_COMMENT")', 'position' => 502, 'notnull' => 0, 'visible' => 1,),
- 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => '1', 'position' => 151, 'notnull' => 0, 'visible' => 0,),
- 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => '1', 'position' => 152, 'notnull' => 0, 'visible' => 0,),
- 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => '1', 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
- 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => '1', 'position' => 511, 'notnull' => -1, 'visible' => -2,),
+ 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 151, 'notnull' => 0, 'visible' => 0,),
+ 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 152, 'notnull' => 0, 'visible' => 0,),
+ 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
+ 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2,),
);
public $rowid;
public $ref;
@@ -301,8 +299,7 @@ class Position extends CommonObject
$result = $object->createCommon($user);
if ($result < 0) {
$error++;
- $this->error = $object->error;
- $this->errors = $object->errors;
+ $this->setErrorsFromObject($object);
}
if (!$error) {
@@ -970,8 +967,7 @@ class Position extends CommonObject
$result = $objectline->fetchAll('ASC', 'position', 0, 0, '(fk_position:=:'.((int) $this->id).')');
if (is_numeric($result)) {
- $this->error = $objectline->error;
- $this->errors = $objectline->errors;
+ $this->setErrorsFromObject($objectline);
return $result;
} else {
$this->lines = $result;
@@ -1088,36 +1084,6 @@ class Position extends CommonObject
return $result;
}
- /**
- * Action executed by scheduler
- * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
- * Use public function doScheduledJob($param1, $param2, ...) to get parameters
- *
- * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
- */
- public function doScheduledJob()
- {
- global $conf, $langs;
-
- //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log';
-
- $error = 0;
- $this->output = '';
- $this->error = '';
-
- dol_syslog(__METHOD__, LOG_DEBUG);
-
- $now = dol_now();
-
- $this->db->begin();
-
- // ...
-
- $this->db->commit();
-
- return $error;
- }
-
/**
* Return clicable link of object (with eventually picto)
*
diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php
index aefd68a0bea..256956d55de 100644
--- a/htdocs/hrm/class/skill.class.php
+++ b/htdocs/hrm/class/skill.class.php
@@ -29,8 +29,6 @@
// Put here all includes required by your class file
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
/**
* Class for Skill
@@ -108,22 +106,22 @@ class Skill extends CommonObject
// BEGIN MODULEBUILDER PROPERTIES
/**
- * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
- 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"),
- 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => '1', 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => '2',),
- 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => '1', 'position' => 60, 'notnull' => 0, 'visible' => 3,),
- 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 500, 'notnull' => 1, 'visible' => -2,),
- 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 501, 'notnull' => 0, 'visible' => -2,),
- 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'UserAuthor', 'enabled' => '1', 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
- 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'UserModif', 'enabled' => '1', 'position' => 511, 'notnull' => -1, 'visible' => -2,),
- 'required_level' => array('type' => 'integer', 'label' => 'requiredLevel', 'enabled' => '1', 'position' => 50, 'notnull' => 1, 'visible' => 0,),
- 'date_validite' => array('type' => 'integer', 'label' => 'date_validite', 'enabled' => '1', 'position' => 52, 'notnull' => 1, 'visible' => 0,),
- 'temps_theorique' => array('type' => 'double(24,8)', 'label' => 'temps_theorique', 'enabled' => '1', 'position' => 54, 'notnull' => 1, 'visible' => 0,),
- 'skill_type' => array('type' => 'integer', 'label' => 'SkillType', 'enabled' => '1', 'position' => 55, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'css' => 'minwidth200', 'arrayofkeyval' => array('0' => 'TypeKnowHow', '1' => 'TypeHowToBe', '9' => 'TypeKnowledge'), 'default' => 0),
- 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => '1', 'position' => 70, 'notnull' => 0, 'visible' => 0,),
- 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => '1', 'position' => 71, 'notnull' => 0, 'visible' => 0,),
+ 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
+ 'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'showoncombobox' => 2,),
+ 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 3,),
+ 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2,),
+ 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2,),
+ 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
+ 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php:0', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2,),
+ 'required_level' => array('type' => 'integer', 'label' => 'requiredLevel', 'enabled' => 1, 'position' => 50, 'notnull' => 1, 'visible' => 0,),
+ 'date_validite' => array('type' => 'integer', 'label' => 'date_validite', 'enabled' => 1, 'position' => 52, 'notnull' => 1, 'visible' => 0,),
+ 'temps_theorique' => array('type' => 'double(24,8)', 'label' => 'temps_theorique', 'enabled' => 1, 'position' => 54, 'notnull' => 1, 'visible' => 0,),
+ 'skill_type' => array('type' => 'integer', 'label' => 'SkillType', 'enabled' => 1, 'position' => 55, 'notnull' => 1, 'visible' => 1, 'index' => 1, 'css' => 'minwidth200', 'arrayofkeyval' => array('0' => 'TypeKnowHow', '1' => 'TypeHowToBe', '9' => 'TypeKnowledge'), 'default' => '0'),
+ 'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'position' => 70, 'notnull' => 0, 'visible' => 0,),
+ 'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'position' => 71, 'notnull' => 0, 'visible' => 0,),
);
public $rowid;
public $label;
@@ -261,7 +259,7 @@ class Skill extends CommonObject
$this->db->begin();
// Create level of skills
- for ($i; $i <= $MaxNumberSkill ; $i++) {
+ while ($i <= $MaxNumberSkill) {
$skilldet = new Skilldet($this->db);
$skilldet->description = $defaultSkillDesc . " " . $i;
$skilldet->rankorder = $i;
@@ -271,9 +269,10 @@ class Skill extends CommonObject
if ($result <= 0) {
$error++;
}
+ $i++;
}
- if (! $error) {
+ if (!$error) {
$this->db->commit();
setEventMessage($langs->trans('SkillCreated'), $i);
@@ -351,8 +350,7 @@ class Skill extends CommonObject
$result = $object->createCommon($user);
if ($result < 0) {
$error++;
- $this->error = $object->error;
- $this->errors = $object->errors;
+ $this->setErrorsFromObject($object);
}
if (!$error) {
@@ -414,8 +412,7 @@ class Skill extends CommonObject
if (is_array($this->lines)) {
return (count($this->lines) > 0) ? $this->lines : array();
} elseif ($this->lines < 0) {
- $this->errors = array_merge($this->errors, $skilldet->errors);
- $this->error = $skilldet->error;
+ $this->setErrorsFromObject($skilldet);
return $this->lines;
}
return [];
@@ -969,8 +966,7 @@ class Skill extends CommonObject
$result = $objectline->fetchAll('ASC', 'rankorder', 0, 0, '(fk_skill:=:'.((int) $this->id).')');
if (is_numeric($result)) {
- $this->error = $objectline->error;
- $this->errors = $objectline->errors;
+ $this->setErrorsFromObject($objectline);
return $result;
} else {
$this->lines = $result;
@@ -1072,36 +1068,6 @@ class Skill extends CommonObject
return $result;
}
- /**
- * Action executed by scheduler
- * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
- * Use public function doScheduledJob($param1, $param2, ...) to get parameters
- *
- * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
- */
- public function doScheduledJob()
- {
- global $conf, $langs;
-
- //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log';
-
- $error = 0;
- $this->output = '';
- $this->error = '';
-
- dol_syslog(__METHOD__, LOG_DEBUG);
-
- $now = dol_now();
-
- $this->db->begin();
-
- // ...
-
- $this->db->commit();
-
- return $error;
- }
-
/**
* @param int $code number of code label
* @return int|string
diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php
index 83ccae8c5ab..12258e08025 100644
--- a/htdocs/hrm/class/skilldet.class.php
+++ b/htdocs/hrm/class/skilldet.class.php
@@ -29,8 +29,6 @@
// Put here all includes required by your class file
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
-//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
/**
* Class for Skilldet
@@ -102,15 +100,15 @@ class Skilldet extends CommonObjectLine
// BEGIN MODULEBUILDER PROPERTIES
/**
- * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
- 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"),
- 'fk_skill' => array('type' => 'integer:Skill:/hrm/class/skill.class.php', 'label' => 'fk_skill', 'enabled' => '1', 'position' => 5, 'notnull' => 1, 'visible' => 0,),
- 'rankorder' => array('type' => 'integer', 'label' => 'rank', 'enabled' => '1', 'position' => 10, 'notnull' => 0, 'visible' => 2,),
- 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => '1', 'position' => 60, 'notnull' => 0, 'visible' => 1,),
- 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => '1', 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
- 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => '1', 'position' => 511, 'notnull' => -1, 'visible' => 0,),
+ 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
+ 'fk_skill' => array('type' => 'integer:Skill:/hrm/class/skill.class.php', 'label' => 'fk_skill', 'enabled' => 1, 'position' => 5, 'notnull' => 1, 'visible' => 0,),
+ 'rankorder' => array('type' => 'integer', 'label' => 'rank', 'enabled' => 1, 'position' => 10, 'notnull' => 0, 'visible' => 2,),
+ 'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'position' => 60, 'notnull' => 0, 'visible' => 1,),
+ 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
+ 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => 0,),
);
public $rowid;
public $fk_skill;
@@ -283,8 +281,7 @@ class Skilldet extends CommonObjectLine
$result = $object->createCommon($user);
if ($result < 0) {
$error++;
- $this->error = $object->error;
- $this->errors = $object->errors;
+ $this->setErrorsFromObject($object);
}
if (!$error) {
@@ -959,34 +956,4 @@ class Skilldet extends CommonObjectLine
return $result;
}
-
- /**
- * Action executed by scheduler
- * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
- * Use public function doScheduledJob($param1, $param2, ...) to get parameters
- *
- * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
- */
- public function doScheduledJob()
- {
- global $conf, $langs;
-
- //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log';
-
- $error = 0;
- $this->output = '';
- $this->error = '';
-
- dol_syslog(__METHOD__, LOG_DEBUG);
-
- $now = dol_now();
-
- $this->db->begin();
-
- // ...
-
- $this->db->commit();
-
- return $error;
- }
}
diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php
index 245a6d8ba6c..4c599235f72 100644
--- a/htdocs/hrm/class/skillrank.class.php
+++ b/htdocs/hrm/class/skillrank.class.php
@@ -104,18 +104,18 @@ class SkillRank extends CommonObject
// BEGIN MODULEBUILDER PROPERTIES
/**
- * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
- 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"),
- 'fk_skill' => array('type' => 'integer:Skill:hrm/class/skill.class.php:1', 'label' => 'Skill', 'enabled' => '1', 'position' => 3, 'notnull' => 1, 'visible' => 1, 'index' => 1,),
- 'rankorder' => array('type' => 'integer', 'label' => 'Rank', 'enabled' => '1', 'position' => 4, 'notnull' => 1, 'visible' => 1, 'default' => 0),
- 'fk_object' => array('type' => 'integer', 'label' => 'object', 'enabled' => '1', 'position' => 5, 'notnull' => 1, 'visible' => 0,),
- 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 500, 'notnull' => 1, 'visible' => -2,),
- 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 501, 'notnull' => 0, 'visible' => -2,),
- 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => '1', 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
- 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => '1', 'position' => 511, 'notnull' => -1, 'visible' => -2,),
- 'objecttype' => array('type' => 'varchar(128)', 'label' => 'objecttype', 'enabled' => '1', 'position' => 6, 'notnull' => 1, 'visible' => 0,),
+ 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
+ 'fk_skill' => array('type' => 'integer:Skill:hrm/class/skill.class.php:1', 'label' => 'Skill', 'enabled' => 1, 'position' => 3, 'notnull' => 1, 'visible' => 1, 'index' => 1,),
+ 'rankorder' => array('type' => 'integer', 'label' => 'Rank', 'enabled' => 1, 'position' => 4, 'notnull' => 1, 'visible' => 1, 'default' => '0'),
+ 'fk_object' => array('type' => 'integer', 'label' => 'object', 'enabled' => 1, 'position' => 5, 'notnull' => 1, 'visible' => 0,),
+ 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2,),
+ 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => -2,),
+ 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
+ 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2,),
+ 'objecttype' => array('type' => 'varchar(128)', 'label' => 'objecttype', 'enabled' => 1, 'position' => 6, 'notnull' => 1, 'visible' => 0,),
);
public $rowid;
public $fk_skill;
@@ -309,8 +309,7 @@ class SkillRank extends CommonObject
$result = $object->createCommon($user);
if ($result < 0) {
$error++;
- $this->error = $object->error;
- $this->errors = $object->errors;
+ $this->setErrorsFromObject($object);
}
if (!$error) {
@@ -1033,51 +1032,4 @@ class SkillRank extends CommonObject
return $result;
}
-
- /**
- * Action executed by scheduler
- * CAN BE A CRON TASK. In such a case, parameters come from the schedule job setup field 'Parameters'
- * Use public function doScheduledJob($param1, $param2, ...) to get parameters
- *
- * @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
- */
- public function doScheduledJob()
- {
- global $conf, $langs;
-
- //$conf->global->SYSLOG_FILE = 'DOL_DATA_ROOT/dolibarr_mydedicatedlofile.log';
-
- $error = 0;
- $this->output = '';
- $this->error = '';
-
- dol_syslog(__METHOD__, LOG_DEBUG);
-
- $now = dol_now();
-
- $this->db->begin();
-
- // ...
-
- $this->db->commit();
-
- return $error;
- }
-
- /**
- * @param array $val
- * @param string $key
- * @param string $value
- * @param string $moreparam
- * @param string $keysuffix
- * @param string $keyprefix
- * @param string $morecss
- * @return string
- */
- // public function showOutputField($val, $key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '')
- // {
- // if ($key == "rank") {
- // return displayRankInfos($this);
- // } else return parent::showOutputField($val, $key, $value, $moreparam, $keysuffix, $keyprefix, $morecss);
- // }
}
diff --git a/htdocs/hrm/compare.php b/htdocs/hrm/compare.php
index a75965f797e..8286c7f0cf4 100644
--- a/htdocs/hrm/compare.php
+++ b/htdocs/hrm/compare.php
@@ -4,6 +4,7 @@
* Copyright (C) 2021 Greg Rastklan
* Copyright (C) 2021 Jean-Pascal BOUDET
* Copyright (C) 2021 Grégory BLEMAND
+ * Copyright (C) 2024 Frédéric 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
@@ -278,6 +279,7 @@ $fk_usergroup1 = GETPOST('fk_usergroup1');
print dol_get_fiche_end();
llxFooter();
+$db->close();
@@ -357,10 +359,10 @@ function rate(&$TMergedSkills, $field)
}
/**
- * return a html ul list of skills
+ * return a html ul list of skills
*
- * @param array $TMergedSkills skill list for display
- * @return string (ul list in html )
+ * @param array $TMergedSkills skill list for display
+ * @return string (ul list in html )
*/
function skillList(&$TMergedSkills)
{
diff --git a/htdocs/hrm/skill_tab.php b/htdocs/hrm/skill_tab.php
index c7a0e1bd988..a1e71528361 100644
--- a/htdocs/hrm/skill_tab.php
+++ b/htdocs/hrm/skill_tab.php
@@ -4,6 +4,7 @@
* Copyright (C) 2021 Greg Rastklan
* Copyright (C) 2021 Jean-Pascal BOUDET
* Copyright (C) 2021 Grégory BLEMAND
+ * Copyright (C) 2024 Frédéric 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
@@ -481,6 +482,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$rslt = $db->query($sqlEval);
$numEval = $db->num_rows($sqlEval);
+ $page = 0;
print_barre_liste($langs->trans("Evaluations"), $page, $_SERVER["PHP_SELF"], '', '', '', '', $numEval, $numEval, $evaltmp->picto, 0);
print '';
@@ -547,6 +549,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
print dol_get_fiche_end();
-
- llxFooter();
}
+
+llxFooter();
+$db->close();
diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php
index 8abfb691119..871030cb774 100644
--- a/htdocs/install/inc.php
+++ b/htdocs/install/inc.php
@@ -7,6 +7,7 @@
* Copyright (C) 2016 Raphaël Doursenaud
* Copyright (C) 2021 Charlene Benke
* Copyright (C) 2023 Alexandre Janniaux
+ * Copyright (C) 2024 MDW
*
* 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
@@ -140,24 +141,39 @@ if (php_sapi_name() === "cli" && (float) PHP_VERSION > 7.0) {
case 'config':
$conffile = $arg;
$conffiletoshow = $arg;
- break;
+ break;
case 'h':
case 'help':
usage($argv[0], "Usage:");
- exit(0);
+ exit(0);
}
}
// Parse the arguments to find the options.
- $args_options = array_filter(array_slice($argv, 0, $rest_index), function ($arg) {
- return strlen($arg) >= 2 && $arg[0] == '-';
- });
- $parsed_options = array_map(function ($arg) {
- if (strlen($arg) > 1) {
- return "--" . $arg;
+ $args_options = array_filter(
+ array_slice($argv, 0, $rest_index),
+ /**
+ * @param string $arg
+ * @return bool
+ */
+ static function ($arg) {
+ return strlen($arg) >= 2 && $arg[0] == '-';
}
- return "-" . $arg;
- }, array_keys($opts));
+ );
+ $parsed_options = array_map(
+ /**
+ * Previx option with '-' for single characters and -- for more than single characters
+ * @param string $arg
+ * @return string
+ */
+ static function ($arg) {
+ if (strlen($arg) > 1) {
+ return "--" . $arg;
+ }
+ return "-" . $arg;
+ },
+ array_keys($opts)
+ );
// Find options (dash-prefixed) that were not parsed.
$unknown_options = array_diff($args_options, $parsed_options);
@@ -301,7 +317,7 @@ if (constant('DOL_DATA_ROOT') === null) {
$lockfile = '../../documents/install.lock';
$upgradeunlockfile = '../../documents/upgrade.unlock';
}
-$islocked=false;
+$islocked = false;
if (@file_exists($lockfile) || @file_exists($lockfile2)) {
if (!defined('ALLOWED_IF_UPGRADE_UNLOCK_FOUND') || (! @file_exists($upgradeunlockfile) && ! @file_exists($upgradeunlockfile2))) {
// If this is a dangerous install page (ALLOWED_IF_UPGRADE_UNLOCK_FOUND not defined) or
diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql
index 958a0c65797..5ed3730adc1 100644
--- a/htdocs/install/mysql/data/llx_c_action_trigger.sql
+++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql
@@ -60,7 +60,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_VALIDATE','Customer invoice validated','Executed when a customer invoice is approved','facture',6);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_MODIFY','Customer invoice modified','Executed when a customer invoice is modified','facture',7);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_PAYED','Customer invoice payed','Executed when a customer invoice is payed','facture',7);
-insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is conceled','facture',8);
+insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_CANCEL','Customer invoice canceled','Executed when a customer invoice is canceled','facture',8);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_SENTBYMAIL','Customer invoice sent by mail','Executed when a customer invoice is sent by mail','facture',9);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_UNVALIDATE','Customer invoice unvalidated','Executed when a customer invoice status set back to draft','facture',9);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('BILL_DELETE','Customer invoice deleted','Executed when a customer invoice is deleted','facture',9);
diff --git a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql
index 4f50ee95936..9c9f6dd01ee 100644
--- a/htdocs/install/mysql/migration/19.0.0-20.0.0.sql
+++ b/htdocs/install/mysql/migration/19.0.0-20.0.0.sql
@@ -232,8 +232,8 @@ ALTER TABLE llx_knowledgemanagement_knowledgerecord MODIFY COLUMN answer longtex
-- Rename const to add customer categories on not customer/prospect third-party if enabled
UPDATE llx_const SET name = 'THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT' WHERE name = 'THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER';
-ALTER TABLE llx_fichinter ADD COLUMN signed_status integer DEFAULT NULL AFTER duree;
-ALTER TABLE llx_contrat ADD COLUMN signed_status integer DEFAULT NULL AFTER date_contrat;
+ALTER TABLE llx_fichinter ADD COLUMN signed_status smallint DEFAULT NULL AFTER duree;
+ALTER TABLE llx_contrat ADD COLUMN signed_status smallint DEFAULT NULL AFTER date_contrat;
ALTER TABLE llx_mailing ADD COLUMN messtype varchar(16) DEFAULT 'email' after rowid;
@@ -268,3 +268,11 @@ ALTER TABLE llx_facture_fourn ADD INDEX idx_facture_fourn_tms (tms);
ALTER TABLE llx_element_element MODIFY COLUMN sourcetype VARCHAR(64) NOT NULL;
ALTER TABLE llx_element_element MODIFY COLUMN targettype VARCHAR(64) NOT NULL;
ALTER TABLE llx_c_type_contact MODIFY COLUMN element VARCHAR(64) NOT NULL;
+
+ALTER TABLE llx_product_association ADD COLUMN import_key varchar(14) DEFAULT NULL;
+
+ALTER TABLE llx_ticket ADD COLUMN barcode varchar(255) DEFAULT NULL after extraparams;
+ALTER TABLE llx_ticket ADD COLUMN fk_barcode_type integer DEFAULT NULL after barcode;
+
+ALTER TABLE llx_ticket ADD UNIQUE INDEX uk_ticket_barcode_barcode_type (barcode, fk_barcode_type, entity);
+ALTER TABLE llx_ticket ADD CONSTRAINT llx_ticket_fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type (rowid);
diff --git a/htdocs/install/mysql/tables/llx_actioncomm.sql b/htdocs/install/mysql/tables/llx_actioncomm.sql
index 54eac887362..eccb6f49fe8 100644
--- a/htdocs/install/mysql/tables/llx_actioncomm.sql
+++ b/htdocs/install/mysql/tables/llx_actioncomm.sql
@@ -17,7 +17,7 @@
-- along with this program. If not, see .
--
--
--- Table of events and actions (past and to do).
+-- Table of events and actions (past and to do).
-- This is also the table to track events on other Dolibarr objects.
-- ========================================================================
@@ -31,7 +31,7 @@ create table llx_actioncomm
datep2 datetime, -- date end
fk_action integer, -- type of action (optional link with id in llx_c_actioncomm or null)
- code varchar(50) NULL, -- code of action for automatic action ('AC_OTH_AUTO' for automatic actions, 'AC_EMAILIN_AUTO' for email input, 'AC_xxx' for manual action...)
+ code varchar(50) NULL, -- code of action for automatic action ('AC_OTH_AUTO' for automatic actions, 'AC_EMAILIN_AUTO' for email input, 'AC_xxx' for manual action...)
datec datetime, -- date creation
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- last modification date
@@ -43,7 +43,6 @@ create table llx_actioncomm
fk_contact integer,
fk_parent integer NOT NULL default 0,
fk_user_action integer, -- user id of owner of action (note that users assigned to event are stored into table 'actioncomm_resources')
- fk_user_done integer, -- user id of user that has made action (deprecated)
transparency integer, -- transparency (ical standard). used to say if user assigned to event are busy or not by event. This field may be deprecated if we want to store transparency for each assigned user, moved into table llx_actioncomm_resources.
@@ -56,9 +55,9 @@ create table llx_actioncomm
label varchar(255) NOT NULL, -- label/title of event or topic of email
note mediumtext, -- private note of event or content of email
-
+
calling_duration integer, -- when event is a phone call, duration of phone call
-
+
email_subject varchar(255), -- when event was an email, we store here the subject. content is stored into note.
email_msgid varchar(255), -- when event was an email, we store here the msgid
email_from varchar(255), -- when event was an email, we store here the from
@@ -68,7 +67,7 @@ create table llx_actioncomm
email_tobcc varchar(255), -- when event was an email, we store here the email_tobcc
errors_to varchar(255), -- when event was an email, we store here the erros_to
reply_to varchar(255), -- when event was an email, we store here the reply_to
-
+
recurid varchar(128), -- used to store event id to link each other all the repeating event record. It can be the 'iCalUID' as in RFC5545 (an id similar for all the same serie)
recurrule varchar(128), -- contains string with ical format recurring rule like 'FREQ=MONTHLY;INTERVAL=2;BYMONTHDAY=19' or 'FREQ=WEEKLY;BYDAY=MO'
recurdateend datetime, -- no more recurring event after this date
diff --git a/htdocs/install/mysql/tables/llx_contrat.sql b/htdocs/install/mysql/tables/llx_contrat.sql
index 2e01e909127..53c97061102 100644
--- a/htdocs/install/mysql/tables/llx_contrat.sql
+++ b/htdocs/install/mysql/tables/llx_contrat.sql
@@ -29,7 +29,7 @@ create table llx_contrat
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
datec datetime, -- creation date
date_contrat datetime,
- signed_status integer DEFAULT NULL, -- signed status
+ signed_status smallint DEFAULT NULL, -- signed status
statut smallint DEFAULT 0, -- not used. deprecated
fin_validite datetime,
date_cloture datetime,
diff --git a/htdocs/install/mysql/tables/llx_fichinter.sql b/htdocs/install/mysql/tables/llx_fichinter.sql
index 4065f3c64b8..5832ce07e9f 100644
--- a/htdocs/install/mysql/tables/llx_fichinter.sql
+++ b/htdocs/install/mysql/tables/llx_fichinter.sql
@@ -39,7 +39,7 @@ create table llx_fichinter
datee date, -- date de fin d'intervention
datet date, -- date de terminaison de l'intervention
duree real, -- duree totale de l'intervention
- signed_status integer DEFAULT NULL, -- signed status
+ signed_status smallint DEFAULT NULL, -- signed status
description text,
note_private text,
note_public text,
diff --git a/htdocs/install/mysql/tables/llx_product_association.key.sql b/htdocs/install/mysql/tables/llx_product_association.key.sql
index 9eb9fdd457b..c9dca6e611e 100644
--- a/htdocs/install/mysql/tables/llx_product_association.key.sql
+++ b/htdocs/install/mysql/tables/llx_product_association.key.sql
@@ -20,3 +20,4 @@
ALTER TABLE llx_product_association ADD UNIQUE INDEX uk_product_association (fk_product_pere, fk_product_fils);
ALTER TABLE llx_product_association ADD INDEX idx_product_association_fils (fk_product_fils);
+
diff --git a/htdocs/install/mysql/tables/llx_product_association.sql b/htdocs/install/mysql/tables/llx_product_association.sql
index f97e2aa6a0b..55ce8cc9d78 100644
--- a/htdocs/install/mysql/tables/llx_product_association.sql
+++ b/htdocs/install/mysql/tables/llx_product_association.sql
@@ -24,6 +24,7 @@ create table llx_product_association
fk_product_fils integer NOT NULL DEFAULT 0, -- id du sous-produit
qty double NULL,
incdec integer DEFAULT 1, -- when set to 1 changing stock of product will change stock of linked product too
- rang integer DEFAULT 0
+ rang integer DEFAULT 0,
+ import_key varchar(14) DEFAULT NULL
)ENGINE=innodb;
diff --git a/htdocs/install/mysql/tables/llx_ticket-ticket.key.sql b/htdocs/install/mysql/tables/llx_ticket-ticket.key.sql
index 858f7c7eec5..e7bd5174263 100644
--- a/htdocs/install/mysql/tables/llx_ticket-ticket.key.sql
+++ b/htdocs/install/mysql/tables/llx_ticket-ticket.key.sql
@@ -22,7 +22,10 @@ ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_user_assign (fk_user_assign);
ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_project (fk_project);
ALTER TABLE llx_ticket ADD INDEX idx_ticket_fk_statut (fk_statut);
+ALTER TABLE llx_ticket ADD UNIQUE INDEX uk_ticket_barcode_barcode_type (barcode, fk_barcode_type, entity);
+ALTER TABLE llx_ticket ADD CONSTRAINT llx_ticket_fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type (rowid);
+
-- Idea for better perf to get last num of ticket on large databases
---ALTER TABLE llx_ticket ADD COLUMN calculated_numrefonly INTEGER AS (CASE SUBSTRING(ref FROM 1 FOR 2) WHEN 'TS' THEN CAST(SUBSTRING(ref FROM 8) AS SIGNED) ELSE 0 END) PERSISTENT;
---ALTER TABLE llx_ticket ADD INDEX idx_calculated_numrefonly (calculated_numrefonly);
---Then, the numering module can use the column calculated_numrefonly to get the max with SELECT MAX(calculated_numrefonly) FROM llx_ticket
+-- ALTER TABLE llx_ticket ADD COLUMN calculated_numrefonly INTEGER AS (CASE SUBSTRING(ref FROM 1 FOR 2) WHEN 'TS' THEN CAST(SUBSTRING(ref FROM 8) AS SIGNED) ELSE 0 END) PERSISTENT;
+-- ALTER TABLE llx_ticket ADD INDEX idx_calculated_numrefonly (calculated_numrefonly);
+-- Then, the numering module can use the column calculated_numrefonly to get the max with SELECT MAX(calculated_numrefonly) FROM llx_ticket
diff --git a/htdocs/install/mysql/tables/llx_ticket-ticket.sql b/htdocs/install/mysql/tables/llx_ticket-ticket.sql
index 67e7ca419dd..cda890c6f69 100644
--- a/htdocs/install/mysql/tables/llx_ticket-ticket.sql
+++ b/htdocs/install/mysql/tables/llx_ticket-ticket.sql
@@ -49,5 +49,7 @@ CREATE TABLE llx_ticket
model_pdf varchar(255),
last_main_doc varchar(255), -- relative filepath+filename of last main generated document
extraparams varchar(255), -- to save other parameters with json format
+ barcode varchar(255) DEFAULT NULL, -- barcode
+ fk_barcode_type integer DEFAULT NULL, -- barcode type
import_key varchar(14)
)ENGINE=innodb;
diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php
index bd4aeec2174..21168aea09f 100644
--- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php
+++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php
@@ -99,26 +99,26 @@ class KnowledgeRecord extends CommonObject
// BEGIN MODULEBUILDER PROPERTIES
/**
- * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
+ * @var array|string,position:int,notnull:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
*/
public $fields = array(
- 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => '1', 'index' => 1, 'css' => 'left', 'comment' => "Id"),
- 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'default' => '(PROV)', 'visible' => 5, 'index' => 1, 'searchall' => 1, 'comment' => "Reference of object", "csslist" => "nowraponall", "showoncombobox" => 1),
- 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 20, 'index' => 1),
- 'question' => array('type' => 'text', 'label' => 'Question', 'enabled' => '1', 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'csslist' => 'tdoverflowmax300', 'copytoclipboard' => 1, 'tdcss' => 'titlefieldcreate nowraponall'),
- 'lang' => array('type' => 'varchar(6)', 'label' => 'Language', 'enabled' => '1', 'position' => 40, 'notnull' => 0, 'visible' => 1, 'tdcss' => 'titlefieldcreate nowraponall', "csslist" => "tdoverflowmax100"),
- 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => '1', 'position' => 500, 'notnull' => 1, 'visible' => -2,),
- 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => '1', 'position' => 501, 'notnull' => 0, 'visible' => 2,),
- 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => '1', 'position' => 600, 'notnull' => 0, 'visible' => 0,),
- 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserCreation', 'enabled' => '1', 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
- 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => '1', 'position' => 511, 'notnull' => -1, 'visible' => -2,),
- 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => '1', 'position' => 512, 'notnull' => 0, 'visible' => -2,),
- 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => '1', 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
- 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => '1', 'position' => 1010, 'notnull' => -1, 'visible' => 0,),
+ 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"),
+ 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'default' => '(PROV)', 'visible' => 5, 'index' => 1, 'searchall' => 1, 'comment' => "Reference of object", "csslist" => "nowraponall", "showoncombobox" => 1),
+ 'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => '1', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 20, 'index' => 1),
+ 'question' => array('type' => 'text', 'label' => 'Question', 'enabled' => 1, 'position' => 30, 'notnull' => 1, 'visible' => 1, 'searchall' => 1, 'csslist' => 'tdoverflowmax300', 'copytoclipboard' => 1, 'tdcss' => 'titlefieldcreate nowraponall'),
+ 'lang' => array('type' => 'varchar(6)', 'label' => 'Language', 'enabled' => 1, 'position' => 40, 'notnull' => 0, 'visible' => 1, 'tdcss' => 'titlefieldcreate nowraponall', "csslist" => "tdoverflowmax100"),
+ 'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'position' => 500, 'notnull' => 1, 'visible' => -2,),
+ 'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'position' => 501, 'notnull' => 0, 'visible' => 2,),
+ 'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => 0,),
+ 'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserCreation', 'enabled' => 1, 'position' => 510, 'notnull' => 1, 'visible' => -2, 'foreignkey' => 'user.rowid',),
+ 'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'enabled' => 1, 'position' => 511, 'notnull' => -1, 'visible' => -2,),
+ 'fk_user_valid' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserValidation', 'enabled' => 1, 'position' => 512, 'notnull' => 0, 'visible' => -2,),
+ 'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'position' => 1000, 'notnull' => -1, 'visible' => -2,),
+ 'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'position' => 1010, 'notnull' => -1, 'visible' => 0,),
//'url' => array('type'=>'varchar(255)', 'label'=>'URL', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflow200', 'help'=>'UrlForInfoPage'),
'fk_c_ticket_category' => array('type' => 'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos', 'label' => 'SuggestedForTicketsInGroup', 'enabled' => 'isModEnabled("ticket")', 'position' => 520, 'notnull' => 0, 'visible' => -1, 'help' => 'YouCanLinkArticleToATicketCategory', 'csslist' => 'minwidth200 tdoverflowmax250'),
- 'answer' => array('type' => 'html', 'label' => 'Solution', 'enabled' => '1', 'position' => 600, 'notnull' => 0, 'visible' => 3, 'searchall' => 1, 'csslist' => 'tdoverflowmax300', 'copytoclipboard' => 1, 'tdcss' => 'titlefieldcreate nowraponall'),
- 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => '1', 'position' => 1000, 'notnull' => 1, 'visible' => 5, 'default' => 0, 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '9' => 'Obsolete'),),
+ 'answer' => array('type' => 'html', 'label' => 'Solution', 'enabled' => 1, 'position' => 600, 'notnull' => 0, 'visible' => 3, 'searchall' => 1, 'csslist' => 'tdoverflowmax300', 'copytoclipboard' => 1, 'tdcss' => 'titlefieldcreate nowraponall'),
+ 'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'position' => 1000, 'notnull' => 1, 'visible' => 5, 'default' => '0', 'index' => 1, 'arrayofkeyval' => array('0' => 'Draft', '1' => 'Validated', '9' => 'Obsolete'),),
);
public $rowid;
public $ref;
@@ -189,7 +189,7 @@ class KnowledgeRecord extends CommonObject
*/
public function __construct(DoliDB $db)
{
- global $conf, $langs;
+ global $langs;
$this->db = $db;
diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php
index 3d509d7d25c..c4652df83b1 100644
--- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php
+++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_standard.php
@@ -1,6 +1,7 @@
* Copyright (C) 2005-2009 Regis Houssin
+ * Copyright (C) 2024 MDW
*
* 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
@@ -154,7 +155,7 @@ class mod_knowledgerecord_standard extends ModeleNumRefKnowledgeRecord
if ($max >= (pow(10, 4) - 1)) {
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
} else {
- $num = sprintf("%04s", $max + 1);
+ $num = sprintf("%04d", $max + 1);
}
dol_syslog("mod_knowledgerecord_standard::getNextValue return ".$this->prefix.$yymm."-".$num);
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 576180c6371..f20f46f5c03 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -88,6 +88,8 @@ SearchString=Search string
NotAvailableWhenAjaxDisabled=Not available when Ajax disabled
AllowToSelectProjectFromOtherCompany=On document of a third party, can choose a project linked to another third party
TimesheetPreventAfterFollowingMonths=Prevent recording time spent after the following number of months
+PROJECT_DISPLAY_LINKED_BY_CONTACT=Display project linked by a common contact
+PROJECT_DISPLAY_LINKED_BY_CONTACT_help=That option add a new list on Project tab with all projects linked to that thirdparty via a contact relationship
JavascriptDisabled=JavaScript disabled
UsePreviewTabs=Use preview tabs
ShowPreview=Show preview
diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang
index 70ce8809858..8ce39450cd8 100644
--- a/htdocs/langs/en_US/agenda.lang
+++ b/htdocs/langs/en_US/agenda.lang
@@ -21,7 +21,6 @@ MenuDoneMyActions=My terminated events
ListOfEvents=List of events (default calendar)
ActionsAskedBy=Events reported by
ActionsToDoBy=Events assigned to
-ActionsDoneBy=Events done by
ActionAssignedTo=Event assigned to
ViewCal=Month view
ViewDay=Day view
diff --git a/htdocs/langs/en_US/commercial.lang b/htdocs/langs/en_US/commercial.lang
index 2f6e4da03dc..7b0ab3ed30e 100644
--- a/htdocs/langs/en_US/commercial.lang
+++ b/htdocs/langs/en_US/commercial.lang
@@ -47,7 +47,6 @@ LastProspectToContact=To contact
LastProspectContactInProcess=Contact in process
LastProspectContactDone=Contact done
ActionAffectedTo=Event assigned to
-ActionDoneBy=Event done by
ActionAC_TEL=Phone call
ActionAC_FAX=Send fax
ActionAC_PROP=Send proposal by mail
diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang
index 57b3cf539cf..526483b1339 100644
--- a/htdocs/langs/en_US/companies.lang
+++ b/htdocs/langs/en_US/companies.lang
@@ -6,7 +6,7 @@ ErrorSetACountryFirst=Set the country first
SelectThirdParty=Select a third party
ConfirmDeleteCompany=Are you sure you want to delete this company and all related information?
DeleteContact=Delete a contact/address
-ConfirmDeleteContact=Are you sure you want to delete this contact and all related information?
+ConfirmDeleteContact=Are you sure you want to delete this contact?
MenuNewThirdParty=New Third Party
MenuNewCustomer=New Customer
MenuNewProspect=New Prospect
@@ -527,4 +527,4 @@ HideSocialNetworks=Hide social networks
ExternalSystemID=External system ID
IDOfPaymentInAnExternalSystem=ID of the payment mode into an external system (like Stripe, Paypal, ...)
AADEWebserviceCredentials=AADE Webservice Credentials
-ThirdPartyMustBeACustomerToCreateBANOnStripe=The third-party must be a customer to allow the creation of its bank info on Stripe side
+ThirdPartyMustBeACustomerToCreateBANOnStripe=The third-party must be a customer to allow the creation of its bank info on Stripe side
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 3290d9a2251..d8ebfa352e5 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -332,6 +332,8 @@ ErrorDictionaryNotFound=Dictionary %s not found
ErrorFailedToCreateSymLinkToMedias=Failed to create the symbolic link %s to point to %s
ErrorCheckTheCommandInsideTheAdvancedOptions=Check the command used for the export into the Advanced options of the export
+ErrorEndTimeMustBeGreaterThanStartTime=End time must be greater than start time
+ErrorIncoherentDates=Date start must be less than date end
# Warnings
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
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.
@@ -374,7 +376,7 @@ WarningModuleNeedRefresh = Module %s has been disabled. Don't forget to e
WarningPermissionAlreadyExist=Existing permissions for this object
WarningGoOnAccountancySetupToAddAccounts=If this list is empty, go into menu %s - %s - %s to load or create accounts for your chart of account.
WarningCorrectedInvoiceNotFound=Corrected invoice not found
-WarningCommentNotFound=Please check placement of start and end comments for %s section in file %s before submitting your action
+WarningCommentNotFound=Warning: Can't find the start and/or end comments for the section %s into the file %s
WarningAlreadyReverse=Stock movement already reversed
SwissQrOnlyVIR = SwissQR invoice can only be added on invoices set to be paid with credit transfer payments.
@@ -412,3 +414,4 @@ ThisIdNotDefined=Id not defined
OperNotDefined=Payment method not defined
ErrorThisContactXIsAlreadyDefinedAsThisType=%s is already defined as contact for this type.
ErrorThisGroupIsAlreadyDefinedAsThisType=The contacts with this group are already defined as contact for this type.
+EmptyMessageNotAllowedError=Empty Message Not Allowed Error
diff --git a/htdocs/langs/en_US/help.lang b/htdocs/langs/en_US/help.lang
index 17a6104d59a..88a1b006591 100644
--- a/htdocs/langs/en_US/help.lang
+++ b/htdocs/langs/en_US/help.lang
@@ -21,3 +21,4 @@ LinkToGoldMember=You can call one of the trainers preselected by Dolibarr for yo
PossibleLanguages=Supported languages
SubscribeToFoundation=Help the Dolibarr project, subscribe to the foundation
SeeOfficalSupport=For official Dolibarr support in your language:
%s
+AIProcessingPleaseWait=AI interrogation in progress, please wait...
\ No newline at end of file
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 95042a5cc24..f519e098d01 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -562,6 +562,7 @@ New=New
Discount=Discount
Unknown=Unknown
General=General
+Dimensions=Dimensions
Size=Size
OriginalSize=Original size
RotateImage=Rotate 90°
diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang
index c59c4271710..9ff542d9799 100644
--- a/htdocs/langs/en_US/modulebuilder.lang
+++ b/htdocs/langs/en_US/modulebuilder.lang
@@ -165,7 +165,7 @@ BadValueForType=Bad value for type %s
DefinePropertiesFromExistingTable=Define the fields/properties from an existing table
DefinePropertiesFromExistingTableDesc=If a table in the database (for the object to create) already exists, you can use it to define the properties of the object.
DefinePropertiesFromExistingTableDesc2=Keep empty if the table does not exist yet. The code generator will use different kinds of fields to build an example of table that you can edit later.
-GeneratePermissions=I want to manage permissions on this object
+GeneratePermissions=I want to manage permissions on this object
GeneratePermissionsHelp=If you check this, some code will be added to manage permissions to read, write and delete record of the objects
PermissionDeletedSuccesfuly=Permission has been successfully removed
PermissionUpdatedSuccesfuly=Permission has been successfully updated
@@ -173,6 +173,7 @@ PermissionAddedSuccesfuly=Permission has been successfully added
MenuDeletedSuccessfuly=Menu has been successfully deleted
MenuAddedSuccessfuly=Menu has been successfully added
MenuUpdatedSuccessfuly=Menu has been successfully updated
+AddAPIsForThisObject=Add APIs for this object
ApiObjectDeleted=API for object %s has been successfully deleted
CRUDRead=Read
CRUDCreateWrite=Create or Update
@@ -181,8 +182,8 @@ DictionariesCreated=Dictionary %s created successfully
DictionaryDeleted=Dictionary %s removed successfully
PropertyModuleUpdated=Property %s has been update successfully
InfoForApiFile=* When you generate file for the first time then all methods will be created for each object.
* When you click in remove you just remove all methods for the selected object.
-SetupFile=Page for module setup
+SetupFile=Page for module setup
EmailingSelectors=Emails selectors
EmailingSelectorDesc=You can generate and edit here the class files to provide new email target selectors for the mass emailing module
EmailingSelectorFile=Emails selector file
-NoEmailingSelector=No emails selector file
\ No newline at end of file
+NoEmailingSelector=No emails selector file
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index a1e25cea1af..12955cc9f0e 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -207,6 +207,7 @@ EMailTextInterventionValidated=The intervention %s has been validated.
EMailTextInterventionClosed=The intervention %s has been closed.
EMailTextInvoiceValidated=Invoice %s has been validated.
EMailTextInvoicePayed=Invoice %s has been paid.
+EMailTextInvoiceCanceled=Invoice %s has been canceled.
EMailTextProposalValidated=Proposal %s has been validated.
EMailTextProposalClosedSigned=Proposal %s has been closed signed.
EMailTextProposalClosedSignedWeb=Proposal %s has been closed signed on portal page.
@@ -214,6 +215,7 @@ EMailTextProposalClosedRefused=Proposal %s has been closed refused.
EMailTextProposalClosedRefusedWeb=Proposal %s has been closed refuse on portal page.
EMailTextOrderValidated=Order %s has been validated.
EMailTextOrderClose=Order %s has been delivered.
+EMailTextOrderCanceled=Order %s has been canceled.
EMailTextSupplierOrderApprovedBy=Purchase order %s has been approved by %s.
EMailTextSupplierOrderValidatedBy=Purchase order %s has been recorded by %s.
EMailTextSupplierOrderSubmittedBy=Purchase order %s has been submitted by %s.
@@ -327,6 +329,7 @@ SetupOfFTPClientModuleNotComplete=The setup of the FTP or SFTP client module see
FTPFeatureNotSupportedByYourPHP=Your PHP does not support FTP or SFTP functions
FailedToConnectToFTPServer=Failed to connect to server (server %s, port %s)
FailedToConnectToFTPServerWithCredentials=Failed to login to server with defined login/password
+FailedToChdirOnFTPServer=Failed to change directory on the FTP server
FTPFailedToRemoveFile=Failed to remove file %s.
FTPFailedToRemoveDir=Failed to remove directory %s: check permissions and that the directory is empty.
FTPPassiveMode=Passive mode
diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang
index 93bf150de17..dbdc58acdcb 100644
--- a/htdocs/langs/en_US/products.lang
+++ b/htdocs/langs/en_US/products.lang
@@ -437,3 +437,4 @@ AllowStockMovementVariantParent=Also records stock movements on parent products
AllowStockMovementVariantParentHelp=By default, a parent of a variant is a virtual product, so no stock is managed for it. By enabling this option, a stock will be managed for parent products and each time a stock quantity is modified for a variant product, the same quantity will be modified for the parent product. You should not need this option, except if you are using variant to manage the same product than parent (but with different descriptions, prices...)
ConfirmSetToDraftInventory=Are you sure you want to go back to Draft status?
The quantities currently set in the inventory will be reset.
WarningLineProductNotToSell=Product or service "%s" is not to sell and was cloned
+PriceLabel=Price label
diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang
index f0d303285d4..3b0ec6edb3d 100644
--- a/htdocs/langs/en_US/projects.lang
+++ b/htdocs/langs/en_US/projects.lang
@@ -142,6 +142,7 @@ DoNotShowMyTasksOnly=See also tasks not assigned to me
ShowMyTasksOnly=View only tasks assigned to me
TaskRessourceLinks=Contacts of task
ProjectsDedicatedToThisThirdParty=Projects dedicated to this third party
+ProjectsLinkedToThisThirdParty=Projects having a contact that is a contact of the third party
NoTasks=No tasks for this project
LinkedToAnotherCompany=Linked to other third party
TaskIsNotAssignedToUser=Task not assigned to user. Use button '%s' to assign task now.
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index 2857c585ba4..3750b9bab8a 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -88,6 +88,8 @@ SearchString=Chaîne de recherche
NotAvailableWhenAjaxDisabled=Non disponible quand Ajax est désactivé
AllowToSelectProjectFromOtherCompany=Sur les éléments d'un tiers, autorise la sélection d'un projet lié à un autre tiers
TimesheetPreventAfterFollowingMonths=Empêcher l'enregistrement du temps consacré après le nombre de mois suivant
+PROJECT_DISPLAY_LINKED_BY_CONTACT=Afficher les projets liés par un contact
+PROJECT_DISPLAY_LINKED_BY_CONTACT_help=Cette option permet d'ajouter la liste de tous les projets dans lesquels un des contact du tiers est rattaché
JavascriptDisabled=Javascript désactivé
UsePreviewTabs=Afficher les onglets "Aperçu"
ShowPreview=Afficher aperçu
diff --git a/htdocs/langs/fr_FR/products.lang b/htdocs/langs/fr_FR/products.lang
index b794cbde418..a939cc392ba 100644
--- a/htdocs/langs/fr_FR/products.lang
+++ b/htdocs/langs/fr_FR/products.lang
@@ -436,3 +436,4 @@ WarningConvertFromBatchToSerial=Si vous disposez actuellement d'une quantité su
AllowStockMovementVariantParent=Enregistre également les mouvements de stock sur les produits parent des produits variants
AllowStockMovementVariantParentHelp=Par défaut, un parent d'une variante est un produit virtuel, donc aucun stock n'est géré pour celui-ci. En activant cette option, un stock sera géré pour les produits parents et à chaque fois qu'une quantité de stock est modifiée pour une variante de produit, la même quantité sera modifiée pour le produit parent. Vous ne devriez pas avoir besoin de cette option, sauf si vous utilisez une variante pour gérer le même produit que le parent (mais avec des descriptions, des prix différents...)
ConfirmSetToDraftInventory=Êtes-vous sûr de vouloir revenir à l'état de brouillon ?
Les quantités actuellement définies dans l'inventaire seront réinitialisées.
+PriceLabel=Libellé du prix
diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang
index 962372b874b..d5d1f2ce01c 100644
--- a/htdocs/langs/fr_FR/projects.lang
+++ b/htdocs/langs/fr_FR/projects.lang
@@ -142,6 +142,7 @@ DoNotShowMyTasksOnly=Voir aussi les tâches qui ne me sont pas affectées
ShowMyTasksOnly=Ne voir que les tâches qui me sont affectées
TaskRessourceLinks=Contacts de la tâche
ProjectsDedicatedToThisThirdParty=Projets dédiés à ce tiers
+ProjectsLinkedToThisThirdParty=Projets liés à ce tiers par un contact commun
NoTasks=Aucune tâche pour ce projet
LinkedToAnotherCompany=Liés à autre société
TaskIsNotAssignedToUser=Tâche non assignée à l'utilisateur. Utilisez le bouton '%s' pour assigner la tâche maintenant.
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index 17fd78aa8c1..803717ae085 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -258,7 +258,7 @@ if (empty($reshook)) {
$form = new Form($db);
$formproject = new FormProjets($db);
-$morehtmlright = '';
+$morehtmlstatus = '';
$outputlangs = $langs;
if (isModEnabled('accounting')) {
$formaccounting = new FormAccounting($db);
@@ -474,7 +474,7 @@ if ($id > 0) {
$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
- dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
+ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '';
print '
';
diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php
index f095f480a04..d1e34bbbdf9 100644
--- a/htdocs/loan/class/paymentloan.class.php
+++ b/htdocs/loan/class/paymentloan.class.php
@@ -2,6 +2,7 @@
/* Copyright (C) 2014-2018 Alexandre Spangaro
* Copyright (C) 2015-2024 Frédéric France
* Copyright (C) 2020 Maxime DEMAREST
+ * Copyright (C) 2024 MDW
*
* 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
@@ -62,14 +63,23 @@ class PaymentLoan extends CommonObject
public $datep = '';
/**
- * @var array Array of amounts
+ * @var array Array of amounts
*/
public $amounts = array();
- public $amount_capital; // Total amount of payment
+ /**
+ * @var float|int Total amount of payment
+ */
+ public $amount_capital;
+ /**
+ * @var float|int
+ */
public $amount_insurance;
+ /**
+ * @var float|int
+ */
public $amount_interest;
/**
@@ -98,11 +108,28 @@ class PaymentLoan extends CommonObject
*/
public $fk_user_modif;
+ /**
+ * @var string
+ */
public $type_code;
+ /**
+ * @var string
+ */
public $type_label;
public $chid;
+ /**
+ * @var string
+ */
public $label;
+
+ /**
+ * @var int
+ */
public $paymenttype;
+
+ /**
+ * @var int
+ */
public $bank_account;
public $bank_line;
@@ -521,7 +548,7 @@ class PaymentLoan extends CommonObject
// Insert payment into llx_bank
$bank_line_id = $acc->addline(
$this->datep,
- $this->paymenttype, // Payment mode ID or code ("CHQ or VIR for example")
+ $this->paymenttype, // Payment mode ID or code ("CHQ or VIR for example") it's integer in db
$label,
$total,
$this->num_payment,
@@ -666,7 +693,7 @@ class PaymentLoan extends CommonObject
global $action;
$hookmanager->initHooks(array($this->element . 'dao'));
- $parameters = array('id'=>$this->id, 'getnomurl' => &$result);
+ $parameters = array('id' => $this->id, 'getnomurl' => &$result);
$reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) {
$result = $hookmanager->resPrint;
diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php
index 1b6f586bb58..74b96bf0877 100644
--- a/htdocs/loan/document.php
+++ b/htdocs/loan/document.php
@@ -1,6 +1,7 @@
* Copyright (C) 2017 Ferran Marcet
+ * Copyright (C) 2024 MDW
*
* 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
@@ -140,7 +141,8 @@ if ($object->id) {
$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
- dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
+ $morehtmlstatus = $morehtmlright;
+ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '';
print '
';
diff --git a/htdocs/loan/info.php b/htdocs/loan/info.php
index 436caf903d2..b437a73b845 100644
--- a/htdocs/loan/info.php
+++ b/htdocs/loan/info.php
@@ -1,6 +1,7 @@
* Copyright (C) 2017 Ferran Marcet
+ * Copyright (C) 2024 MDW
*
* 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
@@ -102,7 +103,8 @@ $morehtmlref .= ' ';
$linkback = ''.$langs->trans("BackToList").'';
-dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
+$morehtmlstatus = $morehtmlright;
+dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '';
print '
';
diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php
index 27a9d0bc70b..62d84a1adbc 100644
--- a/htdocs/loan/note.php
+++ b/htdocs/loan/note.php
@@ -6,6 +6,7 @@
* Copyright (C) 2015 Frederic France
* Copyright (C) 2016-2023 Alexandre Spangaro
* Copyright (C) 2017 Ferran Marcet
+ * Copyright (C) 2024 MDW
*
* 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
@@ -129,7 +130,8 @@ if ($id > 0) {
$object->totalpaid = $totalpaid; // To give a chance to dol_banner_tab to use already paid amount to show correct status
- dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
+ $morehtmlstatus = $morehtmlright;
+ dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '';
print '
';
diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php
index 2afeb25b322..31b71d49a3d 100644
--- a/htdocs/loan/payment/card.php
+++ b/htdocs/loan/payment/card.php
@@ -103,9 +103,9 @@ if ($action == 'delete') {
$linkback = '';
$morehtmlref = '';
-$morehtmlright = '';
+$morehtmlstatus = '';
-dol_banner_tab($payment, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
+dol_banner_tab($payment, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
print '
';
print '
';
diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php
index 1864c309298..ae61486bcfe 100644
--- a/htdocs/loan/schedule.php
+++ b/htdocs/loan/schedule.php
@@ -185,9 +185,9 @@ if (isModEnabled('project')) {
}
$morehtmlref .= '
';
-$morehtmlright = '';
+$morehtmlstatus = '';
-dol_banner_tab($object, 'loanid', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
+dol_banner_tab($object, 'loanid', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlstatus);
?>