Fixed the dates in aqbudget.pl
This commit is contained in:
parent
2810acfb2a
commit
e4d7a39bab
3 changed files with 22 additions and 12 deletions
10
C4/Date.pm
10
C4/Date.pm
|
@ -56,6 +56,11 @@ sub format_date
|
|||
my $olddate = shift;
|
||||
my $newdate;
|
||||
|
||||
if ( ! $olddate )
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
my $dateformat = get_date_format();
|
||||
|
||||
if ( $dateformat eq "us" )
|
||||
|
@ -87,6 +92,11 @@ sub format_date_in_iso
|
|||
my $olddate = shift;
|
||||
my $newdate;
|
||||
|
||||
if ( ! $olddate )
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
my $dateformat = get_date_format();
|
||||
|
||||
if ( $dateformat eq "us" )
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
use strict;
|
||||
use CGI;
|
||||
use C4::Date;
|
||||
use C4::Auth;
|
||||
use C4::Context;
|
||||
use C4::Output;
|
||||
|
@ -46,8 +47,6 @@ use C4::Interface::CGI::Output;
|
|||
use C4::Search;
|
||||
use HTML::Template;
|
||||
|
||||
|
||||
|
||||
sub StringSearch {
|
||||
my ($env,$searchstring,$type)=@_;
|
||||
my $dbh = C4::Context->dbh;
|
||||
|
@ -130,8 +129,9 @@ if ($op eq 'add_form') {
|
|||
} else {
|
||||
$template->param(adding => 1);
|
||||
}
|
||||
$template->param(startdate => $dataaqbudget->{'startdate'});
|
||||
$template->param(enddate => $dataaqbudget->{'enddate'});
|
||||
$template->param(dateformat => display_date_format() );
|
||||
$template->param(startdate => format_date($dataaqbudget->{'startdate'}));
|
||||
$template->param(enddate => format_date($dataaqbudget->{'enddate'}));
|
||||
$template->param(budgetamount => $dataaqbudget->{'budgetamount'});
|
||||
# END $OP eq ADD_FORM
|
||||
################## ADD_VALIDATE ##################################
|
||||
|
@ -140,8 +140,8 @@ if ($op eq 'add_form') {
|
|||
my $dbh = C4::Context->dbh;
|
||||
my $query = "replace aqbudget (bookfundid,startdate,enddate,budgetamount) values (";
|
||||
$query.= $dbh->quote($input->param('bookfundid')).",";
|
||||
$query.= $dbh->quote($input->param('startdate')).",";
|
||||
$query.= $dbh->quote($input->param('enddate')).",";
|
||||
$query.= $dbh->quote(format_date_in_iso($input->param('startdate'))).",";
|
||||
$query.= $dbh->quote(format_date_in_iso($input->param('enddate'))).",";
|
||||
$query.= $dbh->quote($input->param('budgetamount')).")";
|
||||
my $sth=$dbh->prepare($query);
|
||||
$sth->execute;
|
||||
|
@ -160,8 +160,8 @@ if ($op eq 'add_form') {
|
|||
my $data=$sth->fetchrow_hashref;
|
||||
$sth->finish;
|
||||
$template->param(bookfundid => $bookfundid);
|
||||
$template->param(startdate => $data->{'startdate'});
|
||||
$template->param(enddate => $data->{'enddate'});
|
||||
$template->param(startdate => format_date($data->{'startdate'}));
|
||||
$template->param(enddate => format_date($data->{'enddate'}));
|
||||
$template->param(budgetamount => $data->{'budgetamount'});
|
||||
# END $OP eq DELETE_CONFIRM
|
||||
################## DELETE_CONFIRMED ##################################
|
||||
|
@ -205,8 +205,8 @@ if ($op eq 'add_form') {
|
|||
push(@toggle,$toggle);
|
||||
push(@bookfundid,$results->[$i]{'bookfundid'});
|
||||
push(@bookfundname,$dataaqbookfund->{'bookfundname'});
|
||||
push(@startdate,$results->[$i]{'startdate'});
|
||||
push(@enddate,$results->[$i]{'enddate'});
|
||||
push(@startdate,format_date($results->[$i]{'startdate'}));
|
||||
push(@enddate,format_date($results->[$i]{'enddate'}));
|
||||
push(@budgetamount,$results->[$i]{'budgetamount'});
|
||||
if ($toggle eq 'white'){
|
||||
$toggle="#ffffcc";
|
||||
|
|
|
@ -91,8 +91,8 @@
|
|||
<TMPL_IF name="adding">
|
||||
<tr><td>Book fund</td><td><input type=text name=bookfundid size=5 maxlength=5 onBlur=toUC(this)></td></tr>
|
||||
</TMPL_IF>
|
||||
<tr><td>Start date</td><td><input type=text name=startdate size=40 maxlength=80 value='<TMPL_VAR name="startdate">'> </td></tr>
|
||||
<tr><td>End date</td><td><input type=text name=enddate value='<TMPL_VAR name="enddate">'></td></tr>
|
||||
<tr><td>Start date (<TMPL_VAR NAME=dateformat>)</td><td><input type=text name=startdate size=40 maxlength=80 value='<TMPL_VAR name="startdate">'> </td></tr>
|
||||
<tr><td>End date (<TMPL_VAR NAME=dateformat>)</td><td><input type=text name=enddate value='<TMPL_VAR name="enddate">'></td></tr>
|
||||
<tr><td>Budget amount</td><td><input type=text name=budgetamount value='<TMPL_VAR name="budgetamount">'></td></tr>
|
||||
<tr><td> </td><td><INPUT type=button value='OK' onClick='Check(this.form)'></td></tr>
|
||||
</table>
|
||||
|
|
Loading…
Reference in a new issue