beginning of patron request processing page
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 10 Mar 2010 22:54:38 +0000 (22:54 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 10 Mar 2010 22:54:38 +0000 (22:54 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15783 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

diff --git a/Open-ILS/web/js/ui/default/acq/picklist/user_request.js b/Open-ILS/web/js/ui/default/acq/picklist/user_request.js
new file mode 100644 (file)
index 0000000..7fe20e5
--- /dev/null
@@ -0,0 +1,44 @@
+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');
+                rGrid.resetStore();
+                buildGrid();
+            }
+        );
+    };
+
+    new openils.User().buildPermOrgSelector(
+        'CREATE_PICKLIST', contextOrgSelector, null, connect);
+}
+
+function buildGrid() {
+
+    if(contextOrg == null)
+        contextOrg = openils.User.user.ws_ou();
+
+    rGrid.loadAll(
+        {   order_by : {aur : 'request_date'},
+            join : 'au' 
+        },
+        {'+au' : {
+            home_ou : fieldmapper.aou.descendantNodeList(contextOrg).map(
+                function(item) { return item.id(); })
+        }}
+    );
+}
+
+openils.Util.addOnLoad(setup);
+
+
diff --git a/Open-ILS/web/templates/default/acq/picklist/user_request.tt2 b/Open-ILS/web/templates/default/acq/picklist/user_request.tt2
new file mode 100644 (file)
index 0000000..b80579e
--- /dev/null
@@ -0,0 +1,34 @@
+[% WRAPPER 'default/base.tt2' %]
+[% ctx.page_title = 'Patron Requests' %]
+<script src='[% ctx.media_prefix %]/js/ui/default/acq/picklist/user_request.js'> </script>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client">
+    <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+        <div>[% ctx.page_title %]</div>
+        <div>
+        </div>
+    </div>
+    <div>
+        <span>Context Org Unit</span>
+        <select 
+            dojoType="openils.widget.OrgUnitFilteringSelect" 
+            jsId='contextOrgSelector'
+            searchAttr='shortname' 
+            labelAttr='shortname'> 
+        </select>
+    </div>
+    <table  jsId="rGrid"
+            dojoType="openils.widget.AutoGrid"
+            query="{id: '*'}"
+            defaultCellWidth='"auto"'
+            fmClass='aur'
+            editStyle='pane'
+            autoHeight='true'
+            suppressFields="['id']"
+            showPaginator='true'
+            showColumnPicker='true'
+            columnPickerPrefix='"acq.picklist.user_reqeust"'
+            editOnEnter='true'>
+    </table>
+</div>
+[% END %]