wire up Create Request action in acq user requests UI
authorJason Etheridge <jason@esilibrary.com>
Thu, 28 Jul 2011 11:27:45 +0000 (07:27 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 20 Sep 2011 15:32:19 +0000 (11:32 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/acq/picklist/user_request.tt2
Open-ILS/web/js/ui/default/acq/picklist/user_request.js

index 9d04a16..fe9486f 100644 (file)
@@ -44,7 +44,7 @@
                     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"]'
                     editOnEnter='true'
-                    suppressEditFields='["id"]'
+                    suppressEditFields='["id", "holdable_formats", "phone_notify", "email_notify", "lineitem", "eg_bib", "max_fee", "cancel_reason"]'
                     fmClass='aur'
                     editStyle='pane'
                     autoHeight='true'
index 0e67777..331e0d9 100644 (file)
@@ -12,6 +12,7 @@ dojo.require('openils.acq.Lineitem');
 
 var contextOrg;
 var contextUsr;
+var contextUsrObj;
 var contextLI;
 var contextEg_bib;
 var aur_obj;
@@ -39,6 +40,7 @@ function setup() {
             }
         );
         if (typeof usr_obj.textcode == 'undefined') {
+            contextUsrObj = usr_obj;
             changeUser(usr_obj.id(),usr_obj.card().barcode());
         } else {
             alert(usr_obj.textcode + ' : ' + usr_obj.desc);
@@ -294,6 +296,7 @@ function changeUserPrompt() {
         }
     }
     if (barcode == '') {
+        contextUsrObj = null;
         changeUser('','');
     } else {
         var usr_obj = fieldmapper.standardRequest(
@@ -309,12 +312,24 @@ function changeUserPrompt() {
             alert(usr_obj.textcode + ' : ' + usr_obj.desc);
             return;
         } else {
+            contextUsrObj = usr_obj;
             changeUser(usr_obj.id(),usr_obj.card().barcode());
         }
     }
     buildGrid();
 }
 
+function createRequest() {
+    if (!contextUsr) {
+        changeUserPrompt();
+    }
+    if (contextUsr) {
+        rGrid.overrideEditWidgets.pickup_lib = new dijit.form.TextBox({"disabled": true});
+        rGrid.overrideEditWidgets.pickup_lib.shove = { create : contextUsrObj.home_ou() };
+        rGrid.showCreateDialog();
+    }
+}
+
 openils.Util.addOnLoad(setup);