UI for managing Line Item Alert Text for Acquisitions (acqliat)
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 16 Feb 2010 06:28:38 +0000 (06:28 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 16 Feb 2010 06:28:38 +0000 (06:28 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15542 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Acq/Lineitem.pm
Open-ILS/web/js/ui/default/conify/global/acq/lineitem_alert.js [new file with mode: 0644]
Open-ILS/web/opac/locale/en-US/lang.dtd
Open-ILS/web/templates/default/conify/global/acq/lineitem_alert.tt2 [new file with mode: 0644]
Open-ILS/xul/staff_client/chrome/content/main/menu.js
Open-ILS/xul/staff_client/chrome/content/main/menu_frame_menus.xul

index 21f01fb..d6f0076 100644 (file)
@@ -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 (file)
index 0000000..94fa959
--- /dev/null
@@ -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);
+
+
index 68c0c8b..40a9adf 100644 (file)
 <!ENTITY staff.main.menu.admin.server_admin.conify.org_unit_setting_type "Organization Unit Setting Types">
 <!ENTITY staff.main.menu.admin.server_admin.conify.usr_setting_type "User Setting Types">
 
+<!ENTITY staff.main.menu.admin.server_admin.acq.label "Acquisitions">
+<!ENTITY staff.main.menu.admin.server_admin.acq.accesskey "A">
+<!ENTITY staff.main.menu.admin.server_admin.acq.lineitem_alert.label "Line Item Alerts">
+<!ENTITY staff.main.menu.admin.server_admin.acq.lineitem_alert.accesskey "L">
+
 <!ENTITY staff.main.menu.admin.server_admin.booking.label "Booking">
 <!ENTITY staff.main.menu.admin.server_admin.booking.accesskey "B">
 <!ENTITY staff.main.menu.admin.server_admin.booking.resource.label "Resources">
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 (file)
index 0000000..b528a33
--- /dev/null
@@ -0,0 +1,31 @@
+[% WRAPPER default/base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/lineitem_alert.js'> </script>
+
+<!-- grid -->
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+        <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+            <div>Line Item Alert Text</div>
+            <div>
+                <button dojoType='dijit.form.Button' onClick='alertGrid.showCreateDialog()'>New Line Item Alert Text</button>
+                <button dojoType='dijit.form.Button' onClick='alertGrid.deleteSelected()'>Delete Selected</button>
+            </div>
+        </div>
+        <div>
+            <span>Context Org Unit</span>
+            <select dojoType="openils.widget.OrgUnitFilteringSelect" jsId='alertContextOrgSelect'
+                searchAttr='shortname' labelAttr='shortname'> </select>
+        </div>
+        <table  jsId="alertGrid"
+                dojoType="openils.widget.AutoGrid"
+                fieldOrder="['id', 'code', 'description', 'owning_lib']"
+                query="{id: '*'}"
+                defaultCellWidth='20'
+                fmClass='acqliat'
+                editOnEnter='true'>
+        </table>
+    </div>
+</div>
+[% END %]
+
+
index 4ca01dd..e7ab12f 100644 (file)
@@ -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'); }
index 5c1ff68..f6b4c78 100644 (file)
     <command id="cmd_server_admin_copy_status"/>
     <command id="cmd_server_admin_marc_code"/>
     <command id="cmd_server_admin_billing_type"/>
+    <command id="cmd_server_admin_acq_lineitem_alert"/>
     <command id="cmd_server_admin_z39_source"/>
     <command id="cmd_server_admin_circ_mod"/>
     <command id="cmd_server_admin_org_unit_setting_type"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.circulation_modifier.label;" command="cmd_server_admin_circ_mod"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.org_unit_setting_type;" command="cmd_server_admin_org_unit_setting_type"/>
                 <menuitem label="&staff.main.menu.admin.server_admin.conify.usr_setting_type;" command="cmd_server_admin_usr_setting_type"/>
-                <menu id="main.menu.admin.server.booking" label="&staff.main.menu.admin.server_admin.booking.label;" accesskey="&staff.main.menu.admin.server_admin.booking.label;">
+                <menu id="main.menu.admin.server.acq" label="&staff.main.menu.admin.server_admin.acq.label;" accesskey="&staff.main.menu.admin.server_admin.acq.accesskey;">
+                    <menupopup id="main.menu.admin.server.acq.popup">
+                        <menuitem label="&staff.main.menu.admin.server_admin.acq.lineitem_alert.label;" accesskey="&staff.main.menu.admin.server_admin.acq.lineitem_alert.accesskey;" command="cmd_server_admin_acq_lineitem_alert"/>
+                    </menupopup>
+                </menu>
+                <menu id="main.menu.admin.server.booking" label="&staff.main.menu.admin.server_admin.booking.label;" accesskey="&staff.main.menu.admin.server_admin.booking.accesskey;">
                     <menupopup id="main.menu.admin.server.booking.popup">
                         <menuitem label="&staff.main.menu.admin.server_admin.booking.resource.label;" command="cmd_server_admin_booking_resource" accesskey="&staff.main.menu.admin.server_admin.booking.resource.accesskey;"/>
                         <menuitem label="&staff.main.menu.admin.server_admin.booking.resource_type.label;" command="cmd_server_admin_booking_resource_type" accesskey="&staff.main.menu.admin.server_admin.booking.resource_type.accesskey;"/>