From 3710c281746eb274c5471c6305485e44c1e31e52 Mon Sep 17 00:00:00 2001
From: "a. bellenir" <ab@grpl.org>
Date: Thu, 24 May 2018 11:44:28 -0400
Subject: [PATCH] LP#1743801: Item Status List View Display Issues

Age Protection was missing '.name' field.

Loan Duration and Fine Levels are numeric: 1, 2, or 3.
Added an Angular filter to show the desired string from numeric index.

Conflicts:
    Open-ILS/src/templates/staff/cat/item/t_list.tt2

Signed-off-by: a. bellenir <ab@grpl.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Jason Stephenson <jason@sigio.com>
---
 Open-ILS/src/templates/staff/cat/item/t_list.tt2       | 10 +++++++---
 Open-ILS/web/js/ui/default/staff/circ/services/item.js |  1 +
 2 files changed, 8 insertions(+), 3 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 e1dd08205f..15e048640c 100644
--- a/Open-ILS/src/templates/staff/cat/item/t_list.tt2
+++ b/Open-ILS/src/templates/staff/cat/item/t_list.tt2
@@ -80,7 +80,7 @@
   </eg-grid-field>
 
   <eg-grid-field label="[% l('Acquisition Cost') %]"     path="cost" hidden></eg-grid-field>
-  <eg-grid-field label="[% l('Age-Based Hold Protection') %]"  path="age_protect" hidden></eg-grid-field>
+  <eg-grid-field label="[% l('Age-Based Hold Protection') %]"  path="age_protect.name" hidden></eg-grid-field>
   <eg-grid-field label="[% l('Author') %]"               path="call_number.record.simple_record.author"  hidden></eg-grid-field>
   <eg-grid-field label="[% l('Checkin Date') %]"         path="_circ_summary.last_checkin_time" datatype="timestamp" hidden></eg-grid-field>
   <eg-grid-field label="[% l('Checkin Scan Date') %]"    path="_circ_summary.last_checkin_scan_time" datatype="timestamp" hidden></eg-grid-field>
@@ -108,7 +108,9 @@
   <eg-grid-field label="[% l('Deleted?') %]"              path="deleted" hidden></eg-grid-field>
   <eg-grid-field label="[% l('Document ID') %]"           path="call_number.record.id" hidden></eg-grid-field>
   <eg-grid-field label="[% l('Edited By') %]"             path="editor.usrname" hidden></eg-grid-field>
-  <eg-grid-field label="[% l('Fine Level') %]"            path="fine_level" hidden></eg-grid-field>
+  <eg-grid-field label="[% l('Fine Level') %]"            path="fine_level" hidden>
+    <span>{{item['fine_level'] | string_pick:'[% l('Low') %]':'[% l('Normal') %]':'[% l('High') %]'}}</span>
+  </eg-grid-field>
   <eg-grid-field label="[% l('Fines Stopped') %]"         path="_circ_summary.last_stop_fines" hidden></eg-grid-field>
   <eg-grid-field label="[% l('Fines Stopped Time') %]"    path="_circ_summary.last_stop_fines_time" datatype="timestamp" hidden></eg-grid-field>
   <eg-grid-field label="[% l('Floating Group') %]"        path="floating.name" hidden></eg-grid-field>
@@ -116,7 +118,9 @@
   <eg-grid-field label="[% l('Holds Count') %]"           path="holds_count" hidden></eg-grid-field>
   <eg-grid-field label="[% l('In-House Uses') %]"         path="_inHouseUseCount" hidden></eg-grid-field>
   <eg-grid-field label="[% l('ISBN') %]"                  path="call_number.record.simple_record.isbn" hidden></eg-grid-field>
-  <eg-grid-field label="[% l('Loan Duration') %]"         path="loan.duration" hidden></eg-grid-field>
+  <eg-grid-field label="[% l('Loan Duration') %]"         path="loan_duration" hidden>
+    <span>{{item['loan_duration'] | string_pick:'[% l('Short') %]':'[% l('Normal') %]':'[% l('Extended') %]'}}</span>
+  </eg-grid-field>
   <eg-grid-field label="[% l('OPAC Visible?') %]"         path="opac_visible" hidden></eg-grid-field>
   <eg-grid-field label="[% l('Owned By') %]"              path="call_number.record.owner" hidden></eg-grid-field>
   <eg-grid-field label="[% l('Owning Library') %]"        path="call_number.owning_lib.shortname" 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 46a977d6a1..4c13dd367e 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
@@ -949,3 +949,4 @@ function(egCore , egCirc , $uibModal , $q , $timeout , $window , egConfirmDialog
 
     return service;
 }])
+.filter('string_pick', function() { return function(i){ return arguments[i] || ''; }; })
-- 
2.11.0