From 2c34a17d9e8e5e59ecfbf2e95ebb832c6ea608da Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 16 Feb 2010 06:28:38 +0000 Subject: [PATCH] UI for managing Line Item Alert Text for Acquisitions (acqliat) git-svn-id: svn://svn.open-ils.org/ILS/trunk@15542 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Acq/Lineitem.pm | 14 ++++++ .../ui/default/conify/global/acq/lineitem_alert.js | 54 ++++++++++++++++++++++ Open-ILS/web/opac/locale/en-US/lang.dtd | 5 ++ .../default/conify/global/acq/lineitem_alert.tt2 | 31 +++++++++++++ .../xul/staff_client/chrome/content/main/menu.js | 4 ++ .../chrome/content/main/menu_frame_menus.xul | 8 +++- 6 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/web/js/ui/default/conify/global/acq/lineitem_alert.js create mode 100644 Open-ILS/web/templates/default/conify/global/acq/lineitem_alert.tt2 diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm index 21f01fb17c..d6f0076a55 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm @@ -800,4 +800,18 @@ sub lineitem_note_CUD_batch { return {complete => 1}; } +__PACKAGE__->register_method( + method => 'ranged_line_item_alert_text', + api_name => 'open-ils.acq.line_item_alert_text.ranged.retrieve.all'); + +sub ranged_line_item_alert_text { + my($self, $conn, $auth, $org_id, $depth) = @_; + my $e = new_editor(authtoken => $auth); + return $e->event unless $e->checkauth; + return $e->event unless $e->allowed('ADMIN_ACQ_LINEITEM_ALERT_TEXT', $org_id); + return $e->search_acq_lineitem_alert_text( + {owning_lib => $U->get_org_full_path($org_id, $depth)}); +} + + 1; diff --git a/Open-ILS/web/js/ui/default/conify/global/acq/lineitem_alert.js b/Open-ILS/web/js/ui/default/conify/global/acq/lineitem_alert.js new file mode 100644 index 0000000000..94fa959da9 --- /dev/null +++ b/Open-ILS/web/js/ui/default/conify/global/acq/lineitem_alert.js @@ -0,0 +1,54 @@ +dojo.require('dojox.grid.DataGrid'); +dojo.require('openils.widget.AutoGrid'); +dojo.require('dojox.grid.cells.dijit'); +dojo.require('dojo.data.ItemFileWriteStore'); +dojo.require('dijit.form.CurrencyTextBox'); +dojo.require('dijit.Dialog'); +dojo.require('dojox.widget.PlaceholderMenuItem'); +dojo.require('fieldmapper.OrgUtils'); +dojo.require('dijit.form.FilteringSelect'); +dojo.require('openils.PermaCrud'); +dojo.require('openils.widget.OrgUnitFilteringSelect'); + +var alertContextOrg; +var alertList; + +function alertInit() { + + buildAlertGrid(); + var connect = function() { + dojo.connect(alertContextOrgSelect, 'onChange', + function() { + alertContextOrg = this.getValue(); + alertGrid.resetStore(); + buildAlertGrid(); + } + ); + }; + new openils.User().buildPermOrgSelector('ADMIN_ACQ_LINEITEM_ALERT_TEXT', alertContextOrgSelect, null, connect); +} + +function buildAlertGrid() { + if(alertContextOrg == null) + alertContextOrg = openils.User.user.ws_ou(); + fieldmapper.standardRequest( + ['open-ils.acq', 'open-ils.acq.line_item_alert_text.ranged.retrieve.all'], + { async: true, + params: [openils.User.authtoken, alertContextOrg, fieldmapper.aou.findOrgDepth(alertContextOrg)], + oncomplete: function(r) { + if(alertList = openils.Util.readResponse(r)) { + alertList = openils.Util.objectSort(alertList); + dojo.forEach(alertList, + function(e) { + alertGrid.store.newItem(acqliat.toStoreItem(e)); + } + ); + } + } + } + ); +} + +openils.Util.addOnLoad(alertInit); + + diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd index 68c0c8b619..40a9adf1f5 100644 --- a/Open-ILS/web/opac/locale/en-US/lang.dtd +++ b/Open-ILS/web/opac/locale/en-US/lang.dtd @@ -677,6 +677,11 @@ + + + + + diff --git a/Open-ILS/web/templates/default/conify/global/acq/lineitem_alert.tt2 b/Open-ILS/web/templates/default/conify/global/acq/lineitem_alert.tt2 new file mode 100644 index 0000000000..b528a3382f --- /dev/null +++ b/Open-ILS/web/templates/default/conify/global/acq/lineitem_alert.tt2 @@ -0,0 +1,31 @@ +[% WRAPPER default/base.tt2 %] + + + + +
+
+
Line Item Alert Text
+
+ + +
+
+
+ Context Org Unit + +
+ +
+
+ +[% END %] + + 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 4ca01dda2d..e7ab12f676 100644 --- a/Open-ILS/xul/staff_client/chrome/content/main/menu.js +++ b/Open-ILS/xul/staff_client/chrome/content/main/menu.js @@ -619,6 +619,10 @@ main.menu.prototype = { ['oncommand'], function() { open_eg_web_page('conify/global/config/billing_type'); } ], + 'cmd_server_admin_acq_lineitem_alert' : [ + ['oncommand'], + function() { open_eg_web_page('conify/global/acq/lineitem_alert'); } + ], 'cmd_server_admin_z39_source' : [ ['oncommand'], function() { open_eg_web_page('conify/global/config/z3950_source'); } 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 5c1ff687d7..f6b4c78ef0 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 @@ -126,6 +126,7 @@ + @@ -342,7 +343,12 @@ - + + + + + + -- 2.11.0