From: erickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Mon, 8 Mar 2010 19:50:45 +0000 (+0000)
Subject: acq cancel reason administration interface.  TODO: add staff client menu entries
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1ff4f267dc6bf8d0d76f062cae071738b8fabb6d;p=contrib%2FConifer.git

acq cancel reason administration interface.  TODO: add staff client menu entries

git-svn-id: svn://svn.open-ils.org/ILS/trunk@15738 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

diff --git a/Open-ILS/web/js/ui/default/conify/global/acq/cancel_reason.js b/Open-ILS/web/js/ui/default/conify/global/acq/cancel_reason.js
new file mode 100644
index 0000000000..6cd329f7e3
--- /dev/null
+++ b/Open-ILS/web/js/ui/default/conify/global/acq/cancel_reason.js
@@ -0,0 +1,39 @@
+dojo.require('openils.Util');
+dojo.require('openils.User');
+dojo.require('openils.widget.AutoGrid');
+dojo.require('fieldmapper.OrgUtils');
+dojo.require('openils.widget.OrgUnitFilteringSelect');
+
+var contextOrg;
+
+function setup() {
+    buildGrid();
+
+    var connect = function() {
+        dojo.connect(contextOrgSelector, 'onChange',
+            function() {
+                contextOrg = this.attr('value');
+                crGrid.resetStore();
+                buildGrid();
+            }
+        );
+    };
+
+    new openils.User().buildPermOrgSelector(
+        'ADMIN_ACQ_CANCEL_CAUSE', contextOrgSelector, null, connect);
+}
+
+function buildGrid() {
+
+    if(contextOrg == null)
+        contextOrg = openils.User.user.ws_ou();
+
+    crGrid.loadAll( 
+        {order_by : {acqcr : 'label'}}, 
+        {org_unit : fieldmapper.aou.fullPath(contextOrg, true)}
+    );
+}
+
+openils.Util.addOnLoad(setup);
+
+
diff --git a/Open-ILS/web/templates/default/conify/global/acq/cancel_reason.tt2 b/Open-ILS/web/templates/default/conify/global/acq/cancel_reason.tt2
new file mode 100644
index 0000000000..133c2cf196
--- /dev/null
+++ b/Open-ILS/web/templates/default/conify/global/acq/cancel_reason.tt2
@@ -0,0 +1,33 @@
+[% WRAPPER default/base.tt2 %]
+[% ctx.page_titel = 'Cancel Reasons' %]
+<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/acq/cancel_reason.js'> </script>
+
+<!-- grid -->
+
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+        <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+            <div>PO / Item / Request Cancellation Reasons</div>
+            <div>
+                <button dojoType='dijit.form.Button' onClick='crGrid.showCreateDialog()'>New Cancel Reason</button>
+                <button dojoType='dijit.form.Button' onClick='crGrid.deleteSelected()'>Delete Selected</button>
+            </div>
+        </div>
+        <div>
+            <span>Context Org Unit</span>
+            <select dojoType="openils.widget.OrgUnitFilteringSelect" jsId='contextOrgSelector'
+                searchAttr='shortname' labelAttr='shortname'> </select>
+        </div>
+        <table  jsId="crGrid"
+                dojoType="openils.widget.AutoGrid"
+                fieldOrder="['id', 'org_unit', 'label', 'description']"
+                query="{id: '*'}"
+                defaultCellWidth='"auto"'
+                fmClass='acqcr'
+                showPaginator='true'
+                editOnEnter='true'>
+        </table>
+    </div>
+</div>
+[% END %]
+
+