Commit ffc4adcf authored by Alex Sassmannshausen's avatar Alex Sassmannshausen Committed by Koha instance kohadev-koha

Bug 6906: Follow coding guidelines in terminology.

* Koha/Patron.pm (wantsCheckPrevCheckout, doCheckPrevCheckout): Rename
  to...
  (wants_check_for_previous_checkout, do_check_for_previous_checkout):
  ...this.
* C4/Circulation.pm: Use new names.
* t/db_dependent/Patron/CheckPrevCheckout.t: Renamed to...
* t/db_dependent/Patron/Borrower_PrevCheckout.t: ...this.

Bug 6906: Fix POD reference to old method name.

* Koha/Patron.pm (wants_check_for_previous_checkout): Fix POD.
Signed-off-by: joubu's avatarJonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: default avatarKyle M Hall <kyle@bywatersolutions.com>
parent da812332
......@@ -946,9 +946,9 @@ sub CanBookBeIssued {
# CHECKPREVCHECKOUT: CHECK IF ITEM HAS EVER BEEN LENT TO PATRON
#
my $patron = Koha::Patrons->find($borrower->{borrowernumber});
my $wantsCheckPrevCheckout = $patron->wantsCheckPrevCheckout;
my $wants_check = $patron->wants_check_for_previous_checkout;
$needsconfirmation{PREVISSUE} = 1
if ($wantsCheckPrevCheckout and $patron->doCheckPrevCheckout($item));
if ($wants_check and $patron->do_check_for_previous_checkout($item));
#
# ITEM CHECKING
......
......@@ -100,15 +100,15 @@ sub siblings {
);
}
=head3 wantsCheckPrevCheckout
=head3 wants_check_for_previous_checkout
$wantsCheckPrevCheckout = $patron->wantsCheckPrevCheckout;
$wants_check = $patron->wants_check_for_previous_checkout;
Return 1 if Koha needs to perform PrevIssue checking, else 0.
=cut
sub wantsCheckPrevCheckout {
sub wants_check_for_previous_checkout {
my ( $self ) = @_;
my $syspref = C4::Context->preference("checkPrevCheckout");
......@@ -134,16 +134,16 @@ sub wantsCheckPrevCheckout {
}
}
=head3 doCheckPrevCheckout
=head3 do_check_for_previous_checkout
$checkPrevCheckout = $patron->doCheckPrevCheckout($item);
$do_check = $patron->do_check_for_previous_checkout($item);
Return 1 if the bib associated with $ITEM has previously been checked out to
$PATRON, 0 otherwise.
=cut
sub doCheckPrevCheckout {
sub do_check_for_previous_checkout {
my ( $self, $item ) = @_;
# Find all items for bib and extract item numbers.
......
......@@ -54,7 +54,7 @@ C4::Context->set_userenv(@USERENV);
BAIL_OUT("No userenv") unless C4::Context->userenv;
# wantsCheckPrevCheckout
# wants_check_for_previous_checkout
# We expect the following result matrix:
#
......@@ -203,7 +203,7 @@ map {
});
my $patron = Koha::Patrons->find($kpatron->{borrowernumber});
is(
$patron->wantsCheckPrevCheckout, $_->{result},
$patron->wants_check_for_previous_checkout, $_->{result},
"Predicate with syspref " . $syspref . ", cat " . $code
. ", patron " . $_->{setting}
);
......@@ -211,7 +211,7 @@ map {
} @{$_->{categories}};
} @{$mappings};
# doCheckPrevCheckout
# do_check_for_previous_checkout
# We want to test:
# - DESCRIPTION [RETURNVALUE (0/1)]
......@@ -254,7 +254,7 @@ sub test_it {
map {
my $patron = Koha::Patrons->find($_->{patron}->{borrowernumber});
is(
$patron->doCheckPrevCheckout($_->{item}),
$patron->do_check_for_previous_checkout($_->{item}),
$_->{result}, $stage . ": " . $_->{msg}
);
} @{$mapping};
......@@ -358,20 +358,20 @@ test_it($cpvPmappings, "PostReturn");
# Finally test C4::Circulation::CanBookBeIssued
# We have already tested ->wantsCheckPrevCheckout and ->doCheckPrevCheckout,
# so all that remains to be tested is whetherthe different combinational
# outcomes of the above return values in CanBookBeIssued result in the
# approriate $needsconfirmation.
# We have already tested ->wants_check_for_previous_checkout and
# ->do_check_for_previous_checkout, so all that remains to be tested is
# whetherthe different combinational outcomes of the above return values in
# CanBookBeIssued result in the approriate $needsconfirmation.
# We want to test:
# - DESCRIPTION [RETURNVALUE (0/1)]
# - patron, !wantsCheckPrevCheckout, !doCheckPrevCheckout
# - patron, !wants_check_for_previous_checkout, !do_check_for_previous_checkout
# [!$issuingimpossible,!$needsconfirmation->{PREVISSUE}]
# - patron, wantsCheckPrevCheckout, !doCheckPrevCheckout
# - patron, wants_check_for_previous_checkout, !do_check_for_previous_checkout
# [!$issuingimpossible,!$needsconfirmation->{PREVISSUE}]
# - patron, !wantsCheckPrevCheckout, doCheckPrevCheckout
# - patron, !wants_check_for_previous_checkout, do_check_for_previous_checkout
# [!$issuingimpossible,!$needsconfirmation->{PREVISSUE}]
# - patron, wantsCheckPrevCheckout, doCheckPrevCheckout
# - patron, wants_check_for_previous_checkout, do_check_for_previous_checkout
# [!$issuingimpossible,$needsconfirmation->{PREVISSUE}]
# Needs:
......@@ -410,26 +410,26 @@ my $CBBI_mappings = [
syspref => 'hardno',
item => $new_item,
result => undef,
msg => "patron, !wantsCheckPrevCheckout, !doCheckPrevCheckout"
msg => "patron, !wants_check_for_previous_checkout, !do_check_for_previous_checkout"
},
{
syspref => 'hardyes',
item => $new_item,
result => undef,
msg => "patron, wantsCheckPrevCheckout, !doCheckPrevCheckout"
msg => "patron, wants_check_for_previous_checkout, !do_check_for_previous_checkout"
},
{
syspref => 'hardno',
item => $prev_item,
result => undef,
msg => "patron, !wantsCheckPrevCheckout, doCheckPrevCheckout"
msg => "patron, !wants_check_for_previous_checkout, do_check_for_previous_checkout"
},
{
syspref => 'hardyes',
item => $prev_item,
result => 1,
msg => "patron, wantsCheckPrevCheckout, doCheckPrevCheckout"
msg => "patron, wants_check_for_previous_checkout, do_check_for_previous_checkout"
},
];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment