From 0f52289a5b1a3fb04dfa15aa649dc9f65acd3f73 Mon Sep 17 00:00:00 2001 From: tonnesen Date: Mon, 28 Oct 2002 17:45:14 +0000 Subject: [PATCH] Merging from trunk to rel-1-2 --- C4/BookShelves.pm | 159 +++++++++++++++++++++++++++++++++++----------- admin-home.pl | 23 ++----- bookcount.pl | 42 ++++++++---- catalogue-home.pl | 35 ++++------ charges.pl | 21 +++++- currency.pl | 35 ++++++++-- delbiblio.pl | 18 ++++++ deletemem.pl | 41 +++++++++--- delitem.pl | 18 ++++++ detail.pl | 26 ++++++-- groups.pl | 22 ++++++- moredetail.pl | 22 ++++++- reports-home.pl | 24 ++----- shelves.pl | 21 ++++++ 14 files changed, 369 insertions(+), 138 deletions(-) diff --git a/C4/BookShelves.pm b/C4/BookShelves.pm index 3f7871fe0b..c31a728307 100755 --- a/C4/BookShelves.pm +++ b/C4/BookShelves.pm @@ -5,6 +5,7 @@ package C4::BookShelves; #asummes C4/BookShelves # #requires DBI.pm to be installed +# $Id$ # Copyright 2000-2002 Katipo Communications # @@ -28,56 +29,50 @@ require Exporter; use DBI; use C4::Database; use C4::Circulation::Circ2; -use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); - +use vars qw($VERSION @ISA @EXPORT); + # set the version for version checking $VERSION = 0.01; - + +=head1 NAME + +C4::BookShelves - Functions for manipulating Koha virtual bookshelves + +=head1 SYNOPSIS + + use C4::BookShelves; + +=head1 DESCRIPTION + +This module provides functions for manipulating virtual bookshelves, +including creating and deleting bookshelves, and adding and removing +items to and from bookshelves. + +=head1 FUNCTIONS + +=over 2 + +=cut + @ISA = qw(Exporter); @EXPORT = qw(&GetShelfList &GetShelfContents &AddToShelf &RemoveFromShelf &AddShelf &RemoveShelf); -%EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ], - -# your exported package globals go here, -# as well as any optionally exported functions - -@EXPORT_OK = qw($Var1 %Hashit); - - -# non-exported package globals go here -use vars qw(@more $stuff); - -# initalize package globals, first exported ones - -my $Var1 = ''; -my %Hashit = (); - -# then the others (which are still accessible as $Some::Module::stuff) -my $stuff = ''; -my @more = (); - -# all file-scoped lexicals must be created before -# the functions below that use them. - -# file-private lexicals go here -my $priv_var = ''; -my %secret_hash = (); - -# here's a file-private function as a closure, -# callable as &$priv_func; it cannot be prototyped. -my $priv_func = sub { - # stuff goes here. -}; - -# make all your functions, whether exported or not; my $dbh=C4Connect(); sub GetShelfList { + # FIXME - These two database queries can be combined into one: + # SELECT bookshelf.shelfnumber, bookshelf.shelfname, + # count(shelfcontents.itemnumber) + # FROM bookshelf + # LEFT JOIN shelfcontents + # ON bookshelf.shelfnumber = shelfcontents.shelfnumber + # GROUP BY bookshelf.shelfnumber my $sth=$dbh->prepare("select shelfnumber,shelfname from bookshelf"); $sth->execute; my %shelflist; while (my ($shelfnumber, $shelfname) = $sth->fetchrow) { my $sti=$dbh->prepare("select count(*) from shelfcontents where shelfnumber=$shelfnumber"); + # FIXME - Should there be an "order by" in here somewhere? $sti->execute; my ($count) = $sti->fetchrow; $shelflist{$shelfnumber}->{'shelfname'}=$shelfname; @@ -86,7 +81,20 @@ sub GetShelfList { return(\%shelflist); } +=item GetShelfContents + $itemlist = &GetShelfContents($env, $shelfnumber); + +Looks up information about the contents of virtual bookshelf number +C<$shelfnumber>. + +Returns a reference-to-array, whose elements are references-to-hash, +as returned by C<&getiteminformation>. + +I don't know what C<$env> is. + +=cut +#' sub GetShelfContents { my ($env, $shelfnumber) = @_; my @itemlist; @@ -97,8 +105,21 @@ sub GetShelfContents { push (@itemlist, $item); } return (\@itemlist); + # FIXME - Wouldn't it be more intuitive to return a list, + # rather than a reference-to-list? } +=item AddToShelf + + &AddToShelf($env, $itemnumber, $shelfnumber); + +Adds item number C<$itemnumber> to virtual bookshelf number +C<$shelfnumber>, unless that item is already on that shelf. + +C<$env> is ignored. + +=cut +#' sub AddToShelf { my ($env, $itemnumber, $shelfnumber) = @_; my $sth=$dbh->prepare("select * from shelfcontents where shelfnumber=$shelfnumber and itemnumber=$itemnumber"); @@ -107,16 +128,46 @@ sub AddToShelf { # already on shelf } else { $sth=$dbh->prepare("insert into shelfcontents (shelfnumber, itemnumber, flags) values ($shelfnumber, $itemnumber, 0)"); + # FIXME - The default for 'flags' is NULL. + # Why set it to 0? $sth->execute; } } +=item RemoveFromShelf + + &RemoveFromShelf($env, $itemnumber, $shelfnumber); + +Removes item number C<$itemnumber> from virtual bookshelf number +C<$shelfnumber>. If the item wasn't on that bookshelf to begin with, +nothing happens. + +C<$env> is ignored. + +=cut +#' sub RemoveFromShelf { my ($env, $itemnumber, $shelfnumber) = @_; my $sth=$dbh->prepare("delete from shelfcontents where shelfnumber=$shelfnumber and itemnumber=$itemnumber"); $sth->execute; } +=item AddShelf + + ($status, $msg) = &AddShelf($env, $shelfname); + +Creates a new virtual bookshelf with name C<$shelfname>. + +Returns a two-element array, where C<$status> is 0 if the operation +was successful, or non-zero otherwise. C<$msg> is "Done" in case of +success, or an error message giving the reason for failure. + +C<$env> is ignored. + +=cut +#' +# FIXME - Perhaps this could/should return the number of the new bookshelf +# as well? sub AddShelf { my ($env, $shelfname) = @_; my $q_shelfname=$dbh->quote($shelfname); @@ -131,6 +182,21 @@ sub AddShelf { } } +=item RemoveShelf + + ($status, $msg) = &RemoveShelf($env, $shelfnumber); + +Deletes virtual bookshelf number C<$shelfnumber>. The bookshelf must +be empty. + +Returns a two-element array, where C<$status> is 0 if the operation +was successful, or non-zero otherwise. C<$msg> is "Done" in case of +success, or an error message giving the reason for failure. + +C<$env> is ignored. + +=cut +#' sub RemoveShelf { my ($env, $shelfnumber) = @_; my $sth=$dbh->prepare("select count(*) from shelfcontents where shelfnumber=$shelfnumber"); @@ -145,12 +211,15 @@ sub RemoveShelf { } } - END { } # module clean-up code here (global destructor) +1; # # $Log$ +# Revision 1.2.2.3 2002/10/28 17:45:15 tonnesen +# Merging from trunk to rel-1-2 +# # Revision 1.2.2.2 2002/08/14 18:30:50 tonnesen # Adding copyright statements to all .pl and .pm files in rel-1-2 branch # @@ -158,3 +227,17 @@ END { } # module clean-up code here (global destructor) # Inserting some changes I made locally a while ago. # # + +__END__ + +=back + +=head1 AUTHOR + +Koha Developement team + +=head1 SEE ALSO + +C4::Circulation::Circ2(3) + +=cut diff --git a/admin-home.pl b/admin-home.pl index 0f6b09e21e..54dfeb1a1d 100755 --- a/admin-home.pl +++ b/admin-home.pl @@ -5,27 +5,12 @@ use CGI; use C4::Auth; use C4::Output; use C4::Database; - -my $configfile=configfile(); -my $intranetdir=$configfile->{'intranetdir'}; +use HTML::Template; my $query = new CGI; my ($loggedinuser, $cookie, $sessionID) = checkauth($query); -print $query->header(-cookie => $cookie); - -print startpage(); -print startmenu('catalogue'); - - -print "

