5334-editDepartment #1521

Merged
carlossa merged 84 commits from 5334-editDepartment into dev 2023-07-06 07:09:06 +00:00
11 changed files with 396 additions and 4 deletions
Showing only changes of commit 87e1caa4eb - Show all commits

View File

@ -0,0 +1,101 @@
<mg-ajax path="Workers/{{patch.params.id}}" options="vnPatch"></mg-ajax>
<vn-watcher
vn-id="watcher"
data="$ctrl.worker"
form="form"
save="patch">
</vn-watcher>
<form name="form" ng-submit="$ctrl.onSubmit()" class="vn-w-md">
<vn-card class="vn-pa-lg">
<vn-vertical>
<vn-horizontal>
<vn-textfield
vn-one
label="Name"
ng-model="$ctrl.worker.firstName"
rule>
</vn-textfield>
<vn-textfield
vn-one
label="Last name"
ng-model="$ctrl.worker.lastName"
rule>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="Business phone"
ng-model="$ctrl.worker.phone"
rule>
</vn-textfield>
<vn-textfield
vn-one
label="Mobile extension"
ng-model="$ctrl.worker.mobileExtension"
rule>
</vn-textfield>
</vn-horizontal>
<vn-horizontal>
carlossa marked this conversation as resolved Outdated
Outdated
Review

Deberia ser Autocomplete

Deberia ser Autocomplete
<vn-autocomplete
ng-model="$ctrl.worker.bossFk"
url="Workers/activeWithInheritedRole"
show-field="nickname"
search-function="{firstName: $search}"
Outdated
Review

Deberia ser Autocomplete

Deberia ser Autocomplete
where="{role: 'employee'}"
label="Boss">
</vn-autocomplete>
<vn-autocomplete
label="Marital status"
data="$ctrl.maritalStatus"
show-field="name"
value-field="code"
ng-model="$ctrl.worker.maritalStatus">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-autocomplete
ng-model="$ctrl.worker.originCountryFk"
url="Countries"
fields="['id', 'country', 'code']"
carlossa marked this conversation as resolved Outdated

jo posaria teleworking es mes intuitiu per a la gent

No, the term "teleworking" is not incorrect. In fact, "teleworking" and "telecommuting" are often used interchangeably to refer to the practice of working remotely. Both terms describe the same concept of performing work duties from a location outside of a traditional office environment.

While "telecommuting" is more commonly used in North America, "teleworking" is a term that is more prevalent in Europe and other parts of the world. The choice between the two terms may vary depending on regional preferences and cultural norms.

jo posaria teleworking es mes intuitiu per a la gent No, the term "teleworking" is not incorrect. In fact, "teleworking" and "telecommuting" are often used interchangeably to refer to the practice of working remotely. Both terms describe the same concept of performing work duties from a location outside of a traditional office environment. While "telecommuting" is more commonly used in North America, "teleworking" is a term that is more prevalent in Europe and other parts of the world. The choice between the two terms may vary depending on regional preferences and cultural norms.

Consistencia en la terminología: Asegúrate de que estás utilizando terminología consistente en todas tus etiquetas. Por ejemplo, en una etiqueta usas "Teleworking" y en otra "check-ins". Sería más consistente si usas "Telework" y "Check-ins" o "Teleworking" y "Checking in", según corresponda.

agafem telework

Consistencia en la terminología: Asegúrate de que estás utilizando terminología consistente en todas tus etiquetas. Por ejemplo, en una etiqueta usas "Teleworking" y en otra "check-ins". Sería más consistente si usas "Telework" y "Check-ins" o "Teleworking" y "Checking in", según corresponda. agafem telework
show-field="country"
value-field="id"
label="Origin country">
</vn-autocomplete>
<vn-autocomplete
ng-model="$ctrl.worker.educationLevelFk"
url="EducationLevels"
fields="['id', 'name']"
carlossa marked this conversation as resolved Outdated

chatgpt
dime en ingles una variable para indicar que alguien trabaja en produccion
ChatGPT
La variable para indicar que alguien trabaja en producción podría denominarse worksInProduction.

