This commit is contained in:
2020-04-04 18:58:23 +00:00
parent 374a033c3b
commit 67071b817a
2 changed files with 177 additions and 191 deletions

View File

@@ -27,28 +27,30 @@ export default function initialize() {
let key = 0; let key = 0;
let sub = []; let sub = [];
let t = window.$gz.translation.get;
let role = window.$gz.role.AUTHORIZATION_ROLES;
//****************** HOME //****************** HOME
//Most users except ops and client logins //Most users except ops and client logins
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull, role.DispatchFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited, role.DispatchLimited,
window.$gz.role.AUTHORIZATION_ROLES.InventoryLimited, role.InventoryLimited,
window.$gz.role.AUTHORIZATION_ROLES.InventoryFull, role.InventoryFull,
window.$gz.role.AUTHORIZATION_ROLES.AccountingFull, role.AccountingFull,
window.$gz.role.AUTHORIZATION_ROLES.TechLimited, role.TechLimited,
window.$gz.role.AUTHORIZATION_ROLES.TechFull, role.TechFull,
window.$gz.role.AUTHORIZATION_ROLES.SubContractorLimited, role.SubContractorLimited,
window.$gz.role.AUTHORIZATION_ROLES.SubContractorFull, role.SubContractorFull,
window.$gz.role.AUTHORIZATION_ROLES.SalesFull, role.SalesFull,
window.$gz.role.AUTHORIZATION_ROLES.SalesLimited role.SalesLimited
]) ])
) { ) {
//DASHBOARD //DASHBOARD
sub.push({ sub.push({
title: window.$gz.translation.get("Dashboard"), title: t("Dashboard"),
icon: "fa-tachometer-alt", icon: "fa-tachometer-alt",
route: "/home-dashboard", route: "/home-dashboard",
key: key++ key: key++
@@ -60,21 +62,21 @@ export default function initialize() {
//SEARCH //SEARCH
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull, role.DispatchFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited, role.DispatchLimited,
window.$gz.role.AUTHORIZATION_ROLES.InventoryLimited, role.InventoryLimited,
window.$gz.role.AUTHORIZATION_ROLES.InventoryFull, role.InventoryFull,
window.$gz.role.AUTHORIZATION_ROLES.AccountingFull, role.AccountingFull,
window.$gz.role.AUTHORIZATION_ROLES.TechLimited, role.TechLimited,
window.$gz.role.AUTHORIZATION_ROLES.TechFull, role.TechFull,
window.$gz.role.AUTHORIZATION_ROLES.SalesFull, role.SalesFull,
window.$gz.role.AUTHORIZATION_ROLES.SalesLimited role.SalesLimited
]) ])
) { ) {
sub.push({ sub.push({
title: window.$gz.translation.get("Search"), title: t("Search"),
icon: "fa-search", icon: "fa-search",
route: "/home-search", route: "/home-search",
key: key++ key: key++
@@ -83,7 +85,7 @@ export default function initialize() {
//SCHEDULE (personal) //SCHEDULE (personal)
sub.push({ sub.push({
title: window.$gz.translation.get("Schedule"), title: t("Schedule"),
icon: "fa-calendar-day", icon: "fa-calendar-day",
route: "/home-schedule", route: "/home-schedule",
key: key++ key: key++
@@ -91,7 +93,7 @@ export default function initialize() {
//MEMOS //MEMOS
sub.push({ sub.push({
title: window.$gz.translation.get("MemoList"), title: t("MemoList"),
icon: "fa-inbox", icon: "fa-inbox",
route: "/home-memos", route: "/home-memos",
key: key++ key: key++
@@ -99,7 +101,7 @@ export default function initialize() {
//REMINDERS (SCHEDULE MARKERS) //REMINDERS (SCHEDULE MARKERS)
sub.push({ sub.push({
title: window.$gz.translation.get("ReminderList"), title: t("ReminderList"),
icon: "fa-sticky-note", icon: "fa-sticky-note",
route: "/home-reminders", route: "/home-reminders",
key: key++ key: key++
@@ -107,7 +109,7 @@ export default function initialize() {
//USER SETTINGS //USER SETTINGS
sub.push({ sub.push({
title: window.$gz.translation.get("UserSettings"), title: t("UserSettings"),
icon: "fa-user-cog", icon: "fa-user-cog",
route: "/home-user-settings", route: "/home-user-settings",
key: key++ key: key++
@@ -116,7 +118,7 @@ export default function initialize() {
//Moved these two into user settings //Moved these two into user settings
// //USER TRANSLATE // //USER TRANSLATE
// sub.push({ // sub.push({
// title: window.$gz.translation.get("Translation"), // title: t("Translation"),
// icon: "fa-language", // icon: "fa-language",
// route: "/home-translation", // route: "/home-translation",
// key: key++ // key: key++
@@ -124,7 +126,7 @@ export default function initialize() {
// //SET LOGIN // //SET LOGIN
// sub.push({ // sub.push({
// title: window.$gz.translation.get("SetLoginPassword"), // title: t("SetLoginPassword"),
// icon: "fa-key", // icon: "fa-key",
// route: "/home-password", // route: "/home-password",
// key: key++ // key: key++
@@ -134,21 +136,21 @@ export default function initialize() {
if ( if (
//all but subcontractors (arbitrary decision without any facts ;) //all but subcontractors (arbitrary decision without any facts ;)
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull, role.DispatchFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited, role.DispatchLimited,
window.$gz.role.AUTHORIZATION_ROLES.InventoryLimited, role.InventoryLimited,
window.$gz.role.AUTHORIZATION_ROLES.InventoryFull, role.InventoryFull,
window.$gz.role.AUTHORIZATION_ROLES.AccountingFull, role.AccountingFull,
window.$gz.role.AUTHORIZATION_ROLES.TechLimited, role.TechLimited,
window.$gz.role.AUTHORIZATION_ROLES.TechFull, role.TechFull,
window.$gz.role.AUTHORIZATION_ROLES.SalesFull, role.SalesFull,
window.$gz.role.AUTHORIZATION_ROLES.SalesLimited role.SalesLimited
]) ])
) { ) {
sub.push({ sub.push({
title: window.$gz.translation.get("NotifySubscriptionList"), title: t("NotifySubscriptionList"),
icon: "fa-bullhorn", icon: "fa-bullhorn",
route: "/home-notify-subscriptions", route: "/home-notify-subscriptions",
key: key++ key: key++
@@ -156,28 +158,21 @@ export default function initialize() {
} }
//HOME //HOME
addNavItem( addNavItem(t("Home"), "fa-home", undefined, sub, key++, "home");
window.$gz.translation.get("Home"),
"fa-home",
undefined,
sub,
key++,
"home"
);
} }
//****************** CUSTOMERS //****************** CUSTOMERS
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull, role.DispatchFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited, role.DispatchLimited,
window.$gz.role.AUTHORIZATION_ROLES.TechFull, role.TechFull,
window.$gz.role.AUTHORIZATION_ROLES.TechLimited, role.TechLimited,
window.$gz.role.AUTHORIZATION_ROLES.AccountingFull, role.AccountingFull,
window.$gz.role.AUTHORIZATION_ROLES.SalesFull, role.SalesFull,
window.$gz.role.AUTHORIZATION_ROLES.SalesLimited role.SalesLimited
]) ])
) { ) {
//clear sublevel array //clear sublevel array
@@ -185,7 +180,7 @@ export default function initialize() {
//CUSTOMERS subitem //CUSTOMERS subitem
sub.push({ sub.push({
title: window.$gz.translation.get("ClientList"), title: t("ClientList"),
icon: "fa-address-card", icon: "fa-address-card",
route: "/cust-customers", route: "/cust-customers",
key: key++ key: key++
@@ -193,7 +188,7 @@ export default function initialize() {
//HEAD OFFICES subitem //HEAD OFFICES subitem
sub.push({ sub.push({
title: window.$gz.translation.get("HeadOfficeList"), title: t("HeadOfficeList"),
icon: "fa-sitemap", icon: "fa-sitemap",
route: "/cust-headoffices", route: "/cust-headoffices",
key: key++ key: key++
@@ -201,7 +196,7 @@ export default function initialize() {
// ** CUSTOMER (TOP) // ** CUSTOMER (TOP)
addNavItem( addNavItem(
window.$gz.translation.get("ClientList"), t("ClientList"),
"fa-address-book", "fa-address-book",
undefined, undefined,
sub, sub,
@@ -213,14 +208,14 @@ export default function initialize() {
//****************** SERVICE //****************** SERVICE
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull, role.DispatchFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited, role.DispatchLimited,
window.$gz.role.AUTHORIZATION_ROLES.TechFull, role.TechFull,
window.$gz.role.AUTHORIZATION_ROLES.TechLimited, role.TechLimited,
window.$gz.role.AUTHORIZATION_ROLES.SalesFull, role.SalesFull,
window.$gz.role.AUTHORIZATION_ROLES.SalesLimited role.SalesLimited
]) ])
) { ) {
//clear sublevel array //clear sublevel array
@@ -228,16 +223,16 @@ export default function initialize() {
//SCHEDULE (combined) //SCHEDULE (combined)
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull, role.DispatchFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited, role.DispatchLimited,
window.$gz.role.AUTHORIZATION_ROLES.TechFull, role.TechFull,
window.$gz.role.AUTHORIZATION_ROLES.TechLimited role.TechLimited
]) ])
) { ) {
sub.push({ sub.push({
title: window.$gz.translation.get("Schedule"), title: t("Schedule"),
icon: "fa-calendar-alt", icon: "fa-calendar-alt",
route: "/svc-schedule", route: "/svc-schedule",
key: key++ key: key++
@@ -247,16 +242,16 @@ export default function initialize() {
//WORKORDERS LIST (was service workorders) //WORKORDERS LIST (was service workorders)
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull, role.DispatchFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited, role.DispatchLimited,
window.$gz.role.AUTHORIZATION_ROLES.TechFull, role.TechFull,
window.$gz.role.AUTHORIZATION_ROLES.TechLimited role.TechLimited
]) ])
) { ) {
sub.push({ sub.push({
title: window.$gz.translation.get("WorkorderServiceList"), title: t("WorkorderServiceList"),
icon: "fa-tools", icon: "fa-tools",
route: "/svc-workorders", route: "/svc-workorders",
key: key++ key: key++
@@ -267,7 +262,7 @@ export default function initialize() {
//this will be an item inside the workorders NEW menu or grid or wherever but it's not top level worthy //this will be an item inside the workorders NEW menu or grid or wherever but it's not top level worthy
//there used to be an array for 3rd level shit but that's whack yo! ;) //there used to be an array for 3rd level shit but that's whack yo! ;)
// subSub.push({ // subSub.push({
// title: window.$gz.translation.get("WorkorderServiceTemplate"), // title: t("WorkorderServiceTemplate"),
// icon: "fa-stamp", // icon: "fa-stamp",
// route: "/svc-workorder-templates", // route: "/svc-workorder-templates",
// key: key++ // key: key++
@@ -277,7 +272,7 @@ export default function initialize() {
//NOTE: this is the only item in this service level area that is visible to Sales //NOTE: this is the only item in this service level area that is visible to Sales
//so there is no separate role check here as the service group role check supersedes this //so there is no separate role check here as the service group role check supersedes this
sub.push({ sub.push({
title: window.$gz.translation.get("WorkorderQuoteList"), title: t("WorkorderQuoteList"),
icon: "fa-edit", icon: "fa-edit",
route: "/svc-quotes", route: "/svc-quotes",
key: key++ key: key++
@@ -286,18 +281,16 @@ export default function initialize() {
//PM LIST //PM LIST
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull, role.DispatchFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited, role.DispatchLimited,
window.$gz.role.AUTHORIZATION_ROLES.TechFull, role.TechFull,
window.$gz.role.AUTHORIZATION_ROLES.TechLimited role.TechLimited
]) ])
) { ) {
sub.push({ sub.push({
title: window.$gz.translation.get( title: t("WorkorderPreventiveMaintenanceList"),
"WorkorderPreventiveMaintenanceList"
),
icon: "fa-business-time", icon: "fa-business-time",
route: "/svc-pm-list", route: "/svc-pm-list",
key: key++ key: key++
@@ -307,16 +300,16 @@ export default function initialize() {
//UNITS subitem //UNITS subitem
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull, role.DispatchFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited, role.DispatchLimited,
window.$gz.role.AUTHORIZATION_ROLES.TechFull, role.TechFull,
window.$gz.role.AUTHORIZATION_ROLES.TechLimited role.TechLimited
]) ])
) { ) {
sub.push({ sub.push({
title: window.$gz.translation.get("UnitList"), title: t("UnitList"),
icon: "fa-fan", icon: "fa-fan",
route: "/svc-units", route: "/svc-units",
key: key++ key: key++
@@ -324,7 +317,7 @@ export default function initialize() {
//UNIT MODELS subitem //UNIT MODELS subitem
sub.push({ sub.push({
title: window.$gz.translation.get("UnitModels"), title: t("UnitModels"),
icon: "fa-dice-d20", icon: "fa-dice-d20",
route: "/svc-unit-models", route: "/svc-unit-models",
key: key++ key: key++
@@ -333,16 +326,16 @@ export default function initialize() {
//LOANERS subitem //LOANERS subitem
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull, role.DispatchFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited, role.DispatchLimited,
window.$gz.role.AUTHORIZATION_ROLES.TechFull, role.TechFull,
window.$gz.role.AUTHORIZATION_ROLES.TechLimited role.TechLimited
]) ])
) { ) {
sub.push({ sub.push({
title: window.$gz.translation.get("LoanItemList"), title: t("LoanItemList"),
icon: "fa-plug", icon: "fa-plug",
route: "/svc-loaners", route: "/svc-loaners",
key: key++ key: key++
@@ -352,16 +345,16 @@ export default function initialize() {
//CONTRACTS subitem //CONTRACTS subitem
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull, role.DispatchFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited, role.DispatchLimited,
window.$gz.role.AUTHORIZATION_ROLES.TechFull, role.TechFull,
window.$gz.role.AUTHORIZATION_ROLES.TechLimited role.TechLimited
]) ])
) { ) {
sub.push({ sub.push({
title: window.$gz.translation.get("ContractList"), title: t("ContractList"),
icon: "fa-file-contract", icon: "fa-file-contract",
route: "/svc-contracts", route: "/svc-contracts",
key: key++ key: key++
@@ -371,16 +364,16 @@ export default function initialize() {
//CUSTOMER SERVICE REQUESTS subitem //CUSTOMER SERVICE REQUESTS subitem
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull, role.DispatchFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited, role.DispatchLimited,
window.$gz.role.AUTHORIZATION_ROLES.TechFull, role.TechFull,
window.$gz.role.AUTHORIZATION_ROLES.TechLimited role.TechLimited
]) ])
) { ) {
sub.push({ sub.push({
title: window.$gz.translation.get("ClientServiceRequestList"), title: t("ClientServiceRequestList"),
icon: "fa-child", icon: "fa-child",
route: "/svc-csr-list", route: "/svc-csr-list",
key: key++ key: key++
@@ -389,7 +382,7 @@ export default function initialize() {
//**** Service (TOP GROUP) //**** Service (TOP GROUP)
addNavItem( addNavItem(
window.$gz.translation.get("Service"), t("Service"),
"fa-toolbox", "fa-toolbox",
undefined, undefined,
sub, sub,
@@ -401,10 +394,10 @@ export default function initialize() {
//****************** INVENTORY //****************** INVENTORY
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.InventoryFull, role.InventoryFull,
window.$gz.role.AUTHORIZATION_ROLES.InventoryLimited role.InventoryLimited
]) ])
) { ) {
//clear sublevel array //clear sublevel array
@@ -412,7 +405,7 @@ export default function initialize() {
//PARTS (part list) //PARTS (part list)
sub.push({ sub.push({
title: window.$gz.translation.get("PartList"), title: t("PartList"),
icon: "fa-boxes", icon: "fa-boxes",
route: "/inv-parts", route: "/inv-parts",
key: key++ key: key++
@@ -420,7 +413,7 @@ export default function initialize() {
//INVENTORY //INVENTORY
sub.push({ sub.push({
title: window.$gz.translation.get("PartByWarehouseInventoryList"), title: t("PartByWarehouseInventoryList"),
icon: "fa-pallet", icon: "fa-pallet",
route: "/inv-part-inventory", route: "/inv-part-inventory",
key: key++ key: key++
@@ -428,7 +421,7 @@ export default function initialize() {
//PART REQUESTS //PART REQUESTS
sub.push({ sub.push({
title: window.$gz.translation.get("WorkorderItemPartRequestList"), title: t("WorkorderItemPartRequestList"),
icon: "fa-paper-plane", icon: "fa-paper-plane",
route: "/inv-part-requests", route: "/inv-part-requests",
key: key++ key: key++
@@ -436,7 +429,7 @@ export default function initialize() {
//PURCHASE ORDERS //PURCHASE ORDERS
sub.push({ sub.push({
title: window.$gz.translation.get("InventoryPurchaseOrders"), title: t("InventoryPurchaseOrders"),
icon: "fa-shipping-fast", icon: "fa-shipping-fast",
route: "/inv-purchase-orders", route: "/inv-purchase-orders",
key: key++ key: key++
@@ -446,9 +439,7 @@ export default function initialize() {
//PURCHASE ORDER RECEIPTS //PURCHASE ORDER RECEIPTS
sub.push({ sub.push({
title: window.$gz.translation.get( title: t("InventoryPurchaseOrderReceipts"),
"InventoryPurchaseOrderReceipts"
),
icon: "fa-dolly-flatbed", icon: "fa-dolly-flatbed",
route: "/inv-purchase-order-receipts", route: "/inv-purchase-order-receipts",
key: key++ key: key++
@@ -460,9 +451,7 @@ export default function initialize() {
//ADJUSTMENTS //ADJUSTMENTS
sub.push({ sub.push({
title: window.$gz.translation.get( title: t("InventoryPartInventoryAdjustments"),
"InventoryPartInventoryAdjustments"
),
icon: "fa-dolly", icon: "fa-dolly",
route: "/inv-adjustments", route: "/inv-adjustments",
key: key++ key: key++
@@ -470,7 +459,7 @@ export default function initialize() {
//**** INVENTORY (TOP GROUP) //**** INVENTORY (TOP GROUP)
addNavItem( addNavItem(
window.$gz.translation.get("Inventory"), t("Inventory"),
"fa-box", "fa-box",
undefined, undefined,
sub, sub,
@@ -482,17 +471,17 @@ export default function initialize() {
//**** VENDORS (TOP GROUP) //**** VENDORS (TOP GROUP)
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.AccountingFull, role.AccountingFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchFull, role.DispatchFull,
window.$gz.role.AUTHORIZATION_ROLES.DispatchLimited, role.DispatchLimited,
window.$gz.role.AUTHORIZATION_ROLES.InventoryFull, role.InventoryFull,
window.$gz.role.AUTHORIZATION_ROLES.InventoryLimited role.InventoryLimited
]) ])
) { ) {
addNavItem( addNavItem(
window.$gz.translation.get("VendorList"), t("VendorList"),
"fa-store", "fa-store",
"/vendors", "/vendors",
[], [],
@@ -504,16 +493,16 @@ export default function initialize() {
//****************** ACCOUNTING //****************** ACCOUNTING
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.AccountingFull, role.AccountingFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited role.BizAdminLimited
]) ])
) { ) {
sub = []; sub = [];
//FAKE subitem as is still TBD //FAKE subitem as is still TBD
sub.push({ sub.push({
title: window.$gz.translation.get("Accounting"), title: t("Accounting"),
icon: "fa-calculator", icon: "fa-calculator",
route: "/acc-accounting", route: "/acc-accounting",
key: key++ key: key++
@@ -521,7 +510,7 @@ export default function initialize() {
// ** ACCOUNTING (TOP) // ** ACCOUNTING (TOP)
addNavItem( addNavItem(
window.$gz.translation.get("Accounting"), t("Accounting"),
"fa-calculator", "fa-calculator",
undefined, undefined,
sub, sub,
@@ -532,17 +521,14 @@ export default function initialize() {
//****************** ADMINISTRATION //****************** ADMINISTRATION
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([role.BizAdminFull, role.BizAdminLimited])
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited
])
) { ) {
//clear sublevel array //clear sublevel array
sub = []; sub = [];
// GLOBAL SETTINGS // GLOBAL SETTINGS
sub.push({ sub.push({
title: window.$gz.translation.get("AdministrationGlobalSettings"), title: t("AdministrationGlobalSettings"),
icon: "fa-cogs", icon: "fa-cogs",
route: "/adm-global-settings", route: "/adm-global-settings",
key: key++ key: key++
@@ -550,7 +536,7 @@ export default function initialize() {
// LICENSE // LICENSE
sub.push({ sub.push({
title: window.$gz.translation.get("HelpLicense"), title: t("HelpLicense"),
icon: "fa-ticket-alt", icon: "fa-ticket-alt",
route: "/adm-license", route: "/adm-license",
key: key++ key: key++
@@ -558,7 +544,7 @@ export default function initialize() {
// USERS // USERS
sub.push({ sub.push({
title: window.$gz.translation.get("UserList"), title: t("UserList"),
icon: "fa-users", icon: "fa-users",
route: "/adm-users", route: "/adm-users",
key: key++ key: key++
@@ -568,7 +554,7 @@ export default function initialize() {
//TRANSLATION //TRANSLATION
sub.push({ sub.push({
title: window.$gz.translation.get("Translation"), title: t("Translation"),
icon: "fa-language", icon: "fa-language",
route: "/adm-translation", route: "/adm-translation",
key: key++ key: key++
@@ -576,7 +562,7 @@ export default function initialize() {
//REPORT TEMPLATES //REPORT TEMPLATES
sub.push({ sub.push({
title: window.$gz.translation.get("ReportList"), title: t("ReportList"),
icon: "fa-th-list", icon: "fa-th-list",
route: "/adm-report-templates", route: "/adm-report-templates",
key: key++ key: key++
@@ -584,7 +570,7 @@ export default function initialize() {
//FILES IN DATABASE //FILES IN DATABASE
sub.push({ sub.push({
title: window.$gz.translation.get("Attachments"), title: t("Attachments"),
icon: "fa-folder", icon: "fa-folder",
route: "/adm-attachments", route: "/adm-attachments",
key: key++ key: key++
@@ -592,7 +578,7 @@ export default function initialize() {
//EVENT LOG / HISTORY //EVENT LOG / HISTORY
sub.push({ sub.push({
title: window.$gz.translation.get("History"), title: t("History"),
icon: "fa-history", icon: "fa-history",
route: "/adm-history", route: "/adm-history",
key: key++ key: key++
@@ -600,7 +586,7 @@ export default function initialize() {
//KPI / METRICS / CHARTS AND STUFF //KPI / METRICS / CHARTS AND STUFF
sub.push({ sub.push({
title: window.$gz.translation.get("Statistics"), title: t("Statistics"),
icon: "fa-chart-line", icon: "fa-chart-line",
route: "/adm-statistics", route: "/adm-statistics",
key: key++ key: key++
@@ -608,7 +594,7 @@ export default function initialize() {
// ** ADMINISTRATION (TOP) // ** ADMINISTRATION (TOP)
addNavItem( addNavItem(
window.$gz.translation.get("Administration"), t("Administration"),
"fa-user-tie", "fa-user-tie",
undefined, undefined,
sub, sub,
@@ -619,17 +605,14 @@ export default function initialize() {
//****************** OPERATIONS //****************** OPERATIONS
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([role.OpsAdminFull, role.OpsAdminLimited])
window.$gz.role.AUTHORIZATION_ROLES.OpsAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.OpsAdminLimited
])
) { ) {
//clear sublevel array //clear sublevel array
sub = []; sub = [];
// ARCHIVE // ARCHIVE
sub.push({ sub.push({
title: window.$gz.translation.get("Backup"), title: t("Backup"),
icon: "fa-file-archive", icon: "fa-file-archive",
route: "/ops-backup", route: "/ops-backup",
key: key++ key: key++
@@ -643,7 +626,7 @@ export default function initialize() {
// JOBS // JOBS
sub.push({ sub.push({
title: window.$gz.translation.get("ServerJobs"), title: t("ServerJobs"),
icon: "fa-robot", icon: "fa-robot",
route: "/ops-jobs", route: "/ops-jobs",
key: key++ key: key++
@@ -651,7 +634,7 @@ export default function initialize() {
// LOGS // LOGS
sub.push({ sub.push({
title: window.$gz.translation.get("ServerLog"), title: t("ServerLog"),
icon: "fa-history", icon: "fa-history",
route: "/ops-log", route: "/ops-log",
key: key++ key: key++
@@ -659,7 +642,7 @@ export default function initialize() {
//METRICS //METRICS
sub.push({ sub.push({
title: window.$gz.translation.get("ServerMetrics"), title: t("ServerMetrics"),
icon: "fa-file-medical-alt", icon: "fa-file-medical-alt",
route: "/ops-metrics", route: "/ops-metrics",
key: key++ key: key++
@@ -667,7 +650,7 @@ export default function initialize() {
//NOTIFICATION CONFIG AND HISTORY //NOTIFICATION CONFIG AND HISTORY
sub.push({ sub.push({
title: window.$gz.translation.get("NotificationSettings"), title: t("NotificationSettings"),
icon: "fa-bullhorn", icon: "fa-bullhorn",
route: "/ops-notification-settings", route: "/ops-notification-settings",
key: key++ key: key++
@@ -675,7 +658,7 @@ export default function initialize() {
// ** OPERATIONS (TOP) // ** OPERATIONS (TOP)
addNavItem( addNavItem(
window.$gz.translation.get("Operations"), t("Operations"),
"fa-server", "fa-server",
undefined, undefined,
sub, sub,
@@ -687,14 +670,14 @@ export default function initialize() {
//**** WIDGETS (TOP GROUP) //**** WIDGETS (TOP GROUP)
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.BizAdminFull, role.BizAdminFull,
window.$gz.role.AUTHORIZATION_ROLES.BizAdminLimited, role.BizAdminLimited,
window.$gz.role.AUTHORIZATION_ROLES.InventoryFull, role.InventoryFull,
window.$gz.role.AUTHORIZATION_ROLES.InventoryLimited role.InventoryLimited
]) ])
) { ) {
addNavItem( addNavItem(
window.$gz.translation.get("WidgetList"), t("WidgetList"),
"fa-vial", "fa-vial",
"/widgets", "/widgets",
[], [],
@@ -706,8 +689,8 @@ export default function initialize() {
//****************** CUSTOMER USER / HEAD OFFICE USER UI //****************** CUSTOMER USER / HEAD OFFICE USER UI
if ( if (
window.$gz.role.hasRole([ window.$gz.role.hasRole([
window.$gz.role.AUTHORIZATION_ROLES.CustomerFull, role.CustomerFull,
window.$gz.role.AUTHORIZATION_ROLES.CustomerLimited role.CustomerLimited
]) && ]) &&
(window.$gz.store.state.userType == 4 || (window.$gz.store.state.userType == 4 ||
window.$gz.store.state.userType == 5) window.$gz.store.state.userType == 5)
@@ -721,7 +704,7 @@ export default function initialize() {
//CSR LIST subitem //CSR LIST subitem
sub.push({ sub.push({
title: window.$gz.translation.get("ClientServiceRequestList"), title: t("ClientServiceRequestList"),
icon: "fa-child", icon: "fa-child",
route: "/customer-csr-list", route: "/customer-csr-list",
key: key++ key: key++
@@ -729,7 +712,7 @@ export default function initialize() {
//WORKORDERS subitem //WORKORDERS subitem
sub.push({ sub.push({
title: window.$gz.translation.get("WorkorderServiceList"), title: t("WorkorderServiceList"),
icon: "fa-tools", icon: "fa-tools",
route: "/customer-workorders", route: "/customer-workorders",
key: key++ key: key++
@@ -738,7 +721,7 @@ export default function initialize() {
//** CUSTOMER LOGIN HOME (TOP) //** CUSTOMER LOGIN HOME (TOP)
addNavItem( addNavItem(
window.$gz.translation.get("Home"), t("Home"),
"fa-home", "fa-home",
undefined, undefined,
sub, sub,
@@ -751,7 +734,8 @@ export default function initialize() {
//GET USER OPTIONS //GET USER OPTIONS
window.$gz.api window.$gz.api
.get("UserOptions/" + window.$gz.store.state.userId) .get("UserOptions/" + window.$gz.store.state.userId)
.then(res => { // eslint-disable-next-line
.then((res) => {
if (res.error != undefined) { if (res.error != undefined) {
//In a form this would trigger a bunch of validation or error display code but for here and now: //In a form this would trigger a bunch of validation or error display code but for here and now:
//convert error to human readable string for display and popup a notification to user //convert error to human readable string for display and popup a notification to user
@@ -805,7 +789,8 @@ export default function initialize() {
//GET GLOBAL SETTINGS //GET GLOBAL SETTINGS
window.$gz.api window.$gz.api
.get("GlobalBizSettings/client") .get("GlobalBizSettings/client")
.then(res => { // eslint-disable-next-line
.then((res) => {
if (res.error != undefined) { if (res.error != undefined) {
//In a form this would trigger a bunch of validation or error display code but for here and now: //In a form this would trigger a bunch of validation or error display code but for here and now:
//convert error to human readable string for display and popup a notification to user //convert error to human readable string for display and popup a notification to user

View File

@@ -193,5 +193,6 @@ new Vue({
vuetify: Vuetify, vuetify: Vuetify,
router, router,
store, store,
render: h => h(App) // eslint-disable-next-line
render: (h) => h(App)
}).$mount("#app"); }).$mount("#app");