Logged in as: $loggedinuser [Log Out]

\n"; - -open H, "$intranetdir/htdocs/admin/index.html"; -while () { - print $_; -} -close H; - +my $template = gettemplate("parameters/admin-home.tmpl"); +$template->param(loggeninuser => $loggedinuser); -print endpage(); -print endmenu('catalogue'); +print $query->header(-cookie => $cookie),$template->output; diff --git a/bookcount.pl b/bookcount.pl index 1057492d8f..cc563a0885 100755 --- a/bookcount.pl +++ b/bookcount.pl @@ -1,10 +1,31 @@ #!/usr/bin/perl +# $Id$ + #written 7/3/2002 by Finlay #script to display reports + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + use strict; use CGI; +use C4::Context; use C4::Search; use C4::Circulation::Circ2; use C4::Output; @@ -39,7 +60,7 @@ if (not $lastmove) { } -# make the page ... +# make the page ... print $input->header; @@ -93,55 +114,51 @@ print endpage; # This stuff should probably go into C4::Search # database includes use DBI; -use C4::Database; sub itemdatanum { my ($itemnumber)=@_; - my $dbh=C4Connect; + my $dbh = C4::Context->dbh; my $itm = $dbh->quote("$itemnumber"); my $query = "select * from items where itemnumber=$itm"; my $sth=$dbh->prepare($query); $sth->execute; my $data=$sth->fetchrow_hashref; $sth->finish; - $dbh->disconnect; return($data); } sub lastmove { my ($itemnumber)=@_; - my $dbh=C4Connect; + my $dbh = C4::Context->dbh; my $var1 = $dbh->quote($itemnumber); my $sth =$dbh->prepare("select max(branchtransfers.datearrived) from branchtransfers where branchtransfers.itemnumber=$var1"); $sth->execute; my ($date) = $sth->fetchrow_array; return(0, "Item has no branch transfers record") if not $date; - my $var2 = $dbh->quote($date); + my $var2 = $dbh->quote($date); $sth=$dbh->prepare("Select * from branchtransfers where branchtransfers.itemnumber=$var1 and branchtransfers.datearrived=$var2"); $sth->execute; my ($data) = $sth->fetchrow_hashref; return(0, "Item has no branch transfers record") if not $data; $sth->finish; - $dbh->disconnect; return($data,""); } sub issuessince { my ($itemnumber, $date)=@_; - my $dbh=C4Connect; + my $dbh = C4::Context->dbh; my $itm = $dbh->quote($itemnumber); my $dat = $dbh->quote($date); my $sth=$dbh->prepare("Select count(*) from issues where issues.itemnumber=$itm and issues.timestamp > $dat"); $sth->execute; my $count=$sth->fetchrow_hashref; $sth->finish; - $dbh->disconnect; return($count->{'count(*)'}); } sub issuesat { my ($itemnumber, $brcd)=@_; - my $dbh=C4Connect; + my $dbh = C4::Context->dbh; my $itm = $dbh->quote($itemnumber); my $brc = $dbh->quote($brcd); my $query = "Select count(*) from issues where itemnumber=$itm and branchcode = $brc"; @@ -149,13 +166,12 @@ sub issuesat { $sth->execute; my ($count)=$sth->fetchrow_array; $sth->finish; - $dbh->disconnect; return($count); } sub lastseenat { my ($itemnumber, $brcd)=@_; - my $dbh=C4Connect; + my $dbh = C4::Context->dbh; my $itm = $dbh->quote($itemnumber); my $brc = $dbh->quote($brcd); my $query = "Select max(timestamp) from issues where itemnumber=$itm and branchcode = $brc"; @@ -164,11 +180,11 @@ sub lastseenat { my ($date1)=$sth->fetchrow_array; $sth->finish; $query = "Select max(datearrived) from branchtransfers where itemnumber=$itm and tobranch = $brc"; + # FIXME - There's already a $sth in this scope. my $sth=$dbh->prepare($query); $sth->execute; my ($date2)=$sth->fetchrow_array; $sth->finish; - $dbh->disconnect; $date2 =~ s/-//g; $date2 =~ s/://g; $date2 =~ s/ //g; diff --git a/catalogue-home.pl b/catalogue-home.pl index 72c0ebb3b5..0365d19f3c 100755 --- a/catalogue-home.pl +++ b/catalogue-home.pl @@ -5,32 +5,19 @@ use CGI; use C4::Auth; use C4::Output; use C4::Database; - -my $configfile=configfile(); -my $intranetdir=$configfile->{'intranetdir'}; +use HTML::Template; my $query = new CGI; my ($loggedinuser, $cookie, $sessionID) = checkauth($query); - -print $query->header(-cookie => $cookie); - -print startpage(); -print startmenu('catalogue'); - -print "

