PINES Custom: 3rd attempt to fix the age protection star
authorTerran McCanna <tmccanna@georgialibraries.org>
Sun, 17 Jan 2021 20:20:27 +0000 (15:20 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Sat, 19 Nov 2022 19:58:15 +0000 (14:58 -0500)
Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2

index 0175f04..8af0e6d 100755 (executable)
@@ -320,7 +320,12 @@ END; # FOREACH bib
                     '-';
                 END %]</td>
         <!-- PINES customization: Show alert if item is new -->
-        <td>[% IF copy_info.age_protect && (date.format(copy_info.active_date) > date.format(date.now - 15552000)); '<a title="" data-toggle="tooltip" data-original-title="' _ l("This is a new item and may only be checked out locally.") _ '"><i class="fas fa-star" style="color:orange;" aria-hidden="true"></i></a>'; END; %] 
+        <td>[%
+            vActive = date.format(copy_info.active_date,'%Y%m%d');
+            v6MonthsAgo = date.format(date.now - 15552000,'%Y%m%d');
+            IF copy_info.age_protect && (vActive > v6MonthsAgo); 
+                '<a title="" data-toggle="tooltip" data-original-title="' _ l("This is a new item and may only be checked out locally.") _ '"><i class="fas fa-star" style="color:orange;" aria-hidden="true"></i></a>';
+            END; %]
         </td>
         </tr>