3 # written 8/5/2002 by Finlay
4 # script to execute issuing of books
6 # Copyright 2000-2002 Katipo Communications
8 # This file is part of Koha.
10 # Koha is free software; you can redistribute it and/or modify it under the
11 # terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 2 of the License, or (at your option) any later
15 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License along with
20 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
21 # Suite 330, Boston, MA 02111-1307 USA
24 # use warnings; # FIXME
28 use C4::Auth qw/:DEFAULT get_session/;
29 use C4::Dates qw/format_date/;
30 use C4::Branch; # GetBranches
31 use C4::Koha; # GetPrinter
52 # new op dev the branch and the printer are now defined by the userenv
53 # but first we have to check if someone has tried to change them
55 my $branch = $query->param('branch');
57 # update our session so the userenv is updated
58 my $sessionID = $query->cookie("CGISESSID") ;
59 my $session = get_session($sessionID);
60 $session->param('branch',$branch);
61 my $branchname = GetBranchName($branch);
62 $session->param('branchname',$branchname);
65 my $printer = $query->param('printer');
67 # update our session so the userenv is updated
68 my $sessionID = $query->cookie("CGISESSID") ;
69 my $session = get_session($sessionID);
70 $session->param('branchprinter',$printer);
73 if (!C4::Context->userenv && !$branch){
74 my $sessionID = $query->cookie("CGISESSID") ;
75 my $session = get_session($sessionID);
76 if ($session->param('branch') eq 'NO_LIBRARY_SET'){
77 # no branch set we can't issue
78 print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl");
83 my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
85 template_name => 'circ/circulation.tmpl',
89 flagsrequired => { circulate => 'circulate_remaining_permissions' },
93 my $branches = GetBranches();
94 my $printers = GetPrinters();
96 my @failedrenews = $query->param('failedrenew');
98 for (@failedrenews) { $renew_failed[$_] = 1; }
100 my $findborrower = $query->param('findborrower');
101 $findborrower =~ s|,| |g;
102 #$findborrower =~ s|'| |g;
103 my $borrowernumber = $query->param('borrowernumber');
105 $branch = C4::Context->userenv->{'branch'};
106 $printer = C4::Context->userenv->{'branchprinter'};
109 # If Autolocated is not activated, we show the Circulation Parameters to chage settings of librarian
110 if (C4::Context->preference("AutoLocation") ne 1) { # FIXME: string comparison to number
111 $template->param(ManualLocation => 1);
114 my $barcode = $query->param('barcode') || '';
115 $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
117 $barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter'));
118 my $stickyduedate = $query->param('stickyduedate') || $session->param( 'stickyduedate' );
119 my $duedatespec = $query->param('duedatespec') || $session->param( 'stickyduedate' );
120 my $issueconfirmed = $query->param('issueconfirmed');
121 my $cancelreserve = $query->param('cancelreserve');
122 my $organisation = $query->param('organisations');
123 my $print = $query->param('print');
124 my $newexpiry = $query->param('dateexpiry');
125 my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice
127 # Check if stickyduedate is turned off
129 # was stickyduedate loaded from session?
130 if ( $stickyduedate && ! $query->param("stickyduedate") ) {
131 $session->clear( 'stickyduedate' );
132 $stickyduedate = $query->param('stickyduedate');
133 $duedatespec = $query->param('duedatespec');
140 # if ($query->param('setcookies')) {
141 # $branchcookie = $query->cookie(-name=>'branch', -value=>"$branch", -expires=>'+1y');
142 # $printercookie = $query->cookie(-name=>'printer', -value=>"$printer", -expires=>'+1y');
146 my ($datedue,$invalidduedate,$globalduedate);
148 if(C4::Context->preference('globalDueDate') && (C4::Context->preference('globalDueDate') =~ C4::Dates->regexp('syspref'))){
149 $globalduedate = C4::Dates->new(C4::Context->preference('globalDueDate'));
151 my $duedatespec_allow = C4::Context->preference('SpecifyDueDate');
152 if($duedatespec_allow){
154 if ($duedatespec =~ C4::Dates->regexp('syspref')) {
155 my $tempdate = C4::Dates->new($duedatespec);
156 if ($tempdate and $tempdate->output('iso') gt C4::Dates->new()->output('iso')) {
157 # i.e., it has to be later than today/now
158 $datedue = $tempdate;
161 $template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
165 $template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
168 # pass global due date to tmpl if specifyduedate is true
169 # and we have no barcode (loading circ page but not checking out)
170 if($globalduedate && ! $barcode ){
171 $duedatespec = $globalduedate->output();
176 $datedue = $globalduedate if($globalduedate);
179 my $todaysdate = C4::Dates->new->output('iso');
181 # check and see if we should print
182 if ( $barcode eq '' && $print eq 'maybe' ) {
186 my $inprocess = ($barcode eq '') ? '' : $query->param('inprocess');
187 if ( $barcode eq '' && $query->param('charges') eq 'yes' ) {
190 borrowernumber => $borrowernumber
194 if ( $print eq 'yes' && $borrowernumber ne '' ) {
195 printslip( $borrowernumber );
196 $query->param( 'borrowernumber', '' );
197 $borrowernumber = '';
201 # STEP 2 : FIND BORROWER
202 # if there is a list of find borrowers....
207 my ( $count, $borrowers ) =
208 SearchMember($findborrower, 'cardnumber', 'web' );
209 my @borrowers = @$borrowers;
211 "AddPatronLists_".C4::Context->preference("AddPatronLists")=> "1",
213 if (C4::Context->preference("AddPatronLists")=~/code/){
214 my $categories=GetBorrowercategoryList;
215 $categories->[0]->{'first'}=1;
216 $template->param(categories=>$categories);
218 if ( $#borrowers == -1 ) {
219 $query->param( 'findborrower', '' );
220 $message = "'$findborrower'";
222 elsif ( $#borrowers == 0 ) {
223 $query->param( 'borrowernumber', $borrowers[0]->{'borrowernumber'} );
224 $query->param( 'barcode', '' );
225 $borrowernumber = $borrowers[0]->{'borrowernumber'};
228 $borrowerslist = \@borrowers;
232 # get the borrower information.....
235 if ($borrowernumber) {
236 $borrower = GetMemberDetails( $borrowernumber, 0 );
237 my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
239 # Warningdate is the date that the warning starts appearing
240 my ( $today_year, $today_month, $today_day ) = Today();
241 my ( $warning_year, $warning_month, $warning_day ) = split /-/,
242 $borrower->{'dateexpiry'};
243 my ( $enrol_year, $enrol_month, $enrol_day ) = split /-/,
244 $borrower->{'dateenrolled'};
245 # Renew day is calculated by adding the enrolment period to today
246 my ( $renew_year, $renew_month, $renew_day ) =
247 Add_Delta_YM( $enrol_year, $enrol_month, $enrol_day,
248 0 , $borrower->{'enrolmentperiod'}) if ($enrol_year*$enrol_month*$enrol_day>0);
249 # if the expiry date is before today ie they have expired
250 if ( $warning_year*$warning_month*$warning_day==0
251 || Date_to_Days( $today_year, $today_month, $today_day )
252 > Date_to_Days( $warning_year, $warning_month, $warning_day ) )
254 #borrowercard expired, no issues
258 expired => format_date($borrower->{dateexpiry}),
259 renewaldate => format_date("$renew_year-$renew_month-$renew_day")
262 # check for NotifyBorrowerDeparture
263 elsif ( C4::Context->preference('NotifyBorrowerDeparture') &&
264 Date_to_Days(Add_Delta_Days($warning_year,$warning_month,$warning_day,- C4::Context->preference('NotifyBorrowerDeparture'))) <
265 Date_to_Days( $today_year, $today_month, $today_day ) )
267 # borrower card soon to expire warn librarian
268 $template->param("warndeparture" => format_date($borrower->{dateexpiry}),
270 if ( C4::Context->preference('ReturnBeforeExpiry')){
271 $template->param("returnbeforeexpiry" => 1);
276 issuecount => $issue,
286 # always check for blockers on issuing
287 my ( $error, $question ) =
288 CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
289 my $blocker = $invalidduedate ? 1 : 0;
291 delete $question->{'DEBT'} if ($debt_confirmed);
292 foreach my $impossible ( keys %$error ) {
294 $impossible => $$error{$impossible},
300 my $confirm_required = 0;
301 unless($issueconfirmed){
302 # Get the item title for more information
303 my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode);
304 $template->param( itemhomebranch => $getmessageiteminfo->{'homebranch'} );
306 # pass needsconfirmation to template if issuing is possible and user hasn't yet confirmed.
307 foreach my $needsconfirmation ( keys %$question ) {
309 $needsconfirmation => $$question{$needsconfirmation},
310 getTitleMessageIteminfo => $getmessageiteminfo->{'title'},
311 NEEDSCONFIRMATION => 1
313 $confirm_required = 1;
316 unless($confirm_required) {
317 AddIssue( $borrower, $barcode, $datedue, $cancelreserve );
319 if($globalduedate && ! $stickyduedate && $duedatespec_allow ){
320 $duedatespec = $globalduedate->output();
326 # FIXME If the issue is confirmed, we launch another time GetMemberIssuesAndFines, now display the issue count after issue
327 my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
328 $template->param( issuecount => $issue );
331 # reload the borrower info for the sake of reseting the flags.....
332 if ($borrowernumber) {
333 $borrower = GetMemberDetails( $borrowernumber, 0 );
336 ##################################################################################
338 # show all reserves of this borrower, and the position of the reservation ....
339 my $borrowercategory;
341 if ($borrowernumber) {
344 # now we show the status of the borrower's reservations
345 my @borrowerreserv = GetReservesFromBorrowernumber($borrowernumber );
347 my @WaitingReserveLoop;
349 foreach my $num_res (@borrowerreserv) {
351 my %getWaitingReserveInfo;
352 my $getiteminfo = GetBiblioFromItemNumber( $num_res->{'itemnumber'} );
353 my $itemtypeinfo = getitemtypeinfo( (C4::Context->preference('item-level_itypes')) ? $getiteminfo->{'itype'} : $getiteminfo->{'itemtype'} );
354 my ( $transfertwhen, $transfertfrom, $transfertto ) =
355 GetTransfers( $num_res->{'itemnumber'} );
357 $getreserv{waiting} = 0;
358 $getreserv{transfered} = 0;
359 $getreserv{nottransfered} = 0;
361 $getreserv{reservedate} = format_date( $num_res->{'reservedate'} );
362 $getreserv{title} = $getiteminfo->{'title'};
363 $getreserv{itemtype} = $itemtypeinfo->{'description'};
364 $getreserv{author} = $getiteminfo->{'author'};
365 $getreserv{barcodereserv} = $getiteminfo->{'barcode'};
366 $getreserv{itemcallnumber} = $getiteminfo->{'itemcallnumber'};
367 $getreserv{biblionumber} = $getiteminfo->{'biblionumber'};
368 $getreserv{waitingat} = GetBranchName( $num_res->{'branchcode'} );
369 # check if we have a waiting status for reservations
370 if ( $num_res->{'found'} eq 'W' ) {
371 $getreserv{color} = 'reserved';
372 $getreserv{waiting} = 1;
373 # genarate information displaying only waiting reserves
374 $getWaitingReserveInfo{title} = $getiteminfo->{'title'};
375 $getWaitingReserveInfo{biblionumber} = $getiteminfo->{'biblionumber'};
376 $getWaitingReserveInfo{itemtype} = $itemtypeinfo->{'description'};
377 $getWaitingReserveInfo{author} = $getiteminfo->{'author'};
378 $getWaitingReserveInfo{reservedate} = format_date( $num_res->{'reservedate'} );
379 $getWaitingReserveInfo{waitingat} = GetBranchName( $num_res->{'branchcode'} );
380 if($num_res->{'branchcode'} eq $branch){ $getWaitingReserveInfo{waitinghere} = 1; }
382 # check transfers with the itemnumber foud in th reservation loop
383 if ($transfertwhen) {
384 $getreserv{color} = 'transfered';
385 $getreserv{transfered} = 1;
386 $getreserv{datesent} = format_date($transfertwhen);
387 $getreserv{frombranch} = GetBranchName($transfertfrom);
390 if ( ( $getiteminfo->{'holdingbranch'} ne $num_res->{'branchcode'} )
391 and not $transfertwhen )
393 $getreserv{nottransfered} = 1;
394 $getreserv{nottransferedby} =
395 GetBranchName( $getiteminfo->{'holdingbranch'} );
398 # if we don't have a reserv on item, we put the biblio infos and the waiting position
399 if ( $getiteminfo->{'title'} eq '' ) {
400 my $getbibinfo = GetBiblioData( $num_res->{'biblionumber'} );
401 my $getbibtype = getitemtypeinfo( $getbibinfo->{'itemtype'} ); # fixme - we should have item-level reserves here ?
402 $getreserv{color} = 'inwait';
403 $getreserv{title} = $getbibinfo->{'title'};
404 $getreserv{nottransfered} = 0;
405 $getreserv{itemtype} = $getbibtype->{'description'};
406 $getreserv{author} = $getbibinfo->{'author'};
407 $getreserv{biblionumber} = $num_res->{'biblionumber'};
409 $getreserv{waitingposition} = $num_res->{'priority'};
410 push( @reservloop, \%getreserv );
412 # if we have a reserve waiting, initiate waitingreserveloop
413 if ($getreserv{waiting} eq 1) {
414 push (@WaitingReserveLoop, \%getWaitingReserveInfo)
419 # return result to the template
421 countreserv => scalar @reservloop,
422 reservloop => \@reservloop ,
423 WaitingReserveLoop => \@WaitingReserveLoop,
425 $template->param( adultborrower => 1 ) if ( $borrower->{'category_type'} eq 'A' );
428 # make the issued books table.
429 my $todaysissues = '';
434 ## ADDED BY JF: new itemtype issuingrules counter stuff
435 my $issued_itemtypes_loop;
436 my $issued_itemtypes_count;
437 my $issued_itemtypes_allowed_count; # hashref with total allowed by itemtype
438 my $issued_itemtypes_remaining; # hashref with remaining
439 my $issued_itemtypes_flags; #hashref that stores flags
440 my @issued_itemtypes_count_loop;
443 # get each issue of the borrower & separate them in todayissues & previous issues
444 my ($issueslist) = GetPendingIssues($borrower->{'borrowernumber'});
446 # split in 2 arrays for today & previous
447 foreach my $it ( @$issueslist ) {
448 # set itemtype per item-level_itype syspref - FIXME this is an ugly hack
449 $it->{'itemtype'} = ( C4::Context->preference( 'item-level_itypes' ) ) ? $it->{'itype'} : $it->{'itemtype'};
451 ($it->{'charge'}, $it->{'itemtype_charge'}) = GetIssuingCharges(
452 $it->{'itemnumber'}, $borrower->{'borrowernumber'}
454 $it->{'charge'} = sprintf("%.2f", $it->{'charge'});
455 my ($can_renew, $can_renew_error) = CanBookBeRenewed(
456 $borrower->{'borrowernumber'},$it->{'itemnumber'}
458 $it->{"renew_error_${can_renew_error}"} = 1 if defined $can_renew_error;
459 my ( $restype, $reserves ) = CheckReserves( $it->{'itemnumber'} );
460 $it->{'can_renew'} = $can_renew;
461 $it->{'can_confirm'} = !$can_renew && !$restype;
462 $it->{'renew_error'} = $restype;
464 $it->{'dd'} = format_date($it->{'date_due'});
465 $it->{'od'} = ( $it->{'date_due'} lt $todaysdate ) ? 1 : 0 ;
466 ($it->{'author'} eq '') and $it->{'author'} = ' ';
467 $it->{'renew_failed'} = $renew_failed[$it->{'itemnumber'}];
468 # ADDED BY JF: NEW ITEMTYPE COUNT DISPLAY
469 $issued_itemtypes_count->{ $it->{'itemtype'} }++;
471 if ( $todaysdate eq $it->{'issuedate'} or $todaysdate eq $it->{'lastreneweddate'} ) {
472 push @todaysissues, $it;
474 push @previousissues, $it;
477 if ( C4::Context->preference( "todaysIssuesDefaultSortOrder" ) eq 'asc' ) {
478 @todaysissues = sort { $a->{'timestamp'} cmp $b->{'timestamp'} } @todaysissues;
481 @todaysissues = sort { $b->{'timestamp'} cmp $a->{'timestamp'} } @todaysissues;
483 if ( C4::Context->preference( "previousIssuesDefaultSortOrder" ) eq 'asc' ){
484 @previousissues = sort { $a->{'date_due'} cmp $b->{'date_due'} } @previousissues;
487 @previousissues = sort { $b->{'date_due'} cmp $a->{'date_due'} } @previousissues;
491 #### ADDED BY JF FOR COUNTS BY ITEMTYPE RULES
492 # FIXME: This should utilize all the issuingrules options rather than just the defaults
493 # and it should be moved to a module
494 my $dbh = C4::Context->dbh;
496 # how many of each is allowed?
497 my $issueqty_sth = $dbh->prepare( "
498 SELECT itemtypes.description AS description,issuingrules.itemtype,maxissueqty
500 LEFT JOIN itemtypes ON (itemtypes.itemtype=issuingrules.itemtype)
503 #my @issued_itemtypes_count; # huh?
504 $issueqty_sth->execute("*"); # This is a literal asterisk, not a wildcard.
506 while ( my $data = $issueqty_sth->fetchrow_hashref() ) {
508 # subtract how many of each this borrower has
509 $data->{'count'} = $issued_itemtypes_count->{ $data->{'description'} };
511 ( $data->{'maxissueqty'} -
512 $issued_itemtypes_count->{ $data->{'description'} } );
514 # can't have a negative number of remaining
515 if ( $data->{'left'} < 0 ) { $data->{'left'} = "0" }
516 $data->{'flag'} = 1 unless ( $data->{'maxissueqty'} > $data->{'count'} );
517 unless ( ( $data->{'maxissueqty'} < 1 )
518 || ( $data->{'itemtype'} eq "*" )
519 || ( $data->{'itemtype'} eq "CIRC" ) )
521 push @issued_itemtypes_count_loop, $data;
524 $issued_itemtypes_loop = \@issued_itemtypes_count_loop;
530 my $CGIselectborrower;
531 if ($borrowerslist) {
533 sort {(lc $a->{'surname'} cmp lc $b->{'surname'} || lc $a->{'firstname'} cmp lc $b->{'firstname'})
537 push @values, $_->{'borrowernumber'};
538 $labels{ $_->{'borrowernumber'} } =
539 "$_->{'surname'}, $_->{'firstname'} ... ($_->{'cardnumber'} - $_->{'categorycode'}) ... $_->{'address'} ";
541 $CGIselectborrower = CGI::scrolling_list(
542 -name => 'borrowernumber',
544 -id => 'borrowernumber',
547 -onclick => "window.location = '/cgi-bin/koha/circ/circulation.pl?borrowernumber=' + this.value;",
555 my $flags = $borrower->{'flags'};
558 foreach $flag ( sort keys %$flags ) {
559 $template->param( flagged=> 1);
560 $flags->{$flag}->{'message'} =~ s#\n#<br />#g;
561 if ( $flags->{$flag}->{'noissues'} ) {
566 if ( $flag eq 'GNA' ) {
567 $template->param( gna => 'true' );
569 if ( $flag eq 'LOST' ) {
570 $template->param( lost => 'true' );
572 if ( $flag eq 'DBARRED' ) {
573 $template->param( dbarred => 'true' );
575 if ( $flag eq 'CHARGES' ) {
578 chargesmsg => $flags->{'CHARGES'}->{'message'},
579 chargesamount => $flags->{'CHARGES'}->{'amount'},
580 charges_is_blocker => 1
583 if ( $flag eq 'CREDITS' ) {
586 creditsmsg => $flags->{'CREDITS'}->{'message'}
591 if ( $flag eq 'CHARGES' ) {
595 chargesmsg => $flags->{'CHARGES'}->{'message'},
596 chargesamount => $flags->{'CHARGES'}->{'amount'},
599 if ( $flag eq 'CREDITS' ) {
602 creditsmsg => $flags->{'CREDITS'}->{'message'}
605 if ( $flag eq 'ODUES' ) {
609 oduesmsg => $flags->{'ODUES'}->{'message'}
612 my $items = $flags->{$flag}->{'itemlist'};
616 # foreach my $item (@$items) {
617 # my ($iteminformation) =
618 # getiteminformation( $item->{'itemnumber'}, 0 );
619 # push @itemswaiting, $iteminformation;
622 if ( $query->param('module') ne 'returns' ) {
623 $template->param( nonreturns => 'true' );
626 if ( $flag eq 'NOTES' ) {
630 notesmsg => $flags->{'NOTES'}->{'message'}
636 my $amountold = $borrower->{flags}->{'CHARGES'}->{'message'} || 0;
637 my @temp = split( /\$/, $amountold );
639 if ( $borrower->{'category_type'} eq 'C') {
640 my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' );
641 my $cnt = scalar(@$catcodes);
642 $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
643 $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
646 my $CGIorganisations;
647 my $member_of_institution;
648 if ( C4::Context->preference("memberofinstitution") ) {
649 my $organisations = get_institutions();
652 foreach my $organisation ( keys %$organisations ) {
653 push @orgs, $organisation;
654 $org_labels{$organisation} =
655 $organisations->{$organisation}->{'surname'};
657 $member_of_institution = 1;
658 $CGIorganisations = CGI::popup_menu(
659 -id => 'organisations',
660 -name => 'organisations',
661 -labels => \%org_labels,
666 $amountold = $temp[1];
669 issued_itemtypes_count_loop => $issued_itemtypes_loop,
670 findborrower => $findborrower,
671 borrower => $borrower,
672 borrowernumber => $borrowernumber,
674 branchname => GetBranchName($borrower->{'branchcode'}),
676 printername => $printer,
677 firstname => $borrower->{'firstname'},
678 surname => $borrower->{'surname'},
679 dateexpiry => format_date($newexpiry),
680 expiry => format_date($borrower->{'dateexpiry'}),
681 categorycode => $borrower->{'categorycode'},
682 categoryname => $borrower->{description},
683 address => $borrower->{'address'},
684 address2 => $borrower->{'address2'},
685 email => $borrower->{'email'},
686 emailpro => $borrower->{'emailpro'},
687 borrowernotes => $borrower->{'borrowernotes'},
688 city => $borrower->{'city'},
689 zipcode => $borrower->{'zipcode'},
690 phone => $borrower->{'phone'} || $borrower->{'mobile'},
691 cardnumber => $borrower->{'cardnumber'},
692 amountold => $amountold,
694 stickyduedate => $stickyduedate,
695 duedatespec => $duedatespec,
697 CGIselectborrower => $CGIselectborrower,
698 todayissues => \@todaysissues,
699 previssues => \@previousissues,
700 inprocess => $inprocess,
701 memberofinstution => $member_of_institution,
702 CGIorganisations => $CGIorganisations,
703 is_child => ($borrower->{'category_type'} eq 'C'),
707 # save stickyduedate to session
708 if ($stickyduedate) {
709 $session->param( 'stickyduedate', $duedatespec );
712 #if ($branchcookie) {
713 #$cookie=[$cookie, $branchcookie, $printercookie];
716 my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'});
717 $template->param( picture => 1 ) if $picture;
721 debt_confirmed => $debt_confirmed,
722 SpecifyDueDate => $duedatespec_allow,
723 CircAutocompl => C4::Context->preference("CircAutocompl"),
724 AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"),
725 dateformat => C4::Context->preference("dateformat"),
726 DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
728 output_html_with_http_headers $query, $cookie, $template->output;