From: Bill Erickson Date: Mon, 14 Feb 2011 11:45:40 +0000 (-0500) Subject: pulling in more copy fields for display; added sample code X-Git-Tag: opac-tt-poc-demo2~27^2~10 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=65f8cf4d290fc8ced8761ebb9999886d2c413ef7;p=evergreen%2Fequinox.git pulling in more copy fields for display; added sample code --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm index aeb7108560..ac15a595d1 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Record.pm @@ -44,9 +44,15 @@ sub mk_copy_query { my $query = { select => { - acp => ['id', 'barcode', 'circ_lib'], - acpl => [{column => 'name', alias => 'copy_location'}], - ccs => [{column => 'name', alias => 'copy_status'}], + acp => ['id', 'barcode', 'circ_lib', 'create_date', 'age_protect', 'holdable'], + acpl => [ + {column => 'name', alias => 'copy_location'}, + {column => 'holdable', alias => 'location_holdable'} + ], + ccs => [ + {column => 'name', alias => 'copy_status'}, + {column => 'holdable', alias => 'status_holdable'} + ], acn => [ {column => 'label', alias => 'call_number_label'}, {column => 'id', alias => 'call_number'} diff --git a/Open-ILS/web/templates/default/opac/parts/record/cn_details.tt2 b/Open-ILS/web/templates/default/opac/parts/record/cn_details.tt2 index 6d44776535..2a5167ec06 100644 --- a/Open-ILS/web/templates/default/opac/parts/record/cn_details.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/record/cn_details.tt2 @@ -11,14 +11,39 @@ [% l("Barcode") %] [% l("Status") %] [% l("Location") %] - [% l("Age Hold Protection") %] - [% l("Create Date") %] - [% l("Holdable") %] - [% l("Due Date") %] + [% IF ctx.is_staff %] + [% l("Age Hold Protection") %] + [% l("Create Date") %] + [% l("Holdable") %] + [% END %] + [% l("Due Date") %] + [% FOR copy_info IN ctx.copies %] + [% copy_info.barcode %] + [% copy_info.copy_status %] + [% copy_info.copy_location %] + [% IF ctx.is_staff %] + [% copy_info.age_protect %] + [% date.format(ctx.parse_datetime(copy_info.create_date), DATE_FORMAT) %] + + [% IF copy_info.holdable == 't' AND + copy_info.location_holdable == 't' AND + copy_info.status_holdable == 't'; + l('Yes'); + ELSE; + l('No'); + END; + %] + + [% END %] + [% date.format(ctx.parse_datetime(copy_info.create_date), DATE_FORMAT) %] + + [% END %] + + diff --git a/Open-ILS/web/templates/default/opac/record.tt2 b/Open-ILS/web/templates/default/opac/record.tt2 index 6e4368fba9..04e33cbb40 100644 --- a/Open-ILS/web/templates/default/opac/record.tt2 +++ b/Open-ILS/web/templates/default/opac/record.tt2 @@ -12,15 +12,4 @@
- [%# TODO: TEST CODE, DELETE ME... %] - [% FOR copy_info IN ctx.copies %] -
- [% - copy_info.id _ ' ' _ copy_info.barcode _ ' ' _ ctx.find_aou(copy_info.circ_lib).name _ - ' ' _ copy_info.copy_location _ ' ' _ copy_info.copy_status _ - ' ' _ copy_info.call_number_label _ ' ' _ copy_info.call_number _ ' '; - IF copy_info.due_date; date.format(ctx.parse_datetime(copy_info.due_date),'%m/%d/%Y'); END; - %] -
- [% END %] [% END %]