Mike Rylander wrote:
On Thu, Apr 23, 2009 at 10:30 AM, Doug Kyle <[email protected]> wrote:
Change to verify an item requested for renewal is actually being circulated
by the renewal patron - if we have the patron info. This is against the
1_4_0 svn tree.


Thanks, Doug.  For completeness, would you please resubmit with the DCO?

http://open-ils.org/documentation/contributing.html#Submitting a Patch

Oops, sure.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
   have the right to submit it under the open source license
   indicated in the file; or

(b) The contribution is based upon previous work that, to the best
   of my knowledge, is covered under an appropriate open source
   license and I have the right under that license to submit that
   work with modifications, whether created in whole or in part
   by me, under the same open source license (unless I am
   permitted to submit under a different license), as indicated
   in the file; or

(c) The contribution was provided directly to me by some other
   person who certified (a), (b) or (c) and I have not modified
   it.

(d) I understand and agree that this project and the contribution
   are public and that a record of the contribution (including all
   personal information I submit with it, including my sign-off) is
   maintained indefinitely and may be redistributed consistent with
   this project or the open source license(s) involved.

Signed-off-by: Doug Kyle [email protected]


Index: Circulate.pm
===================================================================
--- Circulate.pm	(revision 12971)
+++ Circulate.pm	(working copy)
@@ -2307,17 +2307,25 @@
 
     # Make sure there is an open circ to renew that is not
     # marked as LOST, CLAIMSRETURNED, or LONGOVERDUE
-    my $circ = $self->editor->search_action_circulation(
-            { target_copy => $self->copy->id, stop_fines => undef } )->[0];
+    my $usrid = $self->patron->id;
+    my $circ;
+    if ($usrid) {
+        # If we have a patron, match them to the circ
+        $circ = $self->editor->search_action_circulation(
+                {target_copy => $self->copy->id, usr => $usrid,  stop_fines => undef})->[0];
+        } else {
+        $circ = $self->editor->search_action_circulation(
+                {target_copy => $self->copy->id, stop_fines => undef})->[0];
+        }
 
     if(!$circ) {
+        if ($usrid) {
         $circ = $self->editor->search_action_circulation(
-            { 
-                target_copy => $self->copy->id, 
-                stop_fines => OILS_STOP_FINES_MAX_FINES,
-                checkin_time => undef
-            } 
-        )->[0];
+            {target_copy => $self->copy->id, usr => $usrid, stop_fines => OILS_STOP_FINES_MAX_FINES, checkin_time => undef})->[0];
+        } else {
+        $circ = $self->editor->search_action_circulation(
+            {target_copy => $self->copy->id, stop_fines => OILS_STOP_FINES_MAX_FINES, checkin_time => undef})->[0];
+        }
     }
 
     return $self->bail_on_events($self->editor->event) unless $circ;

Reply via email to