install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0090'); -- miker
+INSERT INTO config.upgrade_log (version) VALUES ('0091'); -- berick
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
'Number of seconds of inactivity before the patron is logged out of the selfcheck interfacer',
'integer' ),
-( 'circ.selfcheck.alert_on_checkout_event',
+( 'circ.selfcheck.alert.popup',
'Selfcheck: Pop-up alert for errors',
'If true, checkout/renewal errors will cause a pop-up window in addition to the on-screen message',
'bool' ),
'bool'
);
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype )
+ VALUES (
+ 'circ.selfcheck.alert.sound',
+ oils_i18n_gettext('circ.selfcheck.alert.sound', 'Selfcheck: Audio Alerts', 'coust', 'label'),
+ oils_i18n_gettext('circ.selfcheck.alert.sound', 'Use audio alerts for selfcheck events', 'coust', 'description'),
+ 'bool'
+ );
+
+
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0091');
+
+-- add some consistency to the name of an old selfcheck setting
+UPDATE actor.org_unit_setting
+ SET name = 'circ.selfcheck.alert.popup'
+ WHERE name = 'circ.selfcheck.alert_on_checkout_event';
+
+UPDATE config.org_unit_setting_type
+ SET name = 'circ.selfcheck.alert.popup'
+ WHERE name = 'circ.selfcheck.alert_on_checkout_event';
+
+-- add the sound setting
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype )
+ VALUES (
+ 'circ.selfcheck.alert.sound',
+ oils_i18n_gettext('circ.selfcheck.alert.sound', 'Selfcheck: Audio Alerts', 'coust', 'label'),
+ oils_i18n_gettext('circ.selfcheck.alert.sound', 'Use audio alerts for selfcheck events', 'coust', 'description'),
+ 'bool'
+ );
+
+COMMIT;
const SET_BARCODE_REGEX = 'opac.barcode_regex';
const SET_PATRON_TIMEOUT = 'circ.selfcheck.patron_login_timeout';
-const SET_ALERT_ON_CHECKOUT_EVENT = 'circ.selfcheck.alert_on_checkout_event';
const SET_AUTO_OVERRIDE_EVENTS = 'circ.selfcheck.auto_override_checkout_events';
const SET_PATRON_PASSWORD_REQUIRED = 'circ.selfcheck.patron_password_required';
const SET_AUTO_RENEW_INTERVAL = 'circ.checkout_auto_renew_age';
const SET_WORKSTATION_REQUIRED = 'circ.selfcheck.workstation_required';
-const SET_SOUND_ON_CHECKOUT_EVENT = 'circ.selfcheck.sound_on_checkout_event';
-
-//openils.Util.playAudioUrl('/xul/server/skin/media/audio/bonus.wav');
+const SET_ALERT_POPUP = 'circ.selfcheck.alert.popup';
+const SET_ALERT_SOUND = 'circ.selfcheck.alert.sound';
function SelfCheckManager() {
this.staff.ws_ou(), [
SET_BARCODE_REGEX,
SET_PATRON_TIMEOUT,
- SET_ALERT_ON_CHECKOUT_EVENT,
+ SET_ALERT_POPUP,
SET_AUTO_OVERRIDE_EVENTS,
SET_PATRON_PASSWORD_REQUIRED,
SET_AUTO_RENEW_INTERVAL,
dojo.byId('oils-selfck-status-div').innerHTML = message;
- if(shouldPopup && this.orgSettings[SET_ALERT_ON_CHECKOUT_EVENT])
+ if(shouldPopup && this.orgSettings[SET_ALERT_POPUP])
alert(message);
- if(sound && this.orgSettings[SET_SOUND_ON_CHECKOUT_EVENT])
+ if(sound && this.orgSettings[SET_ALERT_SOUND])
openils.Util.playAudioUrl(SelfCheckManager.audioConfig[sound]);
}