Removing +1y expiry time from cookies so that cookies expire when the browser
[koha.git] / MARCdetail.pl
index baf3415..eac610c 100755 (executable)
@@ -26,10 +26,17 @@ MARCdetail.pl : script to show a biblio in MARC format
 
 =head1 DESCRIPTION
 
-This script needs a biblionumber in bib parameter (bibnumber from koha style DB. Automaticaly maps to marc biblionumber).
-It shows the biblio in a (nice) MARC format depending on MARC parameters tables.
-The template is in <templates_dir>/catalogue/MARCdetail.tmpl. this template must be divided in 11 "tabs".
-The 10 firsts presents the biblio, the 11th one presents the items attached to the biblio
+This script needs a biblionumber in bib parameter (bibnumber
+from koha style DB.  Automaticaly maps to marc biblionumber).
+
+It shows the biblio in a (nice) MARC format depending on MARC
+parameters tables.
+
+The template is in <templates_dir>/catalogue/MARCdetail.tmpl.
+this template must be divided into 11 "tabs".
+
+The first 10 tabs present the biblio, the 11th one presents
+the items attached to the biblio
 
 =head1 FUNCTIONS
 
@@ -40,8 +47,10 @@ The 10 firsts presents the biblio, the 11th one presents the items attached to t
 
 use strict;
 require Exporter;
+use C4::Auth;
 use C4::Context;
 use C4::Output;
+use C4::Interface::CGI::Output;
 use CGI;
 use C4::Search;
 use MARC::Record;
@@ -59,8 +68,17 @@ my $bibid = &MARCfind_MARCbibid_from_oldbiblionumber($dbh,$biblionumber);
 my $tagslib = &MARCgettagslib($dbh,1);
 
 my $record =MARCgetbiblio($dbh,$bibid);
+#warn $record->as_formatted();
 # open template
-my $template = gettemplate("catalogue/MARCdetail.tmpl",0);
+my ($template, $loggedinuser, $cookie)
+               = get_template_and_user({template_name => "catalogue/MARCdetail.tmpl",
+                            query => $query,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {catalogue => 1},
+                            debug => 1,
+                            });
+
 # fill arrays
 my @loop_data =();
 my $tag;
@@ -143,5 +161,5 @@ $template->param(item_loop => \@item_value_loop,
                                                item_header_loop => \@header_value_loop,
                                                biblionumber => $biblionumber,
                                                bibid => $bibid);
-print "Content-Type: text/html\n\n", $template->output;
+output_html_with_http_headers $query, $cookie, $template->output;