From: Bill Erickson Date: Thu, 7 May 2015 02:41:09 +0000 (-0400) Subject: patron reg cont. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=73568bfa3785535001560f13d53741e0a79dfcee;p=working%2FEvergreen.git patron reg cont. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 index 98f0102167..7320247549 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_edit.tt2 @@ -8,29 +8,118 @@
{{selected_field_doc.string()}}
+[% MACRO formfield(cls, field, path, input_type) BLOCK %] +[% IF NOT input_type; input_type = 'text'; END %] +
+
+ + +
+
+ [% IF path %] + + + [% ELSE %] + + [% END %] +
+
+[% END %] -
+[% formfield('ac', 'barcode', 'card') %] +[% formfield('au', 'usrname') %] +[% formfield('au', 'passwd') %] +[% formfield('au', 'prefix') %] +[% formfield('au', 'first_given_name') %] +[% formfield('au', 'second_given_name') %] +[% formfield('au', 'family_name') %] +[% formfield('au', 'suffix') %] +[% formfield('au', 'alias') %] +[% formfield('au', 'dob') %] +[% formfield('au', 'juvenile', '', 'checkbox') %] + + + +[% formfield('au', 'ident_value') %] +[% formfield('au', 'ident_value2') %] +[% formfield('au', 'email') %] +[% formfield('au', 'day_phone') %] +[% formfield('au', 'evening_phone') %] +[% formfield('au', 'other_phone') %] + + + +
- {{idl_fields.ac.barcode.label}} - {{idl_fields.au.home_ou.label}} +
- +
-
+ + +
- {{idl_fields.au.usrname.label}} - {{idl_fields.au.home_ou.label}} +
- +
+ + +
+
+
+ + +
+
+ +
+
+ + + +[% formfield('au', 'active', '', 'checkbox') %] +[% formfield('au', 'barred', '', 'checkbox') %] +[% formfield('au', 'master_account', '', 'checkbox') %] +[% formfield('au', 'claims_returned_count', '', 'number') %] +[% formfield('au', 'claims_never_checked_out_count', '', 'number') %] +[% formfield('au', 'alert_message') %] + + + + + + + diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js index 1e72b7592a..76faf45ec7 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js @@ -4,17 +4,35 @@ angular.module('egCoreMod') .factory('patronRegSvc', ['$q', 'egCore', function($q, egCore) { - var service = {}; + var service = { + field_doc : {}, + profiles : [] + }; service.init = function(scope) { return $q.all([ service.get_field_doc(), + service.get_perm_groups() ]); }; - service.get_field_doc = function() { + service.get_perm_groups = function() { + if (egCore.env.pgt) { + service.profiles = egCore.env.pgt.list; + return $q.when(); + } else { + return egCore.pcrud.search('pgt', {parent : null}, + {flesh : -1, flesh_fields : {pgt : ['children']}} + ).then( + function(tree) { + egCore.env.absorbTree(tree, 'pgt') + service.profiles = egCore.env.pgt.list; + } + ); + } + } - service.field_doc = {}; + service.get_field_doc = function() { return egCore.pcrud.search('fdoc', { fm_class: ['au', 'ac', 'aua', 'actsc', 'asv', 'asvq', 'asva']}) @@ -34,9 +52,18 @@ angular.module('egCoreMod') function PatronRegCtrl($scope, $routeParams, $location, egCore, patronSvc, patronRegSvc) { + // fetch needed data and toss it into the scope. patronRegSvc.init().then(function() { $scope.field_doc = patronRegSvc.field_doc; + $scope.profiles = patronRegSvc.profiles; }); + + // determine the tree depth of the profile group + $scope.pgt_depth = function(grp) { + var d = 0; + while (grp = egCore.env.pgt.map[grp.parent()]) d++; + return d; + } // only add the classes we care about to the scope to avoid bloat $scope.idl_fields = { @@ -48,10 +75,16 @@ function PatronRegCtrl($scope, $routeParams, if ($scope.initTab) { // Inside the patron app - $scope.initTab('other', $routeParams.id).then(function() { + $scope.initTab('edit', $routeParams.id).then(function() { $scope.patron = egCore.idl.toHash(patronSvc.current); + $scope.patron.home_ou_obj = + egCore.org.get($scope.patron.home_ou.id); + + $scope.patron.expire_date = + new Date(Date.parse($scope.patron.expire_date)); + }); } else { @@ -65,6 +98,11 @@ function PatronRegCtrl($scope, $routeParams, card : {} }; $scope.patron.isnew = true; + + // default to local workstation org + $scope.patron.home_ou_obj = + egCore.org.get(egCore.auth.user().ws_ou()); + } }