LP#1738249: sort out circ or renewal workstation user/cesardv/lp1738249_signoff_rebase
authorGalen Charlton <gmc@equinoxinitiative.org>
Tue, 6 Feb 2018 21:56:56 +0000 (16:56 -0500)
committerCesar Velez <cesar.velez@equinoxinitiative.org>
Thu, 8 Feb 2018 15:26:27 +0000 (10:26 -0500)
This patch uses accs to work out the name of the workstation
of the most recent renewal, if it exists, or the original
checkout. It implicitly handles the case where the workstation
on the original circulation is null.  As a bonus, this patch
adds an explicit "Last Renewal Workstation" to the item status
grid.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Open-ILS/src/templates/staff/cat/item/t_list.tt2
Open-ILS/web/js/ui/default/staff/circ/services/item.js

index 6980917..24c72e9 100644 (file)
@@ -86,7 +86,8 @@
   <eg-grid-field label="[% l('Checkout Workstation') %]"  path="_circ_summary.checkout_workstation" hidden></eg-grid-field>
   <eg-grid-field label="[% l('Checkout/Renewal Library') %]"  path="_circ_lib.shortname" hidden></eg-grid-field>
   <eg-grid-field label="[% l('Circulation ID') %]"        path="_circ.id" hidden></eg-grid-field>
-  <eg-grid-field label="[% l('Circ or Renewal Workstation') %]"  path="_circ_summary.last_renewal_workstation" hidden></eg-grid-field>
+  <eg-grid-field label="[% l('Circ or Renewal Workstation') %]"  path="_circ_ws" hidden></eg-grid-field>
+  <eg-grid-field label="[% l('Last Renewal Workstation') %]"  path="_circ_summary.last_renewal_workstation" hidden></eg-grid-field>
   <eg-grid-field label="[% l('Classification') %]"        path="call_number.label_class.name" hidden></eg-grid-field>
   <eg-grid-field label="[% l('CN Prefix') %]"             path="call_number.prefix.label" hidden></eg-grid-field>
   <eg-grid-field label="[% l('CN Suffix') %]"             path="call_number.suffix.label" hidden></eg-grid-field>
index 9dc319e..380cd31 100644 (file)
@@ -152,6 +152,11 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
                     flatCopy._circ_summary = egCore.idl.toHash(copyData.circ_summary, true);
                     flatCopy._circ_lib = copyData.circ.circ_lib();
                     flatCopy._duration = copyData.circ.duration();
+                    flatCopy._circ_ws = flatCopy._circ_summary.last_renewal_workstation ?
+                                        flatCopy._circ_summary.last_renewal_workstation :
+                                        flatCopy._circ_summary.checkout_workstation ?
+                                        flatCopy._circ_summary.checkout_workstation :
+                                        '';
                 }
                 flatCopy.index = service.index++;
                 service.copies.unshift(flatCopy);