diff --git a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql index 0ed686d189f..59c79a5741a 100644 --- a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql +++ b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql @@ -413,3 +413,6 @@ ALTER TABLE llx_c_invoice_subtype ADD UNIQUE INDEX uk_c_invoice_subtype (entity, ALTER TABLE llx_c_propalst ADD COLUMN sortorder smallint DEFAULT 0; ALTER TABLE llx_c_stcomm ADD COLUMN sortorder smallint DEFAULT 0; + +ALTER TABLE llx_element_time ADD COLUMN ref_ext varchar(32); + diff --git a/htdocs/install/mysql/tables/llx_element_time.sql b/htdocs/install/mysql/tables/llx_element_time.sql index cf346a48ec0..395ca8ff075 100644 --- a/htdocs/install/mysql/tables/llx_element_time.sql +++ b/htdocs/install/mysql/tables/llx_element_time.sql @@ -17,6 +17,7 @@ CREATE TABLE llx_element_time( -- BEGIN MODULEBUILDER FIELDS rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, + ref_ext varchar(32), -- reference into an external system (not used by dolibarr) fk_element integer NOT NULL, elementtype varchar(32) NOT NULL, element_date date, diff --git a/htdocs/projet/class/api_tasks.class.php b/htdocs/projet/class/api_tasks.class.php index 8bf6769d8fa..d880ba1ad0d 100644 --- a/htdocs/projet/class/api_tasks.class.php +++ b/htdocs/projet/class/api_tasks.class.php @@ -16,10 +16,11 @@ * along with this program. If not, see . */ - use Luracast\Restler\RestException; +use Luracast\Restler\RestException; + +require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; - require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; - require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; /** * API class for projects @@ -29,7 +30,6 @@ */ class Tasks extends DolibarrApi { - /** * @var array $FIELDS Mandatory fields, checked when create and update object */ diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 82bbe79edf9..984c24f6ef6 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1354,6 +1354,7 @@ class Task extends CommonObjectLine $sql .= " s.nom as thirdparty_name,"; $sql .= " s.email as thirdparty_email,"; $sql .= " ptt.rowid,"; + $sql .= " ptt.ref_ext,"; $sql .= " ptt.fk_element as fk_task,"; $sql .= " ptt.element_date as task_date,"; $sql .= " ptt.element_datehour as task_datehour,"; @@ -1404,6 +1405,7 @@ class Task extends CommonObjectLine $newobj->task_label = $obj->task_label; $newobj->timespent_line_id = $obj->rowid; + $newobj->timespent_line_ref_ext = $obj->ref_ext; $newobj->timespent_line_date = $this->db->jdate($obj->task_date); $newobj->timespent_line_datehour = $this->db->jdate($obj->task_datehour); $newobj->timespent_line_withhour = $obj->task_date_withhour;