This commit is contained in:
2022-02-14 15:12:38 +00:00
parent 686c2011a4
commit beedbdb2b7
2 changed files with 43 additions and 9 deletions

View File

@@ -23,8 +23,7 @@ FIRST CLIENT SOURCE CODE COMMIT JAN 3rd 2019
# OUTSTANDING MAJOR AREAS TO BETA
Update dependencies before the next beta build
beta versioning for actual release, beta rc1?
beta versioning for actual release, beta rc1?
- BETA tester docs on what and how suggested to test?
Joyce will make survey for this

View File

@@ -130,7 +130,7 @@
<v-card>
<v-card-title>{{ $ay.t("New") }}</v-card-title>
<v-card-text>
<v-col cols="12">
<v-col v-if="canCreateWorkOrder" cols="12">
<v-btn
x-large
block
@@ -138,7 +138,7 @@
><v-icon large left>$ayiTools</v-icon
>{{ $ay.t("WorkOrder") }}</v-btn
> </v-col
><v-col cols="12">
><v-col v-if="canCreateReminder" cols="12">
<v-btn x-large block @click="newItem($ay.ayt().Reminder)"
><v-icon large left>$ayiStickyNote</v-icon
>{{ $ay.t("Reminder") }}</v-btn
@@ -496,6 +496,24 @@ export default {
},
issmAndUp() {
return this.$vuetify.breakpoint.smAndUp;
},
canCreateWorkOrder() {
if (
this.$store.getters.isScheduleableUser &&
!window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.TechRestricted
]) &&
!window.$gz.store.getters.isSubContractorUser
) {
return true;
}
return false;
},
canCreateReminder() {
if (!window.$gz.store.getters.isSubContractorUser) {
return true;
}
return false;
}
},
async created() {
@@ -593,7 +611,8 @@ export default {
//Handle the event, could be one of three things: changing an event start time, changing an event length or creating a new event
if (this.extendEvent && this.extendEvent.type == 0) {
//NEW, prompt for deets and create or if cancelled then just remove this faux event from events list (it will be the last one in the array)
this.newItemDialog = true;
if (this.canCreateWorkOrder || this.canCreateReminder)
this.newItemDialog = true;
} else {
//MORE INFO
if (this.lastMouseDownMS != null && this.itWasAClickNotADrag()) {
@@ -636,11 +655,27 @@ export default {
);
}
try {
let allowedToDoThis = true;
//only users who could create the object are allowed to modify it
if (
param.type == window.$gz.type.WorkOrderItemScheduledUser &&
!this.canCreateWorkOrder
) {
allowedToDoThis = false;
}
if (
param.type == window.$gz.type.Reminder &&
!this.canCreateReminder
) {
allowedToDoThis = false;
}
window.$gz.form.deleteAllErrorBoxErrors(this);
const res = await window.$gz.api.post("schedule/adjust", param);
if (res.error) {
this.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(this);
if (allowedToDoThis) {
const res = await window.$gz.api.post("schedule/adjust", param);
if (res.error) {
this.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(this);
}
}
} catch (error) {
window.$gz.errorHandler.handleFormError(error, this);