switched from picktemplate() to gettemplate()
authortonnesen <tonnesen>
Wed, 9 Oct 2002 18:09:16 +0000 (18:09 +0000)
committertonnesen <tonnesen>
Wed, 9 Oct 2002 18:09:16 +0000 (18:09 +0000)
acqui.simple/marcimport.pl
detail.pl
marc/MARCdetail.pl
moredetail.pl
opac/opac-detail.pl
opac/opac-searchresults.pl
userpage.pl

index 9b67709..0988123 100755 (executable)
@@ -178,9 +178,7 @@ sub ProcessRecord {
     if ($record) {
        $oldkoha=MARCmarc2koha($dbh,$record);
     }
-    my $templatebase="marcimport/marcimportdetail.tmpl";
-    my $theme=picktemplate($includes, $templatebase);
-    my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
+    my $template=gettemplate('marcimport/marcimportdetail.tmpl";
     $oldkoha->{additionalauthors} =~ s/ \| /\n/g;
     $oldkoha =~ s/\|/\n/g;
     $template->param($oldkoha);
@@ -247,9 +245,7 @@ sub ListFileRecords {
     
     requireDBI($dbh,"ListFileRecords");
 
-    my $templatebase="marcimport/ListFileRecords.tmpl";
-    my $theme=picktemplate($includes, $templatebase);
-    my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
+    my $template=gettemplate('marcimport/ListFileRecords.tmpl";
 
     # File can be z3950 search query or uploaded MARC data
     
@@ -578,9 +574,7 @@ sub uploadmarc {
 
     requireDBI($dbh,"uploadmarc");
 
-    my $templatebase="marcimport/uploadmarc.tmpl";
-    my $theme=picktemplate($includes, $templatebase);
-    my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
+    my $template=gettemplate('marcimport/uploadmarc.tmpl";
     $template->param(SCRIPT_NAME => $ENV{'SCRIPT_NAME'});
 #    print "<a href=$ENV{'SCRIPT_NAME'}>Main Menu</a><hr>\n";
     my $sth=$dbh->prepare("select id,name from uploadedmarc");
@@ -604,9 +598,7 @@ sub manual {
 
 
 sub mainmenu {
-       my $templatebase="marcimport/mainmenu.tmpl";
-       my $theme=picktemplate($includes, $templatebase);
-       my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
+       my $template=gettemplate('marcimport/mainmenu.tmpl";
        $template->param(SCRIPT_NAME => $ENV{'SCRIPT_NAME'});
        print "Content-Type: text/html\n\n", $template->output;
 } # sub mainmenu
@@ -745,9 +737,7 @@ sub AcceptBiblioitem {
        print STDERR "Error in marcimport.pl/Acceptbiblioitem : numrecord not defined\n";
        print "Error in marcimport.pl/Acceptbiblioitem : numrecord not defined : contact administrator\n";
     }
-    my $templatebase="marcimport/AcceptBiblioitem.tmpl";
-    my $theme=picktemplate($includes, $templatebase);
-    my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
+    my $template=gettemplate('marcimport/AcceptBiblioitem.tmpl";
 
     my $oldkoha = MARCmarc2koha($dbh,$record);
     # See if it already exists
@@ -851,9 +841,7 @@ sub AcceptItemCopy {
     use strict;
     my ( $dbh, $input )=@_;
 
-    my $templatebase="marcimport/AcceptItemCopy.tmpl";
-    my $theme=picktemplate($includes, $templatebase);
-    my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
+    my $template=gettemplate('marcimport/AcceptItemCopy.tmpl";
 
     my $error;
 
@@ -993,6 +981,9 @@ sub FormatMarcText {
 
 #---------------
 # $Log$
+# Revision 1.15  2002/10/09 18:09:16  tonnesen
+# switched from picktemplate() to gettemplate()
+#
 # Revision 1.14  2002/10/05 09:56:14  arensb
 # Merged with arensb-context branch: use C4::Context->dbh instead of
 # &C4Connect, and generally prefer C4::Context over C4::Database.
index b94272d..e729bb2 100755 (executable)
--- a/detail.pl
+++ b/detail.pl
@@ -21,7 +21,7 @@ use HTML::Template;
 use strict;
 require Exporter;
 use C4::Context;
-use C4::Output;  # contains picktemplate
+use C4::Output;  # contains gettemplate
 use CGI;
 use C4::Search;
 use C4::Auth;
index ada2a2e..0451a8b 100755 (executable)
@@ -21,7 +21,7 @@ use strict;
 use HTML::Template;
 require Exporter;      # FIXME - Is this really necessary?
 use C4::Context;
-use C4::Output;  # contains picktemplate
+use C4::Output;  # contains gettemplate
 use CGI;
 use C4::Search;
 use MARC::Record;
@@ -35,11 +35,7 @@ my $tag=$query->param('tag');
 if (! defined $tag) { $tag='2XX';}
 #print STDERR "BIB : $biblionumber // TAG : $tag\n";
 if (! defined $biblionumber) {
-    my $includes = C4::Context->config('includes') ||
-       "/usr/local/www/hdl/htdocs/includes";
-    my $templatebase="MARCdetailbiblioselect.tmpl";
-    my $theme=picktemplate($includes, $templatebase);
-    my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
+    my $template = gettemplate("MARCdetailbiblioselect.tmpl");
     print "Content-Type: text/html\n\n", $template->output;
 
 } else {
@@ -52,11 +48,7 @@ sub showmarcrecord {
     my $sth=$dbh->prepare("select liblibrarian from marc_subfield_structure where tagfield=? and tagsubfield=?");
     my $record =MARCgetbiblio($dbh,$biblionumber);
 # open template
-    my $templatebase="catalogue/MARCdetail.tmpl";
-    my $includes = C4::Context->config('includes') ||
-       "/usr/local/www/hdl/htdocs/includes";
-    my $theme=picktemplate($includes, $templatebase);
-    my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
+    my $template = gettemplate("MARCdetail.tmpl");
 # fill arrays
     my @loop_data =();
     my @fields = $record->field($tag);
index 07bc6d8..674f82f 100755 (executable)
@@ -24,7 +24,7 @@ use C4::Koha;
 use CGI;
 use C4::Search;
 use C4::Acquisitions;
-use C4::Output; # contains picktemplate
+use C4::Output; # contains gettemplate
   
 my $query=new CGI;
 
index 3e48936..2aaeb85 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 use strict;
 require Exporter;
-use C4::Output;  # contains picktemplate
+use C4::Output;  # contains gettemplate
 use CGI;
 use C4::Search;
 use C4::Auth;
index 8e86232..27f9aeb 100755 (executable)
@@ -4,7 +4,7 @@ require Exporter;
 use CGI;
 use C4::Search;
 use C4::Auth;
-use C4::Output; # now contains picktemplate
+use C4::Output; # now contains gettemplate
   
 my $query=new CGI;
 
index 00766b6..3e6b991 100755 (executable)
@@ -21,7 +21,7 @@ use HTML::Template;
 use strict;
 require Exporter;
 use C4::Context;
-use C4::Output;  # contains picktemplate
+use C4::Output;
 use CGI;
 use C4::Search;
 use C4::Auth;