From 726324ab71f9c3f79d4f1c334e4b2410bf78a1cd Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 29 Oct 2014 17:06:45 -0400 Subject: [PATCH] KMAIN-385: Standard Patron Messages Cross-port: a5efc1a Conflicts: Open-ILS/xul/staff_client/chrome/content/main/about.html --- KCLS/sql/kmain-385-standard-default-messages.sql | 54 ++++++++++++++++++++++ Open-ILS/examples/fm_IDL.xml | 18 ++++++++ .../conify/global/config/patron_messages.tt2 | 39 ++++++++++++++++ .../conify/global/config/patron_messages.js | 46 ++++++++++++++++++ Open-ILS/web/opac/locale/en-US/lang.dtd | 1 + .../xul/staff_client/chrome/content/main/menu.js | 4 ++ .../chrome/content/main/menu_frame_menus.xul | 6 +++ 7 files changed, 168 insertions(+) create mode 100644 KCLS/sql/kmain-385-standard-default-messages.sql create mode 100644 Open-ILS/src/templates/conify/global/config/patron_messages.tt2 create mode 100644 Open-ILS/web/js/ui/default/conify/global/config/patron_messages.js diff --git a/KCLS/sql/kmain-385-standard-default-messages.sql b/KCLS/sql/kmain-385-standard-default-messages.sql new file mode 100644 index 0000000000..d0f142eaae --- /dev/null +++ b/KCLS/sql/kmain-385-standard-default-messages.sql @@ -0,0 +1,54 @@ +--KCM-16 Rollback +----------------------------------- +--DROP TABLE config.patron_message; + +BEGIN; + +CREATE TABLE config.patron_message +( + id serial NOT NULL, + message text NOT NULL, + weight integer DEFAULT 0, + CONSTRAINT patron_message_pkey PRIMARY KEY (id) +) +WITH ( + OIDS=FALSE +); + +INSERT INTO config.patron_message(message, weight) + VALUES ('Address verifying documentation needed – Limit 2', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('Annual address verifying documentation next needed:', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('Banned from computer use until:', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('Card lost/stolen/left. Require photo ID.', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('Foreign-exchange student', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('Items missing from holds shelf. Review CKO with patron.', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('Limited Checkout due to:', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('No Laptop CKO:', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('Patron has protected address', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('Patron knows one card per year. Card issue date:', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('Photo ID required for CKO', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('Seattle to King County verifying documentation needed', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('Shelf check done:', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('Visiting missionary', 0); +INSERT INTO config.patron_message(message, weight) + VALUES ('Per Unique new Seattle address needed', 1); +INSERT INTO config.patron_message(message, weight) + VALUES ('Address check needed – verbal approval okay', 2); + +ALTER TABLE config.patron_message + OWNER TO evergreen; + +COMMIT; \ No newline at end of file diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index cce74fd9de..4ae53b192f 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -4294,6 +4294,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/templates/conify/global/config/patron_messages.tt2 b/Open-ILS/src/templates/conify/global/config/patron_messages.tt2 new file mode 100644 index 0000000000..f3955a544b --- /dev/null +++ b/Open-ILS/src/templates/conify/global/config/patron_messages.tt2 @@ -0,0 +1,39 @@ +[% WRAPPER base.tt2 %] +[% ctx.page_title = l('Patron Message Editor') %] + + +
+
+
[% ctx.page_title %]
+
+ + +
+
+ + + + + + + + + +
MessageWeight
+
+ +[% END %] \ No newline at end of file diff --git a/Open-ILS/web/js/ui/default/conify/global/config/patron_messages.js b/Open-ILS/web/js/ui/default/conify/global/config/patron_messages.js new file mode 100644 index 0000000000..7f6ca77ab4 --- /dev/null +++ b/Open-ILS/web/js/ui/default/conify/global/config/patron_messages.js @@ -0,0 +1,46 @@ +dojo.require('dojox.grid.DataGrid'); +dojo.require('openils.widget.AutoGrid'); +dojo.require('dojox.grid.cells.dijit'); +dojo.require('dojo.data.ItemFileWriteStore'); +dojo.require('dijit.Dialog'); +dojo.require('openils.PermaCrud'); + +var thingList; + +function thingInit() { + + thingGrid.disableSelectorForRow = function(rowIdx) { + var item = thingGrid.getItem(rowIdx); + return (thingGrid.store.getValue(item, 'id') < 0); + } + + buildGrid(); +} + +function buildGrid() { + + fieldmapper.standardRequest( + ['open-ils.pcrud', 'open-ils.pcrud.search.cpm.atomic'], + { async: true, + params: [ + openils.User.authtoken, + {"id":{"!=":null}}, + {"order_by": + {"cpm":"message"} + } + ], + oncomplete: function(r) { + if(thingList = openils.Util.readResponse(r)) { + thingList = openils.Util.objectSort(thingList,'message'); + dojo.forEach(thingList, + function(e) { + thingGrid.store.newItem(cpm.toStoreItem(e)); + } + ); + } + } + } + ); +} + +openils.Util.addOnLoad(thingInit); \ No newline at end of file diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index d1e553c8fa..b755ef9d2a 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -758,6 +758,7 @@ + diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu.js b/Open-ILS/xul/staff_client/chrome/content/main/menu.js index 0f983da49d..65af05763d 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -814,6 +814,10 @@ main.menu.prototype = { ['oncommand'], function(event) { open_eg_web_page('conify/global/config/standing_penalty', null, event); } ], + 'cmd_local_admin_patron_messages' : [ + ['oncommand'], + function(event) { open_eg_web_page('conify/global/config/patron_messages', null, event); } + ], 'cmd_local_admin_grp_penalty_threshold' : [ ['oncommand'], function(event) { open_eg_web_page('conify/global/permission/grp_penalty_threshold', null, event); } diff --git a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul index 2e4d8d5e82..ca21c6c218 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul @@ -143,6 +143,11 @@ + + + @@ -641,6 +646,7 @@ + -- 2.11.0