3 # Copyright 2000-2002 Katipo Communications
4 # Copyright 2010 BibLibre
6 # This file is part of Koha.
8 # Koha is free software; you can redistribute it and/or modify it under the
9 # terms of the GNU General Public License as published by the Free Software
10 # Foundation; either version 2 of the License, or (at your option) any later
13 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License along
18 # with Koha; if not, write to the Free Software Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
29 use C4::Serials; #uses getsubscriptionfrom biblionumber
34 use C4::Tags qw(get_tags);
35 use C4::Dates qw/format_date/;
36 use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn);
37 use C4::External::Amazon;
38 use C4::External::Syndetics qw(get_syndetics_index get_syndetics_summary get_syndetics_toc get_syndetics_excerpt get_syndetics_reviews get_syndetics_anotes );
41 use C4::VirtualShelves;
47 use List::MoreUtils qw/any none/;
50 if (C4::Context->preference('BakerTaylorEnabled')) {
51 require C4::External::BakerTaylor;
52 import C4::External::BakerTaylor qw(&image_url &link_url);
57 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
59 template_name => "opac-detail.tmpl",
62 authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
63 flagsrequired => { borrow => 1 },
67 my $biblionumber = $query->param('biblionumber') || $query->param('bib');
69 $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
70 $template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
72 my $record = GetMarcBiblio($biblionumber);
74 print $query->redirect("/cgi-bin/koha/errors/404.pl");
77 $template->param( biblionumber => $biblionumber );
81 # XSLT processing of some stuff
82 if (C4::Context->preference("OPACXSLTDetailsDisplay") ) {
83 $template->param( 'XSLTBloc' => XSLTParse4Display($biblionumber, $record, 'Detail', 'opac') );
86 $template->param('OPACShowCheckoutName' => C4::Context->preference("OPACShowCheckoutName") );
87 # change back when ive fixed request.pl
88 my @all_items = GetItemsInfo( $biblionumber );
90 # adding items linked via host biblios
91 my $marcflavour = C4::Context->preference("marcflavour");
93 my $analyticfield = '773';
94 if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC'){
95 $analyticfield = '773';
96 } elsif ($marcflavour eq 'UNIMARC') {
97 $analyticfield = '461';
99 foreach my $hostfield ( $record->field($analyticfield)) {
100 my $hostbiblionumber = $hostfield->subfield("0");
101 my $linkeditemnumber = $hostfield->subfield("9");
102 my @hostitemInfos = GetItemsInfo($hostbiblionumber);
103 foreach my $hostitemInfo (@hostitemInfos){
104 if ($hostitemInfo->{itemnumber} eq $linkeditemnumber){
105 push(@all_items, $hostitemInfo);
112 # Getting items to be hidden
113 my @hiddenitems = GetHiddenItemnumbers(@all_items);
115 # Are there items to hide?
116 my $hideitems = 1 if C4::Context->preference('hidelostitems') or scalar(@hiddenitems) > 0;
120 for my $itm (@all_items) {
121 if ( C4::Context->preference('hidelostitems') ) {
122 push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems;
124 push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems;
132 my $dat = &GetBiblioData($biblionumber);
134 my $itemtypes = GetItemTypes();
136 my $itemtype = $dat->{'itemtype'};
138 $dat->{'imageurl'} = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} );
139 $dat->{'description'} = $itemtypes->{$itemtype}->{'description'};
141 my $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'}, 'opac');
142 my $collections = GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}, 'opac');
144 #coping with subscriptions
145 my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
146 my @subscriptions = GetSubscriptions( undef, undef, $biblionumber );
149 $dat->{'serial'}=1 if $subscriptionsnumber;
150 foreach my $subscription (@subscriptions) {
151 my $serials_to_display;
153 $cell{subscriptionid} = $subscription->{subscriptionid};
154 $cell{subscriptionnotes} = $subscription->{notes};
155 $cell{missinglist} = $subscription->{missinglist};
156 $cell{opacnote} = $subscription->{opacnote};
157 $cell{histstartdate} = format_date($subscription->{histstartdate});
158 $cell{histenddate} = format_date($subscription->{histenddate});
159 $cell{branchcode} = $subscription->{branchcode};
160 $cell{branchname} = GetBranchName($subscription->{branchcode});
161 $cell{hasalert} = $subscription->{hasalert};
162 #get the three latest serials.
163 $serials_to_display = $subscription->{opacdisplaycount};
164 $serials_to_display = C4::Context->preference('OPACSerialIssueDisplayCount') unless $serials_to_display;
165 $cell{opacdisplaycount} = $serials_to_display;
166 $cell{latestserials} =
167 GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
171 $dat->{'count'} = scalar(@items);
173 # If there is a lot of items, and the user has not decided
174 # to view them all yet, we first warn him
175 # TODO: The limit of 50 could be a syspref
176 my $viewallitems = $query->param('viewallitems');
177 if ($dat->{'count'} >= 50 && !$viewallitems) {
178 $template->param('lotsofitems' => 1);
181 my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
184 my $branches = GetBranches();
186 for my $itm (@items) {
188 if ( (not $itm->{'wthdrawn'} )
189 && (not $itm->{'itemlost'} )
190 && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'} )
191 && (not $itemtypes->{$itm->{'itype'}}->{notforloan} )
192 && ($itm->{'itemnumber'} ) );
194 if ( defined $itm->{'publictype'} ) {
195 # I can't actually find any case in which this is defined. --amoore 2008-12-09
196 $itm->{ $itm->{'publictype'} } = 1;
198 $itm->{datedue} = format_date($itm->{datedue});
199 $itm->{datelastseen} = format_date($itm->{datelastseen});
201 # get collection code description, too
202 if ( my $ccode = $itm->{'ccode'} ) {
203 $itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) );
205 if ( defined $itm->{'location'} ) {
206 $itm->{'location_description'} = $shelflocations->{ $itm->{'location'} };
208 if (exists $itm->{itype} && defined($itm->{itype}) && exists $itemtypes->{ $itm->{itype} }) {
209 $itm->{'imageurl'} = getitemtypeimagelocation( 'opac', $itemtypes->{ $itm->{itype} }->{'imageurl'} );
210 $itm->{'description'} = $itemtypes->{ $itm->{itype} }->{'description'};
212 foreach (qw(ccode enumchron copynumber itemnotes uri)) {
213 $itemfields{$_} = 1 if ($itm->{$_});
216 # walk through the item-level authorised values and populate some images
217 my $item_authorised_value_images = C4::Items::get_authorised_value_images( C4::Items::get_item_authorised_values( $itm->{'itemnumber'} ) );
218 # warn( Data::Dumper->Dump( [ $item_authorised_value_images ], [ 'item_authorised_value_images' ] ) );
220 if ( $itm->{'itemlost'} ) {
221 my $lostimageinfo = List::Util::first { $_->{'category'} eq 'LOST' } @$item_authorised_value_images;
222 $itm->{'lostimageurl'} = $lostimageinfo->{ 'imageurl' };
223 $itm->{'lostimagelabel'} = $lostimageinfo->{ 'label' };
226 if( $itm->{'count_reserves'}){
227 if( $itm->{'count_reserves'} eq "Waiting"){ $itm->{'waiting'} = 1; }
228 if( $itm->{'count_reserves'} eq "Reserved"){ $itm->{'onhold'} = 1; }
231 my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
232 if ( defined( $transfertwhen ) && $transfertwhen ne '' ) {
233 $itm->{transfertwhen} = format_date($transfertwhen);
234 $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
235 $itm->{transfertto} = $branches->{$transfertto}{branchname};
239 ## get notes and subjects from MARC record
240 my $dbh = C4::Context->dbh;
241 my $marcnotesarray = GetMarcNotes ($record,$marcflavour);
242 my $marcisbnsarray = GetMarcISBN ($record,$marcflavour);
243 my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour);
244 my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour);
245 my $marcseriesarray = GetMarcSeries ($record,$marcflavour);
246 my $marcurlsarray = GetMarcUrls ($record,$marcflavour);
247 my $marchostsarray = GetMarcHosts($record,$marcflavour);
248 my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
251 MARCNOTES => $marcnotesarray,
252 MARCSUBJCTS => $marcsubjctsarray,
253 MARCAUTHORS => $marcauthorsarray,
254 MARCSERIES => $marcseriesarray,
255 MARCURLS => $marcurlsarray,
256 MARCHOSTS => $marchostsarray,
257 norequests => $norequests,
258 RequestOnOpac => C4::Context->preference("RequestOnOpac"),
259 itemdata_ccode => $itemfields{ccode},
260 itemdata_enumchron => $itemfields{enumchron},
261 itemdata_uri => $itemfields{uri},
262 itemdata_copynumber => $itemfields{copynumber},
263 itemdata_itemnotes => $itemfields{itemnotes},
264 authorised_value_images => $biblio_authorised_value_images,
265 subtitle => $subtitle,
268 if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
269 my $fieldspec = C4::Context->preference("AlternateHoldingsField");
270 my $subfields = substr $fieldspec, 3;
271 my $holdingsep = C4::Context->preference("AlternateHoldingsSeparator") || ' ';
272 my @alternateholdingsinfo = ();
273 my @holdingsfields = $record->field(substr $fieldspec, 0, 3);
275 for my $field (@holdingsfields) {
276 my %holding = ( holding => '' );
277 my $havesubfield = 0;
278 for my $subfield ($field->subfields()) {
279 if ((index $subfields, $$subfield[0]) >= 0) {
280 $holding{'holding'} .= $holdingsep if (length $holding{'holding'} > 0);
281 $holding{'holding'} .= $$subfield[1];
286 push(@alternateholdingsinfo, \%holding);
291 ALTERNATEHOLDINGS => \@alternateholdingsinfo,
295 foreach ( keys %{$dat} ) {
296 $template->param( "$_" => defined $dat->{$_} ? $dat->{$_} : '' );
299 # some useful variables for enhanced content;
300 # in each case, we're grabbing the first value we find in
301 # the record and normalizing it
302 my $upc = GetNormalizedUPC($record,$marcflavour);
303 my $ean = GetNormalizedEAN($record,$marcflavour);
304 my $oclc = GetNormalizedOCLCNumber($record,$marcflavour);
305 my $isbn = GetNormalizedISBN(undef,$record,$marcflavour);
306 my $content_identifier_exists;
307 if ( $isbn or $ean or $oclc or $upc ) {
308 $content_identifier_exists = 1;
311 normalized_upc => $upc,
312 normalized_ean => $ean,
313 normalized_oclc => $oclc,
314 normalized_isbn => $isbn,
315 content_identifier_exists => $content_identifier_exists,
318 # COinS format FIXME: for books Only
320 ocoins => GetCOinSBiblio($biblionumber),
323 my $libravatar_enabled = 0;
324 eval 'use Libravatar::URL';
325 if (!$@ and C4::Context->preference('ShowReviewer') and C4::Context->preference('ShowReviewerPhoto')) {
326 $libravatar_enabled = 1;
329 my $reviews = getreviews( $biblionumber, 1 );
330 my $loggedincommenter;
331 foreach ( @$reviews ) {
332 my $borrowerData = GetMember('borrowernumber' => $_->{borrowernumber});
333 # setting some borrower info into this hash
334 $_->{title} = $borrowerData->{'title'};
335 $_->{surname} = $borrowerData->{'surname'};
336 $_->{firstname} = $borrowerData->{'firstname'};
337 if ($libravatar_enabled and $borrowerData->{'email'}) {
338 $_->{avatarurl} = libravatar_url(email => $borrowerData->{'email'}, https => $ENV{HTTPS});
340 $_->{userid} = $borrowerData->{'userid'};
341 $_->{cardnumber} = $borrowerData->{'cardnumber'};
342 $_->{datereviewed} = format_date($_->{datereviewed});
343 if ($borrowerData->{'borrowernumber'} eq $borrowernumber) {
344 $_->{your_comment} = 1;
345 $loggedincommenter = 1;
350 if(C4::Context->preference("ISBD")) {
351 $template->param(ISBD => 1);
355 ITEM_RESULTS => \@items,
356 subscriptionsnumber => $subscriptionsnumber,
357 biblionumber => $biblionumber,
358 subscriptions => \@subs,
359 subscriptionsnumber => $subscriptionsnumber,
361 loggedincommenter => $loggedincommenter
366 if (C4::Context->preference("virtualshelves") ) {
367 $template->param( 'GetShelves' => GetBibliosShelves( $biblionumber ) );
372 if (C4::Context->preference("OPACFRBRizeEditions")==1) {
375 XISBNS => get_xisbns($isbn)
378 if ($@) { warn "XISBN Failed $@"; }
382 my @sc_fields = $record->field(955);
383 my @serialcollections = ();
385 foreach my $sc_field (@sc_fields) {
388 $row_data{text} = $sc_field->subfield('r');
389 $row_data{branch} = $sc_field->subfield('9');
391 if ($row_data{text} && $row_data{branch}) {
392 push (@serialcollections, \%row_data);
396 if (scalar(@serialcollections) > 0) {
398 serialcollection => 1,
399 serialcollections => \@serialcollections);
403 if ( C4::Context->preference("OPACAmazonEnabled") ) {
404 $template->param( AmazonTld => get_amazon_tld() );
405 my $amazon_reviews = C4::Context->preference("OPACAmazonReviews");
406 my $amazon_similars = C4::Context->preference("OPACAmazonSimilarItems");
408 if ( $amazon_reviews ) {
409 push( @services, 'EditorialReview', 'Reviews' );
411 if ( $amazon_similars ) {
412 push( @services, 'Similarities' );
414 my $amazon_details = &get_amazon_details( $isbn, $record, $marcflavour, \@services );
415 my $similar_products_exist;
416 if ( $amazon_reviews ) {
417 my $item = $amazon_details->{Items}->{Item}->[0];
418 my $customer_reviews = \@{ $item->{CustomerReviews}->{Review} };
419 for my $one_review ( @$customer_reviews ) {
420 $one_review->{Date} = format_date($one_review->{Date});
422 my $editorial_reviews = \@{ $item->{EditorialReviews}->{EditorialReview} };
423 my $average_rating = $item->{CustomerReviews}->{AverageRating} || 0;
424 $template->param( amazon_average_rating => $average_rating * 20);
425 $template->param( AMAZON_CUSTOMER_REVIEWS => $customer_reviews );
426 $template->param( AMAZON_EDITORIAL_REVIEWS => $editorial_reviews );
428 if ( $amazon_similars ) {
429 my $item = $amazon_details->{Items}->{Item}->[0];
430 my @similar_products;
431 for my $similar_product (@{ $item->{SimilarProducts}->{SimilarProduct} }) {
432 # do we have any of these isbns in our collection?
433 my $similar_biblionumbers = get_biblionumber_from_isbn($similar_product->{ASIN});
434 # verify that there is at least one similar item
435 if (scalar(@$similar_biblionumbers)){
436 $similar_products_exist++ if ($similar_biblionumbers && $similar_biblionumbers->[0]);
437 push @similar_products, +{ similar_biblionumbers => $similar_biblionumbers, title => $similar_product->{Title}, ASIN => $similar_product->{ASIN} };
440 $template->param( OPACAmazonSimilarItems => $similar_products_exist );
441 $template->param( AMAZON_SIMILAR_PRODUCTS => \@similar_products );
445 my $syndetics_elements;
447 if ( C4::Context->preference("SyndeticsEnabled") ) {
448 $template->param("SyndeticsEnabled" => 1);
449 $template->param("SyndeticsClientCode" => C4::Context->preference("SyndeticsClientCode"));
451 $syndetics_elements = &get_syndetics_index($isbn,$upc,$oclc);
452 for my $element (values %$syndetics_elements) {
453 $template->param("Syndetics$element"."Exists" => 1 );
454 #warn "Exists: "."Syndetics$element"."Exists";
460 if ( C4::Context->preference("SyndeticsEnabled")
461 && C4::Context->preference("SyndeticsSummary")
462 && ( exists($syndetics_elements->{'SUMMARY'}) || exists($syndetics_elements->{'AVSUMMARY'}) ) ) {
464 my $syndetics_summary = &get_syndetics_summary($isbn,$upc,$oclc, $syndetics_elements);
465 $template->param( SYNDETICS_SUMMARY => $syndetics_summary );
471 if ( C4::Context->preference("SyndeticsEnabled")
472 && C4::Context->preference("SyndeticsTOC")
473 && exists($syndetics_elements->{'TOC'}) ) {
475 my $syndetics_toc = &get_syndetics_toc($isbn,$upc,$oclc);
476 $template->param( SYNDETICS_TOC => $syndetics_toc );
481 if ( C4::Context->preference("SyndeticsEnabled")
482 && C4::Context->preference("SyndeticsExcerpt")
483 && exists($syndetics_elements->{'DBCHAPTER'}) ) {
485 my $syndetics_excerpt = &get_syndetics_excerpt($isbn,$upc,$oclc);
486 $template->param( SYNDETICS_EXCERPT => $syndetics_excerpt );
491 if ( C4::Context->preference("SyndeticsEnabled")
492 && C4::Context->preference("SyndeticsReviews")) {
494 my $syndetics_reviews = &get_syndetics_reviews($isbn,$upc,$oclc,$syndetics_elements);
495 $template->param( SYNDETICS_REVIEWS => $syndetics_reviews );
500 if ( C4::Context->preference("SyndeticsEnabled")
501 && C4::Context->preference("SyndeticsAuthorNotes")
502 && exists($syndetics_elements->{'ANOTES'}) ) {
504 my $syndetics_anotes = &get_syndetics_anotes($isbn,$upc,$oclc);
505 $template->param( SYNDETICS_ANOTES => $syndetics_anotes );
510 # LibraryThingForLibraries ID Code and Tabbed View Option
511 if( C4::Context->preference('LibraryThingForLibrariesEnabled') )
513 $template->param(LibraryThingForLibrariesID =>
514 C4::Context->preference('LibraryThingForLibrariesID') );
515 $template->param(LibraryThingForLibrariesTabbedView =>
516 C4::Context->preference('LibraryThingForLibrariesTabbedView') );
520 if( C4::Context->preference('NovelistSelectEnabled') )
522 $template->param(NovelistSelectProfile => C4::Context->preference('NovelistSelectProfile') );
523 $template->param(NovelistSelectPassword => C4::Context->preference('NovelistSelectPassword') );
524 $template->param(NovelistSelectView => C4::Context->preference('NovelistSelectView') );
529 if ( C4::Context->preference("Babeltheque") ) {
535 # Shelf Browser Stuff
536 if (C4::Context->preference("OPACShelfBrowser")) {
537 # pick the first itemnumber unless one was selected by the user
538 my $starting_itemnumber = $query->param('shelfbrowse_itemnumber'); # || $items[0]->{itemnumber};
539 if (defined($starting_itemnumber)) {
540 $template->param( OpenOPACShelfBrowser => 1) if $starting_itemnumber;
541 my $nearby = GetNearbyItems($starting_itemnumber,3);
544 starting_homebranch => $nearby->{starting_homebranch}->{description},
545 starting_location => $nearby->{starting_location}->{description},
546 starting_ccode => $nearby->{starting_ccode}->{description},
547 starting_itemnumber => $nearby->{starting_itemnumber},
548 shelfbrowser_prev_itemnumber => $nearby->{prev_itemnumber},
549 shelfbrowser_next_itemnumber => $nearby->{next_itemnumber},
550 shelfbrowser_prev_biblionumber => $nearby->{prev_biblionumber},
551 shelfbrowser_next_biblionumber => $nearby->{next_biblionumber},
552 PREVIOUS_SHELF_BROWSE => $nearby->{prev},
553 NEXT_SHELF_BROWSE => $nearby->{next},
558 if (C4::Context->preference("BakerTaylorEnabled")) {
560 BakerTaylorEnabled => 1,
561 BakerTaylorImageURL => &image_url(),
562 BakerTaylorLinkURL => &link_url(),
563 BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
565 my ($bt_user, $bt_pass);
567 $bt_user = C4::Context->preference('BakerTaylorUsername') and
568 $bt_pass = C4::Context->preference('BakerTaylorPassword') )
571 BakerTaylorContentURL =>
572 sprintf("http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
573 $bt_user,$bt_pass,$isbn)
579 if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail')) {
582 TagsShowOnDetail => $tag_quantity,
583 TagsInputOnDetail => C4::Context->preference('TagsInputOnDetail')
585 $template->param(TagLoop => get_tags({biblionumber=>$biblionumber, approved=>1,
586 'sort'=>'-weight', limit=>$tag_quantity}));
589 if (C4::Context->preference("OPACURLOpenInNewWindow")) {
590 # These values are going to be read by Javascript, at least in the case
591 # of the google covers
592 $template->param(covernewwindow => 'true');
594 $template->param(covernewwindow => 'false');
597 #Search for title in links
598 my $marccontrolnumber = GetMarcControlnumber ($record, $marcflavour);
600 if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
601 $dat->{author} ? $search_for_title =~ s/{AUTHOR}/$dat->{author}/g : $search_for_title =~ s/{AUTHOR}//g;
602 $dat->{title} =~ s/\/+$//; # remove trailing slash
603 $dat->{title} =~ s/\s+$//; # remove trailing space
604 $dat->{title} ? $search_for_title =~ s/{TITLE}/$dat->{title}/g : $search_for_title =~ s/{TITLE}//g;
605 $isbn ? $search_for_title =~ s/{ISBN}/$isbn/g : $search_for_title =~ s/{ISBN}//g;
606 $marccontrolnumber ? $search_for_title =~ s/{CONTROLNUMBER}/$marccontrolnumber/g : $search_for_title =~ s/{CONTROLNUMBER}//g;
607 $search_for_title =~ s/{BIBLIONUMBER}/$biblionumber/g;
608 $template->param('OPACSearchForTitleIn' => $search_for_title);
611 # We try to select the best default tab to show, according to what
612 # the user wants, and what's available for display
613 my $opac_serial_default = C4::Context->preference('opacSerialDefaultTab');
615 $opac_serial_default eq 'subscriptions' && $subscriptionsnumber
617 $opac_serial_default eq 'serialcollection' && @serialcollections > 0
618 ? 'serialcollection' :
619 $opac_serial_default eq 'holdings' && $dat->{'count'} > 0
623 @serialcollections > 0
624 ? 'serialcollection' : 'subscription';
625 $template->param('defaulttab' => $defaulttab);
627 output_html_with_http_headers $query, $cookie, $template->output;