Return calculated value for SIP recall_ok test user/berick/sip-recall-ok-flag
authorBill Erickson <berick@esilibrary.com>
Wed, 26 Dec 2012 15:29:30 +0000 (10:29 -0500)
committerBill Erickson <berick@esilibrary.com>
Wed, 13 Mar 2013 17:21:03 +0000 (13:21 -0400)
Determine the value for the "recall OK" testing for patron information
requests the same we we determine the value for ciruclations and holds.
Previously, the recall-OK test always returned false, presumably since
recalls are not currently supported in Evergreen SIP.

Note that like holds and circs, we determine whether a user has good
standing based on the users penalties and whether the user is active /
non-barred.  Though we could in some cases, we are not checking whether
the user has the required permission to perform specific tasks.

This feature is enabled via a new oils_sip.xml configuration option:

<option name='patron_calculate_recal_ok' value='true' />

This option is disabled by default.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/examples/oils_sip.xml.example
Open-ILS/src/perlmods/lib/OpenILS/SIP/Patron.pm

index 5d4ebd3..b988816 100644 (file)
                                                If enabled, the PC field in patron-info requests will return the non-translated profile name
                                        <option name='patron_type_uses_code' value='true' />
                                        -->
+
+                                       <!--
+                                               If enabled, return the calculated value for the recall
+                                               flag instead of always returning not-OK
+                                       <option name='patron_calculate_recal_ok' value='true' />
+                                       -->
+
                                </options>
 
                 <checkin_override>
index 4a77bd0..5ce70e9 100644 (file)
@@ -325,6 +325,8 @@ sub renew_ok {
 
 sub recall_ok {
     my $self = shift;
+    return $self->charge_ok if 
+        OpenILS::SIP->get_option_value('patron_calculate_recal_ok');
     return 0;
 }