Acq: general PO interface improvements
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 26 Feb 2013 19:28:40 +0000 (14:28 -0500)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 11 Mar 2013 18:00:49 +0000 (14:00 -0400)
See included release notes doc.  The bullet points after the empty line
are not yet done.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/templates/acq/common/li_table.tt2
Open-ILS/src/templates/acq/invoice/receive.tt2
Open-ILS/src/templates/acq/po/item_table.tt2
Open-ILS/src/templates/acq/po/view.tt2
Open-ILS/src/templates/conify/global/acq/distribution_formula.tt2
Open-ILS/web/js/ui/default/acq/po/view_po.js
docs/RELEASE_NOTES_NEXT/acq_po_interface_improvements.txt [new file with mode: 0644]

index 83881d0..efc220f 100644 (file)
             <tbody style='font-weight:bold;'>
                 <tr>
                     <td style='margin-top:30px;'>[% l('Owning Branch') %]</td>
-                    <td>[% l('Shelving Location') %]</td>
+                    <td>[% l('Copy Location') %]</td>
                     <td>[% l('Collection Code') %]</td>
                     <td>[% l('Fund') %]</td>
                     <td>[% l('Circ Modifier') %]</td>
             <tbody style='font-weight:bold;'>
                 <tr>
                     <td style='margin-top:30px;'>[% l('Owning Branch') %]</td>
-                    <td>[% l('Shelving Location') %]</td>
+                    <td>[% l('Copy Location') %]</td>
                     <td>[% l('Collection Code') %]</td>
                     <td>[% l('Fund') %]</td>
                     <td>[% l('Circ Modifier') %]</td>
             <tbody style='font-weight:bold;'>
                 <tr>
                     <td style='margin-top:30px;'>[% l('Owning Branch') %]</td>
-                    <td>[% l('Shelving Location') %]</td>
+                    <td>[% l('Copy Location') %]</td>
                     <td>[% l('Circ Modifier') %]</td>
                     <td>[% l('Callnumber') %]</td>
                     <td>[% l('Barcode') %]</td>
index 1a964a6..80756cf 100644 (file)
@@ -39,7 +39,7 @@
                             /><label for="select_all">[% l(' Select All') %]</label>
                     </th>
                     <th>[% l('Owning Branch') %]</th>
-                    <th>[% l('Shelving Location') %]</th>
+                    <th>[% l('Copy Location') %]</th>
                     <th>[% l('Collection Code') %]</th>
                     <th>[% l('Fund') %]</th>
                     <th>[% l('Circ Modifier') %]</th>
index 80497c5..be61c8e 100644 (file)
@@ -27,7 +27,7 @@
     <div id="acq-po-item-table-i-am-empty" class="hidden">
         <em>[% l('There are no miscellanea attached to this purchase order.') %]</em>
     </div>
-    <div id="acq-po-item-table-controls">
+    <div id="acq-po-item-table-controls" class="hidden">
         <button id="acq-po-item-table-new-charge">[% l('New Charge') %]</button> &nbsp;
         <button id="acq-po-item-table-save-new">[% l('Save New Charges') %]</button>
     </div>
index 2bc08e6..143a9d2 100644 (file)
@@ -21,7 +21,7 @@
                     <th>[% l('Activatable?') %]</th>
                     <td>
                         <span id="acq-po-activate-checking"></span>
-                        <a class="hidden" id="acq-po-activate-link" href="javascript:void(0);" onclick="activatePo()">[% l('Activate Order') %]</a>
+                        <span class="hidden" id="acq-po-activate-link"><span dojoType="dijit.form.Button" onClick="activatePo()" jsId="activatePoButton">[% l('Activate Order') %]</span></span>
                     </td>
                 </tr>
                 <tr>
@@ -54,7 +54,7 @@
                 <tr>
                     <th>[% l('Total Encumbered') %]</th>
                     <td>[% l('$[_1]', '<span id="acq-po-view-total-enc"></span>') %]</td>
-                    <th>[% l('Invoicing') %]</th>
+                    <th id="acq-po-invoice-label" class="hidden">[% l('Invoicing') %]</th>
                     <td id="acq-po-invoice-stuff" class="hidden">
                         <button dojoType="dijit.form.Button"
                             id="acq-po-view-invoice-link">
                             <button dojoType='dijit.form.Button' id='acq-po-return-to-invoice-button'>[% l('&#x2196; Return to Invoice') %]</button>
                         </div>
                     </td>
-                    <th>[% l('Allow activation with <br/> zero-copy lineitems') %]</th>
-                    <td><input type='checkbox' id='acq-po-activate-zero-copies' onclick='checkCouldActivatePo()'/></td>
+                    <th class="hidden" id="acq-po-zero-activate-label">[% l('Allow activation with <br/> zero-copy lineitems') %]</th>
+                    <td class="hidden" id="acq-po-zero-activate"><input type='checkbox' id='acq-po-activate-zero-copies' onclick='checkCouldActivatePo()'/></td>
                 </tr>
                 <tr>
                     <td colspan='3'>
index 2132d9f..68f536e 100644 (file)
@@ -49,7 +49,7 @@
             <tr>
                 <th></th>
                 <th>[% l('Owning Library') %]</th>
