Bug 16960: Update 1 missing occurrence of GetModifications
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 5 Aug 2016 10:43:52 +0000 (11:43 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Mon, 22 Aug 2016 11:46:05 +0000 (11:46 +0000)
Signed-off-by: Bob Birchall <bob@calyx.net.au>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Koha/Patron/Modification.pm
circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
t/db_dependent/Koha_borrower_modifications.t

index 8afbd5e..5407172 100644 (file)
@@ -27,7 +27,7 @@ use base qw(Koha::Object);
 
 =head1 NAME
 
-Koha::Patron::Modification - Class represents a requrest to modify or create a patron
+Koha::Patron::Modification - Class represents a request to modify or create a patron
 
 =head2 Class Methods
 
index 940e902..867466e 100755 (executable)
@@ -659,13 +659,14 @@ $template->param(
 my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber});
 $template->param( picture => 1 ) if $patron_image;
 
+my $has_modifications = Koha::Patron::Modifications->search( { borrowernumber => $borrowernumber } )->count;
 $template->param(
     debt_confirmed            => $debt_confirmed,
     SpecifyDueDate            => $duedatespec_allow,
     CircAutocompl             => C4::Context->preference("CircAutocompl"),
     debarments                => GetDebarments({ borrowernumber => $borrowernumber }),
     todaysdate                => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ),
-    modifications             => Koha::Patron::Modifications->GetModifications({ borrowernumber => $borrowernumber }),
+    has_modifications         => $has_modifications,
     override_high_holds       => $override_high_holds,
     nopermission              => scalar $query->param('nopermission'),
 );
index 4d3965c..545d0e8 100644 (file)
@@ -706,7 +706,7 @@ No patron matched <span class="ex">[% message | html %]</span>
 
                <ul>
 
-                   [% IF ( modifications ) %]
+                   [% IF ( has_modifications ) %]
                     <li><span class="circ-hlt">Pending modifications:</span> Patron has pending modifications.
                             [% IF CAN_user_borrowers && ( !Koha.Preference('IndependentBranchesPatronModifications') || borrower.branch == branch ) %]
                                     <a href="/cgi-bin/koha/members/members-update.pl">View all pending patron modifications</a>
index e09ae4b..fb24495 100755 (executable)
@@ -87,6 +87,6 @@ my $new_borrower = GetMember( borrowernumber => $borr1 );
 
 ## Check to see that the approved modifications were saved
 ok( $new_borrower->{'surname'} eq 'Hall',
-    'Test approve() applys modification to borrower' );
+    'Test approve() applies modification to borrower' );
 
 $dbh->rollback();