Moved intranet templated scripts to new template directory structure.

This commit is contained in:
tonnesen 2002-10-21 20:10:18 +00:00
parent d7839f04cf
commit 2ad9c87d86
5 changed files with 127 additions and 116 deletions

View File

@ -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 (<KC>) {
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);

View File

@ -0,0 +1,112 @@
<TMPL_INCLUDE NAME="cat-top.inc">
<TMPL_IF NAME="loggedinuser">
<p align=left>Logged in as: <TMPL_VAR NAME="loggedinuser"> [<a href=/cgi-bin/koha/logout.pl>Log Out</a>]</p>
<TMPL_ELSE>
<p align=left><a href=/cgi-bin/koha/userpage.pl>Log In</a> to Koha</p>
</TMPL_IF>
<center>
<br>
<TMPL_LOOP NAME="BIBITEM_DATA">
<a href=/cgi-bin/koha/request.pl?bib=<TMPL_VAR NAME="biblionumber">
<img src=/images/requests.gif
width=120 height=42 border=0 align=right border=0></a>
<FONT SIZE=6><em><a
href=/cgi-bin/koha/detail.pl?bib=<TMPL_VAR NAME="biblionumber">&type=intra><TMPL_VAR NAME="title">
(<TMPL_VAR NAME="author">)</a></em></FONT><P>
<p>
<form action=/cgi-bin/koha/modbibitem.pl>
<input type=hidden name=bibitem value=<TMPL_VAR NAME="biblioitemnumber">>
<input type=hidden name=biblio value=<TMPL_VAR NAME="biblionumber">>
<!-------------------BIBLIO ITEM------------>
<TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left>
<TR VALIGN=TOP>
<td bgcolor="99cc33" background="/images/background-mem.gif"
><B><TMPL_VAR NAME="biblioitemnumber"> GROUP - <TMPL_VAR NAME="description"> </b> </TD>
</TR>
<tr VALIGN=TOP >
<TD width=210 >
<INPUT TYPE="image" name="submit" VALUE="modify" height=42 WIDTH=93
BORDER=0 src="/images/modify-mem.gif">
<INPUT TYPE="image" name="delete" VALUE="delete" height=42 WIDTH=93
BORDER=0 src="/images/delete-mem.gif">
<br>
<FONT SIZE=2 face="arial, helvetica">
<b>Biblionumber:</b> <TMPL_VAR NAME="biblionumber"><br>
<b>Item Type:</b> <TMPL_VAR NAME="itemtype"><br>
<b>URL:</b> <TMPL_VAR NAME="url"><br>
<b>Loan Length:</b> <TMPL_VAR NAME="loanlength"><br>
<b>Rental Charge:</b> <TMPL_VAR NAME="rentalcharge"><br>
<b>Classification:</b> <TMPL_VAR NAME="classification"><TMPL_VAR NAME="dewey"><TMPL_VAR NAME="subclass"><br>
<b>ISBN:</b> <TMPL_VAR NAME="isbn"><br>
<b>Publisher:</b> <TMPL_VAR NAME="publishercode"> <br>
<b>Place:</b> <TMPL_VAR NAME="place"><br>
<b>Date:</b> <TMPL_VAR NAME="publicationyear"><br>
<b>Volume:</b> <TMPL_VAR NAME="volumeddesc"><br>
<b>Pages:</b> <TMPL_VAR NAME="pages"><br>
<b>Illus:</b> <TMPL_VAR NAME="illus"><br>
<b>Size:</b> <TMPL_VAR NAME="size"><br>
<b>Notes:</b> <TMPL_VAR NAME="bnotes"><br>
<b>No. of Items:</b> <TMPL_VAR NAME="count">
</font>
</TD>
</tr>
</table>
</form>
</TMPL_LOOP>
<TMPL_LOOP NAME="ITEM_DATA">
<img src="/images/holder.gif" width=16 height=300 align=left>
<TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left width=220 >
<TR VALIGN=TOP>
<td bgcolor="99cc33" background="/images/background-mem.gif"><B>BARCODE
<TMPL_VAR NAME="barcode"></b></TD>
</TR>
<tr VALIGN=TOP>
<TD width=220>
<form action=/cgi-bin/koha/moditem.pl method=post>
<input type=hidden name=bibitem value=<TMPL_VAR NAME="biblioitemnumber">>
<input type=hidden name=item value=<TMPL_VAR NAME="itemnumber">>
<input type=hidden name=type value=<TMPL_VAR NAME="type">>
<INPUT TYPE="image" name="submit" VALUE="modify" height=42 WIDTH=93
BORDER=0 src="/images/modify-mem.gif">
<INPUT TYPE="image" name="delete" VALUE="delete" height=42 WIDTH=93
BORDER=0 src="/images/delete-mem.gif">
<br>
<FONT SIZE=2 face="arial, helvetica">
<b>Home Branch:</b> <TMPL_VAR NAME="homebranch"><br>
<b>Last seen:</b> <TMPL_VAR NAME="datelastseen"><br>
<b>Last borrowed:</b> <TMPL_VAR NAME="timestamp0"><br>
<!-- on issue bit -->
<b>Last Borrower 1:</b> <TMPL_VAR NAME="card0"><br>
<b>Last Borrower 2:</b> <TMPL_VAR NAME="card1"><br>
<b>Current Branch:</b> <TMPL_VAR NAME="holdingbranch"><br>
<b>Replacement Price:</b> <TMPL_VAR NAME="replacementprice"><br>
<b>Item lost:</b> <TMPL_VAR NAME="itemlost"><br>
<b>Paid for:</b> <TMPL_VAR NAME="paidfor"><br>
<b>Notes:</b> <TMPL_VAR NAME="itemnotes"><br>
<b>Renewals:</b> <TMPL_VAR NAME="renewals"><br>
<b><a href="/cgi-bin/koha/acqui/acquire.pl?recieve=<TMPL_VAR NAME="ordernumber">&biblio=<TMPL_VAR NAME="biblionumber">&invoice=<TMPL_VAR NAME="booksellerinvoicenumber">&catview=yes">
Accession</a>
Date:<TMPL_VAR NAME="dateaccessioned"><br>
<b>Cancelled: <TMPL_VAR NAME="wthdrawn"><br>
<b><a
href=/cgi-bin/koha/bookcount.pl?&bib=<TMPL_VAR NAME="biblionumber">&bi=<TMPL_VAR NAME="biblioitemnumber">&itm=<TMPL_VAR NAME="itemnumber">>Total
Issues:</a></b> <TMPL_VAR NAME="issues"><br>
<b>Group Number:</b> <TMPL_VAR NAME="biblioitemnumber"> <br>
<b>Biblio number:</b> <TMPL_VAR NAME="biblionumber"> <br>
</font>
</TD>
</tr>
</table>
</form>
</TMPL_LOOP>
<p>
</form>
</center>
<TMPL_INCLUDE NAME="cat-bottom.inc">

View File

@ -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 (<KC>) {
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;

View File

@ -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 (<KC>) {
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);

View File

@ -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 (<KC>) {
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;