(bug #3695) allow to limit overdues by categorycode
[koha.git] / opac / opac-suggestions.pl
index 1cb9e14..838cd05 100755 (executable)
@@ -16,6 +16,7 @@
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use warnings;
 
 use CGI;
 use C4::Auth;    # get_template_and_user
@@ -97,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,