Fix for bug 1648, specifying a due date resulted in a blank due date
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
f768cd6108
commit
ea7cbfff43
|
|
@ -101,17 +101,17 @@ sub GetBranches {
|
|||
my %branches;
|
||||
my $dbh = C4::Context->dbh;
|
||||
my $sth;
|
||||
my $query="SELECT * from branches";
|
||||
my $query="SELECT * FROM branches";
|
||||
if ($onlymine && C4::Context->userenv && C4::Context->userenv->{branch}){
|
||||
$query .= " WHERE branchcode =".$dbh->quote(C4::Context->userenv->{branch});
|
||||
}
|
||||
$query.=" order by branchname";
|
||||
$query.=" ORDER BY branchname";
|
||||
$sth = $dbh->prepare($query);
|
||||
$sth->execute;
|
||||
while ( my $branch = $sth->fetchrow_hashref ) {
|
||||
my $nsth =
|
||||
$dbh->prepare(
|
||||
"select categorycode from branchrelations where branchcode = ?");
|
||||
"SELECT category_id FROM branchrelations WHERE branchcode = ?");
|
||||
$nsth->execute( $branch->{'branchcode'} );
|
||||
while ( my ($cat) = $nsth->fetchrow_array ) {
|
||||
|
||||
|
|
|
|||
|
|
@ -856,7 +856,9 @@ sub AddIssue {
|
|||
if ( $actualissue->{borrowernumber} eq $borrower->{'borrowernumber'} ) {
|
||||
AddRenewal(
|
||||
$borrower->{'borrowernumber'},
|
||||
$item->{'itemnumber'}
|
||||
$item->{'itemnumber'},
|
||||
C4::Context->userenv->{'branch'},
|
||||
$date
|
||||
);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,10 +131,11 @@ my $print = $query->param('print');
|
|||
#
|
||||
|
||||
my ($datedue,$invalidduedate);
|
||||
if($duedatespec) {
|
||||
$datedue= C4::Dates->new($duedatespec );
|
||||
if ($duedatespec) {
|
||||
$datedue = C4::Dates->new($duedatespec,'iso' );
|
||||
$invalidduedate=1 unless $datedue;
|
||||
}
|
||||
|
||||
#if (defined($year)) {
|
||||
# $duedatespec = "$year-$month-$day";
|
||||
#} else {
|
||||
|
|
@ -196,7 +197,6 @@ if ($findborrower) {
|
|||
# get the borrower information.....
|
||||
my $borrower;
|
||||
my @lines;
|
||||
warn $borrowernumber;
|
||||
if ($borrowernumber) {
|
||||
$borrower = GetMemberDetails( $borrowernumber, 0 );
|
||||
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
|
||||
|
|
@ -275,10 +275,8 @@ if ($barcode) {
|
|||
$noquestion = 0;
|
||||
}
|
||||
$template->param(
|
||||
itemhomebranch => $getmessageiteminfo->{'homebranch'} ,
|
||||
day => $day,
|
||||
month => $month,
|
||||
year => $year
|
||||
itemhomebranch => $getmessageiteminfo->{'homebranch'} ,
|
||||
duedatespec => $duedatespec,
|
||||
);
|
||||
if ( $noerror && ( $noquestion || $issueconfirmed ) ) {
|
||||
AddIssue( $borrower, $barcode, $datedue );
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@
|
|||
<input type="hidden" name="barcode" value="<!-- TMPL_VAR NAME="barcode" -->" />
|
||||
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
|
||||
<input type="hidden" name="issueconfirmed" value="1" />
|
||||
<input type="hidden" name="duedatespec" value="<!-- TMPL_VAR NAME="duedatespec" -->" />
|
||||
<input type="hidden" name="day" value="<!-- TMPL_VAR name="day" -->" />
|
||||
<input type="hidden" name="month" value="<!-- TMPL_VAR name="month" -->" />
|
||||
<input type="hidden" name="year" value="<!-- TMPL_VAR name="year" -->" />
|
||||
|
|
|
|||
Loading…
Reference in New Issue