Bug fixes

This commit is contained in:
wolfpac444 2003-03-29 00:02:24 +00:00
parent 4dd0e8d2fb
commit 16f422a8f7
4 changed files with 6 additions and 47 deletions

View file

@ -1,3 +1,5 @@
#!/usr/bin/perl -w
package C4::Date;
use strict;
@ -15,9 +17,10 @@ $VERSION = 0.01;
@EXPORT = qw(
&display_date_format
&format_date
&format_date_in_iso
);
sub get_date_format
{
#Get the database handle
@ -65,19 +68,16 @@ sub format_date
if ( $dateformat eq "us" )
{
Date_Init("DateFormat=US");
$olddate = ParseDate($olddate);
$newdate = UnixDate($olddate,'%m/%d/%Y');
}
elsif ( $dateformat eq "metric" )
{
Date_Init("DateFormat=metric");
$olddate = ParseDate($olddate);
$newdate = UnixDate($olddate,'%d/%m/%Y');
}
elsif ( $dateformat eq "iso" )
{
Date_Init("DateFormat=iso");
$olddate = ParseDate($olddate);
$newdate = UnixDate($olddate,'%Y-%m-%d');
}
@ -87,37 +87,4 @@ sub format_date
}
}
sub format_date_in_iso
{
my $olddate = shift;
my $newdate;
my $dateformat = get_date_format();
if ( $dateformat eq "us" )
{
Date_Init("DateFormat=US");
$olddate = ParseDate($olddate);
}
elsif ( $dateformat eq "metric" )
{
Date_Init("DateFormat=metric");
$olddate = ParseDate($olddate);
}
elsif ( $dateformat eq "iso" )
{
Date_Init("DateFormat=iso");
$olddate = ParseDate($olddate);
}
else
{
return "9999-99-99";
}
$newdate = UnixDate($olddate, '%Y-%m-%d');
return $newdate;
}
1;
__END__

View file

@ -4,12 +4,6 @@
<TMPL_INCLUDE NAME="cat-top.inc">
</TMPL_IF>
<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>
<form name="f" method="post">

View file

@ -68,8 +68,7 @@ if ($op eq "do_search") {
flagsrequired => {catalogue => 1},
debug => 1,
});
$template->param(loggedinuser => $loggedinuser,
result => \@results);
#$template->param(result => \@results);
} else {
($template, $loggedinuser, $cookie)
@ -80,7 +79,7 @@ if ($op eq "do_search") {
flagsrequired => {catalogue => 1},
debug => 1,
});
$template->param(loggedinuser => $loggedinuser);
#$template->param(loggedinuser => $loggedinuser);
my $tagslib;
if ($type eq "opac") {
$tagslib = &MARCgettagslib($dbh,1);

View file

@ -169,7 +169,6 @@ $template->param(search => $search);
$template->param(searchdesc => $searchdesc);
$template->param(SEARCH_RESULTS => $resultsarray);
#$template->param(includesdir => $includes);
$template->param(loggedinuser => $loggedinuser);
my @numbers = ();
if ($count>10) {