5509-entryDmsBack #2079

Merged
alexm merged 21 commits from 5509-entryDmsBack into dev 2024-02-26 10:16:41 +00:00
3 changed files with 8 additions and 70 deletions
Showing only changes of commit 5f60f2a00e - Show all commits

View File

@ -2408,7 +2408,8 @@ INSERT INTO `vn`.`dmsType`(`id`, `name`, `readRoleFk`, `writeRoleFk`, `code`)
(17, 'cmr', NULL, NULL, 'cmr'),
(18, 'dua', NULL, NULL, 'dua'),
(19, 'inmovilizado', NULL, NULL, 'fixedAssets'),
(20, 'Reclamación', 1, 1, 'claim');
(20, 'Reclamación', 1, 1, 'claim'),
(21, 'Entrada', 1, 1, 'entry');
INSERT INTO `vn`.`dms`(`id`, `dmsTypeFk`, `file`, `contentType`, `workerFk`, `warehouseFk`, `companyFk`, `hardCopyNumber`, `hasFile`, `reference`, `description`, `created`)
VALUES

View File

@ -10,78 +10,13 @@ CREATE OR REPLACE TABLE `vn`.`entryDms` (
CONSTRAINT `entryDms_entry` FOREIGN KEY (`entryFk`) REFERENCES `entry` (`id`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
-- DROP TRIGGER IF EXISTS `vn`.`entryDms_beforeInsert`;
-- USE `vn`;
-- DELIMITER $$
-- $$
-- CREATE DEFINER=`root`@`localhost` TRIGGER `vn`.`entryDms_beforeInsert`
-- BEFORE INSERT ON `entryDms`
-- FOR EACH ROW
-- BEGIN
-- SET NEW.editorFk = account.myUser_getId();
-- END $$
-- DELIMITER ;
-- DROP TRIGGER IF EXISTS `vn`.`entryDms_beforeUpdate`;
-- USE `vn`;
-- DELIMITER $$
-- $$
-- CREATE DEFINER=`root`@`localhost` TRIGGER `vn`.`entryDms_beforeUpdate`
-- BEFORE UPDATE ON `entryDms`
-- FOR EACH ROW
-- BEGIN
-- SET NEW.editorFk = account.myUser_getId();
-- END $$
-- DELIMITER ;
-- DROP TRIGGER IF EXISTS `vn`.`entryDms_beforeDelete`;
-- USE `vn`;
-- DELIMITER $$
-- $$
-- CREATE DEFINER=`root`@`localhost` TRIGGER `vn`.`entryDms_beforeDelete`
-- BEFORE DELETE ON `entryDms`
-- FOR EACH ROW
-- BEGIN
-- UPDATE dms
-- SET dmsTypeFk = (SELECT id
-- FROM dmsType
-- WHERE `code` = 'trash'
-- )
-- WHERE id = OLD.dmsFk AND ( SELECT IF(COUNT(*) > 0, FALSE, TRUE)
-- FROM entryDms
-- WHERE dmsFk = OLD.dmsFk
-- ) ;
-- END $$
-- DELIMITER ;
-- DROP TRIGGER IF EXISTS `vn`.`entryDms_afterDelete`;
-- USE `vn`;
-- DELIMITER $$
-- $$
-- CREATE DEFINER=`root`@`localhost` TRIGGER `vn`.`entryDms_afterDelete`
-- AFTER DELETE ON `entryDms`
-- FOR EACH ROW
-- BEGIN
-- INSERT INTO entryLog
-- SET `action` = 'delete',
-- `changedModel` = 'entryDms',
-- `changedModelId` = OLD.entryFk,
-- `userFk` = account.myUser_getId();
-- END $$
-- DELIMITER ;
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`)
VALUES
('WorkerDms', '*', '*', 'ALLOW', 'ROLE', 'employee'),
('EntryDms', '*', '*', 'ALLOW', 'ROLE', 'employee'),
('Entry', 'uploadFile', 'WRITE', 'ALLOW', 'ROLE', 'employee');
-- UPDATE `salix`.`ACL`
-- SET accessType = '*'
-- WHERE model = 'ClientDms'
-- AND property = '*';
UPDATE `salix`.`ACL`
SET accessType = '*'
WHERE model = 'ClientDms'
AND property = '*';

View File

@ -0,0 +1,2 @@
INSERT INTO `vn`.`dmsType` (code, name, path__, writeRoleFk, readRoleFk, monthToDelete)
VALUES('entry', 'Entrada', '', 1, 1, NULL);
Review

Fique algo de path__ ? @juan

Fique algo de `path__` ? @juan
Review

Esta deprecat, això es que no se gasta i no farà falta ficar res

Esta deprecat, això es que no se gasta i no farà falta ficar res