changed the color to red and size to +2 for the Issuing Question....
[koha_fer] / html-template / moredetail.pl
1 #!/usr/bin/perl
2
3 # Copyright 2000-2002 Katipo Communications
4 #
5 # This file is part of Koha.
6 #
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
10 # version.
11 #
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License along with
17 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18 # Suite 330, Boston, MA  02111-1307 USA
19
20 use HTML::Template;
21 use strict;
22 require Exporter;
23 use C4::Koha;
24 use CGI;
25 use C4::Search;
26 use C4::Acquisitions;
27 use C4::Output; # contains picktemplate
28   
29 my $query=new CGI;
30
31
32 my $language='french';
33
34
35 my %configfile;
36 open (KC, "/etc/koha.conf");
37 while (<KC>) {
38  chomp;
39  (next) if (/^\s*#/);
40  if (/(.*)\s*=\s*(.*)/) {
41    my $variable=$1;
42    my $value=$2;
43    # Clean up white space at beginning and end
44    $variable=~s/^\s*//g;
45    $variable=~s/\s*$//g;
46    $value=~s/^\s*//g;
47    $value=~s/\s*$//g;
48    $configfile{$variable}=$value;
49  }
50 }
51
52 my $includes=$configfile{'includes'};
53 ($includes) || ($includes="/usr/local/www/hdl/htdocs/includes");
54 my $templatebase="catalogue/moredetail.tmpl";
55 my $startfrom=$query->param('startfrom');
56 ($startfrom) || ($startfrom=0);
57 my $theme=picktemplate($includes, $templatebase);
58
59 my $subject=$query->param('subject');
60 # if its a subject we need to use the subject.tmpl
61 if ($subject){
62   $templatebase=~ s/searchresults\.tmpl/subject\.tmpl/;
63 }
64 my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
65
66 # get variables 
67
68 my $biblionumber=$query->param('bib');
69 my $title=$query->param('title');
70 my $bi=$query->param('bi');
71
72 my $data=bibitemdata($bi);
73 my $dewey = $data->{'dewey'};
74 $dewey =~ s/0+$//;
75 if ($dewey eq "000.") { $dewey = "";};
76 if ($dewey < 10){$dewey='00'.$dewey;}
77 if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}
78 if ($dewey <= 0){
79       $dewey='';
80 }
81 $dewey=~ s/\.$//;
82 $data->{'dewey'}=$dewey;
83
84 my @results;
85
86 my (@items)=itemissues($bi);
87 my $count=@items;
88 $data->{'count'}=$count;
89 my ($order,$ordernum)=getorder($bi,$biblionumber);
90
91 my $env;
92 $env->{itemcount}=1;
93
94 $results[0]=$data;
95
96 $template->param(includesdir => $includes);
97 $template->param(BIBITEM_DATA => \@results);
98 $template->param(ITEM_DATA => \@items);
99 print "Content-Type: text/html\n\n", $template->output;
100