[open-ils-commits] r15219 - trunk/Open-ILS/xul/staff_client/server/patron (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Dec 22 07:10:04 EST 2009


Author: phasefx
Date: 2009-12-22 07:10:03 -0500 (Tue, 22 Dec 2009)
New Revision: 15219

Modified:
   trunk/Open-ILS/xul/staff_client/server/patron/bill2.js
Log:
wire up Show in Catalog action for bills interface

Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill2.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill2.js	2009-12-22 10:32:14 UTC (rev 15218)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill2.js	2009-12-22 12:10:03 UTC (rev 15219)
@@ -88,6 +88,12 @@
             false
         );
 
+        $('opac').addEventListener(
+            'command',
+            handle_opac,
+            false
+        );
+
         $('payment').addEventListener(
             'change',
             function(ev) {
@@ -435,6 +441,7 @@
             $('details').setAttribute('disabled', g.bill_list_selection.length == 0);
             $('add').setAttribute('disabled', g.bill_list_selection.length == 0);
             $('voidall').setAttribute('disabled', g.bill_list_selection.length == 0);
+            $('opac').setAttribute('disabled', g.bill_list_selection.length == 0);
         },
         'on_click' : function(ev) {
             netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect UniversalBrowserRead');
@@ -584,6 +591,22 @@
     }
 }
 
+function handle_opac() {
+    try {
+        var ids = [];
+        for (var i = 0; i < g.bill_list_selection.length; i++) {
+            var my_mvr = g.bill_map[ g.bill_list_selection[i] ].record;
+            var my_acp = g.bill_map[ g.bill_list_selection[i] ].copy;
+            if (typeof my_mvr != 'undefined' && my_mvr != null) {
+                ids.push( { 'barcode' : my_acp.barcode(), 'doc_id' : my_mvr.doc_id() } );
+            }
+        }
+        JSAN.use('cat.util');
+        cat.util.show_in_opac( ids );
+    } catch(E) {
+        alert('Error in bill2.js, handle_opac: ' + E);
+    }
+}
 
 function handle_details() {
     JSAN.use('util.window'); var win = new util.window();



More information about the open-ils-commits mailing list