use CGI;
use C4::Output;
use C4::Print;
-use C4::Auth;
+use C4::Auth qw/:DEFAULT get_session/;
use C4::Date;
use C4::Branch; # GetBranches
use C4::Koha; # GetPrinter
# update our session so the userenv is updated
my $dbh=C4::Context->dbh;
my $sessionID = $query->cookie("CGISESSID") ;
- my $session = new CGI::Session("driver:MySQL", $sessionID, {Handle=>$dbh});
+ my $session = get_session($sessionID);
$session->param('branch',$branch);
my $branchname = GetBranchName($branch);
$session->param('branchname',$branchname);
# update our session so the userenv is updated
my $dbh=C4::Context->dbh;
my $sessionID = $query->cookie("CGISESSID") ;
- my $session = new CGI::Session("driver:MySQL", $sessionID, {Handle=>$dbh});
+ my $session = get_session($sessionID);
$session->param('branchprinter',$printer);
}
my $month = $query->param('month');
my $day = $query->param('day');
my $stickyduedate = $query->param('stickyduedate');
+my $duedatespec = $query->param('duedatespec');
my $issueconfirmed = $query->param('issueconfirmed');
my $cancelreserve = $query->param('cancelreserve');
my $organisation = $query->param('organisations');
# }
#
+my ($datedue,$invalidduedate);
+if($duedatespec) {
+ $datedue= C4::Dates->new($duedatespec );
+ $invalidduedate=1 unless $datedue;
+}
+#if (defined($year)) {
+# $duedatespec = "$year-$month-$day";
+#} else {
+# ($year, $month, $day) = ($duedatespec) ? split /-/, $duedatespec : (0,0,0);
+#}
my @datearr = localtime( time() );
# get the borrower information.....
my $borrower;
my @lines;
-
+warn $borrowernumber;
if ($borrowernumber) {
$borrower = GetMemberDetails( $borrowernumber, 0 );
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
#
if ($barcode) {
- $barcode = cuecatbarcodedecode($barcode);
- my ( $datedue, $invalidduedate ) = fixdate( $year, $month, $day );
- if ($issueconfirmed) {
+ # $barcode = cuecatbarcodedecode($barcode);
+
+ if ($issueconfirmed) {
AddIssue( $borrower, $barcode, $datedue, $cancelreserve );
$inprocess = 1;
}
else {
my ( $error, $question ) =
- CanBookBeIssued( $borrower, $barcode, $year, $month, $day,
- $inprocess );
+ CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
my $noerror = 1;
my $noquestion = 1;
# Get the item title for more information
$amountold = $temp[1];
+my $borrowercategory = GetBorrowercategory( $borrower->{'categorycode'} );
+my $category_type = $borrowercategory->{'category_type'};
+( $template->param( adultborrower => 1 ) ) if ( $category_type eq 'A' );
+
$template->param(
issued_itemtypes_count_loop => $issued_itemtypes_loop,
findborrower => $findborrower,
inprocess => $inprocess,
memberofinstution => $member_of_institution,
CGIorganisations => $CGIorganisations,
+ circview => 1,
+
);
# set return date if stickyduedate
if ($stickyduedate) {
- my $t_year = "year" . $year;
- my $t_month = "month" . $month;
- my $t_day = "day" . $day;
$template->param(
- $t_year => 1,
- $t_month => 1,
- $t_day => 1,
+ duedatespec => $duedatespec,
);
}
#}
$template->param(
- SpecifyDueDate => C4::Context->preference("SpecifyDueDate")
+ SpecifyDueDate => C4::Context->preference("SpecifyDueDate"),
+ CircAutocompl => C4::Context->preference("CircAutocompl") ,
+ DHTMLformat => C4::Dates->DHTMLcalendar(),
);
-$template->param( CircAutocompl => C4::Context->preference("CircAutocompl") );
output_html_with_http_headers $query, $cookie, $template->output;