acq - create invoice from / link to invoice now work in new tab
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Wed, 6 Mar 2013 20:11:08 +0000 (15:11 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 11 Mar 2013 18:00:52 +0000 (14:00 -0400)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/web/js/dojo/openils/acq/nls/acq.js
Open-ILS/web/js/ui/default/acq/common/inv_dialog.js
Open-ILS/web/js/ui/default/acq/common/li_table.js

index fd7949f..51100b0 100644 (file)
@@ -87,5 +87,6 @@
     "COPIES_TO_RECEIVE": "Number of copies to receive: ",
     "CREATE_PO_INVALID": "A purchase order must have an ordering agency and a provider.",
     "INVOICE_COPY_COUNT_INFO": "Copies received on this invoice: ${0} out of ${1}.",
-    "INVOICE_IDENT_COLLIDE": "There is already an invoice in the system with the given combination of 'Vendor Invoice ID' and 'Provider,' which is not allowed."
+    "INVOICE_IDENT_COLLIDE": "There is already an invoice in the system with the given combination of 'Vendor Invoice ID' and 'Provider,' which is not allowed.",
+    "NEW_INVOICE": "New Invoice"
 }
index 7a5789e..6ef5126 100644 (file)
@@ -11,7 +11,18 @@ function InvoiceLinkDialogManager(which, target) {
             var join = (idx == 0) ? '?' : '&';
             path += join + "attach_" + self.which + "=" + id;
         });
-        location.href = path;
+        if (openils.XUL.isXUL()) {
+            openils.XUL.newTabEasy(
+                path,
+                /* tab title */ dojo.string.substitute(
+                    localeStrings.INVOICE_NUMBER, [self.inv.inv_ident()]
+                ),
+                null,
+                true /* <browser> wrapper */
+            );
+        } else {
+            location.href = path;
+        }
     };
 
     this.which = which;
index 28caf99..e727b64 100644 (file)
@@ -2804,7 +2804,10 @@ function AcqLiTable() {
         if (!liIds.length) return;
         var path = oilsBasePath + '/acq/invoice/view?create=1';
         dojo.forEach(liIds, function(li, idx) { path += '&attach_li=' + li });
-        location.href = path;
+        if (openils.XUL.isXUL())
+            openils.XUL.newTabEasy(path, localeStrings.NEW_INVOICE, null, true);
+        else
+            location.href = path;
     };
 
     this.batchLinkInvoice = function(create) {