Added necessary fleshing in egCirc service and items out to get acn.owning_lib.shortname
Signed-off by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Jason Etheridge <jason@equinoxinitiative.org>
path="author" hidden></eg-grid-field>
<eg-grid-field path="acp.circ_modifier.name" label="[% l('Circulation Modifier') %]"></eg-grid-field>
<eg-grid-field path="acp.circ_lib.shortname" label="[% l('Circulation Library') %]"></eg-grid-field>
+ <eg-grid-field path="acn.owning_lib.shortname" label="[% l('Owning Library') %]"></eg-grid-field>
<eg-grid-field path="circ.*" parent-idl-class="circ" hidden></eg-grid-field>
<eg-grid-field path="acp.*" parent-idl-class="acp" hidden></eg-grid-field>
<eg-grid-field path="acn.*" parent-idl-class="acn" hidden></eg-grid-field>
<eg-grid-field label="[% l('Workstation') %]" path='workstation.name'></eg-grid-field>
<eg-grid-field label="[% l('Checkin Workstation') %]" path='checkin_workstation.name'></eg-grid-field>
<eg-grid-field label="[% l('Checkout / Renewal Library') %]" path='circ_lib.shortname'></eg-grid-field>
+ <eg-grid-field label="[% l('Owning Library') %]" path='target_copy.call_number.owning_lib.shortname'></eg-grid-field>
<eg-grid-field label="[% l('Renewals Remaining') %]" path='renewal_remaining'></eg-grid-field>
<eg-grid-field label="[% l('Fines Stopped') %]" path='stop_fines'></eg-grid-field>
<eg-grid-field label="[% l('Title') %]" path="target_copy.call_number.record.simple_record.title" name="title">
flesh_fields : {
circ : ['target_copy', 'workstation', 'checkin_workstation'],
acp : ['call_number', 'holds_count', 'status'],
- acn : ['record'],
+ acn : ['record', 'owning_lib'],
bre : ['simple_record']
},
// avoid fetching the MARC blob by specifying which
var promises = [];
var payload;
if (!evt[0] || !(payload = evt[0].payload)) return $q.when();
-
+
promises.push(service.flesh_copy_location(payload.copy));
if (payload.copy) {
+ promises.push(service.flesh_acn_owning_lib(payload.volume));
promises.push(service.flesh_copy_circ_library(payload.copy));
promises.push(service.flesh_copy_circ_modifier(payload.copy));
promises.push(
return $q.all(promises);
}
+ service.flesh_acn_owning_lib = function(acn) {
+ if (!acn) return $q.when();
+ return $q.when(acn.owning_lib(egCore.org.get( acn.owning_lib() )));
+ }
+
service.flesh_copy_circ_library = function(copy) {
if (!copy) return $q.when();