1 dump('entering patron/display.js\n');
3 if (typeof patron == 'undefined') patron = {};
4 patron.display = function (params) {
6 JSAN.use('util.error'); this.error = new util.error();
7 JSAN.use('main.window'); this.window = new main.window();
8 JSAN.use('main.network'); this.network = new main.network();
12 patron.display.prototype = {
14 'init' : function( params ) {
16 this.session = params['session'];
17 this.barcode = params['barcode'];
19 JSAN.use('OpenILS.data'); this.OpenILS = {};
20 this.OpenILS.data = new OpenILS.data( { 'session' : params.session } ); this.OpenILS.data.init(true);
23 obj.view = {}; obj.render_list = [];
28 function() { alert('Not Yet Implemented'); }
34 e.setAttribute('label',obj.patron.family_name() + ', '
35 + obj.patron.first_given_name());
44 e.setAttribute('value',
45 obj.OpenILS.data.hash.pgt[
55 return function() { };
61 return function() { };
64 'patron_checkouts' : [
67 return function() { };
73 return function() { };
79 return function() { };
82 'patron_holds_available' : [
85 return function() { };
91 return function() { };
94 'patron_ident_type_1' : [
97 return function() { };
100 'patron_ident_value_1' : [
103 return function() { };
106 'patron_ident_type_2' : [
109 return function() { };
112 'patron_date_of_birth' : [
115 return function() { };
118 'patron_day_phone' : [
121 return function() { };
124 'patron_evening_phone' : [
127 return function() { };
130 'patron_other_phone' : [
133 return function() { };
139 return function() { };
142 'patron_mailing_address_street1' : [
145 return function() { };
148 'patron_mailing_address_street2' : [
151 return function() { };
154 'patron_mailing_address_city' : [
157 return function() { };
160 'patron_mailing_address_state' : [
163 return function() { };
166 'patron_mailing_address_post_code' : [
169 return function() { };
172 'patron_physical_address_street1' : [
175 return function() { };
178 'patron_physical_address_street2' : [
181 return function() { };
184 'patron_physical_address_city' : [
187 return function() { };
190 'patron_physical_address_state' : [
193 return function() { };
196 'patron_physical_address_post_code' : [
199 return function() { };
204 for (var i in control_map) {
205 var cmd = this.w.document.getElementById(i);
207 for (var j in control_map[i][0]) {
208 if (control_map[i][1]) {
209 var ev_type = control_map[i][0][j];
212 obj.render_list.push( control_map[i][1](cmd) );
214 default: cmd.addEventListener(ev_type,control_map[i][1],false);
226 'retrieve' : function() {
230 patron = this.network.request(
232 'open-ils.actor.user.fleshed.retrieve_by_barcode',
233 [ this.session, this.barcode ]
238 if (instanceOf(patron,au)) {
240 this.patron = patron;
245 throw('patron is not an au fm object');
249 throw('patron == false');
253 var error = ('patron.display.retrieve : ' + js2JSON(E));
254 this.error.sdump('D_ERROR',error);
259 'render' : function() {
261 for (var i in this.render_list) {
263 this.render_list[i]();
265 var error = 'Problem in patron.display.render with\n' + this.render_list[i] + '\n\n' + js2JSON(E);
266 this.error.sdump('D_ERROR',error);
273 dump('exiting patron/display.js\n');