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