trim the default display fields in the user req ui. format the title as a link to...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 11 Mar 2010 18:59:10 +0000 (18:59 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 11 Mar 2010 18:59:10 +0000 (18:59 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@15802 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/acq/picklist/user_request.js
Open-ILS/web/templates/default/acq/picklist/user_request.tt2

index 8508316..052e42b 100644 (file)
@@ -7,6 +7,41 @@ dojo.require('openils.widget.OrgUnitFilteringSelect');
 var contextOrg;
 
 function setup() {
+
+    if(reqId) {
+        drawRequest();
+    } else {
+        drawList();
+    }
+}
+
+function drawRequest() {
+    // hide the grid and the context selector
+    // draw a detail page for a particular request
+    // including ability to add request to a picklist
+    // and to "reject" it (aka apply a cancel reason)
+}
+
+
+// format the title data as id:title
+function getTitle(idx, item) {
+    if(item) {
+        return this.grid.store.getValue(item, 'id') + ':' + 
+        this.grid.store.getValue(item, 'title');
+    }
+    return ''
+}
+
+// turn id:title into a url
+function formatTitle(value) {
+    if(value) {
+        var parts = value.split(/:/);
+        return '<a href="' + oilsBasePath + 
+            '/acq/picklist/user_request/' + parts[0] + '">' + parts[1] + '</a>';
+    }
+}
+
+function drawList() {
     buildGrid();
 
     var connect = function() {
index 12126eb..6fe8cbe 100644 (file)
@@ -1,11 +1,13 @@
 [% WRAPPER 'default/base.tt2' %]
 [% ctx.page_title = 'Patron Requests' %]
 <script src='[% ctx.media_prefix %]/js/ui/default/acq/picklist/user_request.js'> </script>
+<script>var reqId = '[% ctx.page_args.0 %]';</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>
+            <!-- TODO: add reject-selection operation -->
         </div>
     </div>
     <div>
@@ -20,7 +22,8 @@
     <table  jsId="rGrid"
             dojoType="openils.widget.AutoGrid"
             query="{id: '*'}"
-            defaultCellWidth='"auto"'
+            suppressFields='["id", "usr", "pickup_lib", "holdable_formats", "phone_notify", "email_notify", "lineitem", "eg_bib", "max_fee", "cancel_reason"]'
+            fieldOrder='["title", "author", "isxn", "article_title", "article_pages", "request_type", "volume", "pubdate", "publisher", "location", "other_info", "mentioned"]'
             fmClass='aur'
             editStyle='pane'
             autoHeight='true'
             showColumnPicker='true'
             columnPickerPrefix='"acq.picklist.user_request"'
             editOnEnter='true'>
+            <thead>
+                <tr>
+                    <th field='title' get='getTitle' formatter='formatTitle'/>
+                </tr>
+            </thead>
     </table>
 </div>
 [% END %]