This commit is contained in:
2021-07-15 18:21:33 +00:00
parent 18b9899a4b
commit 86a0c1681f
2 changed files with 39 additions and 46 deletions

View File

@@ -112,30 +112,13 @@ export default {
//populate the context portion of the menu so handle accordingly
if (ctx.menuItems) {
vm.appBar.menuItems = ctx.menuItems;
//DIVIDER
//Insert the devider between context and global items
// vm.appBar.menuItems.push({ divider: true, inset: false });
}
//WIKI, ATTACHMENTS, RECORD HISTORY
//STANDARD BIZ OBJECT OPTIONS
//NOTE: This applies equally to all core business object types that are basically real world and have an id and a type (all are wikiable, attachable and reviewable)
//Not utility type objects like datalist etc
//there will be few exceptions so they will be coded in later if needed but assume anything with an id and a type
if (isCoreBizObject) {
// vm.appBar.menuItems.push({
// title: "Attachments"),
// icon: "fa - paperclip",
// key: "app:attachments",
// data: { ayaType: formAyaType, recordId: formRecordId }
// });
// vm.appBar.menuItems.push({
// title: "WikiPage"),
// icon: "fa - feather",
// key: "app:wiki",
// data: { ayaType: formAyaType, recordId: formRecordId }
// });
if (isCoreBizObject && !ctx.hideCoreBizStandardOptions) {
//"Review" was follow up type of schedule marker
//basically it's now a "Reminder" type of object but it's own thing with separate collection
@@ -168,15 +151,13 @@ export default {
ctx.formData &&
ctx.formData.formCustomTemplateKey != undefined &&
window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminRestricted,
window.$gz.role.AUTHORIZATION_ROLES.BizAdmin,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminRestricted
])
) {
//NOTE: BizAdmin can edit, BizAdminRestricted can read only
//add customize menu item
//DIVIDER
//Insert the devider between context and global items
// vm.appBar.menuItems.push({ divider: true, inset: false });
//customize
vm.appBar.menuItems.push({
title: "Customize",

View File

@@ -1855,6 +1855,8 @@ function generateMenu(vm) {
let menuOptions = {
isMain: false,
readOnly: vm.formState.readOnly,
hideCoreBizStandardOptions: vm.obj.userIsRestrictedType,
hideSearch: vm.obj.userIsRestrictedType,
icon: "$ayiTools",
title: "WorkOrder",
helpUrl: "svc-workorders",
@@ -1877,7 +1879,11 @@ function generateMenu(vm) {
});
}
if (vm.rights.delete && vm.$route.params.recordid != 0) {
if (
vm.rights.delete &&
vm.$route.params.recordid != 0 &&
!vm.obj.userIsRestrictedType
) {
menuOptions.menuItems.push({
title: "Delete",
icon: "$ayiTrashAlt",
@@ -1898,7 +1904,7 @@ function generateMenu(vm) {
//get last report selected
let lastReport = window.$gz.form.getLastReport(FORM_KEY);
if (lastReport != null) {
if (lastReport != null && !vm.obj.userIsRestrictedType) {
menuOptions.menuItems.push({
title: lastReport.name,
icon: "$ayiFileAlt",
@@ -1907,7 +1913,7 @@ function generateMenu(vm) {
});
}
if (vm.rights.change) {
if (vm.rights.change && !vm.obj.userIsRestrictedType) {
menuOptions.menuItems.push({
title: "New",
icon: "$ayiPlus",
@@ -1916,7 +1922,11 @@ function generateMenu(vm) {
});
}
if (vm.rights.change && vm.$route.params.recordid != 0) {
if (
vm.rights.change &&
vm.$route.params.recordid != 0 &&
!vm.obj.userIsRestrictedType
) {
menuOptions.menuItems.push({
title: "Duplicate",
icon: "$ayiClone",
@@ -1927,25 +1937,27 @@ function generateMenu(vm) {
//--- /show all ---
menuOptions.menuItems.push({ divider: true, inset: false });
menuOptions.menuItems.push({
title: "WorkOrderStatusList",
icon: "$ayiFlag",
key: FORM_KEY + ":statuslist",
vm: vm
});
menuOptions.menuItems.push({
title: "WorkOrderItemStatusList",
icon: "$ayiCircle",
key: FORM_KEY + ":itemstatuslist",
vm: vm
});
menuOptions.menuItems.push({
title: "WorkOrderItemPriorityList",
icon: "$ayiFireAlt",
key: FORM_KEY + ":prioritylist",
vm: vm
});
if (!vm.obj.userIsRestrictedType) {
menuOptions.menuItems.push({ divider: true, inset: false });
menuOptions.menuItems.push({
title: "WorkOrderStatusList",
icon: "$ayiFlag",
key: FORM_KEY + ":statuslist",
vm: vm
});
menuOptions.menuItems.push({
title: "WorkOrderItemStatusList",
icon: "$ayiCircle",
key: FORM_KEY + ":itemstatuslist",
vm: vm
});
menuOptions.menuItems.push({
title: "WorkOrderItemPriorityList",
icon: "$ayiFireAlt",
key: FORM_KEY + ":prioritylist",
vm: vm
});
}
menuOptions.menuItems.push({ divider: true, inset: false });
window.$gz.eventBus.$emit("menu-change", menuOptions);