From 461eb848f3a9d1019b3e31e067c18f416482a977 Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Tue, 26 Feb 2013 14:28:40 -0500 Subject: [PATCH] Acq: general PO interface improvements See included release notes doc. The bullet points after the empty line are not yet done. Signed-off-by: Lebbeous Fogle-Weekley --- Open-ILS/src/templates/acq/common/li_table.tt2 | 6 +-- Open-ILS/src/templates/acq/invoice/receive.tt2 | 2 +- Open-ILS/src/templates/acq/po/item_table.tt2 | 2 +- Open-ILS/src/templates/acq/po/view.tt2 | 8 ++-- .../conify/global/acq/distribution_formula.tt2 | 2 +- Open-ILS/web/js/ui/default/acq/po/view_po.js | 43 +++++++++++++++++----- .../acq_po_interface_improvements.txt | 17 +++++++++ 7 files changed, 60 insertions(+), 20 deletions(-) create mode 100644 docs/RELEASE_NOTES_NEXT/acq_po_interface_improvements.txt diff --git a/Open-ILS/src/templates/acq/common/li_table.tt2 b/Open-ILS/src/templates/acq/common/li_table.tt2 index 83881d0393..efc220f8d9 100644 --- a/Open-ILS/src/templates/acq/common/li_table.tt2 +++ b/Open-ILS/src/templates/acq/common/li_table.tt2 @@ -212,7 +212,7 @@ [% l('Owning Branch') %] - [% l('Shelving Location') %] + [% l('Copy Location') %] [% l('Collection Code') %] [% l('Fund') %] [% l('Circ Modifier') %] @@ -239,7 +239,7 @@ [% l('Owning Branch') %] - [% l('Shelving Location') %] + [% l('Copy Location') %] [% l('Collection Code') %] [% l('Fund') %] [% l('Circ Modifier') %] @@ -292,7 +292,7 @@ [% l('Owning Branch') %] - [% l('Shelving Location') %] + [% l('Copy Location') %] [% l('Circ Modifier') %] [% l('Callnumber') %] [% l('Barcode') %] diff --git a/Open-ILS/src/templates/acq/invoice/receive.tt2 b/Open-ILS/src/templates/acq/invoice/receive.tt2 index 1a964a6e2a..80756cf2f3 100644 --- a/Open-ILS/src/templates/acq/invoice/receive.tt2 +++ b/Open-ILS/src/templates/acq/invoice/receive.tt2 @@ -39,7 +39,7 @@ /> [% l('Owning Branch') %] - [% l('Shelving Location') %] + [% l('Copy Location') %] [% l('Collection Code') %] [% l('Fund') %] [% l('Circ Modifier') %] diff --git a/Open-ILS/src/templates/acq/po/item_table.tt2 b/Open-ILS/src/templates/acq/po/item_table.tt2 index 80497c5b87..be61c8e208 100644 --- a/Open-ILS/src/templates/acq/po/item_table.tt2 +++ b/Open-ILS/src/templates/acq/po/item_table.tt2 @@ -27,7 +27,7 @@ -
+ diff --git a/Open-ILS/src/templates/acq/po/view.tt2 b/Open-ILS/src/templates/acq/po/view.tt2 index 2bc08e6c76..143a9d2c31 100644 --- a/Open-ILS/src/templates/acq/po/view.tt2 +++ b/Open-ILS/src/templates/acq/po/view.tt2 @@ -21,7 +21,7 @@ [% l('Activatable?') %] - + @@ -54,7 +54,7 @@ [% l('Total Encumbered') %] [% l('$[_1]', '') %] - [% l('Invoicing') %] + [% l('Invoicing') %]
- [% l('Allow activation with
zero-copy lineitems') %] - + [% l('Allow activation with
zero-copy lineitems') %] + diff --git a/Open-ILS/src/templates/conify/global/acq/distribution_formula.tt2 b/Open-ILS/src/templates/conify/global/acq/distribution_formula.tt2 index e3dfd1ac90..d80e29e157 100644 --- a/Open-ILS/src/templates/conify/global/acq/distribution_formula.tt2 +++ b/Open-ILS/src/templates/conify/global/acq/distribution_formula.tt2 @@ -49,7 +49,7 @@ [% l('Owning Library') %] - [% l('Shelving Location') %] + [% l('Copy Location') %] [% l('Item Count') %] diff --git a/Open-ILS/web/js/ui/default/acq/po/view_po.js b/Open-ILS/web/js/ui/default/acq/po/view_po.js index 490de978cf..e20794937f 100644 --- a/Open-ILS/web/js/ui/default/acq/po/view_po.js +++ b/Open-ILS/web/js/ui/default/acq/po/view_po.js @@ -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"); /* not 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 index 0000000000..9aaf086894 --- /dev/null +++ b/docs/RELEASE_NOTES_NEXT/acq_po_interface_improvements.txt @@ -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 -- 2.11.0