-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from EmmetBlue/harm-ui
Harm ui
- Loading branch information
Showing
321 changed files
with
29,471 additions
and
2,903 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
angular.module("EmmetBlue") | ||
|
||
.controller('coreController', function($scope, $location, $routeParams, CONSTANTS, utils){ | ||
.controller('coreController', function($scope, $location, $routeParams, CONSTANTS, utils, $cookies){ | ||
$scope.loadImage = utils.loadImage; | ||
$scope.userClient = utils.globalConstants.USER_CLIENT; | ||
$scope.$on('$routeChangeSuccess', function(event, current, previous){ | ||
var path = ($location.path()).split('/'); | ||
var userDashboard = ("/"+utils.userSession.getDashboard()).split("/"); | ||
|
@@ -35,6 +36,33 @@ angular.module("EmmetBlue") | |
var checkLogin = function(){ | ||
if ($location.path() != '/user/login'){ | ||
utils.userSession.cookie(); | ||
|
||
$.sessionTimeout({ | ||
heading: 'h5', | ||
title: 'Session expiration', | ||
message: 'Your session is about to expire. Do you want to stay connected and extend your session?', | ||
keepAlive: false, | ||
warnAfter: 900000, //10 mins | ||
redirAfter: 1020000, //15 mins | ||
ignoreUserActivity: false, | ||
onWarn: function(){ | ||
var title = "IDLE TIMEOUT"; | ||
var text = "Your session is about to expire. Click on the cancel button to stay connected and extend your session or click on Logout to close the current session" | ||
var close = true; | ||
var type = "info"; | ||
var btnText = "Logout"; | ||
|
||
var process = function(){ | ||
$scope.logout(); | ||
} | ||
|
||
utils.confirm(title, text, close, process, type, btnText); | ||
}, | ||
onRedir: function(){ | ||
utils.notify('Your session has expired!', 'You are being redirected to the login page, please enter your username and password to access your account', 'info'); | ||
$scope.logout(); | ||
} | ||
}); | ||
} | ||
} | ||
|
||
|
@@ -78,9 +106,68 @@ angular.module("EmmetBlue") | |
} | ||
|
||
$scope.showEmmetBlueInfo = function(){ | ||
utils.alert("Emmetblue "+$scope.currentYear, "This software has been designed for and deployed to St. Gerard's Catholic Hospital. Unless stated otherwise, every part of the system is considered a property of Emmetblue and are presently in the closed-source domain with appropriate licenses. Contact an appropriate department for help or [email protected] for technical support.", "info"); | ||
utils.alert("Emmetblue "+$scope.currentYear, "This software has been customized for and deployed to "+$scope.userClient.short_name+". Unless stated otherwise, every part of the system is considered a property of Emmetblue and are presently in the closed-source domain with appropriate licenses. Contact an appropriate department for help or [email protected] for technical support.", "info"); | ||
} | ||
|
||
function updateCookieDashboardUrl(url, department = ""){ | ||
var cookie = $cookies.getObject(utils.globalConstants.USER_COOKIE_IDENTIFIER); | ||
cookie.dashboard = url; | ||
$cookies.putObject(utils.globalConstants.USER_COOKIE_IDENTIFIER, cookie); | ||
|
||
$location.path(url); | ||
if (department !== ""){ | ||
utils.storage.currentStaffDepartmentID = department | ||
} | ||
} | ||
|
||
$scope.$watch(function(){ | ||
return utils.storage.currentStaffDepartmentID; | ||
}, function(nv){ | ||
var req = utils.serverRequest("/human-resources/department/view?resourceId="+nv, "GET"); | ||
req.then(function(response){ | ||
$scope.currentDepartmentName = response[0].Name; | ||
}); | ||
}) | ||
|
||
$scope.switch = function(id){ | ||
var data = { | ||
"staff": utils.userSession.getID(), | ||
"department":id | ||
}; | ||
|
||
utils.serverRequest("/user/account/get-switch-data", "POST", data) | ||
.then(function(response){ | ||
updateCookieDashboardUrl(response.Url, response.DepartmentID); | ||
}, function(error){ | ||
utils.errorHandler(error); | ||
}) | ||
} | ||
|
||
$scope.returnToPrimaryDept = function(){ | ||
utils.serverRequest("/human-resources/staff/view-root-url?resourceId="+utils.userSession.getID(), "GET").then(function(response){ | ||
updateCookieDashboardUrl(response.Url, response.DepartmentID); | ||
}, function(error){ | ||
utils.errorHandler(error); | ||
}) | ||
} | ||
|
||
checkLogin(); | ||
loadUserProfile(); | ||
loadUserProfile(); | ||
|
||
$scope.loadSwitchableDepts = function(){ | ||
if (typeof $scope.switchableDepartments == "undefined"){ | ||
utils.serverRequest("/human-resources/staff-department/view-secondary-departments?resourceId="+utils.userSession.getID(), "GET") | ||
.then(function(response){ | ||
$scope.switchableDepartments = response; | ||
}, function(error){ | ||
utils.errorHandler(error); | ||
}) | ||
} | ||
} | ||
|
||
var userSessionQrCodeHandler = function(){ | ||
$(".userSessionQrCodeSvg").html(utils.generateQrCode(JSON.stringify(utils.userSession.cookie()), "user")); | ||
} | ||
|
||
userSessionQrCodeHandler(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
assets/angular/libraries/angular-bootstrap-calendar/angular-bootstrap-calendar-tpls.min.js
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
assets/angular/libraries/angular-bootstrap-calendar/angular-bootstrap-calendar.min.css
Large diffs are not rendered by default.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
assets/angular/libraries/angular-bootstrap-calendar/angular-bootstrap-calendar.min.js
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.