[Koha-bugs] [Bug 15581] Add a circ rule to limit the auto renewals given a delay

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Apr 28 14:31:09 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15581

--- Comment #18 from Kyle M Hall <kyle at bywatersolutions.com> ---
Comment on attachment 50743
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50743
Bug 15581: Display the latest auto renew date possible when renewing manually

Review of attachment 50743:
 --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=15581&attachment=50743)
-----------------------------------------------------------------

::: C4/Circulation.pm
@@ +3191,5 @@
> +
> +=cut
> +
> +sub GetLatestAutoRenewDate {
> +    my ( $borrowernumber, $itemnumber ) = @_;

You already have the issue, item and patron data where this code is called, why
not pass them in?

@@ +3195,5 @@
> +    my ( $borrowernumber, $itemnumber ) = @_;
> +
> +    my $dbh = C4::Context->dbh;
> +
> +    my $item      = GetItem($itemnumber)      or return;

Re-fetching item we already have.

@@ +3196,5 @@
> +
> +    my $dbh = C4::Context->dbh;
> +
> +    my $item      = GetItem($itemnumber)      or return;
> +    my $itemissue = GetItemIssue($itemnumber) or return;

Re-fetching issue we already have.

@@ +3199,5 @@
> +    my $item      = GetItem($itemnumber)      or return;
> +    my $itemissue = GetItemIssue($itemnumber) or return;
> +
> +    $borrowernumber ||= $itemissue->{borrowernumber};
> +    my $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber )

Re-fetching patron data we already have.

::: circ/renew.pl
@@ +83,5 @@
>                      );
>                  }
> +                if ( $error && ( $error eq 'auto_too_late' ) ) {
> +                    $latest_auto_renew_date = C4::Circulation::GetLatestAutoRenewDate(
> +                        $borrower->borrowernumber(),

We should pass in the issue, item, and patron objects here.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list