diff --git a/detail.pl b/detail.pl index 7b8d006bcc..9afe8bc51b 100755 --- a/detail.pl +++ b/detail.pl @@ -3,7 +3,7 @@ use HTML::Template; use strict; require Exporter; use C4::Database; -use C4::Output; # contains picktemplate +use C4::Output; # contains gettemplate use CGI; use C4::Search; use C4::Auth; @@ -15,29 +15,8 @@ my $type=$query->param('type'); my ($loggedinuser, $cookie, $sessionID) = checkauth($query, ($type eq 'opac') ? (1) : (0)); -my $language='french'; - - -my %configfile; -open (KC, "/etc/koha.conf"); -while () { - chomp; - (next) if (/^\s*#/); - if (/(.*)\s*=\s*(.*)/) { - my $variable=$1; - my $value=$2; - # Clean up white space at beginning and end - $variable=~s/^\s*//g; - $variable=~s/\s*$//g; - $value=~s/^\s*//g; - $value=~s/\s*$//g; - $configfile{$variable}=$value; - } -} - my $biblionumber=$query->param('bib'); - # change back when ive fixed request.pl my @items = ItemInfo(undef, $biblionumber, $type); my $dat=bibdata($biblionumber); @@ -61,16 +40,10 @@ my $itemsarray=\@items; my $webarray=\@webbiblioitems; my $sitearray=\@websites; -my $includes=$configfile{'includes'}; -($includes) || ($includes="/usr/local/www/hdl/htdocs/includes"); -my $templatebase="catalogue/detail.tmpl"; -($type eq 'opac') && ($templatebase="catalogue/detail-opac.tmpl"); my $startfrom=$query->param('startfrom'); ($startfrom) || ($startfrom=0); -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('catalogue/detail.tmpl'); my $count=1; # now to get the items into a hash we can use and whack that thru @@ -85,7 +58,7 @@ $template->param(nextstartfrom => $nextstartfrom); $template->param(prevstartfrom => $prevstartfrom); # $template->param(template => $templatename); # $template->param(search => $search); -$template->param(includesdir => $includes); +#$template->param(includesdir => $includes); $template->param(BIBLIO_RESULTS => $resultsarray); $template->param(ITEM_RESULTS => $itemsarray); $template->param(WEB_RESULTS => $webarray); diff --git a/koha-tmpl/intranet-tmpl/default/en/catalogue/moredetail.tmpl b/koha-tmpl/intranet-tmpl/default/en/catalogue/moredetail.tmpl new file mode 100644 index 0000000000..c291e1313f --- /dev/null +++ b/koha-tmpl/intranet-tmpl/default/en/catalogue/moredetail.tmpl @@ -0,0 +1,112 @@ + + + +

Logged in as: [Log Out]

+ +

Log In to Koha

+
+ +
+
+ + + +&type=intra> +()

+

+

+> +> + + + + + + + + +
GROUP -
+ + +
+ +Biblionumber:
+Item Type:
+URL:
+Loan Length:
+Rental Charge:
+Classification:
+ISBN:
+Publisher:
+Place:
+Date:
+Volume:
+Pages:
+Illus:
+Size:
+Notes:
+No. of Items: +
+
+
+
+ + + + + + + + + +
BARCODE +
+
+> +> +> + + +
+ +Home Branch:
+Last seen:
+Last borrowed:
+ +Last Borrower 1:
+Last Borrower 2:
+Current Branch:
+Replacement Price:
+Item lost:
+Paid for:
+Notes:
+Renewals:
+&biblio=&invoice=&catview=yes"> +Accession +Date:
+Cancelled:
+&bi=&itm=>Total +Issues:
+Group Number:
+Biblio number:
+ + + +
+
+ +
+ +

+ +

