From 1d7e69cb25f809ca2d26c1fa2e90facff815cbc4 Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 16 Dec 2024 07:40:49 +0100 Subject: [PATCH 1/3] feat: refs #7584 workerTimeControl_afterDelete --- .../vn/triggers/workerTimeControl_afterDelete.sql | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/db/routines/vn/triggers/workerTimeControl_afterDelete.sql b/db/routines/vn/triggers/workerTimeControl_afterDelete.sql index 27432fccb..762754591 100644 --- a/db/routines/vn/triggers/workerTimeControl_afterDelete.sql +++ b/db/routines/vn/triggers/workerTimeControl_afterDelete.sql @@ -3,10 +3,12 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`workerTimeControl_after AFTER DELETE ON `workerTimeControl` FOR EACH ROW BEGIN - INSERT INTO workerLog - SET `action` = 'delete', - `changedModel` = 'WorkerTimeControl', - `changedModelId` = OLD.id, - `userFk` = account.myUser_getId(); + IF account.myUser_getId() THEN + INSERT INTO workerLog + SET `action` = 'delete', + `changedModel` = 'WorkerTimeControl', + `changedModelId` = OLD.id, + `userFk` = account.myUser_getId(); + END IF; END$$ DELIMITER ; From 48d2d1d3271eb6d92ef8cda0979e38daed999e30 Mon Sep 17 00:00:00 2001 From: jtubau Date: Thu, 26 Dec 2024 10:41:20 +0100 Subject: [PATCH 2/3] feat: refs #8117 add worker first and last name to item type query --- modules/ticket/back/methods/ticket-request/getItemTypeWorker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ticket/back/methods/ticket-request/getItemTypeWorker.js b/modules/ticket/back/methods/ticket-request/getItemTypeWorker.js index f160cfaac..2f2a85abb 100644 --- a/modules/ticket/back/methods/ticket-request/getItemTypeWorker.js +++ b/modules/ticket/back/methods/ticket-request/getItemTypeWorker.js @@ -30,7 +30,7 @@ module.exports = Self => { Object.assign(myOptions, options); const query = - `SELECT DISTINCT u.id, u.nickname + `SELECT DISTINCT u.id, u.nickname, w.firstName, w.lastName FROM itemType it JOIN worker w ON w.id = it.workerFk JOIN account.user u ON u.id = w.id`; From bdaaffbbd76247d2eaf64635c58fbd8e707bff2b Mon Sep 17 00:00:00 2001 From: robert Date: Fri, 10 Jan 2025 10:33:19 +0100 Subject: [PATCH 3/3] feat: refs #7584 changes request --- db/routines/vn/triggers/workerTimeControl_afterDelete.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/routines/vn/triggers/workerTimeControl_afterDelete.sql b/db/routines/vn/triggers/workerTimeControl_afterDelete.sql index 762754591..96db381b5 100644 --- a/db/routines/vn/triggers/workerTimeControl_afterDelete.sql +++ b/db/routines/vn/triggers/workerTimeControl_afterDelete.sql @@ -3,7 +3,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`workerTimeControl_after AFTER DELETE ON `workerTimeControl` FOR EACH ROW BEGIN - IF account.myUser_getId() THEN + IF account.myUser_getId() IS NOT NULL THEN INSERT INTO workerLog SET `action` = 'delete', `changedModel` = 'WorkerTimeControl',