Bug 12495 - Include streetnumber in hold alert address
[koha_fer] / members / readingrec.pl
index ba94149..2cb9437 100755 (executable)
@@ -63,7 +63,15 @@ if ($input->param('borrowernumber')) {
 
 my $order = 'date_due desc';
 my $limit = 0;
-my $issues = GetAllIssues($borrowernumber,$order,$limit);
+my $issues = ();
+# Do not request the old issues of anonymous patron
+if ( $borrowernumber eq C4::Context->preference('AnonymousPatron') ){
+    # use of 'eq' in the above comparison is intentional -- the
+    # system preference value could be blank
+    $template->param( is_anonymous => 1 );
+} else {
+    $issues = GetAllIssues($borrowernumber,$order,$limit);
+}
 
 my $branches = GetBranches();
 foreach my $issue ( @{$issues} ) {
@@ -103,7 +111,7 @@ if (! $limit){
 }
 
 
-my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
+my ($picture, $dberror) = GetPatronImage($data->{'borrowernumber'});
 $template->param( picture => 1 ) if $picture;
 
 if (C4::Context->preference('ExtendedPatronAttributes')) {
@@ -140,6 +148,7 @@ $template->param(
     loop_reading      => $issues,
     activeBorrowerRelationship =>
       ( C4::Context->preference('borrowerRelationship') ne '' ),
+    RoutingSerials => C4::Context->preference('RoutingSerials'),
 );
 output_html_with_http_headers $input, $cookie, $template->output;