1 dump('entering circ.checkin.js\n');
3 if (typeof circ == 'undefined') circ = {};
4 circ.checkin = function (params) {
6 JSAN.use('util.error'); this.error = new util.error();
7 JSAN.use('util.network'); this.network = new util.network();
8 this.OpenILS = {}; JSAN.use('OpenILS.data'); this.OpenILS.data = new OpenILS.data(); this.OpenILS.data.init({'via':'stash'});
11 circ.checkin.prototype = {
13 'init' : function( params ) {
17 obj.session = params['session'];
19 JSAN.use('circ.util');
20 var columns = circ.util.columns(
22 'barcode' : { 'hidden' : false },
23 'title' : { 'hidden' : false },
24 'status' : { 'hidden' : false },
25 //'checkin_status' : { 'hidden' : false },
26 'checkin_route_to' : { 'hidden' : false },
27 'checkin_text' : { 'hidden' : false, 'flex' : 3 },
30 dump('columns = ' + js2JSON(columns) + '\n');
32 JSAN.use('util.list'); obj.list = new util.list('checkin_list');
36 'map_row_to_column' : circ.util.std_map_row_to_column(),
40 JSAN.use('util.controller'); obj.controller = new util.controller();
44 'checkin_barcode_entry_textbox' : [
47 if (ev.keyCode && ev.keyCode == 13) {
54 function() { alert('Not Yet Implemented'); }
56 'cmd_checkin_submit_barcode' : [
62 'cmd_checkin_print' : [
67 'cmd_checkin_reprint' : [
72 'cmd_checkin_done' : [
80 this.controller.view.checkin_barcode_entry_textbox.focus();
84 'checkin' : function() {
87 var barcode = obj.controller.view.checkin_barcode_entry_textbox.value;
88 JSAN.use('circ.util');
89 var checkin = circ.util.checkin_via_barcode(
90 obj.session, barcode, obj.patron_id
96 'circ' : checkin.circ,
97 'mvr' : checkin.record,
99 'status' : checkin.status,
100 'route_to' : checkin.route_to,
101 'text' : checkin.text,
104 //I could override map_row_to_column here
107 if (typeof obj.on_checkin == 'function') {
108 obj.on_checkin(checkin);
110 if (typeof window.xulG == 'object' && typeof window.xulG.on_checkin == 'function') {
111 obj.error.sdump('D_CIRC','circ.checkin: Calling external .on_checkin()\n');
112 window.xulG.on_checkin(checkin);
114 obj.error.sdump('D_CIRC','circ.checkin: No external .on_checkin()\n');
118 alert('FIXME: need special alert and error handling\n'
120 if (typeof obj.on_failure == 'function') {
123 if (typeof window.xulG == 'object' && typeof window.xulG.on_failure == 'function') {
124 obj.error.sdump('D_CIRC','circ.checkin: Calling external .on_failure()\n');
125 window.xulG.on_failure(E);
127 obj.error.sdump('D_CIRC','circ.checkin: No external .on_failure()\n');
133 'on_checkin' : function() {
134 this.controller.view.checkin_barcode_entry_textbox.value = '';
135 this.controller.view.checkin_barcode_entry_textbox.focus();
138 'on_failure' : function() {
139 this.controller.view.checkin_barcode_entry_textbox.select();
140 this.controller.view.checkin_barcode_entry_textbox.focus();
144 dump('exiting circ.checkin.js\n');