From 3a058fcc9de46d40f9c9f7737832cd4994ab1bcb Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Wed, 29 Jul 2009 17:09:17 -0400 Subject: [PATCH] Bug 1607: Fixes the delete checkboxes in purchase suggestions. If a user views suggestions of another user, syspref (OPACViewOthersSuggestions), a selection check box for deletion appeared next to all of the suggested titles whether the logged-in user owned them or not. - fixed Also fixes the "Clear all" and "Select all" links which appeared for anonymouse users, if AnonSuggestions is turned on. Signed-off-by: Galen Charlton --- .../opac-tmpl/prog/en/modules/opac-suggestions.tmpl | 6 ++++-- opac/opac-suggestions.pl | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl index aafe3b8ca9..addc4ec7bc 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl @@ -101,8 +101,8 @@ $.tablesorter.addParser({
-
Select All - Clear All | New purchase suggestionNew purchase suggestion +
Select All + Clear All | New purchase suggestionNew purchase suggestion
@@ -116,7 +116,9 @@ $.tablesorter.addParser({
+ " /> +

diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index b739817c95..838cd05a7a 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -98,6 +98,15 @@ my $suggestions_loop = &SearchSuggestion( $borrowernumber, $author, $title, $publishercode, $status, $suggestedbyme ); map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop; + +foreach my $suggestion(@$suggestions_loop) { + if($suggestion->{'suggestedby'} == $borrowernumber) { + $suggestion->{'showcheckbox'} = $borrowernumber; + } else { + $suggestion->{'showcheckbox'} = 0; + } +} + $template->param( suggestions_loop => $suggestions_loop, title => $title, -- 2.20.1