-                <th>[% l('Shelving Location') %]</th>
+                <th>[% l('Copy Location') %]</th>
                 <th>[% l('Fund') %]</th>
                 <th>[% l('Circ Modifier') %]</th>
                 <th>[% l('Collection Code') %]</th>
index 490de97..e207949 100644 (file)
@@ -299,6 +299,9 @@ function prepareInvoiceFeatures() {
     openils.Util.show("acq-po-invoice-stuff", "table-cell");
 }
 
+/* renderPo() is the best place to add tests that depend on PO-state
+ * (or simple ordered-or-not? checks) to enable/disable UI elements
+ * across the whole interface. */
 function renderPo() {
     var po_state = PO.state();
     dojo.byId("acq-po-view-id").innerHTML = PO.id();
@@ -325,16 +328,29 @@ function renderPo() {
         } else if(po_state == "received") {
             dojo.removeAttr('rollback_receive_po', 'disabled');
         }
+
+        /* cancel widgets only make sense for activate (ordered) POs */
+        makeCancelWidget(
+            dojo.byId("acq-po-view-cancel-reason"),
+            dojo.byId("acq-po-cancel-label")
+        );
+
+        /* likewise for invoice features */
+        openils.Util.show("acq-po-invoice-label", "table-cell");
+        prepareInvoiceFeatures();
+    } else {
+        /* These things only make sense for not-ordered-yet POs */
+
+        openils.Util.show("acq-po-zero-activate-label", "table-cell");
+        openils.Util.show("acq-po-zero-activate", "table-cell");
+
+        openils.Util.show("acq-po-item-table-controls");
     }
 
     makePrepayWidget(
         dojo.byId("acq-po-view-prepay"),
         openils.Util.isTrue(PO.prepayment_required())
     );
-    makeCancelWidget(
-        dojo.byId("acq-po-view-cancel-reason"),
-        dojo.byId("acq-po-cancel-label")
-    );
     // dojo.byId("acq-po-view-notes").innerHTML = PO.notes().length;
     poNoteTable.updatePoNotesCount();
 
@@ -380,8 +396,6 @@ function renderPo() {
             }
         );
     }
-
-    prepareInvoiceFeatures();
 }
 
 
@@ -466,7 +480,7 @@ function init() {
 
 function checkCouldActivatePo() {
     var d = dojo.byId("acq-po-activate-checking");
-    var a = dojo.byId("acq-po-activate-link");
+    var a = dojo.byId("acq-po-activate-link");  /* <span> not <a> now, but no diff */
     d.innerHTML = localeStrings.PO_CHECKING;
     var warnings = [];
     var stops = [];
@@ -503,6 +517,7 @@ function checkCouldActivatePo() {
                 if (!(warnings.length || stops.length || other.length)) {
                     d.innerHTML = localeStrings.PO_COULD_ACTIVATE;
                     openils.Util.show(a, "inline");
+                    activatePoButton.attr("disabled", false);
                 } else {
                     if (other.length) {
                         /* XXX make the textcode part a tooltip one day */
@@ -543,6 +558,7 @@ function checkCouldActivatePo() {
                                 ]
                             );
                         openils.Util.show(a, "inline");
+                        activatePoButton.attr("disabled", false);
                     }
                 }
             }
@@ -551,14 +567,20 @@ function checkCouldActivatePo() {
 }
 
 function activatePo() {
+    activatePoButton.attr("disabled", true);
+
     if (openils.Util.isTrue(PO.prepayment_required())) {
-        if (!confirm(localeStrings.PREPAYMENT_REQUIRED_REMINDER))
+        if (!confirm(localeStrings.PREPAYMENT_REQUIRED_REMINDER)) {
+            activatePoButton.attr("disabled", false);
             return false;
+        }
     }
 
     if (PO._warning_hack) {
-        if (!confirm(localeStrings.PO_FUND_WARNING_CONFIRM))
+        if (!confirm(localeStrings.PO_FUND_WARNING_CONFIRM)) {
+            activatePoButton.attr("disabled", false);
             return false;
+        }
     }
 
     liTable.showAssetCreator(activatePoStage2);
@@ -578,10 +600,11 @@ function activatePoStage2() {
                 {zero_copy_activate : dojo.byId('acq-po-activate-zero-copies').checked}
             ],
             "onresponse": function(r) {
+                progressDialog.hide();
+                activatePoButton.attr("disabled", false);
                 want_refresh = Boolean(openils.Util.readResponse(r));
             },
             "oncomplete": function() {
-                progressDialog.hide();
                 if (want_refresh)
                     location.href = location.href;
             }
diff --git a/docs/RELEASE_NOTES_NEXT/acq_po_interface_improvements.txt b/docs/RELEASE_NOTES_NEXT/acq_po_interface_improvements.txt
new file mode 100644 (file)
index 0000000..9aaf086
--- /dev/null
@@ -0,0 +1,17 @@
+Acquisitions Purchase Order Improvements
+========================================
+
+Feature Summary
+---------------
+
+The following features, which primarily affect the user interface layer,
+improve Acquisitions work flows.
+
+  * Avoid double-activation of POs
+  * Disable invoice and cancel options for pending POs
+  * Disable zero-copy checkbox for activated POs
+  * Disable new charges for activated POs
+  * Replace "Shelving Location" with Copy Location
+
+  * Rearranging "actions" drop-down
+  * Disable / Allow batch updater operations depending on PO state