Z39 Batch : xul open queue
authorBill Erickson <berick@esilibrary.com>
Thu, 21 Feb 2013 15:30:46 +0000 (10:30 -0500)
committerBill Erickson <berick@esilibrary.com>
Thu, 21 Feb 2013 15:30:46 +0000 (10:30 -0500)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/xul/staff_client/server/cat/bucketz39_dialog.js
Open-ILS/xul/staff_client/server/cat/bucketz39_dialog_overlay.xul

index 66e98d6..5e6d2f0 100644 (file)
@@ -137,9 +137,10 @@ function Bucketz39Dialog() {
             function(cbox) { return cbox.checked }).map(
                 function(cbox) { return cbox.getAttribute('value') }));
 
-        // queue name / match set
         params.push({
+            // queue name (editable menulist)
             queue_name : dojo.byId('queue_selector').parentNode.value,
+            // match set ID
             match_set : dojo.byId('match_set_selector').parentNode.value
         });
 
@@ -173,9 +174,7 @@ function Bucketz39Dialog() {
             onresponse : function(r) {
                 var resp = r.recv();
                 if (!resp) return;
-
                 var stat = resp.content();
-                dump('Z39 Batch Response: ' + js2JSON(stat) + '\n');
 
                 dojo.attr(self.search_bib_count, 'value', ''+stat.bre_count);
                 dojo.attr(self.search_queue_count, 'value', ''+stat.queue_count);
@@ -186,11 +185,41 @@ function Bucketz39Dialog() {
                         (Number(stat.search_complete) / scount) * 100
                     ));
                 }
+
+                // queue object is returned in the final response
+                self.queue = stat.queue;
             },
             oncomplete : function() {
+                dojo.removeClass(dojo.byId('final-actions-row'), 'hideme');
             }
         }).send();
     }
+
+    // Open a new XUL tab focused on the Vandelay queue containing the results.
+    this.open_queue = function() {
+        /*
+        labelKey = labelKey || 'menu.cmd_open_conify.tab';
+        var label = offlineStrings.getString(labelKey);
+        */
+        var label = 'MARC Import/Export'; // TODO
+       
+        // URL
+        var urls = xulG.urls || window.urls;
+        var url_prefix = xulG.url_prefix || window.url_prefix;
+        var loc = urls.XUL_BROWSER + '?url=' + 
+            window.escape(
+                url_prefix('EG_WEB_BASE/') +
+                'vandelay/vandelay?qtype=bib&qid=' + this.queue.id()
+            );
+        
+        var content_params = {
+            'no_xulG': false,
+            'show_print_button': true,
+            'show_nav_buttons': true 
+        };  
+       
+        xulG.new_tab(loc, {tab_name: label}, content_params);
+    }
 }
 
 function my_init() {
index aa16378..c0cd224 100644 (file)
                         <progressmeter id='search-progress' mode='determined'/>
                     </row>
 
+                    <row id='final-actions-row' class='hideme' style='padding:5px;'>
+                        <button oncommand="window.close();" 
+                            icon="remove" accesskey="C" label="Close" />  
+                        <button oncommand="dialog.open_queue();" 
+                            icon="accept" accesskey="O" label="Open Queue" />  
+                    </row>
+
+
                     <!-- TODO cancel / show queue -->
 
                 </rows>