--- /dev/null
+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);
+
+
--- /dev/null
+[% 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 %]