Bug 23591: Display a new "Suggestion detail" tab on the bib detail page
[koha.git] / catalogue / detail.pl
1 #!/usr/bin/perl
2
3 # This file is part of Koha.
4 #
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
19 use Modern::Perl;
20
21 use CGI qw ( -utf8 );
22 use HTML::Entities;
23 use Try::Tiny;
24 use C4::Auth;
25 use C4::Context;
26 use C4::Koha;
27 use C4::Serials;    #uses getsubscriptionfrom biblionumber
28 use C4::Output;
29 use C4::Biblio;
30 use C4::Items;
31 use C4::Circulation;
32 use C4::Reserves;
33 use C4::Serials;
34 use C4::XISBN qw(get_xisbns);
35 use C4::External::Amazon;
36 use C4::Search;        # enabled_staff_search_views
37 use C4::Tags qw(get_tags);
38 use C4::XSLT;
39 use C4::Images;
40 use Koha::DateUtils;
41 use C4::HTML5Media;
42 use C4::CourseReserves qw(GetItemCourseReservesInfo);
43 use C4::Acquisition qw(GetOrdersByBiblionumber);
44 use Koha::AuthorisedValues;
45 use Koha::Biblios;
46 use Koha::Items;
47 use Koha::ItemTypes;
48 use Koha::Patrons;
49 use Koha::Virtualshelves;
50 use Koha::Plugins;
51
52 my $query = CGI->new();
53
54 my $analyze = $query->param('analyze');
55
56 my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
57     {
58     template_name   =>  'catalogue/detail.tt',
59         query           => $query,
60         type            => "intranet",
61         authnotrequired => 0,
62         flagsrequired   => { catalogue => 1 },
63     }
64 );
65
66 # Determine if we should be offering any enhancement plugin buttons
67 if ( C4::Context->config('enable_plugins') ) {
68     # Only pass plugins that can offer a toolbar button
69     my @plugins = Koha::Plugins->new()->GetPlugins({
70         method => 'intranet_catalog_biblio_enhancements_toolbar_button'
71     });
72
73     my @tab_plugins = Koha::Plugins->new()->GetPlugins({
74         method => 'intranet_catalog_biblio_tab',
75     });
76     my @tabs;
77     foreach my $tab_plugin (@tab_plugins) {
78         my @biblio_tabs;
79
80         try {
81             @biblio_tabs = $tab_plugin->intranet_catalog_biblio_tab();
82             foreach my $tab (@biblio_tabs) {
83                 my $tab_id = 'tab-' . $tab->title;
84                 $tab_id =~ s/[^0-9A-Za-z]+/-/g;
85                 $tab->id( $tab_id );
86                 push @tabs, $tab,
87             }
88         }
89         catch {
90             warn "Error calling 'intranet_catalog_biblio_tab' on the " . $tab_plugin->{class} . "plugin ($_)";
91         };
92     }
93
94     $template->param(
95         plugins => \@plugins,
96         tabs => \@tabs,
97     );
98 }
99
100 my $biblionumber = $query->param('biblionumber');
101 $biblionumber = HTML::Entities::encode($biblionumber);
102 my $record       = GetMarcBiblio({ biblionumber => $biblionumber });
103 my $biblio = Koha::Biblios->find( $biblionumber );
104 $template->param( 'biblio', $biblio );
105
106 if ( not defined $record ) {
107     # biblionumber invalid -> report and exit
108     $template->param( unknownbiblionumber => 1,
109                       biblionumber => $biblionumber );
110     output_html_with_http_headers $query, $cookie, $template->output;
111     exit;
112 }
113
114 eval { $biblio->metadata->record };
115 $template->param( decoding_error => $@ );
116
117 if($query->cookie("holdfor")){ 
118     my $holdfor_patron = Koha::Patrons->find( $query->cookie("holdfor") );
119     $template->param(
120         # FIXME Should pass the patron object
121         holdfor => $query->cookie("holdfor"),
122         holdfor_surname => $holdfor_patron->surname,
123         holdfor_firstname => $holdfor_patron->firstname,
124         holdfor_cardnumber => $holdfor_patron->cardnumber,
125     );
126 }
127
128 if($query->cookie("searchToOrder")){
129     my ( $basketno, $vendorid ) = split( /\//, $query->cookie("searchToOrder") );
130     $template->param(
131         searchtoorder_basketno => $basketno,
132         searchtoorder_vendorid => $vendorid
133     );
134 }
135
136 my $fw           = GetFrameworkCode($biblionumber);
137 my $showallitems = $query->param('showallitems');
138 my $marcflavour  = C4::Context->preference("marcflavour");
139
140 # XSLT processing of some stuff
141 my $xslfile = C4::Context->preference('XSLTDetailsDisplay') || "default";
142 my $lang   = $xslfile ? C4::Languages::getlanguage()  : undef;
143 my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef;
144
145 if ( $xslfile ) {
146     $template->param(
147         XSLTDetailsDisplay => '1',
148         XSLTBloc => XSLTParse4Display(
149                         $biblionumber, $record, "XSLTDetailsDisplay",
150                         1, undef, $sysxml, $xslfile, $lang
151                     )
152     );
153 }
154
155 $template->param( 'SpineLabelShowPrintOnBibDetails' => C4::Context->preference("SpineLabelShowPrintOnBibDetails") );
156
157 # Catch the exception as Koha::Biblio::Metadata->record can explode if the MARCXML is invalid
158 # Do not propagate it as we already deal with it previously in this script
159 my $coins = eval { $biblio->get_coins };
160 $template->param( ocoins => $coins );
161
162 # some useful variables for enhanced content;
163 # in each case, we're grabbing the first value we find in
164 # the record and normalizing it
165 my $upc = GetNormalizedUPC($record,$marcflavour);
166 my $ean = GetNormalizedEAN($record,$marcflavour);
167 my $oclc = GetNormalizedOCLCNumber($record,$marcflavour);
168 my $isbn = GetNormalizedISBN(undef,$record,$marcflavour);
169
170 $template->param(
171     normalized_upc => $upc,
172     normalized_ean => $ean,
173     normalized_oclc => $oclc,
174     normalized_isbn => $isbn,
175 );
176
177 my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
178 my $marcisbnsarray   = GetMarcISBN( $record, $marcflavour );
179 my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
180 my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
181 my $marcseriesarray  = GetMarcSeries($record,$marcflavour);
182 my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
183 my $marchostsarray   = GetMarcHosts($record,$marcflavour);
184
185 my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search->unblessed } };
186
187 my $dbh = C4::Context->dbh;
188
189 my @all_items = GetItemsInfo( $biblionumber );
190 my @items;
191 my $patron = Koha::Patrons->find( $borrowernumber );
192 for my $itm (@all_items) {
193     push @items, $itm unless ( $itm->{itemlost} && $patron->category->hidelostitems && !$showallitems);
194 }
195
196 # flag indicating existence of at least one item linked via a host record
197 my $hostrecords;
198 # adding items linked via host biblios
199 my @hostitems = GetHostItemsInfo($record);
200 if (@hostitems){
201     $hostrecords =1;
202     push (@items,@hostitems);
203 }
204
205 my $dat = &GetBiblioData($biblionumber);
206
207 #coping with subscriptions
208 my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
209 my @subscriptions       = SearchSubscriptions({ biblionumber => $biblionumber, orderby => 'title' });
210 my @subs;
211
212 foreach my $subscription (@subscriptions) {
213     my %cell;
214     my $serials_to_display;
215     $cell{subscriptionid}    = $subscription->{subscriptionid};
216     $cell{subscriptionnotes} = $subscription->{internalnotes};
217     $cell{missinglist}       = $subscription->{missinglist};
218     $cell{librariannote}     = $subscription->{librariannote};
219     $cell{branchcode}        = $subscription->{branchcode};
220     $cell{hasalert}          = $subscription->{hasalert};
221     $cell{callnumber}        = $subscription->{callnumber};
222     $cell{location}          = $subscription->{location};
223     $cell{closed}            = $subscription->{closed};
224     #get the three latest serials.
225     $serials_to_display = $subscription->{staffdisplaycount};
226     $serials_to_display = C4::Context->preference('StaffSerialIssueDisplayCount') unless $serials_to_display;
227     $cell{staffdisplaycount} = $serials_to_display;
228     $cell{latestserials} =
229       GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
230     push @subs, \%cell;
231 }
232
233
234 # Get acquisition details
235 if ( C4::Context->preference('AcquisitionDetails') ) {
236     my $orders = Koha::Acquisition::Orders->search(
237         { biblionumber => $biblionumber },
238         {
239             join => 'basketno',
240             order_by => 'basketno.booksellerid'
241         }
242     );    # GetHistory sorted by aqbooksellerid, but does it make sense?
243
244     $template->param(
245         orders => $orders,
246     );
247 }
248
249 if ( C4::Context->preference('suggestion') ) {
250     my $suggestions = Koha::Suggestions->search(
251         {
252             biblionumber => $biblionumber,
253         },
254         {
255             order_by => { -desc => 'suggesteddate' }
256         }
257     );
258     $template->param( suggestions => $suggestions );
259 }
260
261 if ( defined $dat->{'itemtype'} ) {
262     $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }{imageurl} );
263 }
264
265 $dat->{'count'} = scalar @all_items + @hostitems;
266 $dat->{'showncount'} = scalar @items + @hostitems;
267 $dat->{'hiddencount'} = scalar @all_items + @hostitems - scalar @items;
268
269 my $shelflocations =
270   { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $fw, kohafield => 'items.location' } ) };
271 my $collections =
272   { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $fw, kohafield => 'items.ccode' } ) };
273 my $copynumbers =
274   { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $fw, kohafield => 'items.copynumber' } ) };
275 my (@itemloop, @otheritemloop, %itemfields);
276 my $norequests = 1;
277
278 my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
279 if ( $mss->count ) {
280     $template->param( itemlostloop => GetAuthorisedValues( $mss->next->authorised_value ) );
281 }
282 $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.damaged', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
283 if ( $mss->count ) {
284     $template->param( itemdamagedloop => GetAuthorisedValues( $mss->next->authorised_value ) );
285 }
286 $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.withdrawn', authorised_value => { not => undef } });
287 if ( $mss->count ) {
288     $template->param( itemwithdrawnloop => GetAuthorisedValues( $mss->next->authorised_value) );
289 }
290
291 $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.materials', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
292 my %materials_map;
293 if ($mss->count) {
294     my $materials_authvals = GetAuthorisedValues($mss->next->authorised_value);
295     if ($materials_authvals) {
296         foreach my $value (@$materials_authvals) {
297             $materials_map{$value->{authorised_value}} = $value->{lib};
298         }
299     }
300 }
301
302 my $analytics_flag;
303 my $materials_flag; # set this if the items have anything in the materials field
304 my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef;
305 if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
306     $template->param(SeparateHoldings => 1);
307 }
308 my $separatebranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch';
309 foreach my $item (@items) {
310     my $itembranchcode = $item->{$separatebranch};
311
312     # can place holds defaults to yes
313     $norequests = 0 unless ( ( $item->{'notforloan'} > 0 ) || ( $item->{'itemnotforloan'} > 0 ) );
314
315     $item->{imageurl} = defined $item->{itype} ? getitemtypeimagelocation('intranet', $itemtypes->{ $item->{itype} }{imageurl})
316                                                : '';
317
318     $item->{datedue} = format_sqldatetime($item->{datedue});
319
320     #get shelf location and collection code description if they are authorised value.
321     # same thing for copy number
322     my $shelfcode = $item->{'location'};
323     $item->{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
324     my $ccode = $item->{'ccode'};
325     $item->{'ccode'} = $collections->{$ccode} if ( defined( $ccode ) && defined($collections) && exists( $collections->{$ccode} ) );
326     my $copynumber = $item->{'copynumber'};
327     $item->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumber) && defined($copynumbers) && exists( $copynumbers->{$copynumber} ) );
328     foreach (qw(ccode enumchron copynumber stocknumber itemnotes itemnotes_nonpublic uri publisheddate)) { # Warning when removing GetItemsInfo - publisheddate (at least) is not part of the items table
329         $itemfields{$_} = 1 if ( $item->{$_} );
330     }
331
332     # checking for holds
333     my $item_object = Koha::Items->find( $item->{itemnumber} );
334     my $holds = $item_object->current_holds;
335     if ( my $first_hold = $holds->next ) {
336         $item->{first_hold} = $first_hold;
337     }
338
339     if ( my $checkout = $item_object->checkout ) {
340         $item->{CheckedOutFor} = $checkout->patron;
341     }
342
343     # Check the transit status
344     my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber});
345     if ( defined( $transfertwhen ) && ( $transfertwhen ne '' ) ) {
346         $item->{transfertwhen} = $transfertwhen;
347         $item->{transfertfrom} = $transfertfrom;
348         $item->{transfertto}   = $transfertto;
349         $item->{nocancel} = 1;
350     }
351
352     foreach my $f (qw( itemnotes )) {
353         if ($item->{$f}) {
354             $item->{$f} =~ s|\n|<br />|g;
355             $itemfields{$f} = 1;
356         }
357     }
358
359     #item has a host number if its biblio number does not match the current bib
360
361     if ($item->{biblionumber} ne $biblionumber){
362         $item->{hostbiblionumber} = $item->{biblionumber};
363         $item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
364     }
365         
366
367     if ( $analyze ) {
368         # count if item is used in analytical bibliorecords
369         # The 'countanalytics' flag is only used in the templates if analyze is set
370         my $countanalytics = C4::Context->preference('EasyAnalyticalRecords') ? GetAnalyticsCount($item->{itemnumber}) : 0;
371         if ($countanalytics > 0){
372             $analytics_flag=1;
373             $item->{countanalytics} = $countanalytics;
374         }
375     }
376
377     if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
378         $materials_flag = 1;
379         if (defined $materials_map{ $item->{materials} }) {
380             $item->{materials} = $materials_map{ $item->{materials} };
381         }
382     }
383
384     if ( C4::Context->preference('UseCourseReserves') ) {
385         $item->{'course_reserves'} = GetItemCourseReservesInfo( itemnumber => $item->{'itemnumber'} );
386     }
387
388     if ( C4::Context->preference('IndependentBranches') ) {
389         my $userenv = C4::Context->userenv();
390         if ( not C4::Context->IsSuperLibrarian()
391             and $userenv->{branch} ne $item->{homebranch} ) {
392             $item->{cannot_be_edited} = 1;
393         }
394     }
395
396     if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
397         if ($itembranchcode and $itembranchcode eq $currentbranch) {
398             push @itemloop, $item;
399         } else {
400             push @otheritemloop, $item;
401         }
402     } else {
403         push @itemloop, $item;
404     }
405 }
406
407 # Display only one tab if one items list is empty
408 if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) {
409     $template->param(SeparateHoldings => 0);
410     if (scalar(@itemloop) == 0) {
411         @itemloop = @otheritemloop;
412     }
413 }
414
415 $template->param( norequests => $norequests );
416 $template->param(
417     MARCNOTES   => $marcnotesarray,
418     MARCSUBJCTS => $marcsubjctsarray,
419     MARCAUTHORS => $marcauthorsarray,
420     MARCSERIES  => $marcseriesarray,
421     MARCURLS => $marcurlsarray,
422     MARCISBNS => $marcisbnsarray,
423     MARCHOSTS => $marchostsarray,
424     itemdata_ccode      => $itemfields{ccode},
425     itemdata_enumchron  => $itemfields{enumchron},
426     itemdata_uri        => $itemfields{uri},
427     itemdata_copynumber => $itemfields{copynumber},
428     itemdata_stocknumber => $itemfields{stocknumber},
429     itemdata_publisheddate => $itemfields{publisheddate},
430     volinfo                => $itemfields{enumchron},
431         itemdata_itemnotes  => $itemfields{itemnotes},
432         itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic},
433     z3950_search_params    => C4::Search::z3950_search_args($dat),
434         hostrecords         => $hostrecords,
435     analytics_flag    => $analytics_flag,
436     C4::Search::enabled_staff_search_views,
437         materials       => $materials_flag,
438 );
439
440 if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
441     my $fieldspec = C4::Context->preference("AlternateHoldingsField");
442     my $subfields = substr $fieldspec, 3;
443     my $holdingsep = C4::Context->preference("AlternateHoldingsSeparator") || ' ';
444     my @alternateholdingsinfo = ();
445     my @holdingsfields = $record->field(substr $fieldspec, 0, 3);
446
447     for my $field (@holdingsfields) {
448         my %holding = ( holding => '' );
449         my $havesubfield = 0;
450         for my $subfield ($field->subfields()) {
451             if ((index $subfields, $$subfield[0]) >= 0) {
452                 $holding{'holding'} .= $holdingsep if (length $holding{'holding'} > 0);
453                 $holding{'holding'} .= $$subfield[1];
454                 $havesubfield++;
455             }
456         }
457         if ($havesubfield) {
458             push(@alternateholdingsinfo, \%holding);
459         }
460     }
461
462     $template->param(
463         ALTERNATEHOLDINGS   => \@alternateholdingsinfo,
464         );
465 }
466
467 my @results = ( $dat, );
468 foreach ( keys %{$dat} ) {
469     $template->param( "$_" => defined $dat->{$_} ? $dat->{$_} : '' );
470 }
471
472 # does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
473 # method query not found?!?!
474 $template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
475 $template->param(
476     itemloop        => \@itemloop,
477     otheritemloop   => \@otheritemloop,
478     biblionumber        => $biblionumber,
479     ($analyze? 'analyze':'detailview') =>1,
480     subscriptions       => \@subs,
481     subscriptionsnumber => $subscriptionsnumber,
482     subscriptiontitle   => $dat->{title},
483     searchid            => scalar $query->param('searchid'),
484 );
485
486 # $debug and $template->param(debug_display => 1);
487
488 # Lists
489
490 if (C4::Context->preference("virtualshelves") ) {
491     my $shelves = Koha::Virtualshelves->search(
492         {
493             biblionumber => $biblionumber,
494             category => 2,
495         },
496         {
497             join => 'virtualshelfcontents',
498         }
499     );
500     $template->param( 'shelves' => $shelves );
501 }
502
503 # XISBN Stuff
504 if (C4::Context->preference("FRBRizeEditions")==1) {
505     eval {
506         $template->param(
507             XISBNS => scalar get_xisbns($isbn, $biblionumber)
508         );
509     };
510     if ($@) { warn "XISBN Failed $@"; }
511 }
512
513 if ( C4::Context->preference("LocalCoverImages") == 1 ) {
514     my @images = ListImagesForBiblio($biblionumber);
515     $template->{VARS}->{localimages} = \@images;
516 }
517
518 # HTML5 Media
519 if ( (C4::Context->preference("HTML5MediaEnabled") eq 'both') or (C4::Context->preference("HTML5MediaEnabled") eq 'staff') ) {
520     $template->param( C4::HTML5Media->gethtml5media($record));
521 }
522
523 # Displaying tags
524
525 my $tag_quantity;
526 if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail')) {
527     $template->param(
528         TagsEnabled => 1,
529         TagsShowOnDetail => $tag_quantity
530     );
531     $template->param(TagLoop => get_tags({biblionumber=>$biblionumber, approved=>1,
532                                 'sort'=>'-weight', limit=>$tag_quantity}));
533 }
534
535 #we only need to pass the number of holds to the template
536 my $holds = $biblio->holds;
537 $template->param( holdcount => $holds->count );
538
539 my $StaffDetailItemSelection = C4::Context->preference('StaffDetailItemSelection');
540 if ($StaffDetailItemSelection) {
541     # Only enable item selection if user can execute at least one action
542     if (
543         $flags->{superlibrarian}
544         || (
545             ref $flags->{tools} eq 'HASH' && (
546                 $flags->{tools}->{items_batchmod}       # Modify selected items
547                 || $flags->{tools}->{items_batchdel}    # Delete selected items
548             )
549         )
550         || ( ref $flags->{tools} eq '' && $flags->{tools} )
551       )
552     {
553         $template->param(
554             StaffDetailItemSelection => $StaffDetailItemSelection );
555     }
556 }
557
558 my @allorders_using_biblio = GetOrdersByBiblionumber ($biblionumber);
559 my @deletedorders_using_biblio;
560 my @orders_using_biblio;
561 my @baskets_orders;
562 my @baskets_deletedorders;
563
564 foreach my $myorder (@allorders_using_biblio) {
565     my $basket = $myorder->{'basketno'};
566     if ((defined $myorder->{'datecancellationprinted'}) and  ($myorder->{'datecancellationprinted'} ne '0000-00-00') ){
567         push @deletedorders_using_biblio, $myorder;
568         unless (grep{ $_ eq $basket } @baskets_deletedorders){
569             push @baskets_deletedorders,$myorder->{'basketno'};
570         }
571     }
572     else {
573         push @orders_using_biblio, $myorder;
574         unless (grep{ $_ eq $basket } @baskets_orders){
575             push @baskets_orders,$myorder->{'basketno'};
576             }
577     }
578 }
579
580 $template->param(biblio => $biblio);
581
582 my $count_orders_using_biblio = scalar @orders_using_biblio ;
583 $template->param (countorders => $count_orders_using_biblio);
584
585 my $count_deletedorders_using_biblio = scalar @deletedorders_using_biblio ;
586 $template->param (countdeletedorders => $count_deletedorders_using_biblio);
587
588 $template->param (basketsorders => \@baskets_orders);
589 $template->param (basketsdeletedorders => \@baskets_deletedorders);
590
591 output_html_with_http_headers $query, $cookie, $template->output;