ACQ+Vandelay ACQ Records in vandelay queue selector
authorBill Erickson <berick@esilibrary.com>
Tue, 31 Jan 2012 15:01:01 +0000 (10:01 -0500)
committerBill Erickson <berick@esilibrary.com>
Tue, 21 Feb 2012 15:45:57 +0000 (10:45 -0500)
Adds a new type of record to select from the Vandelay queue selector.
Selecting "Acquisitions Records" will show queues with type 'acq'.
Selecting the existing "Bibliographic Records" selector will only show
queues with queue_type 'bib' (i.e. non-acq queues).

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/vandelay/inc/queueselect.tt2
Open-ILS/web/js/ui/default/vandelay/vandelay.js

index e72633b..91416c9 100644 (file)
@@ -6,6 +6,7 @@
         <td>
             <select jsId='vlQueueSelectType' dojoType='dijit.form.FilteringSelect' onchange='vlShowQueueSelect();'>
                 <option value='bib' selected='selected'>[% l('Bibliographic Records') %]</option>
+                <option value='bib-acq'>[% l('Acquisitions Records') %]</option>
                 <option value='auth'>[% l('Authority Records') %]</option>
             </select>
         </td>
index 2b39612..03e8cfb 100644 (file)
@@ -1349,7 +1349,26 @@ function batchUpload() {
 
 
 function vlFleshQueueSelect(selector, type) {
-    var data = (type == 'bib') ? vbq.toStoreData(allUserBibQueues) : vaq.toStoreData(allUserAuthQueues);
+    var data;
+    if (type == 'bib') {
+        var bibList = allUserBibQueues.filter(
+            function(q) {
+                return (q.queue_type() == 'bib');
+            }
+        );
+        data = vbq.toStoreData(bibList);
+    } else if (type == 'bib-acq') {
+        // ACQ queues are a special type of bib queue
+        var acqList = allUserBibQueues.filter(
+            function(q) {
+                return (q.queue_type() == 'acq');
+            }
+        );
+        data = vbq.toStoreData(acqList);
+    } else {
+        data = vaq.toStoreData(allUserAuthQueues);
+    }
+
     selector.store = new dojo.data.ItemFileReadStore({data:data});
     selector.setValue(null);
     selector.setDisplayedValue('');
@@ -1450,7 +1469,7 @@ function vlShowMatchSetEditor() {
 }
 
 function vlFetchQueueFromForm() {
-    currentType = vlQueueSelectType.getValue();
+    currentType = vlQueueSelectType.attr('value').replace(/-.*/, ''); // trim bib-acq
     currentQueueId = vlQueueSelectQueueList.getValue();
     retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
 }