ACQ Vandeley : acq UI bits for temp queues vs named queues
authorBill Erickson <berick@esilibrary.com>
Thu, 1 Dec 2011 22:13:27 +0000 (17:13 -0500)
committerBill Erickson <berick@esilibrary.com>
Thu, 1 Dec 2011 22:13:27 +0000 (17:13 -0500)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/acq/common/vlagent.tt2
Open-ILS/web/js/ui/default/acq/common/vlagent.js

index ce14f80..0b112bd 100644 (file)
     <td>[% l('Insufficient Quality Fall-Through Profile') %]</td>
     <td><div id='acq_vl:fall_through_merge_profile'></div></td>
 </tr>
+<tr>
+    <td>
+        <span>[% l('Temporary Queue') %]</span>
+        <input dojoType='dijit.form.CheckBox' id='acq_vl:tmp_queue'></input>
+    </td>
+    <td>
+        <div id='acq_vl:named_queue'></div>
+        <span>[% l('Named Queue') %]</span>
+    </td>
+</tr>
 
index bd305af..b53395b 100644 (file)
@@ -12,10 +12,12 @@ function VLAgent(args) {
         {key : 'auto_overlay_1match'},
         {key : 'auto_overlay_best_match'},
         {key : 'match_quality_ratio'},
+        {key : 'tmp_queue'},
         {key : 'match_set', cls : 'vms'},
         {key : 'bib_source', cls : 'cbs'},
         {key : 'merge_profile', cls : 'vmp'},
-        {key : 'fall_through_merge_profile', cls : 'vmp'}
+        {key : 'fall_through_merge_profile', cls : 'vmp'},
+        {key : 'named_queue', cls : 'vbq'}
     ];
 
     this.init = function() {
@@ -23,14 +25,14 @@ function VLAgent(args) {
 
         dojo.forEach(this.widgets,
             function(widg) {
-
                 if (widg.cls) { // selectors
+
                     new openils.widget.AutoFieldWidget({
                         fmClass : widg.cls,
                         selfReference : true,
                         orgLimitPerms : [self.limitPerm || 'CREATE_PURCHASE_ORDER'],
                         parentNode : dojo.byId('acq_vl:' + widg.key)
-                    }).build(function(w) { widg.dijit = w }); 
+                    }).build(function(dijit) { self._widgetPostBuild(widg, dijit) }); 
 
                 } else { // bools
                     widg.dijit = dijit.byId('acq_vl:' + widg.key);
@@ -39,6 +41,23 @@ function VLAgent(args) {
         );
     }
 
+    this._widgetPostBuild = function(widg, dijit) {
+        var self = this;
+        widg.dijit = dijit;
+
+        // don't allow selecting a named queue if temp queue is selected
+        if (widg.cls == 'vbq') {
+            dijit.attr('disabled', true);
+            var tmpd = self.widgets.filter(function(item){return (item.key == 'tmp_queue')})[0].dijit;
+            tmpd.attr('checked', true);
+            dojo.connect(
+                tmpd, 'onChange', 
+                function(val) { dijit.attr('disabled', val) }
+            );
+        }
+    }
+
+
     this.values = function() {
         var values = {};
         dojo.forEach(this.widgets,