+ + diff --git a/mainpage.pl b/mainpage.pl index 9411832af6..0243ec8948 100755 --- a/mainpage.pl +++ b/mainpage.pl @@ -3,36 +3,14 @@ use HTML::Template; use strict; require Exporter; use C4::Database; -use C4::Output; # contains picktemplate +use C4::Output; # contains gettemplate use CGI; use C4::Auth; my $query = new CGI; my ($loggedinuser, $cookie, $sessionID) = checkauth($query); -my %configfile; -open (KC, "/etc/koha.conf"); -while () { - chomp; - (next) if (/^\s*#/); - if (/(.*)\s*=\s*(.*)/) { - my $variable=$1; - my $value=$2; - # Clean up white space at beginning and end - $variable=~s/^\s*//g; - $variable=~s/\s*$//g; - $value=~s/^\s*//g; - $value=~s/\s*$//g; - $configfile{$variable}=$value; - } -} - -my $includes=$configfile{'includes'}; -($includes) || ($includes="/usr/local/www/hdl/htdocs/includes"); -my $templatebase="catalogue/intranet-main.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("intranet-main.tmpl"); #$template->param(SITE_RESULTS => $sitearray); print "Content-Type: text/html\n\n", $template->output; diff --git a/moredetail.pl b/moredetail.pl index 59e9042961..4aa8b64997 100755 --- a/moredetail.pl +++ b/moredetail.pl @@ -6,7 +6,7 @@ use C4::Koha; use CGI; use C4::Search; use C4::Acquisitions; -use C4::Output; # contains picktemplate +use C4::Output; # contains gettemplate use C4::Auth; my $query=new CGI; @@ -15,39 +15,11 @@ my $flagsrequired; $flagsrequired->{catalogue}=1; my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 0, $flagsrequired); -my $language='french'; - - -my %configfile; -open (KC, "/etc/koha.conf"); -while () { - chomp; - (next) if (/^\s*#/); - if (/(.*)\s*=\s*(.*)/) { - my $variable=$1; - my $value=$2; - # Clean up white space at beginning and end - $variable=~s/^\s*//g; - $variable=~s/\s*$//g; - $value=~s/^\s*//g; - $value=~s/\s*$//g; - $configfile{$variable}=$value; - } -} - -my $includes=$configfile{'includes'}; -($includes) || ($includes="/usr/local/www/hdl/htdocs/includes"); -my $templatebase="catalogue/moredetail.tmpl"; my $startfrom=$query->param('startfrom'); ($startfrom) || ($startfrom=0); -my $theme=picktemplate($includes, $templatebase); -my $subject=$query->param('subject'); -# if its a subject we need to use the subject.tmpl -if ($subject){ - $templatebase=~ s/searchresults\.tmpl/subject\.tmpl/; -} -my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]); + +my $template=gettemplate('catalogue/moredetail.tmpl'); # get variables @@ -99,7 +71,6 @@ foreach my $item (@items){ } -$template->param(includesdir => $includes); $template->param(BIBITEM_DATA => \@results); $template->param(ITEM_DATA => \@items); $template->param(loggedinuser => $loggedinuser); diff --git a/search.pl b/search.pl index 17fbf87631..0ff23f03d0 100755 --- a/search.pl +++ b/search.pl @@ -6,7 +6,7 @@ use C4::Database; use CGI; use C4::Search; use C4::Auth; -use C4::Output; # no contains picktemplate +use C4::Output; # no contains gettemplate my $query=new CGI; my $type=$query->param('type'); @@ -15,42 +15,19 @@ my $type=$query->param('type'); my ($loggedinuser, $cookie, $sessionID) = checkauth($query, ($type eq 'opac') ? (1) : (0)); -my $language='french'; - -my %configfile; -open (KC, "/etc/koha.conf"); -while () { - chomp; - (next) if (/^\s*#/); - if (/(.*)\s*=\s*(.*)/) { - my $variable=$1; - my $value=$2; - # Clean up white space at beginning and end - $variable=~s/^\s*//g; - $variable=~s/\s*$//g; - $value=~s/^\s*//g; - $value=~s/\s*$//g; - $configfile{$variable}=$value; - } -} -#print $query->header; - -my $includes=$configfile{'includes'}; -($includes) || ($includes="/usr/local/www/hdl/htdocs/includes"); -my $templatebase="catalogue/searchresults.tmpl"; my $startfrom=$query->param('startfrom'); ($startfrom) || ($startfrom=0); -my $theme=picktemplate($includes, $templatebase); my $subject=$query->param('subject'); -# if its a subject we need to use the subject.tmpl + +my $template; if ($subject) { - $templatebase=~ s/searchresults\.tmpl/subject\.tmpl/; - $theme=picktemplate($includes, $templatebase); + $template=gettemplate('catalogue/subject.tmpl'); +} else { + $template=gettemplate('catalogue/searchresults.tmpl'); } -my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]); my $env; $env->{itemcount}=1; @@ -183,7 +160,7 @@ $template->param(prevstartfrom => $prevstartfrom); $template->param(search => $search); $template->param(searchdesc => $searchdesc); $template->param(SEARCH_RESULTS => $resultsarray); -$template->param(includesdir => $includes); +#$template->param(includesdir => $includes); $template->param(loggedinuser => $loggedinuser); my $numbers;