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 my $sessionID = $query->cookie("CGISESSID") ;
53 my $session = get_session($sessionID);
55 # new op dev the branch and the printer are now defined by the userenv
56 # but first we have to check if someone has tried to change them
58 my $branch = $query->param('branch');
60 # update our session so the userenv is updated
61 $session->param('branch',$branch);
62 my $branchname = GetBranchName($branch);
63 $session->param('branchname',$branchname);
66 my $printer = $query->param('printer');
68 # update our session so the userenv is updated
69 $session->param('branchprinter',$printer);
72 if (!C4::Context->userenv && !$branch){
73 if ($session->param('branch') eq 'NO_LIBRARY_SET'){
74 # no branch set we can't issue
75 print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl");
80 my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
82 template_name => 'circ/circulation.tmpl',
86 flagsrequired => { circulate => 1 },
90 my $branches = GetBranches();
91 my $printers = GetPrinters();
93 my @failedrenews = $query->param('failedrenew');
95 for (@failedrenews) { $renew_failed[$_] = 1; }
97 my $findborrower = $query->param('findborrower');
98 $findborrower =~ s|,| |g;
99 #$findborrower =~ s|'| |g;
100 my $borrowernumber = $query->param('borrowernumber');
102 $branch = C4::Context->userenv->{'branch'};
103 $printer = C4::Context->userenv->{'branchprinter'};
106 # If Autolocated is not activated, we show the Circulation Parameters to chage settings of librarian
107 if (C4::Context->preference("AutoLocation") ne 1) { # FIXME: string comparison to number
108 $template->param(ManualLocation => 1);
111 my $barcode = $query->param('barcode') || '';
112 $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
114 $barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter'));
115 my $stickyduedate = $query->param('stickyduedate') || $session->param( 'stickyduedate' );
116 my $duedatespec = $query->param('duedatespec') || $session->param( 'stickyduedate' );
117 my $issueconfirmed = $query->param('issueconfirmed');
118 my $cancelreserve = $query->param('cancelreserve');
119 my $organisation = $query->param('organisations');
120 my $print = $query->param('print');
121 my $newexpiry = $query->param('dateexpiry');
122 my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice
124 # Check if stickyduedate is turned off
126 # was stickyduedate loaded from session?
127 if ( $stickyduedate && ! $query->param("stickyduedate") ) {
128 $session->clear( 'stickyduedate' );
129 $stickyduedate = $query->param('stickyduedate');
130 $duedatespec = $query->param('duedatespec');
137 # if ($query->param('setcookies')) {
138 # $branchcookie = $query->cookie(-name=>'branch', -value=>"$branch", -expires=>'+1y');
139 # $printercookie = $query->cookie(-name=>'printer', -value=>"$printer", -expires=>'+1y');
143 my ($datedue,$invalidduedate);
145 if ($duedatespec =~ C4::Dates->regexp('syspref')) {
146 my $tempdate = C4::Dates->new($duedatespec);
147 if ($tempdate and $tempdate->output('iso') gt C4::Dates->new()->output('iso')) {
148 # i.e., it has to be later than today/now
149 $datedue = $tempdate;
152 $template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
156 $template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
160 my $todaysdate = C4::Dates->new->output('iso');
162 # check and see if we should print
163 if ( $barcode eq '' && $print eq 'maybe' ) {
167 my $inprocess = ($barcode eq '') ? '' : $query->param('inprocess');
169 if ( $barcode eq '' && $query->param('charges') eq 'yes' ) {
172 borrowernumber => $borrowernumber
176 if ( $print eq 'yes' && $borrowernumber ne '' ) {
177 printslip( $borrowernumber );
178 $query->param( 'borrowernumber', '' );
179 $borrowernumber = '';
183 # STEP 2 : FIND BORROWER
184 # if there is a list of find borrowers....
189 my ( $count, $borrowers ) =
190 SearchMember($findborrower, 'cardnumber', 'web' );
191 my @borrowers = @$borrowers;
193 "AddPatronLists_".C4::Context->preference("AddPatronLists")=> "1",
195 if (C4::Context->preference("AddPatronLists")=~/code/){
196 my $categories=GetBorrowercategoryList;
197 $categories->[0]->{'first'}=1;
198 $template->param(categories=>$categories);
200 if ( $#borrowers == -1 ) {
201 $query->param( 'findborrower', '' );
202 $message = "'$findborrower'";
204 elsif ( $#borrowers == 0 ) {
205 $query->param( 'borrowernumber', $borrowers[0]->{'borrowernumber'} );
206 $query->param( 'barcode', '' );
207 $borrowernumber = $borrowers[0]->{'borrowernumber'};
210 $borrowerslist = \@borrowers;
214 # get the borrower information.....
217 if ($borrowernumber) {
218 $borrower = GetMemberDetails( $borrowernumber, 0 );
219 my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
221 # Warningdate is the date that the warning starts appearing
222 my ( $today_year, $today_month, $today_day ) = Today();
223 my ( $warning_year, $warning_month, $warning_day ) = split /-/,
224 $borrower->{'dateexpiry'};
225 my ( $enrol_year, $enrol_month, $enrol_day ) = split /-/,
226 $borrower->{'dateenrolled'};
227 # Renew day is calculated by adding the enrolment period to today
228 my ( $renew_year, $renew_month, $renew_day ) =
229 Add_Delta_YM( $enrol_year, $enrol_month, $enrol_day,
230 0 , $borrower->{'enrolmentperiod'}) if ($enrol_year*$enrol_month*$enrol_day>0);
231 # if the expiry date is before today ie they have expired
232 if ( $warning_year*$warning_month*$warning_day==0
233 || Date_to_Days( $today_year, $today_month, $today_day )
234 > Date_to_Days( $warning_year, $warning_month, $warning_day ) )
236 #borrowercard expired, no issues
240 expired => format_date($borrower->{dateexpiry}),
241 renewaldate => format_date("$renew_year-$renew_month-$renew_day")
244 # check for NotifyBorrowerDeparture
245 elsif ( C4::Context->preference('NotifyBorrowerDeparture') &&
246 Date_to_Days(Add_Delta_Days($warning_year,$warning_month,$warning_day,- C4::Context->preference('NotifyBorrowerDeparture'))) <
247 Date_to_Days( $today_year, $today_month, $today_day ) )
249 # borrower card soon to expire warn librarian
250 $template->param("warndeparture" => format_date($borrower->{dateexpiry}),
252 if ( C4::Context->preference('ReturnBeforeExpiry')){
253 $template->param("returnbeforeexpiry" => 1);
258 issuecount => $issue,
268 # always check for blockers on issuing
269 my ( $error, $question ) =
270 CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
271 my $noerror = $invalidduedate ? 0 : 1;
273 delete $question->{'DEBT'} if ($debt_confirmed);
274 foreach my $impossible ( keys %$error ) {
275 if ($impossible eq "NOT_FOR_LOAN_CAN_FORCE"){
276 $$question{$impossible}=$$error{$impossible},
279 $impossible => $$error{$impossible},
286 if ($issueconfirmed && $noerror) {
287 # we have no blockers for issuing and any issues needing confirmation have been resolved
288 AddIssue( $borrower, $barcode, $datedue, $cancelreserve );
291 elsif ($issueconfirmed){ # FIXME: Do something? Or is this to *intentionally* do nothing?
292 if (C4::Context->preference("AllowNotForLoanOverride")){
293 AddIssue( $borrower, $barcode, $datedue, $cancelreserve );
294 $template->param(IMPOSSIBLE => 0);
300 # Get the item title for more information
301 my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode);
303 # only pass needsconfirmation to template if issuing is possible
304 foreach my $needsconfirmation ( keys %$question ) {
306 $needsconfirmation => $$question{$needsconfirmation},
307 getTitleMessageIteminfo => $getmessageiteminfo->{'title'},
308 NEEDSCONFIRMATION => 1
312 # Because of the weird conditional structure (empty elsif block),
313 # if we reached here, $issueconfirmed must be false.
314 # Also, since we moved inside the if ($noerror) conditional,
315 # this old chunky conditional can be simplified:
316 # if ( $noerror && ( $noquestion || $issueconfirmed ) ) {
318 AddIssue( $borrower, $barcode, $datedue );
323 itemhomebranch => $getmessageiteminfo->{'homebranch'} ,
324 duedatespec => $duedatespec,
328 # FIXME If the issue is confirmed, we launch another time borrdata2, now display the issue count after issue
329 my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
331 issuecount => $issue,
335 # reload the borrower info for the sake of reseting the flags.....
336 if ($borrowernumber) {
337 $borrower = GetMemberDetails( $borrowernumber, 0 );
340 ##################################################################################
342 # show all reserves of this borrower, and the position of the reservation ....
343 my $borrowercategory;
345 if ($borrowernumber) {
348 # now we show the status of the borrower's reservations
349 my @borrowerreserv = GetReservesFromBorrowernumber($borrowernumber );
351 my @WaitingReserveLoop;
353 foreach my $num_res (@borrowerreserv) {
355 my %getWaitingReserveInfo;
356 my $getiteminfo = GetBiblioFromItemNumber( $num_res->{'itemnumber'} );
357 my $itemtypeinfo = getitemtypeinfo( (C4::Context->preference('item-level_itypes')) ? $getiteminfo->{'itype'} : $getiteminfo->{'itemtype'} );
358 my ( $transfertwhen, $transfertfrom, $transfertto ) =
359 GetTransfers( $num_res->{'itemnumber'} );
361 $getreserv{waiting} = 0;
362 $getreserv{transfered} = 0;
363 $getreserv{nottransfered} = 0;
365 $getreserv{reservedate} = format_date( $num_res->{'reservedate'} );
366 $getreserv{title} = $getiteminfo->{'title'};
367 $getreserv{itemtype} = $itemtypeinfo->{'description'};
368 $getreserv{author} = $getiteminfo->{'author'};
369 $getreserv{barcodereserv} = $getiteminfo->{'barcode'};
370 $getreserv{itemcallnumber} = $getiteminfo->{'itemcallnumber'};
371 $getreserv{biblionumber} = $getiteminfo->{'biblionumber'};
372 $getreserv{waitingat} = GetBranchName( $num_res->{'branchcode'} );
373 # check if we have a waiting status for reservations
374 if ( $num_res->{'found'} eq 'W' ) {
375 $getreserv{color} = 'reserved';
376 $getreserv{waiting} = 1;
377 # genarate information displaying only waiting reserves
378 $getWaitingReserveInfo{title} = $getiteminfo->{'title'};
379 $getWaitingReserveInfo{biblionumber} = $getiteminfo->{'biblionumber'};
380 $getWaitingReserveInfo{itemtype} = $itemtypeinfo->{'description'};
381 $getWaitingReserveInfo{author} = $getiteminfo->{'author'};
382 $getWaitingReserveInfo{reservedate} = format_date( $num_res->{'reservedate'} );
383 $getWaitingReserveInfo{waitingat} = GetBranchName( $num_res->{'branchcode'} );
384 if($num_res->{'branchcode'} eq $branch){ $getWaitingReserveInfo{waitinghere} = 1; }
386 # check transfers with the itemnumber foud in th reservation loop
387 if ($transfertwhen) {
388 $getreserv{color} = 'transfered';
389 $getreserv{transfered} = 1;
390 $getreserv{datesent} = format_date($transfertwhen);
391 $getreserv{frombranch} = GetBranchName($transfertfrom);
394 if ( ( $getiteminfo->{'holdingbranch'} ne $num_res->{'branchcode'} )
395 and not $transfertwhen )
397 $getreserv{nottransfered} = 1;
398 $getreserv{nottransferedby} =
399 GetBranchName( $getiteminfo->{'holdingbranch'} );
402 # if we don't have a reserv on item, we put the biblio infos and the waiting position
403 if ( $getiteminfo->{'title'} eq '' ) {
404 my $getbibinfo = GetBiblioData( $num_res->{'biblionumber'} );
405 my $getbibtype = getitemtypeinfo( $getbibinfo->{'itemtype'} ); # fixme - we should have item-level reserves here ?
406 $getreserv{color} = 'inwait';
407 $getreserv{title} = $getbibinfo->{'title'};
408 $getreserv{nottransfered} = 0;
409 $getreserv{itemtype} = $getbibtype->{'description'};
410 $getreserv{author} = $getbibinfo->{'author'};
411 $getreserv{biblionumber} = $num_res->{'biblionumber'};
413 $getreserv{waitingposition} = $num_res->{'priority'};
414 push( @reservloop, \%getreserv );
416 # if we have a reserve waiting, initiate waitingreserveloop
417 if ($getreserv{waiting} eq 1) {
418 push (@WaitingReserveLoop, \%getWaitingReserveInfo)
423 # return result to the template
425 countreserv => scalar @reservloop,
426 reservloop => \@reservloop ,
427 WaitingReserveLoop => \@WaitingReserveLoop,
429 $template->param( adultborrower => 1 ) if ( $borrower->{'category_type'} eq 'A' );
432 # make the issued books table.
433 my $todaysissues = '';
438 ## ADDED BY JF: new itemtype issuingrules counter stuff
439 my $issued_itemtypes_loop;
440 my $issued_itemtypes_count;
441 my $issued_itemtypes_allowed_count; # hashref with total allowed by itemtype
442 my $issued_itemtypes_remaining; # hashref with remaining
443 my $issued_itemtypes_flags; #hashref that stores flags
444 my @issued_itemtypes_count_loop;
447 # get each issue of the borrower & separate them in todayissues & previous issues
448 my ($issueslist) = GetPendingIssues($borrower->{'borrowernumber'});
450 # split in 2 arrays for today & previous
451 foreach my $it ( @$issueslist ) {
452 # set itemtype per item-level_itype syspref - FIXME this is an ugly hack
453 $it->{'itemtype'} = ( C4::Context->preference( 'item-level_itypes' ) ) ? $it->{'itype'} : $it->{'itemtype'};
455 ($it->{'charge'}, $it->{'itemtype_charge'}) = GetIssuingCharges(
456 $it->{'itemnumber'}, $borrower->{'borrowernumber'}
458 $it->{'charge'} = sprintf("%.2f", $it->{'charge'});
459 my ($can_renew, $can_renew_error) = CanBookBeRenewed(
460 $borrower->{'borrowernumber'},$it->{'itemnumber'}
462 $it->{"renew_error_${can_renew_error}"} = 1 if defined $can_renew_error;
463 my ( $restype, $reserves ) = CheckReserves( $it->{'itemnumber'} );
464 $it->{'can_renew'} = $can_renew;
465 $it->{'can_confirm'} = !$can_renew && !$restype;
466 $it->{'renew_error'} = $restype;
468 $it->{'dd'} = format_date($it->{'date_due'});
469 $it->{'od'} = ( $it->{'date_due'} lt $todaysdate ) ? 1 : 0 ;
470 ($it->{'author'} eq '') and $it->{'author'} = ' ';
471 $it->{'renew_failed'} = $renew_failed[$it->{'itemnumber'}];
472 # ADDED BY JF: NEW ITEMTYPE COUNT DISPLAY
473 $issued_itemtypes_count->{ $it->{'itemtype'} }++;
475 if ( $todaysdate eq $it->{'issuedate'} or $todaysdate eq $it->{'lastreneweddate'} ) {
476 push @todaysissues, $it;
478 push @previousissues, $it;
481 if ( C4::Context->preference( "todaysIssuesDefaultSortOrder" ) eq 'asc' ) {
482 @todaysissues = sort { $a->{'timestamp'} cmp $b->{'timestamp'} } @todaysissues;
485 @todaysissues = sort { $b->{'timestamp'} cmp $a->{'timestamp'} } @todaysissues;
487 if ( C4::Context->preference( "previousIssuesDefaultSortOrder" ) eq 'asc' ){
488 @previousissues = sort { $a->{'date_due'} cmp $b->{'date_due'} } @previousissues;
491 @previousissues = sort { $b->{'date_due'} cmp $a->{'date_due'} } @previousissues;
495 #### ADDED BY JF FOR COUNTS BY ITEMTYPE RULES
496 # FIXME: This should utilize all the issuingrules options rather than just the defaults
497 # and it should be moved to a module
498 my $dbh = C4::Context->dbh;
500 # how many of each is allowed?
501 my $issueqty_sth = $dbh->prepare( "
502 SELECT itemtypes.description AS description,issuingrules.itemtype,maxissueqty
504 LEFT JOIN itemtypes ON (itemtypes.itemtype=issuingrules.itemtype)
507 #my @issued_itemtypes_count; # huh?
508 $issueqty_sth->execute("*"); # This is a literal asterisk, not a wildcard.
510 while ( my $data = $issueqty_sth->fetchrow_hashref() ) {
512 # subtract how many of each this borrower has
513 $data->{'count'} = $issued_itemtypes_count->{ $data->{'description'} };
515 ( $data->{'maxissueqty'} -
516 $issued_itemtypes_count->{ $data->{'description'} } );
518 # can't have a negative number of remaining
519 if ( $data->{'left'} < 0 ) { $data->{'left'} = "0" }
520 $data->{'flag'} = 1 unless ( $data->{'maxissueqty'} > $data->{'count'} );
521 unless ( ( $data->{'maxissueqty'} < 1 )
522 || ( $data->{'itemtype'} eq "*" )
523 || ( $data->{'itemtype'} eq "CIRC" ) )
525 push @issued_itemtypes_count_loop, $data;
528 $issued_itemtypes_loop = \@issued_itemtypes_count_loop;
534 my $CGIselectborrower;
535 if ($borrowerslist) {
537 sort {(lc $a->{'surname'} cmp lc $b->{'surname'} || lc $a->{'firstname'} cmp lc $b->{'firstname'})
541 push @values, $_->{'borrowernumber'};
542 $labels{ $_->{'borrowernumber'} } =
543 "$_->{'surname'}, $_->{'firstname'} ... ($_->{'cardnumber'} - $_->{'categorycode'}) ... $_->{'address'} ";
545 $CGIselectborrower = CGI::scrolling_list(
546 -name => 'borrowernumber',
548 -id => 'borrowernumber',
551 -onclick => "window.location = '/cgi-bin/koha/circ/circulation.pl?borrowernumber=' + this.value;",
559 my $flags = $borrower->{'flags'};
562 foreach $flag ( sort keys %$flags ) {
563 $template->param( flagged=> 1);
564 $flags->{$flag}->{'message'} =~ s#\n#<br />#g;
565 if ( $flags->{$flag}->{'noissues'} ) {
570 if ( $flag eq 'GNA' ) {
571 $template->param( gna => 'true' );
573 if ( $flag eq 'LOST' ) {
574 $template->param( lost => 'true' );
576 if ( $flag eq 'DBARRED' ) {
577 $template->param( dbarred => 'true' );
579 if ( $flag eq 'CHARGES' ) {
582 chargesmsg => $flags->{'CHARGES'}->{'message'},
583 chargesamount => $flags->{'CHARGES'}->{'amount'},
584 charges_is_blocker => 1
587 if ( $flag eq 'CREDITS' ) {
590 creditsmsg => $flags->{'CREDITS'}->{'message'}
595 if ( $flag eq 'CHARGES' ) {
599 chargesmsg => $flags->{'CHARGES'}->{'message'},
600 chargesamount => $flags->{'CHARGES'}->{'amount'},
603 if ( $flag eq 'CREDITS' ) {
606 creditsmsg => $flags->{'CREDITS'}->{'message'}
609 if ( $flag eq 'ODUES' ) {
613 oduesmsg => $flags->{'ODUES'}->{'message'}
616 my $items = $flags->{$flag}->{'itemlist'};
620 # foreach my $item (@$items) {
621 # my ($iteminformation) =
622 # getiteminformation( $item->{'itemnumber'}, 0 );
623 # push @itemswaiting, $iteminformation;
626 if ( $query->param('module') ne 'returns' ) {
627 $template->param( nonreturns => 'true' );
630 if ( $flag eq 'NOTES' ) {
634 notesmsg => $flags->{'NOTES'}->{'message'}
640 my $amountold = $borrower->{flags}->{'CHARGES'}->{'message'} || 0;
641 my @temp = split( /\$/, $amountold );
643 if ( $borrower->{'category_type'} eq 'C') {
644 my ( $catcodes, $labels ) = GetborCatFromCatType( 'A', 'WHERE category_type = ?' );
645 my $cnt = scalar(@$catcodes);
646 $template->param( 'CATCODE_MULTI' => 1) if $cnt > 1;
647 $template->param( 'catcode' => $catcodes->[0]) if $cnt == 1;
650 my $CGIorganisations;
651 my $member_of_institution;
652 if ( C4::Context->preference("memberofinstitution") ) {
653 my $organisations = get_institutions();
656 foreach my $organisation ( keys %$organisations ) {
657 push @orgs, $organisation;
658 $org_labels{$organisation} =
659 $organisations->{$organisation}->{'surname'};
661 $member_of_institution = 1;
662 $CGIorganisations = CGI::popup_menu(
663 -id => 'organisations',
664 -name => 'organisations',
665 -labels => \%org_labels,
670 $amountold = $temp[1];
673 issued_itemtypes_count_loop => $issued_itemtypes_loop,
674 findborrower => $findborrower,
675 borrower => $borrower,
676 borrowernumber => $borrowernumber,
678 branchname => GetBranchName($borrower->{'branchcode'}),
680 printername => $printer,
681 firstname => $borrower->{'firstname'},
682 surname => $borrower->{'surname'},
683 dateexpiry => format_date($newexpiry),
684 expiry => format_date($borrower->{'dateexpiry'}),
685 categorycode => $borrower->{'categorycode'},
686 categoryname => $borrower->{description},
687 address => $borrower->{'address'},
688 address2 => $borrower->{'address2'},
689 email => $borrower->{'email'},
690 emailpro => $borrower->{'emailpro'},
691 borrowernotes => $borrower->{'borrowernotes'},
692 city => $borrower->{'city'},
693 zipcode => $borrower->{'zipcode'},
694 phone => $borrower->{'phone'} || $borrower->{'mobile'},
695 cardnumber => $borrower->{'cardnumber'},
696 amountold => $amountold,
698 stickyduedate => $stickyduedate,
700 CGIselectborrower => $CGIselectborrower,
701 todayissues => \@todaysissues,
702 previssues => \@previousissues,
703 inprocess => $inprocess,
704 memberofinstution => $member_of_institution,
705 CGIorganisations => $CGIorganisations,
706 is_child => ($borrower->{'category_type'} eq 'C'),
710 # save stickyduedate to session
711 if ($stickyduedate) {
712 $session->param( 'stickyduedate', $duedatespec );
715 #if ($branchcookie) {
716 #$cookie=[$cookie, $branchcookie, $printercookie];
719 my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'});
720 $template->param( picture => 1 ) if $picture;
724 debt_confirmed => $debt_confirmed,
725 SpecifyDueDate => C4::Context->preference("SpecifyDueDate"),
726 CircAutocompl => C4::Context->preference("CircAutocompl"),
727 AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"),
728 dateformat => C4::Context->preference("dateformat"),
729 DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
731 output_html_with_http_headers $query, $cookie, $template->output;