From: Bill Erickson Date: Fri, 11 Jul 2014 21:11:38 +0000 (-0400) Subject: initial patron reg / clone / edit integration (experimental) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f152fcf8f0d7b72cb33fc2d6f9cd4e743b3ff479;p=working%2FEvergreen.git initial patron reg / clone / edit integration (experimental) Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/circ/patron/register.tt2 b/Open-ILS/src/templates/staff/circ/patron/register.tt2 new file mode 100644 index 0000000000..53505a1831 --- /dev/null +++ b/Open-ILS/src/templates/staff/circ/patron/register.tt2 @@ -0,0 +1,15 @@ +[% + WRAPPER "staff/base.tt2"; + ctx.page_title = l("Patron Registration"); + ctx.page_app = "egPatronRegApp"; +%] + +[% BLOCK APP_JS %] + + + +[% END %] + +
+ +[% END %] diff --git a/Open-ILS/src/templates/staff/css/style.css.tt2 b/Open-ILS/src/templates/staff/css/style.css.tt2 index 6b1f31bc59..7d555a7801 100644 --- a/Open-ILS/src/templates/staff/css/style.css.tt2 +++ b/Open-ILS/src/templates/staff/css/style.css.tt2 @@ -169,6 +169,13 @@ table.list tr.selected td { /* deprecated? */ white-space:nowrap; } +.eg-legacy-frame { + width: 100%; + border: none; + margin: 0px; + padding: 0px; +} + /* ---------------------------------------------------------------------- * Grid * ---------------------------------------------------------------------- */ diff --git a/Open-ILS/src/templates/staff/navbar.tt2 b/Open-ILS/src/templates/staff/navbar.tt2 index 036dc40d67..7bf674c133 100644 --- a/Open-ILS/src/templates/staff/navbar.tt2 +++ b/Open-ILS/src/templates/staff/navbar.tt2 @@ -92,6 +92,12 @@
  • + + + [% l('Register Patron') %] + +
  • +
  • [% l('Retrieve Last Patron') %] diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/register.js b/Open-ILS/web/js/ui/default/staff/circ/patron/register.js new file mode 100644 index 0000000000..705c4cc5ca --- /dev/null +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/register.js @@ -0,0 +1,72 @@ +/** + * Patron App + * + * Search, checkout, items out, holds, bills, edit, etc. + */ + +angular.module('egPatronRegApp', ['ui.bootstrap','ngRoute','egCoreMod']) + + +.config(function($routeProvider, $locationProvider, $compileProvider) { + $locationProvider.html5Mode(true); + $compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|blob):/); // grid export + + var resolver = {delay : + ['egStartup', function(egStartup) {return egStartup.go()}]} + + $routeProvider.when('/circ/patron/register', { + template: '', + controller: 'PatronRegCtrl', + resolve : resolver + }); + + $routeProvider.when('/circ/patron/register/stage/:stage_username', { + template: '', + controller: 'PatronRegCtrl', + resolve : resolver + }); + + $routeProvider.when('/circ/patron/register/edit/:edit_id', { + template: '', + controller: 'PatronRegCtrl', + resolve : resolver + }); + + $routeProvider.when('/circ/patron/register/clone/:clone_id', { + template: '', + controller: 'PatronRegCtrl', + resolve : resolver + }); + + $routeProvider.otherwise({redirectTo : '/circ/patron/register'}); +}) + + +/** + * */ +.controller('PatronRegCtrl', + ['$scope','$routeParams','$location','$filter','egCore', +function($scope , $routeParams , $location , $filter , egCore) { + + + var url = $location.absUrl().replace(/\/staff.*/, '/actor/user/register'); + + // since we don't store auth cookies, pass the cookie via URL + url += '?ses=' + egCore.auth.token(); + + if ($routeParams.stage_username) { + url += '&stage=' + encodeURIComponent($routeParams.stage_username); + } + + if ($routeParams.edit_id) { + url += '&usr=' + encodeURIComponent($routeParams.edit_id); + } + + if ($routeParams.clone_id) { + url += '&clone=' + encodeURIComponent($routeParams.clone_id); + } + + console.log('URL = ' + url); + $scope.reg_url = url; +}]) + diff --git a/Open-ILS/web/js/ui/default/staff/services/lframe.js b/Open-ILS/web/js/ui/default/staff/services/lframe.js new file mode 100644 index 0000000000..a5ea654caa --- /dev/null +++ b/Open-ILS/web/js/ui/default/staff/services/lframe.js @@ -0,0 +1,25 @@ +angular.module('egCoreMod') + +/* + * Iframe container for legacy interfaces + */ +.directive('egLegacyFrame', function() { + return { + restrict : 'AE', + scope : { + url : '=' + }, + + template : '', + + controller : ['$scope','$window', function($scope, $window) { + + // Set the iframe height to just under the window height. + // leave room for the navbar, padding, margins, etc. + $scope.height = $window.outerHeight - 250; + }] + } +}) + +