webstaff: Allow ACQ catalog and link-to-record, er, links to work in a browser
authorMike Rylander <mrylander@gmail.com>
Tue, 22 Nov 2016 15:03:16 +0000 (10:03 -0500)
committerKathy Lussier <klussier@masslnc.org>
Tue, 22 Nov 2016 19:10:06 +0000 (14:10 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/web/js/ui/default/acq/common/li_table.js

index c54346b..851982d 100644 (file)
@@ -1786,17 +1786,25 @@ function AcqLiTable() {
 
     this.generateMakeRecTab = function(bib_id,default_view, row) {
         return function() {
-            xulG.new_tab(
-                XUL_OPAC_WRAPPER,
-                {tab_name: localeStrings.XUL_RECORD_DETAIL_PAGE, browser:false},
-                {
-                    no_xulG : false, 
-                    show_nav_buttons : true, 
-                    show_print_button : true, 
-                    opac_url : xulG.url_prefix('opac_rdetail|' + bib_id),
-                    default_view : default_view
+            if(openils.XUL.isXUL() && !window.IAMBROWSER) {
+                xulG.new_tab(
+                    XUL_OPAC_WRAPPER,
+                    {tab_name: localeStrings.XUL_RECORD_DETAIL_PAGE, browser:false},
+                    {
+                        no_xulG : false, 
+                        show_nav_buttons : true, 
+                        show_print_button : true, 
+                        opac_url : xulG.url_prefix('opac_rdetail|' + bib_id),
+                        default_view : default_view
+                    }
+                );
+            } else {
+                var url = '/eg/staff/cat/catalog/record/' + bib_id;
+                if (default_view == 'copy_browser') {
+                    url += '/holdings';
                 }
-            );
+                window.open(url);
+            }
 
             if(row) nodeByName("action_none", row).selected = true;
         }
@@ -3742,9 +3750,14 @@ function AcqLiTable() {
             }
         );
 
-        win = window.open(
-            oilsBasePath + '/acq/lineitem/findbib?query=' + encodeURIComponent(query),
-            '', 'resizable,scrollbars=1,chrome');
+        if(openils.XUL.isXUL() && !window.IAMBROWSER) {
+            win = window.open(
+                oilsBasePath + '/acq/lineitem/findbib?query=' + encodeURIComponent(query),
+                '', 'resizable,scrollbars=1,chrome');
+        } else {
+            win = window.open( oilsBasePath + '/acq/lineitem/findbib?query=' + encodeURIComponent(query));
+        }
+
 
         win.window.recordFound = function(bibId) { 
             win.close();