removing cat-top.inc references
[koha.git] / readingrec.pl
index 7315dc3..8a3e254 100755 (executable)
@@ -23,7 +23,9 @@
 # Suite 330, Boston, MA  02111-1307 USA
 
 use strict;
+use C4::Auth;
 use C4::Output;
+use C4::Interface::CGI::Output;
 use CGI;
 use C4::Search;
 use HTML::Template;
@@ -46,11 +48,14 @@ if ($limit eq 'full'){
 }
 my ($count,$issues)=allissues($bornum,$order2,$limit);
 
-
-#print $input->header;
-#print startpage();
-#print startmenu('member');
-my $template = gettemplate("members/readingrec.tmpl");
+my ($template, $loggedinuser, $cookie)
+= get_template_and_user({template_name => "members/readingrec.tmpl",
+                               query => $input,
+                               type => "intranet",
+                               authnotrequired => 0,
+                               flagsrequired => {borrowers => 1},
+                               debug => 1,
+                               });
 
 my @loop_reading;
 
@@ -62,13 +67,17 @@ for (my $i=0;$i<$count;$i++){
        $line{volumeddesc}=$issues->[$i]->{'volumeddesc'};
        push(@loop_reading,\%line);
 }
+
 $template->param(title => $data->{'title'},
                                                initials => $data->{'initials'},
                                                surname => $data->{'surname'},
                                                bornum => $bornum,
                                                limit => $limit,
+                                               firstname => $data->{'firstname'},
+                                               cardnumber => $data->{'cardnumber'},
+                                               showfulllink => ($count > 50),                                  
                                                loop_reading => \@loop_reading);
-print "Content-Type: text/html\n\n", $template->output;
+output_html_with_http_headers $input, $cookie, $template->output;