[Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 5136, Replace SQL with call to GetAuthorisedValues
Galen Charlton
gmcharlt at gmail.com
Sat Oct 30 07:36:57 CEST 2010
From: Owen Leonard <oleonard at myacpl.org>
An embedded query in circulation.pl for BOR_NOTES authorized
values can be replaced with a call to GetAuthorisedValues
Signed-off-by: Galen Charlton <gmcharlt at gmail.com>
---
circ/circulation.pl | 11 ++---------
1 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/circ/circulation.pl b/circ/circulation.pl
index 4b67920..1d84aa4 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -700,15 +700,7 @@ my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'});
$template->param( picture => 1 ) if $picture;
# get authorised values with type of BOR_NOTES
-my @canned_notes;
-my $sth = $dbh->prepare('SELECT * FROM authorised_values WHERE category = "BOR_NOTES"');
-$sth->execute();
-while ( my $row = $sth->fetchrow_hashref() ) {
- push @canned_notes, $row;
-}
-if ( scalar( @canned_notes ) ) {
- $template->param( canned_bor_notes_loop => \@canned_notes );
-}
+my $canned_notes = GetAuthorisedValues("BOR_NOTES");;
$template->param(
debt_confirmed => $debt_confirmed,
@@ -717,5 +709,6 @@ $template->param(
AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"),
dateformat => C4::Context->preference("dateformat"),
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
+ canned_bor_notes_loop => $canned_notes,
);
output_html_with_http_headers $query, $cookie, $template->output;
--
1.7.0
More information about the Koha-patches
mailing list