Bug 17698: (follow-up) Changing to Koha Objects style, adding circ sidebar
[koha.git] / circ / returns.pl
1 #!/usr/bin/perl
2
3 # Copyright 2000-2002 Katipo Communications
4 #           2006 SAN-OP
5 #           2007-2010 BibLibre, Paul POULAIN
6 #           2010 Catalyst IT
7 #           2011 PTFS-Europe Ltd.
8 #
9 # This file is part of Koha.
10 #
11 # Koha is free software; you can redistribute it and/or modify it
12 # under the terms of the GNU General Public License as published by
13 # the Free Software Foundation; either version 3 of the License, or
14 # (at your option) any later version.
15 #
16 # Koha is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with Koha; if not, see <http://www.gnu.org/licenses>.
23
24 =head1 returns.pl
25
26 script to execute returns of books
27
28 =cut
29
30 use Modern::Perl;
31
32 # FIXME There are weird things going on with $patron and $borrowernumber in this script
33
34 use CGI qw ( -utf8 );
35 use DateTime;
36 use C4::Context;
37 use C4::Auth qw/:DEFAULT get_session/;
38 use C4::Output;
39 use C4::Circulation;
40 use C4::Print;
41 use C4::Reserves;
42 use C4::Biblio;
43 use C4::Items;
44 use C4::Members;
45 use C4::Members::Messaging;
46 use C4::Koha;   # FIXME : is it still useful ?
47 use C4::RotatingCollections;
48 use Koha::AuthorisedValues;
49 use Koha::DateUtils;
50 use Koha::Calendar;
51 use Koha::BiblioFrameworks;
52 use Koha::Holds;
53 use Koha::Items;
54 use Koha::Patrons;
55 use Koha::Checkouts;
56
57 my $query = new CGI;
58
59 #getting the template
60 my ( $template, $librarian, $cookie, $flags ) = get_template_and_user(
61     {
62         template_name   => "circ/returns.tt",
63         query           => $query,
64         type            => "intranet",
65         authnotrequired => 0,
66         flagsrequired   => { circulate => "circulate_remaining_permissions" },
67     }
68 );
69
70 my $sessionID = $query->cookie("CGISESSID");
71 my $session = get_session($sessionID);
72 if ($session->param('branch') eq 'NO_LIBRARY_SET'){
73     # no branch set we can't return
74     print $query->redirect("/cgi-bin/koha/circ/selectbranchprinter.pl");
75     exit;
76 }
77
78 # Print a reserve slip on this page
79 if ( $query->param('print_slip') ) {
80     $template->param(
81         print_slip     => 1,
82         borrowernumber => scalar $query->param('borrowernumber'), # FIXME We should send a Koha::Patron and raise an error if not exist.
83         biblionumber   => scalar $query->param('biblionumber'),
84         itemnumber     => scalar $query->param('itemnumber'),
85     );
86 }
87
88 #####################
89 #Global vars
90 my $printers = GetPrinters();
91 my $userenv = C4::Context->userenv;
92 my $userenv_branch = $userenv->{'branch'} // '';
93 my $printer = $userenv->{'branchprinter'} // '';
94 my $forgivemanualholdsexpire = $query->param('forgivemanualholdsexpire');
95
96 my $overduecharges = (C4::Context->preference('finesMode') && C4::Context->preference('finesMode') ne 'off');
97  #
98 # Some code to handle the error if there is no branch or printer setting.....
99 #
100
101 # Set up the item stack ....
102 my %returneditems;
103 my %riduedate;
104 my %riborrowernumber;
105 my @inputloop;
106 foreach ( $query->param ) {
107     my $counter;
108     if (/ri-(\d*)/) {
109         $counter = $1;
110         if ($counter > 20) {
111             next;
112         }
113     }
114     else {
115         next;
116     }
117
118     my %input;
119     my $barcode        = $query->param("ri-$counter");
120     my $duedate        = $query->param("dd-$counter");
121     my $borrowernumber = $query->param("bn-$counter");
122     $counter++;
123
124     # decode barcode    ## Didn't we already decode them before passing them back last time??
125     $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
126     $barcode = barcodedecode($barcode) if(C4::Context->preference('itemBarcodeInputFilter'));
127
128     ######################
129     #Are these lines still useful ?
130     $returneditems{$counter}    = $barcode;
131     $riduedate{$counter}        = $duedate;
132     $riborrowernumber{$counter} = $borrowernumber;
133
134     #######################
135     $input{counter}        = $counter;
136     $input{barcode}        = $barcode;
137     $input{duedate}        = $duedate;
138     $input{borrowernumber} = $borrowernumber;
139     push( @inputloop, \%input );
140 }
141
142 ############
143 # Deal with the requests....
144
145 if ($query->param('WT-itemNumber')){
146         updateWrongTransfer ($query->param('WT-itemNumber'),$query->param('WT-waitingAt'),$query->param('WT-From'));
147 }
148
149 if ( $query->param('reserve_id') ) {
150     my $itemnumber     = $query->param('itemnumber');
151     my $borrowernumber = $query->param('borrowernumber');
152     my $reserve_id     = $query->param('reserve_id');
153     my $diffBranchReturned = $query->param('diffBranch');
154     my $cancel_reserve = $query->param('cancel_reserve');
155     # fix up item type for display
156     my $item = Koha::Items->find( $itemnumber );
157     my $biblio = $item->biblio;
158
159     if ( $cancel_reserve ) {
160         my $hold = Koha::Holds->find( $reserve_id );
161         if ( $hold ) {
162             $hold->cancel( { charge_cancel_fee => !$forgivemanualholdsexpire } );
163         } # FIXME else?
164     } else {
165         my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef;
166         # diffBranchSend tells ModReserveAffect whether document is expected in this library or not,
167         # i.e., whether to apply waiting status
168         ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id );
169     }
170 #   check if we have other reserves for this document, if we have a return send the message of transfer
171     my ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber);
172
173     my $patron = Koha::Patrons->find( $nextreservinfo );
174     my $name   = $patron ? $patron->surname . ", " . $patron->title . " " . $patron->firstname : '';
175     if ( $messages->{'transfert'} ) {
176         $template->param(
177             itemtitle      => $biblio->title,
178             itemnumber     => $item->itemnumber,
179             itembiblionumber => $biblio->biblionumber,
180             iteminfo       => $biblio->author,
181             name           => $name,
182             patron         => $patron,
183             diffbranch     => 1,
184         );
185     }
186 }
187
188 my $borrower;
189 my $returned = 0;
190 my $messages;
191 my $issue;
192 my $itemnumber;
193 my $barcode     = $query->param('barcode');
194 my $exemptfine  = $query->param('exemptfine');
195 if (
196   $exemptfine &&
197   !C4::Auth::haspermission(C4::Context->userenv->{'id'}, {'updatecharges' => 'writeoff'})
198 ) {
199     # silently prevent unauthorized operator from forgiving overdue
200     # fines by manually tweaking form parameters
201     undef $exemptfine;
202 }
203 my $dropboxmode = $query->param('dropboxmode');
204 my $dotransfer  = $query->param('dotransfer');
205 my $canceltransfer = $query->param('canceltransfer');
206 my $dest = $query->param('dest');
207 my $calendar    = Koha::Calendar->new( branchcode => $userenv_branch );
208 #dropbox: get last open day (today - 1)
209 my $today       = DateTime->now( time_zone => C4::Context->tz());
210 my $dropboxdate = $calendar->addDate($today, -1);
211
212 my $return_date_override = $query->param('return_date_override');
213 my $return_date_override_remember =
214   $query->param('return_date_override_remember');
215 if ($return_date_override) {
216     if ( C4::Context->preference('SpecifyReturnDate') ) {
217         my $return_date_override_dt = eval {dt_from_string( $return_date_override ) };
218         if ( $return_date_override_dt ) {
219             # note that we've overriden the return date
220             $template->param( return_date_was_overriden => 1);
221             # Save the original format if we are remembering for this series
222             $template->param(
223                 return_date_override          => $return_date_override,
224                 return_date_override_remember => 1
225             ) if ($return_date_override_remember);
226
227             $return_date_override =
228               DateTime::Format::MySQL->format_datetime( $return_date_override_dt );
229         }
230     }
231     else {
232         $return_date_override = q{};
233     }
234 }
235
236 if ($dotransfer){
237 # An item has been returned to a branch other than the homebranch, and the librarian has chosen to initiate a transfer
238     my $transferitem = $query->param('transferitem');
239     my $tobranch     = $query->param('tobranch');
240     ModItemTransfer($transferitem, $userenv_branch, $tobranch);
241 }
242
243 if ($canceltransfer){
244     $itemnumber=$query->param('itemnumber');
245     DeleteTransfer($itemnumber);
246     if($dest eq "ttr"){
247         print $query->redirect("/cgi-bin/koha/circ/transferstoreceive.pl");
248         exit;
249     } else {
250         $template->param( transfercancelled => 1);
251     }
252 }
253
254 # actually return book and prepare item table.....
255 my $returnbranch;
256 if ($barcode) {
257     $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
258     $barcode = barcodedecode($barcode) if C4::Context->preference('itemBarcodeInputFilter');
259     my $item = Koha::Items->find({ barcode => $barcode });
260
261     if ( $item ) {
262         $itemnumber = $item->itemnumber;
263         # Check if we should display a checkin message, based on the the item
264         # type of the checked in item
265         my $itemtype = Koha::ItemTypes->find( $item->effective_itemtype );
266         if ( $itemtype && $itemtype->checkinmsg ) {
267             $template->param(
268                 checkinmsg     => $itemtype->checkinmsg,
269                 checkinmsgtype => $itemtype->checkinmsgtype,
270             );
271         }
272
273         # make sure return branch respects home branch circulation rules, default to homebranch
274         my $hbr = GetBranchItemRule($item->homebranch, $itemtype ? $itemtype->itemtype : undef )->{'returnbranch'} || "homebranch";
275         $returnbranch = $hbr ne 'noreturn' ? $item->$hbr : $userenv_branch; # can be noreturn, homebranch or holdingbranch
276
277         my $materials = $item->materials;
278         my $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({frameworkcode => '', kohafield =>'items.materials', authorised_value => $materials });
279         $materials = $descriptions->{lib} // $materials;
280
281         my $checkout = $item->checkout;
282         my $biblio   = $item->biblio;
283         $template->param(
284             title            => $biblio->title,
285             homebranch       => $item->homebranch,
286             holdingbranch    => $item->holdingbranch,
287             returnbranch     => $returnbranch,
288             author           => $biblio->author,
289             itembarcode      => $item->barcode,
290             itemtype         => $item->effective_itemtype,
291             ccode            => $item->ccode,
292             itembiblionumber => $biblio->biblionumber,
293             biblionumber     => $biblio->biblionumber,
294             additional_materials => $materials,
295             issue            => $checkout,
296         );
297     } # FIXME else we should not call AddReturn but set BadBarcode directly instead
298
299     my %input = (
300         counter => 0,
301         first   => 1,
302         barcode => $barcode,
303     );
304
305
306     # do the return
307     ( $returned, $messages, $issue, $borrower ) =
308       AddReturn( $barcode, $userenv_branch, $exemptfine, $dropboxmode, $return_date_override, $dropboxdate );
309
310     if ($returned) {
311         my $time_now = DateTime->now( time_zone => C4::Context->tz )->truncate( to => 'minute');
312         my $date_due_dt = dt_from_string( $issue->date_due, 'sql' );
313         my $duedate = $date_due_dt->strftime('%Y-%m-%d %H:%M');
314         $returneditems{0}      = $barcode;
315         $riborrowernumber{0}   = $borrower->{'borrowernumber'};
316         $riduedate{0}          = $duedate;
317         $input{borrowernumber} = $borrower->{'borrowernumber'};
318         $input{duedate}        = $duedate;
319         unless ( $dropboxmode ) {
320             $input{return_overdue} = 1 if (DateTime->compare($date_due_dt, DateTime->now()) == -1);
321         } else {
322             $input{return_overdue} = 1 if (DateTime->compare($date_due_dt, $dropboxdate) == -1);
323         }
324         push( @inputloop, \%input );
325
326         if ( C4::Context->preference("FineNotifyAtCheckin") ) {
327             my $patron = Koha::Patrons->find( $borrower->{borrowernumber} );
328             my $balance = $patron->account->balance;
329
330             if ($balance > 0) {
331                 $template->param( fines => sprintf("%.2f", $balance) );
332                 $template->param( fineborrowernumber => $borrower->{'borrowernumber'} );
333             }
334         }
335
336         if (C4::Context->preference("WaitingNotifyAtCheckin") ) {
337             #Check for waiting holds
338             my $patron = Koha::Patrons->find( $borrower->{borrowernumber} );
339             my $waiting_holds = $patron->holds->search({ found => 'W', branchcode => $userenv_branch })->count;
340             if ($waiting_holds > 0) {
341                 $template->param(
342                     waiting_holds       => $waiting_holds,
343                     holdsborrowernumber => $borrower->{'borrowernumber'},
344                     holdsfirstname => $borrower->{'firstname'},
345                     holdssurname => $borrower->{'surname'},
346                 );
347             }
348         }
349     } elsif ( C4::Context->preference('ShowAllCheckins') and !$messages->{'BadBarcode'} ) {
350         $input{duedate}   = 0;
351         $returneditems{0} = $barcode;
352         $riduedate{0}     = 0;
353         push( @inputloop, \%input );
354     }
355     $template->param( privacy => $borrower->{privacy} );
356 }
357 $template->param( inputloop => \@inputloop );
358
359 my $found    = 0;
360 my $waiting  = 0;
361 my $reserved = 0;
362
363 # new op dev : we check if the document must be returned to his homebranch directly,
364 #  if the document is transfered, we have warning message .
365
366 if ( $messages->{'WasTransfered'} ) {
367     $template->param(
368         found          => 1,
369         transfer       => 1,
370         itemnumber     => $itemnumber,
371     );
372 }
373
374 if ( $messages->{'NeedsTransfer'} ){
375     $template->param(
376         found          => 1,
377         needstransfer  => $messages->{'NeedsTransfer'},
378         itemnumber     => $itemnumber,
379     );
380 }
381
382 if ( $messages->{'Wrongbranch'} ){
383     $template->param(
384         wrongbranch => 1,
385         rightbranch => $messages->{'Wrongbranch'}->{'Rightbranch'},
386     );
387 }
388
389 # case of wrong transfert, if the document wasn't transfered to the right library (according to branchtransfer (tobranch) BDD)
390
391 if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) {
392     $template->param(
393         WrongTransfer  => 1,
394         TransferWaitingAt => $messages->{'WrongTransfer'},
395         WrongTransferItem => $messages->{'WrongTransferItem'},
396         itemnumber => $itemnumber,
397     );
398
399     my $reserve    = $messages->{'ResFound'};
400     if ( $reserve ) {
401         my $patron = Koha::Patrons->find( $reserve->{'borrowernumber'} );
402         my $name = $patron->surname . ", " . $patron->title . " " . $patron->firstname;
403         $template->param(
404             patron => $patron,
405         );
406     }
407     $template->param(
408         wtransfertFrom  => $userenv_branch,
409     );
410 }
411
412 #
413 # reserve found and item arrived at the expected branch
414 #
415 if ( $messages->{'ResFound'}) {
416     my $reserve    = $messages->{'ResFound'};
417     my $patron = Koha::Patrons->find( $reserve->{borrowernumber} );
418     my $holdmsgpreferences =  C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $reserve->{'borrowernumber'}, message_name   => 'Hold_Filled' } );
419     if ( $reserve->{'ResFound'} eq "Waiting" or $reserve->{'ResFound'} eq "Reserved" ) {
420         if ( $reserve->{'ResFound'} eq "Waiting" ) {
421             $template->param(
422                 waiting      => ($userenv_branch eq $reserve->{'branchcode'} ? 1 : 0 ),
423             );
424         } elsif ( $reserve->{'ResFound'} eq "Reserved" ) {
425             $template->param(
426                 intransit    => ($userenv_branch eq $reserve->{'branchcode'} ? 0 : 1 ),
427                 transfertodo => ($userenv_branch eq $reserve->{'branchcode'} ? 0 : 1 ),
428                 reserve_id   => $reserve->{reserve_id},
429                 reserved     => 1,
430             );
431         }
432
433         # same params for Waiting or Reserved
434         $template->param(
435             # FIXME The full patron object should be passed to the template
436             found          => 1,
437             patron         => $patron,
438             barcode        => $barcode,
439             destbranch     => $reserve->{'branchcode'},
440             itemnumber     => $reserve->{'itemnumber'},
441             reservenotes   => $reserve->{'reservenotes'},
442             reserve_id     => $reserve->{reserve_id},
443             bormessagepref => $holdmsgpreferences->{'transports'},
444         );
445     } # else { ; }  # error?
446 }
447
448 # Error Messages
449 my @errmsgloop;
450 foreach my $code ( keys %$messages ) {
451     my %err;
452     my $exit_required_p = 0;
453     if ( $code eq 'BadBarcode' ) {
454         $err{badbarcode} = 1;
455         $err{msg}        = $messages->{'BadBarcode'};
456     }
457     elsif ( $code eq 'NotIssued' ) {
458         $err{notissued} = 1;
459         $err{msg} = '';
460     }
461     elsif ( $code eq 'LocalUse' ) {
462         $err{localuse} = 1;
463     }
464     elsif ( $code eq 'WasLost' ) {
465         $err{waslost} = 1;
466         $exit_required_p = 1 if C4::Context->preference("BlockReturnOfLostItems");
467     }
468     elsif ( $code eq 'LostItemFeeRefunded' ) {
469         $template->param( LostItemFeeRefunded => 1 );
470     }
471     elsif ( $code eq 'ResFound' ) {
472         ;    # FIXME... anything to do here?
473     }
474     elsif ( $code eq 'WasReturned' ) {
475         ;    # FIXME... anything to do here?
476     }
477     elsif ( $code eq 'WasTransfered' ) {
478         ;    # FIXME... anything to do here?
479     }
480     elsif ( $code eq 'withdrawn' ) {
481         $err{withdrawn} = 1;
482         $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
483     }
484     elsif ( $code eq 'WrongTransfer' ) {
485         ;    # FIXME... anything to do here?
486     }
487     elsif ( $code eq 'WrongTransferItem' ) {
488         ;    # FIXME... anything to do here?
489     }
490     elsif ( $code eq 'NeedsTransfer' ) {
491     }
492     elsif ( $code eq 'Wrongbranch' ) {
493     }
494     elsif ( $code eq 'Debarred' ) {
495         $err{debarred}            = $messages->{'Debarred'};
496         $err{debarcardnumber}     = $borrower->{cardnumber};
497         $err{debarborrowernumber} = $borrower->{borrowernumber};
498         $err{debarname}           = "$borrower->{firstname} $borrower->{surname}";
499     }
500     elsif ( $code eq 'PrevDebarred' ) {
501         $err{prevdebarred}        = $messages->{'PrevDebarred'};
502     }
503     elsif ( $code eq 'ForeverDebarred' ) {
504         $err{foreverdebarred}        = $messages->{'ForeverDebarred'};
505     }
506     elsif ( $code eq 'NotForLoanStatusUpdated' ) {
507         $err{NotForLoanStatusUpdated} = $messages->{NotForLoanStatusUpdated};
508     }
509     elsif ( $code eq 'DataCorrupted' ) {
510         $err{data_corrupted} = 1;
511     }
512     else {
513         die "Unknown error code $code";    # note we need all the (empty) elsif's above, or we die.
514         # This forces the issue of staying in sync w/ Circulation.pm
515     }
516     if (%err) {
517         push( @errmsgloop, \%err );
518     }
519     last if $exit_required_p;
520 }
521 $template->param( errmsgloop => \@errmsgloop );
522
523 #set up so only the last 8 returned items display (make for faster loading pages)
524 my $returned_counter = ( C4::Context->preference('numReturnedItemsToShow') ) ? C4::Context->preference('numReturnedItemsToShow') : 8;
525 my $count = 0;
526 my @riloop;
527 my $shelflocations =
528   { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' } ) };
529 foreach ( sort { $a <=> $b } keys %returneditems ) {
530     my %ri;
531     if ( $count++ < $returned_counter ) {
532         my $bar_code = $returneditems{$_};
533         if ($riduedate{$_}) {
534             my $duedate = dt_from_string( $riduedate{$_}, 'sql');
535             $ri{year}  = $duedate->year();
536             $ri{month} = $duedate->month();
537             $ri{day}   = $duedate->day();
538             $ri{hour}   = $duedate->hour();
539             $ri{minute}   = $duedate->minute();
540             $ri{duedate} = output_pref($duedate);
541             my $patron = Koha::Patrons->find( $riborrowernumber{$_} );
542             unless ( $dropboxmode ) {
543                 $ri{return_overdue} = 1 if (DateTime->compare($duedate, DateTime->now()) == -1);
544             } else {
545                 $ri{return_overdue} = 1 if (DateTime->compare($duedate, $dropboxdate) == -1);
546             }
547             $ri{patron} = $patron,
548             $ri{borissuescount} = $patron->checkouts->count;
549         }
550         else {
551             $ri{borrowernumber} = $riborrowernumber{$_};
552         }
553
554         my $item = Koha::Items->find({ barcode => $bar_code });
555         my $biblio = $item->biblio;
556         # FIXME pass $item to the template and we are done here...
557         $ri{itembiblionumber}    = $biblio->biblionumber;
558         $ri{itemtitle}           = $biblio->title;
559         $ri{itemauthor}          = $biblio->author;
560         $ri{itemcallnumber}      = $item->itemcallnumber;
561         $ri{dateaccessioned}     = $item->dateaccessioned;
562         $ri{itemtype}            = $item->effective_itemtype;
563         $ri{itemnote}            = $item->itemnotes;
564         $ri{itemnotes_nonpublic} = $item->itemnotes_nonpublic;
565         $ri{ccode}               = $item->ccode;
566         $ri{enumchron}           = $item->enumchron;
567         $ri{itemnumber}          = $item->itemnumber;
568         $ri{barcode}             = $bar_code;
569         $ri{homebranch}          = $item->homebranch;
570         $ri{holdingbranch}       = $item->holdingbranch;
571
572         $ri{location} = $item->location;
573         my $shelfcode = $ri{'location'};
574         $ri{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
575
576     }
577     else {
578         last;
579     }
580     push @riloop, \%ri;
581 }
582
583 my $pending_checkout_notes = Koha::Checkouts->search({ noteseen => 0 })->count;
584
585 $template->param(
586     riloop         => \@riloop,
587     printer        => $printer,
588     errmsgloop     => \@errmsgloop,
589     exemptfine     => $exemptfine,
590     dropboxmode    => $dropboxmode,
591     dropboxdate    => output_pref($dropboxdate),
592     forgivemanualholdsexpire => $forgivemanualholdsexpire,
593     overduecharges => $overduecharges,
594     AudioAlerts        => C4::Context->preference("AudioAlerts"),
595     pending_checkout_notes => $pending_checkout_notes,
596 );
597
598 $itemnumber = GetItemnumberFromBarcode( $barcode );
599 if ( $itemnumber ) {
600     my ( $holdingBranch, $collectionBranch ) = GetCollectionItemBranches( $itemnumber );
601     if ( $holdingBranch and $collectionBranch ) {
602         $holdingBranch //= '';
603         $collectionBranch //= $returnbranch;
604         if ( ! ( $holdingBranch eq $collectionBranch ) ) {
605             $template->param(
606               collectionItemNeedsTransferred => 1,
607               collectionBranch => $collectionBranch,
608               itemnumber => $itemnumber,
609             );
610         }
611     }
612 }
613
614 # Checking if there is a Fast Cataloging Framework
615 $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
616
617 # actually print the page!
618 output_html_with_http_headers $query, $cookie, $template->output;