This commit is contained in:
@@ -421,7 +421,8 @@ todo: many biz objects are not using new PUT methodology
|
|||||||
|
|
||||||
CURRENTLY DOING:
|
CURRENTLY DOING:
|
||||||
|
|
||||||
Workorder modifications for restricted / low rights users
|
Subcontractor / tech limited modifications
|
||||||
|
|
||||||
- Remove all costs from workorder for parts unless have inventory-limited, inventory, bizadminfull or Accounting roles
|
- Remove all costs from workorder for parts unless have inventory-limited, inventory, bizadminfull or Accounting roles
|
||||||
not sent over wire / populated
|
not sent over wire / populated
|
||||||
not shown as fields in UI of workorder anywhere
|
not shown as fields in UI of workorder anywhere
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ function initNavPanel() {
|
|||||||
ServiceContractor = 5 */
|
ServiceContractor = 5 */
|
||||||
|
|
||||||
//########## OUTSIDE USERS GROUP (CUSTOMER / HEADOFFICE) ###
|
//########## OUTSIDE USERS GROUP (CUSTOMER / HEADOFFICE) ###
|
||||||
if (window.$gz.store.state.isCustomerUser == true) {
|
if (window.$gz.store.state.getters.isCustomerUser == true) {
|
||||||
//clear sublevel array
|
//clear sublevel array
|
||||||
sub = [];
|
sub = [];
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ function initNavPanel() {
|
|||||||
CustomerHomePageSet = true;
|
CustomerHomePageSet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.$gz.store.state.notifyAvailable) {
|
if (window.$gz.store.state.getters.canSubscribeToNotifications) {
|
||||||
sub.push({
|
sub.push({
|
||||||
title: "NotifySubscriptionList",
|
title: "NotifySubscriptionList",
|
||||||
icon: "$ayiBullhorn",
|
icon: "$ayiBullhorn",
|
||||||
@@ -108,6 +108,38 @@ function initNavPanel() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//###### SUBCONTRACTORS ######
|
||||||
|
//console.log(window.$gz.store.state.getters.isSubContractorUser);
|
||||||
|
if (window.$gz.store.state.getters.isSubContractorUser == true) {
|
||||||
|
//clear sublevel array
|
||||||
|
sub = [];
|
||||||
|
|
||||||
|
//USER SETTINGS
|
||||||
|
|
||||||
|
sub.push({
|
||||||
|
title: "UserSettings",
|
||||||
|
icon: "$ayiUserCog",
|
||||||
|
route: "/home-user-settings",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
|
//SCHEDULE (personal)
|
||||||
|
sub.push({
|
||||||
|
title: "Schedule",
|
||||||
|
icon: "$ayiCalendarDay",
|
||||||
|
route: "/home-schedule",
|
||||||
|
key: key++
|
||||||
|
});
|
||||||
|
|
||||||
|
//** HOME (TOP)
|
||||||
|
addNavItem("Home", "$ayiHome", undefined, sub, key++, "home");
|
||||||
|
|
||||||
|
//set default home page
|
||||||
|
window.$gz.store.commit("setHomePage", "/home-schedule");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
//###### ALL INSIDE USERS FROM HERE DOWN ###############
|
//###### ALL INSIDE USERS FROM HERE DOWN ###############
|
||||||
|
|
||||||
//###### EXPIRED LICENSE GROUP
|
//###### EXPIRED LICENSE GROUP
|
||||||
@@ -702,7 +734,7 @@ function initNavPanel() {
|
|||||||
//as long as they are a normal User type and not a subcontractor type
|
//as long as they are a normal User type and not a subcontractor type
|
||||||
if (
|
if (
|
||||||
(licenseState == 1) &
|
(licenseState == 1) &
|
||||||
(window.$gz.store.state.isSubContractorUser == false)
|
(window.$gz.store.state.getters.isSubContractorUser == false)
|
||||||
) {
|
) {
|
||||||
addNavItem(
|
addNavItem(
|
||||||
"Evaluate",
|
"Evaluate",
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ export default new Vuex.Store({
|
|||||||
apiToken: "-",
|
apiToken: "-",
|
||||||
downloadToken: "-",
|
downloadToken: "-",
|
||||||
tfaEnabled: undefined,
|
tfaEnabled: undefined,
|
||||||
notifyAvailable: true,
|
|
||||||
customerRights: {},
|
customerRights: {},
|
||||||
userId: 0,
|
userId: 0,
|
||||||
userName: "NOT AUTHENTICATED",
|
userName: "NOT AUTHENTICATED",
|
||||||
@@ -65,6 +64,7 @@ export default new Vuex.Store({
|
|||||||
return state.userType == 3 || state.userType == 4;
|
return state.userType == 3 || state.userType == 4;
|
||||||
},
|
},
|
||||||
isSubContractorUser: state => {
|
isSubContractorUser: state => {
|
||||||
|
console.log("Issubcontractoruser", state);
|
||||||
return state.userType == 5;
|
return state.userType == 5;
|
||||||
},
|
},
|
||||||
isScheduleableUser: state => {
|
isScheduleableUser: state => {
|
||||||
@@ -107,13 +107,6 @@ export default new Vuex.Store({
|
|||||||
state.tfaEnabled = data.tfaEnabled;
|
state.tfaEnabled = data.tfaEnabled;
|
||||||
if (data.customerRights) {
|
if (data.customerRights) {
|
||||||
state.customerRights = data.customerRights;
|
state.customerRights = data.customerRights;
|
||||||
//only a customer user could have zero access to notifications
|
|
||||||
state.notifyAvailable =
|
|
||||||
data.customerRights.notifyServiceImminent == true ||
|
|
||||||
data.customerRights.notifyCSRAccepted == true ||
|
|
||||||
data.customerRights.notifyCSRRejected == true ||
|
|
||||||
data.customerRights.notifyWOCompleted == true ||
|
|
||||||
data.customerRights.notifyWOCreated == true;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
logout(state) {
|
logout(state) {
|
||||||
@@ -127,7 +120,6 @@ export default new Vuex.Store({
|
|||||||
state.userName = "NOT AUTHENTICATED";
|
state.userName = "NOT AUTHENTICATED";
|
||||||
state.roles = 0;
|
state.roles = 0;
|
||||||
state.userType = 0;
|
state.userType = 0;
|
||||||
state.notifyAvailable = true;
|
|
||||||
state.homePage = undefined;
|
state.homePage = undefined;
|
||||||
state.navItems = [];
|
state.navItems = [];
|
||||||
state.translationText = {};
|
state.translationText = {};
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ function generateMenu(vm) {
|
|||||||
vm: vm
|
vm: vm
|
||||||
});
|
});
|
||||||
menuOptions.menuItems.push({ divider: true, inset: false });
|
menuOptions.menuItems.push({ divider: true, inset: false });
|
||||||
if (vm.$store.state.isScheduleableUser) {
|
if (vm.$store.state.getters.isScheduleableUser) {
|
||||||
menuOptions.menuItems.push({
|
menuOptions.menuItems.push({
|
||||||
title: "WorkOrderItemScheduledUserList",
|
title: "WorkOrderItemScheduledUserList",
|
||||||
icon: "$ayiUserClock",
|
icon: "$ayiUserClock",
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ function generateMenu(vm) {
|
|||||||
vm: vm
|
vm: vm
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!window.$gz.store.state.isCustomerUser) {
|
if (!window.$gz.store.state.getters.isCustomerUser) {
|
||||||
menuOptions.menuItems.push({
|
menuOptions.menuItems.push({
|
||||||
title: "DirectNotification",
|
title: "DirectNotification",
|
||||||
icon: "$ayiCommentAlt",
|
icon: "$ayiCommentAlt",
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
showTags() {
|
showTags() {
|
||||||
if (!window.$gz.store.state.isCustomerUser) {
|
if (!window.$gz.store.state.getters.isCustomerUser) {
|
||||||
//customers NEVER see tags anywhere, that's private information and they do not use or require it
|
//customers NEVER see tags anywhere, that's private information and they do not use or require it
|
||||||
switch (this.obj.eventType) {
|
switch (this.obj.eventType) {
|
||||||
case 27: //General notification
|
case 27: //General notification
|
||||||
@@ -774,7 +774,7 @@ async function populateSelectionLists(vm) {
|
|||||||
//ensure the pick lists required are pre-fetched
|
//ensure the pick lists required are pre-fetched
|
||||||
await window.$gz.enums.fetchEnumList("NotifyEventType");
|
await window.$gz.enums.fetchEnumList("NotifyEventType");
|
||||||
const tempEventTypes = window.$gz.enums.getSelectionList("NotifyEventType");
|
const tempEventTypes = window.$gz.enums.getSelectionList("NotifyEventType");
|
||||||
if (window.$gz.store.state.isCustomerUser) {
|
if (window.$gz.store.state.getters.isCustomerUser) {
|
||||||
vm.selectLists.eventTypes = tempEventTypes.filter(z => {
|
vm.selectLists.eventTypes = tempEventTypes.filter(z => {
|
||||||
//return true if it's a type allowed by customer *and* they have customerRights to it
|
//return true if it's a type allowed by customer *and* they have customerRights to it
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user