From 26ffed64510cddf61ad344dd4b39b149447f771c Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 25 Nov 2009 03:21:54 +0000 Subject: [PATCH] added org setting to enable selfcheck audio. alter popup alert to match setting name layout git-svn-id: svn://svn.open-ils.org/ILS/trunk@15022 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 11 ++++++++++- .../0091.data.org-setting-selfcheck-misc2.sql | 23 ++++++++++++++++++++++ .../web/js/ui/default/circ/selfcheck/selfcheck.js | 12 +++++------ 4 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/0091.data.org-setting-selfcheck-misc2.sql diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 4bce49f11d..57e25e1954 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -51,7 +51,7 @@ CREATE TABLE config.upgrade_log ( 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, diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 6cf53ca76b..5c23bb39a8 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1589,7 +1589,7 @@ INSERT into config.org_unit_setting_type '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' ), @@ -2607,3 +2607,12 @@ INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) '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' + ); + + diff --git a/Open-ILS/src/sql/Pg/upgrade/0091.data.org-setting-selfcheck-misc2.sql b/Open-ILS/src/sql/Pg/upgrade/0091.data.org-setting-selfcheck-misc2.sql new file mode 100644 index 0000000000..eb2855f135 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/0091.data.org-setting-selfcheck-misc2.sql @@ -0,0 +1,23 @@ +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; diff --git a/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js b/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js index 483fc37b69..beaf0ad38e 100644 --- a/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js +++ b/Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js @@ -12,14 +12,12 @@ var localeStrings = dojo.i18n.getLocalization('openils.circ', 'selfcheck'); 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() { @@ -114,7 +112,7 @@ SelfCheckManager.prototype.loadOrgSettings = function() { 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, @@ -218,10 +216,10 @@ SelfCheckManager.prototype.handleAlert = function(message, shouldPopup, sound) { 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]); } -- 2.11.0