chatgpt dime en ingles una variable para indicar que alguien trabaja en produccion ChatGPT La variable para indicar que alguien trabaja en producción podría denominarse worksInProduction.
show-field="name"
value-field="id"
label="Education level">
</vn-autocomplete>
</vn-horizontal>
<vn-horizontal>
<vn-textfield
vn-one
label="SSN"
ng-model="$ctrl.worker.SSN"
rule>
</vn-textfield>
<vn-input-number
min="0"
label="Locker"
ng-model="$ctrl.worker.locker">
</vn-input-number>
</vn-horizontal>
</vn-vertical>
</vn-card>
<vn-button-bar>
<vn-submit
disabled="!watcher.dataChanged()"
label="Save">
</vn-submit>
<vn-button
class="cancel"
label="Undo changes"
disabled="!watcher.dataChanged()"
ng-click="watcher.loadOriginalData()">
</vn-button>
</vn-button-bar>
</form>

View File

@ -0,0 +1,27 @@
import ngModule from '../module';
import Section from 'salix/components/section';
class Controller extends Section {
carlossa marked this conversation as resolved Outdated
Outdated
Review

Me sona que si no gastes el Controller pots borrar esta linea y...

Me sona que si no gastes el Controller pots borrar esta linea y...
constructor($element, $) {
super($element, $);
this.maritalStatus = [
{code: 'M', name: this.$t('Married')},
carlossa marked this conversation as resolved Outdated
Outdated
Review

... Aci posar Section (No estic segur)

... Aci posar Section (No estic segur)
{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'
}
});

View File

@ -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

View File

@ -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}}
</vn-treeview>
</vn-card>

View File

@ -1,4 +1,4 @@
import ngModule from '../module';
import ngModule from '../../module';
import Section from 'salix/components/section';
class Controller extends Section {

View File

@ -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"]
}
]
}

View File

@ -0,0 +1,73 @@
<vn-card class="summary">
<h5>
<a ng-if="::$ctrl.worker.id"
vn-tooltip="Go to the worker"
ui-sref="department.card.summary({id: {{::$ctrl.worker.id}}})"
name="goToSummary">
<vn-icon-button icon="launch"></vn-icon-button>
</a>
<span>{{worker.firstName}} {{worker.lastName}}</span>
</h5>
<vn-horizontal class="vn-pa-md">
<vn-one>
<h4 ng-show="$ctrl.isHr">
<a
ui-sref="worker.card.basicData({id:$ctrl.worker.id})">
<span translate vn-tooltip="Go to">Basic data</span>
</a>
</h4>
<h4
translates
ng-show="!$ctrl.isHr">
Basic data
</h4>
<vn-label-value label="Id"
value="{{worker.id}}">
</vn-label-value>
<vn-label-value label="Email" no-ellipsize
value="{{worker.user.emailUser.email}}">
</vn-label-value>
<vn-label-value label="Department"
value="{{worker.department.department.name}}">
</vn-label-value>
<vn-label-value
label="Boss">
<span
ng-click="workerDescriptor.show($event, worker.boss.id)"
class="link">
{{::worker.boss.nickname}}
</span>
</vn-label-value>
carlossa marked this conversation as resolved Outdated

teleworking

teleworking
<vn-label-value label="Mobile extension"
value="{{worker.mobileExtension}}">
</vn-label-value>
<vn-label-value label="Business phone"
value="{{worker.phone}}">
carlossa marked this conversation as resolved Outdated

Notify on errors

Notify on errors
</vn-label-value>
<vn-label-value label="Personal phone"
value="{{worker.client.phone}}">
</vn-label-value>
<vn-label-value label="Locker"
value="{{worker.locker}}">
</vn-label-value>
</vn-one>
<vn-one>
<h4 translate>User data</h4>
<vn-label-value label="User id"
value="{{worker.userFk}}">
</vn-label-value>
<vn-label-value label="User"
value="{{worker.user.name}}">
</vn-label-value>
<vn-label-value label="Role"
value="{{worker.user.role.name}}">
</vn-label-value>
<vn-label-value label="Extension"
value="{{worker.sip.extension}}">
</vn-label-value>
</vn-one>
</vn-horizontal>
</vn-card>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>

View File

@ -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;
Outdated
Review

Revisa que no tingues ja les dades en this.department

Revisa que no tingues ja les dades en this.department
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: '<'
}
});

View File

@ -0,0 +1,4 @@
Business phone: Teléfono de empresa
Personal phone: Teléfono personal
Mobile extension: Extensión móvil
Locker: Taquilla

View File

@ -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';

View File

@ -118,7 +118,7 @@
"worker": "$ctrl.worker"
}
}, {
"url" : "/department",
"url" : "/department/department",
"state": "worker.department",
"component": "vn-worker-department",
"description": "Departments",