From 466e224721d4301448539c4ece13d3531382a5f8 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 Signed-off-by: Henri-Damien LAURENT --- .../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 5c11812e5c..3e8c6d896d 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 + @@ -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.39.5