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());
43 e.setAttribute('value',
44 obj.OpenILS.data.hash.pgt[
54 return function() { };
60 return function() { };
63 'patron_checkouts' : [
66 return function() { };
72 return function() { };
78 return function() { };
81 'patron_holds_available' : [
84 return function() { };
90 return function() { };
93 'patron_ident_type_1' : [
96 return function() { };
99 'patron_ident_value_1' : [
102 return function() { };
105 'patron_ident_type_2' : [
108 return function() { };
111 'patron_date_of_birth' : [
114 return function() { };
117 'patron_day_phone' : [
120 return function() { };
123 'patron_evening_phone' : [
126 return function() { };
129 'patron_other_phone' : [
132 return function() { };
138 return function() { };
144 return function() { };
147 'patron_mailing_address_street1' : [
150 return function() { };
153 'patron_mailing_address_street2' : [
156 return function() { };
159 'patron_mailing_address_city' : [
162 return function() { };
165 'patron_mailing_address_state' : [
168 return function() { };
171 'patron_mailing_address_post_code' : [
174 return function() { };
177 'patron_physical_address_street1' : [
180 return function() { };
183 'patron_physical_address_street2' : [
186 return function() { };
189 'patron_physical_address_city' : [
192 return function() { };
195 'patron_physical_address_state' : [
198 return function() { };
201 'patron_physical_address_post_code' : [
204 return function() { };
209 for (var i in control_map) {
210 var cmd = this.w.document.getElementById(i);
212 for (var j in control_map[i][0]) {
213 if (control_map[i][1]) {
214 var ev_type = control_map[i][0][j];
217 obj.render_list.push( control_map[i][1](cmd) );
219 default: cmd.addEventListener(ev_type,control_map[i][1],false);
231 'retrieve' : function() {
235 patron = this.network.request(
237 'open-ils.actor.user.fleshed.retrieve_by_barcode',
238 [ this.session, this.barcode ]
243 if (instanceOf(patron,au)) {
245 this.patron = patron;
250 throw('patron is not an au fm object');
254 throw('patron == false');
258 var error = ('patron.display.retrieve : ' + js2JSON(E));
259 this.error.sdump('D_ERROR',error);
264 'render' : function() {
266 for (var i in this.render_list) {
268 this.render_list[i]();
270 var error = 'Problem in patron.display.render with\n' + this.render_list[i] + '\n\n' + js2JSON(E);
271 this.error.sdump('D_ERROR',error);
278 dump('exiting patron/display.js\n');