} else {
this._funcs = [];
}
- JSAN.use('util.exec'); this._exec = new util.exec(); var intervalId = this._exec.timer( this._funcs, params.interval || 500 );
+ JSAN.use('util.exec');
+ this._exec = new util.exec();
+ var delay = params.interval;
+ if (!delay) { delay = _sound_delay_interval; /* define this in server/skin/custom.js */ }
+ if (!delay) { delay = 2000; }
+ var intervalId = this._exec.timer( this._funcs, delay );
dump('SOUND('+this.sig+'): starting timer with intervalId = ' + intervalId + '\n');
}
this.play_url( urls[key] );
},
+ 'special' : function special(e) {
+ var key = 'AUDIO_' + arguments.callee.name + '_' + e;
+ dump('SOUND('+this.sig+'): key = ' + key + '\n');
+ this.play_url( urls[key] );
+ },
+
'good' : function good(e){
var key = 'AUDIO_' + arguments.callee.name;
dump('SOUND('+this.sig+'): key = ' + key + '\n');
if (check.ilsevent == 3 /* NO_CHANGE */) {
//msg = 'This item is already checked in.\n';
check.what_happened = 'no_change';
+ sound.special('checkin.no_change');
if (no_change_label) {
var m = no_change_label.getAttribute('value');
var text = document.getElementById('circStrings').getFormattedString('staff.circ.utils.item_checked_in', [params.barcode]);
}
if (check.ilsevent == 1202 /* ITEM_NOT_CATALOGED */ && check.copy.status() != 11) {
check.what_happened = 'error';
+ sound.special('checkin.error');
var copy_status = (data.hash.ccs[ check.copy.status() ] ? data.hash.ccs[ check.copy.status() ].name() : check.copy.status().name() );
var err_msg = document.getElementById('commonStrings').getString('common.error');
err_msg += '\nFIXME --';
case 0: /* AVAILABLE */
case 7: /* RESHELVING */
check.what_happened = 'success';
+ sound.special('checkin.success');
if (msg) {
print_data.route_to_msg = document.getElementById('circStrings').getFormattedString('staff.circ.utils.route_to.msg', [check.route_to]);
print_data.route_to = check.route_to;
break;
case 8: /* ON HOLDS SHELF */
check.what_happened = 'hold_shelf';
+ sound.special('checkin.hold_shelf');
check.route_to = document.getElementById('circStrings').getString('staff.circ.route_to.hold_shelf');
if (check.payload.hold) {
if (check.payload.hold.pickup_lib() != data.list.au[0].ws_ou()) {
check.what_happened = 'error';
+ sound.special('checkin.error');
var err_msg = document.getElementById('commonStrings').getString('common.error');
err_msg += '\nFIXME: ';
err_msg += document.getElementById('circStrings').getString('staff.circ.utils.route_item_error');
}
} else {
check.what_happened = 'error';
+ sound.special('checkin.error');
var err_msg = document.getElementById('commonStrings').getString('common.error');
err_msg += '\nFIXME: ';
err_msg += document.getElementById('circStrings').getString('staff.circ.utils.route_item_status_error');
break;
case 6: /* IN TRANSIT */
check.what_happened = 'error';
+ sound.special('checkin.error');
check.route_to = 'TRANSIT SHELF??';
print_data.route_to;
var err_msg = document.getElementById('commonStrings').getString('common.error');
break;
case 11: /* CATALOGING */
check.what_happened = 'cataloging';
+ sound.special('checkin.cataloging');
check.route_to = 'CATALOGING';
print_data.route_to;
var suppress_popups = data.hash.aous['ui.circ.suppress_checkin_popups'];
case 15: // ON_RESERVATION_SHELF
check.route_to = 'RESERVATION SHELF';
check.what_happened = "reservation_shelf";
+ sound.special('checkin.reservation_shelf');
if (check.payload.reservation) {
if (check.payload.reservation.pickup_lib() != data.list.au[0].ws_ou()) {
msg += document.getElementById('commonStrings').getString('common.error');
break;
default:
check.what_happened = 'error';
+ sound.special('checkin.error');
msg += document.getElementById('commonStrings').getString('common.error');
var copy_status = data.hash.ccs[check.copy.status()] ? data.hash.ccs[check.copy.status()].name() : check.copy.status().name();
msg += '\n';
} else /* ROUTE_ITEM */ if (check.ilsevent == 7000) {
check.what_happened = 'transit';
+ sound.special('checkin.transit');
var lib = data.hash.aou[ check.org ];
check.route_to = lib.shortname();
print_data.route_to = check.route_to;
JSAN.use('util.date');
if (check.payload.hold) {
check.what_happened = 'transit_for_hold';
+ sound.special('checkin.transit_for_hold');
JSAN.use('patron.util');
var au_obj = patron.util.retrieve_fleshed_au_via_id( session, check.payload.hold.usr() );
print_data.user = au_obj;
} else /* ASSET_COPY_NOT_FOUND */ if (check.ilsevent == 1502) {
check.what_happened = 'not_found';
+ sound.special('checkin.not_found');
check.route_to = 'CATALOGING';
var mis_scan_msg = document.getElementById('circStrings').getFormattedString('staff.circ.copy_status.status.copy_not_found', [params.barcode]);
var suppress_popups = data.hash.aous['ui.circ.suppress_checkin_popups'];
} else /* HOLD_CAPTURE_DELAYED */ if (check.ilsevent == 7019) {
check.what_happened = 'hold_capture_delayed';
+ sound.special('checkin.hold_capture_delayed');
var rv = 0;
msg += document.getElementById('circStrings').getString('staff.circ.utils.hold_capture_delayed.description');
var suppress_popups = data.hash.aous['ui.circ.suppress_checkin_popupst'];
} else /* NETWORK TIMEOUT */ if (check.ilsevent == -1) {
check.what_happened = 'error';
+ sound.special('checkin.error');
error.standard_network_error_alert(document.getElementById('circStrings').getString('staff.circ.checkin.suggest_offline'));
} else {
/* Settings here override default values from constants.js;for example:
urls['AUDIO_good'] = '/xul/server/skin/media/custom/good.wav';
+
+ urls['AUDIO_special_checkin.cataloging'] = '/xul/server/skin/media/custom/cataloging.wav';
+ urls['AUDIO_special_checkin.error'] = '/xul/server/skin/media/custom/error.wav';
+ urls['AUDIO_special_checkin.hold_capture_delayed'] = '/xul/server/skin/media/custom/hold_capture_delayed.wav';
+ urls['AUDIO_special_checkin.hold_shelf'] = '/xul/server/skin/media/custom/hold_shelf.wav';
+ urls['AUDIO_special_checkin.no_change'] = '/xul/server/skin/media/custom/no_change.wav';
+ urls['AUDIO_special_checkin.not_found'] = '/xul/server/skin/media/custom/not_found.wav';
+ urls['AUDIO_special_checkin.reservation_shelf'] = '/xul/server/skin/media/custom/reservation_shelf.wav';
+ urls['AUDIO_special_checkin.success'] = '/xul/server/skin/media/custom/success.wav';
+ urls['AUDIO_special_checkin.transit'] = '/xul/server/skin/media/custom/transit.wav';
+ urls['AUDIO_special_checkin.transit_for_hold'] = '/xul/server/skin/media/custom/transit_for_hold.wav';
+
urls['opac'] = '/opac/' + LOCALE + '/skin/mylib/xml/advanced.xml?nps=1';
urls['opac_rdetail'] = '/opac/' + LOCALE + '/skin/mylib/xml/rdetail.xml';
urls['opac_rresult'] = '/opac/' + LOCALE + '/skin/mylib/xml/rresult.xml';