LP1366026: Add Active Date to Record Detail Page
authorJason Boyer <jboyer1@library.in.gov>
Fri, 5 Sep 2014 14:16:26 +0000 (10:16 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 19 Feb 2015 15:07:35 +0000 (15:07 +0000)
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>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Conflicts:
Open-ILS/src/templates/opac/parts/record/copy_table.tt2

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
Open-ILS/src/templates/opac/parts/record/copy_table.tt2

index 8de64a5..c8ae3c2 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 033ac5b..74059d0 100644 (file)
@@ -42,7 +42,7 @@ END;
             <th scope='col'>[% l("Shelving Location") %]</th>
             [%- IF ctx.is_staff %]
             <th scope='col'>[% l("Age Hold Protection") %]</th>
-            <th scope='col'>[% l("Create Date") %]</th>
+            <th scope='col'>[% l("Active/Create Date") %]</th>
             [%- END %]
             [%- IF ctx.is_staff OR serial_holdings %]
             <th scope='col'>[% 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>[% date.format(
-                ctx.parse_datetime(copy_info.create_date),
+            <td>[% 
+            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 %]