From 87e1caa4eb53ac07840755ae1057b5966e5861e6 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 15 May 2023 10:43:06 +0200
Subject: [PATCH 01/80] refs #5334 department seccion
---
.../front/department/basic-data/index.html | 101 +++++++++++++++++
.../front/department/basic-data/index.js | 27 +++++
.../front/department/basic-data/locale/es.yml | 9 ++
.../front/department/{ => index}/index.html | 3 +-
.../front/department/{ => index}/index.js | 2 +-
modules/worker/front/department/routes.json | 103 ++++++++++++++++++
.../front/department/summary/index.html | 73 +++++++++++++
.../worker/front/department/summary/index.js | 74 +++++++++++++
.../front/department/summary/locale/es.yml | 4 +
modules/worker/front/index.js | 2 +-
modules/worker/front/routes.json | 2 +-
11 files changed, 396 insertions(+), 4 deletions(-)
create mode 100644 modules/worker/front/department/basic-data/index.html
create mode 100644 modules/worker/front/department/basic-data/index.js
create mode 100644 modules/worker/front/department/basic-data/locale/es.yml
rename modules/worker/front/department/{ => index}/index.html (93%)
rename modules/worker/front/department/{ => index}/index.js (98%)
create mode 100644 modules/worker/front/department/routes.json
create mode 100644 modules/worker/front/department/summary/index.html
create mode 100644 modules/worker/front/department/summary/index.js
create mode 100644 modules/worker/front/department/summary/locale/es.yml
diff --git a/modules/worker/front/department/basic-data/index.html b/modules/worker/front/department/basic-data/index.html
new file mode 100644
index 000000000..d89d88f2e
--- /dev/null
+++ b/modules/worker/front/department/basic-data/index.html
@@ -0,0 +1,101 @@
+
+
+
+
diff --git a/modules/worker/front/department/basic-data/index.js b/modules/worker/front/department/basic-data/index.js
new file mode 100644
index 000000000..ea75d7b97
--- /dev/null
+++ b/modules/worker/front/department/basic-data/index.js
@@ -0,0 +1,27 @@
+import ngModule from '../module';
+import Section from 'salix/components/section';
+
+class Controller extends Section {
+ constructor($element, $) {
+ super($element, $);
+ this.maritalStatus = [
+ {code: 'M', name: this.$t('Married')},
+ {code: 'S', name: this.$t('Single')}
+ ];
+ }
+ onSubmit() {
+ return this.$.watcher.submit()
+ .then(() => this.card.reload());
+ }
+}
+
+ngModule.vnComponent('vnWorkerBasicData', {
+ template: require('./index.html'),
+ controller: Controller,
+ bindings: {
+ worker: '<'
+ },
+ require: {
+ card: '^vnWorkerCard'
+ }
+});
diff --git a/modules/worker/front/department/basic-data/locale/es.yml b/modules/worker/front/department/basic-data/locale/es.yml
new file mode 100644
index 000000000..edf08de90
--- /dev/null
+++ b/modules/worker/front/department/basic-data/locale/es.yml
@@ -0,0 +1,9 @@
+Marital status: Estado civil
+Origin country: País origen
+Education level: Nivel educación
+SSN: NSS
+Married: Casado/a
+Single: Soltero/a
+Business phone: Teléfono de empresa
+Mobile extension: Extensión móvil
+Locker: Taquilla
diff --git a/modules/worker/front/department/index.html b/modules/worker/front/department/index/index.html
similarity index 93%
rename from modules/worker/front/department/index.html
rename to modules/worker/front/department/index/index.html
index df8630104..9afa90e13 100644
--- a/modules/worker/front/department/index.html
+++ b/modules/worker/front/department/index/index.html
@@ -12,7 +12,8 @@
sort-func="$ctrl.onSort($a, $b)"
on-drop="$ctrl.onDrop($dropped, $dragged)"
on-drag-start="$ctrl.onDragStart(item)"
- on-drag-end="$ctrl.onDragEnd(item)">
+ on-drag-end="$ctrl.onDragEnd(item)"
+ ui-sref="department.card.summary(item)">
{{::item.name}}
diff --git a/modules/worker/front/department/index.js b/modules/worker/front/department/index/index.js
similarity index 98%
rename from modules/worker/front/department/index.js
rename to modules/worker/front/department/index/index.js
index 15904a963..178299362 100644
--- a/modules/worker/front/department/index.js
+++ b/modules/worker/front/department/index/index.js
@@ -1,4 +1,4 @@
-import ngModule from '../module';
+import ngModule from '../../module';
import Section from 'salix/components/section';
class Controller extends Section {
diff --git a/modules/worker/front/department/routes.json b/modules/worker/front/department/routes.json
new file mode 100644
index 000000000..f6fd46367
--- /dev/null
+++ b/modules/worker/front/department/routes.json
@@ -0,0 +1,103 @@
+{
+ "module": "deparment",
+ "name": "Departments",
+ "icon" : "work",
+ "validations" : true,
+ "dependencies": ["account"],
+ "menus": {
+ "main": [
+ {"state": "deparment.index", "icon": "icon-worker"}
+ ],
+ "card": [
+ {"state": "department.card.basicData", "icon": "settings"},
+ {
+ "icon": "icon-wiki",
+ "external":true,
+ "url": "http://wiki.verdnatura.es",
+ "description": "Wikipedia"
+ },
+ {"state": "worker.card.workerLog", "icon": "history"}
+ ]
+ },
+ "routes": [
+ {
+ "url": "/worker",
+ "state": "worker",
+ "abstract": true,
+ "component": "vn-worker",
+ "description": "Workers"
+ }, {
+ "url": "/index?q",
+ "state": "worker.index",
+ "component": "vn-worker-index",
+ "description": "Workers"
+ }, {
+ "url" : "/summary",
+ "state": "worker.card.summary",
+ "component": "vn-worker-summary",
+ "description": "Summary",
+ "params": {
+ "worker": "$ctrl.worker"
+ }
+ }, {
+ "url": "/:id",
+ "state": "worker.card",
+ "component": "vn-worker-card",
+ "abstract": true,
+ "description": "Detail"
+ }, {
+ "url": "/basic-data",
+ "state": "worker.card.basicData",
+ "component": "vn-worker-basic-data",
+ "description": "Basic data",
+ "params": {
+ "worker": "$ctrl.worker"
+ },
+ "acl": ["hr"]
+ }, {
+ "url" : "/log",
+ "state": "worker.card.workerLog",
+ "component": "vn-worker-log",
+ "description": "Log",
+ "acl": ["salesAssistant"]
+ }, {
+ "url": "/index",
+ "state": "worker.card.note.index",
+ "component": "vn-worker-note",
+ "description": "Notes",
+ "params": {
+ "worker": "$ctrl.worker"
+ },
+ "acl": ["hr"]
+ }, {
+ "url": "/create",
+ "state": "worker.card.note.create",
+ "component": "vn-note-worker-create",
+ "description": "New note"
+ },
+ {
+ "url": "/index",
+ "state": "worker.card.dms.index",
+ "component": "vn-worker-dms-index",
+ "description": "My documentation",
+ "acl": ["employee"]
+ },
+ {
+ "url": "/create",
+ "state": "worker.card.dms.create",
+ "component": "vn-worker-dms-create",
+ "description": "Upload file",
+ "params": {
+ "worker": "$ctrl.worker"
+ },
+ "acl": ["hr"]
+ },
+ {
+ "url": "/create",
+ "state": "worker.create",
+ "component": "vn-worker-create",
+ "description": "New worker",
+ "acl": ["hr"]
+ }
+ ]
+}
diff --git a/modules/worker/front/department/summary/index.html b/modules/worker/front/department/summary/index.html
new file mode 100644
index 000000000..de8710a6d
--- /dev/null
+++ b/modules/worker/front/department/summary/index.html
@@ -0,0 +1,73 @@
+
+
+
+
+
+ {{worker.firstName}} {{worker.lastName}}
+
+
+
+
+
+ Basic data
+
+
+
+
+
+
+
+
+
+ {{::worker.boss.nickname}}
+
+
+
+
+
+
+
+
+
+
+
+
+ User data
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/worker/front/department/summary/index.js b/modules/worker/front/department/summary/index.js
new file mode 100644
index 000000000..c2ad107d5
--- /dev/null
+++ b/modules/worker/front/department/summary/index.js
@@ -0,0 +1,74 @@
+import ngModule from '../module';
+import Summary from 'salix/components/summary';
+
+class Controller extends Summary {
+ get worker() {
+ return this._worker;
+ }
+
+ set worker(value) {
+ this._worker = value;
+ this.$.worker = null;
+ if (!value) return;
+
+ const query = `Workers/${value.id}`;
+ const filter = {
+ include: [
+ {
+ relation: 'user',
+ scope: {
+ fields: ['name', 'roleFk'],
+ include: [{
+ relation: 'role',
+ scope: {
+ fields: ['name']
+ }
+ },
+ {
+ relation: 'emailUser',
+ scope: {
+ fields: ['email']
+ }
+ }]
+ }
+ },
+ {
+ relation: 'client',
+ scope: {fields: ['fi', 'phone']}
+ },
+ {
+ relation: 'boss',
+ scope: {fields: ['id', 'nickname']}
+ },
+ {
+ relation: 'sip',
+ scope: {fields: ['extension']}
+ },
+ {
+ relation: 'department',
+ scope: {
+ include: {
+ relation: 'department'
+ }
+ }
+ }
+ ]
+ };
+
+ this.$http.get(query, {params: {filter}}).then(res => {
+ this.$.worker = res.data;
+ });
+ }
+
+ get isHr() {
+ return this.aclService.hasAny(['hr']);
+ }
+}
+
+ngModule.vnComponent('vnWorkerSummary', {
+ template: require('./index.html'),
+ controller: Controller,
+ bindings: {
+ worker: '<'
+ }
+});
diff --git a/modules/worker/front/department/summary/locale/es.yml b/modules/worker/front/department/summary/locale/es.yml
new file mode 100644
index 000000000..fb9d2e2ca
--- /dev/null
+++ b/modules/worker/front/department/summary/locale/es.yml
@@ -0,0 +1,4 @@
+Business phone: Teléfono de empresa
+Personal phone: Teléfono personal
+Mobile extension: Extensión móvil
+Locker: Taquilla
diff --git a/modules/worker/front/index.js b/modules/worker/front/index.js
index 8fad2c0df..605ec9dde 100644
--- a/modules/worker/front/index.js
+++ b/modules/worker/front/index.js
@@ -11,7 +11,7 @@ import './search-panel';
import './basic-data';
import './pbx';
import './pda';
-import './department';
+import './department/index';
import './calendar';
import './time-control';
import './log';
diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json
index 25a0ffbcf..6817d0cef 100644
--- a/modules/worker/front/routes.json
+++ b/modules/worker/front/routes.json
@@ -118,7 +118,7 @@
"worker": "$ctrl.worker"
}
}, {
- "url" : "/department",
+ "url" : "/department/department",
"state": "worker.department",
"component": "vn-worker-department",
"description": "Departments",
From 598067f75724482cf10962afb513c18235f13444 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 15 May 2023 13:15:33 +0200
Subject: [PATCH 02/80] refs #5334 routes
---
front/salix/components/left-menu/left-menu.js | 2 +-
modules/worker/back/models/department.json | 12 ++
.../worker/front/department/card/index.html | 5 +
modules/worker/front/department/card/index.js | 29 +++++
.../front/department/descriptor/index.html | 90 +++++++++++++++
.../front/department/descriptor/index.js | 104 ++++++++++++++++++
.../front/department/descriptor/index.spec.js | 26 +++++
.../worker/front/department/index/index.html | 2 +-
.../worker/front/department/index/index.js | 2 +-
.../worker/front/department/main/index.html | 18 +++
modules/worker/front/department/main/index.js | 9 ++
modules/worker/front/department/routes.json | 103 -----------------
.../front/department/summary/index.html | 44 ++++----
.../worker/front/department/summary/index.js | 52 ++-------
modules/worker/front/routes.json | 28 ++++-
15 files changed, 351 insertions(+), 175 deletions(-)
create mode 100644 modules/worker/front/department/card/index.html
create mode 100644 modules/worker/front/department/card/index.js
create mode 100644 modules/worker/front/department/descriptor/index.html
create mode 100644 modules/worker/front/department/descriptor/index.js
create mode 100644 modules/worker/front/department/descriptor/index.spec.js
create mode 100644 modules/worker/front/department/main/index.html
create mode 100644 modules/worker/front/department/main/index.js
delete mode 100644 modules/worker/front/department/routes.json
diff --git a/front/salix/components/left-menu/left-menu.js b/front/salix/components/left-menu/left-menu.js
index da545b291..6bec61775 100644
--- a/front/salix/components/left-menu/left-menu.js
+++ b/front/salix/components/left-menu/left-menu.js
@@ -45,7 +45,7 @@ export default class LeftMenu {
if (acl && !this.aclService.hasAny(acl))
continue;
}
-
+ console.log(state, item);
let myItem = {
icon: item.icon,
description: item.description || state.description,
diff --git a/modules/worker/back/models/department.json b/modules/worker/back/models/department.json
index c3f627e93..7d8d61d73 100644
--- a/modules/worker/back/models/department.json
+++ b/modules/worker/back/models/department.json
@@ -38,5 +38,17 @@
"hasToMistake": {
"type": "number"
}
+ },
+ "relations": {
+ "client": {
+ "type": "belongsTo",
+ "model": "Client",
+ "foreignKey": "clientFk"
+ },
+ "worker": {
+ "type": "belongsTo",
+ "model": "Worker",
+ "foreignKey": "workerFk"
+ }
}
}
diff --git a/modules/worker/front/department/card/index.html b/modules/worker/front/department/card/index.html
new file mode 100644
index 000000000..cc1ad59e4
--- /dev/null
+++ b/modules/worker/front/department/card/index.html
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/modules/worker/front/department/card/index.js b/modules/worker/front/department/card/index.js
new file mode 100644
index 000000000..288c1a8c3
--- /dev/null
+++ b/modules/worker/front/department/card/index.js
@@ -0,0 +1,29 @@
+import ngModule from '../module';
+import ModuleCard from 'salix/components/module-card';
+
+class Controller extends ModuleCard {
+ reload() {
+ const filter = {
+ fields: ['chatName', 'notificationEmail'],
+ include: [
+ {
+ relation: 'client',
+ scope: {fields: ['name']}
+ },
+ {
+ relation: 'worker',
+ scope: {fields: ['name']}
+ }
+
+ ]
+ };
+
+ this.$http.get(`Departments/${this.$params.id}`, {filter})
+ .then(res => this.department = res.data);
+ }
+}
+
+ngModule.vnComponent('vnWorkerDepartmentCard', {
+ template: require('./index.html'),
+ controller: Controller
+});
diff --git a/modules/worker/front/department/descriptor/index.html b/modules/worker/front/department/descriptor/index.html
new file mode 100644
index 000000000..564c2d4da
--- /dev/null
+++ b/modules/worker/front/department/descriptor/index.html
@@ -0,0 +1,90 @@
+
+
\ No newline at end of file
diff --git a/modules/worker/front/department/descriptor/index.js b/modules/worker/front/department/descriptor/index.js
new file mode 100644
index 000000000..af57643b7
--- /dev/null
+++ b/modules/worker/front/department/descriptor/index.js
@@ -0,0 +1,104 @@
+import ngModule from '../module';
+import Descriptor from 'salix/components/descriptor';
+
+class Controller extends Descriptor {
+ constructor($element, $, $rootScope) {
+ super($element, $);
+ this.$rootScope = $rootScope;
+ }
+
+ // get worker() {
+ // return this.entity;
+ // }
+
+ // set worker(value) {
+ // this.entity = value;
+
+ // if (value)
+ // this.getIsExcluded();
+ // }
+
+ // get excluded() {
+ // return this.entity.excluded;
+ // }
+
+ // set excluded(value) {
+ // this.entity.excluded = value;
+ // }
+
+ // getIsExcluded() {
+ // this.$http.get(`workerDisableExcludeds/${this.entity.id}/exists`).then(data => {
+ // this.excluded = data.data.exists;
+ // });
+ // }
+
+ // handleExcluded() {
+ // if (this.excluded) {
+ // this.$http.delete(`workerDisableExcludeds/${this.entity.id}`);
+ // this.excluded = false;
+ // } else {
+ // this.$http.post(`workerDisableExcludeds`, {workerFk: this.entity.id, dated: new Date});
+ // this.excluded = true;
+ // }
+ // }
+
+ // loadData() {
+ // const filter = {
+ // include: [
+ // {
+ // relation: 'user',
+ // scope: {
+ // fields: ['name'],
+ // include: {
+ // relation: 'emailUser',
+ // scope: {
+ // fields: ['email']
+ // }
+ // }
+ // }
+ // }, {
+ // relation: 'client',
+ // scope: {
+ // fields: ['fi']
+ // }
+ // }, {
+ // relation: 'sip',
+ // scope: {
+ // fields: ['extension']
+ // }
+ // }, {
+ // relation: 'department',
+ // scope: {
+ // include: {
+ // relation: 'department'
+ // }
+ // }
+ // }
+ // ]
+ // };
+
+ // return this.getData(`Workers/${this.id}`, {filter})
+ // .then(res => this.entity = res.data);
+ // }
+
+ // onUploadResponse() {
+ // const timestamp = Date.vnNew().getTime();
+ // const src = this.$rootScope.imagePath('user', '520x520', this.worker.id);
+ // const zoomSrc = this.$rootScope.imagePath('user', '1600x1600', this.worker.id);
+ // const newSrc = `${src}&t=${timestamp}`;
+ // const newZoomSrc = `${zoomSrc}&t=${timestamp}`;
+
+ // this.$.photo.setAttribute('src', newSrc);
+ // this.$.photo.setAttribute('zoom-image', newZoomSrc);
+ // }
+}
+
+Controller.$inject = ['$element', '$scope', '$rootScope'];
+
+ngModule.vnComponent('vnWorkerDepartmentDescriptor', {
+ template: require('./index.html'),
+ controller: Controller,
+ bindings: {
+ worker: '<'
+ }
+});
diff --git a/modules/worker/front/department/descriptor/index.spec.js b/modules/worker/front/department/descriptor/index.spec.js
new file mode 100644
index 000000000..dfb800415
--- /dev/null
+++ b/modules/worker/front/department/descriptor/index.spec.js
@@ -0,0 +1,26 @@
+import './index.js';
+
+describe('vnWorkerDescriptor', () => {
+ let controller;
+ let $httpBackend;
+
+ beforeEach(ngModule('worker'));
+
+ beforeEach(inject(($componentController, _$httpBackend_) => {
+ $httpBackend = _$httpBackend_;
+ controller = $componentController('vnWorkerDescriptor', {$element: null});
+ }));
+
+ describe('loadData()', () => {
+ it(`should perform a get query to store the worker data into the controller`, () => {
+ const id = 1;
+ const response = 'foo';
+
+ $httpBackend.expectRoute('GET', `Workers/${id}`).respond(response);
+ controller.id = id;
+ $httpBackend.flush();
+
+ expect(controller.worker).toEqual(response);
+ });
+ });
+});
diff --git a/modules/worker/front/department/index/index.html b/modules/worker/front/department/index/index.html
index 9afa90e13..894583213 100644
--- a/modules/worker/front/department/index/index.html
+++ b/modules/worker/front/department/index/index.html
@@ -13,7 +13,7 @@
on-drop="$ctrl.onDrop($dropped, $dragged)"
on-drag-start="$ctrl.onDragStart(item)"
on-drag-end="$ctrl.onDragEnd(item)"
- ui-sref="department.card.summary(item)">
+ ng-click="department.card.summary($item)">
{{::item.name}}
diff --git a/modules/worker/front/department/index/index.js b/modules/worker/front/department/index/index.js
index 178299362..6b7ab18da 100644
--- a/modules/worker/front/department/index/index.js
+++ b/modules/worker/front/department/index/index.js
@@ -77,7 +77,7 @@ class Controller extends Section {
}
}
-ngModule.vnComponent('vnWorkerDepartment', {
+ngModule.vnComponent('vnWorkerDepartmentIndex', {
template: require('./index.html'),
controller: Controller
});
diff --git a/modules/worker/front/department/main/index.html b/modules/worker/front/department/main/index.html
new file mode 100644
index 000000000..3ab993e83
--- /dev/null
+++ b/modules/worker/front/department/main/index.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/modules/worker/front/department/main/index.js b/modules/worker/front/department/main/index.js
new file mode 100644
index 000000000..75110f749
--- /dev/null
+++ b/modules/worker/front/department/main/index.js
@@ -0,0 +1,9 @@
+import ngModule from '../module';
+import ModuleMain from 'salix/components/module-main';
+
+export default class Worker extends ModuleMain {}
+
+ngModule.vnComponent('vnWorkerDepartment', {
+ controller: Worker,
+ template: require('./index.html')
+});
diff --git a/modules/worker/front/department/routes.json b/modules/worker/front/department/routes.json
deleted file mode 100644
index f6fd46367..000000000
--- a/modules/worker/front/department/routes.json
+++ /dev/null
@@ -1,103 +0,0 @@
-{
- "module": "deparment",
- "name": "Departments",
- "icon" : "work",
- "validations" : true,
- "dependencies": ["account"],
- "menus": {
- "main": [
- {"state": "deparment.index", "icon": "icon-worker"}
- ],
- "card": [
- {"state": "department.card.basicData", "icon": "settings"},
- {
- "icon": "icon-wiki",
- "external":true,
- "url": "http://wiki.verdnatura.es",
- "description": "Wikipedia"
- },
- {"state": "worker.card.workerLog", "icon": "history"}
- ]
- },
- "routes": [
- {
- "url": "/worker",
- "state": "worker",
- "abstract": true,
- "component": "vn-worker",
- "description": "Workers"
- }, {
- "url": "/index?q",
- "state": "worker.index",
- "component": "vn-worker-index",
- "description": "Workers"
- }, {
- "url" : "/summary",
- "state": "worker.card.summary",
- "component": "vn-worker-summary",
- "description": "Summary",
- "params": {
- "worker": "$ctrl.worker"
- }
- }, {
- "url": "/:id",
- "state": "worker.card",
- "component": "vn-worker-card",
- "abstract": true,
- "description": "Detail"
- }, {
- "url": "/basic-data",
- "state": "worker.card.basicData",
- "component": "vn-worker-basic-data",
- "description": "Basic data",
- "params": {
- "worker": "$ctrl.worker"
- },
- "acl": ["hr"]
- }, {
- "url" : "/log",
- "state": "worker.card.workerLog",
- "component": "vn-worker-log",
- "description": "Log",
- "acl": ["salesAssistant"]
- }, {
- "url": "/index",
- "state": "worker.card.note.index",
- "component": "vn-worker-note",
- "description": "Notes",
- "params": {
- "worker": "$ctrl.worker"
- },
- "acl": ["hr"]
- }, {
- "url": "/create",
- "state": "worker.card.note.create",
- "component": "vn-note-worker-create",
- "description": "New note"
- },
- {
- "url": "/index",
- "state": "worker.card.dms.index",
- "component": "vn-worker-dms-index",
- "description": "My documentation",
- "acl": ["employee"]
- },
- {
- "url": "/create",
- "state": "worker.card.dms.create",
- "component": "vn-worker-dms-create",
- "description": "Upload file",
- "params": {
- "worker": "$ctrl.worker"
- },
- "acl": ["hr"]
- },
- {
- "url": "/create",
- "state": "worker.create",
- "component": "vn-worker-create",
- "description": "New worker",
- "acl": ["hr"]
- }
- ]
-}
diff --git a/modules/worker/front/department/summary/index.html b/modules/worker/front/department/summary/index.html
index de8710a6d..3cffe2f71 100644
--- a/modules/worker/front/department/summary/index.html
+++ b/modules/worker/front/department/summary/index.html
@@ -1,18 +1,18 @@
-
- {{worker.firstName}} {{worker.lastName}}
+ {{department.name}}
@@ -21,34 +21,28 @@
ng-show="!$ctrl.isHr">
Basic data
-
+
-
+
-
+
+ label="Boss:">
{{::worker.boss.nickname}}
-
+
-
-
-
-
-
+
@@ -68,6 +62,6 @@
-
-
+
+
diff --git a/modules/worker/front/department/summary/index.js b/modules/worker/front/department/summary/index.js
index c2ad107d5..ede559d18 100644
--- a/modules/worker/front/department/summary/index.js
+++ b/modules/worker/front/department/summary/index.js
@@ -2,56 +2,28 @@ import ngModule from '../module';
import Summary from 'salix/components/summary';
class Controller extends Summary {
- get worker() {
- return this._worker;
+ get department() {
+ return this._department;
}
- set worker(value) {
- this._worker = value;
- this.$.worker = null;
+ set department(value) {
+ this._department = value;
+ this.$.department = null;
if (!value) return;
- const query = `Workers/${value.id}`;
+ const query = `Departments/${value.id}`;
const filter = {
+ fields: ['chatName', 'notificationEmail'],
include: [
- {
- relation: 'user',
- scope: {
- fields: ['name', 'roleFk'],
- include: [{
- relation: 'role',
- scope: {
- fields: ['name']
- }
- },
- {
- relation: 'emailUser',
- scope: {
- fields: ['email']
- }
- }]
- }
- },
{
relation: 'client',
- scope: {fields: ['fi', 'phone']}
+ scope: {fields: ['name']}
},
{
- relation: 'boss',
- scope: {fields: ['id', 'nickname']}
- },
- {
- relation: 'sip',
- scope: {fields: ['extension']}
- },
- {
- relation: 'department',
- scope: {
- include: {
- relation: 'department'
- }
- }
+ relation: 'worker',
+ scope: {fields: ['name']}
}
+
]
};
@@ -65,7 +37,7 @@ class Controller extends Summary {
}
}
-ngModule.vnComponent('vnWorkerSummary', {
+ngModule.vnComponent('vnDepartmentSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json
index 6817d0cef..34a8a14e3 100644
--- a/modules/worker/front/routes.json
+++ b/modules/worker/front/routes.json
@@ -7,7 +7,7 @@
"menus": {
"main": [
{"state": "worker.index", "icon": "icon-worker"},
- {"state": "worker.department", "icon": "work"}
+ {"state": "worker.department.index", "icon": "work"}
],
"card": [
{"state": "worker.card.basicData", "icon": "settings"},
@@ -118,11 +118,31 @@
"worker": "$ctrl.worker"
}
}, {
- "url" : "/department/department",
+ "url": "/department",
"state": "worker.department",
- "component": "vn-worker-department",
- "description": "Departments",
+ "abstract": true,
+ "description":"Departments",
+ "component": "ui-view"
+ }, {
+ "url": "/:id",
+ "state": "worker.department.card",
+ "component": "vn-worker-department-card",
+ "abstract": true,
+ "description": "Detail"
+ }, {
+ "url" : "/index",
+ "state": "worker.department.index",
+ "component": "vn-worker-department-index",
+ "description": "Department",
"acl": ["hr"]
+ }, {
+ "url" : "/summary",
+ "state": "worker.department.card.summary",
+ "component": "vn-worker-department-summary",
+ "description": "Summary",
+ "params": {
+ "department": "$ctrl.department"
+ }
}, {
"url": "/dms",
"state": "worker.card.dms",
From 071849065a41af6d26a25111009ed31b4acdc8e1 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 15 May 2023 13:55:35 +0200
Subject: [PATCH 03/80] refs #5334 fix main
---
modules/worker/front/department/index.js | 8 ++++++++
modules/worker/front/department/main/index.js | 4 ++--
2 files changed, 10 insertions(+), 2 deletions(-)
create mode 100644 modules/worker/front/department/index.js
diff --git a/modules/worker/front/department/index.js b/modules/worker/front/department/index.js
new file mode 100644
index 000000000..5dcbe4097
--- /dev/null
+++ b/modules/worker/front/department/index.js
@@ -0,0 +1,8 @@
+import './main';
+import './index/';
+import './summary';
+import './card';
+import './descriptor';
+import './create';
+import './basic-data';
+import './search-panel';
diff --git a/modules/worker/front/department/main/index.js b/modules/worker/front/department/main/index.js
index 75110f749..246f8fe49 100644
--- a/modules/worker/front/department/main/index.js
+++ b/modules/worker/front/department/main/index.js
@@ -1,9 +1,9 @@
import ngModule from '../module';
import ModuleMain from 'salix/components/module-main';
-export default class Worker extends ModuleMain {}
+export default class Department extends ModuleMain {}
ngModule.vnComponent('vnWorkerDepartment', {
- controller: Worker,
+ controller: Department,
template: require('./index.html')
});
From 443821b5c20a0c2b51879d62ec1230144bb9969f Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 15 May 2023 13:59:54 +0200
Subject: [PATCH 04/80] refs #5334 ?q
---
modules/worker/front/routes.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json
index 34a8a14e3..50245b571 100644
--- a/modules/worker/front/routes.json
+++ b/modules/worker/front/routes.json
@@ -118,7 +118,7 @@
"worker": "$ctrl.worker"
}
}, {
- "url": "/department",
+ "url": "/department?q",
"state": "worker.department",
"abstract": true,
"description":"Departments",
From fd4d04756a218a8a2f3bfe7e93c6b9b7592ea219 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Tue, 16 May 2023 08:54:54 +0200
Subject: [PATCH 05/80] refs #5334 routes index fix
---
front/salix/components/left-menu/left-menu.js | 1 -
modules/worker/front/department/basic-data/index.js | 2 +-
modules/worker/front/department/card/index.js | 2 +-
modules/worker/front/department/descriptor/index.js | 2 +-
modules/worker/front/department/index.js | 4 ++--
modules/worker/front/department/main/index.js | 2 +-
modules/worker/front/department/summary/index.js | 2 +-
modules/worker/front/index.js | 2 +-
modules/worker/front/routes.json | 6 ------
9 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/front/salix/components/left-menu/left-menu.js b/front/salix/components/left-menu/left-menu.js
index 6bec61775..a0392ccce 100644
--- a/front/salix/components/left-menu/left-menu.js
+++ b/front/salix/components/left-menu/left-menu.js
@@ -45,7 +45,6 @@ export default class LeftMenu {
if (acl && !this.aclService.hasAny(acl))
continue;
}
- console.log(state, item);
let myItem = {
icon: item.icon,
description: item.description || state.description,
diff --git a/modules/worker/front/department/basic-data/index.js b/modules/worker/front/department/basic-data/index.js
index ea75d7b97..1f2dd848c 100644
--- a/modules/worker/front/department/basic-data/index.js
+++ b/modules/worker/front/department/basic-data/index.js
@@ -1,4 +1,4 @@
-import ngModule from '../module';
+import ngModule from '../../module';
import Section from 'salix/components/section';
class Controller extends Section {
diff --git a/modules/worker/front/department/card/index.js b/modules/worker/front/department/card/index.js
index 288c1a8c3..c7bf32569 100644
--- a/modules/worker/front/department/card/index.js
+++ b/modules/worker/front/department/card/index.js
@@ -1,4 +1,4 @@
-import ngModule from '../module';
+import ngModule from '../../module';
import ModuleCard from 'salix/components/module-card';
class Controller extends ModuleCard {
diff --git a/modules/worker/front/department/descriptor/index.js b/modules/worker/front/department/descriptor/index.js
index af57643b7..12ec396a6 100644
--- a/modules/worker/front/department/descriptor/index.js
+++ b/modules/worker/front/department/descriptor/index.js
@@ -1,4 +1,4 @@
-import ngModule from '../module';
+import ngModule from '../../module';
import Descriptor from 'salix/components/descriptor';
class Controller extends Descriptor {
diff --git a/modules/worker/front/department/index.js b/modules/worker/front/department/index.js
index 5dcbe4097..3e4db6106 100644
--- a/modules/worker/front/department/index.js
+++ b/modules/worker/front/department/index.js
@@ -3,6 +3,6 @@ import './index/';
import './summary';
import './card';
import './descriptor';
-import './create';
+// import './create';
import './basic-data';
-import './search-panel';
+// import './search-panel';
diff --git a/modules/worker/front/department/main/index.js b/modules/worker/front/department/main/index.js
index 246f8fe49..3fda47246 100644
--- a/modules/worker/front/department/main/index.js
+++ b/modules/worker/front/department/main/index.js
@@ -1,4 +1,4 @@
-import ngModule from '../module';
+import ngModule from '../../module';
import ModuleMain from 'salix/components/module-main';
export default class Department extends ModuleMain {}
diff --git a/modules/worker/front/department/summary/index.js b/modules/worker/front/department/summary/index.js
index ede559d18..cef13c479 100644
--- a/modules/worker/front/department/summary/index.js
+++ b/modules/worker/front/department/summary/index.js
@@ -1,4 +1,4 @@
-import ngModule from '../module';
+import ngModule from '../../module';
import Summary from 'salix/components/summary';
class Controller extends Summary {
diff --git a/modules/worker/front/index.js b/modules/worker/front/index.js
index 605ec9dde..8fad2c0df 100644
--- a/modules/worker/front/index.js
+++ b/modules/worker/front/index.js
@@ -11,7 +11,7 @@ import './search-panel';
import './basic-data';
import './pbx';
import './pda';
-import './department/index';
+import './department';
import './calendar';
import './time-control';
import './log';
diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json
index 50245b571..3f4f1977d 100644
--- a/modules/worker/front/routes.json
+++ b/modules/worker/front/routes.json
@@ -129,12 +129,6 @@
"component": "vn-worker-department-card",
"abstract": true,
"description": "Detail"
- }, {
- "url" : "/index",
- "state": "worker.department.index",
- "component": "vn-worker-department-index",
- "description": "Department",
- "acl": ["hr"]
}, {
"url" : "/summary",
"state": "worker.department.card.summary",
From 612d0a2dfbd25173a1f471f4735c49f1abd1b063 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Tue, 16 May 2023 09:52:48 +0200
Subject: [PATCH 06/80] refs #5334 fix index
---
modules/worker/front/routes.json | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json
index 3f4f1977d..50245b571 100644
--- a/modules/worker/front/routes.json
+++ b/modules/worker/front/routes.json
@@ -129,6 +129,12 @@
"component": "vn-worker-department-card",
"abstract": true,
"description": "Detail"
+ }, {
+ "url" : "/index",
+ "state": "worker.department.index",
+ "component": "vn-worker-department-index",
+ "description": "Department",
+ "acl": ["hr"]
}, {
"url" : "/summary",
"state": "worker.department.card.summary",
From 3dcdbe022361f09e234ed534f04fabe034194f77 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Tue, 16 May 2023 11:41:42 +0200
Subject: [PATCH 07/80] refs #5334 summary basic data
---
.../front/department/basic-data/index.html | 88 ++++++++-----------
.../front/department/basic-data/locale/es.yml | 22 +++--
.../worker/front/department/index/index.html | 2 +-
.../front/department/summary/index.html | 36 ++++++--
.../front/department/summary/locale/es.yml | 15 +++-
5 files changed, 89 insertions(+), 74 deletions(-)
diff --git a/modules/worker/front/department/basic-data/index.html b/modules/worker/front/department/basic-data/index.html
index d89d88f2e..0b381b2f1 100644
--- a/modules/worker/front/department/basic-data/index.html
+++ b/modules/worker/front/department/basic-data/index.html
@@ -1,7 +1,7 @@
-
+
@@ -12,78 +12,62 @@
-
-
-
-
-
-
-
-
-
-
-
-
+ label="Boss department"
+ ng-model="$ctrl.department.workerFk">
+
+
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/modules/worker/front/department/basic-data/locale/es.yml b/modules/worker/front/department/basic-data/locale/es.yml
index edf08de90..ea80cfed1 100644
--- a/modules/worker/front/department/basic-data/locale/es.yml
+++ b/modules/worker/front/department/basic-data/locale/es.yml
@@ -1,9 +1,13 @@
-Marital status: Estado civil
-Origin country: País origen
-Education level: Nivel educación
-SSN: NSS
-Married: Casado/a
-Single: Soltero/a
-Business phone: Teléfono de empresa
-Mobile extension: Extensión móvil
-Locker: Taquilla
+Name: Nombre
+Code: Código
+Chat: Chat
+Email: Email
+Boss department: Jefe del departamento
+Self-consumption customer: Cliente autoconsumo
+Telecommutes: Teletrabaja
+Notificate errors: Notificar errores
+Is on production: Pertenece a producción
+Fill in days without physical check-ins: Rellenar fichadas
+Send check-ins by email: Enviar fichadas por email
+Save: Guardar
+Undo changes: Deshacer cambios
diff --git a/modules/worker/front/department/index/index.html b/modules/worker/front/department/index/index.html
index 894583213..ad802542c 100644
--- a/modules/worker/front/department/index/index.html
+++ b/modules/worker/front/department/index/index.html
@@ -13,7 +13,7 @@
on-drop="$ctrl.onDrop($dropped, $dragged)"
on-drag-start="$ctrl.onDragStart(item)"
on-drag-end="$ctrl.onDragEnd(item)"
- ng-click="department.card.summary($item)">
+ ng-click="worker.department.card.summary($item)">
{{::item.name}}
diff --git a/modules/worker/front/department/summary/index.html b/modules/worker/front/department/summary/index.html
index 3cffe2f71..3ed5a310e 100644
--- a/modules/worker/front/department/summary/index.html
+++ b/modules/worker/front/department/summary/index.html
@@ -2,7 +2,7 @@
@@ -21,17 +21,17 @@
ng-show="!$ctrl.isHr">
Basic data
-
-
-
+ label="Boss department">
@@ -41,11 +41,31 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
Date: Tue, 16 May 2023 12:12:25 +0200
Subject: [PATCH 08/80] refs #5334 fix summary route
---
.../front/department/descriptor/index.html | 20 ++++---------------
.../worker/front/department/main/index.html | 4 +++-
modules/worker/front/routes.json | 13 +++---------
3 files changed, 10 insertions(+), 27 deletions(-)
diff --git a/modules/worker/front/department/descriptor/index.html b/modules/worker/front/department/descriptor/index.html
index 564c2d4da..05230bd09 100644
--- a/modules/worker/front/department/descriptor/index.html
+++ b/modules/worker/front/department/descriptor/index.html
@@ -1,19 +1,7 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/modules/worker/front/department/main/index.html b/modules/worker/front/department/main/index.html
index 3ab993e83..2aebd0f4d 100644
--- a/modules/worker/front/department/main/index.html
+++ b/modules/worker/front/department/main/index.html
@@ -15,4 +15,6 @@
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json
index 50245b571..89cafc6e2 100644
--- a/modules/worker/front/routes.json
+++ b/modules/worker/front/routes.json
@@ -7,7 +7,7 @@
"menus": {
"main": [
{"state": "worker.index", "icon": "icon-worker"},
- {"state": "worker.department.index", "icon": "work"}
+ {"state": "worker.department", "icon": "work"}
],
"card": [
{"state": "worker.card.basicData", "icon": "settings"},
@@ -120,22 +120,15 @@
}, {
"url": "/department?q",
"state": "worker.department",
- "abstract": true,
"description":"Departments",
- "component": "ui-view"
+ "component": "vn-worker-department"
}, {
"url": "/:id",
"state": "worker.department.card",
"component": "vn-worker-department-card",
"abstract": true,
"description": "Detail"
- }, {
- "url" : "/index",
- "state": "worker.department.index",
- "component": "vn-worker-department-index",
- "description": "Department",
- "acl": ["hr"]
- }, {
+ }, {
"url" : "/summary",
"state": "worker.department.card.summary",
"component": "vn-worker-department-summary",
From 9f9963af5679edcae918134b20031dad4e54035c Mon Sep 17 00:00:00 2001
From: carlossa
Date: Tue, 16 May 2023 13:10:26 +0200
Subject: [PATCH 09/80] refs #5334 descriptor
---
.../front/department/descriptor/index.html | 53 ++------
.../front/department/descriptor/index.js | 125 ++++++------------
2 files changed, 53 insertions(+), 125 deletions(-)
diff --git a/modules/worker/front/department/descriptor/index.html b/modules/worker/front/department/descriptor/index.html
index 05230bd09..0fa80da50 100644
--- a/modules/worker/front/department/descriptor/index.html
+++ b/modules/worker/front/department/descriptor/index.html
@@ -7,63 +7,30 @@
ng-click="$ctrl.handleExcluded()"
translate
ng-if="!$ctrl.excluded">
- Click to exclude the user from getting disabled
-
-
- Click to allow the user to be disabled
+ Delete
+ {{worker.department.name}}
+ {{worker.department.id}}
+ label="Chat"
+ value="{{$ctrl.worker.department.chatName}}">
+ value="{{$ctrl.worker.department.emailNotification}}">
+ label="Self-consumption customer"
+ value="{{$ctrl.worker.department.clientFK}}">
-
-
+ label="Boss department"
+ value="{{$ctrl.worker.department.workerFk}}">
-
-
-
-
-
diff --git a/modules/worker/front/department/descriptor/index.js b/modules/worker/front/department/descriptor/index.js
index 12ec396a6..937f4c351 100644
--- a/modules/worker/front/department/descriptor/index.js
+++ b/modules/worker/front/department/descriptor/index.js
@@ -7,90 +7,51 @@ class Controller extends Descriptor {
this.$rootScope = $rootScope;
}
- // get worker() {
- // return this.entity;
- // }
+ get department() {
+ return this.entity;
+ }
- // set worker(value) {
- // this.entity = value;
+ set department(value) {
+ this.entity = value;
+ }
+ loadData() {
+ const filter = {
+ include: [
+ {
+ relation: 'user',
+ scope: {
+ fields: ['name'],
+ include: {
+ relation: 'emailUser',
+ scope: {
+ fields: ['email']
+ }
+ }
+ }
+ }, {
+ relation: 'client',
+ scope: {
+ fields: ['fi']
+ }
+ }, {
+ relation: 'sip',
+ scope: {
+ fields: ['extension']
+ }
+ }, {
+ relation: 'department',
+ scope: {
+ include: {
+ relation: 'department'
+ }
+ }
+ }
+ ]
+ };
- // if (value)
- // this.getIsExcluded();
- // }
-
- // get excluded() {
- // return this.entity.excluded;
- // }
-
- // set excluded(value) {
- // this.entity.excluded = value;
- // }
-
- // getIsExcluded() {
- // this.$http.get(`workerDisableExcludeds/${this.entity.id}/exists`).then(data => {
- // this.excluded = data.data.exists;
- // });
- // }
-
- // handleExcluded() {
- // if (this.excluded) {
- // this.$http.delete(`workerDisableExcludeds/${this.entity.id}`);
- // this.excluded = false;
- // } else {
- // this.$http.post(`workerDisableExcludeds`, {workerFk: this.entity.id, dated: new Date});
- // this.excluded = true;
- // }
- // }
-
- // loadData() {
- // const filter = {
- // include: [
- // {
- // relation: 'user',
- // scope: {
- // fields: ['name'],
- // include: {
- // relation: 'emailUser',
- // scope: {
- // fields: ['email']
- // }
- // }
- // }
- // }, {
- // relation: 'client',
- // scope: {
- // fields: ['fi']
- // }
- // }, {
- // relation: 'sip',
- // scope: {
- // fields: ['extension']
- // }
- // }, {
- // relation: 'department',
- // scope: {
- // include: {
- // relation: 'department'
- // }
- // }
- // }
- // ]
- // };
-
- // return this.getData(`Workers/${this.id}`, {filter})
- // .then(res => this.entity = res.data);
- // }
-
- // onUploadResponse() {
- // const timestamp = Date.vnNew().getTime();
- // const src = this.$rootScope.imagePath('user', '520x520', this.worker.id);
- // const zoomSrc = this.$rootScope.imagePath('user', '1600x1600', this.worker.id);
- // const newSrc = `${src}&t=${timestamp}`;
- // const newZoomSrc = `${zoomSrc}&t=${timestamp}`;
-
- // this.$.photo.setAttribute('src', newSrc);
- // this.$.photo.setAttribute('zoom-image', newZoomSrc);
- // }
+ return this.getData(`Workers/${this.id}`, {filter})
+ .then(res => this.entity = res.data);
+ }
}
Controller.$inject = ['$element', '$scope', '$rootScope'];
From 5c9ee21cfce621f02cb01a4c84bc3cf2a9e2d236 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Tue, 16 May 2023 14:00:05 +0200
Subject: [PATCH 10/80] refs #5334 department.card
---
modules/worker/front/department/card/index.html | 2 +-
modules/worker/front/routes.json | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/modules/worker/front/department/card/index.html b/modules/worker/front/department/card/index.html
index cc1ad59e4..b9ae1a87b 100644
--- a/modules/worker/front/department/card/index.html
+++ b/modules/worker/front/department/card/index.html
@@ -1,5 +1,5 @@
-
+
diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json
index 89cafc6e2..4314a6401 100644
--- a/modules/worker/front/routes.json
+++ b/modules/worker/front/routes.json
@@ -24,6 +24,8 @@
"description": "Wikipedia"
},
{"state": "worker.card.workerLog", "icon": "history"}
+ ], "department": [
+ {"state": "worker.deparment.card.basicData", "icon": "settings"}
]
},
"keybindings": [
@@ -136,6 +138,14 @@
"params": {
"department": "$ctrl.department"
}
+ }, {
+ "url": "/basic-data",
+ "state": "worker.deparment.card.basicData",
+ "component": "vn-worker-department-basic-data",
+ "description": "Basic data",
+ "params": {
+ "department": "$ctrl.department"
+ }
}, {
"url": "/dms",
"state": "worker.card.dms",
From f63dd0f9a383f10a838e5cd31badf6f4127bf014 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 17 May 2023 09:05:28 +0200
Subject: [PATCH 11/80] refs #5334 datos
---
modules/worker/front/department/card/index.html | 2 +-
modules/worker/front/department/card/index.js | 3 ++-
modules/worker/front/routes.json | 2 +-
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/modules/worker/front/department/card/index.html b/modules/worker/front/department/card/index.html
index b9ae1a87b..032939600 100644
--- a/modules/worker/front/department/card/index.html
+++ b/modules/worker/front/department/card/index.html
@@ -1,5 +1,5 @@
-
+
diff --git a/modules/worker/front/department/card/index.js b/modules/worker/front/department/card/index.js
index c7bf32569..9b1ccf08d 100644
--- a/modules/worker/front/department/card/index.js
+++ b/modules/worker/front/department/card/index.js
@@ -4,7 +4,8 @@ import ModuleCard from 'salix/components/module-card';
class Controller extends ModuleCard {
reload() {
const filter = {
- fields: ['chatName', 'notificationEmail'],
+ fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
+ 'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMai', 'hasToMistake', 'clientFk'],
include: [
{
relation: 'client',
diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json
index 4314a6401..a24cf9722 100644
--- a/modules/worker/front/routes.json
+++ b/modules/worker/front/routes.json
@@ -25,7 +25,7 @@
},
{"state": "worker.card.workerLog", "icon": "history"}
], "department": [
- {"state": "worker.deparment.card.basicData", "icon": "settings"}
+ {"state": "worker.department.card.basicData", "icon": "settings"}
]
},
"keybindings": [
From adafd7444b3363ea752a6808fcae843a47fcca51 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Wed, 17 May 2023 10:04:44 +0200
Subject: [PATCH 12/80] refs #5334 worker-department
---
modules/worker/front/department/card/index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/worker/front/department/card/index.html b/modules/worker/front/department/card/index.html
index 032939600..b9ae1a87b 100644
--- a/modules/worker/front/department/card/index.html
+++ b/modules/worker/front/department/card/index.html
@@ -1,5 +1,5 @@
-
+
From 10e085ca1b1952651814f93b0b68641891372b6b Mon Sep 17 00:00:00 2001
From: carlossa
Date: Fri, 26 May 2023 11:43:51 +0200
Subject: [PATCH 13/80] refs #5334 link department
---
modules/worker/front/department/index/index.html | 9 ++++++---
modules/worker/front/department/summary/index.js | 2 +-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/modules/worker/front/department/index/index.html b/modules/worker/front/department/index/index.html
index ad802542c..259f4b8f0 100644
--- a/modules/worker/front/department/index/index.html
+++ b/modules/worker/front/department/index/index.html
@@ -12,9 +12,12 @@
sort-func="$ctrl.onSort($a, $b)"
on-drop="$ctrl.onDrop($dropped, $dragged)"
on-drag-start="$ctrl.onDragStart(item)"
- on-drag-end="$ctrl.onDragEnd(item)"
- ng-click="worker.department.card.summary($item)">
- {{::item.name}}
+ on-drag-end="$ctrl.onDragEnd(item)">
+
+ {{::item.name}}
+
diff --git a/modules/worker/front/department/summary/index.js b/modules/worker/front/department/summary/index.js
index cef13c479..51d5aa969 100644
--- a/modules/worker/front/department/summary/index.js
+++ b/modules/worker/front/department/summary/index.js
@@ -37,7 +37,7 @@ class Controller extends Summary {
}
}
-ngModule.vnComponent('vnDepartmentSummary', {
+ngModule.vnComponent('vnWorkerDepartmentSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
From 2b06c628766ecb95aab894857636fb6b3a0e1c59 Mon Sep 17 00:00:00 2001
From: alexm
Date: Fri, 26 May 2023 12:21:15 +0200
Subject: [PATCH 14/80] refs #5334 left-menu
---
front/salix/components/left-menu/left-menu.js | 3 +++
modules/worker/front/department/basic-data/index.js | 5 +----
modules/worker/front/department/main/index.html | 5 +----
modules/worker/front/routes.json | 4 ++--
4 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/front/salix/components/left-menu/left-menu.js b/front/salix/components/left-menu/left-menu.js
index a0392ccce..4a9bcc8e3 100644
--- a/front/salix/components/left-menu/left-menu.js
+++ b/front/salix/components/left-menu/left-menu.js
@@ -45,6 +45,9 @@ export default class LeftMenu {
if (acl && !this.aclService.hasAny(acl))
continue;
}
+ console.log('MyItem:', item);
+ console.log('MyState:', state);
+ console.log(item.description, state.description);
let myItem = {
icon: item.icon,
description: item.description || state.description,
diff --git a/modules/worker/front/department/basic-data/index.js b/modules/worker/front/department/basic-data/index.js
index 1f2dd848c..d9b60c683 100644
--- a/modules/worker/front/department/basic-data/index.js
+++ b/modules/worker/front/department/basic-data/index.js
@@ -15,13 +15,10 @@ class Controller extends Section {
}
}
-ngModule.vnComponent('vnWorkerBasicData', {
+ngModule.vnComponent('vnWorkerDepartmentBasicData', {
template: require('./index.html'),
controller: Controller,
bindings: {
worker: '<'
- },
- require: {
- card: '^vnWorkerCard'
}
});
diff --git a/modules/worker/front/department/main/index.html b/modules/worker/front/department/main/index.html
index 2aebd0f4d..ee260b516 100644
--- a/modules/worker/front/department/main/index.html
+++ b/modules/worker/front/department/main/index.html
@@ -12,9 +12,6 @@
model="model">
-
-
-
-
\ No newline at end of file
+
diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json
index a24cf9722..41d09ba4f 100644
--- a/modules/worker/front/routes.json
+++ b/modules/worker/front/routes.json
@@ -122,8 +122,8 @@
}, {
"url": "/department?q",
"state": "worker.department",
- "description":"Departments",
- "component": "vn-worker-department"
+ "component": "vn-worker-department",
+ "description":"Departments"
}, {
"url": "/:id",
"state": "worker.department.card",
From 07898043521091c33445e35b96064bbdb4985aa2 Mon Sep 17 00:00:00 2001
From: alexm
Date: Fri, 26 May 2023 12:58:03 +0200
Subject: [PATCH 15/80] refs #5334 fix basic-data
---
front/salix/components/left-menu/left-menu.js | 4 +---
.../front/department/descriptor/index.html | 18 +++++++++---------
modules/worker/front/department/index.js | 2 +-
.../worker/front/department/main/index.html | 3 ++-
modules/worker/front/routes.json | 16 ++++++++++------
5 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/front/salix/components/left-menu/left-menu.js b/front/salix/components/left-menu/left-menu.js
index 4a9bcc8e3..da545b291 100644
--- a/front/salix/components/left-menu/left-menu.js
+++ b/front/salix/components/left-menu/left-menu.js
@@ -45,9 +45,7 @@ export default class LeftMenu {
if (acl && !this.aclService.hasAny(acl))
continue;
}
- console.log('MyItem:', item);
- console.log('MyState:', state);
- console.log(item.description, state.description);
+
let myItem = {
icon: item.icon,
description: item.description || state.description,
diff --git a/modules/worker/front/department/descriptor/index.html b/modules/worker/front/department/descriptor/index.html
index 0fa80da50..28433e612 100644
--- a/modules/worker/front/department/descriptor/index.html
+++ b/modules/worker/front/department/descriptor/index.html
@@ -1,7 +1,7 @@
+ base-state="worker.department">
{{worker.department.id}}
@@ -39,7 +39,7 @@
-
+
Date: Fri, 26 May 2023 13:25:49 +0200
Subject: [PATCH 17/80] refs #5334 fix checks basic-data
---
modules/worker/front/department/basic-data/index.html | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/modules/worker/front/department/basic-data/index.html b/modules/worker/front/department/basic-data/index.html
index 0b381b2f1..2406080bf 100644
--- a/modules/worker/front/department/basic-data/index.html
+++ b/modules/worker/front/department/basic-data/index.html
@@ -48,6 +48,7 @@
ng-model="$ctrl.department.clientFk">
+
@@ -60,14 +61,19 @@
label="Is on production"
ng-model="$ctrl.department.isProduction">
+
+
+
+
+
From ceaaece0071108b1096d16eb190be039d781e2b8 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Fri, 26 May 2023 14:08:37 +0200
Subject: [PATCH 18/80] refs #5334 label-value
---
.../front/department/basic-data/index.js | 4 ---
.../front/department/descriptor/index.js | 32 +++++--------------
.../front/department/summary/index.html | 18 ++++-------
.../worker/front/department/summary/index.js | 7 ++--
4 files changed, 20 insertions(+), 41 deletions(-)
diff --git a/modules/worker/front/department/basic-data/index.js b/modules/worker/front/department/basic-data/index.js
index d9b60c683..d5f988141 100644
--- a/modules/worker/front/department/basic-data/index.js
+++ b/modules/worker/front/department/basic-data/index.js
@@ -4,10 +4,6 @@ import Section from 'salix/components/section';
class Controller extends Section {
constructor($element, $) {
super($element, $);
- this.maritalStatus = [
- {code: 'M', name: this.$t('Married')},
- {code: 'S', name: this.$t('Single')}
- ];
}
onSubmit() {
return this.$.watcher.submit()
diff --git a/modules/worker/front/department/descriptor/index.js b/modules/worker/front/department/descriptor/index.js
index 937f4c351..eb6489826 100644
--- a/modules/worker/front/department/descriptor/index.js
+++ b/modules/worker/front/department/descriptor/index.js
@@ -16,35 +16,19 @@ class Controller extends Descriptor {
}
loadData() {
const filter = {
+ fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
+ 'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMai', 'hasToMistake', 'clientFk'],
include: [
{
- relation: 'user',
- scope: {
- fields: ['name'],
- include: {
- relation: 'emailUser',
- scope: {
- fields: ['email']
- }
- }
- }
- }, {
relation: 'client',
- scope: {
- fields: ['fi']
- }
- }, {
- relation: 'sip',
- scope: {
- fields: ['extension']
- }
+ scope: {fields: ['name']}
+ },
+ {
+ relation: 'worker',
+ scope: {fields: ['name']}
}, {
relation: 'department',
- scope: {
- include: {
- relation: 'department'
- }
- }
+ scope: {fields: ['name']}
}
]
};
diff --git a/modules/worker/front/department/summary/index.html b/modules/worker/front/department/summary/index.html
index 6b7ded649..979f01dc0 100644
--- a/modules/worker/front/department/summary/index.html
+++ b/modules/worker/front/department/summary/index.html
@@ -2,9 +2,9 @@
-
+
{{department.name}}
@@ -12,7 +12,7 @@
@@ -24,21 +24,17 @@
-
-
- {{::worker.boss.nickname}}
-
+ label="Boss department"
+ value="{{$ctrl.worker.department.workerFk}}">
-
Date: Fri, 26 May 2023 14:23:34 +0200
Subject: [PATCH 19/80] refs #5334 fix hasToSendMail
---
modules/worker/front/department/card/index.js | 2 +-
modules/worker/front/department/descriptor/index.js | 2 +-
modules/worker/front/department/summary/index.js | 9 +++++----
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/modules/worker/front/department/card/index.js b/modules/worker/front/department/card/index.js
index 9b1ccf08d..72b0876a0 100644
--- a/modules/worker/front/department/card/index.js
+++ b/modules/worker/front/department/card/index.js
@@ -5,7 +5,7 @@ class Controller extends ModuleCard {
reload() {
const filter = {
fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
- 'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMai', 'hasToMistake', 'clientFk'],
+ 'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'],
include: [
{
relation: 'client',
diff --git a/modules/worker/front/department/descriptor/index.js b/modules/worker/front/department/descriptor/index.js
index eb6489826..31a37e338 100644
--- a/modules/worker/front/department/descriptor/index.js
+++ b/modules/worker/front/department/descriptor/index.js
@@ -17,7 +17,7 @@ class Controller extends Descriptor {
loadData() {
const filter = {
fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
- 'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMai', 'hasToMistake', 'clientFk'],
+ 'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'],
include: [
{
relation: 'client',
diff --git a/modules/worker/front/department/summary/index.js b/modules/worker/front/department/summary/index.js
index f40214be5..3c78e329f 100644
--- a/modules/worker/front/department/summary/index.js
+++ b/modules/worker/front/department/summary/index.js
@@ -14,7 +14,7 @@ class Controller extends Summary {
const query = `Departments/${value.id}`;
const filter = {
fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
- 'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMai', 'hasToMistake', 'clientFk'],
+ 'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'],
include: [
{
relation: 'client',
@@ -30,9 +30,10 @@ class Controller extends Summary {
]
};
- this.$http.get(query, {params: {filter}}).then(res => {
- this.$.worker = res.data;
- });
+ this.$http.get(query, {params: {filter}})
+ .then(res => {
+ this.$.department = res.data;
+ });
}
get isHr() {
From 2a78a912eb9d1cf3d1a95761c8155043371976c2 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Fri, 26 May 2023 14:35:12 +0200
Subject: [PATCH 20/80] refs #5334 worker.department
---
modules/worker/front/department/summary/index.html | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/modules/worker/front/department/summary/index.html b/modules/worker/front/department/summary/index.html
index 979f01dc0..850b1e9f4 100644
--- a/modules/worker/front/department/summary/index.html
+++ b/modules/worker/front/department/summary/index.html
@@ -22,23 +22,23 @@
Basic data
+ value="{{worker.department.department.name}}">
+ value="{{worker.department.department.code}}">
+ value="{{worker.department.department.chat}}">
+ value="{{$ctrl.worker.department.department.workerFk}}">
+ value="{{worker.department.department.notificationEmail}}">
+ value="{{worker.department.department.workerFk}}">
From f4e877dadad25ce9e07a6da01de34b7c62495032 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 29 May 2023 14:46:39 +0200
Subject: [PATCH 21/80] refs #5334 refactor summary
---
.../front/department/basic-data/index.js | 12 +-----
.../worker/front/department/summary/index.js | 40 ++++++-------------
2 files changed, 15 insertions(+), 37 deletions(-)
diff --git a/modules/worker/front/department/basic-data/index.js b/modules/worker/front/department/basic-data/index.js
index d5f988141..31f50ee85 100644
--- a/modules/worker/front/department/basic-data/index.js
+++ b/modules/worker/front/department/basic-data/index.js
@@ -1,20 +1,12 @@
import ngModule from '../../module';
import Section from 'salix/components/section';
-class Controller extends Section {
- constructor($element, $) {
- super($element, $);
- }
- onSubmit() {
- return this.$.watcher.submit()
- .then(() => this.card.reload());
- }
-}
+export default class Controller extends Section {}
ngModule.vnComponent('vnWorkerDepartmentBasicData', {
template: require('./index.html'),
controller: Controller,
bindings: {
- worker: '<'
+ department: '<'
}
});
diff --git a/modules/worker/front/department/summary/index.js b/modules/worker/front/department/summary/index.js
index 3c78e329f..4897c27a2 100644
--- a/modules/worker/front/department/summary/index.js
+++ b/modules/worker/front/department/summary/index.js
@@ -1,39 +1,25 @@
import ngModule from '../../module';
-import Summary from 'salix/components/summary';
-
-class Controller extends Summary {
- get department() {
- return this._department;
- }
+import Component from 'core/lib/component';
+class Controller extends Component {
set department(value) {
this._department = value;
- this.$.department = null;
+ this.$.summary = null;
if (!value) return;
- const query = `Departments/${value.id}`;
const filter = {
- fields: ['id', 'name', 'code', 'workerFk', 'isProduction', 'chatName',
- 'isTeleworking', 'notificationEmail', 'hasToRefill', 'hasToSendMail', 'hasToMistake', 'clientFk'],
include: [
- {
- relation: 'client',
- scope: {fields: ['name']}
- },
- {
- relation: 'worker',
- scope: {fields: ['name']}
- }, {
- relation: 'department',
- scope: {fields: ['name']}
- }
+ {relation: 'client'},
+ {relation: 'worker'},
+ {relation: 'department'}
]
};
- this.$http.get(query, {params: {filter}})
- .then(res => {
- this.$.department = res.data;
- });
+ this.$http.get(`Departments/${value.id}`, {filter})
+ .then(res => this.$.summary = res.data);
+ }
+ get department() {
+ return this._department;
}
get isHr() {
@@ -41,10 +27,10 @@ class Controller extends Summary {
}
}
-ngModule.vnComponent('vnWorkerDepartmentSummary', {
+ngModule.component('vnWorkerDepartmentSummary', {
template: require('./index.html'),
controller: Controller,
bindings: {
- worker: '<'
+ department: '<'
}
});
From 2d6f0bb2ce10e5847c42145a93f5846e9395a011 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Mon, 29 May 2023 15:27:50 +0200
Subject: [PATCH 22/80] refs #5334 front fix
---
modules/worker/back/models/department.json | 3 +-
.../front/department/summary/index.html | 33 ++++++++-----------
2 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/modules/worker/back/models/department.json b/modules/worker/back/models/department.json
index 7d8d61d73..855124620 100644
--- a/modules/worker/back/models/department.json
+++ b/modules/worker/back/models/department.json
@@ -9,7 +9,8 @@
"properties": {
"id": {
"id": true,
- "type": "number"
+ "type": "number",
+ "description": "Identifier"
},
"code": {
"type": "string"
diff --git a/modules/worker/front/department/summary/index.html b/modules/worker/front/department/summary/index.html
index 850b1e9f4..6950ea7c1 100644
--- a/modules/worker/front/department/summary/index.html
+++ b/modules/worker/front/department/summary/index.html
@@ -1,18 +1,11 @@
-
-
-
-
- {{department.name}}
+ {{summary.name}}
@@ -22,45 +15,45 @@
Basic data
+ value="{{summary.name}}">
+ value="{{summary.code}}">
+ value="{{summary.chat}}">
+ value="{{$summary.workerFk}}">
+ value="{{summary.notificationEmail}}">
+ value="{{summary.workerFk}}">
+ ng-model="$ctrl.summary.isTeleworking">
+ ng-model="$ctrl.summary.hasToMistake">
+ ng-model="$ctrl.summary.isProduction">
+ ng-model="$ctrl.summary.hasToRefill">
+ ng-model="$ctrl.summary.hasToSendMail">
From d9a64211de6f1f46ebdbe5f63b6ba453ddf60a32 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Tue, 30 May 2023 09:16:02 +0200
Subject: [PATCH 23/80] refs #5334 fix descriptor, basic-data, summary
---
modules/worker/back/models/department.json | 5 ++++-
.../front/department/basic-data/index.html | 3 +--
.../front/department/descriptor/index.html | 12 ++++++------
.../front/department/descriptor/index.js | 7 ++-----
.../worker/front/department/summary/index.html | 18 ++++++++++++------
.../worker/front/department/summary/index.js | 3 +--
modules/worker/front/routes.json | 5 ++---
7 files changed, 28 insertions(+), 25 deletions(-)
diff --git a/modules/worker/back/models/department.json b/modules/worker/back/models/department.json
index 855124620..37ec3a3a1 100644
--- a/modules/worker/back/models/department.json
+++ b/modules/worker/back/models/department.json
@@ -8,8 +8,8 @@
},
"properties": {
"id": {
- "id": true,
"type": "number",
+ "id": true,
"description": "Identifier"
},
"code": {
@@ -38,6 +38,9 @@
},
"hasToMistake": {
"type": "number"
+ },
+ "isTeleworking": {
+ "type": "boolean"
}
},
"relations": {
diff --git a/modules/worker/front/department/basic-data/index.html b/modules/worker/front/department/basic-data/index.html
index 2406080bf..9b82f4ec6 100644
--- a/modules/worker/front/department/basic-data/index.html
+++ b/modules/worker/front/department/basic-data/index.html
@@ -1,9 +1,8 @@
-
+ url="Departments">
diff --git a/modules/worker/front/department/summary/index.js b/modules/worker/front/department/summary/index.js
index 4897c27a2..6fbffc852 100644
--- a/modules/worker/front/department/summary/index.js
+++ b/modules/worker/front/department/summary/index.js
@@ -10,8 +10,7 @@ class Controller extends Component {
const filter = {
include: [
{relation: 'client'},
- {relation: 'worker'},
- {relation: 'department'}
+ {relation: 'worker'}
]
};
diff --git a/modules/worker/front/routes.json b/modules/worker/front/routes.json
index ccba0551a..7ac692391 100644
--- a/modules/worker/front/routes.json
+++ b/modules/worker/front/routes.json
@@ -146,9 +146,8 @@
"component": "vn-worker-department-basic-data",
"description": "Basic data",
"params": {
- "item-type": "$ctrl.itemType"
- },
- "acl": ["buyer"]
+ "department": "$ctrl.department"
+ }
},
{
"url": "/dms",
From 107d8d1edd808f2873ddadd502374ee9382d1fe3 Mon Sep 17 00:00:00 2001
From: carlossa
Date: Tue, 30 May 2023 10:13:49 +0200
Subject: [PATCH 24/80] refs #5334 model y vista
---
modules/worker/back/models/department.json | 9 +++++++++
modules/worker/front/department/basic-data/index.html | 2 +-
modules/worker/front/department/summary/index.html | 2 +-
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/modules/worker/back/models/department.json b/modules/worker/back/models/department.json
index 37ec3a3a1..edeba74f7 100644
--- a/modules/worker/back/models/department.json
+++ b/modules/worker/back/models/department.json
@@ -41,6 +41,15 @@
},
"isTeleworking": {
"type": "boolean"
+ },
+ "hasToRefill": {
+ "type": "boolean"
+ },
+ "hasToSendMail": {
+ "type": "boolean"
+ },
+ "isProduction": {
+ "type": "boolean"
}
},
"relations": {
diff --git a/modules/worker/front/department/basic-data/index.html b/modules/worker/front/department/basic-data/index.html
index 9b82f4ec6..ef5760be2 100644
--- a/modules/worker/front/department/basic-data/index.html
+++ b/modules/worker/front/department/basic-data/index.html
@@ -4,7 +4,7 @@
form="form"
url="Departments">
-