Merge branch '2182_worker_log' of verdnatura/salix into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
commit
77e8bbc2ce
|
@ -0,0 +1 @@
|
|||
INSERT INTO `salix`.`ACL` (`model`, `property`, `accessType`, `permission`, `principalType`, `principalId`) VALUES ('WorkerLog', '*', 'READ', 'ALLOW', 'ROLE', 'hr');
|
|
@ -0,0 +1,6 @@
|
|||
ALTER TABLE `vn`.`workerLog`
|
||||
ADD COLUMN `changedModel` VARCHAR(45) NULL DEFAULT NULL AFTER `description`,
|
||||
ADD COLUMN `oldInstance` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
|
||||
ADD COLUMN `newInstance` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
|
||||
ADD COLUMN `changedModelId` int(11) DEFAULT NULL,
|
||||
ADD COLUMN `changedModelValue` varchar(45) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL;
|
|
@ -52,5 +52,11 @@
|
|||
},
|
||||
"Device": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"WorkerLog": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
"name": "WorkerLog",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "workerLog"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "Number",
|
||||
"forceId": false
|
||||
},
|
||||
"originFk": {
|
||||
"type": "Number",
|
||||
"required": true
|
||||
},
|
||||
"userFk": {
|
||||
"type": "Number"
|
||||
},
|
||||
"action": {
|
||||
"type": "String",
|
||||
"required": true
|
||||
},
|
||||
"changedModel": {
|
||||
"type": "String"
|
||||
},
|
||||
"oldInstance": {
|
||||
"type": "Object"
|
||||
},
|
||||
"newInstance": {
|
||||
"type": "Object"
|
||||
},
|
||||
"creationDate": {
|
||||
"type": "Date"
|
||||
},
|
||||
"changedModelId": {
|
||||
"type": "String"
|
||||
},
|
||||
"changedModelValue": {
|
||||
"type": "String"
|
||||
},
|
||||
"description": {
|
||||
"type": "String"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"user": {
|
||||
"type": "belongsTo",
|
||||
"model": "Account",
|
||||
"foreignKey": "userFk"
|
||||
}
|
||||
},
|
||||
"scope": {
|
||||
"order": ["creationDate DESC", "id DESC"]
|
||||
}
|
||||
}
|
|
@ -1,7 +1,11 @@
|
|||
{
|
||||
"name": "Worker",
|
||||
"description": "Company employees",
|
||||
"base": "VnModel",
|
||||
"base": "Loggable",
|
||||
"log": {
|
||||
"model":"WorkerLog",
|
||||
"showField": "firstName"
|
||||
},
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "worker"
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
<mg-ajax path="Workers/{{patch.params.id}}" options="vnPatch"></mg-ajax>
|
||||
<vn-watcher
|
||||
vn-id="watcher"
|
||||
data="$ctrl.worker"
|
||||
form="form"
|
||||
id-field="id"
|
||||
url="Workers"
|
||||
save="post">
|
||||
save="patch">
|
||||
</vn-watcher>
|
||||
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
|
||||
<vn-card class="vn-pa-lg">
|
||||
|
|
|
@ -6,7 +6,7 @@ class Controller {
|
|||
}
|
||||
|
||||
onSubmit() {
|
||||
this.$.watcher.submit()
|
||||
return this.$.watcher.submit()
|
||||
.then(() => this.card.reload());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import './department';
|
|||
import './calendar';
|
||||
import './time-control';
|
||||
import './log';
|
||||
import './worker-log';
|
||||
import './dms/index';
|
||||
import './dms/create';
|
||||
import './dms/edit';
|
||||
|
|
|
@ -18,3 +18,4 @@ Calendar: Calendario
|
|||
Search workers by id, firstName, lastName or user name: Buscar trabajadores por el identificador, nombre, apellidos o nombre de usuario
|
||||
Time control: Control de horario
|
||||
Data saved! User must access web: ¡Datos guardados! El usuario deberá acceder con su contraseña a la web para que los cambios surtan efecto.
|
||||
Log: Historial
|
|
@ -13,7 +13,8 @@
|
|||
{"state": "worker.card.pbx", "icon": "icon-pbx"},
|
||||
{"state": "worker.card.calendar", "icon": "icon-calendar"},
|
||||
{"state": "worker.card.timeControl", "icon": "access_time"},
|
||||
{"state": "worker.card.dms.index", "icon": "cloud_upload"}
|
||||
{"state": "worker.card.dms.index", "icon": "cloud_upload"},
|
||||
{"state": "worker.card.workerLog", "icon": "history"}
|
||||
]
|
||||
},
|
||||
"routes": [
|
||||
|
@ -51,6 +52,11 @@
|
|||
"worker": "$ctrl.worker"
|
||||
},
|
||||
"acl": ["hr"]
|
||||
}, {
|
||||
"url" : "/log",
|
||||
"state": "worker.card.workerLog",
|
||||
"component": "vn-worker-log",
|
||||
"description": "Log"
|
||||
}, {
|
||||
"url": "/pbx",
|
||||
"state": "worker.card.pbx",
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<vn-log url="WorkerLogs" origin-id="$ctrl.$params.id"></vn-log>
|
|
@ -0,0 +1,7 @@
|
|||
import ngModule from '../module';
|
||||
import Section from 'salix/components/section';
|
||||
|
||||
ngModule.component('vnWorkerLog', {
|
||||
template: require('./index.html'),
|
||||
controller: Section,
|
||||
});
|
Loading…
Reference in New Issue