Compare commits
5 Commits
f9382a1c22
...
f4a9e7b74e
Author | SHA1 | Date |
---|---|---|
Javier Segarra | f4a9e7b74e | |
Javier Segarra | f00b264daa | |
Javier Segarra | 1b60cd33d5 | |
Javier Segarra | 50cb7964d9 | |
Javier Segarra | 1d95c17a0b |
|
@ -0,0 +1,47 @@
|
|||
DROP TRIGGER IF EXISTS `vn`.`zoneIncluded_afterInsert`;
|
||||
USE `vn`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`zoneIncluded_afterInsert`
|
||||
AFTER INSERT ON `zoneIncluded`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO zoneLog
|
||||
SET `action` = 'insert',
|
||||
`changedModel` = 'zoneIncluded',
|
||||
`changedModelId` = OLD.zoneFk,
|
||||
`userFk` = account.myUser_getId();
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
||||
DROP TRIGGER IF EXISTS `vn`.`zoneIncluded_afterUpdate`;
|
||||
USE `vn`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`zoneIncluded_afterUpdate`
|
||||
AFTER UPDATE ON `zoneIncluded`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO zoneLog
|
||||
SET `action` = 'update',
|
||||
`changedModel` = 'zoneIncluded',
|
||||
`changedModelId` = OLD.zoneFk,
|
||||
`userFk` = account.myUser_getId();
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
||||
-- DROP TRIGGER IF EXISTS `vn`.`zoneIncluded_afterDelete`;
|
||||
-- USE `vn`;
|
||||
|
||||
-- DELIMITER $$
|
||||
-- CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`zoneIncluded_afterDelete`
|
||||
-- AFTER DELETE ON `zoneIncluded`
|
||||
-- FOR EACH ROW
|
||||
-- BEGIN
|
||||
-- INSERT INTO zoneLog
|
||||
-- SET `action` = 'delete',
|
||||
-- `changedModel` = 'zoneIncluded',
|
||||
-- `changedModelId` = OLD.zoneFk,
|
||||
-- `userFk` = account.myUser_getId();
|
||||
-- END$$
|
||||
-- DELIMITER ;
|
|
@ -0,0 +1,7 @@
|
|||
CREATE TABLE `vn`.`zoneIncludedCheck` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`zoneFK` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY (`inclusion_FK`,`zoneFK`),
|
||||
CONSTRAINT `inclusion_FK` FOREIGN KEY (`zoneFK`) REFERENCES `zoneIncluded` (`id`) ON UPDATE CASCADE,
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
|
@ -0,0 +1,2 @@
|
|||
DELETE FROM bs.nightTask
|
||||
WHERE `procedure` ='zone_getCollisions';
|
|
@ -0,0 +1 @@
|
|||
DROP PROCEDURE vn.zone_getCollisions;
|
|
@ -0,0 +1,11 @@
|
|||
const Stylesheet = require(`vn-print/core/stylesheet`);
|
||||
|
||||
const path = require('path');
|
||||
const vnPrintPath = path.resolve('print');
|
||||
|
||||
module.exports = new Stylesheet([
|
||||
`${vnPrintPath}/common/css/spacing.css`,
|
||||
`${vnPrintPath}/common/css/misc.css`,
|
||||
`${vnPrintPath}/common/css/layout.css`,
|
||||
`${vnPrintPath}/common/css/email.css`])
|
||||
.mergeStyles();
|
|
@ -0,0 +1,2 @@
|
|||
subject: Colisión de zona detectada
|
||||
title: "La zona {0} ha sido registrada en más de un sitio"
|
|
@ -0,0 +1,5 @@
|
|||
SELECT
|
||||
z.name
|
||||
FROM vn.zoneIncluded zI
|
||||
LEFT JOIN vn.zone z ON z.Id = zI.zoneFk
|
||||
WHERE zI.id = ?;
|
|
@ -0,0 +1,8 @@
|
|||
<email-body v-bind="$props">
|
||||
<div class="grid-row">
|
||||
<div class="grid-block vn-pa-ml">
|
||||
<h1>{{ $t('subject') }}</h1>
|
||||
<p>{{ $t('title', [this.zoneIncluded.name]) }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</email-body>
|
|
@ -0,0 +1,27 @@
|
|||
const Component = require(`vn-print/core/component`);
|
||||
const emailBody = new Component('email-body');
|
||||
|
||||
module.exports = {
|
||||
name: 'zone-included',
|
||||
async serverPrefetch() {
|
||||
this.zoneIncluded = await this.fetchZoneIncluded(this.id);
|
||||
},
|
||||
methods: {
|
||||
fetchZoneIncluded(id) {
|
||||
return this.findOneFromDef('zoneIncluded', [id]);
|
||||
},
|
||||
},
|
||||
components: {
|
||||
'email-body': emailBody.build(),
|
||||
},
|
||||
props: {
|
||||
id: {
|
||||
type: Number,
|
||||
required: true
|
||||
},
|
||||
url: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue