url += '?usr=' + encodeURIComponent(user_id);
// user_edit does not load the session via cookie. It uses URL
- // params or xulG instead. We are forced to use URL params,
- // since xulG pass-thru's are not inserted until the iframe is
- // loaded.
- // xulG instead. Pass via xulG.
+ // params or xulG instead. Pass via xulG.
$scope.funcs = {
ses : egCore.auth.token(),
on_patron_save : function() {
- $window.location.reload();
+ $scope.funcs.reload();
}
}
resolve : resolver
});
+ $routeProvider.when('/circ/patron/:id/edit_perms', {
+ templateUrl: './circ/patron/t_edit_perms',
+ controller: 'PatronPermsCtrl',
+ resolve : resolver
+ });
+
$routeProvider.when('/circ/patron/:id/group', {
templateUrl: './circ/patron/t_group',
controller: 'PatronGroupCtrl',
$scope.funcs = {};
}])
+.controller('PatronPermsCtrl',
+ ['$scope','$routeParams','$window','$location','egCore',
+function($scope , $routeParams , $window , $location , egCore) {
+ $scope.initTab('other', $routeParams.id);
+
+ var url = $location.absUrl().replace(
+ /\/eg\/staff.*/, '/xul/server/patron/user_edit.xhtml');
+
+ url += '?usr=' + encodeURIComponent($routeParams.id);
+
+ // user_edit does not load the session via cookie. It uses URL
+ // params or xulG instead. Pass via xulG.
+ $scope.funcs = {
+ ses : egCore.auth.token(),
+ on_patron_save : function() {
+ $scope.funcs.reload();
+ }
+ }
+
+ $scope.user_perms_url = url;
+}])
+
handlers : '=',
// called after onload of each new iframe page
- onchange : '='
+ onchange : '=',
},
templateUrl : './share/t_eframe',
console.debug('egEmbedFrameLoader(): ' + page);
// reload ifram page w/o reloading the entire UI
- $scope.reload_page = function() {
+ $scope.reload = function() {
iframe.contentWindow.location.replace(
iframe.contentWindow.location);
}
}
if ($scope.handlers) {
+ $scope.handlers.reload = $scope.reload;
angular.forEach($scope.handlers, function(val, key) {
iframe.contentWindow.xulG[key] = val;
});