Bug 24083: (follow-up) Include SelfCheckInModule

As highlighted by Katrin, the selfcheckin module was not aware of this
work. This commits gives it awareness of the too_unseen renew error and
the "seen" argument that can be passed to AddRenewal

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Andrew Isherwood 2020-10-05 12:37:01 +01:00 committed by Jonathan Druart
parent bbfdc72303
commit e429d90fb3
2 changed files with 7 additions and 2 deletions

View File

@ -133,6 +133,7 @@
<input type="hidden" name="patronid" value="[% patronid | html %]" />
<input type="hidden" name="barcode" value="[% barcode | html %]" />
<input type="hidden" name="confirmed" value="1" />
<input type="hidden" name="seen" value="1" />
<input type="hidden" name="newissues" value="[% newissues | html %]" />
<button type="submit" name="confirm" class="btn btn-primary"><i class="fa fa-refresh" aria-hidden="true"></i> Renew item</button>
</form>
@ -142,6 +143,7 @@
<input type="hidden" name="patronid" value="[% patronid | html %]" />
<input type="hidden" name="barcode" value="[% barcode | html %]" />
<input type="hidden" name="confirmed" value="1" />
<input type="hidden" name="seen" value="1" />
<input type="hidden" name="newissues" value="[% newissues | html %]" />
<button type="submit" class="btn btn-primary"><i class="fa fa-refresh" aria-hidden="true"></i> Renew item</button>
</form>
@ -341,6 +343,8 @@
<span>This item has been scheduled for automatic renewal and cannot be renewed</span>
[% ELSIF ISSUE.renew_error == 'onsite_checkout' %]
<span>This is a on-site checkout, it cannot be renewed.</span>
[% ELSIF ISSUE.renew_error == 'too_unseen' %]
<span>You have renewed this item the maximum number of consecutive times without it being seen by the library.</span>
[% ELSE %]
<span>No renewals allowed</span>
[% END %]

View File

@ -99,13 +99,14 @@ if (defined C4::Context->preference('SCOAllowCheckin')) {
}
my $issuerid = $loggedinuser;
my ($op, $patronid, $patronlogin, $patronpw, $barcode, $confirmed, $newissues) = (
my ($op, $patronid, $patronlogin, $patronpw, $barcode, $confirmed, $seen, $newissues) = (
$query->param("op") || '',
$query->param("patronid") || '',
$query->param("patronlogin")|| '',
$query->param("patronpw") || '',
$query->param("barcode") || '',
$query->param("confirmed") || '',
$query->param("seen") || 0,
$query->param("newissues") || '',
);
@ -268,7 +269,7 @@ if ( $patron && ( $op eq 'renew' ) ) {
my ($status,$renewerror) = CanBookBeRenewed( $borrower->{borrowernumber}, $item->itemnumber );
if ($status) {
#warn "renewing";
AddRenewal( $borrower->{borrowernumber}, $item->itemnumber );
AddRenewal( $borrower->{borrowernumber}, $item->itemnumber, undef, undef, undef, undef, $seen );
push @newissueslist, $barcode;
$template->param( renewed => 1 );
}