Logged in as: $loggedinuser [Log Out]

\n"; +my $template = gettemplate("catalogue/catalogue-home.tmpl"); my $classlist=''; -open C, "$intranetdir/htdocs/includes/cat-class-list.inc"; -while () { - $classlist.=$_; -} -open H, "$intranetdir/htdocs/catalogue/index.html"; -while () { - s//$classlist/; - print $_; -} -close H; - - -print endpage(); -print endmenu('catalogue'); +#open C, "$intranetdir/htdocs/includes/cat-class-list.inc"; +#while () { +# $classlist.=$_; +#} +$template->param(loggedinuser => $loggedinuser, + classlist => $classlist, + opac => 0); + +print $query->header(-cookie => $cookie), $template->output; diff --git a/charges.pl b/charges.pl index 8cc909abab..4fedcc8ea3 100755 --- a/charges.pl +++ b/charges.pl @@ -3,8 +3,27 @@ #script to display reports #written 8/11/99 + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + use strict; use CGI; +use C4::Context; use C4::Output; use C4::Database; use C4::Auth; @@ -23,7 +42,7 @@ print startmenu('issue'); print "Each box needs to be filled in with fine,time to start charging,charging cycle
eg 1,7,7 = $1 fine, after 7 days, every 7 days"; -my $dbh=C4Connect; +my $dbh = C4::Context->dbh; my $query="Select description,categorycode from categories"; my $sth=$dbh->prepare($query); $sth->execute; diff --git a/currency.pl b/currency.pl index 685593f6c7..363d00968a 100755 --- a/currency.pl +++ b/currency.pl @@ -1,9 +1,32 @@ #!/usr/bin/perl +# $Id$ + #written by chris@katipo.co.nz #9/10/2000 #script to display and update currency rates + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +# FIXME - There's an "admin/currency.pl", and this script never seems +# to be used. Is it obsolete? + use CGI; use C4::Acquisitions; use C4::Biblio; @@ -22,7 +45,7 @@ if ($type ne 'change'){ EXCHANGE RATES - + printend ; @@ -34,12 +57,12 @@ printend # print $rates->[$i]->{'currency'}; } print < +

