LP1366026: Add Active Date to Record Detail Page collab/jboyer/lp1366026_active_date
authorJason Boyer <jboyer1@library.in.gov>
Fri, 5 Sep 2014 14:16:26 +0000 (10:16 -0400)
committerJason Boyer <jboyer1@library.in.gov>
Fri, 5 Sep 2014 14:16:26 +0000 (10:16 -0400)
Display active date in place of create date when
item circ_lib uses active date for hold age
protection calculations.

Signed-off-by: Jason Boyer <jboyer1@library.in.gov>
Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
Open-ILS/src/templates/opac/parts/record/copy_table.tt2

index 1dc306e..801345a 100644 (file)
@@ -1963,7 +1963,7 @@ sub basic_opac_copy_query {
 
     return {
         select => {
-            acp => ['id', 'barcode', 'circ_lib', 'create_date',
+            acp => ['id', 'barcode', 'circ_lib', 'create_date', 'active_date',
                     'age_protect', 'holdable', 'copy_number'],
             acpl => [
                 {column => 'name', alias => 'copy_location'},
index 6ecaa10..5b0e272 100644 (file)
@@ -42,7 +42,7 @@ END;
             <th id='copy_header_shelfloc'>[% l("Shelving Location") %]</th>
             [%- IF ctx.is_staff %]
             <th id='copy_header_age_hold'>[% l("Age Hold Protection") %]</th>
-            <th id='copy_header_create_date'>[% l("Create Date") %]</th>
+            <th id='copy_header_create_date'>[% l("Active/Create Date") %]</th>
             [%- END %]
             [%- IF ctx.is_staff OR serial_holdings %]
             <th id='copy_header_holdable'>[% l("Holdable?") %]</th>
@@ -141,8 +141,15 @@ END; # FOREACH bib
                 [% copy_info.age_protect ?
                     ctx.get_crahp(copy_info.age_protect).name : l('None') | html %]
             </td>
-            <td headers='copy_header_create_date'>[% date.format(
-                ctx.parse_datetime(copy_info.create_date),
+            <td headers='copy_header_create_date'>[% 
+            IF ctx.get_org_setting(copy_info.circ_lib, 'circ.holds.age_protect.active_date') == 1;
+              disp_date = copy_info.active_date ? copy_info.active_date : copy_info.create_date;
+            ELSE;
+              disp_date = copy_info.create_date;
+            END;
+           
+           date.format(
+                ctx.parse_datetime(disp_date),
                 DATE_FORMAT
             ) %]</td>
             [% END # is_staff %]