Acq: make view/place orders open a new tab w/ xul browser wrapped therearound
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 19 Aug 2010 17:35:03 +0000 (17:35 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 19 Aug 2010 17:35:03 +0000 (17:35 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17268 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/cat/opac.js
Open-ILS/xul/staff_client/chrome/content/cat/opac.xul
Open-ILS/xul/staff_client/chrome/locale/en-US/offline.properties

index 48abee9..cdbf7e9 100644 (file)
@@ -4,7 +4,6 @@ var marc_view_reset = true;
 var marc_edit_reset = true;
 var copy_browser_reset = true;
 var hold_browser_reset = true;
-var acq_orders_reset = true;
 var serctrl_view_reset = true;
 
 function $(id) { return document.getElementById(id); }
@@ -269,17 +268,38 @@ function set_hold_browser() {
     bottom_pane.get_contentWindow().addEventListener('load',opac_wrapper_set_help_context,false);
 }
 
-function set_acq_orders() {
-    g.view = 'acq_orders';
-    var url = xulG.url_prefix( '/eg/acq/lineitem/related/' ) + window.escape(docid) + '?target=bib';
-    if (acq_orders_reset) {
-        bottom_pane.reset_iframe(url,{},xulG);
-        acq_orders_reset = false;
-    } else {
-        bottom_pane.set_iframe(url,{},xulG);
+
+function open_acq_orders() {
+    try {
+        var content_params = {
+            "session": ses(),
+            "authtime": ses("authtime"),
+            "no_xulG": false,
+            "show_print_button": false
+        };
+
+        ["url_prefix", "new_tab", "set_tab", "close_tab", "new_patron_tab",
+            "set_patron_tab", "volume_item_creator", "get_new_session",
+            "holdings_maintenance_tab", "set_tab_name", "open_chrome_window",
+            "url_prefix", "network_meter", "page_meter", "set_statusbar",
+            "set_help_context"
+        ].forEach(function(k) { content_params[k] = xulG[k]; });
+
+        var loc = urls.XUL_BROWSER + "?url=" + window.escape(
+            xulG.url_prefix("/eg/acq/lineitem/related/") +
+            docid + "?target=bib"
+        );
+        xulG.new_tab(
+            loc, {
+                "tab_name": $("offlineStrings").getString(
+                    "staff.cat.opac.related_items"
+                ),
+                "browser": false
+            }, content_params
+        );
+    } catch (E) {
+        g.error.sdump("D_ERROR", E);
     }
-    opac_wrapper_set_help_context(); 
-    bottom_pane.get_contentWindow().addEventListener('load',opac_wrapper_set_help_context,false);
 }
 
 function set_opac() {
@@ -667,7 +687,6 @@ function refresh_display(id) {
         marc_edit_reset = true;
         copy_browser_reset = true;
         hold_browser_reset = true;
-        acq_orders_reset = true;
         while(top_pane.node.lastChild) top_pane.node.removeChild( top_pane.node.lastChild );
         var children = bottom_pane.node.childNodes;
         for (var i = 0; i < children.length; i++) {
@@ -690,7 +709,6 @@ function refresh_display(id) {
             case 'marc_edit' : set_marc_edit(); break;
             case 'copy_browser' : set_copy_browser(); break;
             case 'hold_browser' : set_hold_browser(); break;
-            case 'acq_orders' : set_acq_orders(); break;
             case 'serctrl_view' : set_serctrl_view(); break;
             case 'opac' :
             default: set_opac(); break;
index a758c92..dd26a6d 100644 (file)
@@ -49,7 +49,7 @@
                 <menuitem label="&staff.cat.opac.marc_edit.label;" accesskey="&staff.cat.opac.marc_edit.accesskey;" id="marc_edit" oncommand="set_marc_edit();"/>
                 <menuitem label="&staff.cat.opac.copy_browse.label;" accesskey="&staff.cat.opac.copy_browse.accesskey;" id="copy_browse" oncommand="set_copy_browser();"/>
                 <menuitem label="&staff.cat.opac.view_holds.label;" accesskey="&staff.cat.opac.view_holds.accesskey;" id="view_holds" oncommand="set_hold_browser();"/>
-                <menuitem label="&staff.cat.opac.view_orders.label;" accesskey="&staff.cat.opac.view_orders.accesskey;" id="view_orders" oncommand="set_acq_orders();"/>
+                <menuitem label="&staff.cat.opac.view_orders.label;" accesskey="&staff.cat.opac.view_orders.accesskey;" id="view_orders" oncommand="open_acq_orders();"/>
                 <menuseparator/>
                 <menuitem label="&staff.cat.opac.add_bucket.label;" accesskey="&staff.cat.opac.add_bucket.accesskey;" id="add_bucket" oncommand="add_to_bucket();"/>
                 <menuitem label="&staff.cat.opac.mark_for_overlay.label;" accesskey="&staff.cat.opac.mark_for_overlay.accesskey;" id="mark_for_overlay" oncommand="mark_for_overlay();"/>
index eca1229..07c9f4a 100644 (file)
@@ -259,6 +259,7 @@ staff.cat.opac.marked_record_for_hold_transfer_indicator.record_id.label=Record
 staff.cat.opac.title_for_hold_transfer.destination_needed.label=Need to mark a record as a Title Hold Transfer Destination first.
 staff.cat.opac.title_for_hold_transfer.success.label=Holds transferred.
 staff.cat.opac.title_for_hold_transfer.failure.label=Holds not transferred.
+staff.cat.opac.related_items=Related Lineitems
 staff.cat.create_or_rebarcode_items=Create or Re-barcode Items
 printing.nothing_to_reprint=Nothing to re-print
 printing.prompt_for_external_print_cmd=Enter external print command and parameters (use %receipt.txt% or %receipt.html% as the file containing the print data. Those values will be substituted with the proper path.):