Acq: Delay loading of providers for invoice-linking dialogs until
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 19 Sep 2010 23:53:36 +0000 (23:53 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 19 Sep 2010 23:53:36 +0000 (23:53 +0000)
they're really needed.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17821 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/acq/common/li_table.js
Open-ILS/web/js/ui/default/acq/po/view_po.js
Open-ILS/web/templates/default/acq/common/inv_dialog.tt2
Open-ILS/web/templates/default/acq/po/view.tt2

index 9a09b53..5e7357b 100644 (file)
@@ -68,7 +68,6 @@ function AcqLiTable() {
     this.realCopiesRow = this.realCopiesTbody.removeChild(dojo.byId('acq-lit-real-copies-row'));
     this._copy_fields_for_acqdf = ['owning_lib', 'location'];
     this.skipInitialEligibilityCheck = false;
-    this.invoiceLinkDialogManager = new InvoiceLinkDialogManager("li");
     this.claimDialog = new ClaimDialogManager(
         liClaimDialog, finalClaimDialog, this.claimEligibleLidByLi,
         function(li) {    /* callback that fires when claims are made */
@@ -501,6 +500,10 @@ function AcqLiTable() {
                 nodeByName("action_none", row).selected = true;
             };
             actLinkInvoice.onclick = function() {
+                if (!self.invoiceLinkDialogManager) {
+                    self.invoiceLinkDialogManager =
+                        new InvoiceLinkDialogManager("li");
+                }
                 self.invoiceLinkDialogManager.target = li;
                 acqLitLinkInvoiceDialog.show();
                 nodeByName("action_none", row).selected = true;
index 05ee24a..cec6abc 100644 (file)
@@ -295,9 +295,6 @@ function prepareInvoiceFeatures() {
             "/acq/invoice/view?create=1&attach_po=" + PO.id();
     };
 
-    if (!invoiceLinkDialogManager)
-        invoiceLinkDialogManager = new InvoiceLinkDialogManager("po", PO);
-
     openils.Util.show("acq-po-invoice-stuff", "table-cell");
 }
 
index 28466b4..3bec75c 100644 (file)
@@ -4,21 +4,21 @@
 <table class="acq-link-invoice-dialog">
     <tr>
         <th>
-            <label for="acq-[% which %]-link-invoice-provider">Provider</label>
+            <label for="acq-[% which %]-link-invoice-inv_ident">
+                Invoice #
+            </label>
         </th>
         <td>
-            <span id="acq-[% which %]-link-invoice-provider"></span>
+            <input id="acq-[% which %]-link-invoice-inv_ident"
+                dojoType="dijit.form.TextBox" />
         </td>
     </tr>
     <tr>
         <th>
-            <label for="acq-[% which %]-link-invoice-inv_ident">
-                Invoice #
-            </label>
+            <label for="acq-[% which %]-link-invoice-provider">Provider</label>
         </th>
         <td>
-            <input id="acq-[% which %]-link-invoice-inv_ident"
-                dojoType="dijit.form.TextBox" />
+            <span id="acq-[% which %]-link-invoice-provider"></span>
         </td>
     </tr>
     <tr>
index 1f14d9a..cc4bf1e 100644 (file)
                             <span>Link Invoice</span>
                             <div dojoType="dijit.TooltipDialog"
                                 id="acq-po-link-invoice">
+                                <script type="dojo/connect" event="onOpen">
+                                    if (!invoiceLinkDialogManager) {
+                                        invoiceLinkDialogManager =
+                                            new InvoiceLinkDialogManager(
+                                                "po", PO
+                                            );
+                                    }
+                                </script>
                                 [% INCLUDE "default/acq/common/inv_dialog.tt2"
                                     which = "po" %]
                             </div>