- - - - + + + + printend ; } else { diff --git a/delbiblio.pl b/delbiblio.pl index d428c9f648..19c19e0932 100755 --- a/delbiblio.pl +++ b/delbiblio.pl @@ -4,6 +4,24 @@ #written 2/5/00 #by chris@katipo.co.nz + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + use strict; use C4::Search; diff --git a/deletemem.pl b/deletemem.pl index 6290069b59..8744ee3094 100755 --- a/deletemem.pl +++ b/deletemem.pl @@ -1,15 +1,35 @@ #!/usr/bin/perl -#script to delete borrowers +# $Id$ + +#script to delete items #written 2/5/00 #by chris@katipo.co.nz + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + use strict; -use C4::Search; use CGI; +use C4::Context; +use C4::Search; use C4::Output; -use C4::Database; use C4::Circulation::Circ2; #use C4::Acquisitions; use C4::Auth; @@ -35,16 +55,15 @@ $env{'nottodayissues'}=1; $i++; } my ($bor,$flags)=getpatroninformation(\%env, $member,''); -my $dbh=C4Connect; +my $dbh = C4::Context->dbh; my $query="Select * from borrowers where guarantor='$member'"; my $sth=$dbh->prepare($query); $sth->execute; my $data=$sth->fetchrow_hashref; $sth->finish; -$dbh->disconnect; - -if ($i > 0 || $flags->{'CHARGES'} ne '' || $data ne ''){ + +if ($i > 0 || $flags->{'CHARGES'} ne '' || $data ne ''){ print $input->header; print ""; if ($i > 0){ @@ -65,7 +84,7 @@ if ($i > 0 || $flags->{'CHARGES'} ne '' || $data ne ''){ sub delmember{ my ($member)=@_; - my $dbh=C4Connect; + my $dbh = C4::Context->dbh; my $query="Select * from borrowers where borrowernumber='$member'"; my $sth=$dbh->prepare($query); $sth->execute; @@ -73,20 +92,22 @@ sub delmember{ $sth->finish; $query="Insert into deletedborrowers values ("; foreach my $temp (@data){ - $query=$query."'$temp',"; + $query .= "'$temp',"; } $query=~ s/\,$/\)/; # print $query; + # FIXME - Use $dbh->do() $sth=$dbh->prepare($query); $sth->execute; $sth->finish; + # FIXME - Use $dbh->do() $query = "Delete from borrowers where borrowernumber='$member'"; $sth=$dbh->prepare($query); $sth->execute; $sth->finish; + # FIXME - Use $dbh->do() $query="Delete from reserves where borrowernumber='$member'"; $sth=$dbh->prepare($query); $sth->execute; $sth->finish; - $dbh->disconnect; } diff --git a/delitem.pl b/delitem.pl index e933d3c901..c0a3242d37 100755 --- a/delitem.pl +++ b/delitem.pl @@ -4,6 +4,24 @@ #written 2/5/00 #by chris@katipo.co.nz + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + use strict; use C4::Search; diff --git a/detail.pl b/detail.pl index 9afe8bc51b..af9a24cd3a 100755 --- a/detail.pl +++ b/detail.pl @@ -1,20 +1,37 @@ #!/usr/bin/perl + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + use HTML::Template; use strict; require Exporter; -use C4::Database; +use C4::Context; use C4::Output; # contains gettemplate use CGI; use C4::Search; use C4::Auth; - + my $query=new CGI; my $type=$query->param('type'); (-e "opac") && ($type='opac'); ($type) || ($type='intra'); my ($loggedinuser, $cookie, $sessionID) = checkauth($query, ($type eq 'opac') ? (1) : (0)); - my $biblionumber=$query->param('bib'); # change back when ive fixed request.pl @@ -56,9 +73,6 @@ my $nextstartfrom=($startfrom+20<$count-20) ? ($startfrom+20) : ($count-20); my $prevstartfrom=($startfrom-20>0) ? ($startfrom-20) : (0); $template->param(nextstartfrom => $nextstartfrom); $template->param(prevstartfrom => $prevstartfrom); -# $template->param(template => $templatename); -# $template->param(search => $search); -#$template->param(includesdir => $includes); $template->param(BIBLIO_RESULTS => $resultsarray); $template->param(ITEM_RESULTS => $itemsarray); $template->param(WEB_RESULTS => $webarray); diff --git a/groups.pl b/groups.pl index aac7316da9..be38e4148a 100755 --- a/groups.pl +++ b/groups.pl @@ -1,8 +1,28 @@ #!/usr/bin/perl +# $Id$ + #written 14/1/2000 #script to display reports + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + use CGI qw/:standard/; use C4::Output; use C4::Groups; @@ -119,7 +139,7 @@ EOF

-Printer: +Printer: diff --git a/moredetail.pl b/moredetail.pl index 4aa8b64997..4d4a0b44a2 100755 --- a/moredetail.pl +++ b/moredetail.pl @@ -1,4 +1,24 @@ #!/usr/bin/perl + +# $Id$ + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + use HTML::Template; use strict; require Exporter; @@ -68,9 +88,9 @@ foreach my $item (@items){ } else { $item->{'issue'}="Currently on issue to: {'borrower0'}>$item->{'card'}
"; } - } +$template->param(includesdir => $includes); $template->param(BIBITEM_DATA => \@results); $template->param(ITEM_DATA => \@items); $template->param(loggedinuser => $loggedinuser); diff --git a/reports-home.pl b/reports-home.pl index 87b0b657e1..422c1e7d8d 100755 --- a/reports-home.pl +++ b/reports-home.pl @@ -4,27 +4,13 @@ use strict; use CGI; use C4::Auth; use C4::Output; -use C4::Database; - -my $configfile=configfile(); -my $intranetdir=$configfile->{'intranetdir'}; +use C4::Context; +use HTML::Template; my $query = new CGI; my ($loggedinuser, $cookie, $sessionID) = checkauth($query); -print $query->header(-cookie => $cookie); - -print startpage(); -print startmenu('report'); - -print "

Logged in as: $loggedinuser [Log Out]

\n"; - -open H, "$intranetdir/htdocs/reports/index.html"; -while () { - print $_; -} -close H; - +my $template = gettemplate("reports/reports-home.tmpl"); +$template->param(loggedinuser => $loggedinuser); -print endpage(); -print endmenu('report'); +print $query->header(-cookie => $cookie),$template->output; diff --git a/shelves.pl b/shelves.pl index e1f49c7a42..48964a2f42 100755 --- a/shelves.pl +++ b/shelves.pl @@ -4,6 +4,24 @@ # $Header$ # + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + use strict; use C4::Search; use CGI; @@ -169,6 +187,9 @@ EOF # # $Log$ +# Revision 1.2.2.3 2002/10/28 17:45:14 tonnesen +# Merging from trunk to rel-1-2 +# # Revision 1.2.2.2 2002/07/11 18:05:28 tonnesen # Committing changes to add authentication and opac templating to rel-1-2 branch # -- 2.39.5