Browse Source

Fix for bug 1648, specifying a due date resulted in a blank due date

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
3.0.x
Chris Cormack 17 years ago
committed by Joshua Ferraro
parent
commit
ea7cbfff43
  1. 6
      C4/Branch.pm
  2. 4
      C4/Circulation.pm
  3. 12
      circ/circulation.pl
  4. 1
      koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl

6
C4/Branch.pm

@ -101,17 +101,17 @@ sub GetBranches {
my %branches; my %branches;
my $dbh = C4::Context->dbh; my $dbh = C4::Context->dbh;
my $sth; my $sth;
my $query="SELECT * from branches"; my $query="SELECT * FROM branches";
if ($onlymine && C4::Context->userenv && C4::Context->userenv->{branch}){ if ($onlymine && C4::Context->userenv && C4::Context->userenv->{branch}){
$query .= " WHERE branchcode =".$dbh->quote(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 = $dbh->prepare($query);
$sth->execute; $sth->execute;
while ( my $branch = $sth->fetchrow_hashref ) { while ( my $branch = $sth->fetchrow_hashref ) {
my $nsth = my $nsth =
$dbh->prepare( $dbh->prepare(
"select categorycode from branchrelations where branchcode = ?"); "SELECT category_id FROM branchrelations WHERE branchcode = ?");
$nsth->execute( $branch->{'branchcode'} ); $nsth->execute( $branch->{'branchcode'} );
while ( my ($cat) = $nsth->fetchrow_array ) { while ( my ($cat) = $nsth->fetchrow_array ) {

4
C4/Circulation.pm

@ -856,7 +856,9 @@ sub AddIssue {
if ( $actualissue->{borrowernumber} eq $borrower->{'borrowernumber'} ) { if ( $actualissue->{borrowernumber} eq $borrower->{'borrowernumber'} ) {
AddRenewal( AddRenewal(
$borrower->{'borrowernumber'}, $borrower->{'borrowernumber'},
$item->{'itemnumber'} $item->{'itemnumber'},
C4::Context->userenv->{'branch'},
$date
); );
} }

12
circ/circulation.pl

@ -131,10 +131,11 @@ my $print = $query->param('print');
# #
my ($datedue,$invalidduedate); my ($datedue,$invalidduedate);
if($duedatespec) { if ($duedatespec) {
$datedue= C4::Dates->new($duedatespec ); $datedue = C4::Dates->new($duedatespec,'iso' );
$invalidduedate=1 unless $datedue; $invalidduedate=1 unless $datedue;
} }
#if (defined($year)) { #if (defined($year)) {
# $duedatespec = "$year-$month-$day"; # $duedatespec = "$year-$month-$day";
#} else { #} else {
@ -196,7 +197,6 @@ if ($findborrower) {
# get the borrower information..... # get the borrower information.....
my $borrower; my $borrower;
my @lines; my @lines;
warn $borrowernumber;
if ($borrowernumber) { if ($borrowernumber) {
$borrower = GetMemberDetails( $borrowernumber, 0 ); $borrower = GetMemberDetails( $borrowernumber, 0 );
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber ); my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
@ -275,10 +275,8 @@ if ($barcode) {
$noquestion = 0; $noquestion = 0;
} }
$template->param( $template->param(
itemhomebranch => $getmessageiteminfo->{'homebranch'} , itemhomebranch => $getmessageiteminfo->{'homebranch'} ,
day => $day, duedatespec => $duedatespec,
month => $month,
year => $year
); );
if ( $noerror && ( $noquestion || $issueconfirmed ) ) { if ( $noerror && ( $noquestion || $issueconfirmed ) ) {
AddIssue( $borrower, $barcode, $datedue ); AddIssue( $borrower, $barcode, $datedue );

1
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl

@ -95,6 +95,7 @@
<input type="hidden" name="barcode" value="<!-- TMPL_VAR NAME="barcode" -->" /> <input type="hidden" name="barcode" value="<!-- TMPL_VAR NAME="barcode" -->" />
<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" /> <input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
<input type="hidden" name="issueconfirmed" value="1" /> <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="day" value="<!-- TMPL_VAR name="day" -->" />
<input type="hidden" name="month" value="<!-- TMPL_VAR name="month" -->" /> <input type="hidden" name="month" value="<!-- TMPL_VAR name="month" -->" />
<input type="hidden" name="year" value="<!-- TMPL_VAR name="year" -->" /> <input type="hidden" name="year" value="<!-- TMPL_VAR name="year" -->" />

Loading…
Cancel
Save