From 019e6fcf014dda1ef90d8479f798882da871377b Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 14 Jul 2021 23:55:43 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 4 +++- .../src/components/work-order-item-labors.vue | 12 ++++++++++-- .../src/components/work-order-item-loans.vue | 18 +++++++++++++++--- .../work-order-item-outside-services.vue | 14 +++++++++++--- .../work-order-item-part-requests.vue | 14 +++++++++++--- .../src/components/work-order-item-parts.vue | 18 +++++++++++++++--- .../work-order-item-scheduled-users.vue | 18 +++++++++++++++--- .../src/components/work-order-item-tasks.vue | 18 +++++++++++++++--- .../src/components/work-order-item-travels.vue | 12 ++++++++++-- .../src/components/work-order-item-units.vue | 18 +++++++++++++++--- 10 files changed, 120 insertions(+), 26 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 3a25ce72..7ce8edb4 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -457,7 +457,9 @@ Subcontractor / tech limited modifications - +TODO: Outside Service repair COST is still showing for restricted and other users + should it? + todo: units on work order are not limited to customer on work order?? todo: looks like wont' need subrights system, need to disentangle and remove it from workorder todo: Status on work order doesn't seem to be preventing "Who can select" by role properly diff --git a/ayanova/src/components/work-order-item-labors.vue b/ayanova/src/components/work-order-item-labors.vue index 27721b0b..1836fab2 100644 --- a/ayanova/src/components/work-order-item-labors.vue +++ b/ayanova/src/components/work-order-item-labors.vue @@ -953,10 +953,18 @@ export default { return this.pvm.rights.change && this.pvm.subRights.labors.create; }, canDelete: function() { - return this.activeItemIndex != null && this.canDeleteAll; + return ( + this.activeItemIndex != null && + this.pvm.rights.change && + this.pvm.subRights.labors.delete + ); }, canDeleteAll: function() { - return this.pvm.rights.change && this.pvm.subRights.labors.delete; + return ( + this.pvm.rights.change && + this.pvm.subRights.labors.delete && + !this.value.userIsRestrictedType + ); } //---- } diff --git a/ayanova/src/components/work-order-item-loans.vue b/ayanova/src/components/work-order-item-loans.vue index 63ddf46e..e3d68381 100644 --- a/ayanova/src/components/work-order-item-loans.vue +++ b/ayanova/src/components/work-order-item-loans.vue @@ -821,13 +821,25 @@ export default { return this.activeItemIndex != null; }, canAdd: function() { - return this.pvm.rights.change && this.pvm.subRights.loans.create; + return ( + this.pvm.rights.change && + this.pvm.subRights.loans.create && + !this.value.userIsRestrictedType + ); }, canDelete: function() { - return this.activeItemIndex != null && this.canDeleteAll; + return ( + this.activeItemIndex != null && + this.canDeleteAll && + !this.value.userIsRestrictedType + ); }, canDeleteAll: function() { - return this.pvm.rights.change && this.pvm.subRights.loans.delete; + return ( + this.pvm.rights.change && + this.pvm.subRights.loans.delete && + !this.value.userIsRestrictedType + ); } //---- diff --git a/ayanova/src/components/work-order-item-outside-services.vue b/ayanova/src/components/work-order-item-outside-services.vue index 95c2f182..382bb9a0 100644 --- a/ayanova/src/components/work-order-item-outside-services.vue +++ b/ayanova/src/components/work-order-item-outside-services.vue @@ -1080,15 +1080,23 @@ export default { }, canAdd: function() { return ( - this.pvm.rights.change && this.pvm.subRights.outsideServices.create + this.pvm.rights.change && + this.pvm.subRights.outsideServices.create && + !this.value.userIsRestrictedType ); }, canDelete: function() { - return this.activeItemIndex != null && this.canDeleteAll; + return ( + this.activeItemIndex != null && + this.canDeleteAll && + !this.value.userIsRestrictedType + ); }, canDeleteAll: function() { return ( - this.pvm.rights.change && this.pvm.subRights.outsideServices.delete + this.pvm.rights.change && + this.pvm.subRights.outsideServices.delete && + !this.value.userIsRestrictedType ); } diff --git a/ayanova/src/components/work-order-item-part-requests.vue b/ayanova/src/components/work-order-item-part-requests.vue index 574d754d..675fdbc1 100644 --- a/ayanova/src/components/work-order-item-part-requests.vue +++ b/ayanova/src/components/work-order-item-part-requests.vue @@ -373,13 +373,21 @@ export default { return this.activeItemIndex != null; }, // canAdd: function() { - // return this.pvm.rights.change && this.pvm.subRights.partRequests.create; + // return this.pvm.rights.change && this.pvm.subRights.partRequests.create && !this.value.userIsRestrictedType; // }, canDelete: function() { - return this.activeItemIndex != null && this.canDeleteAll; + return ( + this.activeItemIndex != null && + this.canDeleteAll && + !this.value.userIsRestrictedType + ); }, canDeleteAll: function() { - return this.pvm.rights.change && this.pvm.subRights.partRequests.delete; + return ( + this.pvm.rights.change && + this.pvm.subRights.partRequests.delete && + !this.value.userIsRestrictedType + ); } //---- diff --git a/ayanova/src/components/work-order-item-parts.vue b/ayanova/src/components/work-order-item-parts.vue index 812722c4..0e00a511 100644 --- a/ayanova/src/components/work-order-item-parts.vue +++ b/ayanova/src/components/work-order-item-parts.vue @@ -1071,13 +1071,25 @@ export default { return this.activeItemIndex != null; }, canAdd: function() { - return this.pvm.rights.change && this.pvm.subRights.parts.create; + return ( + this.pvm.rights.change && + this.pvm.subRights.parts.create && + !this.value.userIsRestrictedType + ); }, canDelete: function() { - return this.activeItemIndex != null && this.canDeleteAll; + return ( + this.activeItemIndex != null && + this.canDeleteAll && + !this.value.userIsRestrictedType + ); }, canDeleteAll: function() { - return this.pvm.rights.change && this.pvm.subRights.parts.delete; + return ( + this.pvm.rights.change && + this.pvm.subRights.parts.delete && + !this.value.userIsRestrictedType + ); } //---- diff --git a/ayanova/src/components/work-order-item-scheduled-users.vue b/ayanova/src/components/work-order-item-scheduled-users.vue index f89367e6..723cacce 100644 --- a/ayanova/src/components/work-order-item-scheduled-users.vue +++ b/ayanova/src/components/work-order-item-scheduled-users.vue @@ -664,13 +664,25 @@ export default { return this.activeItemIndex != null; }, canAdd: function() { - return this.pvm.rights.change && this.pvm.subRights.scheduledUsers.create; + return ( + this.pvm.rights.change && + this.pvm.subRights.scheduledUsers.create && + !this.value.userIsRestrictedType + ); }, canDelete: function() { - return this.activeItemIndex != null && this.canDeleteAll; + return ( + this.activeItemIndex != null && + this.canDeleteAll && + !this.value.userIsRestrictedType + ); }, canDeleteAll: function() { - return this.pvm.rights.change && this.pvm.subRights.scheduledUsers.delete; + return ( + this.pvm.rights.change && + this.pvm.subRights.scheduledUsers.delete && + !this.value.userIsRestrictedType + ); } } }; diff --git a/ayanova/src/components/work-order-item-tasks.vue b/ayanova/src/components/work-order-item-tasks.vue index 1b8609d8..28364dac 100644 --- a/ayanova/src/components/work-order-item-tasks.vue +++ b/ayanova/src/components/work-order-item-tasks.vue @@ -625,13 +625,25 @@ export default { return this.activeItemIndex != null; }, canAdd: function() { - return this.pvm.rights.change && this.pvm.subRights.tasks.create; + return ( + this.pvm.rights.change && + this.pvm.subRights.tasks.create && + !this.value.userIsRestrictedType + ); }, canDelete: function() { - return this.activeItemIndex != null && this.canDeleteAll; + return ( + this.activeItemIndex != null && + this.canDeleteAll && + !this.value.userIsRestrictedType + ); }, canDeleteAll: function() { - return this.pvm.rights.change && this.pvm.subRights.tasks.delete; + return ( + this.pvm.rights.change && + this.pvm.subRights.tasks.delete && + !this.value.userIsRestrictedType + ); } } }; diff --git a/ayanova/src/components/work-order-item-travels.vue b/ayanova/src/components/work-order-item-travels.vue index 2120405d..007b7cf3 100644 --- a/ayanova/src/components/work-order-item-travels.vue +++ b/ayanova/src/components/work-order-item-travels.vue @@ -931,10 +931,18 @@ export default { return this.pvm.rights.change && this.pvm.subRights.travels.create; }, canDelete: function() { - return this.activeItemIndex != null && this.canDeleteAll; + return ( + this.activeItemIndex != null && + this.pvm.rights.change && + this.pvm.subRights.travels.delete + ); }, canDeleteAll: function() { - return this.pvm.rights.change && this.pvm.subRights.travels.delete; + return ( + this.pvm.rights.change && + this.pvm.subRights.travels.delete && + !this.value.userIsRestrictedType + ); } //---- diff --git a/ayanova/src/components/work-order-item-units.vue b/ayanova/src/components/work-order-item-units.vue index 733d22c8..c0eaed5c 100644 --- a/ayanova/src/components/work-order-item-units.vue +++ b/ayanova/src/components/work-order-item-units.vue @@ -758,13 +758,25 @@ export default { return this.activeItemIndex != null; }, canAdd: function() { - return this.pvm.rights.change && this.pvm.subRights.units.create; + return ( + this.pvm.rights.change && + this.pvm.subRights.units.create && + !this.value.userIsRestrictedType + ); }, canDelete: function() { - return this.activeItemIndex != null && this.canDeleteAll; + return ( + this.activeItemIndex != null && + this.canDeleteAll && + !this.value.userIsRestrictedType + ); }, canDeleteAll: function() { - return this.pvm.rights.change && this.pvm.subRights.units.delete; + return ( + this.pvm.rights.change && + this.pvm.subRights.units.delete && + !this.value.userIsRestrictedType + ); } } };