provider.refresh();
}
+ if (typeof BroadcastChannel != 'undefined') {
+ // connect 2 bChannel
+ holdings_bChannel = new BroadcastChannel('eg.pending_usr.update');
+ holdings_bChannel.onmessage = function(e){
+ if (e.data && e.data.usr.home_ou == $scope.context_org.id()){
+ // pending usr was registered, refresh grid!
+ console.log("Got broadcast from channel eg.pending_usr.update for usr id: " + e.data.usr.id);
+ refresh_page();
+ }
+ }
+ };
+
provider.get = function(offset, count) {
var deferred = $q.defer();
var recv_index = 0;
.controller('PatronRegCtrl',
['$scope','$routeParams','$q','$uibModal','$window','egCore',
'patronSvc','patronRegSvc','egUnloadPrompt','egAlertDialog',
- 'egWorkLog',
+ 'egWorkLog', '$timeout',
function($scope , $routeParams , $q , $uibModal , $window , egCore ,
patronSvc , patronRegSvc , egUnloadPrompt, egAlertDialog ,
- egWorkLog) {
+ egWorkLog, $timeout) {
$scope.page_data_loaded = false;
$scope.hold_notify_type = { phone : null, email : null, sms : null };
+ updated_user.id();
$window.open(url, '_blank').focus();
+ } else if ($window.location.href.indexOf('stage') > -1 ){
+ // we're here after deleting a self-reg staged user.
+ // Just close tab, since refresh won't find staged user
+ $timeout(function(){
+ if (typeof BroadcastChannel != 'undefined') {
+ var bChannel = new BroadcastChannel("eg.pending_usr.update");
+ bChannel.postMessage({
+ usr: egCore.idl.toHash(updated_user)
+ });
+ }
+
+ $window.close();
+ });
} else {
// reload the current page
$window.location.href = location.href;