acq cancel reason administration interface. TODO: add staff client menu entries
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 8 Mar 2010 19:50:45 +0000 (19:50 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 8 Mar 2010 19:50:45 +0000 (19:50 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15738 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/conify/global/acq/cancel_reason.js [new file with mode: 0644]
Open-ILS/web/templates/default/conify/global/acq/cancel_reason.tt2 [new file with mode: 0644]

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 (file)
index 0000000..6cd329f
--- /dev/null
@@ -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 (file)
index 0000000..133c2cf
--- /dev/null
@@ -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 %]
+
+