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,+BAAgCqO,GAGrEA,EAAoBrc,QAAU,CAAC,oBAAqB,oBAkBpD,CAzBD,GCAA,WACC,aASA,SAASsgB,EAAkBnB,EAAmBG,GAE7C,IAAIE,EAAO,IAAIL,EAAkB,gBAAiBG,GA2BlD,OAxBAE,EAAKjY,WAKL,WAEC,OAAO+X,EAAkBM,IAAInhB,KAAKghB,SAAW,eAAeO,YAAYje,MAAK,SAASwe,GAErF,OAAOA,CACR,GACD,EAVAf,EAAKvZ,QAaL,SAAiBD,GAChB,OAAOvH,KAAKkX,IAAI3P,EAAW,WAC5B,EAdAwZ,EAAK5L,cAiBL,SAAuB1K,GACtB,OAAOoW,EAAkBQ,IAAIrhB,KAAKghB,SAAW,iBAAkBvW,GAAc9M,QAC9E,EAGOojB,CACR,CApCAllB,QAAQyF,OAAO,cAAciO,QAAQ,4BAA6BsS,GAGlEA,EAAkBtgB,QAAU,CAAC,oBAAqB,oBAkClD,CAzCD","sources":["webpack://nha.portal.web/./app/scripts/sv-element.decorator.js","webpack://nha.portal.web/./app/_global.js","webpack://nha.portal.web/./app/app.js","webpack://nha.portal.web/./app/app.run.js","webpack://nha.portal.web/./app/app.config.js","webpack://nha.portal.web/./app/app.routes.js","webpack://nha.portal.web/./app/directives/nha-branding/nha-branding.directive.js","webpack://nha.portal.web/./app/directives/portal-app-logo/portal-app-logo.controller.js","webpack://nha.portal.web/./app/directives/portal-app-logo/portal-app-logo.directive.js","webpack://nha.portal.web/./app/directives/portal-favorites/portal-favorites.controller.js","webpack://nha.portal.web/./app/directives/portal-favorites/portal-favorites.directive.js","webpack://nha.portal.web/./app/directives/portal-group-list/portal-group-list.controller.js","webpack://nha.portal.web/./app/directives/portal-group-list/portal-group-list.directive.js","webpack://nha.portal.web/./app/directives/portal-group/portal-group.controller.js","webpack://nha.portal.web/./app/directives/portal-group/portal-group.directive.js","webpack://nha.portal.web/./app/directives/portal-launcher/portal-launcher.directive.js","webpack://nha.portal.web/./app/directives/portal-link-list/portal-link-list.controller.js","webpack://nha.portal.web/./app/directives/portal-link-list/portal-link-list.directive.js","webpack://nha.portal.web/./app/directives/portal-link/portal-link.controller.js","webpack://nha.portal.web/./app/directives/portal-link/portal-link.directive.js","webpack://nha.portal.web/./app/directives/portal-mini-launcher/portal-mini-launcher.controller.js","webpack://nha.portal.web/./app/directives/portal-mini-launcher/portal-mini-launcher.directive.js","webpack://nha.portal.web/./app/directives/portal-mini-search/portal-mini-search.controller.js","webpack://nha.portal.web/./app/directives/portal-mini-search/portal-mini-search.directive.js","webpack://nha.portal.web/./app/directives/portal-search/portal-search.controller.js","webpack://nha.portal.web/./app/directives/portal-search/portal-search.directive.js","webpack://nha.portal.web/./app/directives/portal-search/portal-search.manager.js","webpack://nha.portal.web/./app/directives/portal-search/search-result/search-result.controller.js","webpack://nha.portal.web/./app/directives/portal-search/search-result/search-result.directive.js","webpack://nha.portal.web/./app/directives/portal-sidebar/portal-sidebar.controller.js","webpack://nha.portal.web/./app/directives/portal-sidebar/portal-sidebar.directive.js","webpack://nha.portal.web/./app/filters/strip-line-breaks.filter.js","webpack://nha.portal.web/./app/managers/portal-app-context.manager.js","webpack://nha.portal.web/./app/managers/portal-favorites.manager.js","webpack://nha.portal.web/./app/portal-admin/portal-admin-groups/group-modal.controller.js","webpack://nha.portal.web/./app/portal-admin/portal-admin-groups/portal-admin-groups.controller.js","webpack://nha.portal.web/./app/portal-admin/portal-admin-groups/portal-admin-groups.directive.js","webpack://nha.portal.web/./app/portal-admin/portal-admin-links/link-modal.controller.js","webpack://nha.portal.web/./app/portal-admin/portal-admin-links/portal-admin-links.controller.js","webpack://nha.portal.web/./app/portal-admin/portal-admin-links/portal-admin-links.directive.js","webpack://nha.portal.web/./app/portal-admin/portal-admin-quicklinks/portal-admin-quicklinks.controller.js","webpack://nha.portal.web/./app/portal-admin/portal-admin-quicklinks/portal-admin-quicklinks.directive.js","webpack://nha.portal.web/./app/portal-admin/portal-admin-settings/portal-admin-setting.directive.js","webpack://nha.portal.web/./app/portal-admin/portal-admin-settings/portal-admin-settings.controller.js","webpack://nha.portal.web/./app/portal-admin/portal-admin-settings/setting-modal.controller.js","webpack://nha.portal.web/./app/portal-admin/portal-admin.directive.js","webpack://nha.portal.web/./app/portal-main/portal-main.directive.js","webpack://nha.portal.web/./app/portal/portal.directive.js","webpack://nha.portal.web/./app/repositories/birthday.repository.js","webpack://nha.portal.web/./app/repositories/color.repository.js","webpack://nha.portal.web/./app/repositories/config-frontend-web-source.repository.js","webpack://nha.portal.web/./app/repositories/config.repository.js","webpack://nha.portal.web/./app/repositories/portal-link-business-application.repository.js","webpack://nha.portal.web/./app/repositories/portal-link-group-link.repository.js","webpack://nha.portal.web/./app/repositories/portal-link-group.repository.js","webpack://nha.portal.web/./app/repositories/portal-link-location.repository.js","webpack://nha.portal.web/./app/repositories/portal-link-role.repository.js","webpack://nha.portal.web/./app/repositories/portal-link.repository.js","webpack://nha.portal.web/./app/repositories/portal-quick-link.repository.js","webpack://nha.portal.web/./app/repositories/staff-favorite.repository.js"],"sourcesContent":["/**\n * sv-element decorator\n * @namespace angular-sortable-view\n */\n\n(function() {\n\t'use strict';\n\n\t/** decorate the sv-element directive */\n\tangular.module('angular-sortable-view').config(config);\n\n\t/** injection */\n\tconfig.$inject = ['$provide'];\n\tsvElementDecorator.$inject = ['$delegate', '$parse'];\n\n\t/** config implementation */\n\tfunction config($provide) {\n\t\t/** create the sv-element decorator */\n\t\t$provide.decorator('svElementDirective', svElementDecorator);\n\t}\n\n\t/** svElementDecorator implementation */\n\tfunction svElementDecorator($delegate, $parse) {\n\t\t/** get the directive */\n\t\tvar directive = $delegate[0];\n\n\t\t/** set compile function */\n\t\tdirective.compile = compileFunc;\n\n\t\t/** compileFunc implementation */\n\t\tfunction compileFunc() {\n\t\t\treturn newLinkFunc;\n\t\t}\n\n\t\t/** create new link function */\n\t\tfunction newLinkFunc($scope, $element, $attrs, $controllers) {\n\t\t\tvar sortableElement = {\n\t\t\t\telement: $element,\n\t\t\t\tgetPart: $controllers[0].getPart,\n\t\t\t\tgetIndex: function(){\n\t\t\t\t\treturn $scope.$index;\n\t\t\t\t}\n\t\t\t};\n\t\t\t$controllers[1].addToSortableElements(sortableElement);\n\t\t\t$scope.$on('$destroy', function(){\n\t\t\t\t$controllers[1].removeFromSortableElements(sortableElement);\n\t\t\t});\n\n\t\t\tvar handle = $element;\n\n\t\t\t/******************************************************************************************\n\t\t\t * PATCHED AREA OF CODE\n\t\t\t * https://github.com/RobertjanTuit/angular-sortable-view/commit/2d9438e70ce6df6373dec0cf5c4ff341eaffbf3a\n\t\t\t******************************************************************************************/\n\n\t\t\tvar startTimer;\n\t\t\tvar clearEvent = function() {\n\t\t\t\tclearTimeout(startTimer);\n\t\t\t};\n\n\t\t\tvar opts = $parse($attrs.svElement)($scope);\n\t\t\topts = angular.extend({}, {\n\t\t\t\tdelay: 0\n\t\t\t}, opts);\n\n\t\t\t/** check for disabled flag */\n\t\t\tif (opts.disabled !== true) {\n\t\t\t\tvar event = onMousedown;\n\t\t\t\tif (opts.delay) {\n\t\t\t\t\tevent = function (e) {\n\t\t\t\t\t\thtml.on('mouseup touchend', clearEvent);\n\t\t\t\t\t\tstartTimer = setTimeout(function () { onMousedown(e); }, opts.delay);\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\thandle.on('mousedown touchstart', event);\n\n\t\t\t\t$scope.$watch('$ctrl.handle', function(customHandle){\n\t\t\t\t\tif(customHandle){\n\t\t\t\t\t\tclearEvent();\n\t\t\t\t\t\thandle.off('mousedown touchstart', event);\n\t\t\t\t\t\thandle = customHandle;\n\t\t\t\t\t\thandle.on('mousedown touchstart', event);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/******************************************************************************************/\n\n\t\t\tvar helper;\n\t\t\t$scope.$watch('$ctrl.helper', function(customHelper){\n\t\t\t\tif(customHelper){\n\t\t\t\t\thelper = customHelper;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tvar placeholder;\n\t\t\t$scope.$watch('$ctrl.placeholder', function(customPlaceholder){\n\t\t\t\tif(customPlaceholder){\n\t\t\t\t\tplaceholder = customPlaceholder;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tvar html = angular.element(document.documentElement);\n\n\t\t\tvar moveExecuted;\n\n\t\t\tfunction onMousedown(e){\n\t\t\t\ttouchFix(e);\n\n\t\t\t\tif($controllers[1].sortingInProgress()) return;\n\t\t\t\tif(e.button !== 0 && e.type === 'mousedown') return;\n\n\t\t\t\t// START - for Behavior Module : Student's List page - Bug #20772\n\t\t\t\tvar isForBehaviorList = false;\n\n\t\t\t\tif (e.toElement) {\n if (e.toElement.ownerDocument) {\n if (e.toElement.ownerDocument.URL.indexOf('behavior') > 0 && e.toElement.ownerDocument.URL.indexOf('list') > 0) {\n var words = _.words(e.toElement.ownerDocument.URL);\n\n var numbers = _.remove(words, function (n) {\n return !isNaN(n);\n });\n\n numbers = _.drop(numbers, 2); // drop unncessary course info\n\n numbers = _.chunk(numbers, 3); // split array to compare dates\n\n isForBehaviorList = _.difference(numbers[0], numbers[1]).length === 0;\n }\n }\n }\n\t\t\t\t// END - for Behavior Module : Student's List page\n\n\t\t\t\tmoveExecuted = false;\n\t\t\t\tvar opts = $parse($attrs.svElement)($scope);\n\t\t\t\topts = angular.extend({}, {\n\t\t\t\t\ttolerance: 'pointer',\n\t\t\t\t\trevert: 200,\n\t\t\t\t\tcontainment: 'html'\n\t\t\t\t}, opts);\n\t\t\t\tif(opts.containment){\n\t\t\t\t\tvar containmentRect = closestElement.call($element, opts.containment)[0].getBoundingClientRect();\n\t\t\t\t}\n\n\t\t\t\tvar target = $element;\n\t\t\t\tvar clientRect = $element[0].getBoundingClientRect();\n\t\t\t\tvar clone;\n\n\t\t\t\tif(!helper) helper = $controllers[0].helper;\n\t\t\t\tif(!placeholder) placeholder = $controllers[0].placeholder;\n\t\t\t\tif(helper){\n\t\t\t\t\tclone = helper.clone();\n\t\t\t\t\tclone.removeClass('ng-hide');\n\t\t\t\t\tclone.css({\n\t\t\t\t\t 'left': clientRect.left + document.body.scrollLeft + 'px',\n\t\t\t\t\t 'top': clientRect.top + document.body.scrollTop + 'px'\n\t\t\t\t\t});\n\t\t\t\t\ttarget.addClass('sv-visibility-hidden');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tclone = target.clone();\n\n\t\t\t\t\tvar width = isForBehaviorList ? (clone.context.clientWidth - clone.context.lastElementChild.clientWidth) : clientRect.width;\n\n\t\t\t\t\tclone.addClass('sv-helper').css({\n\t\t\t\t\t 'left': clientRect.left + document.body.scrollLeft + 'px',\n\t\t\t\t\t 'top': clientRect.top + document.body.scrollTop + 'px',\n\t\t\t\t\t 'width': width + 'px'\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tclone[0].reposition = function(coords){\n\t\t\t\t\tvar targetLeft = coords.x;\n\t\t\t\t\tvar targetTop = coords.y;\n\t\t\t\t\tvar helperRect = clone[0].getBoundingClientRect();\n\n\t\t\t\t\tvar body = document.body;\n\n\t\t\t\t\tif(containmentRect){\n\t\t\t\t\t\tif(targetTop < containmentRect.top + body.scrollTop) // top boundary\n\t\t\t\t\t\t\ttargetTop = containmentRect.top + body.scrollTop;\n\t\t\t\t\t\tif(targetTop + helperRect.height > containmentRect.top + body.scrollTop + containmentRect.height) // bottom boundary\n\t\t\t\t\t\t\ttargetTop = containmentRect.top + body.scrollTop + containmentRect.height - helperRect.height;\n\t\t\t\t\t\tif(targetLeft < containmentRect.left + body.scrollLeft) // left boundary\n\t\t\t\t\t\t\ttargetLeft = containmentRect.left + body.scrollLeft;\n\t\t\t\t\t\tif(targetLeft + helperRect.width > containmentRect.left + body.scrollLeft + containmentRect.width) // right boundary\n\t\t\t\t\t\t\ttargetLeft = containmentRect.left + body.scrollLeft + containmentRect.width - helperRect.width;\n\t\t\t\t\t}\n\t\t\t\t\tthis.style.left = targetLeft - body.scrollLeft + 'px';\n\t\t\t\t\tthis.style.top = targetTop - body.scrollTop + 'px';\n\t\t\t\t};\n\n var pointerOffset = {\n x: (e.clientX - clientRect.left)/clientRect.width,\n y: (e.clientY - clientRect.top)/clientRect.height\n };\n\t\t\t\thtml.addClass('sv-sorting-in-progress');\n\t\t\t\thtml.on('mousemove touchmove', onMousemove).on('mouseup touchend touchcancel', function mouseup(){\n\t\t\t\t\thtml.off('mousemove touchmove', onMousemove);\n\t\t\t\t\thtml.off('mouseup touchend', mouseup);\n\t\t\t\t\thtml.removeClass('sv-sorting-in-progress');\n\t\t\t\t\tif(moveExecuted){\n\t\t\t\t\t\t$controllers[0].$drop($scope.$index, opts);\n\t\t\t\t\t}\n\t\t\t\t\t$element.removeClass('sv-visibility-hidden');\n\t\t\t\t});\n\n\t\t\t\t// onMousemove(e);\n\t\t\t\tfunction onMousemove(e){\n\t\t\t\t\ttouchFix(e);\n\t\t\t\t\tif(!moveExecuted){\n\t\t\t\t\t\t$element.parent().prepend(clone);\n\t\t\t\t\t\tmoveExecuted = true;\n\t\t\t\t\t}\n\t\t\t\t\t$controllers[1].$moveUpdate(opts, {\n\t\t\t\t\t\tx: e.clientX,\n\t\t\t\t\t\ty: e.clientY,\n\t\t\t\t\t\toffset: pointerOffset\n\t\t\t\t\t}, clone, $element, placeholder, $controllers[0].getPart(), $scope.$index);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/** add methods from original sv-sort module that only exist in its context */\n\t\tfunction touchFix(e){\n\t\t\tif(!('clientX' in e) && !('clientY' in e)) {\n\t\t\t\tvar touches = e.touches || e.originalEvent.touches;\n\t\t\t\tif(touches && touches.length) {\n\t\t\t\t\te.clientX = touches[0].clientX;\n\t\t\t\t\te.clientY = touches[0].clientY;\n\t\t\t\t}\n\t\t\t\te.preventDefault();\n\t\t\t}\n\t\t}\n\t\tvar closestElement = angular.element.prototype.closest || function (selector){\n\t\t\tvar el = this[0].parentNode;\n\t\t\twhile(el !== document.documentElement && !el[matchingFunction](selector))\n\t\t\t\tel = el.parentNode;\n\t\t\tif(el[matchingFunction](selector))\n\t\t\t\treturn angular.element(el);\n\t\t\telse\n\t\t\t\treturn angular.element();\n\t\t};\n\n\t\t/** return the delegate */\n\t\treturn $delegate;\n\t}\n})();","/**\n * Global Script\n * @namespace curriculum\n */\n\n/** String object extensions */\n\n(function () {\n\t'use strict';\n\n\t/** check to see if a string contains another string */\n\tString.prototype.contains = function(str){\n\t\treturn this.toLowerCase().indexOf(str.toLowerCase()) > -1;\n\t};\n\n\t/** remove the specified string from the given string */\n\tString.prototype.remove = function(str){\n\t\tif (this.contains(str)) return this.replace(str, '');\n\t};\n\n\t/** strip html */\n\tString.prototype.stripHtml = function() {\n\t\tvar tmp = document.createElement('div');\n\t\ttmp.innerHTML = this;\n\t\treturn tmp.textContent || tmp.innerText || '';\n\t};\n\n\t/** Array Extensions */\n\n\t/** check an array for an item and return true or false */\n\tArray.prototype.contains = function(item){\n\t\treturn $.inArray(item, this) > -1;\n\t};\n\n\t/** remove an entry from an array */\n\tArray.prototype.remove = function(item){\n\t\tif (this.contains(item)){\n\t\t\tthis.splice($.inArray(item, this), 1);\n\t\t}\n\t};\n\n\t/** compare array to another array and return missing values */\n\tArray.prototype.compare = function(array){\n\t\tvar missingValues = [];\n\t\tfor (var i = 0; i < this.length; i++){\n\t\t\tif (!array.contains(this[i])) missingValues.push(this[i]);\n\t\t}\n\t\treturn missingValues;\n\t};\n})();","/**\n * app\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** create the nha.portal module */\n\tangular.module('nha.portal', _ng.moduleInit(['nha.core']));\n})();","/**\n * app.run\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** initialize the nha.portal module */\n\tangular.module('nha.portal').run(run);\n\n\t/** injection */\n\trun.$inject = ['$location', '$rootScope', 'stateTransitionSecurityCheck', 'userContextService', 'appSettings'];\n\n\t/** implementation */\n function run($location, $rootScope, stateTransitionSecurityCheck, userContextService, appSettings) {\n\n\t\tuserContextService.ensureUserContext().then(function (user) {\n\t\t\tvar myNHA = window['myNHA'];\n\t\t\tvar tagManager = new myNHA.TagManagerService();\n\t\t\ttagManager.setupUserID();\n\t\t});\n\n\t\t/** add security check on state change */\n\t\tstateTransitionSecurityCheck.attachStateChangeListener('portal.403');\n\n\t\t/** change page title */\n\t\tvar pageTitleAppName = ' | NHA Portal';\n\t\tvar defaultPageTitle = 'Home' + pageTitleAppName;\n\n\t\t/** whenever the UI Route changes, fire off this event to update the page title */\n\t\t$rootScope.$on('$stateChangeSuccess', function (event, toState) {\n\t\t\tif (toState.hasOwnProperty('title')) document.title = toState.title + pageTitleAppName;\n\t\t\telse if (document.title !== defaultPageTitle) document.title = defaultPageTitle;\n\t\t});\n\t}\n})();","/**\n * app.config\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** configure the nha.portal module */\n\tangular.module('nha.portal').config(config);\n\n\t/** injection */\n\tconfig.$inject = ['$stateProvider', '$urlRouterProvider', '$locationProvider', '$breadcrumbProvider', '$sceDelegateProvider', '$compileProvider', 'RestangularProvider', 'appSettings'];\n\n\t/** implementation */\n\tfunction config($stateProvider, $urlRouterProvider, $locationProvider, $breadcrumbProvider, $sceDelegateProvider, $compileProvider, RestangularProvider, appSettings) {\n\t\t/** whitelist domains that we need to communicate with */\n\t\t$sceDelegateProvider.resourceUrlWhitelist([\n\t\t\t'self',\n\t\t\t'https://*.nhatest.com/**',\n\t\t\t'https://*.mynhadev.com/**',\n\t\t\t'https://*.nhaschools.com/**', 'https://*.mynha.com/**', 'https://mynha.com/**'\n\t\t]);\n\n\t\t/** enable/disable debug info */\n\t\tif (appSettings.environment !== 'dev' && appSettings.environment !== 'ci') {\n\t\t\t$compileProvider.debugInfoEnabled(false);\n\t\t}\n\n\t\t/** use HTML5 History API */\n\t\t$locationProvider.html5Mode({ enabled: true, requireBase: true });\n\n\t\t/** set default path */\n\t\t$urlRouterProvider.otherwise('/');\n\n\t\t/** configure Restangular */\n\t\tRestangularProvider.setBaseUrl(appSettings.portalServicesRootUrl);\n\n\t\t/** grab our breadcrumb template root */\n\t\t$breadcrumbProvider.setOptions({\n\t\t\ttemplateUrl: appSettings.coreWebRootUrl + 'app/directives/breadcrumb/breadcrumb.html',\n\t\t\tincludeAbstract: true\n\t\t});\n\t}\n})();","/**\n * app.routes\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** configure the nha.curriculum module */\n\tangular.module('nha.portal').config(config);\n\n\t/** setup injection */\n\tconfig.$inject = ['$stateProvider', 'appSettings'];\n\n\t/** implementation */\n\tfunction config($stateProvider, appSettings) {\n\t\t/** setup parent route */\n\t\t$stateProvider.state('portal', {\n\t\t\tabstract: true,\n\t\t\turl: '',\n\t\t\ttemplate: '',\n\t\t\tncyBreadcrumb: {\n\t\t\t\tskip: true\n\t\t\t}\n\t\t});\n\n\t\t/** setup main route */\n\t\t$stateProvider.state('portal.main', {\n\t\t\turl: '/',\n\t\t\ttemplate: '',\n\t\t\tncyBreadcrumb: {\n\t\t\t\tlabel: 'Home'\n\t\t\t},\n\t\t\tresolve: {\n\t\t\t\tauthorization: ['stateTransitionSecurityCheck', function (stateTransitionSecurityCheck) {\n\t\t\t\t\treturn stateTransitionSecurityCheck.resolveAuthorization('ui_portal_main', 'Portal');\n\t\t\t\t}]\n\t\t\t},\n\t\t\tdata: {\n\t\t\t\tsecurity: {\n\t\t\t\t\trequiredResource: 'ui_portal_main',\n\t\t\t\t\tapi: 'Portal'\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/** setup admin routes */\n\t\t$stateProvider.state('portal.admin', {\n\t\t\tabstract: true,\n\t\t\turl: '/admin',\n\t\t\ttemplate: '',\n\t\t\tncyBreadcrumb: {\n\t\t\t\tlabel: 'Admin'\n\t\t\t},\n\t\t\tresolve: {\n\t\t\t\tauthorization: ['stateTransitionSecurityCheck', function (stateTransitionSecurityCheck) {\n\t\t\t\t\treturn stateTransitionSecurityCheck.resolveAuthorization('ui_portal_admin', 'Portal');\n\t\t\t\t}]\n\t\t\t},\n\t\t\tdata: {\n\t\t\t\tsecurity: {\n\t\t\t\t\trequiredResource: 'ui_portal_admin',\n\t\t\t\t\tapi: 'Portal'\n\t\t\t\t}\n\t\t\t}\n\t\t}).state('portal.admin.portal-links', {\n\t\t\turl: '/links',\n\t\t\ttemplate: '',\n\t\t\tncyBreadcrumb: {\n\t\t\t\tlabel: 'Portal Links',\n\t\t\t\tparent: 'portal.admin'\n\t\t\t}\n\t\t}).state('portal.admin.portal-groups', {\n\t\t\turl: '/groups',\n\t\t\ttemplate: '',\n\t\t\tncyBreadcrumb: {\n\t\t\t\tlabel: 'Portal Groups',\n\t\t\t\tparent: 'portal.admin'\n\t\t\t},\n\t\t\tresolve: {\n\t\t\t\tauthorization: ['stateTransitionSecurityCheck', function (stateTransitionSecurityCheck) {\n\t\t\t\t\treturn stateTransitionSecurityCheck.resolveAuthorization('ui_portal_editor', 'Portal');\n\t\t\t\t}]\n\t\t\t},\n\t\t\tdata: {\n\t\t\t\tsecurity: {\n\t\t\t\t\trequiredResource: 'ui_portal_editor',\n\t\t\t\t\tapi: 'Portal'\n\t\t\t\t}\n\t\t\t}\n\t\t}).state('portal.admin.portal-quicklinks', {\n\t\t\turl: '/quicklinks',\n\t\t\ttemplate: '',\n\t\t\tncyBreadcrumb: {\n\t\t\t\tlabel: 'Portal Quick Links',\n\t\t\t\tparent: 'portal.admin'\n\t\t\t},\n\t\t\tresolve: {\n\t\t\t\tauthorization: ['stateTransitionSecurityCheck', function (stateTransitionSecurityCheck) {\n\t\t\t\t\treturn stateTransitionSecurityCheck.resolveAuthorization('ui_portal_editor', 'Portal');\n\t\t\t\t}]\n\t\t\t},\n\t\t\tdata: {\n\t\t\t\tsecurity: {\n\t\t\t\t\trequiredResource: 'ui_portal_editor',\n\t\t\t\t\tapi: 'Portal'\n\t\t\t\t}\n\t\t\t}\n\t\t}).state('portal.admin.portal-settings', {\n\t\t\turl: '/settings',\n\t\t\ttemplate: '',\n\t\t\tncyBreadcrumb: {\n\t\t\t\tlabel: 'Portal Settings',\n\t\t\t\tparent: 'portal.admin'\n\t\t\t},\n\t\t\tresolve: {\n\t\t\t\tauthorization: ['stateTransitionSecurityCheck', function (stateTransitionSecurityCheck) {\n\t\t\t\t\treturn stateTransitionSecurityCheck.resolveAuthorization('ui_portal_editor', 'Portal');\n\t\t\t\t}]\n\t\t\t},\n\t\t\tdata: {\n\t\t\t\tsecurity: {\n\t\t\t\t\trequiredResource: 'ui_portal_editor',\n\t\t\t\t\tapi: 'Portal'\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\t/** setup forbidden route */\n\t\t$stateProvider.state('portal.403', {\n\t\t\turl: '/403',\n\t\t\ttemplateUrl: appSettings.coreWebRootUrl + 'app/templates/403.html',\n\t\t\tncyBreadcrumb: {\n\t\t\t\tlabel: 'No Access',\n\t\t\t\tparent: 'portal'\n\t\t\t},\n\t\t\ttitle: 'No Access'\n\t\t});\n\t}\n})();","/**\n * nha-branding.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('nhaBranding', nhaBrandingDirective);\n\n\t/** injection */\n\tnhaBrandingDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction nhaBrandingDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\treplace: true,\n\t\t\ttemplateUrl: appSettings.portalWebRootUrl + 'app/directives/nha-branding/nha-branding.directive.html',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-app-logo.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-app-logo.controller', portalAppLogoController);\n\n\t/** setup injection */\n\tportalAppLogoController.$inject = ['portal-link.repository'];\n\n\t/** implementation */\n\tfunction portalAppLogoController(portalLinkRepository) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.loading = false;\n\t\tvm.portalLink = null;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** flip loading flag */\n\t\t\tvm.loading = true;\n\n\t\t\t/** get the corresponding portal links */\n\t\t\tportalLinkRepository.getForSettingKey(vm.settingKey).then(function(portalLink) {\n\t\t\t\t/** set the portal link */\n\t\t\t\tvm.portalLink = portalLink;\n\n\t\t\t\t/** flip loading flag */\n\t\t\t\tvm.loading = false;\n\t\t\t});\n\t\t}\n\t}\n})();","/**\n * portal-app-logo.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalAppLogo', portalAppLogoDirective);\n\n\t/** injection */\n\tportalAppLogoDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction portalAppLogoDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\treplace: true,\n\t\t\ttemplateUrl: appSettings.portalWebRootUrl + 'app/directives/portal-app-logo/portal-app-logo.directive.html',\n\t\t\tcontroller: 'portal-app-logo.controller',\n\t\t\tcontrollerAs: 'portalAppLogoCtrl',\n\t\t\tbindToController: {\n\t\t\t\tsettingKey: '=',\n\t\t\t\tisTraining: '=?'\n\t\t\t},\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-favorites.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-favorites.controller', portalFavoritesController);\n\n\t/** setup injection */\n\tportalFavoritesController.$inject = ['toastr', 'portal-favorites.manager'];\n\n\t/** implementation */\n\tfunction portalFavoritesController(toastr, portalFavoritesManager) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.loading = false;\n\t\tvm.favorites = [];\n\n\t\t/** public methods */\n\t\tvm.reorder = reorder;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** reorder the user favorites */\n\t\tfunction reorder() {\n\t\t\t/** set the order number value */\n\t\t\tangular.forEach(vm.favorites, function(fav, index) {\n\t\t\t\tfav.favoriteOrderNumber = (index + 1);\n\t\t\t});\n\n\t\t\t/** save the reordered extension types */\n\t\t\tportalFavoritesManager.reorderFavorites(vm.favorites).then(function() {\n\t\t\t\t/** show success message */\n\t\t\t\ttoastr.success('Favorites reordered successfully.', 'Save Successful', { positionClass: 'toast-bottom-right' });\n\t\t\t});\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** flip loading flag */\n\t\t\tvm.loading = true;\n\n\t\t\t/** get the user favorites */\n\t\t\tportalFavoritesManager.getFavorites().then(function(favorites) {\n\t\t\t\t/** set favorites */\n\t\t\t\tvm.favorites = favorites;\n\n\t\t\t\t/** set the favorites callback */\n\t\t\t\tportalFavoritesManager.addCallback('portal-favorites', setFavorites);\n\n\t\t\t\t/** flip loading flag */\n\t\t\t\tvm.loading = false;\n\t\t\t});\n\t\t}\n\n\t\t/** callback for favorites */\n\t\tfunction setFavorites(favorites) {\n\t\t\t/** set the favorites */\n\t\t\tvm.favorites = favorites || [];\n\t\t}\n\t}\n})();","/**\n * portal-favorites.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalFavorites', portalFavoritesDirective);\n\n\t/** injection */\n\tportalFavoritesDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction portalFavoritesDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: appSettings.portalWebRootUrl + 'app/directives/portal-favorites/portal-favorites.directive.html',\n\t\t\tcontroller: 'portal-favorites.controller',\n\t\t\tcontrollerAs: 'portalFavoritesCtrl',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-group-list.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-group-list.controller', portalGroupListController);\n\n\t/** setup injection */\n\tportalGroupListController.$inject = ['$timeout', 'portal-link-group.repository', 'portal-link.repository'];\n\n\t/** implementation */\n\tfunction portalGroupListController($timeout, portalLinkGroupRepository, portalLinkRepository) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.loading = false;\n\t\tvm.portalGroups = [];\n\t\tvm.searching = false;\n\t\tvm.searchString = '';\n\t\tvm.searchResults = [];\n\n\t\t/** public methods */\n\t\tvm.searchLinks = searchLinks;\n\t\tvm.closeSearch = closeSearch;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** search for links */\n\t\tfunction searchLinks() {\n\t\t\t/** reset matches */\n\t\t\tvm.searchResults = [];\n\n\t\t\t/** check the length */\n\t\t\tif (vm.searchString.length < 2) return;\n\n\t\t\t/** place search in timeout so that old results don't still display */\n\t\t\t$timeout(function() {\n\t\t\t\t/** flip searching flag */\n\t\t\t\tvm.searching = true;\n\n\t\t\t\t/** load portal links */\n\t\t\t\tportalLinkRepository.search(vm.searchString).then(function(matches) {\n\t\t\t\t\t/** set search results */\n\t\t\t\t\tvm.searchResults = matches;\n\n\t\t\t\t\t/** flip searching flag */\n\t\t\t\t\tvm.searching = false;\n\t\t\t\t});\n\t\t\t}, 100);\n\t\t}\n\n\t\t/** close the search results */\n\t\tfunction closeSearch() {\n\t\t\t/** reset values */\n\t\t\tvm.searchString = '';\n\t\t\tvm.searchResults = [];\n\t\t}\n\n\t\t/** private methods */\n\t\t\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** flip loading flag */\n\t\t\tvm.loading = true;\n\n\t\t\t/** load portal links */\n\t\t\tportalLinkGroupRepository.getForUser().then(function(portalGroups) {\n\t\t\t\t/** set portal groups */\n\t\t\t\tvm.portalGroups = portalGroups.filter(function(g){ return g.linkCount > 0; });\n\n\t\t\t\t/** flip loading flag */\n\t\t\t\tvm.loading = false;\n\t\t\t});\n\t\t}\n\t}\n})();","/**\n * portal-group-list.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalGroupList', portalGroupListDirective);\n\n\t/** injection */\n\tportalGroupListDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction portalGroupListDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: appSettings.portalWebRootUrl + 'app/directives/portal-group-list/portal-group-list.directive.html',\n\t\t\tcontroller: 'portal-group-list.controller',\n\t\t\tcontrollerAs: 'portalGroupListCtrl',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-group.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-group.controller', portalGroupController);\n\n\t/** setup injection */\n\tportalGroupController.$inject = ['$scope', '$window', '$q', '$timeout', 'portal-link-group-link.repository', 'portal-favorites.manager'];\n\n\t/** implementation */\n\tfunction portalGroupController($scope, $window, $q, $timeout, portalLinkGroupLinkRepository, portalFavoritesManager) {\n\t\t/** private properties */\n\t\tvar windowElement = angular.element($window);\n\t\tvar groupLinks = [];\n\t\t\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.loading = false;\n\t\tvm.showLinks = false;\n\t\tvm.groupLinks = [];\n\t\tvm.fixedLinks = false;\n\n\t\t/** public methods */\n\t\tvm.viewLinks = viewLinks;\n\t\tvm.close = close;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** view the links for the group */\n\t\tfunction viewLinks() {\n\t\t\t/** check for preview */\n\t\t\tif (vm.preview) return;\n\n\t\t\t/** flip loading flag */\n\t\t\tvm.loading = true;\n\n\t\t\t/** show the links area */\n\t\t\tvm.showLinks = true;\n\n\t\t\t/** set the onScroll handler */\n\t\t\twindowElement.on('scroll', positionHandler);\n\t\t\t$scope.$on('$destroy', function() {\n\t\t\t\twindowElement.off('scroll', positionHandler);\n\t\t\t});\n\t\t\tpositionHandler();\n\n\t\t\t/** load the links */\n\t\t\tloadLinks().then(function(gl) {\n\t\t\t\t/** set timeout so that links display properly */\n\t\t\t\t$timeout(function() {\n\t\t\t\t\t/** set group links */\n\t\t\t\t\tvm.groupLinks = gl;\n\n\t\t\t\t\t/** flip loading flag */\n\t\t\t\t\tvm.loading = false;\n\t\t\t\t}, 300);\n\t\t\t});\n\t\t}\n\n\t\t/** close the links window */\n\t\tfunction close() {\n\t\t\t/** show the links area */\n\t\t\tvm.showLinks = false;\n\n\t\t\t/** empty links */\n\t\t\tvm.groupLinks = [];\n\n\t\t\t/** destroy the scroll event */\n\t\t\twindowElement.off('scroll', positionHandler);\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** set the favorites callback */\n\t\t\tportalFavoritesManager.addCallback('portal-favorites', adjustFavorites, false, $scope);\n\t\t}\n\n\t\t/** load the related links */\n\t\tfunction loadLinks() {\n\t\t\t/** create a promise */\n\t\t\tvar deferred = $q.defer();\n\n\t\t\t/** check for links */\n\t\t\tif (groupLinks.length > 0) {\n\t\t\t\t/** set the current context */\n\t\t\t\tdeferred.resolve(groupLinks);\n\t\t\t} else {\n\t\t\t\t/** load the links */\n\t\t\t\tportalLinkGroupLinkRepository.getForGroup(vm.group.portalLinkGroupID).then(function(gl) {\n\t\t\t\t\t/** set the group links */\n\t\t\t\t\tgroupLinks = gl;\n\n\t\t\t\t\t/** set the current context */\n\t\t\t\t\tdeferred.resolve(groupLinks);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/** return the promise */\n\t\t\treturn deferred.promise;\n\t\t}\n\n\t\t/** position handler */\n\t\tfunction positionHandler() {\n\t\t\t/** event must fire in scope */\n\t\t\t$timeout(function() {\n\t\t\t\t/** get the scroll position */\n\t\t\t\tvar scrollY = $window.scrollY || $window.pageYOffset;\n\n\t\t\t\t/** check the value */\n\t\t\t\tif (scrollY > 84) vm.fixedLinks = true;\n\t\t\t\telse vm.fixedLinks = false;\n\t\t\t});\n\t\t}\n\n\t\t/** adjust the favorites */\n\t\tfunction adjustFavorites(favorites) {\n\t\t\t/** adjust the group link isFavorite star */\n\t\t\t_.forEach(groupLinks, function(gl) {\n\t\t\t\t/** default the link to isFavorite = false */\n\t\t\t\tgl.portalLink.isFavorite = false;\n\n\t\t\t\t/** find a match in favorites */\n\t\t\t\tvar match = favorites.filter(function(fav){ return fav.portalLinkID === gl.portalLinkID; });\n\t\t\t\tif (match.length > 0) gl.portalLink.isFavorite = true;\n\t\t\t});\n\t\t}\n\t}\n})();","/**\n * portal-group.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalGroup', portalGroupDirective);\n\n\t/** injection */\n\tportalGroupDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction portalGroupDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\treplace: true,\n\t\t\ttemplateUrl: appSettings.portalWebRootUrl + 'app/directives/portal-group/portal-group.directive.html',\n\t\t\tcontroller: 'portal-group.controller',\n\t\t\tcontrollerAs: 'portalGroupCtrl',\n\t\t\tbindToController: {\n\t\t\t\tgroup: '=',\n\t\t\t\tpreview: '=?'\n\t\t\t},\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-launcher.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalLauncher', portalLauncherDirective);\n\n\t/** injection */\n\tportalLauncherDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction portalLauncherDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: appSettings.portalWebRootUrl + 'app/directives/portal-launcher/portal-launcher.directive.html',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-link-list.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-link-list.controller', portalLinkListController);\n\n\t/** setup injection */\n\tportalLinkListController.$inject = ['appSettings', 'portal-link.repository'];\n\n\t/** implementation */\n\tfunction portalLinkListController(appSettings, portalLinkRepository) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.loading = false;\n\t\tvm.searchString = '';\n\t\tvm.portalLinks = [];\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** private methods */\n\t\t\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** flip loading flag */\n\t\t\tvm.loading = true;\n\n\t\t\t/** load portal links */\n\t\t\tportalLinkRepository.getAll().then(function(portalLinks) {\n\t\t\t\t/** set portal links */\n\t\t\t\tvm.portalLinks = portalLinks;\n\n\t\t\t\t/** flip loading flag */\n\t\t\t\tvm.loading = false;\n\t\t\t});\n\t\t}\n\t}\n})();","/**\n * portal-link-list.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalLinkList', portalLinkListDirective);\n\n\t/** injection */\n\tportalLinkListDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction portalLinkListDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: appSettings.portalWebRootUrl + 'app/directives/portal-link-list/portal-link-list.directive.html',\n\t\t\tcontroller: 'portal-link-list.controller',\n\t\t\tcontrollerAs: 'portalLinkListCtrl',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-link.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-link.controller', portalLinkController);\n\n\t/** setup injection */\n\tportalLinkController.$inject = ['$scope', '$sce', 'appSettings', 'portal-favorites.manager'];\n\n\t/** implementation */\n\tfunction portalLinkController($scope, $sce, appSettings, portalFavoritesManager) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\n\t\t/** public methods */\n\t\tvm.toggleFavorite = portalFavoritesManager.toggleFavorite;\n\t\tvm.getUrl = getUrl;\n\t\tvm.getSVG = getSVG;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** get the url */\n\t\tfunction getUrl() {\n\t\t\t/** check for preview */\n\t\t\tif (vm.preview) return '';\n\t\t\treturn vm.link.linkUrl;\n\t\t}\n\n\t\t/** get the svg value */\n\t\tfunction getSVG() {\n\t\t\treturn vm.link.iconSVG ? $sce.trustAsHtml(vm.link.iconSVG) : '';\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** set callback for favorite */\n\t\t\tportalFavoritesManager.addCallback('portal-favorites', toggleFavorite, false, $scope);\n\t\t}\n\n\n\t\t/** toggle the favorite star */\n\t\tfunction toggleFavorite(favorites) {\n\t\t\t/** find a match in favorites */\n\t\t\tvar match = favorites.filter(function(fav){ return fav.portalLinkID === vm.link.portalLinkID; });\n\t\t\tif (match.length > 0) vm.link.isFavorite = true;\n\t\t\telse vm.link.isFavorite = false;\n\t\t}\n\t}\n})();","/**\n * portal-link.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalLink', portalLinkDirective);\n\n\t/** injection */\n\tportalLinkDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction portalLinkDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\treplace: true,\n\t\t\ttemplateUrl: appSettings.portalWebRootUrl + 'app/directives/portal-link/portal-link.directive.html',\n\t\t\tcontroller: 'portal-link.controller',\n\t\t\tcontrollerAs: 'portalLinkCtrl',\n\t\t\tbindToController: {\n\t\t\t\tlink: '=',\n\t\t\t\tsidebar: '=?',\n\t\t\t\tpreview: '=?'\n\t\t\t},\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-mini-launcher.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-mini-launcher.controller', portalMiniLauncherController);\n\n\t/** setup injection */\n\tportalMiniLauncherController.$inject = ['message.manager'];\n\n\t/** implementation */\n\tfunction portalMiniLauncherController(messageManager) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.active = false;\n\n\t\t/** public methods */\n\t\tvm.toggleLauncher = toggleLauncher;\n\t\t\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** show the app launcher */\n\t\tfunction toggleLauncher() {\n\t\t\t/** show the launcher and mask */\n\t\t\tif (vm.active) {\n\t\t\t\tvm.active = false;\n\t\t\t\tmessageManager.setData('message', { 'key': 'module-callout-mask', 'value': { 'visible': false, 'window': null }});\n\t\t\t} else {\n\t\t\t\tvm.active = true;\n\t\t\t\tmessageManager.setData('message', { 'key': 'module-callout-mask', 'value': { 'visible': true, 'window': 'portal-mini-launcher' }});\n\t\t\t}\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** set callbacks */\n\t\t\tmessageManager.addCallback('message', messageReceiver, true);\n\t\t}\n\n\t\t/** watch for messages */\n\t\tfunction messageReceiver(message) {\n\t\t\tif (message.key && message.key === 'module-callout-mask' && (message.value.visible === false || (message.value.visible === true && message.value.window !== 'portal-mini-launcher'))) {\n\t\t\t\tvm.active = false;\n\t\t\t}\n\t\t}\n\t}\n})();","/**\n * portal-mini-launcher.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalMiniLauncher', portalMiniLauncherDirective);\n\n\t/** injection */\n\tportalMiniLauncherDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction portalMiniLauncherDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\treplace: true,\n\t\t\ttemplateUrl: appSettings.portalWebRootUrl + 'app/directives/portal-mini-launcher/portal-mini-launcher.directive.html',\n\t\t\tcontroller: 'portal-mini-launcher.controller',\n\t\t\tcontrollerAs: 'portalMiniLauncherCtrl',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-mini-search.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-mini-search.controller', portalMiniSearchController);\n\n\t/** setup injection */\n\tportalMiniSearchController.$inject = ['message.manager'];\n\n\t/** implementation */\n\tfunction portalMiniSearchController(messageManager) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.active = false;\n\n\t\t/** public methods */\n\t\tvm.toggleSearch = toggleSearch;\n\t\t\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** show the app search */\n\t\tfunction toggleSearch() {\n\t\t\t/** show the search and mask */\n\t\t\tif (vm.active) {\n\t\t\t\tvm.active = false;\n\t\t\t\tmessageManager.setData('message', { 'key': 'module-callout-mask', 'value': { 'visible': false, 'window': null }});\n\t\t\t} else {\n\t\t\t\tvm.active = true;\n\t\t\t\tmessageManager.setData('message', { 'key': 'module-callout-mask', 'value': { 'visible': true, 'window': 'portal-mini-search' } });\n\t\t\t}\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** set callbacks */\n\t\t\tmessageManager.addCallback('message', messageReceiver, true);\n\t\t}\n\n\t\t/** watch for messages */\n\t\tfunction messageReceiver(message) {\n\t\t\tif (message.key && message.key === 'module-callout-mask' && (message.value.visible === false || (message.value.visible === true && message.value.window !== 'portal-mini-search'))) {\n\t\t\t\tvm.active = false;\n\t\t\t}\n\t\t}\n\t}\n})();","/**\n * portal-mini-search.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalMiniSearch', portalMiniSearchDirective);\n\n\t/** injection */\n\tportalMiniSearchDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction portalMiniSearchDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\treplace: true,\n\t\t\ttemplateUrl: appSettings.portalWebRootUrl + 'app/directives/portal-mini-search/portal-mini-search.directive.html',\n\t\t\tcontroller: 'portal-mini-search.controller',\n\t\t\tcontrollerAs: 'portalMiniSearchCtrl',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-search.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-search.controller', portalSearchController);\n\n\t/** setup injection */\n\tportalSearchController.$inject = ['$q', 'portal-search.manager', 'portal-app-context.manager', 'academicYearRepository'];\n\n\t/** implementation */\n\tfunction portalSearchController($q, portalSearchManager, portalAppContextManager, academicYearRepository) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.loading = false;\n\t\tvm.searching = false;\n\t\tvm.loadingMore = false;\n\t\tvm.schoolID = null;\n\t\tvm.currentSearchScope = null;\n\t\tvm.searchOptions = [];\n\t\tvm.searchString = '';\n\t\tvm.currentAcademicYearScope = null;\n\t\tvm.currentAndNextAcademicYearScope = [];\n\t\tvm.academicYears = [];\n\t\tvm.searchResultCount = 0;\n\t\tvm.searchResults = [];\n\t\tvm.searchMessage = '';\n\n\t\t/** private properties */\n\t\tvar schoolIDs = [];\n\t\tvar cancelor = null;\n\n\t\t/** public methods */\n\t\tvm.setSearchScope = setSearchScope;\n\t\tvm.setAcademicYearScope = setAcademicYearScope;\n\t\tvm.search = search;\n\t\tvm.clearSearch = clearSearch;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** set the current search scope */\n\t\tfunction setSearchScope(searchOption) {\n\t\t\tvm.currentSearchScope = searchOption;\n\t\t\tclearSearch();\n\t\t}\n\n\t\t/** set the current academic year scope */\n\t\tfunction setAcademicYearScope(academicYear) {\n\t\t\tvm.currentAcademicYearScope = academicYear;\n\t\t\tclearSearch();\n\t\t}\n\n\t\t/** search for matches to search criteria */\n\t\tfunction search(hideLoader) {\n\t\t\t/** clear the search message */\n\t\t\tvm.searchMessage = '';\n\n\t\t\t/** cancel any current requests */\n\t\t\tif (cancelor !== null) {\n\t\t\t\tcancelor.resolve();\n\t\t\t\tcancelor = null;\n\t\t\t}\n\n\t\t\t/** check the length */\n\t\t\tif (vm.searchString.length < 3) {\n\t\t\t\t/** reset the search results */\n\t\t\t\tvm.searchResults = [];\n\t\t\t\tvm.searching = false;\n\t\t\t\tvm.loadingMore = false;\n\t\t\t\tvm.searchResultCount = 0;\n\n\t\t\t\t/** reset the paging options */\n\t\t\t\tportalSearchManager.resetPagingOptions();\n\t\t\t}\n\n\t\t\t/** check the search string length */\n\t\t\tif (vm.searchString.length > 2) {\n\t\t\t\t/** create cancelor promise */\n\t\t\t\tcancelor = $q.defer();\n\n\t\t\t\t/** clear the search message */\n\t\t\t\tvm.searchMessage = '';\n\n\t\t\t\t/** flip searching flag */\n\t\t\t\tif (!hideLoader) vm.searching = true;\n\t\t\t\tvm.loadingMore = true;\n\n\t\t\t\t/** reset the search results */\n\t\t\t\tif (!hideLoader) vm.searchResults = [];\n\n\t\t\t\t/** get the search method */\n\t\t\t\tvar searchMethod = portalSearchManager.searchStudents;\n\t\t\t\tif (vm.currentSearchScope.type === 'staff') searchMethod = portalSearchManager.searchStaff;\n\t\t\t\tif (vm.currentSearchScope.type === 'parent') searchMethod = portalSearchManager.searchParents;\n\n\t\t\t\t/** execute the search method */\n\t\t\t\tsearchMethod(schoolIDs, vm.currentAcademicYearScope.academicYearID, vm.searchString, cancelor).then(function(results) {\n\t\t\t\t\t/** check for message */\n\t\t\t\t\tif (!results.message) {\n\t\t\t\t\t\t/** sort results by last name */\n\t\t\t\t\t\tresults.items.sort(function(a, b) {\n\t\t\t\t\t\t\t/** create name key */\n\t\t\t\t\t\t\tvar keyA = a.lastName + '_' + a.firstName;\n\t\t\t\t\t\t\tvar keyB = b.lastName + '_' + b.firstName;\n\n\t\t\t\t\t\t\t/** compare */\n\t\t\t\t\t\t\tif (keyA < keyB) return -1;\n\t\t\t\t\t\t\tif (keyA > keyB) return 1;\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t/** set the search results */\n\t\t\t\t\t\tvm.searchResults = results.items;\n\t\t\t\t\t\tvm.searchResultCount = results.count;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/** set the search results to blank array */\n\t\t\t\t\t\tvm.searchResults = [];\n\n\t\t\t\t\t\t/** set the search message */\n\t\t\t\t\t\tvm.searchMessage = results.message;\n\t\t\t\t\t}\n\n\t\t\t\t\t/** flip searching flag */\n\t\t\t\t\tvm.searching = false;\n\t\t\t\t\tvm.loadingMore = false;\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t/** set the search results to blank array */\n\t\t\t\tvm.searchResults = [];\n\n\t\t\t\t/** set the search message */\n\t\t\t\tvm.searchMessage = 'You must enter at least 3 characters';\n\t\t\t}\n\t\t}\n\n\t\t/** clear the search area */\n\t\tfunction clearSearch() {\n\t\t\t/** reset search values */\n\t\t\tvm.searching = false;\n\t\t\tvm.loadingMore = false;\n\t\t\tvm.searchResults = [];\n\t\t\tvm.searchString = '';\n\t\t\tvm.searchMessage = '';\n\t\t\tvm.searchResultCount = 0;\n\n\t\t\t/** reset the paging options */\n\t\t\tportalSearchManager.resetPagingOptions();\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** flip loading flag */\n\t\t\tvm.loading = true;\n\n\t\t\t/** set the search options */\n\t\t\tvm.searchOptions = portalSearchManager.getSearchOptions();\n\t\t\tsetSearchScope(vm.searchOptions[0]);\n\n\t\t\t/** ensure the app context */\n\t\t\tportalAppContextManager.ensurePortalContext().then(function(context) {\n\t\t\t\t/** set the users school ids */\n\t\t\t\tvm.schoolID = context.school.schoolID;\n\t\t\t\tschoolIDs = context.schoolIDs;\n\n\t\t\t\t/** get the academic years */\n\t\t\t\tacademicYearRepository.getAllAcademicYears().then(function(academicYears) {\n\t\t\t\t\t/** set academic years */\n\t\t\t\t\tvm.academicYears = academicYears.reverse();\n\n\t\t\t\t\t/** get the current academic year */\n\t\t\t\t\tvm.currentAcademicYearScope = vm.academicYears.filter(function (ay) {\n\t\t\t\t\t\treturn ay.isCurrent;\n\t\t\t\t\t})[0];\n\n\t\t\t\t\tvm.currentAndNextAcademicYearScope = vm.academicYears.filter(function (ay) {\n\t\t\t\t\t\treturn ay.isCurrent || ay.academicYearID === (vm.currentAcademicYearScope.academicYearID + 1)\n\t\t\t\t\t});\n\n\t\t\t\t\t/** check for teacher */\n\t\t\t\t\tif (!context.roles.contains('Previous AY Student Search')) {\n\t\t\t\t\t\tvm.academicYears = vm.currentAndNextAcademicYearScope;\n\t\t\t\t\t}\n\n\t\t\t\t\t/** flip loading flag */\n\t\t\t\t\tvm.loading = false;\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}\n})();","/**\n * portal-search.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalSearch', portalSearchDirective);\n\n\t/** injection */\n\tportalSearchDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction portalSearchDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: appSettings.portalWebRootUrl + 'app/directives/portal-search/portal-search.directive.html',\n\t\t\tcontroller: 'portal-search.controller',\n\t\t\tcontrollerAs: 'portalSearchCtrl',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-search.manager\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** add the service */\n\tangular.module('nha.portal').service('portal-search.manager', portalSearchManager);\n\n\t/** injection */\n\tportalSearchManager.$inject = ['$q', '$http', 'appSettings'];\n\n\t/** implementation */\n\tfunction portalSearchManager($q, $http, appSettings) {\n\t\t/** capture service object */\n\t\tvar service = this;\n\n\t\t/** private properties */\n\t\tvar searchOptions = [\n\t\t\t{ 'type': 'student', 'name': 'Students', 'placeholder': 'Enter Student Name, ID, or type \"Birthdays\" to see student birthdays' },\n\t\t\t{ 'type': 'staff', 'name': 'Staff', 'placeholder': 'Enter Staff Member Name' },\n\t\t\t{ 'type': 'parent', 'name': 'Parents', 'placeholder': 'Enter Parent Name or Phone' }\n\t\t];\n\t\tvar pageSize = 20;\n\t\tvar loadedCount = 0;\n\t\tvar moreExist = true;\n\t\tvar currentResults = [];\n\t\tvar currentCount = 0;\n\t\tvar currentSearchCriteria = '';\n\n\t\t/** public methods */\n\t\tservice.getSearchOptions = getSearchOptions;\n\t\tservice.resetPagingOptions = resetPagingOptions;\n\t\tservice.searchStudents = searchStudents;\n\t\tservice.searchParents = searchParents;\n\t\tservice.searchStaff = searchStaff;\n\n\t\t/** public method implementations */\n\n\t\t/** return the search options */\n\t\tfunction getSearchOptions() {\n\t\t\tsearchOptions[0].active = true;\n\t\t\treturn searchOptions;\n\t\t}\n\n\t\t/** reset the paging options */\n\t\tfunction resetPagingOptions() {\n\t\t\tpageSize = 20;\n\t\t\tloadedCount = 0;\n\t\t\tmoreExist = true;\n\t\t\tcurrentResults = [];\n\t\t\tcurrentCount = 0;\n\t\t\tcurrentSearchCriteria = '';\n\t\t}\n\n\t\t/** search students */\n\t\tfunction searchStudents(schoolIDs, academicYearID, searchCriteria, cancelor) {\n\t\t\t/** create a promise */\n\t\t\tvar deferred = $q.defer();\n\n\t\t\t/** check the search criteria */\n\t\t\tif (currentSearchCriteria !== searchCriteria) {\n\t\t\t\t/** reset the paging options */\n\t\t\t\tresetPagingOptions();\n\t\t\t}\n\n\t\t\t/** set the current search criteria */\n\t\t\tcurrentSearchCriteria = searchCriteria;\n\n\t\t\t/** get the params */\n\t\t\tvar params = getParams(schoolIDs, academicYearID);\n\t\t\tparams.searchText = searchCriteria;\n\t\t\tparams.skip = loadedCount;\n\t\t\tparams.take = pageSize;\n\n\t\t\t/** check for moreExist */\n\t\t\tif (!moreExist) {\n\t\t\t\t/** return last loaded data */\n\t\t\t\tdeferred.resolve({ 'count': currentCount, 'items': currentResults });\n\t\t\t\treturn deferred.promise;\n\t\t\t}\n\n\t\t\t/** make the request */\n\t\t\t$http.get(appSettings.portalServicesRootUrl + 'studentsearch', { 'params': params, 'cache': true, 'timeout': cancelor.promise }).then(function(results) {\n\t\t\t\t/** manipulate parent results */\n\t\t\t\t_.forEach(results.data.items, function(s) {\n\t\t\t\t\t/** adjust the grade level name */\n\t\t\t\t\ts.gradeLevelNameAdjusted = adjustGradeLevelName(s.gradeLevelName);\n\t\t\t\t});\n\n\t\t\t\t/** set paging variables */\n\t\t\t\tloadedCount += results.data.items.length;\n\t\t\t\tif (results.data.items.length < pageSize) moreExist = false;\n\n\t\t\t\t/** set the current context */\n\t\t\t\tcurrentResults = currentResults.concat(results.data.items);\n\t\t\t\tcurrentCount = results.data.count;\n\t\t\t\tdeferred.resolve({ 'count': currentCount, 'items': currentResults });\n\t\t\t});\n\n\t\t\t/** return the promise */\n\t\t\treturn deferred.promise;\n\t\t}\n\n\t\t/** search staff members */\n\t\tfunction searchStaff(schoolIDs, academicYearID, searchCriteria, cancelor) {\n\t\t\t/** create a promise */\n\t\t\tvar deferred = $q.defer();\n\n\t\t\t/** check the search criteria */\n\t\t\tif (currentSearchCriteria !== searchCriteria) {\n\t\t\t\t/** reset the paging options */\n\t\t\t\tresetPagingOptions();\n\t\t\t}\n\n\t\t\t/** set the current search criteria */\n\t\t\tcurrentSearchCriteria = searchCriteria;\n\n\t\t\t/** get the params */\n\t\t\tvar params = getParams(schoolIDs, academicYearID);\n\n\t\t\t/** search by name */\n\t\t\tparams.staffName = currentSearchCriteria;\n\n\t\t\t/** add additional odata params */\n\t\t\tparams.orderby = 'LastName, FirstName';\n\t\t\tparams.top = pageSize;\n\t\t\tparams.skip = loadedCount;\n\n\t\t\t/** check for moreExist */\n\t\t\tif (!moreExist) {\n\t\t\t\t/** return last loaded data */\n\t\t\t\tdeferred.resolve({ 'count': currentCount, 'items': currentResults });\n\t\t\t\treturn deferred.promise;\n\t\t\t}\n\n\t\t\t/** make the request */\n\t\t\t$http.get(appSettings.portalServicesRootUrl + 'staffsearch', { 'params': params, 'cache': true, 'timeout': cancelor.promise }).then(function(results) {\n\t\t\t\t/** set paging variables */\n\t\t\t\tloadedCount += results.data.items.length;\n\t\t\t\tif (results.data.items.length < pageSize) moreExist = false;\n\n\t\t\t\t/** set the current context */\n\t\t\t\tcurrentResults = currentResults.concat(results.data.items);\n\t\t\t\tcurrentCount = results.data.count;\n\t\t\t\tdeferred.resolve({ 'count': currentCount, 'items': currentResults });\n\t\t\t});\n\n\t\t\t/** return the promise */\n\t\t\treturn deferred.promise;\n\t\t}\n\n\t\t/** search parents */\n\t\tfunction searchParents(schoolIDs, academicYearID, searchCriteria, cancelor) {\n\t\t\t/** create a promise */\n\t\t\tvar deferred = $q.defer();\n\n\t\t\t/** check the search criteria */\n\t\t\tif (currentSearchCriteria !== searchCriteria) {\n\t\t\t\t/** reset the paging options */\n\t\t\t\tresetPagingOptions();\n\t\t\t}\n\n\t\t\t/** set the current search criteria */\n\t\t\tcurrentSearchCriteria = searchCriteria;\n\n\t\t\t/** get the params */\n\t\t\tvar params = getParams(schoolIDs, academicYearID);\n\n\t\t\t/** try to parse out a phone number */\n\t\t\tvar phoneNumber = parseNumber(currentSearchCriteria);\n\t\t\tif (phoneNumber) {\n\t\t\t\t/** check the phone number length */\n\t\t\t\tif (phoneNumber.length < 5) {\n\t\t\t\t\t/** create a promise */\n\t\t\t\t\tdeferred.resolve({ message: 'Phone numbers require at least 5 digits' });\n\t\t\t\t\treturn deferred.promise;\n\t\t\t\t}\n\n\t\t\t\t/** add the phone number param */\n\t\t\t\tparams.phoneNumber = phoneNumber;\n\t\t\t} else {\n\t\t\t\t/** search by name */\n\t\t\t\tparams.parentName = currentSearchCriteria;\n\t\t\t}\n\n\t\t\t/** add additional odata params */\n\t\t\tparams.$orderby = 'LastName, FirstName';\n\t\t\tparams.$inlinecount = 'allpages';\n\t\t\tparams.$top = pageSize;\n\t\t\tparams.$skip = loadedCount;\n\n\t\t\t/** check for moreExist */\n\t\t\tif (!moreExist) {\n\t\t\t\t/** return last loaded data */\n\t\t\t\tdeferred.resolve({ 'count': currentCount, 'items': currentResults });\n\t\t\t\treturn deferred.promise;\n\t\t\t}\n\n\t\t\t/** make the request */\n\t\t\t$http.get(appSettings.portalServicesRootUrl + 'parentsearch', { 'params': params, 'cache': true, 'timeout': cancelor.promise }).then(function(results) {\n\t\t\t\t/** manipulate parent results */\n\t\t\t\t_.forEach(results.data.items, function(p) {\n\t\t\t\t\t/** set opt out values */\n\t\t\t\t\tp.optOut = false;\n\t\t\t\t\tif (p.doNotCall) p.optOut = true;\n\t\t\t\t\tif (p.doNotText) p.optOut = true;\n\t\t\t\t\tif (p.doNotEmail) p.optOut = true;\n\t\t\t\t\tif (p.doNotMail) p.optOut = true;\n\n\t\t\t\t\t/** order the phone numbers by type */\n\t\t\t\t\tp.phoneNumbers.sort(function(a, b) {\n\t\t\t\t\t\tif (a.type < b.type) return -1;\n\t\t\t\t\t\tif (a.type > b.type) return 1;\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t});\n\n\t\t\t\t\t/** add students object */\n\t\t\t\t\tp.studentGroups = {};\n\n\t\t\t\t\t/** cycle through students */\n\t\t\t\t\t_.forEach(p.students, function(s) {\n\t\t\t\t\t\t/** adjust the grade level name */\n\t\t\t\t\t\ts.gradeLevelNameAdjusted = adjustGradeLevelName(s.gradeLevelName, s.gradeLevelNameDesc);\n\n\t\t\t\t\t\t/** check for student group */\n\t\t\t\t\t\tif (!p.studentGroups[s.studentID]) p.studentGroups[s.studentID] = {\n\t\t\t\t\t\t\t'studentID': s.studentID,\n\t\t\t\t\t\t\t'firstName': s.firstName,\n\t\t\t\t\t\t\t'lastName': s.lastName,\n\t\t\t\t\t\t\t'studentInSchool': []\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\t/** add the student record */\n\t\t\t\t\t\tp.studentGroups[s.studentID].studentInSchool.push(s);\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\t/** set paging variables */\n\t\t\t\tloadedCount += results.data.items.length;\n\t\t\t\tif (results.data.items.length < pageSize) moreExist = false;\n\n\t\t\t\t/** set the current context */\n\t\t\t\tcurrentResults = currentResults.concat(results.data.items);\n\t\t\t\tcurrentCount = results.data.count;\n\t\t\t\tdeferred.resolve({ 'count': currentCount, 'items': currentResults });\n\t\t\t});\n\n\t\t\t/** return the promise */\n\t\t\treturn deferred.promise;\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** get base parameters */\n\t\tfunction getParams(schoolIDs, academicYearID) {\n\t\t\t/** setup params */\n\t\t\tvar params = {\n\t\t\t\t'academicYearID': academicYearID\n\t\t\t};\n\n\t\t\t/** parse integers out of school ids */\n\t\t\tschoolIDs = _.map(schoolIDs, _.parseInt);\n\t\t\tif (!_.includes(schoolIDs, 0)) {\n\t\t\t\tparams.schoolIDs = schoolIDs;\n\t\t\t}\n\n\t\t\t/** return the params */\n\t\t\treturn params;\n\t\t}\n\n\t\t/** parse a number from the string */\n\t\tfunction parseNumber(n) {\n\t\t\tvar numArr = n.match(/\\d/g);\n\t\t\treturn numArr ? numArr.join('') : null;\n\t\t}\n\n\t\t/** adjust the grade level name */\n\t\tfunction adjustGradeLevelName(gradeLevelName) {\n\t\t\tif (gradeLevelName === 'K') return 'Kindergarten';\n\t\t\tif (gradeLevelName === '1') return gradeLevelName + 'st Grade';\n\t\t\tif (gradeLevelName === '2') return gradeLevelName + 'nd Grade';\n\t\t\tif (gradeLevelName === '3') return gradeLevelName + 'rd Grade';\n\t\t\tif (['4', '5', '6', '7', '8'].contains(gradeLevelName)) return gradeLevelName + 'th Grade';\n\t\t\treturn gradeLevelName;\n\t\t}\n\n\t\t/** return the service */\n\t\treturn service;\n\t}\n})();","/**\n * search-result.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('search-result.controller', searchResultController);\n\n\t/** setup injection */\n\tsearchResultController.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction searchResultController(appSettings) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.studentUrl = '';\n\t\tvm.staffUrl = '';\n\t\tvm.parentUrl = '';\n\n\t\t/** public methods */\n\t\tvm.adjustStudentUrl = adjustStudentUrl;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** adjust the student url */\n\t\tfunction adjustStudentUrl(url, id) {\n\t\t\treturn url.replace('{id}', id);\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** set urls */\n\t\t\tvm.studentUrl = appSettings.studentManagementWebRootUrl + '{id}/demographics/information';\n\t\t\tvm.staffUrl = appSettings.staffManagementWebRootUrl + 'staff-record/' + vm.result.staffID;\n\t\t\tvm.parentUrl = appSettings.studentManagementWebRootUrl + 'guardian/' + vm.result.guardianID + '/' + vm.academicYearId + '/' + vm.schoolId + '/guardian/overview';\n\n\t\t\t/** check for student and adjust */\n\t\t\tif (vm.type === 'student') {\n\t\t\t\tvm.studentUrl = adjustStudentUrl(vm.studentUrl, vm.result.studentInSchoolID);\n\t\t\t}\n\t\t}\n\t}\n})();","/**\n * search-result.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('searchResult', searchResultDirective);\n\n\t/** injection */\n\tsearchResultDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction searchResultDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: appSettings.portalWebRootUrl + 'app/directives/portal-search/search-result/search-result.directive.html',\n\t\t\tcontroller: 'search-result.controller',\n\t\t\tcontrollerAs: 'searchResultCtrl',\n\t\t\tbindToController: {\n\t\t\t\tresult: '=',\n\t\t\t\ttype: '=',\n\t\t\t\tschoolId: '=',\n\t\t\t\tacademicYearId: '='\n\t\t\t},\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-sidebar.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-sidebar.controller', portalSidebarController);\n\n\t/** setup injection */\n\tportalSidebarController.$inject = ['appSettings', 'portal-quick-link.repository', 'portal-favorites.manager'];\n\n\t/** implementation */\n\tfunction portalSidebarController(appSettings, portalQuickLinkRepository, portalFavoritesManager) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.loading = false;\n\t\tvm.quickLinksVisible = true;\n\t\tvm.favoritesVisible = true;\n\t\tvm.quickLinks = [];\n\t\tvm.favorites = [];\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** flip loading flag */\n\t\t\tvm.loading = true;\n\n\t\t\t/** setup callbacks */\n\t\t\tportalFavoritesManager.addCallback('portal-favorites', setFavorites);\n\n\t\t\t/** get the quick links */\n\t\t\tportalQuickLinkRepository.getAll({ 'filter': { 'PortalLink/IsEnabled': true } }).then(function(quickLinks) {\n\t\t\t\t/** set quick links */\n\t\t\t\tvm.quickLinks = quickLinks;\n\n\t\t\t\t/** flip loading flag */\n\t\t\t\tvm.loading = false;\n\t\t\t});\n\n\t\t}\n\n\t\t/** callback for favorites */\n\t\tfunction setFavorites(favorites) {\n\t\t\t/** set the favorites */\n\t\t\tvm.favorites = favorites || [];\n\t\t}\n\t}\n})();","/**\n * portal-sidebar.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalSidebar', portalSidebarDirective);\n\n\t/** injection */\n\tportalSidebarDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction portalSidebarDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: appSettings.portalWebRootUrl + 'app/directives/portal-sidebar/portal-sidebar.directive.html',\n\t\t\tcontroller: 'portal-sidebar.controller',\n\t\t\tcontrollerAs: 'portalSidebarCtrl',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * strip-line-breaks.filter\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add filter */\n\tangular.module('nha.portal').filter('stripLineBreaks', stripLineBreaks);\n\n\t/** implementation */\n\tfunction stripLineBreaks() {\n\t\treturn function(text) {\n\t\t\treturn text ? String(text).replace('
', ' ') : '';\n\t\t};\n\t}\n})();","/**\n * portal-app-context.manager\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** add manager */\n\tangular.module('nha.portal').service('portal-app-context.manager', portalAppContextManager);\n\n\t/** setup inject */\n\tportalAppContextManager.$inject = ['$q', '$state', '$interval', 'ipCookie', 'userContextService', 'appContextFactory'];\n\n\t/** implement the manager */\n\tfunction portalAppContextManager($q, $state, $interval, ipCookie, userContextService, appContextFactory) {\n\t\t/** instantiate the context manager */\n\t\tvar contextManager = new appContextFactory(null, [loadSchoolFromSelector]);\n\n\t\t/** private properties */\n\t\tvar appContextModel = contextManager.getContext();\n\n\t\t/** public methods */\n\t\tcontextManager.ensurePortalContext = ensurePortalContext;\n\t\tcontextManager.resetContext = resetContext;\n\t\tcontextManager.setBreadcrumbLabel = setBreadcrumbLabel;\n\n\t\t/** add load app context */\n\t\tfunction ensurePortalContext() {\n\t\t\t/** create a promise */\n\t\t\tvar deferred = $q.defer();\n\n\t\t\t/** check for context */\n\t\t\tif (appContextModel.school === null || !appContextModel.roles) {\n\t\t\t\t/** run the ensure app context */\n\t\t\t\tcontextManager.ensureAppContext().then(function(context) {\n\t\t\t\t\t/** set the current context */\n\t\t\t\t\tdeferred.resolve(context);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t/** resolve with current context */\n\t\t\t\tdeferred.resolve(appContextModel);\n\t\t\t}\n\n\t\t\t/** return the promise */\n\t\t\treturn deferred.promise;\n\t\t}\n\n\t\t/** reset the context */\n\t\tfunction resetContext() {\n\t\t\t/** clear the context and reset */\n\t\t\t_.forIn(appContextModel, function(value, key) {\n\t\t\t\tappContextModel[key] = null;\n\t\t\t});\n\n\t\t\t/** reload the context */\n\t\t\treturn ensurePortalContext();\n\t\t}\n\n\t\t/** set a state's breadcrumb label */\n\t\tfunction setBreadcrumbLabel(stateName, value) {\n\t\t\t/** get the state config */\n\t\t\tvar config = $state.get(stateName);\n\t\t\tif (config && config.ncyBreadcrumb) {\n\t\t\t\tif (config.ncyBreadcrumb.label !== undefined) config.ncyBreadcrumb.label = value;\n\t\t\t\tif (config.ncyBreadcrumbLabel !== undefined) config.ncyBreadcrumbLabel = value;\n\t\t\t}\n\t\t}\n\n\t\t/** return the context manager */\n\t\treturn contextManager;\n\n\t\t/** private methods */\n\n\t\t/** load the school from the school selector */\n\t\tfunction loadSchoolFromSelector() {\n\t\t\t/** create the promise */\n\t\t\tvar deferred = $q.defer();\n\n\t\t\t/** state param not set so look for the cookie */\n\t\t\tuserContextService.ensureUserContext().then(function(context) {\n\t\t\t\t/** we need to wait for the school cookie to be set */\n\t\t\t\tvar interval = $interval(function() {\n\t\t\t\t\t/** attempt to get the cookie */\n\t\t\t\t\tvar defaultSchoolCookieName = 'nha.core.user-default-school.' + context['http://schemas.mynha.com/Savyint/UserID'];\n\t\t\t\t\tvar defaultSchool = ipCookie(defaultSchoolCookieName) !== null ? ipCookie(defaultSchoolCookieName) : null;\n\n\t\t\t\t\t/** has school been set */\n\t\t\t\t\tif (defaultSchool && defaultSchool !== null) {\n\t\t\t\t\t\t/** cancel the interval */\n\t\t\t\t\t\t$interval.cancel(interval);\n\t\t\t\t\t\tinterval = undefined;\n\n\t\t\t\t\t\t/** set the user roles */\n\t\t\t\t\t\tappContextModel.roles = context.role;\n\n\t\t\t\t\t\t/** set the app context school */\n\t\t\t\t\t\tappContextModel.school = defaultSchool;\n\n\t\t\t\t\t\t/** set the staff information */\n\t\t\t\t\t\tappContextModel.staffID = parseInt(context['http://schemas.mynha.com/SIS/Core/StaffID']);\n\t\t\t\t\t\tappContextModel.staffName = context.commonname;\n\n\t\t\t\t\t\t/** get the users schools */\n\t\t\t\t\t\tvar usersSchools = userContextService.getUserContext()[\"http://schemas.mynha.com/ILM/SchoolID\"];\n\t\t\t\t\t\tappContextModel.schoolIDs = (_.isArray(usersSchools) ? usersSchools : [usersSchools]);\n\n\t\t\t\t\t\t/** resolve the promise */\n\t\t\t\t\t\tdeferred.resolve();\n\t\t\t\t\t}\n\t\t\t\t}, 100);\n\t\t\t});\n\n\t\t\t/** return the promise */\n\t\t\treturn deferred.promise;\n\t\t}\n\t}\n})();","/**\n * portal-favorites.manager\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** add model */\n\tangular.module('nha.portal').service('portal-favorites.manager', portalFavoritesManager);\n\n\t/** setup injection */\n\tportalFavoritesManager.$inject = ['$q', 'pub-sub.factory', 'staff-favorite.repository'];\n\n\t/** implement the model */\n\tfunction portalFavoritesManager($q, pubSubFactory, staffFavoriteRepository) {\n\t\t/** create pub sub manager */\n\t\tvar pubSubManager = new pubSubFactory(['portal-favorites'], 'memory', 'portal');\n\n\t\t/** public methods */\n\t\tpubSubManager.getFavorites = getFavorites;\n\t\tpubSubManager.toggleFavorite = toggleFavorite;\n\t\tpubSubManager.reorderFavorites = reorderFavorites;\n\n\t\t/** return the pub sub */\n\t\treturn pubSubManager;\n\n\t\t/** public method implementations */\n\n\t\t/** retrieve the users favorites */\n\t\tfunction getFavorites() {\n\t\t\t/** create a promise */\n\t\t\tvar deferred = $q.defer();\n\n\t\t\t/** check for favorites data */\n\t\t\tvar favorites = pubSubManager.getData('portal-favorites');\n\t\t\tif (favorites !== null) {\n\t\t\t\t/** resolve with favorites */\n\t\t\t\tdeferred.resolve(favorites);\n\t\t\t} else {\n\t\t\t\t/** request favorites */\n\t\t\t\tstaffFavoriteRepository.getForUser().then(function(favorites) {\n\t\t\t\t\t/** set favorites */\n\t\t\t\t\tpubSubManager.setData('portal-favorites', favorites);\n\n\t\t\t\t\t/** resolve with favorites */\n\t\t\t\t\tdeferred.resolve(favorites);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/** return the promise */\n\t\t\treturn deferred.promise;\n\t\t}\n\n\t\t/** favorite a link */\n\t\tfunction toggleFavorite(link) {\n\t\t\t/** create a promise */\n\t\t\tvar deferred = $q.defer();\n\n\t\t\t/** check the favorite flag */\n\t\t\tif (link.isFavorite) {\n\t\t\t\t/** delete the favorite */\n\t\t\t\tstaffFavoriteRepository.deleteForUser(link.portalLinkID).then(function() {\n\t\t\t\t\t/** toggle the isFavorite value */\n\t\t\t\t\tlink.isFavorite = false;\n\t\t\t\t\tremoveFavorite(link, deferred);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t/** save the favorite */\n\t\t\t\tstaffFavoriteRepository.post({ 'portalLinkID': link.portalLinkID }).then(function(favorite) {\n\t\t\t\t\t/** toggle the isFavorite value */\n\t\t\t\t\tlink.favoriteOrderNumber = favorite.orderNumber;\n\t\t\t\t\tlink.isFavorite = true;\n\t\t\t\t\taddFavorite(link, deferred);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/** return the promise */\n\t\t\treturn deferred.promise;\n\t\t}\n\n\t\t/** reorder the favorites */\n\t\tfunction reorderFavorites(favorites) {\n\t\t\t/** create a promise */\n\t\t\tvar deferred = $q.defer();\n\n\t\t\t/** delete the favorite */\n\t\t\tstaffFavoriteRepository.reorder(favorites).then(function() {\n\t\t\t\t/** set the new favorites */\n\t\t\t\tpubSubManager.setData('portal-favorites', favorites);\n\n\t\t\t\t/** resolve with favorites */\n\t\t\t\tdeferred.resolve(favorites);\n\t\t\t});\n\n\t\t\t/** return the promise */\n\t\t\treturn deferred.promise;\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** add a favorite */\n\t\tfunction addFavorite(link, deferred) {\n\t\t\t/** get the favorites and add one */\n\t\t\tgetFavorites().then(function(favorites) {\n\t\t\t\t/** add a favorite */\n\t\t\t\tfavorites.push(link);\n\n\t\t\t\t/** set the new favorites */\n\t\t\t\tpubSubManager.setData('portal-favorites', favorites);\n\n\t\t\t\t/** resolve with favorites */\n\t\t\t\tdeferred.resolve(favorites);\n\t\t\t});\n\t\t}\n\n\t\t/** remove a favorite */\n\t\tfunction removeFavorite(link, deferred) {\n\t\t\t/** get the favorites and add one */\n\t\t\tgetFavorites().then(function(favorites) {\n\t\t\t\t/** remove the favorite */\n\t\t\t\t_.remove(favorites, function(fav) {\n\t\t\t\t\treturn fav.portalLinkID === link.portalLinkID;\n\t\t\t\t});\n\n\t\t\t\t/** set the new favorites */\n\t\t\t\tpubSubManager.setData('portal-favorites', favorites);\n\n\t\t\t\t/** resolve with favorites */\n\t\t\t\tdeferred.resolve(favorites);\n\t\t\t});\n\t\t}\n\t}\n})();","/**\n * group-modal.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('group-modal.controller', groupModalController);\n\n\t/** setup injection */\n\tgroupModalController.$inject = ['$uibModalInstance', '$timeout', 'toastr', 'portal-link-group.repository', 'portal-link-group-link.repository', 'portal-link.repository', 'color.repository', 'portalGroup', 'parentInit'];\n\n\t/** implementation */\n\tfunction groupModalController($uibModalInstance, $timeout, toastr, portalLinkGroupRepo, portalLinkGroupLinkRepo, portalLinkRepository, colorRepo, portalGroup, parentInit) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.saving = false;\n\t\tvm.isNew = portalGroup ? false : true;\n\t\tvm.original = portalGroup || createPortalLinkGroup();\n\t\tvm.portalGroup = angular.copy(vm.original);\n\t\tvm.tab = 'group-info-tab';\n\t\tvm.groupLinks = [];\n\t\tvm.colors = [];\n\t\tvm.searching = false;\n\t\tvm.searchString = '';\n\t\tvm.searchResults = [];\n\n\t\t/** public methods */\n\t\tvm.save = save;\n\t\tvm.activate = activate;\n\t\tvm.remove = remove;\n\t\tvm.reorder = reorder;\n\t\tvm.searchLinks = searchLinks;\n\t\tvm.addLink = addLink;\n\t\tvm.removeLink = removeLink;\n\t\tvm.closeSearch = closeSearch;\n\t\tvm.close = close;\n\t\tvm.cancel = cancel;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** save the group */\n\t\tfunction save() {\n\t\t\t/** flip saving flag */\n\t\t\tvm.saving = true;\n\n\t\t\t/** map values from source to original */\n\t\t\t_.merge(vm.original, vm.portalGroup);\n\n\t\t\t/** send the request to activate/deactivate */\n\t\t\tportalLinkGroupRepo.save(vm.original, (vm.original.portalLinkGroupID !== 0 ? vm.original.portalLinkGroupID : undefined)).then(function(portalLinkGroup) {\n\t\t\t\t/** show the success message */\n\t\t\t\tswal({\n\t\t\t\t\t'title': 'Save Complete',\n\t\t\t\t\t'text': 'The processing has completed. The group was saved successfully.',\n\t\t\t\t\t'type': 'success'\n\t\t\t\t}, function() {\n\t\t\t\t\t/** flip saving flag */\n\t\t\t\t\tvm.saving = false;\n\n\t\t\t\t\t/** set isNew to false */\n\t\t\t\t\tvm.isNew = false;\n\n\t\t\t\t\t/** set original and copy */\n\t\t\t\t\tif (portalLinkGroup) {\n\t\t\t\t\t\tvm.original = portalLinkGroup;\n\t\t\t\t\t\tvm.portalGroup = angular.copy(vm.original);\n\t\t\t\t\t}\n\n\t\t\t\t\t/** load group links */\n\t\t\t\t\tloadLinks();\n\n\t\t\t\t\t/** reset the users groups */\n\t\t\t\t\tportalLinkGroupRepo.resetGroups();\n\n\t\t\t\t\t/** reinitialize the parent */\n\t\t\t\t\tparentInit();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t/** activate/deactivate a group */\n\t\tfunction activate(active) {\n\t\t\t/** set the isEnabled flag */\n\t\t\tvm.original.isEnabled = active;\n\n\t\t\t/** flip saving flag */\n\t\t\tvm.saving = true;\n\n\t\t\t/** send the request to activate/deactivate */\n\t\t\tportalLinkGroupRepo.put(vm.original, vm.original.portalLinkGroupID).then(function() {\n\t\t\t\t/** flip the isEnabled flag on the copy */\n\t\t\t\tvm.portalGroup.isEnabled = vm.original.isEnabled;\n\n\t\t\t\t/** flip saving flag */\n\t\t\t\tvm.saving = false;\n\n\t\t\t\t/** show the success message */\n\t\t\t\tswal({\n\t\t\t\t\t'title': 'Save Complete',\n\t\t\t\t\t'text': 'The processing has completed. The group was saved successfully.',\n\t\t\t\t\t'type': 'success'\n\t\t\t\t}, function() {\n\t\t\t\t\t/** reset the users groups */\n\t\t\t\t\tportalLinkGroupRepo.resetGroups();\n\n\t\t\t\t\t/** reinitialize the parent */\n\t\t\t\t\tparentInit();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t/** remove the group */\n\t\tfunction remove() {\n\t\t\t/** show swal confirmation window */\n\t\t\tswal({\n\t\t\t\t'title': 'Are you sure you want to delete this group?',\n\t\t\t\t'type': 'warning',\n\t\t\t\t'showCancelButton': true,\n\t\t\t\t'confirmButtonText': 'Yes, Delete It!',\n\t\t\t\t'closeOnConfirm': false\n\t\t\t}, function(isConfirm) {\n\t\t\t\t/** check the isConfirm flag */\n\t\t\t\tif (isConfirm) {\n\t\t\t\t\t/** flip saving flag */\n\t\t\t\t\tvm.saving = true;\n\n\t\t\t\t\t/** send the request to activate/deactivate */\n\t\t\t\t\tportalLinkGroupRepo.remove(portalGroup.portalLinkGroupID).then(function() {\n\t\t\t\t\t\t/** flip saving flag */\n\t\t\t\t\t\tvm.saving = false;\n\n\t\t\t\t\t\t/** show the success message */\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t'title': 'Delete Complete',\n\t\t\t\t\t\t\t'text': 'The processing has completed. The group was deleted successfully.',\n\t\t\t\t\t\t\t'type': 'success'\n\t\t\t\t\t\t}, function() {\n\t\t\t\t\t\t\t/** reset the users groups */\n\t\t\t\t\t\t\tportalLinkGroupRepo.resetGroups();\n\n\t\t\t\t\t\t\t/** reinitialize the parent */\n\t\t\t\t\t\t\tparentInit();\n\n\t\t\t\t\t\t\t/** close modal */\n\t\t\t\t\t\t\tclose();\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t/** reorder the related links */\n\t\tfunction reorder() {\n\t\t\t/** set the order number value */\n\t\t\tangular.forEach(vm.groupLinks, function(gl, index) {\n\t\t\t\tgl.orderNumber = (index + 1);\n\t\t\t});\n\n\t\t\t/** save groups */\n\t\t\tportalLinkGroupLinkRepo.reorder(vm.groupLinks).then(function() {\n\t\t\t\t/** show success message */\n\t\t\t\ttoastr.success('Group Links reordered successfully.', 'Save Successful', { positionClass: 'toast-bottom-right' });\n\t\t\t});\n\t\t}\n\n\t\t/** search for links */\n\t\tfunction searchLinks() {\n\t\t\t/** reset matches */\n\t\t\tvm.searchResults = [];\n\n\t\t\t/** check the length */\n\t\t\tif (vm.searchString.length < 2) return;\n\n\t\t\t/** place search in timeout so that old results don't still display */\n\t\t\t$timeout(function() {\n\t\t\t\t/** flip searching flag */\n\t\t\t\tvm.searching = true;\n\n\t\t\t\t/** load portal links */\n\t\t\t\tportalLinkRepository.search(vm.searchString).then(function(matches) {\n\t\t\t\t\t/** set search results */\n\t\t\t\t\tvm.searchResults = matches;\n\n\t\t\t\t\t/** set the active flag */\n\t\t\t\t\ttoggleSearchResults();\n\n\t\t\t\t\t/** flip searching flag */\n\t\t\t\t\tvm.searching = false;\n\t\t\t\t});\n\t\t\t}, 100);\n\t\t}\n\n\t\t/** add the portal link */\n\t\tfunction addLink(portalLinkID) {\n\t\t\t/** flip saving flag */\n\t\t\tvm.saving = true;\n\n\t\t\t/** get the order number */\n\t\t\tvar orderNumber = 0;\n\t\t\tvar lastGroupLink = _.last(vm.groupLinks);\n\t\t\tif (lastGroupLink !== undefined) {\n\t\t\t\torderNumber = lastGroupLink.orderNumber + 1;\n\t\t\t}\n\n\t\t\t/** create the object */\n\t\t\tvar portalLinkGroupLink = {\n\t\t\t\t'portalLinkGroupLinkID': 0,\n\t\t\t\t'portalLinkID': portalLinkID,\n\t\t\t\t'portalLinkGroupID': vm.portalGroup.portalLinkGroupID,\n\t\t\t\t'orderNumber': orderNumber\n\t\t\t};\n\n\t\t\t/** send the request to activate/deactivate */\n\t\t\tportalLinkGroupLinkRepo.post(portalLinkGroupLink).then(function() {\n\t\t\t\t/** flip saving flag */\n\t\t\t\tvm.saving = false;\n\n\t\t\t\t/** show success message */\n\t\t\t\ttoastr.success('Group Link added successfully.', 'Add Successful', { positionClass: 'toast-bottom-right' });\n\n\t\t\t\t/** reload the links */\n\t\t\t\tloadLinks();\n\t\t\t});\n\t\t}\n\n\t\t/** remove the portal link */\n\t\tfunction removeLink(portalLinkGroupLinkID) {\n\t\t\t/** flip saving flag */\n\t\t\tvm.saving = true;\n\n\t\t\t/** send the request to activate/deactivate */\n\t\t\tportalLinkGroupLinkRepo.remove(portalLinkGroupLinkID).then(function() {\n\t\t\t\t/** flip saving flag */\n\t\t\t\tvm.saving = false;\n\n\t\t\t\t/** show success message */\n\t\t\t\ttoastr.success('Group Link removed successfully.', 'Delete Successful', { positionClass: 'toast-bottom-right' });\n\n\t\t\t\t/** reload the links */\n\t\t\t\tloadLinks();\n\t\t\t});\n\t\t}\n\n\t\t/** close the search results */\n\t\tfunction closeSearch() {\n\t\t\t/** reset values */\n\t\t\tvm.searchString = '';\n\t\t\tvm.searchResults = [];\n\t\t}\n\n\t\t/** close the modal */\n\t\tfunction close() {\n\t\t\t$uibModalInstance.close();\n\t\t}\n\n\t\t/** cancel the modal */\n\t\tfunction cancel() {\n\t\t\t$uibModalInstance.dismiss();\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** check for group */\n\t\t\tif (!vm.isNew) {\n\t\t\t\t/** load group links */\n\t\t\t\tloadLinks();\n\t\t\t}\n\n\t\t\t/** load the possible colors */\n\t\t\tcolorRepo.getAll().then(function(colors) {\n\t\t\t\t/** set the colors */\n\t\t\t\tvm.colors = colors;\n\t\t\t});\n\n\t\t\t/** set focus on the */\n\t\t\t$uibModalInstance.rendered.then(function() {\n\t\t\t\t$('.modal-body div input[type=\"text\"]:first').focus();\n\t\t\t});\n\t\t}\n\n\t\t/** load the related portal links */\n\t\tfunction loadLinks() {\n\t\t\t/** load group links */\n\t\t\tportalLinkGroupLinkRepo.getForGroup(vm.portalGroup.portalLinkGroupID).then(function(portalLinkGroupLinks) {\n\t\t\t\t/** set the group links */\n\t\t\t\tvm.groupLinks = portalLinkGroupLinks;\n\n\t\t\t\t/** set the active flag */\n\t\t\t\ttoggleSearchResults();\n\t\t\t});\n\t\t}\n\n\t\t/** toggle the active flag on search results */\n\t\tfunction toggleSearchResults() {\n\t\t\t/** add active flag */\n\t\t\t_.forEach(vm.searchResults, function(sr) {\n\t\t\t\tsr.active = vm.groupLinks.filter(function(gl){ return gl.portalLinkID === sr.portalLinkID; }).length === 0;\n\t\t\t});\n\t\t}\n\n\t\t/** create an empty PortalLinkGroup entity */\n\t\tfunction createPortalLinkGroup() {\n\t\t\treturn {\n\t\t\t\t'portalLinkGroupID': 0,\n\t\t\t\t'portalLinkGroupName': 'New Group',\n\t\t\t\t'description': 'Your description should go here.',\n\t\t\t\t'orderNumber': 0,\n\t\t\t\t'isEnabled': false,\n\t\t\t\t'isRemoveable': true,\n\t\t\t\t'iconColor': '#7A8599',\n\t\t\t\t'iconClass': 'nha-portal'\n\t\t\t};\n\t\t}\n\t}\n})();","/**\n * portal-admin-groups.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-admin-groups.controller', portalAdminGroupsController);\n\n\t/** setup injection */\n\tportalAdminGroupsController.$inject = ['$uibModal', 'toastr', 'portal-link-group.repository'];\n\n\t/** implementation */\n\tfunction portalAdminGroupsController($uibModal, toastr, portalLinkGroupRepo) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.loading = false;\n\t\tvm.groups = [];\n\n\t\t/** public methods */\n\t\tvm.openGroupModal = openGroupModal;\n\t\tvm.reorder = reorder;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** open a modal for group editing */\n\t\tfunction openGroupModal(group) {\n\t\t\t/** create the modal instance */\n\t\t\t$uibModal.open({\n\t\t\t\ttemplateUrl: 'app/portal-admin/portal-admin-groups/group-modal.html',\n\t\t\t\tcontroller: 'group-modal.controller',\n\t\t\t\tcontrollerAs: 'groupModalCtrl',\n\t\t\t\tsize: 'lg',\n\t\t\t\tresolve: {\n\t\t\t\t\tportalGroup: function() {\n\t\t\t\t\t\treturn group;\n\t\t\t\t\t},\n\t\t\t\t\tparentInit: function() {\n\t\t\t\t\t\treturn init;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t/** reorder the groups */\n\t\tfunction reorder() {\n\t\t\t/** set the order number value */\n\t\t\tangular.forEach(vm.groups, function(g, index) {\n\t\t\t\tg.orderNumber = (index + 1);\n\t\t\t});\n\n\t\t\t/** save groups */\n\t\t\tportalLinkGroupRepo.reorder(vm.groups).then(function() {\n\t\t\t\t/** reset the users groups */\n\t\t\t\tportalLinkGroupRepo.resetGroups();\n\n\t\t\t\t/** show success message */\n\t\t\t\ttoastr.success('Groups reordered successfully.', 'Save Successful', { positionClass: 'toast-bottom-right' });\n\t\t\t});\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** flip loading flag */\n\t\t\tvm.loading = true;\n\n\t\t\t/** load groups */\n\t\t\tportalLinkGroupRepo.getAll().then(function(groups) {\n\t\t\t\t/** set groups */\n\t\t\t\tvm.groups = groups;\n\n\t\t\t\t/** flip loading flag */\n\t\t\t\tvm.loading = false;\n\t\t\t});\n\t\t}\n\t}\n})();","/**\n * portal-admin-groups.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalAdminGroups', portalAdminGroupsDirective);\n\n\t/** implementation */\n\tfunction portalAdminGroupsDirective() {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: 'app/portal-admin/portal-admin-groups/portal-admin-groups.directive.html',\n\t\t\tcontroller: 'portal-admin-groups.controller',\n\t\t\tcontrollerAs: 'portalAdminGroupsCtrl',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * link-modal.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('link-modal.controller', linkModalController);\n\n\t/** setup injection */\n\tlinkModalController.$inject = ['$uibModalInstance', 'toastr', 'portal-link.repository', 'portal-link-role.repository', 'portal-link-location.repository', 'portal-link-group.repository', 'portal-link-group-link.repository', 'color.repository', 'config.repository', 'role.repository', 'role-type.repository', 'stateRepository', 'schoolService', 'portalLink', 'parentInit'];\n\n\t/** implementation */\n\tfunction linkModalController($uibModalInstance, toastr, portalLinkRepo, portalLinkRoleRepo, portalLinkLocationRepo, portalLinkGroupRepo, portalLinkGroupLinkRepo, colorRepo, configRepo, roleRepo, roleTypeRepo, stateRepository, schoolService, portalLink, parentInit) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.saving = false;\n\t\tvm.isNew = portalLink ? false : true;\n\t\tvm.tab = 'link-info-tab';\n\t\tvm.original = portalLink || createPortalLink();\n\t\tvm.portalLink = angular.copy(vm.original);\n\t\tvm.colors = [];\n\t\tvm.allSettings = [];\n\t\tvm.selectedSetting = null;\n\t\tvm.linkType = portalLink && portalLink.settingKey !== null && portalLink.settingKey.length > 0 ? 2 : 1;\n\t\tvm.linkTypes = [{ 'label': 'External Link', 'value': 1 }, { 'label': 'Portal Setting', 'value': 2 }];\n\t\tvm.iconType = null;\n\t\tvm.iconTypes = [{ 'label': 'Icon Class', 'value': 1 }, { 'label': '3 Letter Icon', 'value': 2 }, { 'label': 'SVG', 'value': 3 }];\n\t\tvm.isRequired = {\n\t\t\t'url': (vm.linkType === 1 ? true : false),\n\t\t\t'portalSetting': (vm.linkType === 2 ? true : false)\n\t\t};\n\n\t\t/** public properties (portalLinkRoles) */\n\t\tvm.portalLinkRoles = [];\n\t\tvm.selectedRole = null;\n\t\tvm.roles = [];\n\t\tvm.selectedRoleType = null;\n\t\tvm.roleTypes = [];\n\n\t\t/** public properties (portalLinkLocations) */\n\t\tvm.portalLinkLocations = [];\n\t\tvm.selectedLocationType = null;\n\t\tvm.locationTypes = [\n\t\t\t{ 'label': 'Service Center', 'value': 1 },\n\t\t\t{ 'label': 'All NHA Schools', 'value': 2 },\n\t\t\t{ 'label': 'Select Schools', 'value': 3 }\n\t\t];\n\t\tvm.selectedState = null;\n\t\tvm.states = [];\n\t\tvm.selectedSchool = null;\n\t\tvm.allSchools = [];\n\t\tvm.schools = [];\n\n\t\t/** public properties (portalLinkGroupLinks) */\n\t\tvm.portalLinkGroupLinks = [];\n\t\tvm.portalLinkGroups = [];\n\t\tvm.selectedGroup = null;\n\n\t\t/** public methods (portalLink) */\n\t\tvm.save = save;\n\t\tvm.activate = activate;\n\t\tvm.remove = remove;\n\t\tvm.close = close;\n\t\tvm.cancel = cancel;\n\t\tvm.changeLinkType = changeLinkType;\n\t\tvm.changeIconType = changeIconType;\n\n\t\t/** public methods (portalLinkRole) */\n\t\tvm.addRole = addRole;\n\t\tvm.removeRole = removeRole;\n\n\t\t/** public methods (portalLinkLocations) */\n\t\tvm.locationMessage = null;\n\t\tvm.disableLocationAddBtn = disableLocationAddBtn;\n\t\tvm.getSchoolOptions = getSchoolOptions;\n\t\tvm.addLocation = addLocation;\n\t\tvm.removeLocation = removeLocation;\n\n\t\t/** public methods (portalLinkGroupLinks) */\n\t\tvm.addGroup = addGroup;\n\t\tvm.removeGroup = removeGroup;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** save the link */\n\t\tfunction save() {\n\t\t\t/** flip saving flag */\n\t\t\tvm.saving = true;\n\n\t\t\t/** map values from source to original */\n\t\t\t_.merge(vm.original, vm.portalLink);\n\n\t\t\t/** check for portal setting */\n\t\t\tif (vm.linkType === 2 && vm.selectedSetting) {\n\t\t\t\tvm.original.settingKey = vm.selectedSetting.settingKey;\n\t\t\t}\n\n\t\t\t/** send the request to activate/deactivate */\n\t\t\tportalLinkRepo.save(vm.original, (vm.original.portalLinkID !== 0 ? vm.original.portalLinkID : undefined)).then(function(newPortalLink) {\n\t\t\t\t/** show the success message */\n\t\t\t\tswal({\n\t\t\t\t\t'title': 'Save Complete',\n\t\t\t\t\t'text': 'The processing has completed. The link was saved successfully.',\n\t\t\t\t\t'type': 'success'\n\t\t\t\t}, function() {\n\t\t\t\t\t/** flip saving flag */\n\t\t\t\t\tvm.saving = false;\n\n\t\t\t\t\t/** set isNew to false */\n\t\t\t\t\tvm.isNew = false;\n\t\t\t\t\t\n\t\t\t\t\t/** set original and copy */\n\t\t\t\t\tif (newPortalLink) {\n\t\t\t\t\t\tportalLink = newPortalLink;\n\t\t\t\t\t\tvm.original = newPortalLink;\n\t\t\t\t\t\tvm.portalLink = angular.copy(vm.original);\n\t\t\t\t\t}\n\n\t\t\t\t\t/** reinitialize the parent */\n\t\t\t\t\tparentInit();\n\n\t\t\t\t\t/** load the support data */\n\t\t\t\t\tloadSupportData();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t/** activate/deactivate a link */\n\t\tfunction activate(active) {\n\t\t\t/** set the isEnabled flag */\n\t\t\tvm.original.isEnabled = active;\n\n\t\t\t/** flip saving flag */\n\t\t\tvm.saving = true;\n\n\t\t\t/** send the request to activate/deactivate */\n\t\t\tportalLinkRepo.put(vm.original, vm.original.portalLinkID).then(function() {\n\t\t\t\t/** flip the isEnabled flag on the copy */\n\t\t\t\tvm.portalLink.isEnabled = vm.original.isEnabled;\n\n\t\t\t\t/** flip saving flag */\n\t\t\t\tvm.saving = false;\n\n\t\t\t\t/** show the success message */\n\t\t\t\tswal({\n\t\t\t\t\t'title': 'Save Complete',\n\t\t\t\t\t'text': 'The processing has completed. The link was saved successfully.',\n\t\t\t\t\t'type': 'success'\n\t\t\t\t}, function() {\n\t\t\t\t\t/** reinitialize the parent */\n\t\t\t\t\tparentInit();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t/** remove the link */\n\t\tfunction remove() {\n\t\t\t/** show swal confirmation window */\n\t\t\tswal({\n\t\t\t\t'title': 'Are you sure you want to delete this link?',\n\t\t\t\t'type': 'warning',\n\t\t\t\t'showCancelButton': true,\n\t\t\t\t'confirmButtonText': 'Yes, Delete It!',\n\t\t\t\t'closeOnConfirm': false\n\t\t\t}, function(isConfirm) {\n\t\t\t\t/** check the isConfirm flag */\n\t\t\t\tif (isConfirm) {\n\t\t\t\t\t/** flip saving flag */\n\t\t\t\t\tvm.saving = true;\n\n\t\t\t\t\t/** send the request to activate/deactivate */\n\t\t\t\t\tportalLinkRepo.remove(portalLink.portalLinkID).then(function() {\n\t\t\t\t\t\t/** flip saving flag */\n\t\t\t\t\t\tvm.saving = false;\n\n\t\t\t\t\t\t/** show the success message */\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t'title': 'Delete Complete',\n\t\t\t\t\t\t\t'text': 'The processing has completed. The link was deleted successfully.',\n\t\t\t\t\t\t\t'type': 'success'\n\t\t\t\t\t\t}, function() {\n\t\t\t\t\t\t\t/** reinitialize the parent */\n\t\t\t\t\t\t\tparentInit();\n\n\t\t\t\t\t\t\t/** close modal */\n\t\t\t\t\t\t\tclose();\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t/** close the modal */\n\t\tfunction close() {\n\t\t\t$uibModalInstance.close();\n\t\t}\n\n\t\t/** cancel the modal */\n\t\tfunction cancel() {\n\t\t\t$uibModalInstance.dismiss();\n\t\t}\n\n\t\t/** change the data based on the link type */\n\t\tfunction changeLinkType() {\n\t\t\tvm.selectedSetting = null;\n\n\t\t\t/** change the data for the selected type */\n\t\t\tif (vm.linkType === 1) { // external link\n\t\t\t\tvm.portalLink.settingKey = null;\n\t\t\t\tvm.isRequired.url = true;\n\t\t\t\tvm.isRequired.portalSetting = false;\n\t\t\t}\n\t\t\tif (vm.linkType === 2) { // portal setting\n\t\t\t\tvm.portalLink.url = null;\n\t\t\t\tvm.isRequired.url = false;\n\t\t\t\tvm.isRequired.portalSetting = true;\n\t\t\t}\n\t\t}\n\n\t\t/** change the icon type for the link */\n\t\tfunction changeIconType() {\n\t\t\tif (vm.iconType === 1) { // icon class\n\t\t\t\tvm.portalLink.iconLetters = null;\n\t\t\t\tvm.portalLink.iconSVG = null;\n\t\t\t}\n\t\t\tif (vm.iconType === 2) { // icon letters\n\t\t\t\tvm.portalLink.iconClass = null;\n\t\t\t\tvm.portalLink.iconSVG = null;\n\t\t\t}\n\t\t\tif (vm.iconType === 3) { // icon svg\n\t\t\t\tvm.portalLink.iconClass = null;\n\t\t\t\tvm.portalLink.iconLetters = null;\n\t\t\t}\n\t\t}\n\n\t\t/** add a portalLinkRole */\n\t\tfunction addRole() {\n\t\t\t/** create the portalLinkRole object */\n\t\t\tvar newPortalLinkRole = {\n\t\t\t\t'portalLinkRoleID': 0,\n\t\t\t\t'portalLinkID': vm.portalLink.portalLinkID,\n\t\t\t\t'roleID': vm.selectedRole\n\t\t\t};\n\n\t\t\t/** add the role */\n\t\t\tportalLinkRoleRepo.save(newPortalLinkRole).then(function() {\n\t\t\t\t/** reload portalLinkRoles */\n\t\t\t\tloadPortalLinkRoles();\n\n\t\t\t\t/** show success message */\n\t\t\t\ttoastr.success('Role added successfully.', 'Save Successful', { positionClass: 'toast-bottom-right' });\n\n\t\t\t\t/** reset selected role type and role */\n\t\t\t\tvm.selectedRole = null;\n\t\t\t\tvm.selectedRoleType = null;\n\t\t\t});\n\t\t}\n\n\t\t/** remove a portalLinkRole */\n\t\tfunction removeRole(portalLinkRole) {\n\t\t\t/** send the request */\n\t\t\tportalLinkRoleRepo.remove(portalLinkRole.portalLinkRoleID).then(function() {\n\t\t\t\t/** remove record from portalLinkRoles */\n\t\t\t\tvm.portalLinkRoles = vm.portalLinkRoles.filter(function(plr){ return plr.portalLinkRoleID !== portalLinkRole.portalLinkRoleID; });\n\n\t\t\t\t/** show success message */\n\t\t\t\ttoastr.success('Role removed successfully.', 'Removal Successful', { positionClass: 'toast-bottom-right' });\n\t\t\t});\n\t\t}\n\n\t\t/** check whether the add location button should be disabled */\n\t\tfunction disableLocationAddBtn() {\n\t\t\t/** haven't selected a location type yet */\n\t\t\tif (vm.selectedLocationType === null) return true;\n\n\t\t\t/** reset the location message */\n\t\t\tvm.locationMessage = null;\n\n\t\t\t/** trying to add service center */\n\t\t\tif (vm.selectedLocationType === 1) {\n\t\t\t\t/** check to see if service center already exists */\n\t\t\t\tif (vm.portalLinkLocations.filter(function(pll){ return pll.isServiceCenter; }).length > 0) {\n\t\t\t\t\tvm.locationMessage = 'The Service Center has already been set has a location.';\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\t/** do not disable */\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t/** trying to add all schools */\n\t\t\tif (vm.selectedLocationType === 2) {\n\t\t\t\t/** check to see if all schools record already exists, or an individual school record exists */\n\t\t\t\tif (vm.portalLinkLocations.filter(function(pll){ return pll.isAllSchools || pll.schoolID !== null; }).length > 0) {\n\t\t\t\t\tvm.locationMessage = 'There is already an All NHA Schools record -OR- individual schools have been chosen.';\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\t/** do not disable */\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t/** trying to add individual school and All Schools already selected */\n\t\t\tif (vm.selectedLocationType === 3) {\n\t\t\t\t/** check to see if the school record already exists */\n\t\t\t\tif (vm.portalLinkLocations.filter(function(pll){ return pll.isAllSchools; }).length > 0) {\n\t\t\t\t\tvm.locationMessage = 'There is already an All NHA Schools record.';\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\t/** check for selected state */\n\t\t\t\tif (vm.selectedState !== null && vm.selectedSchool !== null) {\n\t\t\t\t\t/** do not disable */\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/** return true as default */\n\t\t\treturn true;\n\t\t}\n\n\t\t/** get the school options based upon the state */\n\t\tfunction getSchoolOptions() {\n\t\t\t/** reset the schools */\n\t\t\tvm.schools = [];\n\n\t\t\t/** return if no state selected */\n\t\t\tif (vm.selectedState === null) return;\n\n\t\t\t/** get school ids */\n\t\t\tvar schoolIDs = _.map(vm.portalLinkLocations.filter(function(pll) {\n\t\t\t\treturn pll.schoolID !== null && pll.school.stateID === vm.selectedState;\n\t\t\t}), function(pll) {\n\t\t\t\treturn pll.schoolID;\n\t\t\t});\n\n\t\t\t/** get the schools for the selected state */\n\t\t\tvm.schools = vm.allSchools.filter(function(sc) {\n\t\t\t\treturn sc.stateID === vm.selectedState && !schoolIDs.contains(sc.schoolID);\n\t\t\t});\n\t\t\tvm.schools.sort(function(a, b) {\n\t\t\t\tif (a.schoolName < b.schoolName) return -1;\n\t\t\t\tif (a.schoolName > b.schoolName) return 1;\n\t\t\t\treturn 0;\n\t\t\t});\n\n\t\t\t/** check if all schools option is necessary */\n\t\t\tif (vm.portalLinkLocations.filter(function(pll){ return pll.stateID === vm.selectedState; }).length === 0) {\n\t\t\t\t/** get the state */\n\t\t\t\tvar state = vm.states.filter(function(st) {\n\t\t\t\t\treturn st.stateID === vm.selectedState;\n\t\t\t\t})[0];\n\n\t\t\t\t/** add an all schools option */\n\t\t\t\tvm.schools.unshift({ 'schoolID': -1, 'schoolName': 'All ' + state.name + ' Schools' });\n\t\t\t}\n\t\t}\n\n\t\t/** add a location record */\n\t\tfunction addLocation() {\n\t\t\t/** create array */\n\t\t\tvar newPortalLinkLocations = [];\n\n\t\t\t/** check for all schools option */\n\t\t\tif (vm.selectedLocationType === 3 && vm.selectedSchool === -1) {\n\t\t\t\t/** get school ids */\n\t\t\t\tvar schoolIDs = _.map(vm.portalLinkLocations.filter(function(pll) {\n\t\t\t\t\treturn pll.schoolID !== null && pll.school.stateID === vm.selectedState;\n\t\t\t\t}), function(pll) {\n\t\t\t\t\treturn pll.schoolID;\n\t\t\t\t});\n\n\t\t\t\t/** add a record for the state */\n\t\t\t\tnewPortalLinkLocations.push({\n\t\t\t\t\t'portalLinkLocationID': 0,\n\t\t\t\t\t'portalLinkID': vm.portalLink.portalLinkID,\n\t\t\t\t\t'isServiceCenter': false,\n\t\t\t\t\t'isAllSchools': false,\n\t\t\t\t\t'stateID': vm.selectedState,\n\t\t\t\t\t'schoolID': null\n\t\t\t\t});\n\n\t\t\t\t/** get all the schools for the selected state */\n\t\t\t\t_.forEach(vm.allSchools, function(sc) {\n\t\t\t\t\tif (sc.stateID === vm.selectedState && !schoolIDs.contains(sc.schoolID)) {\n\t\t\t\t\t\tnewPortalLinkLocations.push({\n\t\t\t\t\t\t\t'portalLinkLocationID': 0,\n\t\t\t\t\t\t\t'portalLinkID': vm.portalLink.portalLinkID,\n\t\t\t\t\t\t\t'isServiceCenter': false,\n\t\t\t\t\t\t\t'isAllSchools': false,\n\t\t\t\t\t\t\t'schoolID': sc.schoolID\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t/** create the portalLinkLocation object */\n\t\t\t\tnewPortalLinkLocations.push({\n\t\t\t\t\t'portalLinkLocationID': 0,\n\t\t\t\t\t'portalLinkID': vm.portalLink.portalLinkID,\n\t\t\t\t\t'isServiceCenter': vm.selectedLocationType === 1,\n\t\t\t\t\t'isAllSchools': vm.selectedLocationType === 2,\n\t\t\t\t\t'schoolID': vm.selectedSchool\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/** add the location */\n\t\t\tportalLinkLocationRepo.postAll(newPortalLinkLocations).then(function() {\n\t\t\t\t/** reload portalLinkLocations */\n\t\t\t\tloadPortalLinkLocations().then(function() {\n\t\t\t\t\t/** show success message */\n\t\t\t\t\ttoastr.success('Location added successfully.', 'Save Successful', { positionClass: 'toast-bottom-right' });\n\n\t\t\t\t\t/** reset selectors */\n\t\t\t\t\tif (vm.selectedLocationType !== 3) {\n\t\t\t\t\t\tvm.selectedLocationType = null;\n\t\t\t\t\t\tvm.selectedState = null;\n\t\t\t\t\t\tvm.selectedSchool = null;\n\t\t\t\t\t}\n\t\t\t\t\tif (vm.selectedLocationType === 3) {\n\t\t\t\t\t\tvm.selectedSchool = null;\n\t\t\t\t\t\tgetSchoolOptions();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t/** remove a location record */\n\t\tfunction removeLocation(portalLinkLocation) {\n\t\t\t/** send the request */\n\t\t\tportalLinkLocationRepo.remove(portalLinkLocation.portalLinkLocationID).then(function() {\n\t\t\t\t/** reload portalLinkLocations */\n\t\t\t\tloadPortalLinkLocations().then(function() {\n\t\t\t\t\t/** show success message */\n\t\t\t\t\ttoastr.success('Location removed successfully.', 'Removal Successful', { positionClass: 'toast-bottom-right' });\n\n\t\t\t\t\t/** reset selectors */\n\t\t\t\t\tif (vm.selectedLocationType === 3) {\n\t\t\t\t\t\tgetSchoolOptions();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t/** add a new portalLinkGroupLink record */\n\t\tfunction addGroup() {\n\t\t\t/** create the portalLinkGroupLink object */\n\t\t\tvar newPortalLinkGroupLink = {\n\t\t\t\t'portalLinkGroupLinkID': 0,\n\t\t\t\t'portalLinkID': vm.portalLink.portalLinkID,\n\t\t\t\t'portalLinkGroupID': vm.selectedGroup,\n\t\t\t\t'orderNumber': 1000\n\t\t\t};\n\n\t\t\t/** add the group */\n\t\t\tportalLinkGroupLinkRepo.save(newPortalLinkGroupLink).then(function() {\n\t\t\t\t/** reload portalLinkGroupLinks */\n\t\t\t\tloadPortalLinkGroupsLinks().then(function() {\n\t\t\t\t\t/** adjust the available groups */\n\t\t\t\t\tadjustPortalLinkGroups();\n\t\t\t\t});\n\n\t\t\t\t/** show success message */\n\t\t\t\ttoastr.success('Group added successfully.', 'Save Successful', { positionClass: 'toast-bottom-right' });\n\n\t\t\t\t/** reset selected group */\n\t\t\t\tvm.selectedGroup = null;\n\t\t\t});\n\t\t}\n\n\t\t/** remove a portalLinkGroupLink record */\n\t\tfunction removeGroup(portalLinkGroupLink) {\n\t\t\t/** send the request */\n\t\t\tportalLinkGroupLinkRepo.remove(portalLinkGroupLink.portalLinkGroupLinkID).then(function() {\n\t\t\t\t/** remove record from portalLinkGroupLinks */\n\t\t\t\tvm.portalLinkGroupLinks = vm.portalLinkGroupLinks.filter(function(plgl){ return plgl.portalLinkGroupLinkID !== portalLinkGroupLink.portalLinkGroupLinkID; });\n\n\t\t\t\t/** adjust the available groups */\n\t\t\t\tadjustPortalLinkGroups();\n\n\t\t\t\t/** show success message */\n\t\t\t\ttoastr.success('Group removed successfully.', 'Removal Successful', { positionClass: 'toast-bottom-right' });\n\t\t\t});\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** load the possible colors */\n\t\t\tcolorRepo.getAll().then(function(colors) {\n\t\t\t\t/** set the colors */\n\t\t\t\tvm.colors = colors;\n\t\t\t});\n\n\t\t\t/** get the distinct settings keys */\n\t\t\tconfigRepo.getSettings().then(function (settings) {\n\t\t\t\t/** set allSettings */\n\t\t\t\tvm.allSettings = settings;\n\n\t\t\t\t/** check to see if selectedSetting needs to be set */\n\t\t\t\tif (vm.original.settingKey !== null) {\n\t\t\t\t\tvm.selectedSetting = vm.allSettings.find(function (s) {\n\t\t\t\t\t\treturn s.settingKey === vm.original.settingKey;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t/** set the iconType */\n\t\t\tif (vm.portalLink.iconClass && vm.portalLink.iconClass.length > 0) vm.iconType = 1;\n\t\t\tif (vm.portalLink.iconLetters && vm.portalLink.iconLetters.length > 0) vm.iconType = 2;\n\t\t\tif (vm.portalLink.iconSVG && vm.portalLink.iconSVG.length > 0) vm.iconType = 3;\n\n\t\t\t/** load the portal link roles if not new */\n\t\t\tif (!vm.isNew) {\n\t\t\t\t/** load the support data */\n\t\t\t\tloadSupportData();\n\t\t\t}\n\n\t\t\t/** set focus on the */\n\t\t\t$uibModalInstance.rendered.then(function() {\n\t\t\t\t$('.modal-body div input[type=\"text\"]:first').focus();\n\t\t\t});\n\t\t}\n\n\t\t/** load roles, locations, and groups */\n\t\tfunction loadSupportData() {\n\t\t\t/** load the role types */\n\t\t\troleTypeRepo.getAll().then(function(roleTypes) {\n\t\t\t\t/** set the role types */\n\t\t\t\tvm.roleTypes = roleTypes;\n\n\t\t\t\t/** load the roles */\n\t\t\t\troleRepo.getAll().then(function(roles) {\n\t\t\t\t\t/** set the roles */\n\t\t\t\t\tvm.roles = roles;\n\n\t\t\t\t\t/** load the portal link roles */\n\t\t\t\t\tloadPortalLinkRoles();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t/** load schools */\n\t\t\tschoolService.getSchools().then(function(schools) {\n\t\t\t\t/** set the schools */\n\t\t\t\tvm.allSchools = schools;\n\n\t\t\t\t/** get the state ids to filter states */\n\t\t\t\tvar stateIDs = _.map(vm.allSchools, function(sc) {\n\t\t\t\t\treturn sc.stateID;\n\t\t\t\t});\n\n\t\t\t\t/** load states */\n\t\t\t\tstateRepository.getAll().then(function(states) {\n\t\t\t\t\t/** filter states */\n\t\t\t\t\tstates = states.filter(function(st) {\n\t\t\t\t\t\treturn stateIDs.contains(st.stateID);\n\t\t\t\t\t});\n\n\t\t\t\t\t/** set the states */\n\t\t\t\t\tvm.states = states;\n\n\t\t\t\t\t/** load portal link locations */\n\t\t\t\t\tloadPortalLinkLocations();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\t/** load the portalLinkGroupLinks */\n\t\t\tloadPortalLinkGroupsLinks().then(function() {\n\t\t\t\t/** load portal link groups */\n\t\t\t\tportalLinkGroupRepo.getAll().then(function(portalLinkGroups) {\n\t\t\t\t\t/** strip html and add visible flag */\n\t\t\t\t\t_.forEach(portalLinkGroups, function(plg) {\n\t\t\t\t\t\tplg.portalLinkGroupName = plg.portalLinkGroupName.stripHtml();\n\t\t\t\t\t\tplg.visible = true;\n\t\t\t\t\t});\n\n\t\t\t\t\t/** set groups and adjust */\n\t\t\t\t\tvm.portalLinkGroups = portalLinkGroups;\n\t\t\t\t\tadjustPortalLinkGroups();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t/** load the portal link roles */\n\t\tfunction loadPortalLinkRoles() {\n\t\t\tportalLinkRoleRepo.getAll({ 'filter': { 'PortalLinkID': vm.original.portalLinkID }, 'orderby': 'Role/RoleName' }).then(function(portalLinkRoles) {\n\t\t\t\t/** set value */\n\t\t\t\tvm.portalLinkRoles = portalLinkRoles;\n\t\t\t});\n\t\t}\n\n\t\t/** load the portal link location records */\n\t\tfunction loadPortalLinkLocations() {\n\t\t\treturn portalLinkLocationRepo.getAll({ 'filter': { 'PortalLinkID': vm.original.portalLinkID }, 'orderby': 'IsServiceCenter,IsAllSchools,State/Name,School/SchoolName' }).then(function(portalLinkLocations) {\n\t\t\t\t/** add the schools state name */\n\t\t\t\t_.forEach(portalLinkLocations.filter(function(pll) {\n\t\t\t\t\treturn pll.schoolID !== null;\n\t\t\t\t}), function(pll) {\n\t\t\t\t\tpll.school.stateName = getStateName(pll.school.stateID);\n\t\t\t\t});\n\n\t\t\t\t/** set value */\n\t\t\t\tvm.portalLinkLocations = portalLinkLocations;\n\t\t\t});\n\t\t}\n\n\t\t/** load the portal link group links */\n\t\tfunction loadPortalLinkGroupsLinks() {\n\t\t\treturn portalLinkGroupLinkRepo.getAll({ 'filter': { 'PortalLinkID': vm.original.portalLinkID }, 'orderby': 'PortalLinkGroup/PortalLinkGroupName' }).then(function(portalLinkGroupLinks) {\n\t\t\t\t/** set value */\n\t\t\t\tvm.portalLinkGroupLinks = portalLinkGroupLinks;\n\t\t\t});\n\t\t}\n\n\t\t/** adjust the portal link groups */\n\t\tfunction adjustPortalLinkGroups() {\n\t\t\t/** filter out groups where this link already exists */\n\t\t\tvar groupIDs = _.map(vm.portalLinkGroupLinks, function(plgl) {\n\t\t\t\treturn plgl.portalLinkGroupID;\n\t\t\t});\n\n\t\t\t/** show/hide */\n\t\t\t_.forEach(vm.portalLinkGroups, function(plg) {\n\t\t\t\tplg.visible = !groupIDs.contains(plg.portalLinkGroupID);\n\t\t\t});\n\t\t}\n\n\t\t/** return a state name for the given state id */\n\t\tfunction getStateName(stateID) {\n\t\t\t/** find the matching state */\n\t\t\tvar state = vm.states.filter(function(st) {\n\t\t\t\treturn st.stateID === stateID;\n\t\t\t});\n\n\t\t\t/** check for match and return */\n\t\t\tif (state.length > 0) {\n\t\t\t\treturn state[0].name;\n\t\t\t}\n\n\t\t\t/** return a blank name */\n\t\t\treturn '';\n\t\t}\n\n\t\t/** create an empty PortalLink entity */\n\t\tfunction createPortalLink() {\n\t\t\treturn {\n\t\t\t\t'portalLinkID': 0,\n\t\t\t\t'portalLinkName': 'New Link',\n\t\t\t\t'description': null,\n\t\t\t\t'url': null,\n\t\t\t\t'settingKey': null,\n\t\t\t\t'iconClass': 'nha-portal',\n\t\t\t\t'iconLetters': null,\n\t\t\t\t'iconSVG': null,\n\t\t\t\t'iconColor': '#7A8599',\n\t\t\t\t'isEnabled': false,\n\t\t\t\t'isMobile': false,\n\t\t\t\t'isRemoveable': true\n\t\t\t};\n\t\t}\n\t}\n})();","/**\n * portal-admin-links.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-admin-links.controller', portalAdminLinksController);\n\n\t/** setup injection */\n\tportalAdminLinksController.$inject = ['$sce', '$uibModal', 'portal-link.repository'];\n\n\t/** implementation */\n\tfunction portalAdminLinksController($sce, $uibModal, portalLinkRepo)\n\t{\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.loading = false;\n\t\tvm.links = [];\n\n\t\t/** public methods */\n\t\tvm.openLinkModal = openLinkModal;\n\t\tvm.getSVG = getSVG;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** open a modal for link editing */\n\t\tfunction openLinkModal(link) {\n\t\t\t/** create the modal instance */\n\t\t\t$uibModal.open({\n\t\t\t\ttemplateUrl: 'app/portal-admin/portal-admin-links/link-modal.html',\n\t\t\t\tcontroller: 'link-modal.controller',\n\t\t\t\tcontrollerAs: 'linkModalCtrl',\n\t\t\t\tsize: 'lg',\n\t\t\t\tresolve: {\n\t\t\t\t\tportalLink: function() {\n\t\t\t\t\t\treturn link;\n\t\t\t\t\t},\n\t\t\t\t\tparentInit: function() {\n\t\t\t\t\t\treturn init;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t/** get the svg value */\n\t\tfunction getSVG(iconSVG) {\n\t\t\treturn $sce.trustAsHtml(iconSVG);\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** flip loading flag */\n\t\t\tvm.loading = true;\n\n\t\t\t/** load links */\n\t\t\tportalLinkRepo.getAll({ 'filter': {}, 'orderby': 'PortalLinkName' }).then(function(links) {\n\t\t\t\t/** get todays day of the year */\n\t\t\t\tvar today = moment();\n\n\t\t\t\t/** check how new each link is */\n\t\t\t\t_.forEach(links, function(l) {\n\t\t\t\t\t/** get the created/modified day of the year */\n\t\t\t\t\tvar createdDayOfYear = moment(l.createDate);\n\n\t\t\t\t\t/** add an isModified flag */\n\t\t\t\t\tl.changeDaysAgo = today.diff(createdDayOfYear, 'days');\n\t\t\t\t});\n\n\t\t\t\t/** set links */\n\t\t\t\tvm.links = links;\n\n\t\t\t\t/** flip loading flag */\n\t\t\t\tvm.loading = false;\n\t\t\t});\n\t\t}\n\t}\n})();","/**\n * portal-admin-links.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalAdminLinks', portalAdminLinksDirective);\n\n\t/** implementation */\n\tfunction portalAdminLinksDirective() {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: 'app/portal-admin/portal-admin-links/portal-admin-links.directive.html',\n\t\t\tcontroller: 'portal-admin-links.controller',\n\t\t\tcontrollerAs: 'portalAdminLinksCtrl',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-admin-quicklinks.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-admin-quicklinks.controller', portalAdminQuickLinksController);\n\n\t/** setup injection */\n\tportalAdminQuickLinksController.$inject = ['toastr', 'portal-quick-link.repository', 'portal-link.repository'];\n\n\t/** implementation */\n\tfunction portalAdminQuickLinksController(toastr, portalQuickLinkRepo, portalLinkRepo) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.quicklinks = [];\n\t\tvm.portalLink = [];\n\t\tvm.selectedPortalLink = null;\n\n\t\t/** public methods */\n\t\tvm.addQuickLink = addQuickLink;\n\t\tvm.removeQuickLink = removeQuickLink;\n\t\tvm.reorder = reorder;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** add a quick link */\n\t\tfunction addQuickLink() {\n\t\t\t/** get the last quick link for the order number */\n\t\t\tvar orderNumber = 1;\n\t\t\tvar last = _.last(vm.quicklinks);\n\t\t\tif (last) orderNumber = last.orderNumber + 1;\n\n\t\t\t/** create the quick link object */\n\t\t\tvar quicklink = {\n\t\t\t\t'portalQuickLinkID': 0,\n\t\t\t\t'portalLinkID': vm.selectedPortalLink,\n\t\t\t\t'orderNumber': orderNumber\n\t\t\t};\n\n\t\t\t/** save the quick link */\n\t\t\tportalQuickLinkRepo.post(quicklink).then(function() {\n\t\t\t\t/** reload quick links */\n\t\t\t\tloadQuickLinks().then(function() {\n\t\t\t\t\t/** adjust the portal links again */\n\t\t\t\t\tadjustPortalLinks();\n\t\t\t\t});\n\n\t\t\t\t/** show success message */\n\t\t\t\ttoastr.success('Quick link added successfully.', 'Save Successful', { positionClass: 'toast-bottom-right' });\n\n\t\t\t\t/** reset selected link */\n\t\t\t\tvm.selectedPortalLink = null;\n\t\t\t});\n\t\t}\n\n\t\t/** remove a quick link */\n\t\tfunction removeQuickLink(quicklink) {\n\t\t\t/** send the request */\n\t\t\tportalQuickLinkRepo.remove(quicklink.portalQuickLinkID).then(function() {\n\t\t\t\t/** reload quick links */\n\t\t\t\tloadQuickLinks().then(function() {\n\t\t\t\t\t/** adjust the portal links again */\n\t\t\t\t\tadjustPortalLinks();\n\t\t\t\t});\n\n\t\t\t\t/** show success message */\n\t\t\t\ttoastr.success('Quick link removed successfully.', 'Removal Successful', { positionClass: 'toast-bottom-right' });\n\t\t\t});\n\t\t}\n\n\t\t/** reorder the quicklinks */\n\t\tfunction reorder() {\n\t\t\t/** set the order number value */\n\t\t\tangular.forEach(vm.quicklinks, function(ql, index) {\n\t\t\t\tql.orderNumber = (index + 1);\n\t\t\t});\n\n\t\t\t/** save quicklinks */\n\t\t\tportalQuickLinkRepo.reorder(vm.quicklinks).then(function() {\n\t\t\t\t/** show success message */\n\t\t\t\ttoastr.success('Quick Links reordered successfully.', 'Save Successful', { positionClass: 'toast-bottom-right' });\n\t\t\t});\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** load the quick links */\n\t\t\tloadQuickLinks().then(function() {\n\t\t\t\t/** load the portal links */\n\t\t\t\tportalLinkRepo.getAll().then(function(portalLinks) {\n\t\t\t\t\t/** add a visible flag */\n\t\t\t\t\t_.forEach(portalLinks, function(pl) {\n\t\t\t\t\t\tpl.portalLinkName = pl.portalLinkName.stripHtml();\n\t\t\t\t\t\tpl.visible = true;\n\t\t\t\t\t});\n\n\t\t\t\t\t/** set links */\n\t\t\t\t\tvm.portalLinks = portalLinks;\n\n\t\t\t\t\t/** adjust the portal links */\n\t\t\t\t\tadjustPortalLinks();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t/** load quicklinks */\n\t\tfunction loadQuickLinks() {\n\t\t\t/** send request */\n\t\t\treturn portalQuickLinkRepo.getAll().then(function(quicklinks) {\n\t\t\t\t/** set quick links */\n\t\t\t\tvm.quicklinks = quicklinks;\n\t\t\t});\n\t\t}\n\n\t\t/** adjust the available links */\n\t\tfunction adjustPortalLinks() {\n\t\t\t/** get the portalLinkIDs of the quick links */\n\t\t\tvar portalLinkIDs = _.map(vm.quicklinks, function(ql) {\n\t\t\t\treturn ql.portalLinkID;\n\t\t\t});\n\n\t\t\t/** go through portal links to show / hide */\n\t\t\t_.forEach(vm.portalLinks, function(pl) {\n\t\t\t\tpl.visible = !portalLinkIDs.contains(pl.portalLinkID);\n\t\t\t});\n\t\t}\n\t}\n})();","/**\n * portal-admin-quicklinks.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalAdminQuicklinks', portalAdminQuickLinksDirective);\n\n\t/** implementation */\n\tfunction portalAdminQuickLinksDirective() {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: 'app/portal-admin/portal-admin-quicklinks/portal-admin-quicklinks.directive.html',\n\t\t\tcontroller: 'portal-admin-quicklinks.controller',\n\t\t\tcontrollerAs: 'portalAdminQuickLinksCtrl',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-admin-settingkeys.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalAdminSettings', portalAdminSettingsDirective);\n\n\t/** implementation */\n\tfunction portalAdminSettingsDirective() {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: 'app/portal-admin/portal-admin-settings/portal-admin-settings.directive.html',\n\t\t\tcontroller: 'portal-admin-settings.controller',\n\t\t\tcontrollerAs: 'portalAdminSettingsCtrl',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-admin-settingkeys.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('portal-admin-settings.controller', portalAdminSettingsController);\n\n\t/** setup injection */\n\tportalAdminSettingsController.$inject = ['$uibModal', 'config.repository'];\n\n\t/** implementation */\n\tfunction portalAdminSettingsController($uibModal, configRepo) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.loading = false;\n\t\tvm.settings = [];\n\n\t\t/** public methods */\n\t\tvm.openModal = openModal;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** open a modal for editing */\n\t\tfunction openModal(setting) {\n\t\t\t/** create the modal instance */\n\t\t\t$uibModal.open({\n\t\t\t\ttemplateUrl: 'app/portal-admin/portal-admin-settings/setting-modal.html',\n\t\t\t\tcontroller: 'setting-modal.controller',\n\t\t\t\tcontrollerAs: 'settingModalCtrl',\n\t\t\t\tsize: 'lg',\n\t\t\t\tresolve: {\n\t\t\t\t\tallSettings: function () {\n\t\t\t\t\t\treturn vm.settings;\n\t\t\t\t\t},\n\t\t\t\t\tsetting: function() {\n\t\t\t\t\t\treturn setting;\n\t\t\t\t\t},\n\t\t\t\t\tparentInit: function() {\n\t\t\t\t\t\treturn init;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** flip loading flag */\n\t\t\tvm.loading = true;\n\n\t\t\t/** load links */\n\t\t\tconfigRepo.getSettings().then(function(settings) {\n\t\t\t\t/** set settings */\n\t\t\t\tvm.settings = settings;\n\n\t\t\t\t/** flip loading flag */\n\t\t\t\tvm.loading = false;\n\t\t\t});\n\t\t}\n\t}\n})();","/**\n * setting-modal.controller\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add controller */\n\tangular.module('nha.portal').controller('setting-modal.controller', settingModalController);\n\n\t/** setup injection */\n\tsettingModalController.$inject = ['$uibModalInstance', 'config.repository', 'setting', 'allSettings', 'parentInit'];\n\n\t/** implementation */\n\tfunction settingModalController($uibModalInstance, configRepo, setting, allSettings, parentInit) {\n\t\t/** pubic properties */\n\t\tvar vm = this;\n\t\tvm.original = setting || createSetting();\n\t\tvm.setting = angular.copy(vm.original);\n\t\tvm.environments = [];\n\t\tvm.loading = false;\n\t\tvm.saving = false;\n\t\tvm.isAllEnv = checkIsAllEnv();\n\t\tvm.isNew = setting ? false : true;\n\n\t\t/** public methods (portalLink) */\n\t\tvm.save = save;\n\t\tvm.remove = remove;\n\t\tvm.isValidNewSettingKey = isValidNewSettingKey;\n\t\tvm.checkEnvValues = checkEnvValues;\n\t\tvm.close = close;\n\t\tvm.cancel = cancel;\n\n\t\t/** run init */\n\t\tinit();\n\n\t\t/** public method implementations */\n\n\t\t/** save the link */\n\t\tfunction save() {\n\t\t\t/** flip saving flag */\n\t\t\tvm.saving = true;\n\n\t\t\t/** set the settingKey value */\n\t\t\tvm.original.settingKey = vm.setting.settingKey;\n\t\t\tvm.original.settingValues = [];\n\n\t\t\t/** check the isAllEnv flag */\n\t\t\tif (vm.isAllEnv) {\n\t\t\t\t/** get the all environment value */\n\t\t\t\tvar value = vm.environments.find(function (env) { return env.environmentID === 1; }).value;\n\n\t\t\t\t/** add the all environment setting value */\n\t\t\t\tvm.original.settingValues.push({\n\t\t\t\t\tsettingID: vm.setting.settingID,\n\t\t\t\t\tenvironmentID: 1,\n\t\t\t\t\tsettingValue: value\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t/** cycle through environment values to add settingValue for each */\n\t\t\t\tvm.environments.forEach(function (env) {\n\t\t\t\t\t/** ignore all env option */\n\t\t\t\t\tif (env.environmentID !== 1 && env.value !== null && env.value.length > 0) {\n\t\t\t\t\t\t/** add the all environment setting value */\n\t\t\t\t\t\tvm.original.settingValues.push({\n\t\t\t\t\t\t\tsettingID: vm.setting.settingID,\n\t\t\t\t\t\t\tenvironmentID: env.environmentID,\n\t\t\t\t\t\t\tsettingValue: env.value\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/** send the request to activate/deactivate */\n\t\t\tconfigRepo.saveSetting(vm.original).then(function(newSetting) {\n\t\t\t\t/** show the success message */\n\t\t\t\tswal({\n\t\t\t\t\t'title': 'Save Complete',\n\t\t\t\t\t'text': 'The processing has completed. The link was saved successfully.',\n\t\t\t\t\t'type': 'success'\n\t\t\t\t}, function() {\n\t\t\t\t\t/** flip saving flag */\n\t\t\t\t\tvm.saving = false;\n\t\t\t\t\t\n\t\t\t\t\t/** set original and copy */\n\t\t\t\t\tif (newSetting) {\n\t\t\t\t\t\tvm.original = newSetting;\n\t\t\t\t\t\tvm.setting = angular.copy(vm.original);\n\t\t\t\t\t}\n\n\t\t\t\t\t/** set isNew to false */\n\t\t\t\t\tvm.isNew = false;\n\t\t\t\t\tvm.isAllEnv = checkIsAllEnv();\n\n\t\t\t\t\t/** reinitialize the parent */\n\t\t\t\t\tparentInit();\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\t/** remove the setting */\n\t\tfunction remove() {\n\t\t\t/** show swal confirmation window */\n\t\t\tswal({\n\t\t\t\t'title': 'Are you sure you want to delete this setting?',\n\t\t\t\t'type': 'warning',\n\t\t\t\t'showCancelButton': true,\n\t\t\t\t'confirmButtonText': 'Yes, Delete It!',\n\t\t\t\t'closeOnConfirm': false\n\t\t\t}, function(isConfirm) {\n\t\t\t\t/** check the isConfirm flag */\n\t\t\t\tif (isConfirm) {\n\t\t\t\t\t/** flip saving flag */\n\t\t\t\t\tvm.saving = true;\n\n\t\t\t\t\t/** send the request to activate/deactivate */\n\t\t\t\t\tconfigRepo.removeSetting(vm.setting.settingID).then(function() {\n\t\t\t\t\t\t/** flip saving flag */\n\t\t\t\t\t\tvm.saving = false;\n\n\t\t\t\t\t\t/** show the success message */\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\t'title': 'Delete Complete',\n\t\t\t\t\t\t\t'text': 'The processing has completed. The setting was deleted successfully.',\n\t\t\t\t\t\t\t'type': 'success'\n\t\t\t\t\t\t}, function() {\n\t\t\t\t\t\t\t/** reinitialize the parent */\n\t\t\t\t\t\t\tparentInit();\n\n\t\t\t\t\t\t\t/** close modal */\n\t\t\t\t\t\t\tclose();\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\t/** check that at least one environment has a value */\n\t\tfunction checkEnvValues() {\n\t\t\tif (vm.isAllEnv) {\n\t\t\t\tif (vm.environments.find(function (env) { return env.environmentID === 1 && env.value !== null; })) return true;\n\t\t\t} else {\n\t\t\t\tvar hasValue = false;\n\t\t\t\tvm.environments.forEach(function (env) {\n\t\t\t\t\tif (env.environmentID !== 1 && env.value !== null && env.value !== '') {\n\t\t\t\t\t\thasValue = true;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn hasValue;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\t/** check that the key isn't already in use */\n\t\tfunction isValidNewSettingKey() {\n\t\t\tif (vm.isNew) {\n\t\t\t\tif (allSettings.find(function (s) { return s.settingKey === vm.setting.settingKey; })) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/** close the modal */\n\t\tfunction close() {\n\t\t\t$uibModalInstance.close();\n\t\t}\n\n\t\t/** cancel the modal */\n\t\tfunction cancel() {\n\t\t\t$uibModalInstance.dismiss();\n\t\t}\n\n\t\t/** private methods */\n\n\t\t/** initialize */\n\t\tfunction init() {\n\t\t\t/** toggle loading flag */\n\t\t\tvm.loading = true;\n\n\t\t\t/** load the environments */\n\t\t\tconfigRepo.getEnvironments().then(function (envs) {\n\t\t\t\t/** set environments */\n\t\t\t\tvm.environments = envs.map(function (env) {\n\t\t\t\t\t/** find the environment value */\n\t\t\t\t\tvar envSettingValue = null;\n\t\t\t\t\tif (vm.setting.settingValues) {\n\t\t\t\t\t\tenvSettingValue = vm.setting.settingValues.find(function (sv) {\n\t\t\t\t\t\t\treturn sv.environmentID === env.environmentID;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\t/** return an object */\n\t\t\t\t\tenv.value = envSettingValue ? envSettingValue.settingValue : null;\n\t\t\t\t\treturn env;\n\t\t\t\t});\n\n\t\t\t\t/** toggle loading flag */\n\t\t\t\tvm.loading = false;\n\t\t\t});\n\n\t\t\t/** set focus on the */\n\t\t\t$uibModalInstance.rendered.then(function() {\n\t\t\t\t$('.modal-body div input[type=\"text\"]:first').focus();\n\t\t\t});\n\t\t}\n\n\t\t/** check whether this is an all environment setting or not */\n\t\tfunction checkIsAllEnv() {\n\t\t\tif (vm.setting.settingValues.length === 1 && vm.setting.settingValues.find(function (sv) { return sv.environmentID === 1; })) return true;\n\t\t\treturn false;\n\t\t}\n\n\t\t/** create an empty setting entity */\n\t\tfunction createSetting() {\n\t\t\treturn {\n\t\t\t\tsettingID: 0,\n\t\t\t\tsettingKey: '',\n\t\t\t\tsettingTypeID: 4,\n\t\t\t\tlocationID: 1,\n\t\t\t\tisProtected: false,\n\t\t\t\tcreatedByUserName: '',\n\t\t\t\tlastModifiedByUserName: '',\n\t\t\t\tsettingValues: []\n\t\t\t};\n\t\t}\n\t}\n})();","/**\n * portal-admin.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalAdmin', portalAdminDirective);\n\n\t/** injection */\n\tportalAdminDirective.$inject = [];\n\n\t/** implementation */\n\tfunction portalAdminDirective() {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: 'app/portal-admin/portal-admin.directive.html',\n\t\t\tscope: {}\n\t\t};\n\t}\n})();","/**\n * portal-main.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portalMain', portalMainDirective);\n\n\t/** injection */\n\tportalMainDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction portalMainDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: 'app/portal-main/portal-main.directive.html',\n\t\t\tscope: {},\n\t\t\tlink: linkFunc\n\t\t};\n\n\t\t/** link function */\n\t\tfunction linkFunc(scope) {\n\t\t\t/** set the moduleID */\n\t\t\tscope.moduleID = appSettings.moduleID;\n\t\t}\n\t}\n})();","/**\n * portal.directive\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** get the angular module and add directive */\n\tangular.module('nha.portal').directive('portal', portalDirective);\n\n\t/** injection */\n\tportalDirective.$inject = ['appSettings'];\n\n\t/** implementation */\n\tfunction portalDirective(appSettings) {\n\t\t/** return directive */\n\t\treturn {\n\t\t\trestrict: 'E',\n\t\t\ttemplateUrl: 'app/portal/portal.directive.html',\n\t\t\tscope: {},\n\t\t\tlink: linkFunc\n\t\t};\n\n\t\t/** link function */\n\t\tfunction linkFunc(scope) {\n\t\t\t/** set the moduleID */\n\t\t\tscope.settingKey = appSettings.moduleSettingKey;\n\t\t}\n\t}\n})();","/**\n * birthday.repository\n * @namespace portal\n * @description This should probably move to a separate module for the DataWarehouse once it has a web application, or we move to the CDN\n */\n\n(function () {\n\t'use strict';\n\n\t/** add the repo */\n\tangular.module('nha.portal').service('birthday.repository', birthdayRepo);\n\n\t/** injection */\n\tbirthdayRepo.$inject = ['repositoryFactory', 'DataWarehouseRestangular'];\n\n\t/** implementation */\n\tfunction birthdayRepo(repositoryFactory, dataWarehouseRestangular) {\n\t\t/** create the repo */\n\t\tvar repo = new repositoryFactory('Birthday', dataWarehouseRestangular);\n\n\t\t/** return the repo */\n\t\treturn repo;\n\t}\n})();","/**\n * color.repository\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** add the repo */\n\tangular.module('nha.portal').service('color.repository', colorRepo);\n\n\t/** injection */\n\tcolorRepo.$inject = ['$q'];\n\n\t/** implementation */\n\tfunction colorRepo($q) {\n\t\t/** private properties */\n\t\tvar colors = [\n\t\t\t{ 'label': 'Gray', 'value': '#8E9697'},\n\t\t\t{ 'label': 'Blue', 'value': '#00D3F7'},\n\t\t\t{ 'label': 'Medium Blue', 'value': '#00AEEF' },\n\t\t\t{ 'label': 'Dark Blue', 'value': '#00539F' },\n\t\t\t{ 'label': 'Green', 'value': '#AED900'},\n\t\t\t{ 'label': 'Dark Green', 'value': '#77B800'},\n\t\t\t{ 'label': 'Orange', 'value': '#FE6401'}\n\t\t];\n\n\t\t/** get the colors */\n\t\tfunction getAll() {\n\t\t\t/** create a promise */\n\t\t\tvar deferred = $q.defer();\n\n\t\t\t/** resolve the promise */\n\t\t\tdeferred.resolve(colors);\n\n\t\t\t/** return the promise */\n\t\t\treturn deferred.promise;\n\t\t}\n\n\t\t/** create the service */\n\t\tvar service = {\n\t\t\tgetAll: getAll\n\t\t};\n\n\t\t/** return the service */\n\t\treturn service;\n\t}\n})();","(function () {\r\n\t'use strict';\r\n\r\n\tangular.module('nha.portal').service('config-frontend-web-source.repository', configFrontEndWebSourceRepo);\r\n\r\n\tconfigFrontEndWebSourceRepo.$inject = ['PortalRestangular', 'baseService'];\r\n\r\n\tfunction configFrontEndWebSourceRepo(portalRestangular, baseService) {\r\n\t\t/** create the repo */\r\n\t\tvar repo = {\r\n\t\t\tendpoint: 'ConfigFrontEndWebSource',\r\n\t\t\tgetKeys: getKeys,\r\n\t\t\tgetEnvironments: getEnvironments\r\n\t\t};\r\n\r\n\t\t/** public methods */\r\n\r\n\t\tfunction getKeys() {\r\n\t\t\treturn baseService.getList(repo.endpoint.concat('/keys/'), null, false, false, portalRestangular);\r\n\t\t}\r\n\r\n\t\tfunction getEnvironments() {\r\n\t\t\treturn baseService.getList(repo.endpoint.concat('/environments/'), null, false, false, portalRestangular);\r\n\t\t}\r\n\r\n\t\t/** return the repo */\r\n\t\treturn repo;\r\n\t}\r\n}());","(function () {\r\n\t'use strict';\r\n\r\n\tangular.module('nha.portal').service('config.repository', configRepo);\r\n\r\n\tconfigRepo.$inject = ['PortalRestangular', 'baseService'];\r\n\r\n\tfunction configRepo(portalRestangular, baseService) {\r\n\t\t/** create the repo */\r\n\t\tvar repo = {\r\n\t\t\tendpoint: 'config',\r\n\t\t\tgetSettings: getSettings,\r\n\t\t\tgetEnvironments: getEnvironments,\r\n\t\t\tsaveSetting: saveSetting,\r\n\t\t\tremoveSetting: removeSetting,\r\n\t\t\thasApplication: hasApplication\r\n\t\t};\r\n\r\n\t\t/** public methods */\r\n\r\n\t\tfunction getEnvironments() {\r\n\t\t\treturn baseService.getList(repo.endpoint.concat('/environments'), null, false, false, portalRestangular);\r\n\t\t}\r\n\r\n\t\tfunction getSettings() {\r\n\t\t\treturn baseService.getList(repo.endpoint.concat('/settings'), null, false, false, portalRestangular);\r\n\t\t}\r\n\r\n\t\tfunction saveSetting(setting) {\r\n\t\t\treturn portalRestangular.all(repo.endpoint.concat('/settings/save')).customPOST(setting);\r\n\t\t}\r\n\r\n\t\tfunction removeSetting(settingID) {\r\n\t\t\treturn portalRestangular.one(repo.endpoint.concat('/settings/remove'), settingID).remove();\r\n\t\t}\r\n\r\n\t\tfunction hasApplication(schoolID, settingKey) {\r\n\t\t\treturn portalRestangular.all(this.endpoint + '/hasapplication?schoolID=' + schoolID + '&settingKey=' + settingKey).customGET().then(function (result) {\r\n\t\t\t\treturn result;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t/** return the repo */\r\n\t\treturn repo;\r\n\t}\r\n}());","/**\n * portal-link-busiess-application.repository\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** add the repo */\n\tangular.module('nha.portal').service('portal-link-busiess-application.repository', portalLinkBusinessApplicationRepo);\n\n\t/** injection */\n\tportalLinkBusinessApplicationRepo.$inject = ['repositoryFactory', 'PortalRestangular'];\n\n\t/** implementation */\n\tfunction portalLinkBusinessApplicationRepo(repositoryFactory, portalRestangular) {\n\t\t/** create the repo */\n\t\tvar repo = new repositoryFactory('PortalLinkBusinessApplication', portalRestangular);\n\n\t\t/** return the repo */\n\t\treturn repo;\n\t}\n})();","/**\n * portal-link-group-link.repository\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** add the repo */\n\tangular.module('nha.portal').service('portal-link-group-link.repository', portalLinkGroupLinkRepo);\n\n\t/** injection */\n\tportalLinkGroupLinkRepo.$inject = ['repositoryFactory', 'PortalRestangular'];\n\n\t/** implementation */\n\tfunction portalLinkGroupLinkRepo(repositoryFactory, portalRestangular) {\n\t\t/** create the repo */\n\t\tvar repo = new repositoryFactory('PortalLinkGroupLink', portalRestangular);\n\n\t\t/** additional public methods */\n\t\trepo.getForGroup = getForGroup;\n\t\trepo.reorder = reorder;\n\n\t\t/** reorder the group links */\n\t\tfunction reorder(groups) {\n\t\t\treturn this.put(groups, '/reorder');\n\t\t}\n\n\t\t/** get the group links */\n\t\tfunction getForGroup(groupID) {\n\t\t\t/** send request */\n\t\t\treturn portalRestangular.all(this.endpoint + '/getforgroup/' + groupID).customGET().then(function(portalLinkGroupLinks) {\n\t\t\t\t/** return group links */\n\t\t\t\treturn portalLinkGroupLinks;\n\t\t\t});\n\t\t}\n\n\t\t/** return the repo */\n\t\treturn repo;\n\t}\n})();","/**\n * portal-link-group.repository\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** add the repo */\n\tangular.module('nha.portal').service('portal-link-group.repository', portalLinkGroupRepo);\n\n\t/** injection */\n\tportalLinkGroupRepo.$inject = ['$q', 'repositoryFactory', 'PortalRestangular'];\n\n\t/** implementation */\n\tfunction portalLinkGroupRepo($q, repositoryFactory, portalRestangular) {\n\t\t/** private properties */\n\t\tvar portalGroups = [];\n\n\t\t/** create the repo */\n\t\tvar repo = new repositoryFactory('PortalLinkGroup', portalRestangular);\n\n\t\t/** additional public methods */\n\t\trepo.getForUser = getForUser;\n\t\trepo.reorder = reorder;\n\t\trepo.resetGroups = resetGroups;\n\n\t\t/** get the groups for the user */\n\t\tfunction getForUser() {\n\t\t\t/** create the promise */\n\t\t\tvar deferred = $q.defer();\n\n\t\t\t/** check for portal groups */\n\t\t\tif (portalGroups.length > 0) {\n\t\t\t\t/** set the current context */\n\t\t\t\tdeferred.resolve(portalGroups);\n\t\t\t} else {\n\t\t\t\t/** load portal links */\n\t\t\t\trepo.getAll({ 'filter': { 'IsEnabled': true } }).then(function(groups) {\n\t\t\t\t\t/** set portal groups */\n\t\t\t\t\tportalGroups = groups;\n\n\t\t\t\t\t/** set the current context */\n\t\t\t\t\tdeferred.resolve(portalGroups);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t/** return the promise */\n\t\t\treturn deferred.promise;\n\t\t}\n\n\t\t/** reorder the groups */\n\t\tfunction reorder(groups) {\n\t\t\treturn this.put(groups, '/reorder');\n\t\t}\n\n\t\t/** clear the groups */\n\t\tfunction resetGroups() {\n\t\t\tportalGroups = [];\n\t\t}\n\n\t\t/** return the repo */\n\t\treturn repo;\n\t}\n})();","/**\n * portal-link-location.repository\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** add the repo */\n\tangular.module('nha.portal').service('portal-link-location.repository', portalLinkLocationRepo);\n\n\t/** injection */\n\tportalLinkLocationRepo.$inject = ['repositoryFactory', 'PortalRestangular'];\n\n\t/** implementation */\n\tfunction portalLinkLocationRepo(repositoryFactory, portalRestangular) {\n\t\t/** create the repo */\n\t\tvar repo = new repositoryFactory('PortalLinkLocation', portalRestangular);\n\n\t\t/** additional public methods */\n\t\trepo.postAll = postAll;\n\n\t\t/** create multiple portal link location records */\n\t\tfunction postAll(portalLinkLocations) {\n\t\t\treturn portalRestangular.all(repo.endpoint.concat('/postall')).customPOST(portalLinkLocations);\n\t\t}\n\n\t\t/** return the repo */\n\t\treturn repo;\n\t}\n})();","/**\n * portal-link-role.repository\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** add the repo */\n\tangular.module('nha.portal').service('portal-link-role.repository', portalLinkRoleRepo);\n\n\t/** injection */\n\tportalLinkRoleRepo.$inject = ['repositoryFactory', 'PortalRestangular'];\n\n\t/** implementation */\n\tfunction portalLinkRoleRepo(repositoryFactory, portalRestangular) {\n\t\t/** create the repo */\n\t\tvar repo = new repositoryFactory('PortalLinkRole', portalRestangular);\n\n\t\t/** return the repo */\n\t\treturn repo;\n\t}\n})();","/**\n * portal-link.repository\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** add the repo */\n\tangular.module('nha.portal').service('portal-link.repository', portalLinkRepo);\n\n\t/** injection */\n\tportalLinkRepo.$inject = ['$q', 'repositoryFactory', 'PortalRestangular'];\n\n\t/** implementation */\n\tfunction portalLinkRepo($q, repositoryFactory, portalRestangular) {\n\t\t/** private properties */\n\t\tvar pageSize = 25;\n\t\tvar loadedCount = 0;\n\t\tvar moreExist = true;\n\t\tvar loadedLinks = [];\n\n\t\t/** create the repo */\n\t\tvar repo = new repositoryFactory('PortalLink', portalRestangular);\n\n\t\t/** public methods */\n\t\trepo.search = search;\n\t\trepo.getForSettingKey = getForSettingKey;\n\t\trepo.hasPortalLink = hasPortalLink;\n\t\trepo.load = load;\n\n\t\t/** search the subject codes */\n\t\tfunction search(searchString, portalLinkGroupID) {\n\t\t\t/** send request */\n\t\t\treturn portalRestangular.all(this.endpoint + '/search?searchString=' + searchString + (portalLinkGroupID ? '&excludeGroup=' + portalLinkGroupID : '')).customGET().then(function(matches) {\n\t\t\t\t/** return matches */\n\t\t\t\treturn matches;\n\t\t\t});\n\t\t}\n\n\t\t/** get for the settings key */\n\t\tfunction getForSettingKey(settingKey) {\n\t\t\t/** send request */\n\t\t\treturn portalRestangular.all(this.endpoint + '/getforsettingkey?settingKey=' + settingKey).customGET().then(function(portalLinks) {\n\t\t\t\t/** return portal links */\n\t\t\t\treturn portalLinks;\n\t\t\t});\n\t\t}\n\n\t\t/** check to see if the user has the portal link */\n\t\tfunction hasPortalLink(settingKey) {\n\t\t\t/** send request */\n\t\t\treturn portalRestangular.all(this.endpoint + '/haslink?settingKey=' + settingKey).customGET().then(function (result) {\n\t\t\t\t/** return boolean value */\n\t\t\t\treturn result;\n\t\t\t});\n\t\t}\n\n\t\t/** load portal links by paging */\n\t\tfunction load() {\n\t\t\t/** prepare params and repo */\n\t\t\tvar params = '?$top=' + pageSize + '&$skip=' + loadedCount + '&$orderby=PortalLinkName';\n\n\t\t\t/** check for moreExist */\n\t\t\tif (!moreExist) {\n\t\t\t\t/** return empty promise */\n\t\t\t\tvar deferred = $q.defer();\n\t\t\t\tdeferred.resolve(loadedLinks);\n\t\t\t\treturn deferred.promise;\n\t\t\t}\n\n\t\t\t/** load a page of data */\n\t\t\treturn this.getAll(null, { 'shouldCache': false, 'urlAppendString': params }).then(function(portalLinks) {\n\t\t\t\t/** add to loadedCount and check for more */\n\t\t\t\tloadedCount += portalLinks.length;\n\t\t\t\tif (portalLinks.length < pageSize) moreExist = false;\n\n\t\t\t\t/** add to loadedLinks and return */\n\t\t\t\tloadedLinks = loadedLinks.concat(portalLinks);\n\t\t\t\treturn loadedLinks;\n\t\t\t});\n\t\t}\n\n\t\t/** return the repo */\n\t\treturn repo;\n\t}\n})();","/**\n * portal-quick-link.repository\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** add the repo */\n\tangular.module('nha.portal').service('portal-quick-link.repository', portalQuickLinkRepo);\n\n\t/** injection */\n\tportalQuickLinkRepo.$inject = ['repositoryFactory', 'PortalRestangular'];\n\n\t/** implementation */\n\tfunction portalQuickLinkRepo(repositoryFactory, portalRestangular) {\n\t\t/** create the repo */\n\t\tvar repo = new repositoryFactory('PortalQuickLink', portalRestangular);\n\n\t\t/** additional public methods */\n\t\trepo.reorder = reorder;\n\n\t\t/** define custom method */\n\t\tfunction reorder(quicklinks) {\n\t\t\treturn this.put(quicklinks, '/reorder');\n\t\t}\n\n\t\t/** return the repo */\n\t\treturn repo;\n\t}\n})();","/**\n * staff-favorite.repository\n * @namespace portal\n */\n\n(function () {\n\t'use strict';\n\n\t/** add the repo */\n\tangular.module('nha.portal').service('staff-favorite.repository', staffFavoriteRepo);\n\n\t/** injection */\n\tstaffFavoriteRepo.$inject = ['repositoryFactory', 'PortalRestangular'];\n\n\t/** implementation */\n\tfunction staffFavoriteRepo(repositoryFactory, portalRestangular) {\n\t\t/** create the repo */\n\t\tvar repo = new repositoryFactory('StaffFavorite', portalRestangular);\n\n\t\t/** additional public methods */\n\t\trepo.getForUser = getForUser;\n\t\trepo.reorder = reorder;\n\t\trepo.deleteForUser = deleteForUser;\n\n\t\t/** get the favorites for a user */\n\t\tfunction getForUser() {\n\t\t\t/** send request */\n\t\t\treturn portalRestangular.all(this.endpoint + '/getforuser').customGET().then(function(staffFavorites) {\n\t\t\t\t/** return staff favorites */\n\t\t\t\treturn staffFavorites;\n\t\t\t});\n\t\t}\n\n\t\t/** define custom method */\n\t\tfunction reorder(favorites) {\n\t\t\treturn this.put(favorites, '/reorder');\n\t\t}\n\n\t\t/** delete the favorite for the user by the portalLinkID */\n\t\tfunction deleteForUser(portalLinkID) {\n\t\t\treturn portalRestangular.one(this.endpoint + '/deleteforuser', portalLinkID).remove();\n\t\t}\n\n\t\t/** return the repo */\n\t\treturn repo;\n\t}\n})();"],"names":["config","$provide","decorator","svElementDecorator","$delegate","$parse","newLinkFunc","$scope","$element","$attrs","$controllers","sortableElement","element","getPart","getIndex","$index","addToSortableElements","$on","removeFromSortableElements","startTimer","helper","placeholder","handle","clearEvent","clearTimeout","opts","svElement","angular","extend","delay","disabled","event","onMousedown","e","html","on","setTimeout","$watch","customHandle","off","customHelper","customPlaceholder","moveExecuted","document","documentElement","touchFix","sortingInProgress","button","type","isForBehaviorList","toElement","ownerDocument","URL","indexOf","words","_","numbers","remove","n","isNaN","drop","chunk","difference","length","tolerance","revert","containment","containmentRect","closestElement","call","getBoundingClientRect","clone","target","clientRect","removeClass","css","left","body","scrollLeft","top","scrollTop","addClass","width","context","clientWidth","lastElementChild","reposition","coords","targetLeft","x","targetTop","y","helperRect","height","this","style","pointerOffset","clientX","clientY","onMousemove","mouseup","$drop","parent","prepend","$moveUpdate","offset","touches","originalEvent","preventDefault","compile","prototype","closest","selector","el","parentNode","matchingFunction","module","$inject","String","contains","str","toLowerCase","replace","stripHtml","tmp","createElement","innerHTML","textContent","innerText","Array","item","$","inArray","splice","compare","array","missingValues","i","push","_ng","moduleInit","run","$location","$rootScope","stateTransitionSecurityCheck","userContextService","appSettings","ensureUserContext","then","user","window","TagManagerService","setupUserID","attachStateChangeListener","defaultPageTitle","toState","hasOwnProperty","title","$stateProvider","$urlRouterProvider","$locationProvider","$breadcrumbProvider","$sceDelegateProvider","$compileProvider","RestangularProvider","resourceUrlWhitelist","environment","debugInfoEnabled","html5Mode","enabled","requireBase","otherwise","setBaseUrl","portalServicesRootUrl","setOptions","templateUrl","coreWebRootUrl","includeAbstract","state","abstract","url","template","ncyBreadcrumb","skip","label","resolve","authorization","resolveAuthorization","data","security","requiredResource","api","nhaBrandingDirective","restrict","portalWebRootUrl","scope","directive","portalAppLogoController","portalLinkRepository","vm","loading","portalLink","getForSettingKey","settingKey","controller","portalAppLogoDirective","controllerAs","bindToController","isTraining","portalFavoritesController","toastr","portalFavoritesManager","setFavorites","favorites","reorder","forEach","fav","index","favoriteOrderNumber","reorderFavorites","success","positionClass","getFavorites","addCallback","portalFavoritesDirective","portalGroupListController","$timeout","portalLinkGroupRepository","portalGroups","searching","searchString","searchResults","searchLinks","search","matches","closeSearch","getForUser","filter","g","linkCount","portalGroupListDirective","portalGroupController","$window","$q","portalLinkGroupLinkRepository","windowElement","groupLinks","positionHandler","scrollY","pageYOffset","fixedLinks","showLinks","viewLinks","deferred","preview","defer","getForGroup","group","portalLinkGroupID","gl","promise","close","isFavorite","portalLinkID","portalGroupDirective","portalLauncherDirective","portalLinkListController","portalLinks","getAll","portalLinkListDirective","portalLinkController","$sce","toggleFavorite","getUrl","link","linkUrl","getSVG","iconSVG","trustAsHtml","portalLinkDirective","sidebar","portalMiniLauncherController","messageManager","active","toggleLauncher","setData","message","key","value","visible","portalMiniLauncherDirective","portalMiniSearchController","toggleSearch","portalMiniSearchDirective","portalSearchController","portalSearchManager","portalAppContextManager","academicYearRepository","loadingMore","schoolID","currentSearchScope","searchOptions","currentAcademicYearScope","currentAndNextAcademicYearScope","academicYears","searchResultCount","searchMessage","schoolIDs","cancelor","setSearchScope","searchOption","clearSearch","resetPagingOptions","setAcademicYearScope","academicYear","hideLoader","searchMethod","searchStudents","searchStaff","searchParents","academicYearID","results","items","sort","a","b","keyA","lastName","firstName","keyB","count","getSearchOptions","ensurePortalContext","school","getAllAcademicYears","reverse","ay","isCurrent","roles","portalSearchDirective","$http","service","pageSize","loadedCount","moreExist","currentResults","currentCount","currentSearchCriteria","getParams","params","map","parseInt","includes","adjustGradeLevelName","gradeLevelName","searchCriteria","searchText","take","get","s","gradeLevelNameAdjusted","concat","numArr","phoneNumber","match","join","parentName","$orderby","$inlinecount","$top","$skip","p","optOut","doNotCall","doNotText","doNotEmail","doNotMail","phoneNumbers","studentGroups","students","gradeLevelNameDesc","studentID","studentInSchool","staffName","orderby","searchResultController","adjustStudentUrl","id","studentUrl","staffUrl","parentUrl","studentManagementWebRootUrl","staffManagementWebRootUrl","result","staffID","guardianID","academicYearId","schoolId","studentInSchoolID","searchResultDirective","portalSidebarController","portalQuickLinkRepository","quickLinksVisible","favoritesVisible","quickLinks","portalSidebarDirective","text","$state","$interval","ipCookie","appContextFactory","contextManager","interval","defaultSchoolCookieName","defaultSchool","cancel","undefined","appContextModel","role","commonname","usersSchools","getUserContext","isArray","getContext","ensureAppContext","resetContext","forIn","setBreadcrumbLabel","stateName","ncyBreadcrumbLabel","pubSubFactory","staffFavoriteRepository","pubSubManager","deleteForUser","removeFavorite","post","favorite","orderNumber","addFavorite","getData","groupModalController","$uibModalInstance","portalLinkGroupRepo","portalLinkGroupLinkRepo","colorRepo","portalGroup","parentInit","loadLinks","portalLinkGroupLinks","toggleSearchResults","sr","saving","isNew","original","copy","tab","colors","save","merge","portalLinkGroup","swal","resetGroups","activate","isEnabled","put","isConfirm","addLink","lastGroupLink","last","portalLinkGroupLink","removeLink","portalLinkGroupLinkID","dismiss","rendered","focus","portalAdminGroupsController","$uibModal","init","groups","openGroupModal","open","size","linkModalController","portalLinkRepo","portalLinkRoleRepo","portalLinkLocationRepo","configRepo","roleRepo","roleTypeRepo","stateRepository","schoolService","getSchoolOptions","schools","selectedState","portalLinkLocations","pll","stateID","allSchools","sc","schoolName","states","st","unshift","name","loadSupportData","roleTypes","loadPortalLinkRoles","getSchools","stateIDs","loadPortalLinkLocations","loadPortalLinkGroupsLinks","portalLinkGroups","plg","portalLinkGroupName","adjustPortalLinkGroups","portalLinkRoles","groupIDs","plgl","allSettings","selectedSetting","linkType","linkTypes","iconType","iconTypes","isRequired","selectedRole","selectedRoleType","selectedLocationType","locationTypes","selectedSchool","selectedGroup","newPortalLink","changeLinkType","portalSetting","changeIconType","iconLetters","iconClass","addRole","newPortalLinkRole","removeRole","portalLinkRole","portalLinkRoleID","plr","locationMessage","disableLocationAddBtn","isServiceCenter","isAllSchools","addLocation","newPortalLinkLocations","postAll","removeLocation","portalLinkLocation","portalLinkLocationID","addGroup","newPortalLinkGroupLink","removeGroup","getSettings","settings","find","portalAdminLinksController","links","today","moment","l","createdDayOfYear","createDate","changeDaysAgo","diff","openLinkModal","portalAdminQuickLinksController","portalQuickLinkRepo","loadQuickLinks","quicklinks","adjustPortalLinks","portalLinkIDs","ql","pl","selectedPortalLink","addQuickLink","quicklink","removeQuickLink","portalQuickLinkID","portalLinkName","portalAdminSettingsController","openModal","setting","settingModalController","checkIsAllEnv","settingValues","sv","environmentID","settingID","settingTypeID","locationID","isProtected","createdByUserName","lastModifiedByUserName","environments","isAllEnv","env","settingValue","saveSetting","newSetting","removeSetting","isValidNewSettingKey","checkEnvValues","hasValue","getEnvironments","envs","envSettingValue","portalAdminDirective","portalMainDirective","moduleID","portalDirective","moduleSettingKey","birthdayRepo","repositoryFactory","dataWarehouseRestangular","configFrontEndWebSourceRepo","portalRestangular","baseService","repo","endpoint","getKeys","getList","all","customPOST","one","hasApplication","customGET","portalLinkBusinessApplicationRepo","groupID","loadedLinks","hasPortalLink","load","staffFavoriteRepo","staffFavorites"],"sourceRoot":""}