Bugzilla – Attachment 53147 Details for
Bug 6906
Show 'Borrower has previously issued $ITEM' alert on checkout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6906: Follow coding guidelines in terminology.
Bug-6906-Follow-coding-guidelines-in-terminology.patch (text/plain), 6.93 KB, created by
Jonathan Druart
on 2016-07-06 16:16:18 UTC
(
hide
)
Description:
Bug 6906: Follow coding guidelines in terminology.
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-07-06 16:16:18 UTC
Size:
6.93 KB
patch
obsolete
>From 0e511dda1a671230f45678e6754a1fb9fbe440d8 Mon Sep 17 00:00:00 2001 >From: Alex Sassmannshausen <alex.sassmannshausen@ptfs-europe.com> >Date: Mon, 4 Jul 2016 19:22:51 +0200 >Subject: [PATCH] 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: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/Circulation.pm | 4 +-- > Koha/Patron.pm | 12 ++++---- > ...CheckPrevCheckout.t => Borrower_PrevCheckout.t} | 32 +++++++++++----------- > 3 files changed, 24 insertions(+), 24 deletions(-) > rename t/db_dependent/Patron/{CheckPrevCheckout.t => Borrower_PrevCheckout.t} (91%) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 68f5d23..4298e01 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -944,9 +944,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 >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index aa38363..5ba5efc 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -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. >diff --git a/t/db_dependent/Patron/CheckPrevCheckout.t b/t/db_dependent/Patron/Borrower_PrevCheckout.t >similarity index 91% >rename from t/db_dependent/Patron/CheckPrevCheckout.t >rename to t/db_dependent/Patron/Borrower_PrevCheckout.t >index 67964ec..453ccf1 100644 >--- a/t/db_dependent/Patron/CheckPrevCheckout.t >+++ b/t/db_dependent/Patron/Borrower_PrevCheckout.t >@@ -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" > }, > ]; > >-- >2.8.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6906
:
5531
|
5532
|
5533
|
27558
|
27606
|
30680
|
30681
|
50071
|
50127
|
50128
|
50243
|
50286
|
50323
|
51378
|
51393
|
52278
|
52279
|
52280
|
53104
|
53105
|
53136
|
53144
|
53145
|
53146
| 53147 |
53148