Instead of turning off age protect we modified the way the TPac displays the 
message. We do some date math and adjust the message accordingly. Staff and 
patrons get different messages since "Age Protect" is meaningless to a patron. 

Our TPac is fairly heavily modified. Here is a code 
snip(opac/parts/record/copy_table.tt2): 

138 [%- IF copy_info.age_protect AND copy_info.create_date; 
139 create_date = date.format(ctx.parse_datetime(copy_info.create_date), 
"%Y%m%d"); 
140 today = date.format(date.now, "%Y%m%d"); 
141 
142 age_protect_age = ctx.get_crahp(copy_info.age_protect).age; 
143 
144 manip = date.manip; 
145 expire_date = manip.DateCalc(create_date, age_protect_age.replace('mons', 
'months')); 
146 expire_date_format = manip.UnixDate(expire_date, DATE_FORMAT); 
147 expire_date = manip.UnixDate(expire_date, "%Y%m%d"); 
148 
149 expire_msg = ''; 
150 age_protect_is_active = 0; 
151 
152 IF today > expire_date; 
153 date_color = 'green'; 
154 age_protect = l('Expired'); 
155 ELSE; 
156 date_color = 'orange'; 
157 age_protect = l('Active'); 
158 expire_msg = expire_date_format; 
159 age_protect_is_active = 1; 
160 END ; 
161 ELSE; 
162 date_color = 'black'; 
163 age_protect = l('None'); 
164 expire_msg = '-'; 
165 age_protect_is_active = 0; 
166 END; 
167 %] 

Then for staff: 

168 [%- IF ctx.is_staff %] 
169 <td style='color:[% date_color | html %];'> 
170 [% age_protect | html %] <br /> 
171 [% expire_msg | html %] 
172 </td> 
173 <td>[% 
174 IF copy_info.create_date; 
175 date.format( 
176 ctx.parse_datetime(copy_info.create_date), 
177 DATE_FORMAT 
178 ); 
179 ELSE; 
180 '-'; 
181 END; 
182 %]</td> 
183 [% END # is_staff %] 

For patrons: 

247 [%- IF age_protect_is_active AND !ctx.is_staff %] 
248 <tr> 
249 <td></td> 
250 <td colspan='3' style='color:orange'>This copy is new and can only be 
picked up at this library.</td> 
251 </tr> 
252 [%- END %] 

Bob Wicksall 
Computer and Network Services Manager 

Pioneer Library System 
2557 State Rt. 21 
Canandaigua, New York 14424 

Voice: (585) 394-8260 ext. 110 
Fax: (585) 394-1935 

> From: "Josh Stompro" <[email protected]>
> To: "Evergreen Discussion Group" <[email protected]>
> Sent: Tuesday, December 15, 2015 10:24:16 AM
> Subject: [OPEN-ILS-GENERAL] Removing Age Protection after expired

> Hello, does anyone else out there remove the age protection from copies after 
> it
> has expired. I’ve been asked to set that up, and it seems like a shame since 
> it
> was designed to just work automatically, except that items with expired age
> protection still show up as age protected in the catalog. There is a bug open
> about it at https://bugs.launchpad.net/evergreen/+bug/1251761

> Does anyone currently go through and remove the age protection to get around
> that issue? If so do you do it directly at the DB level or do you use the
> client? Are there any gotchas about directly updating asset.copy to change the
> age protection and also changing the shelving location at the same time.

> If anyone wants to combine resources to get that bug fixed, either with brain
> power or development funding let me know also.

> Josh

> Lake Agassiz Regional Library - Moorhead MN larl.org

> Josh Stompro | Office 218.233.3757 EXT-139

> LARL IT Director | Cell 218.790.2110

Reply via email to