Thanks Bob, this looks to me like it could be the solution to that bug. I think our age protection goes off of the active_date, not the create_date so it would need to check that YAOUS to decide which one to use. And the message to customers might be too specific for all cases, we use age protection on a regional level, so it wouldn’t make sense for us. But I would be happy with not displaying anything to the public, just leaving that out.
Thanks for sharing this. I’ll add a link to your message to that ticket so if anyone has time to work on a generic solution they have somewhere to start. Josh Stompro - LARL IT Director From: Open-ils-general [mailto:[email protected]] On Behalf Of Bob Wicksall Sent: Tuesday, December 15, 2015 10:05 AM To: Evergreen Discussion Group Subject: Re: [OPEN-ILS-GENERAL] Removing Age Protection after expired 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<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l138> [%- IF copy_info.age_protect AND copy_info.create_date; 139<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l139> create_date = date.format(ctx.parse_datetime(copy_info.create_date), "%Y%m%d"); 140<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l140> today = date.format(date.now, "%Y%m%d"); 141<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l141> 142<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l142> age_protect_age = ctx.get_crahp(copy_info.age_protect).age; 143<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l143> 144<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l144> manip = date.manip; 145<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l145> expire_date = manip.DateCalc(create_date, age_protect_age.replace('mons', 'months')); 146<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l146> expire_date_format = manip.UnixDate(expire_date, DATE_FORMAT); 147<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l147> expire_date = manip.UnixDate(expire_date, "%Y%m%d"); 148<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l148> 149<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l149> expire_msg = ''; 150<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l150> age_protect_is_active = 0; 151<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l151> 152<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l152> IF today > expire_date; 153<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l153> date_color = 'green'; 154<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l154> age_protect = l('Expired'); 155<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l155> ELSE; 156<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l156> date_color = 'orange'; 157<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l157> age_protect = l('Active'); 158<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l158> expire_msg = expire_date_format; 159<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l159> age_protect_is_active = 1; 160<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l160> END ; 161<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l161> ELSE; 162<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l162> date_color = 'black'; 163<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l163> age_protect = l('None'); 164<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l164> expire_msg = '-'; 165<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l165> age_protect_is_active = 0; 166<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l166> END; 167<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l167> %] Then for staff: 168<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l168> [%- IF ctx.is_staff %] 169<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l169> <td style='color:[% date_color | html %];'> 170<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l170> [% age_protect | html %] <br /> 171<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l171> [% expire_msg | html %] 172<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l172> </td> 173<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l173> <td>[% 174<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l174> IF copy_info.create_date; 175<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l175> date.format( 176<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l176> ctx.parse_datetime(copy_info.create_date), 177<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l177> DATE_FORMAT 178<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l178> ); 179<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l179> ELSE; 180<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l180> '-'; 181<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l181> END; 182<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l182> %]</td> 183<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l183> [% END # is_staff %] For patrons: 247<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l247> [%- IF age_protect_is_active AND !ctx.is_staff %] 248<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l248> <tr> 249<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l249> <td></td> 250<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l250> <td colspan='3' style='color:orange'>This copy is new and can only be picked up at this library.</td> 251<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l251> </tr> 252<http://git.pls-net.org/gitweb/?p=templates_owwl.git;a=blob;f=opac/parts/record/copy_table.tt2;h=e2fb580c57ff0eca832bd02ba865a4b42c6ebdb8;hb=rel_2_7#l252> [%- 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]<mailto:[email protected]>> To: "Evergreen Discussion Group" <[email protected]<mailto:[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
