# cleaning
[koha_ffzg] / admin / koha2marclinks.pl
index 45e0d77..070e44b 100755 (executable)
@@ -20,6 +20,8 @@
 
 use strict;
 use C4::Output;
+use C4::Charset;
+use C4::Auth;
 use CGI;
 use C4::Search;
 use C4::Context;
@@ -28,12 +30,19 @@ use HTML::Template;
 
 my $input = new CGI;
 my $tablename=$input->param('tablename');
-$tablename="biblio." unless ($tablename);
+$tablename="biblio" unless ($tablename);
 my $kohafield = $input->param('kohafield');
 my $op=$input->param('op');
 my $script_name = 'koha2marclinks.pl';
 
-my $template = gettemplate("parameters/koha2marclinks.tmpl",0);
+my ($template, $borrowernumber, $cookie)
+    = get_template_and_user({template_name => "parameters/koha2marclinks.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {parameters => 1},
+                            debug => 1,
+                            });
 
 if ($op) {
 $template->param(script_name => $script_name,
@@ -42,7 +51,7 @@ $template->param(script_name => $script_name,
 $template->param(script_name => $script_name,
                                                else              => 1); # we show only the TMPL_VAR names $op
 }
-       
+
 my $dbh = C4::Context->dbh;
 
 ################## ADD_FORM ##################################
@@ -59,7 +68,6 @@ if ($op eq 'add_form') {
                my @marcarray;
                push @marcarray," ";
                while (my ($field, $tagsubfield, $liblibrarian) = $sth2->fetchrow_array) {
-       #               warn "$field$tagsubfield - $liblibrarian";
                        push @marcarray, "$field $tagsubfield - $liblibrarian";
                }
                my $marclist = CGI::scrolling_list(-name=>"marc",
@@ -127,4 +135,7 @@ if ($op eq 'add_form') {
                                                        );
 } #---- END $OP eq DEFAULT
 
-print "Content-Type: text/html\n\n", $template->output;
+print $input->header(
+    -type => guesstype($template->output),
+    -cookie => $cookie
+), $template->output;