From b719b8593445f184518838ba3ee3cff724a34180 Mon Sep 17 00:00:00 2001
From: Cesar Velez <cesar.velez@equinoxinitiative.org>
Date: Thu, 25 Jan 2018 12:50:59 -0500
Subject: [PATCH] LP#1738249 - Fix checkout_workstation display issue

Addresses the issue with checkout workstation, by
attaching as a object property to the flatCopy hash.
Also makes sure the pcrud call uses combcirc.

Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Jason Stephenson <jason@sigio.com>
---
 Open-ILS/src/templates/staff/cat/item/t_list.tt2       | 2 +-
 Open-ILS/web/js/ui/default/staff/circ/services/item.js | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/Open-ILS/src/templates/staff/cat/item/t_list.tt2 b/Open-ILS/src/templates/staff/cat/item/t_list.tt2
index 521d780f75..64d38fd8dd 100644
--- a/Open-ILS/src/templates/staff/cat/item/t_list.tt2
+++ b/Open-ILS/src/templates/staff/cat/item/t_list.tt2
@@ -86,7 +86,7 @@
   <eg-grid-field label="[% l('Checkin Scan Date') %]"    path="_circ_summary.last_checkin_scan_time" datatype="timestamp" hidden></eg-grid-field>
   <eg-grid-field label="[% l('Checkin Workstation') %]"  path="_circ_summary.last_checkin_workstation" hidden></eg-grid-field>
   <eg-grid-field label="[% l('Checkout Date') %]"  path="_circ_summary.start_time" datatype="timestamp" hidden></eg-grid-field>
-  <eg-grid-field label="[% l('Checkout Workstation') %]"  path="_circ.workstation.name" hidden></eg-grid-field>
+  <eg-grid-field label="[% l('Checkout Workstation') %]"  path="_checkout_ws" 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>
diff --git a/Open-ILS/web/js/ui/default/staff/circ/services/item.js b/Open-ILS/web/js/ui/default/staff/circ/services/item.js
index 16b97fab8a..1a6e839ce8 100644
--- a/Open-ILS/web/js/ui/default/staff/circ/services/item.js
+++ b/Open-ILS/web/js/ui/default/staff/circ/services/item.js
@@ -62,7 +62,7 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
     }
 
     service.getCirc = function(id) {
-        return egCore.pcrud.search('aacs', { target_copy : id },
+        return egCore.pcrud.search('combcirc', { target_copy : id },
             service.circFlesh).then(function(circ) {return circ});
     }
 
@@ -152,6 +152,7 @@ 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._checkout_ws = copyData.circ.workstation().name();
                 }
                 flatCopy.index = service.index++;
                 flatCopy.copy_alert_count = copyData.copy.copy_alerts().filter(function(aca) {
-- 
2.11.0