This commit is contained in:
@@ -51,7 +51,10 @@
|
||||
Showing the form below the grid of all the other items is actually a handy affordance because you can see what was entered and refer to it in the companion same group items
|
||||
so if you forgot if you entered a particular user or not in the midst of entry you can see it just above
|
||||
|
||||
|
||||
todo: can I turn control labels into hyperlinks for getting to feeder records? If not then need to find a way to accomplish it
|
||||
e.g. can workorder status title be changed to a hyper link to status list
|
||||
e.g. can projects title be turned to a hyper link to projects list
|
||||
ideally not in menu because it would be a lot on a workorder and need space for wo graph subitem links
|
||||
todo: need to implement layered (ordered) save now so can test
|
||||
todo: need an editable control at every level for proper test of partical update
|
||||
todo: need the state control at least enough to test as it's a critical part
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
todo: it must be clear to user why they can not change if they have too low a role to change, perhaps text under state instead of selector box that says "Only select roles can change this state"
|
||||
|
||||
-->
|
||||
{{ currentState }}
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
@@ -147,11 +148,39 @@ export default {
|
||||
};
|
||||
},
|
||||
canAdd: function() {
|
||||
return (
|
||||
!this.value.isLocked &&
|
||||
this.pvm.rights.change &&
|
||||
this.pvm.subRights.states.create
|
||||
);
|
||||
//first check most obvious disqualifying properties
|
||||
if (!this.pvm.rights.change || !this.pvm.subRights.states.create) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//not currently locked, user has rights to do it so allow it
|
||||
if (!this.value.isLocked) {
|
||||
return true;
|
||||
}
|
||||
|
||||
//locked, confirm if user can change it
|
||||
//if any role then no problem
|
||||
|
||||
//ok, only thing left to check is if the current user can unlock this
|
||||
//get remove roles required for current state
|
||||
let cs = this.currentState;
|
||||
if (cs.removeRoles == null || cs.removeRoles == 0) {
|
||||
//no state set yet
|
||||
return true;
|
||||
}
|
||||
|
||||
//ok, need to check the role here against current user roles to see if this is valid
|
||||
if (window.$gz.role.hasRole(cs.removeRoles)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
//failsafe
|
||||
return false;
|
||||
// return (
|
||||
// !this.value.isLocked &&
|
||||
// this.pvm.rights.change &&
|
||||
// this.pvm.subRights.states.create
|
||||
// );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -455,7 +455,6 @@ export default {
|
||||
// vm.obj.concurrency = res.data.concurrency;
|
||||
// }
|
||||
|
||||
|
||||
// }
|
||||
} catch (ex) {
|
||||
window.$gz.errorHandler.handleFormError(ex, vm);
|
||||
|
||||
Reference in New Issue
Block a user