This commit is contained in:
@@ -421,6 +421,21 @@ CURRENTLY DOING:
|
|||||||
NOT THE FOLLOWING THOUGH which are too complex to dupe at client
|
NOT THE FOLLOWING THOUGH which are too complex to dupe at client
|
||||||
Translation, User
|
Translation, User
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
consider: duplicate workorder if to be replacement for templates needs ability to:
|
||||||
|
move all dates forward relatively
|
||||||
|
remove big chunks of things all at once
|
||||||
|
|
||||||
|
bugbug: tags are not *displaying* when a record is opened until click in a field
|
||||||
|
happening in all objects with tags
|
||||||
|
not happening in wiki
|
||||||
|
reveals only when a change to the form is made of some kind that triggers I guess formfieldchanged
|
||||||
|
event. Fuck.
|
||||||
|
Look at changes to tag control, maybe it's in there?
|
||||||
|
or in form() manager code
|
||||||
|
|
||||||
|
|
||||||
todo: User duplicate not working, error about optionsobj
|
todo: User duplicate not working, error about optionsobj
|
||||||
Message:_vm.optionsObj is undefined
|
Message:_vm.optionsObj is undefined
|
||||||
probably need to populate that object as well as main obj on dupe
|
probably need to populate that object as well as main obj on dupe
|
||||||
|
|||||||
@@ -674,31 +674,34 @@ export default {
|
|||||||
vm.formState.readOnly = !vm.rights.change;
|
vm.formState.readOnly = !vm.rights.change;
|
||||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
|
|
||||||
|
let setDirty = false;
|
||||||
|
let setValid = true;
|
||||||
|
|
||||||
//id 0 means create a new record don't load one
|
//id 0 means create a new record don't load one
|
||||||
if (vm.$route.params.recordid != 0) {
|
if (vm.$route.params.recordid != 0) {
|
||||||
//is there already an obj from a prior operation?
|
//is there already an obj from a prior operation?
|
||||||
if (this.$route.params.obj) {
|
if (this.$route.params.obj) {
|
||||||
//yes, no need to fetch it
|
//yes, no need to fetch it
|
||||||
this.obj = this.$route.params.obj;
|
this.obj = this.$route.params.obj;
|
||||||
window.$gz.form.setFormState({
|
|
||||||
vm: vm,
|
|
||||||
loading: false
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
window.$gz.form.setFormState({
|
//Might be a duplicate and contain another record
|
||||||
vm: vm,
|
if (this.$route.params.obj) {
|
||||||
loading: false
|
this.obj = this.$route.params.obj;
|
||||||
});
|
this.obj.concurrency = undefined;
|
||||||
|
this.obj.id = 0;
|
||||||
|
setDirty = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
vm: vm,
|
vm: vm,
|
||||||
dirty: false,
|
loading: false,
|
||||||
valid: true
|
dirty: setDirty,
|
||||||
|
valid: setValid
|
||||||
});
|
});
|
||||||
|
|
||||||
generateMenu(vm);
|
generateMenu(vm);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
window.$gz.errorHandler.handleFormError(error, vm);
|
window.$gz.errorHandler.handleFormError(error, vm);
|
||||||
@@ -1001,41 +1004,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async duplicate() {
|
async duplicate() {
|
||||||
let vm = this;
|
//Navigate to new record
|
||||||
if (!vm.canDuplicate || vm.$route.params.recordid == 0) {
|
this.$router.push({
|
||||||
return;
|
name: "head-office-edit",
|
||||||
}
|
params: {
|
||||||
window.$gz.form.setFormState({
|
recordid: 0,
|
||||||
vm: vm,
|
obj: this.obj
|
||||||
loading: true
|
|
||||||
});
|
|
||||||
let url = API_BASE_URL + "duplicate/" + vm.$route.params.recordid;
|
|
||||||
|
|
||||||
try {
|
|
||||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
|
||||||
let res = await window.$gz.api.upsert(url);
|
|
||||||
if (res.error) {
|
|
||||||
vm.formState.serverError = res.error;
|
|
||||||
window.$gz.form.setErrorBoxErrors(vm);
|
|
||||||
} else {
|
|
||||||
//Navigate to new record
|
|
||||||
this.$router.push({
|
|
||||||
name: "head-office-edit",
|
|
||||||
params: {
|
|
||||||
recordid: res.data.id,
|
|
||||||
obj: res.data // Pass data object to new form
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
});
|
||||||
window.$gz.errorHandler.handleFormError(ex, vm);
|
|
||||||
} finally {
|
|
||||||
window.$gz.form.setFormState({
|
|
||||||
vm: vm,
|
|
||||||
loading: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
tabChanged: async function(tab) {
|
tabChanged: async function(tab) {
|
||||||
if (tab == 2) {
|
if (tab == 2) {
|
||||||
//contacts tab, load contacts if not done already
|
//contacts tab, load contacts if not done already
|
||||||
|
|||||||
@@ -203,26 +203,57 @@ export default {
|
|||||||
vm.formState.readOnly = !vm.rights.change;
|
vm.formState.readOnly = !vm.rights.change;
|
||||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
|
|
||||||
|
// //id 0 means create a new record don't load one
|
||||||
|
// if (vm.$route.params.recordid != 0) {
|
||||||
|
// //is there already an obj from a prior operation?
|
||||||
|
// if (this.$route.params.obj) {
|
||||||
|
// //yes, no need to fetch it
|
||||||
|
// this.obj = this.$route.params.obj;
|
||||||
|
// vm.formState.loading = false; //here we handle it immediately
|
||||||
|
// } else {
|
||||||
|
// await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// //default to their configured email address on new record
|
||||||
|
// this.obj.deliveryAddress = this.$store.state.userOptions.emailAddress;
|
||||||
|
// vm.formState.loading = false; //here we handle it immediately
|
||||||
|
// }
|
||||||
|
// //set initial form status
|
||||||
|
// window.$gz.form.setFormState({
|
||||||
|
// vm: vm,
|
||||||
|
// dirty: false,
|
||||||
|
// valid: true
|
||||||
|
// });
|
||||||
|
let setDirty = false;
|
||||||
|
let setValid = true;
|
||||||
|
|
||||||
//id 0 means create a new record don't load one
|
//id 0 means create a new record don't load one
|
||||||
if (vm.$route.params.recordid != 0) {
|
if (vm.$route.params.recordid != 0) {
|
||||||
//is there already an obj from a prior operation?
|
//is there already an obj from a prior operation?
|
||||||
if (this.$route.params.obj) {
|
if (this.$route.params.obj) {
|
||||||
//yes, no need to fetch it
|
//yes, no need to fetch it
|
||||||
this.obj = this.$route.params.obj;
|
this.obj = this.$route.params.obj;
|
||||||
vm.formState.loading = false; //here we handle it immediately
|
|
||||||
} else {
|
} else {
|
||||||
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//default to their configured email address on new record
|
//Might be a duplicate and contain another record
|
||||||
this.obj.deliveryAddress = this.$store.state.userOptions.emailAddress;
|
if (this.$route.params.obj) {
|
||||||
vm.formState.loading = false; //here we handle it immediately
|
this.obj = this.$route.params.obj;
|
||||||
|
this.obj.concurrency = undefined;
|
||||||
|
this.obj.id = 0;
|
||||||
|
setDirty = true;
|
||||||
|
} else {
|
||||||
|
//default to their configured email address on new record
|
||||||
|
this.obj.deliveryAddress = this.$store.state.userOptions.emailAddress;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//set initial form status
|
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
vm: vm,
|
vm: vm,
|
||||||
dirty: false,
|
loading: false,
|
||||||
valid: true
|
dirty: setDirty,
|
||||||
|
valid: setValid
|
||||||
});
|
});
|
||||||
|
|
||||||
generateMenu(vm);
|
generateMenu(vm);
|
||||||
@@ -576,34 +607,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async duplicate() {
|
async duplicate() {
|
||||||
let vm = this;
|
//Navigate to new record
|
||||||
if (!vm.canDuplicate || vm.$route.params.recordid == 0) {
|
this.$router.push({
|
||||||
return;
|
name: "home-notify-subscription",
|
||||||
}
|
params: {
|
||||||
vm.formState.loading = true;
|
recordid: 0,
|
||||||
let url = API_BASE_URL + "duplicate/" + vm.$route.params.recordid;
|
obj: this.obj
|
||||||
|
|
||||||
try {
|
|
||||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
|
||||||
let res = await window.$gz.api.upsert(url);
|
|
||||||
if (res.error) {
|
|
||||||
vm.formState.serverError = res.error;
|
|
||||||
window.$gz.form.setErrorBoxErrors(vm);
|
|
||||||
} else {
|
|
||||||
//Navigate to new record
|
|
||||||
this.$router.push({
|
|
||||||
name: "home-notify-subscription",
|
|
||||||
params: {
|
|
||||||
recordid: res.data.id,
|
|
||||||
obj: res.data // pass data object to new form
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
});
|
||||||
window.$gz.errorHandler.handleFormError(ex, vm);
|
|
||||||
} finally {
|
|
||||||
vm.formState.loading = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -155,38 +155,76 @@ export default {
|
|||||||
vm.formState.readOnly = !vm.rights.change;
|
vm.formState.readOnly = !vm.rights.change;
|
||||||
window.$gz.eventBus.$on("menu-click", clickHandler);
|
window.$gz.eventBus.$on("menu-click", clickHandler);
|
||||||
|
|
||||||
|
// //id 0 means create a new record don't load one
|
||||||
|
// if (vm.$route.params.recordid != 0) {
|
||||||
|
// //is there already an obj from a prior operation?
|
||||||
|
// if (this.$route.params.obj) {
|
||||||
|
// //yes, no need to fetch it
|
||||||
|
// this.obj = this.$route.params.obj;
|
||||||
|
// window.$gz.form.setFormState({
|
||||||
|
// vm: vm,
|
||||||
|
// loading: false
|
||||||
|
// });
|
||||||
|
// } else {
|
||||||
|
// await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// //----------------------------------------------------------
|
||||||
|
// //NEW OBJECT DEFAULTS
|
||||||
|
// let defaultDates = window.$gz.locale.defaultStartDateTime(
|
||||||
|
// window.$gz.type.Reminder
|
||||||
|
// );
|
||||||
|
// vm.obj.startDate = defaultDates.start;
|
||||||
|
// vm.obj.stopDate = defaultDates.end;
|
||||||
|
// //----------------------------------------------------------
|
||||||
|
|
||||||
|
// window.$gz.form.setFormState({
|
||||||
|
// vm: vm,
|
||||||
|
// loading: false
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// window.$gz.form.setFormState({
|
||||||
|
// vm: vm,
|
||||||
|
// dirty: false,
|
||||||
|
// valid: true
|
||||||
|
// });
|
||||||
|
|
||||||
|
let setDirty = false;
|
||||||
|
let setValid = true;
|
||||||
|
|
||||||
//id 0 means create a new record don't load one
|
//id 0 means create a new record don't load one
|
||||||
if (vm.$route.params.recordid != 0) {
|
if (vm.$route.params.recordid != 0) {
|
||||||
//is there already an obj from a prior operation?
|
//is there already an obj from a prior operation?
|
||||||
if (this.$route.params.obj) {
|
if (this.$route.params.obj) {
|
||||||
//yes, no need to fetch it
|
//yes, no need to fetch it
|
||||||
this.obj = this.$route.params.obj;
|
this.obj = this.$route.params.obj;
|
||||||
window.$gz.form.setFormState({
|
|
||||||
vm: vm,
|
|
||||||
loading: false
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//----------------------------------------------------------
|
//Might be a duplicate and contain another record
|
||||||
//NEW OBJECT DEFAULTS
|
if (this.$route.params.obj) {
|
||||||
let defaultDates = window.$gz.locale.defaultStartDateTime(
|
this.obj = this.$route.params.obj;
|
||||||
window.$gz.type.Reminder
|
this.obj.concurrency = undefined;
|
||||||
);
|
this.obj.id = 0;
|
||||||
vm.obj.startDate = defaultDates.start;
|
setDirty = true;
|
||||||
vm.obj.stopDate = defaultDates.end;
|
} else {
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
|
//NEW OBJECT DEFAULTS
|
||||||
window.$gz.form.setFormState({
|
let defaultDates = window.$gz.locale.defaultStartDateTime(
|
||||||
vm: vm,
|
window.$gz.type.Reminder
|
||||||
loading: false
|
);
|
||||||
});
|
vm.obj.startDate = defaultDates.start;
|
||||||
|
vm.obj.stopDate = defaultDates.end;
|
||||||
|
//----------------------------------------------------------
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
vm: vm,
|
vm: vm,
|
||||||
dirty: false,
|
loading: false,
|
||||||
valid: true
|
dirty: setDirty,
|
||||||
|
valid: setValid
|
||||||
});
|
});
|
||||||
|
|
||||||
generateMenu(vm);
|
generateMenu(vm);
|
||||||
@@ -447,40 +485,14 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async duplicate() {
|
async duplicate() {
|
||||||
let vm = this;
|
//Navigate to new record
|
||||||
if (!vm.canDuplicate || vm.$route.params.recordid == 0) {
|
this.$router.push({
|
||||||
return;
|
name: "reminder-edit",
|
||||||
}
|
params: {
|
||||||
window.$gz.form.setFormState({
|
recordid: 0,
|
||||||
vm: vm,
|
obj: this.obj
|
||||||
loading: true
|
|
||||||
});
|
|
||||||
let url = API_BASE_URL + "duplicate/" + vm.$route.params.recordid;
|
|
||||||
|
|
||||||
try {
|
|
||||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
|
||||||
let res = await window.$gz.api.upsert(url);
|
|
||||||
if (res.error) {
|
|
||||||
vm.formState.serverError = res.error;
|
|
||||||
window.$gz.form.setErrorBoxErrors(vm);
|
|
||||||
} else {
|
|
||||||
//Navigate to new record
|
|
||||||
this.$router.push({
|
|
||||||
name: "reminder-edit",
|
|
||||||
params: {
|
|
||||||
recordid: res.data.id,
|
|
||||||
obj: res.data // Pass data object to new form
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
});
|
||||||
window.$gz.errorHandler.handleFormError(ex, vm);
|
|
||||||
} finally {
|
|
||||||
window.$gz.form.setFormState({
|
|
||||||
vm: vm,
|
|
||||||
loading: false
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//end methods
|
//end methods
|
||||||
|
|||||||
Reference in New Issue
Block a user