ACQ+Vandelay ACQ Records in vandelay queue selector
authorBill Erickson <berick@esilibrary.com>
Tue, 31 Jan 2012 15:01:01 +0000 (10:01 -0500)
committerBen Shum <bshum@biblio.org>
Tue, 13 Mar 2012 19:27:18 +0000 (15:27 -0400)
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>
Signed-off-by: Ben Shum <bshum@biblio.org>
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 24b2a0d..c7ed37c 100644 (file)
@@ -1354,7 +1354,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('');
@@ -1455,7 +1474,7 @@ function vlShowMatchSetEditor() {
 }
 
 function vlFetchQueueFromForm() {
-    currentType = vlQueueSelectType.getValue();
+    currentType = vlQueueSelectType.attr('value').replace(/-.*/, ''); // trim bib-acq
     currentQueueId = vlQueueSelectQueueList.getValue();
     retrieveQueuedRecords(currentType, currentQueueId, handleRetrieveRecords);
 }