Add field ref_ext in table of timespent

This commit is contained in:
Laurent Destailleur 2023-05-16 22:14:06 +02:00
parent 9635fa35d8
commit 20a9dc1951
4 changed files with 10 additions and 4 deletions

View File

@ -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);

View File

@ -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,

View File

@ -16,10 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
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
*/

View File

@ -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;