From 3a22d76ae793b2c054a1f03cecf2830b6ddbc4d5 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 12 May 2017 12:14:25 -0400 Subject: [PATCH] LP#1251394 Webstaff items out display entry proof of concept Signed-off-by: Bill Erickson --- Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 | 4 ++-- .../web/js/ui/default/staff/circ/patron/items_out.js | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 index 4c354fd40d..7d1936e1da 100644 --- a/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 +++ b/Open-ILS/src/templates/staff/circ/patron/t_items_out.tt2 @@ -90,7 +90,7 @@ - {{item.target_copy().call_number().record().simple_record().title()}} + {{item.target_copy().call_number().record().wide_display_entry().title()}} @@ -100,7 +100,7 @@ - + diff --git a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js index c8631943ea..df948656ee 100644 --- a/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js +++ b/Open-ILS/web/js/ui/default/staff/circ/patron/items_out.js @@ -108,7 +108,7 @@ function($scope, $q, $routeParams, $timeout, egCore , egUser, patronSvc , $ circ : ['target_copy', 'workstation', 'checkin_workstation'], acp : ['call_number', 'holds_count', 'status', 'circ_lib'], acn : ['record', 'owning_lib'], - bre : ['simple_record'] + bre : ['wide_display_entry'] }, // avoid fetching the MARC blob by specifying which // fields on the bre to select. More may be needed. @@ -125,9 +125,17 @@ function($scope, $q, $routeParams, $timeout, egCore , egUser, patronSvc , $ }).then(deferred.resolve, null, function(circ) { circ.circ_lib(egCore.org.get(circ.circ_lib())); // local fleshing + // TODO: move to shared service + // Un-JSON-ify display field data + var wde = circ.target_copy().call_number().record().wide_display_entry(); + angular.forEach(egCore.idl.classes.mwde.fields, function(f) { + if (f.virtual) return; + wde[f.name](JSON.parse(wde[f.name]())); + }); + if (circ.target_copy().call_number().id() == -1) { // dummy-up a record for precat items - circ.target_copy().call_number().record().simple_record({ + circ.target_copy().call_number().record().wide_display_entry({ title : function() {return circ.target_copy().dummy_title()}, author : function() {return circ.target_copy().dummy_author()}, isbn : function() {return circ.target_copy().dummy_isbn()} @@ -351,8 +359,8 @@ function($scope, $q, $routeParams, $timeout, egCore , egUser, patronSvc , $ circ : egCore.idl.toHash(circ), copy : egCore.idl.toHash(circ.target_copy()), call_number : egCore.idl.toHash(circ.target_copy().call_number()), - title : circ.target_copy().call_number().record().simple_record().title(), - author : circ.target_copy().call_number().record().simple_record().author(), + title : circ.target_copy().call_number().record().wide_display_entry().title(), + author : circ.target_copy().call_number().record().wide_display_entry().author(), }) }); -- 2.11.0