From 13221e6a06e2e526832704ed6330d43b3636dc27 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 30 Dec 2008 23:35:38 +0000 Subject: [PATCH] standing penalty patron UI. almost there git-svn-id: svn://svn.open-ils.org/ILS/trunk@11717 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/opac/locale/en-US/lang.dtd | 9 +++ .../staff_client/chrome/content/main/constants.js | 1 + .../server/locale/en-US/common.properties | 16 +++++ Open-ILS/xul/staff_client/server/patron/display.js | 12 ++++ .../xul/staff_client/server/patron/display.xul | 1 + .../staff_client/server/patron/display_overlay.xul | 2 + .../server/patron/standing_penalties.js | 59 ++++++++++++++++ .../server/patron/standing_penalties.xul | 67 ++++++++++++++++++ Open-ILS/xul/staff_client/server/patron/util.js | 81 ++++++++++++++++++++++ 9 files changed, 248 insertions(+) create mode 100644 Open-ILS/xul/staff_client/server/patron/standing_penalties.js create mode 100644 Open-ILS/xul/staff_client/server/patron/standing_penalties.xul diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index d3234d60e7..2902ac5987 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -1148,6 +1148,13 @@ + + + + + + + @@ -1169,6 +1176,8 @@ + + diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js index 448d2b370c..74360c43ce 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js @@ -307,6 +307,7 @@ const urls = { 'XUL_REMOTE_BROWSER' : '/xul/server/util/rbrowser.xul', 'XUL_SPINE_LABEL' : '/xul/server/cat/spine_labels.xul', 'XUL_STANDALONE' : 'chrome://open_ils_staff_client/content/circ/offline.xul', + 'XUL_STANDING_PENALTIES' : '/xul/server/patron/standing_penalties.xul', 'XUL_STAT_CAT_EDIT' : '/xul/server/admin/stat_cat_editor.xhtml', 'XUL_SURVEY_WIZARD' : 'chrome://open_ils_staff_client/content/admin/survey_wizard.xul', 'XUL_USER_BUCKETS' : '/xul/server/patron/user_buckets.xul', diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/common.properties b/Open-ILS/xul/staff_client/server/locale/en-US/common.properties index 534442a623..bf860ec359 100644 --- a/Open-ILS/xul/staff_client/server/locale/en-US/common.properties +++ b/Open-ILS/xul/staff_client/server/locale/en-US/common.properties @@ -65,6 +65,22 @@ staff.mvr_label_title=Title staff.bills_xact_dates_label=Record / Dates staff.bills_information=Information staff.bills_current_payment_label=Current Payment +staff.csp_id_label=Penalty ID +staff.csp_name_label=Name +staff.csp_label_label=Label +staff.csp_block_list_label=Block List +staff.csp_block_circ_label=Blocks Circulations? +staff.csp_block_renew_label=Blocks Renewals? +staff.csp_block_hold_label=Blocks Holds? +staff.csp_block_circ_yes=Yes +staff.csp_block_circ_no= +staff.csp_block_renew_yes=Yes +staff.csp_block_renew_no= +staff.csp_block_hold_yes=Yes +staff.csp_block_hold_no= +staff.csp_applied_label=Applied to Patron? +staff.csp_applied_yes=Applied +staff.csp_applied_no= staff.mbts_id_label=Bill # staff.mbts_xact_start_label=Start staff.mbts_xact_finish_label=Finish diff --git a/Open-ILS/xul/staff_client/server/patron/display.js b/Open-ILS/xul/staff_client/server/patron/display.js index 1a0f3da0ba..217b095bf2 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.js +++ b/Open-ILS/xul/staff_client/server/patron/display.js @@ -359,6 +359,18 @@ patron.display.prototype = { function() { var frame = obj.right_deck.reset_iframe( urls.XUL_USER_PERM_EDITOR + '?ses=' + window.escape(ses()) + '&usr=' + obj.patron.id(), {}, {}); } + ], + 'cmd_standing_penalties' : [ + ['command'], + function() { + var vframe = obj.right_deck.reset_iframe( + urls.XUL_STANDING_PENALTIES, + {}, + { + 'patron' : obj.patron, + } + ); + } ] } } diff --git a/Open-ILS/xul/staff_client/server/patron/display.xul b/Open-ILS/xul/staff_client/server/patron/display.xul index c9523239e0..aa30bd6ea7 100644 --- a/Open-ILS/xul/staff_client/server/patron/display.xul +++ b/Open-ILS/xul/staff_client/server/patron/display.xul @@ -101,6 +101,7 @@ + diff --git a/Open-ILS/xul/staff_client/server/patron/display_overlay.xul b/Open-ILS/xul/staff_client/server/patron/display_overlay.xul index ef9614c46a..37e5749647 100644 --- a/Open-ILS/xul/staff_client/server/patron/display_overlay.xul +++ b/Open-ILS/xul/staff_client/server/patron/display_overlay.xul @@ -85,6 +85,8 @@ + diff --git a/Open-ILS/xul/staff_client/server/patron/standing_penalties.js b/Open-ILS/xul/staff_client/server/patron/standing_penalties.js new file mode 100644 index 0000000000..dd8f22635b --- /dev/null +++ b/Open-ILS/xul/staff_client/server/patron/standing_penalties.js @@ -0,0 +1,59 @@ +function penalty_init() { + try { + commonStrings = document.getElementById('commonStrings'); + patronStrings = document.getElementById('patronStrings'); + + if (typeof JSAN == 'undefined') { + throw( + commonStrings.getString('common.jsan.missing') + ); + } + + JSAN.errorLevel = "die"; // none, warn, or die + JSAN.addRepository('..'); + + JSAN.use('OpenILS.data'); var data = new OpenILS.data(); data.stash_retrieve(); + XML_HTTP_SERVER = data.server_unadorned; + + JSAN.use('util.network'); var net = new util.network(); + JSAN.use('patron.util'); JSAN.use('util.list'); JSAN.use('util.functional'); + + var list = new util.list( 'csp_list' ); + list.init( + { + 'columns' : patron.util.csp_columns({}), + 'map_row_to_columns' : patron.util.std_map_row_to_columns(), + 'retrieve_row' : function(params) { params.row_node.setAttribute('retrieve_id',params.row.my.csp.id()); params.on_retrieve(params.row); return params.row; }, + 'on_select' : function(ev) { + var sel = list.retrieve_selection(); + var ids = util.functional.map_list( sel, function(o) { return JSON2js( o.getAttribute('retrieve_id') ); } ); + if (ids.length > 0) { + document.getElementById('cmd_apply_penalty').setAttribute('disabled','false'); + document.getElementById('cmd_remove_penalty').setAttribute('disabled','false'); + } else { + document.getElementById('cmd_apply_penalty').setAttribute('disabled','true'); + document.getElementById('cmd_remove_penalty').setAttribute('disabled','true'); + } + } + } + ); + + for (var i = 0; i < data.list.csp.length; i++) { + if (data.list.csp[i].id() >= 100 ) { + list.append( + { + 'row' : { + 'my' : { + 'csp' : data.list.csp[i], + 'au' : xulG.patron + } + } + } + ); + } + }; + + } catch(E) { + alert(E); + } +} diff --git a/Open-ILS/xul/staff_client/server/patron/standing_penalties.xul b/Open-ILS/xul/staff_client/server/patron/standing_penalties.xul new file mode 100644 index 0000000000..e2a6906a29 --- /dev/null +++ b/Open-ILS/xul/staff_client/server/patron/standing_penalties.xul @@ -0,0 +1,67 @@ + + + + + + + + + + + + + +]> + + + + + + + + + + + + +