diff --git a/Controllers/SiteController.cs b/Controllers/SiteController.cs index d53f32d..7f381c3 100644 --- a/Controllers/SiteController.cs +++ b/Controllers/SiteController.cs @@ -114,7 +114,7 @@ namespace rockfishCore.Controllers { return NotFound(); } - var custInfo = await ct.Customer.AsNoTracking().Where(z => z.Id == site.CustomerId).Select(z => new { z.Name, z.Id, dbid = site.DbId }).SingleAsync(); + var custInfo = await ct.Customer.AsNoTracking().Where(z => z.Id == site.CustomerId).Select(z => new { z.Name, z.Id, site.CustomerId, dbid = site.DbId }).SingleAsync(); return Ok(custInfo); } diff --git a/wwwroot/js/app.ravLicense.js b/wwwroot/js/app.ravLicense.js index b48971a..0f22f6a 100644 --- a/wwwroot/js/app.ravLicense.js +++ b/wwwroot/js/app.ravLicense.js @@ -76,14 +76,16 @@ app.ravLicense = (function () { features.push({ Feature: options[i], Count: 0 }); } - submitData["features"]=features; + submitData["features"] = features; //submit // alert("STUB submit"); app.api.createRavLicense(submitData, function (res) { if (res.error) { $.gevent.publish("app-show-error", res.msg); } else { - $("#key").val(res); + page( + "#!/ravLicenses/" + stateMap.id + "/" + stateMap.context.params.cust_id + ); return false; } }); @@ -173,7 +175,12 @@ app.ravLicense = (function () { // app.nav.contextAddLink("licenseRequests/", "Requests", "voice"); // app.nav.contextAddLink("licenseTemplates/", "", "layers"); //case 3233 - app.nav.contextAddLink("licenses/", "List", ""); + + app.nav.contextAddLink( + "ravLicenses/" + stateMap.id + "/" + stateMap.context.params.cust_id, + "Licenses", + "ticket" + ); //from here to new license //set all date inputs to today plus one year var oneYearFromNow = moment() diff --git a/wwwroot/js/app.ravLicenses.js b/wwwroot/js/app.ravLicenses.js index 56485c4..9e3fe72 100644 --- a/wwwroot/js/app.ravLicenses.js +++ b/wwwroot/js/app.ravLicenses.js @@ -63,7 +63,11 @@ app.ravLicenses = (function () { "
  • " + "" + "
  • " @@ -77,7 +81,7 @@ app.ravLicenses = (function () { //=========/licenses============== app.nav.contextClear(); ///ravLicense/122 - app.nav.contextAddLink("ravLicense/" + stateMap.id, "New", "plus"); + app.nav.contextAddLink("ravLicense/" + stateMap.id+ "/" + stateMap.context.params.cust_id, "New", "plus"); app.nav.contextAddLink( "customerSiteEdit/" + stateMap.id + "/" + stateMap.context.params.cust_id, "Site", diff --git a/wwwroot/js/app.shell.js b/wwwroot/js/app.shell.js index 70ce0bd..10d3126 100644 --- a/wwwroot/js/app.shell.js +++ b/wwwroot/js/app.shell.js @@ -12,604 +12,560 @@ /*global $, app */ app.shell = (function () { - 'use strict'; - //---------------- BEGIN MODULE SCOPE VARIABLES -------------- + "use strict"; + //---------------- BEGIN MODULE SCOPE VARIABLES -------------- - var + var stateMap = { + $container: undefined, + anchor_map: {}, + user: { + authenticated: false, + token: "", + name: "", + id: 0 + }, + apiUrl: "", + search_cache: { + has_cache: false + } + }, + tokenExpired, + //onUPdate, + onLogin, + onLogout, + onShowError, + onClearError, + initModule; + //----------------- END MODULE SCOPE VARIABLES --------------- - stateMap = { - $container: undefined, - anchor_map: {}, - user: { - authenticated: false, - token: '', - name: '', - id: 0 - }, - apiUrl: '', - search_cache: { - has_cache: false - } - }, - tokenExpired, - //onUPdate, - onLogin, onLogout, onShowError, onClearError, - initModule; - //----------------- END MODULE SCOPE VARIABLES --------------- + //------------------- BEGIN UTILITY METHODS ------------------ - //------------------- BEGIN UTILITY METHODS ------------------ - - - tokenExpired = function () { - //fetch stored creds if available - var creds = store.get('rockfish.usercreds'); - if (creds) { - //check if token has expired - //is the date greater than the expires date - var rightNowUtc = new Date(); - var expDate = new Date(creds.expires * 1000); - if (rightNowUtc > expDate) { - return true; - } else { - return false; - } - } else { - return true; - } + tokenExpired = function () { + //fetch stored creds if available + var creds = store.get("rockfish.usercreds"); + if (creds) { + //check if token has expired + //is the date greater than the expires date + var rightNowUtc = new Date(); + var expDate = new Date(creds.expires * 1000); + if (rightNowUtc > expDate) { + return true; + } else { + return false; + } + } else { + return true; } - //-------------------- END UTILITY METHODS ------------------- + }; + //-------------------- END UTILITY METHODS ------------------- + //------------------- BEGIN EVENT HANDLERS ------------------- + onLogin = function (event, login_user) { + //store creds + store.set("rockfish.usercreds", stateMap.user); + //New token needs to reset lastNav + stateMap.lastNav = new Date(); + //Go to the home page + page("#!/customers/"); + return false; + }; - //------------------- BEGIN EVENT HANDLERS ------------------- + onLogout = function (event) { + store.clear(); + stateMap.user.authenticated = false; + stateMap.user.name = ""; + stateMap.user.token = ""; + stateMap.user.id = 0; + page("#!/authenticate/"); + return false; + }; - onLogin = function (event, login_user) { - //store creds - store.set('rockfish.usercreds', stateMap.user); - //New token needs to reset lastNav - stateMap.lastNav = new Date(); - //Go to the home page - page('#!/customers/'); - return false; - }; + // onUpdate = function (event) { - onLogout = function (event) { - store.clear(); - stateMap.user.authenticated = false; - stateMap.user.name = ''; - stateMap.user.token = ''; - stateMap.user.id = 0; - page('#!/authenticate/'); - return false; - }; + // window.location.reload(true); + // return false; + // }; - // onUpdate = function (event) { + onShowError = function (event, msg) { + $("#app-error-div").removeClass("d-none"); + $("#app-error-message").text(msg); + return false; + }; - // window.location.reload(true); - // return false; - // }; + onClearError = function (event) { + $("#app-error-div").addClass("d-none"); + return false; + }; + //-------------------- END EVENT HANDLERS -------------------- - onShowError = function (event, msg) { - $("#app-error-div").removeClass("d-none"); - $('#app-error-message').text(msg); - return false; - }; + //------------------- BEGIN PUBLIC METHODS ------------------- + initModule = function ($container) { + document.title = "Rockfish " + app.api.RockFishVersion; - onClearError = function (event) { - $("#app-error-div").addClass("d-none"); - return false; - }; + //PRE FLIGHT CHECK + //================ + //local storage required + if (!store.enabled) { + alert( + 'Local storage is not supported by your browser. Please disable "Private Mode", or upgrade to a modern browser.' + ); + return; + } - //-------------------- END EVENT HANDLERS -------------------- + //wait indicator for ajax functions + $(document) + .ajaxStart(function () { + //disable all buttons + $(".app-frm-buttons button") + .prop("disabled", true) + .addClass("disabled"); + //$('.app-frm-buttons button').attr('disabled', 'disabled'); + $("body").css("cursor", "progress"); + //add app-ajax-busy style to buttons div where user clicked + $(".app-frm-buttons").addClass("app-ajax-busy"); + }) + .ajaxStop(function () { + //with delay in case it's too fast to see + setTimeout(function () { + $(".app-frm-buttons button") + .prop("disabled", false) + .removeClass("disabled"); + //$('.app-frm-buttons button').removeAttr('disabled'); + $("body").css("cursor", "default"); + $(".app-frm-buttons").removeClass("app-ajax-busy"); + }, 250); + }); + //save on app so can call from anywhere + // app.mdInit = mdInit; + // load HTML and map jQuery collections + stateMap.$container = $container; + $container.html(Handlebars.templates["app.shell"]({})); - //------------------- BEGIN PUBLIC METHODS ------------------- - initModule = function ($container) { + //auto hide navbar on click + //rfac is a class only on the items that should trigger collapse + $(".rfac").on("click", function () { + $(".navbar-collapse").collapse("hide"); + }); - document.title = 'Rockfish ' + app.api.RockFishVersion; + //SEARCH + // $('#searchbutton').bind('click', onSearch); + //determine API url and save it + stateMap.apiUrl = app.utilB.getApiUrl(); - //PRE FLIGHT CHECK - //================ + //fetch stored creds if available + var creds = store.get("rockfish.usercreds"); + // if (creds) { + //check if token has expired + if (tokenExpired()) { + stateMap.user.authenticated = false; + stateMap.user.name = ""; + stateMap.user.token = ""; + stateMap.user.id = 0; + } else { + //Show the logout item in the menu + $(".app-mnu-logout").removeClass("app-hidden"); + stateMap.user.authenticated = true; + stateMap.user.name = creds.name; + stateMap.user.token = creds.token; + stateMap.user.id = creds.id; + } + //} - //local storage required - if (!store.enabled) { - alert('Local storage is not supported by your browser. Please disable "Private Mode", or upgrade to a modern browser.'); - return; - } + //EVENT SUBSCRIPTIONS + $.gevent.subscribe($container, "app-login", onLogin); + $.gevent.subscribe($container, "app-logout", onLogout); + //$.gevent.subscribe($container, 'rf-update', onUpdate); + $.gevent.subscribe($container, "app-show-error", onShowError); + $.gevent.subscribe($container, "app-clear-error", onClearError); - //wait indicator for ajax functions - $(document).ajaxStart(function () { + //ROUTES + // + page.base("/default.htm"); + page("*", beforeUrlChange); + page("/authenticate", authenticate); + page("/", inbox); + page("/reportData", reportData); + page("/reportDataProdEmails", reportDataProdEmail); + page("/reportDataExpires", reportDataExpires); + page("/search", search); + page("/logout", function () { + $.gevent.publish("app-logout"); + }); + page("/customers", customers); + page("/customerEdit/:id", customerEdit); + page("/customerSites/:id", customerSites); + page("/customerSiteEdit/:id/:cust_id", customerSiteEdit); + page("/purchases/:id", purchases); + page("/purchaseEdit/:id/:site_id", purchaseEdit); + page("/license", license); + page("/licenseTemplates", licenseTemplates); + page("/licenseRequests", licenseRequests); + page("/licenseRequestEdit/:id", licenseRequestEdit); + //case 3233 + page("/licenses", licenses); + page("/licenseView/:id", licenseView); + page("/subscription", subscription); + page("/subnotify", subnotify); + page("/templates", templates); + page("/templateEdit/:id", templateEdit); + page("/inbox", inbox); + page.exit("/inbox", function (ctx, next) { + app.inbox.terminateModule(); + next(); + }); + page("/mailEdit/:mail_account/:mail_folder/:mail_id", mailEdit); + page("/rfcases", rfcases); + page("/rfcaseEdit/:id", rfcaseEdit); + page("/rfsettings", rfsettings); + page("/ops", ops); + page("/trials", trials); + page("/trialEdit/:id", trialEdit); + page("/ravLicenses/:id/:cust_id", ravLicenses); + page("/ravLicense/:id/:cust_id", ravLicense); + page("*", notFound); + page({ + hashbang: true + }); + // /ROUTES + }; + // End PUBLIC method /initModule/ - //disable all buttons - $('.app-frm-buttons button').prop('disabled', true).addClass('disabled'); - //$('.app-frm-buttons button').attr('disabled', 'disabled'); - $("body").css("cursor", "progress"); - //add app-ajax-busy style to buttons div where user clicked - $('.app-frm-buttons').addClass('app-ajax-busy'); + var beforeUrlChange = function (ctx, next) { + $.gevent.publish("app-clear-error"); + app.shell.stateMap.mediaSize = app.utilB.getMediaSize(); - }).ajaxStop(function () { + //case 3513 + document.title = "Rockfish " + app.api.RockFishVersion; - //with delay in case it's too fast to see - setTimeout(function () { - $('.app-frm-buttons button').prop('disabled', false).removeClass('disabled'); - //$('.app-frm-buttons button').removeAttr('disabled'); - $("body").css("cursor", "default"); - $('.app-frm-buttons').removeClass('app-ajax-busy'); - }, 250); + //bypass stuff below if about to logout + if (ctx.path == "/logout") { + return next(); + } - }); - - - //save on app so can call from anywhere - // app.mdInit = mdInit; - - // load HTML and map jQuery collections - stateMap.$container = $container; - $container.html(Handlebars.templates['app.shell']({})); - - //auto hide navbar on click - //rfac is a class only on the items that should trigger collapse - $('.rfac').on('click', function () { - $('.navbar-collapse').collapse('hide'); - }); - - //SEARCH - // $('#searchbutton').bind('click', onSearch); - - //determine API url and save it - stateMap.apiUrl = app.utilB.getApiUrl(); - - - //fetch stored creds if available - var creds = store.get('rockfish.usercreds'); - // if (creds) { - - //check if token has expired + //================================================================ + //Check authentication token to see if expired, but only if it's been a few minutes since last navigation + if (stateMap.user.authenticated) { + //This first bit sets the last nav in cases where it's never been set before + //default to one hour ago in case it hasn't ever been set yet or isn't in statemap + if (!stateMap.lastNav) { + //Isn't this sketchy? Is this a date or a moment being set here + stateMap.lastNav = moment().subtract(3600, "s").toDate(); //60 minutes ago + } + var mNow = moment(new Date()); //todays date + var mLastNav = moment(stateMap.lastNav); // another date + var duration = moment.duration(mNow.diff(mLastNav)); + var secondsSinceLastNav = duration.asSeconds(); + if (secondsSinceLastNav > 300) { + //have we checked in the last 5 minutes? if (tokenExpired()) { - stateMap.user.authenticated = false; - stateMap.user.name = ''; - stateMap.user.token = ''; - stateMap.user.id = 0; - - } else { - //Show the logout item in the menu - $(".app-mnu-logout").removeClass("app-hidden"); - stateMap.user.authenticated = true; - stateMap.user.name = creds.name; - stateMap.user.token = creds.token; - stateMap.user.id = creds.id; + stateMap.user.authenticated = false; } - //} + } + stateMap.lastNav = new Date(); + } + //=============================================================== + //Not logged in and trying to go somewhere but authenticate? + if (!stateMap.user.authenticated) { + //hide nav + $("#rf-nav").hide({ + duration: 200 + }); - //EVENT SUBSCRIPTIONS - $.gevent.subscribe($container, 'app-login', onLogin); - $.gevent.subscribe($container, 'app-logout', onLogout); - //$.gevent.subscribe($container, 'rf-update', onUpdate); - $.gevent.subscribe($container, 'app-show-error', onShowError); - $.gevent.subscribe($container, 'app-clear-error', onClearError); - - - //ROUTES - // - page.base('/default.htm'); - page('*', beforeUrlChange); - page('/authenticate', authenticate); - page('/', inbox); - page('/reportData', reportData); - page('/reportDataProdEmails', reportDataProdEmail); - page('/reportDataExpires', reportDataExpires); - page('/search', search); - page('/logout', function () { - $.gevent.publish('app-logout'); - }); - page('/customers', customers); - page('/customerEdit/:id', customerEdit); - page('/customerSites/:id', customerSites); - page('/customerSiteEdit/:id/:cust_id', customerSiteEdit); - page('/purchases/:id', purchases); - page('/purchaseEdit/:id/:site_id', purchaseEdit); - page('/license', license); - page('/licenseTemplates', licenseTemplates); - page('/licenseRequests', licenseRequests); - page('/licenseRequestEdit/:id', licenseRequestEdit); - //case 3233 - page('/licenses', licenses); - page('/licenseView/:id', licenseView); - page('/subscription', subscription); - page('/subnotify', subnotify); - page('/templates', templates); - page('/templateEdit/:id', templateEdit); - page('/inbox', inbox); - page.exit('/inbox', function(ctx,next) { - app.inbox.terminateModule(); - next(); - }); - page('/mailEdit/:mail_account/:mail_folder/:mail_id', mailEdit); - page('/rfcases', rfcases); - page('/rfcaseEdit/:id', rfcaseEdit); - page('/rfsettings', rfsettings); - page('/ops', ops); - page('/trials', trials); - page('/trialEdit/:id', trialEdit); - page('/ravLicenses/:id/:cust_id', ravLicenses); - page('/ravLicense/:id', ravLicense); - page('*', notFound); - page({ - hashbang: true - }); - // /ROUTES - - - - - - }; - // End PUBLIC method /initModule/ - - - - - - var beforeUrlChange = function (ctx, next) { - $.gevent.publish('app-clear-error'); - app.shell.stateMap.mediaSize = app.utilB.getMediaSize(); - - //case 3513 - document.title = 'Rockfish ' + app.api.RockFishVersion; - - //bypass stuff below if about to logout - if (ctx.path == '/logout') { - return next(); - } - - - - - - //================================================================ - //Check authentication token to see if expired, but only if it's been a few minutes since last navigation - if (stateMap.user.authenticated) { - //This first bit sets the last nav in cases where it's never been set before - //default to one hour ago in case it hasn't ever been set yet or isn't in statemap - if (!stateMap.lastNav) { - //Isn't this sketchy? Is this a date or a moment being set here - stateMap.lastNav = moment().subtract(3600, 's').toDate();//60 minutes ago - } - - - var mNow = moment(new Date()); //todays date - var mLastNav = moment(stateMap.lastNav); // another date - var duration = moment.duration(mNow.diff(mLastNav)); - var secondsSinceLastNav = duration.asSeconds(); - - if (secondsSinceLastNav > 300)//have we checked in the last 5 minutes? - { - if (tokenExpired()) { - stateMap.user.authenticated = false; - } - - } - stateMap.lastNav = new Date(); - } - //=============================================================== - - //Not logged in and trying to go somewhere but authenticate? - if (!stateMap.user.authenticated) { - //hide nav - $("#rf-nav").hide({ - duration: 200 - }); - - - //page nav to authenticate - if (ctx.path != '/authenticate/') - return page('#!/authenticate/'); - - } else { - //logged in so make sure to show toolbar here - $("#rf-nav").show({ - duration: 200 - }); - } - - next(); + //page nav to authenticate + if (ctx.path != "/authenticate/") return page("#!/authenticate/"); + } else { + //logged in so make sure to show toolbar here + $("#rf-nav").show({ + duration: 200 + }); } + next(); + }; + //TODO: Clean up this coral reef steaming mess + //replace with a function that generates these functions since they are all (nearly) identical - //TODO: Clean up this coral reef steaming mess - //replace with a function that generates these functions since they are all (nearly) identical + var authenticate = function (ctx) { + app.authenticate.configModule({ + context: ctx + }); + app.authenticate.initModule(); + }; - var authenticate = function (ctx) { + var reportData = function (ctx) { + app.nav.setSelectedMenuItem("reportData"); + app.reportData.configModule({ + context: ctx + }); + app.reportData.initModule(); + }; - app.authenticate.configModule({ - context: ctx - }); - app.authenticate.initModule(); - } + var reportDataProdEmail = function (ctx) { + app.nav.setSelectedMenuItem("reportData"); + app.reportDataProdEmail.configModule({ + context: ctx + }); + app.reportDataProdEmail.initModule(); + }; - var reportData = function (ctx) { - app.nav.setSelectedMenuItem('reportData'); - app.reportData.configModule({ - context: ctx - }); - app.reportData.initModule(); - } + var reportDataExpires = function (ctx) { + app.nav.setSelectedMenuItem("reportData"); + app.reportDataExpires.configModule({ + context: ctx + }); + app.reportDataExpires.initModule(); + }; - var reportDataProdEmail = function (ctx) { - app.nav.setSelectedMenuItem('reportData'); - app.reportDataProdEmail.configModule({ - context: ctx - }); - app.reportDataProdEmail.initModule(); - } + var search = function (ctx) { + app.nav.setSelectedMenuItem("search"); + app.search.configModule({ + context: ctx + }); + app.search.initModule(); + }; - var reportDataExpires = function (ctx) { - app.nav.setSelectedMenuItem('reportData'); - app.reportDataExpires.configModule({ - context: ctx - }); - app.reportDataExpires.initModule(); - } + var customers = function (ctx) { + app.nav.setSelectedMenuItem("customers"); + app.customers.configModule({ + context: ctx + }); + app.customers.initModule(); + }; - var search = function (ctx) { - app.nav.setSelectedMenuItem('search'); - app.search.configModule({ - context: ctx - }); - app.search.initModule(); - } + var customerEdit = function (ctx) { + app.nav.setSelectedMenuItem("customers"); + app.customerEdit.configModule({ + context: ctx + }); + app.customerEdit.initModule(); + }; - var customers = function (ctx) { - app.nav.setSelectedMenuItem('customers'); - app.customers.configModule({ - context: ctx - }); - app.customers.initModule(); - } + var customerSites = function (ctx) { + app.nav.setSelectedMenuItem("customers"); + app.customerSites.configModule({ + context: ctx + }); + app.customerSites.initModule(); + }; - var customerEdit = function (ctx) { - app.nav.setSelectedMenuItem('customers'); - app.customerEdit.configModule({ - context: ctx - }); - app.customerEdit.initModule(); - } - - var customerSites = function (ctx) { - app.nav.setSelectedMenuItem('customers'); - app.customerSites.configModule({ - context: ctx - }); - app.customerSites.initModule(); - } + var customerSiteEdit = function (ctx) { + app.nav.setSelectedMenuItem("customers"); + app.customerSiteEdit.configModule({ + context: ctx + }); + app.customerSiteEdit.initModule(); + }; - var customerSiteEdit = function (ctx) { - app.nav.setSelectedMenuItem('customers'); - app.customerSiteEdit.configModule({ - context: ctx - }); - app.customerSiteEdit.initModule(); - } + var purchases = function (ctx) { + app.nav.setSelectedMenuItem("customers"); + app.purchases.configModule({ + context: ctx + }); + app.purchases.initModule(); + }; - var purchases = function (ctx) { - app.nav.setSelectedMenuItem('customers'); - app.purchases.configModule({ - context: ctx - }); - app.purchases.initModule(); - } + var purchaseEdit = function (ctx) { + app.nav.setSelectedMenuItem("customers"); + app.purchaseEdit.configModule({ + context: ctx + }); + app.purchaseEdit.initModule(); + }; - var purchaseEdit = function (ctx) { - app.nav.setSelectedMenuItem('customers'); - app.purchaseEdit.configModule({ - context: ctx - }); - app.purchaseEdit.initModule(); - } + var license = function (ctx) { + app.nav.setSelectedMenuItem("license"); + app.license.configModule({ + context: ctx + }); + app.license.initModule(); + }; - - var license = function (ctx) { - app.nav.setSelectedMenuItem('license'); - app.license.configModule({ - context: ctx - }); - app.license.initModule(); - } + var licenseTemplates = function (ctx) { + app.nav.setSelectedMenuItem("license"); + app.licenseTemplates.configModule({ + context: ctx + }); + app.licenseTemplates.initModule(); + }; - var licenseTemplates = function (ctx) { - app.nav.setSelectedMenuItem('license'); - app.licenseTemplates.configModule({ - context: ctx - }); - app.licenseTemplates.initModule(); - } + var licenseRequests = function (ctx) { + app.nav.setSelectedMenuItem("license"); + app.licenseRequests.configModule({ + context: ctx + }); + app.licenseRequests.initModule(); + }; - var licenseRequests = function (ctx) { - app.nav.setSelectedMenuItem('license'); - app.licenseRequests.configModule({ - context: ctx - }); - app.licenseRequests.initModule(); - } + var licenseRequestEdit = function (ctx) { + app.nav.setSelectedMenuItem("license"); + app.licenseRequestEdit.configModule({ + context: ctx + }); + app.licenseRequestEdit.initModule(); + }; - var licenseRequestEdit = function (ctx) { - app.nav.setSelectedMenuItem('license'); - app.licenseRequestEdit.configModule({ - context: ctx - }); - app.licenseRequestEdit.initModule(); - } + //case 3233 + var licenses = function (ctx) { + app.nav.setSelectedMenuItem("license"); + app.licenses.configModule({ + context: ctx + }); + app.licenses.initModule(); + }; - //case 3233 - var licenses = function (ctx) { - app.nav.setSelectedMenuItem('license'); - app.licenses.configModule({ - context: ctx - }); - app.licenses.initModule(); - } + //case 3233 + var licenseView = function (ctx) { + app.nav.setSelectedMenuItem("license"); + app.licenseView.configModule({ + context: ctx + }); + app.licenseView.initModule(); + }; - //case 3233 - var licenseView = function (ctx) { - app.nav.setSelectedMenuItem('license'); - app.licenseView.configModule({ - context: ctx - }); - app.licenseView.initModule(); - } + var subscription = function (ctx) { + app.nav.setSelectedMenuItem("subscription"); + app.subscription.configModule({ + context: ctx + }); + app.subscription.initModule(); + }; + var subnotify = function (ctx) { + app.nav.setSelectedMenuItem("subscription"); + app.subnotify.configModule({ + context: ctx + }); + app.subnotify.initModule(); + }; + var templates = function (ctx) { + app.nav.setSelectedMenuItem("templates"); + app.templates.configModule({ + context: ctx + }); + app.templates.initModule(); + }; - var subscription = function (ctx) { - app.nav.setSelectedMenuItem('subscription'); - app.subscription.configModule({ - context: ctx - }); - app.subscription.initModule(); - } + var templateEdit = function (ctx) { + app.nav.setSelectedMenuItem("templates"); + app.templateEdit.configModule({ + context: ctx + }); + app.templateEdit.initModule(); + }; - var subnotify = function (ctx) { - app.nav.setSelectedMenuItem('subscription'); - app.subnotify.configModule({ - context: ctx - }); - app.subnotify.initModule(); - } + var inbox = function (ctx) { + app.nav.setSelectedMenuItem("inbox"); + app.inbox.configModule({ + context: ctx + }); + app.inbox.initModule(); + }; - var templates = function (ctx) { - app.nav.setSelectedMenuItem('templates'); - app.templates.configModule({ - context: ctx - }); - app.templates.initModule(); - } + var mailEdit = function (ctx) { + app.nav.setSelectedMenuItem("inbox"); + app.mailEdit.configModule({ + context: ctx + }); + app.mailEdit.initModule(); + }; - var templateEdit = function (ctx) { - app.nav.setSelectedMenuItem('templates'); - app.templateEdit.configModule({ - context: ctx - }); - app.templateEdit.initModule(); - } + var rfcases = function (ctx) { + app.nav.setSelectedMenuItem("rfcases"); + app.rfcases.configModule({ + context: ctx + }); + app.rfcases.initModule(); + }; + var rfcaseEdit = function (ctx) { + app.nav.setSelectedMenuItem("rfcases"); + app.rfcaseEdit.configModule({ + context: ctx + }); + app.rfcaseEdit.initModule(); + }; - var inbox = function (ctx) { - app.nav.setSelectedMenuItem('inbox'); - app.inbox.configModule({ - context: ctx - }); - app.inbox.initModule(); - } + var rfsettings = function (ctx) { + app.nav.setSelectedMenuItem("rfsettings"); + app.rfsettings.configModule({ + context: ctx + }); + app.rfsettings.initModule(); + }; - var mailEdit = function (ctx) { - app.nav.setSelectedMenuItem('inbox'); - app.mailEdit.configModule({ - context: ctx - }); - app.mailEdit.initModule(); - } + var ops = function (ctx) { + app.nav.setSelectedMenuItem("ops"); + app.ops.configModule({ + context: ctx + }); + app.ops.initModule(); + }; + //case 3233 + var trials = function (ctx) { + app.nav.setSelectedMenuItem("trials"); + app.trials.configModule({ + context: ctx + }); + app.trials.initModule(); + }; - var rfcases = function (ctx) { - app.nav.setSelectedMenuItem('rfcases'); - app.rfcases.configModule({ - context: ctx - }); - app.rfcases.initModule(); - } + //case 3233 + var trialEdit = function (ctx) { + app.nav.setSelectedMenuItem("trials"); + app.trialEdit.configModule({ + context: ctx + }); + app.trialEdit.initModule(); + }; - var rfcaseEdit = function (ctx) { - app.nav.setSelectedMenuItem('rfcases'); - app.rfcaseEdit.configModule({ - context: ctx - }); - app.rfcaseEdit.initModule(); - } + var trialEdit = function (ctx) { + app.nav.setSelectedMenuItem("trials"); + app.trialEdit.configModule({ + context: ctx + }); + app.trialEdit.initModule(); + }; - var rfsettings = function (ctx) { - app.nav.setSelectedMenuItem('rfsettings'); - app.rfsettings.configModule({ - context: ctx - }); - app.rfsettings.initModule(); - } + var ravLicense = function (ctx) { + app.nav.setSelectedMenuItem("customers"); + app.ravLicense.configModule({ + context: ctx + }); + app.ravLicense.initModule(); + }; - var ops = function (ctx) { - app.nav.setSelectedMenuItem('ops'); - app.ops.configModule({ - context: ctx - }); - app.ops.initModule(); - } + var ravLicenses = function (ctx) { + app.nav.setSelectedMenuItem("customers"); + app.ravLicenses.configModule({ + context: ctx + }); + app.ravLicenses.initModule(); + }; + var notFound = function (ctx) { + app.fourohfour.configModule({ + context: ctx + }); + app.fourohfour.initModule(); + }; - //case 3233 - var trials = function (ctx) { - app.nav.setSelectedMenuItem('trials'); - app.trials.configModule({ - context: ctx - }); - app.trials.initModule(); - } - - //case 3233 - var trialEdit = function (ctx) { - app.nav.setSelectedMenuItem('trials'); - app.trialEdit.configModule({ - context: ctx - }); - app.trialEdit.initModule(); - } - - var trialEdit = function (ctx) { - app.nav.setSelectedMenuItem('trials'); - app.trialEdit.configModule({ - context: ctx - }); - app.trialEdit.initModule(); - } - - var ravLicense = function (ctx) { - app.nav.setSelectedMenuItem('customers'); - app.ravLicense.configModule({ - context: ctx - }); - app.ravLicense.initModule(); - } - - var ravLicenses = function (ctx) { - app.nav.setSelectedMenuItem('customers'); - app.ravLicenses.configModule({ - context: ctx - }); - app.ravLicenses.initModule(); - } - - - var notFound = function (ctx) { - app.fourohfour.configModule({ - context: ctx - }); - app.fourohfour.initModule(); - } - - - - - - return { - initModule: initModule, - stateMap: stateMap - }; - //------------------- END PUBLIC METHODS --------------------- -}()); \ No newline at end of file + return { + initModule: initModule, + stateMap: stateMap + }; + //------------------- END PUBLIC METHODS --------------------- +})();