From ea7cbfff43b2da9ab3dc36d87d89e45d915f2fdc Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Sun, 16 Dec 2007 18:43:02 -0600 Subject: [PATCH] Fix for bug 1648, specifying a due date resulted in a blank due date Signed-off-by: Joshua Ferraro --- C4/Branch.pm | 6 +++--- C4/Circulation.pm | 4 +++- circ/circulation.pl | 12 +++++------- .../prog/en/modules/circ/circulation.tmpl | 1 + 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/C4/Branch.pm b/C4/Branch.pm index f8edb6a99d..a13af59ef4 100644 --- a/C4/Branch.pm +++ b/C4/Branch.pm @@ -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 ) { diff --git a/C4/Circulation.pm b/C4/Circulation.pm index b124de7229..77708d55da 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -856,7 +856,9 @@ sub AddIssue { if ( $actualissue->{borrowernumber} eq $borrower->{'borrowernumber'} ) { AddRenewal( $borrower->{'borrowernumber'}, - $item->{'itemnumber'} + $item->{'itemnumber'}, + C4::Context->userenv->{'branch'}, + $date ); } diff --git a/circ/circulation.pl b/circ/circulation.pl index 7d8fb837f5..3c2af2d0f8 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -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 ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl index cfc6f207bf..c2cd1cb0bf 100755 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -95,6 +95,7 @@ " /> " /> + " /> " /> " /> " /> -- 2.39.5