bcc3bdf0d7c580c3b52dadaf27a9d3b3acc666f8
[Evergreen.git] / Open-ILS / xul / staff_client / server / patron / display.js
1 dump('entering patron/display.js\n');
2
3 if (typeof patron == 'undefined') patron = {};
4 patron.display = function (params) {
5
6         JSAN.use('util.error'); this.error = new util.error();
7         JSAN.use('util.window'); this.window = new util.window();
8         JSAN.use('util.network'); this.network = new util.network();
9         this.w = window;
10 }
11
12 patron.display.prototype = {
13
14         'retrieve_ids' : [],
15         'stop_checkouts' : false,
16         'check_stop_checkouts' : function() { return this.stop_checkouts; },
17
18         'init' : function( params ) {
19
20                 var obj = this;
21
22                 obj.barcode = params['barcode'];
23                 obj.id = params['id'];
24
25                 JSAN.use('OpenILS.data'); this.OpenILS = {}; 
26                 obj.OpenILS.data = new OpenILS.data(); obj.OpenILS.data.init({'via':'stash'});
27
28                 JSAN.use('util.deck'); 
29                 obj.right_deck = new util.deck('patron_right_deck');
30                 obj.left_deck = new util.deck('patron_left_deck');
31
32                 function spawn_checkout_interface() {
33                         var frame = obj.right_deck.set_iframe(
34                                 urls.XUL_CHECKOUT,
35                                 {},
36                                 { 
37                                         'set_tab' : xulG.set_tab,
38                                         'patron_id' : obj.patron.id(),
39                                         'check_stop_checkouts' : function() { return obj.check_stop_checkouts(); },
40                                         'on_list_change' : function(checkout) {
41                                         
42                                                 /* this stops noncats from getting pushed into Items Out */
43                                                 if (!checkout.circ.id()) return; 
44
45                                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
46                                                 obj.summary_window.g.summary.controller.render('patron_checkouts');
47                                                 obj.summary_window.g.summary.controller.render('patron_standing');
48                                                 if (obj.items_window) {
49                                                         obj.items_window.g.items.list.append(
50                                                                 {
51                                                                         'row' : {
52                                                                                 'my' : {
53                                                                                         'circ_id' : checkout.circ.id(),
54                                                                                 }
55                                                                         }
56                                                                 }
57                                                         )
58                                                 }
59                                         }
60                                 }
61                         );
62                         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
63                         obj.checkout_window = frame.contentWindow;
64                 }
65
66                 JSAN.use('util.controller'); obj.controller = new util.controller();
67                 obj.controller.init(
68                         {
69                                 control_map : {
70                                         'cmd_broken' : [
71                                                 ['command'],
72                                                 function() { alert('Not Yet Implemented'); }
73                                         ],
74                                         'cmd_patron_retrieve' : [
75                                                 ['command'],
76                                                 function(ev) {
77                                                         if (typeof window.xulG == 'object' && typeof window.xulG.new_tab == 'function') {
78                                                                 for (var i = 0; i < obj.retrieve_ids.length; i++) {     
79                                                                         try {
80                                                                                 var url = urls.XUL_PATRON_DISPLAY; //+ '?id=' + window.escape( obj.retrieve_ids[i] );
81                                                                                 window.xulG.new_tab(
82                                                                                         url, {}, { 'id' : obj.retrieve_ids[i] }
83                                                                                 );
84                                                                         } catch(E) {
85                                                                                 alert(E);
86                                                                         }
87                                                                 }
88                                                         }
89                                                 }
90                                         ],
91                                         'cmd_search_form' : [
92                                                 ['command'],
93                                                 function(ev) {
94                                                         obj.controller.view.cmd_search_form.setAttribute('disabled','true');
95                                                         obj.left_deck.node.selectedIndex = 0;
96                                                         obj.controller.view.patron_name.setAttribute('value','No Patron Selected');
97                                                         removeCSSClass(document.documentElement,'PATRON_HAS_BILLS');
98                                                         removeCSSClass(document.documentElement,'PATRON_HAS_OVERDUES');
99                                                         removeCSSClass(document.documentElement,'PATRON_HAS_NOTES');
100                                                         removeCSSClass(document.documentElement,'PATRON_EXCEEDS_CHECKOUT_COUNT');
101                                                         removeCSSClass(document.documentElement,'PATRON_EXCEEDS_OVERDUE_COUNT');
102                                                         removeCSSClass(document.documentElement,'PATRON_EXCEEDS_FINES');
103                                                         removeCSSClass(document.documentElement,'NO_PENALTIES');
104                                                         removeCSSClass(document.documentElement,'ONE_PENALTY');
105                                                         removeCSSClass(document.documentElement,'MULTIPLE_PENALTIES');
106                                                         removeCSSClass(document.documentElement,'PATRON_HAS_ALERT');
107                                                         removeCSSClass(document.documentElement,'PATRON_BARRED');
108                                                         removeCSSClass(document.documentElement,'PATRON_INACTIVE');
109                                                         removeCSSClass(document.documentElement,'PATRON_EXPIRED');
110                                                         removeCSSClass(document.documentElement,'PATRON_HAS_INVALID_DOB');
111                                                         removeCSSClass(document.documentElement,'PATRON_HAS_INVALID_ADDRESS');
112                                                         removeCSSClass(document.documentElement,'PATRON_AGE_GE_65');
113                                                         removeCSSClass(document.documentElement,'PATRON_AGE_LE_65');
114                                                         removeCSSClass(document.documentElement,'PATRON_AGE_GE_24');
115                                                         removeCSSClass(document.documentElement,'PATRON_AGE_LE_24');
116                                                         removeCSSClass(document.documentElement,'PATRON_AGE_GE_21');
117                                                         removeCSSClass(document.documentElement,'PATRON_AGE_LE_21');
118                                                         removeCSSClass(document.documentElement,'PATRON_AGE_GE_18');
119                                                         removeCSSClass(document.documentElement,'PATRON_AGE_LE_18');
120                                                         removeCSSClass(document.documentElement,'PATRON_AGE_GE_13');
121                                                         removeCSSClass(document.documentElement,'PATRON_AGE_LE_13');
122                                                         removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_1');
123                                                         removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_2');
124                                                         removeCSSClass(document.documentElement,'PATRON_NET_ACCESS_3');
125                                                 }
126                                         ],
127                                         'cmd_patron_refresh' : [
128                                                 ['command'],
129                                                 function(ev) {
130                                                         obj.refresh_all();
131                                                 }
132                                         ],
133                                         'cmd_patron_checkout' : [
134                                                 ['command'],
135                                                 spawn_checkout_interface
136                                         ],
137                                         'cmd_patron_items' : [
138                                                 ['command'],
139                                                 function(ev) {
140                                                         var frame = obj.right_deck.set_iframe(
141                                                                 urls.XUL_PATRON_ITEMS
142                                                                 + '?patron_id=' + window.escape( obj.patron.id() ),
143                                                                 {},
144                                                                 {
145                                                                         'on_list_change' : function(b) {
146                                                                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
147                                                                                 obj.summary_window.g.summary.controller.render('patron_checkouts');
148                                                                                 obj.summary_window.g.summary.controller.render('patron_standing');
149                                                                                 obj.summary_window.g.summary.controller.render('patron_bill');
150                                                                                 obj.bill_window.g.bills.refresh(true);
151                                                                         },
152                                                                         'url_prefix' : xulG.url_prefix,
153                                                                         'new_tab' : xulG.new_tab,
154                                                                 }
155                                                         );
156                                                         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
157                                                         obj.items_window = frame.contentWindow;
158                                                 }
159                                         ],
160                                         'cmd_patron_edit' : [
161                                                 ['command'],
162                                                 function(ev) {
163
164                                                                 function spawn_search(s) {
165                                                                         obj.error.sdump('D_TRACE', 'Editor would like to search for: ' + js2JSON(s) ); 
166                                                                         obj.data.stash_retrieve();
167                                                                         var loc = xulG.url_prefix(urls.XUL_PATRON_DISPLAY);
168                                                                         loc += '?doit=1&query=' + window.escape(js2JSON(s));
169                                                                         xulG.new_tab( loc, {}, {} );
170                                                                 }
171
172                                                                 function spawn_editor(p) {
173                                                                         var url = urls.XUL_PATRON_EDIT;
174                                                                         var param_count = 0;
175                                                                         for (var i in p) {
176                                                                                 if (param_count++ == 0) url += '?'; else url += '&';
177                                                                                 url += i + '=' + window.escape(p[i]);
178                                                                         }
179                                                                         var loc = xulG.url_prefix( urls.XUL_REMOTE_BROWSER ) + '?url=' + window.escape( url );
180                                                                         xulG.new_tab(
181                                                                                 loc, 
182                                                                                 {}, 
183                                                                                 { 
184                                                                                         'show_print_button' : true , 
185                                                                                         'tab_name' : 'Editing Related Patron' ,
186                                                                                         'passthru_content_params' : {
187                                                                                                 'spawn_search' : spawn_search,
188                                                                                                 'spawn_editor' : spawn_editor,
189                                                                                                 'url_prefix' : xulG.url_prefix,
190                                                                                                 'new_tab' : xulG.new_tab,
191                                                                                         }
192                                                                                 }
193                                                                         );
194                                                                 }
195
196                                                         obj.right_deck.set_iframe(
197                                                                 urls.XUL_REMOTE_BROWSER
198                                                                 + '?url=' + window.escape( 
199                                                                         urls.XUL_PATRON_EDIT
200                                                                         + '?ses=' + window.escape( ses() )
201                                                                         + '&usr=' + window.escape( obj.patron.id() )
202                                                                 ),
203                                                                 {}, {
204                                                                         'show_print_button' : true,
205                                                                         'passthru_content_params' : {
206                                                                                 'on_save' : function(p) {
207                                                                                         try {
208                                                                                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
209                                                                                                 obj.summary_window.g.summary.retrieve();
210                                                                                         } catch(E) {
211                                                                                                 alert(E);
212                                                                                         }
213                                                                                 },
214                                                                                 'spawn_search' : spawn_search,
215                                                                                 'spawn_editor' : spawn_editor,
216                                                                                 'url_prefix' : xulG.url_prefix,
217                                                                                 'new_tab' : xulG.new_tab,
218                                                                         }
219                                                                 }
220                                                         );
221                                                 }
222                                         ],
223                                         'cmd_patron_info' : [
224                                                 ['command'],
225                                                 function(ev) {
226                                                         obj.right_deck.set_iframe(
227                                                                 urls.XUL_PATRON_INFO + '?patron_id=' + window.escape( obj.patron.id() ),
228                                                                 {},
229                                                                 {
230                                                                         'url_prefix' : xulG.url_prefix,
231                                                                         'new_tab' : xulG.new_tab,
232                                                                 }
233                                                         );
234                                                 }
235                                         ],
236                                         'cmd_patron_holds' : [
237                                                 ['command'],
238                                                 function(ev) {
239                                                         obj.right_deck.set_iframe(
240                                                                 urls.XUL_PATRON_HOLDS   
241                                                                 + '?patron_id=' + window.escape( obj.patron.id() ),
242                                                                 {},
243                                                                 {
244                                                                         'on_list_change' : function(h) {
245                                                                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
246                                                                                 obj.summary_window.g.summary.controller.render('patron_holds');
247                                                                                 obj.summary_window.g.summary.controller.render('patron_standing');
248                                                                         },
249                                                                         'url_prefix' : xulG.url_prefix,
250                                                                         'new_tab' : xulG.new_tab,
251                                                                 }
252                                                         );
253                                                 }
254                                         ],
255                                         'cmd_patron_bills' : [
256                                                 ['command'],
257                                                 function(ev) {
258                                                         var f = obj.right_deck.set_iframe(
259                                                                 urls.XUL_PATRON_BILLS
260                                                                 + '?patron_id=' + window.escape( obj.patron.id() ),
261                                                                 {},
262                                                                 {
263                                                                         'on_money_change' : function(b) {
264                                                                                 //alert('test');
265                                                                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
266                                                                                 obj.summary_window.g.summary.retrieve(true);
267                                                                                 obj.items_window.g.items.retrieve(true);
268                                                                         }
269                                                                 }
270                                                         );
271                                                         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
272                                                         obj.bill_window = f.contentWindow;
273                                                 }
274                                         ],
275                                         'patron_name' : [
276                                                 ['render'],
277                                                 function(e) {
278                                                         return function() { 
279                                                                 e.setAttribute('value',
280                                                                         obj.patron.family_name() + ', ' + obj.patron.first_given_name() + ' ' +
281                                                                         ( obj.patron.second_given_name() ? obj.patron.second_given_name() : '' )
282                                                                 );
283                                                                 JSAN.use('patron.util'); patron.util.set_penalty_css(obj.patron);
284                                                         };
285                                                 }
286                                         ],
287                                         'PatronNavBar' : [
288                                                 ['render'],
289                                                 function(e) {
290                                                         return function() {}
291                                                 }
292                                         ],
293                                 }
294                         }
295                 );
296
297                 if (obj.barcode || obj.id) {
298                         if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
299                                 try { window.xulG.set_tab_name('Retrieving Patron...'); } catch(E) { alert(E); }
300                         }
301
302                         obj.controller.view.PatronNavBar.selectedIndex = 1;
303                         JSAN.use('util.widgets'); 
304                         util.widgets.enable_accesskeys_in_node_and_children(
305                                 obj.controller.view.PatronNavBar.lastChild
306                         );
307                         util.widgets.disable_accesskeys_in_node_and_children(
308                                 obj.controller.view.PatronNavBar.firstChild
309                         );
310                         obj.controller.view.cmd_patron_refresh.setAttribute('disabled','true');
311                         obj.controller.view.cmd_patron_checkout.setAttribute('disabled','true');
312                         obj.controller.view.cmd_patron_items.setAttribute('disabled','true');
313                         obj.controller.view.cmd_patron_holds.setAttribute('disabled','true');
314                         obj.controller.view.cmd_patron_bills.setAttribute('disabled','true');
315                         obj.controller.view.cmd_patron_edit.setAttribute('disabled','true');
316                         obj.controller.view.cmd_patron_info.setAttribute('disabled','true');
317                         obj.controller.view.patron_name.setAttribute('value','Retrieving...');
318                         document.documentElement.setAttribute('class','');
319                         var frame = obj.left_deck.reset_iframe(
320                                 urls.XUL_PATRON_SUMMARY,
321                                 {},
322                                 {
323                                         'barcode' : obj.barcode,
324                                         'id' : obj.id, 
325                                         'on_finished' : function(patron) {
326
327                                                 obj.patron = patron; obj.controller.render();
328
329                                                 obj.controller.view.cmd_patron_refresh.setAttribute('disabled','false');
330                                                 obj.controller.view.cmd_patron_checkout.setAttribute('disabled','false');
331                                                 obj.controller.view.cmd_patron_items.setAttribute('disabled','false');
332                                                 obj.controller.view.cmd_patron_holds.setAttribute('disabled','false');
333                                                 obj.controller.view.cmd_patron_bills.setAttribute('disabled','false');
334                                                 obj.controller.view.cmd_patron_edit.setAttribute('disabled','false');
335                                                 obj.controller.view.cmd_patron_info.setAttribute('disabled','false');
336
337                                                 if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
338                                                         try { 
339                                                                 window.xulG.set_tab_name(
340                                                                         'Patron: ' + patron.family_name() + ', ' + patron.first_given_name() + ' ' 
341                                                                                 + (patron.second_given_name() ? patron.second_given_name() : '' ) 
342                                                                 ); 
343                                                         } catch(E) { 
344                                                                 obj.error.sdump('D_ERROR',E);
345                                                         }
346                                                 }
347
348                                                 if (!obj._checkout_spawned) {
349                                                         spawn_checkout_interface();
350                                                         obj._checkout_spawned = true;
351                                                 }
352
353                                                 obj.network.simple_request(
354                                                         'FM_AHR_COUNT_RETRIEVE',
355                                                         [ ses(), patron.id() ],
356                                                         function(req) {
357                                                                 try {
358                                                                         var msg = ''; obj.stop_checkouts = false;
359                                                                         if (patron.alert_message()) msg += '"' + patron.alert_message() + '"\n';
360                                                                         //alert('obj.barcode = ' + obj.barcode);
361                                                                         if (obj.barcode) {
362                                                                                 if (patron.cards()) for (var i = 0; i < patron.cards().length; i++) {
363                                                                                         //alert('card #'+i+' == ' + js2JSON(patron.cards()[i]));
364                                                                                         if ( (patron.cards()[i].barcode()==obj.barcode) && ( ! get_bool(patron.cards()[i].active()) ) ) {
365                                                                                                 msg += 'Patron account retrieved with an INACTIVE card.\n';
366                                                                                                 obj.stop_checkouts = true;
367                                                                                         }
368                                                                                 }
369                                                                         }
370                                                                         if (get_bool(patron.barred())) {
371                                                                                 msg += 'Patron account is BARRED.\n';
372                                                                                 obj.stop_checkouts = true;
373                                                                         }
374                                                                         if (!get_bool(patron.active())) {
375                                                                                 msg += 'Patron account is INACTIVE.\n';
376                                                                                 obj.stop_checkouts = true;
377                                                                         }
378                                                                         if (patron.expire_date()) {
379                                                                                 var now = new Date();
380                                                                                 now = now.getTime()/1000;
381
382                                                                                 var expire_parts = patron.expire_date().substr(0,10).split('-');
383                                                                                 expire_parts[1] = expire_parts[1] - 1;
384
385                                                                                 var expire = new Date();
386                                                                                 expire.setFullYear(expire_parts[0], expire_parts[1], expire_parts[2]);
387                                                                                 expire = expire.getTime()/1000
388
389                                                                                 if (expire < now) {
390                                                                                         msg += 'Patron account is EXPIRED.\n';
391                                                                                 obj.stop_checkouts = true;
392                                                                                 }
393                                                                         }
394                                                                         var holds = req.getResultObject();
395                                                                         if (holds.ready && holds.ready > 0) msg += 'Holds available: ' + holds.ready;
396                                                                         if (msg) {
397                                                                                 if (msg != obj.old_msg) {
398                                                                                         obj.error.yns_alert(msg,'Alert Message','OK',null,null,'Check here to confirm this message.');
399                                                                                         obj.old_msg = msg;
400                                                                                 } else {
401                                                                                         obj.error.sdump('D_TRACE','Not re-displaying this alert message: ' + msg);
402                                                                                 }
403                                                                         }
404                                                                         if (obj.stop_checkouts && obj.checkout_window) {
405                                                                                 setTimeout( function() {
406                                                                                         try {
407                                                                                         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
408                                                                                         if (
409                                                                                                 obj.checkout_window &&
410                                                                                                 obj.checkout_window.g &&
411                                                                                                 obj.checkout_window.g.checkout &&
412                                                                                                 typeof obj.checkout_window.g.check_disable == 'function') {
413                                                                                                         obj.checkout_window.g.checkout.check_disable();
414                                                                                                 }
415                                                                                         } catch(E) {
416                                                                                                 alert(E);
417                                                                                         }
418                                                                                 }, 0);
419                                                                         }
420                                                                 } catch(E) {
421                                                                         obj.error.standard_unexpected_error_alert('Error showing patron alert and holds availability.',E);
422                                                                 }
423                                                         }
424                                                 );
425
426                                         },
427                                         'on_error' : function(E) {
428                                                 try {
429                                                         var error;
430                                                         if (typeof E.ilsevent != 'undefined') {
431                                                                 error = E.textcode;
432                                                         } else {
433                                                                 error = js2JSON(E).substr(0,100);
434                                                         }
435                                                         location.href = urls.XUL_PATRON_BARCODE_ENTRY + '?error=' + window.escape(error);
436                                                 } catch(F) {
437                                                         alert(F);
438                                                 }
439                                         }
440                                 }
441                         );
442                         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
443                         obj.summary_window = frame.contentWindow;
444                 } else {
445                         if (typeof window.xulG == 'object' && typeof window.xulG.set_tab_name == 'function') {
446                                 try { window.xulG.set_tab_name('Patron Search'); } catch(E) { alert(E); }
447                         }
448
449                         obj.controller.view.PatronNavBar.selectedIndex = 0;
450                         JSAN.use('util.widgets'); 
451                         util.widgets.enable_accesskeys_in_node_and_children(
452                                 obj.controller.view.PatronNavBar.firstChild
453                         );
454                         util.widgets.disable_accesskeys_in_node_and_children(
455                                 obj.controller.view.PatronNavBar.lastChild
456                         );
457                         obj.controller.view.cmd_patron_retrieve.setAttribute('disabled','true');
458                         obj.controller.view.cmd_search_form.setAttribute('disabled','true');
459
460                         var loc = urls.XUL_PATRON_SEARCH_FORM + '?blah=blah';
461                         if (params['query']) {
462                                 var query = JSON2js(params['query']);
463                                 for (var i in query) {
464                                         loc += '&'+window.escape(i)+'='+window.escape(query[i].value);
465                                 }
466                                 if (params.doit) {
467                                         loc += '&doit=1';
468                                 }
469                         }
470                         var form_frame = obj.left_deck.set_iframe(
471                                 loc,
472                                 {},
473                                 {
474                                         'on_submit' : function(query) {
475                                                 obj.controller.view.cmd_patron_retrieve.setAttribute('disabled','true');
476                                                 var list_frame = obj.right_deck.reset_iframe(
477                                                         urls.XUL_PATRON_SEARCH_RESULT + '?' + query,
478                                                         {},
479                                                         {
480                                                                 'on_select' : function(list) {
481                                                                         if (!list) return;
482                                                                         if (list.length < 1) return;
483                                                                         obj.controller.view.cmd_patron_retrieve.setAttribute('disabled','false');
484                                                                         obj.controller.view.cmd_search_form.setAttribute('disabled','false');
485                                                                         obj.retrieve_ids = list;
486                                                                         obj.controller.view.patron_name.setAttribute('value','Retrieving...');
487                                                                         document.documentElement.setAttribute('class','');
488                                                                         setTimeout(
489                                                                                 function() {
490                                                                                         var frame = obj.left_deck.set_iframe(
491                                                                                                 urls.XUL_PATRON_SUMMARY + '?id=' + window.escape(list[0]),
492                                                                                                         {},
493                                                                                                         {
494                                                                                                                 'on_finished' : function(patron) {
495                                                                                                                         obj.patron = patron;
496                                                                                                                         obj.controller.render();
497                                                                                                                 }
498                                                                                                         }
499                                                                                         );
500                                                                                         netscape.security.PrivilegeManager.enablePrivilege(
501                                                                                                 "UniversalXPConnect"
502                                                                                         );
503                                                                                         obj.summary_window = frame.contentWindow;
504                                                                                         obj.patron = obj.summary_window.g.summary.patron;
505                                                                                         obj.controller.render('patron_name');
506                                                                                 }, 0
507                                                                         );
508                                                                 }
509                                                         }
510                                                 );
511                                                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
512                                                 obj.search_result = list_frame.contentWindow;
513                                         }
514                                 }
515                         );
516                         netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
517                         obj.search_window = form_frame.contentWindow;
518                         obj._checkout_spawned = true;
519                 }
520         },
521
522         '_checkout_spawned' : false,
523
524         'refresh_deck' : function(url) {
525                 var obj = this;
526                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
527                 for (var i = 0; i < obj.right_deck.node.childNodes.length; i++) {
528                         try {
529                                 var f = obj.right_deck.node.childNodes[i];
530                                 var w = f.contentWindow;
531                                 if (url) {
532                                         if (w.location.href == url) w.refresh(true);
533                                 } else {
534                                         if (typeof w.refresh == 'function') {
535                                                 w.refresh(true);
536                                         }
537                                 }
538
539                         } catch(E) {
540                                 obj.error.sdump('D_ERROR','refresh_deck: ' + E + '\n');
541                         }
542                 }
543         },
544         
545         'refresh_all' : function() {
546                 var obj = this;
547                 obj.controller.view.patron_name.setAttribute(
548                         'value','Retrieving...'
549                 );
550                 document.documentElement.setAttribute('class','');
551                 try { obj.summary_window.refresh(); } catch(E) { obj.error.sdump('D_ERROR', E + '\n'); }
552                 try { obj.refresh_deck(); } catch(E) { obj.error.sdump('D_ERROR', E + '\n'); }
553         },
554 }
555
556 dump('exiting patron/display.js\n');