View | Details | Raw Unified | Return to bug 7379
Collapse All | Expand All

(-)a/catalogue/detail.pl (-46 / +51 lines)
Lines 128-135 my $hostrecords; Link Here
128
# adding items linked via host biblios
128
# adding items linked via host biblios
129
my @hostitems = GetHostItemsInfo($record);
129
my @hostitems = GetHostItemsInfo($record);
130
if (@hostitems){
130
if (@hostitems){
131
	$hostrecords =1;
131
    $hostrecords =1;
132
	push (@items,@hostitems);
132
    push (@items,@hostitems);
133
}
133
}
134
134
135
my $dat = &GetBiblioData($biblionumber);
135
my $dat = &GetBiblioData($biblionumber);
Lines 144-159 my @subs; Link Here
144
144
145
foreach my $subscription (@subscriptions) {
145
foreach my $subscription (@subscriptions) {
146
    my %cell;
146
    my %cell;
147
	my $serials_to_display;
147
    my $serials_to_display;
148
    $cell{subscriptionid}    = $subscription->{subscriptionid};
148
    $cell{subscriptionid}    = $subscription->{subscriptionid};
149
    $cell{subscriptionnotes} = $subscription->{notes};
149
    $cell{subscriptionnotes} = $subscription->{notes};
150
    $cell{branchcode}        = $subscription->{branchcode};
150
    $cell{branchcode}        = $subscription->{branchcode};
151
    $cell{branchname}        = GetBranchName($subscription->{branchcode});
151
    $cell{branchname}        = GetBranchName($subscription->{branchcode});
152
    $cell{hasalert}          = $subscription->{hasalert};
152
    $cell{hasalert}          = $subscription->{hasalert};
153
    #get the three latest serials.
153
    #get the three latest serials.
154
	$serials_to_display = $subscription->{staffdisplaycount};
154
    $serials_to_display = $subscription->{staffdisplaycount};
155
	$serials_to_display = C4::Context->preference('StaffSerialIssueDisplayCount') unless $serials_to_display;
155
    $serials_to_display = C4::Context->preference('StaffSerialIssueDisplayCount') unless $serials_to_display;
156
	$cell{staffdisplaycount} = $serials_to_display;
156
    $cell{staffdisplaycount} = $serials_to_display;
157
    $cell{latestserials} =
157
    $cell{latestserials} =
158
      GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
158
      GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
159
    push @subs, \%cell;
159
    push @subs, \%cell;
Lines 167-174 $dat->{'count'} = scalar @all_items + @hostitems; Link Here
167
$dat->{'showncount'} = scalar @items + @hostitems;
167
$dat->{'showncount'} = scalar @items + @hostitems;
168
$dat->{'hiddencount'} = scalar @all_items + @hostitems - scalar @items;
168
$dat->{'hiddencount'} = scalar @all_items + @hostitems - scalar @items;
169
169
170
my $shelflocations = GetKohaAuthorisedValues('items.location', $fw);
170
my $shelflocations  = GetKohaAuthorisedValues('items.location'  , $fw);
171
my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
171
my $collections     = GetKohaAuthorisedValues('items.ccode'     , $fw);
172
my $copynumbers     = GetKohaAuthorisedValues('items.copynumber', $fw);
172
my (@itemloop, %itemfields);
173
my (@itemloop, %itemfields);
173
my $norequests = 1;
174
my $norequests = 1;
174
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
175
my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
Lines 189-207 foreach my $item (@items) { Link Here
189
    $item->{imageurl} = defined $item->{itype} ? getitemtypeimagelocation('intranet', $itemtypes->{ $item->{itype} }{imageurl})
190
    $item->{imageurl} = defined $item->{itype} ? getitemtypeimagelocation('intranet', $itemtypes->{ $item->{itype} }{imageurl})
190
                                               : '';
191
                                               : '';
191
192
192
	foreach (qw(datedue datelastseen onloan)) {
193
    foreach (qw(datedue datelastseen onloan)) {
193
		$item->{$_} = format_date($item->{$_});
194
        $item->{$_} = format_date($item->{$_});
194
	}
195
    }
195
    # item damaged, lost, withdrawn loops
196
    # item damaged, lost, withdrawn loops
196
    $item->{itemlostloop} = GetAuthorisedValues($authvalcode_items_itemlost, $item->{itemlost}) if $authvalcode_items_itemlost;
197
    $item->{itemlostloop} = GetAuthorisedValues($authvalcode_items_itemlost, $item->{itemlost}) if $authvalcode_items_itemlost;
197
    if ($item->{damaged}) {
198
    if ($item->{damaged}) {
198
        $item->{itemdamagedloop} = GetAuthorisedValues($authvalcode_items_damaged, $item->{damaged}) if $authvalcode_items_damaged;
199
        $item->{itemdamagedloop} = GetAuthorisedValues($authvalcode_items_damaged, $item->{damaged}) if $authvalcode_items_damaged;
199
    }
200
    }
200
    #get shelf location and collection code description if they are authorised value.
201
    # get shelf location and collection code description if they are authorised value
202
    # same thing for copy number
201
    my $shelfcode = $item->{'location'};
203
    my $shelfcode = $item->{'location'};
202
    $item->{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
204
    $item->{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
203
    my $ccode = $item->{'ccode'};
205
    my $ccode = $item->{'ccode'};
204
    $item->{'ccode'} = $collections->{$ccode} if ( defined( $ccode ) && defined($collections) && exists( $collections->{$ccode} ) );
206
    $item->{'ccode'} = $collections->{$ccode} if ( defined( $ccode ) && defined($collections) && exists( $collections->{$ccode} ) );
207
    my $copynumber = $item->{'copynumber'};
208
    $item->{'copynumber'} = $copynumbers->{$copynumber} if ( defined( $copynumber ) && defined($copynumber) && exists( $copynumbers->{$copynumber} ) );
205
    foreach (qw(ccode enumchron copynumber itemnotes uri)) {
209
    foreach (qw(ccode enumchron copynumber itemnotes uri)) {
206
        $itemfields{$_} = 1 if ( $item->{$_} );
210
        $itemfields{$_} = 1 if ( $item->{$_} );
207
    }
211
    }
Lines 211-230 foreach my $item (@items) { Link Here
211
    my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0);
215
    my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0);
212
    
216
    
213
    if (C4::Context->preference('HidePatronName')){
217
    if (C4::Context->preference('HidePatronName')){
214
	$item->{'hidepatronname'} = 1;
218
        $item->{'hidepatronname'} = 1;
215
    }
219
    }
216
220
217
    if ( defined $reservedate ) {
221
    if ( defined $reservedate ) {
218
        $item->{backgroundcolor} = 'reserved';
222
        $item->{backgroundcolor}            = 'reserved';
219
        $item->{reservedate}     = format_date($reservedate);
223
        $item->{reservedate}                = format_date($reservedate);
220
        $item->{ReservedForBorrowernumber}     = $reservedfor;
224
        $item->{ReservedForBorrowernumber}  = $reservedfor;
221
        $item->{ReservedForSurname}     = $ItemBorrowerReserveInfo->{'surname'};
225
        $item->{ReservedForSurname}         = $ItemBorrowerReserveInfo->{'surname'};
222
        $item->{ReservedForFirstname}   = $ItemBorrowerReserveInfo->{'firstname'};
226
        $item->{ReservedForFirstname}       = $ItemBorrowerReserveInfo->{'firstname'};
223
        $item->{ExpectedAtLibrary}      = $branches->{$expectedAt}{branchname};
227
        $item->{ExpectedAtLibrary}          = $branches->{$expectedAt}{branchname};
224
	$item->{Reservedcardnumber}             = $ItemBorrowerReserveInfo->{'cardnumber'};
228
        $item->{Reservedcardnumber}         = $ItemBorrowerReserveInfo->{'cardnumber'};
225
    }
229
    }
226
230
227
	# Check the transit status
231
    # Check the transit status
228
    my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber});
232
    my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($item->{itemnumber});
229
    if ( defined( $transfertwhen ) && ( $transfertwhen ne '' ) ) {
233
    if ( defined( $transfertwhen ) && ( $transfertwhen ne '' ) ) {
230
        $item->{transfertwhen} = format_date($transfertwhen);
234
        $item->{transfertwhen} = format_date($transfertwhen);
Lines 243-282 foreach my $item (@items) { Link Here
243
    # item has a host number if its biblio number does not match the current bib
247
    # item has a host number if its biblio number does not match the current bib
244
    if ($item->{biblionumber} ne $biblionumber){
248
    if ($item->{biblionumber} ne $biblionumber){
245
        $item->{hostbiblionumber} = $item->{biblionumber};
249
        $item->{hostbiblionumber} = $item->{biblionumber};
246
	$item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
250
    $item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
247
    }
251
    }
248
	
249
	#count if item is used in analytical bibliorecords
250
	my $countanalytics= GetAnalyticsCount($item->{itemnumber});
251
	if ($countanalytics > 0){
252
		$analytics_flag=1;
253
		$item->{countanalytics} = $countanalytics;
254
	}
255
252
253
    #count if item is used in analytical bibliorecords
254
    my $countanalytics= GetAnalyticsCount($item->{itemnumber});
255
    if ( defined $countanalytics) {
256
        if ($countanalytics > 0){
257
            $analytics_flag=1;
258
            $item->{countanalytics} = $countanalytics;
259
        }
260
    }
256
    push @itemloop, $item;
261
    push @itemloop, $item;
257
}
262
}
258
263
259
$template->param( norequests => $norequests );
264
$template->param( norequests => $norequests );
260
$template->param(
265
$template->param(
261
	MARCNOTES   => $marcnotesarray,
266
    MARCNOTES           => $marcnotesarray,
262
	MARCSUBJCTS => $marcsubjctsarray,
267
    MARCSUBJCTS         => $marcsubjctsarray,
263
	MARCAUTHORS => $marcauthorsarray,
268
    MARCAUTHORS         => $marcauthorsarray,
264
	MARCSERIES  => $marcseriesarray,
269
    MARCSERIES          => $marcseriesarray,
265
	MARCURLS => $marcurlsarray,
270
    MARCURLS            => $marcurlsarray,
266
    MARCISBNS => $marcisbnsarray,
271
    MARCISBNS           => $marcisbnsarray,
267
	MARCHOSTS => $marchostsarray,
272
    MARCHOSTS           => $marchostsarray,
268
	subtitle    => $subtitle,
273
    subtitle            => $subtitle,
269
	itemdata_ccode      => $itemfields{ccode},
274
    itemdata_ccode      => $itemfields{ccode},
270
	itemdata_enumchron  => $itemfields{enumchron},
275
    itemdata_enumchron  => $itemfields{enumchron},
271
	itemdata_uri        => $itemfields{uri},
276
    itemdata_uri        => $itemfields{uri},
272
	itemdata_copynumber => $itemfields{copynumber},
277
    itemdata_copynumber => $itemfields{copynumber},
273
	volinfo				=> $itemfields{enumchron},
278
    volinfo             => $itemfields{enumchron},
274
    itemdata_itemnotes  => $itemfields{itemnotes},
279
    itemdata_itemnotes  => $itemfields{itemnotes},
275
	z3950_search_params	=> C4::Search::z3950_search_args($dat),
280
    z3950_search_params => C4::Search::z3950_search_args($dat),
276
    holdcount           => $holdcount,
281
    holdcount           => $holdcount,
277
        hostrecords         => $hostrecords,
282
    hostrecords         => $hostrecords,
278
	analytics_flag	=> $analytics_flag,
283
    analytics_flag      => $analytics_flag,
279
	C4::Search::enabled_staff_search_views,
284
    C4::Search::enabled_staff_search_views,
280
);
285
);
281
286
282
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
287
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
(-)a/opac/opac-detail.pl (-106 / +109 lines)
Lines 400-411 my $hideitems = 1 if C4::Context->preference('hidelostitems') or scalar(@hiddeni Link Here
400
# Hide items
400
# Hide items
401
if ($hideitems) {
401
if ($hideitems) {
402
    for my $itm (@all_items) {
402
    for my $itm (@all_items) {
403
	if  ( C4::Context->preference('hidelostitems') ) {
403
        if  ( C4::Context->preference('hidelostitems') ) {
404
	    push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems;
404
            push @items, $itm unless $itm->{itemlost} or any { $itm->{'itemnumber'} eq $_ } @hiddenitems;
405
	} else {
405
        } else {
406
	    push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems;
406
            push @items, $itm unless any { $itm->{'itemnumber'} eq $_ } @hiddenitems;
407
        }
407
    }
408
    }
408
}
409
} else {
409
} else {
410
    # Or not
410
    # Or not
411
    @items = @all_items;
411
    @items = @all_items;
Lines 422-427 if ( $itemtype ) { Link Here
422
}
422
}
423
my $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'}, 'opac');
423
my $shelflocations =GetKohaAuthorisedValues('items.location',$dat->{'frameworkcode'}, 'opac');
424
my $collections =  GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}, 'opac');
424
my $collections =  GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}, 'opac');
425
my $copynumbers =  GetKohaAuthorisedValues('items.copynumber',$dat->{'frameworkcode'}, 'opac');
425
426
426
#coping with subscriptions
427
#coping with subscriptions
427
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
428
my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
Lines 444-450 foreach my $subscription (@subscriptions) { Link Here
444
    #get the three latest serials.
445
    #get the three latest serials.
445
    $serials_to_display = $subscription->{opacdisplaycount};
446
    $serials_to_display = $subscription->{opacdisplaycount};
446
    $serials_to_display = C4::Context->preference('OPACSerialIssueDisplayCount') unless $serials_to_display;
447
    $serials_to_display = C4::Context->preference('OPACSerialIssueDisplayCount') unless $serials_to_display;
447
	$cell{opacdisplaycount} = $serials_to_display;
448
    $cell{opacdisplaycount} = $serials_to_display;
448
    $cell{latestserials} =
449
    $cell{latestserials} =
449
      GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
450
      GetLatestSerials( $subscription->{subscriptionid}, $serials_to_display );
450
    push @subs, \%cell;
451
    push @subs, \%cell;
Lines 467-477 my $branches = GetBranches(); Link Here
467
my %itemfields;
468
my %itemfields;
468
for my $itm (@items) {
469
for my $itm (@items) {
469
    $norequests = 0
470
    $norequests = 0
470
       if ( (not $itm->{'wthdrawn'} )
471
    if ( (not $itm->{'wthdrawn'} )
471
         && (not $itm->{'itemlost'} )
472
        && (not $itm->{'itemlost'} )
472
         && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'} )
473
        && ($itm->{'itemnotforloan'}<0 || not $itm->{'itemnotforloan'} )
473
		 && (not $itemtypes->{$itm->{'itype'}}->{notforloan} )
474
        && (not $itemtypes->{$itm->{'itype'}}->{notforloan} )
474
         && ($itm->{'itemnumber'} ) );
475
        && ($itm->{'itemnumber'} ) );
475
476
476
    if ( defined $itm->{'publictype'} ) {
477
    if ( defined $itm->{'publictype'} ) {
477
        # I can't actually find any case in which this is defined. --amoore 2008-12-09
478
        # I can't actually find any case in which this is defined. --amoore 2008-12-09
Lines 480-489 for my $itm (@items) { Link Here
480
    $itm->{datedue}      = format_date($itm->{datedue});
481
    $itm->{datedue}      = format_date($itm->{datedue});
481
    $itm->{datelastseen} = format_date($itm->{datelastseen});
482
    $itm->{datelastseen} = format_date($itm->{datelastseen});
482
483
483
    # get collection code description, too
484
    # get collection code and copynumber description, too
484
    if ( my $ccode = $itm->{'ccode'} ) {
485
    if ( my $ccode = $itm->{'ccode'} ) {
485
        $itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) );
486
        $itm->{'ccode'} = $collections->{$ccode} if ( defined($collections) && exists( $collections->{$ccode} ) );
486
    }
487
    }
488
    if ( my $copynumber = $itm->{'copynumber'} ) {
489
        $itm->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumbers) && exists( $copynumbers->{$copynumber} ) );
490
    }
487
    if ( defined $itm->{'location'} ) {
491
    if ( defined $itm->{'location'} ) {
488
        $itm->{'location_description'} = $shelflocations->{ $itm->{'location'} };
492
        $itm->{'location_description'} = $shelflocations->{ $itm->{'location'} };
489
    }
493
    }
Lines 499-550 for my $itm (@items) { Link Here
499
     my $item_authorised_value_images = C4::Items::get_authorised_value_images( C4::Items::get_item_authorised_values( $itm->{'itemnumber'} ) );
503
     my $item_authorised_value_images = C4::Items::get_authorised_value_images( C4::Items::get_item_authorised_values( $itm->{'itemnumber'} ) );
500
     # warn( Data::Dumper->Dump( [ $item_authorised_value_images ], [ 'item_authorised_value_images' ] ) );
504
     # warn( Data::Dumper->Dump( [ $item_authorised_value_images ], [ 'item_authorised_value_images' ] ) );
501
505
502
     if ( $itm->{'itemlost'} ) {
506
    if ( $itm->{'itemlost'} ) {
503
         my $lostimageinfo = List::Util::first { $_->{'category'} eq 'LOST' } @$item_authorised_value_images;
507
        my $lostimageinfo = List::Util::first { $_->{'category'} eq 'LOST' } @$item_authorised_value_images;
504
         $itm->{'lostimageurl'}   = $lostimageinfo->{ 'imageurl' };
508
        $itm->{'lostimageurl'}   = $lostimageinfo->{ 'imageurl' };
505
         $itm->{'lostimagelabel'} = $lostimageinfo->{ 'label' };
509
        $itm->{'lostimagelabel'} = $lostimageinfo->{ 'label' };
506
     }
510
    }
507
511
508
     if( $itm->{'count_reserves'}){
512
    if( $itm->{'count_reserves'}){
509
          if( $itm->{'count_reserves'} eq "Waiting"){ $itm->{'waiting'} = 1; }
513
        if( $itm->{'count_reserves'} eq "Waiting"){ $itm->{'waiting'} = 1; }
510
          if( $itm->{'count_reserves'} eq "Reserved"){ $itm->{'onhold'} = 1; }
514
        if( $itm->{'count_reserves'} eq "Reserved"){ $itm->{'onhold'} = 1; }
511
     }
515
    }
512
    
516
513
     my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
517
    my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
514
     if ( defined( $transfertwhen ) && $transfertwhen ne '' ) {
518
    if ( defined( $transfertwhen ) && $transfertwhen ne '' ) {
515
        $itm->{transfertwhen} = format_date($transfertwhen);
519
        $itm->{transfertwhen} = format_date($transfertwhen);
516
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
520
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
517
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
521
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
518
     }
522
    }
519
}
523
}
520
524
521
## get notes and subjects from MARC record
525
## get notes and subjects from MARC record
522
my $dbh              = C4::Context->dbh;
526
my $dbh                 = C4::Context->dbh;
523
my $marcnotesarray   = GetMarcNotes   ($record,$marcflavour);
527
my $marcnotesarray      = GetMarcNotes   ($record,$marcflavour);
524
my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
528
my $marcisbnsarray      = GetMarcISBN    ($record,$marcflavour);
525
my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour);
529
my $marcauthorsarray    = GetMarcAuthors ($record,$marcflavour);
526
my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour);
530
my $marcsubjctsarray    = GetMarcSubjects($record,$marcflavour);
527
my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
531
my $marcseriesarray     = GetMarcSeries  ($record,$marcflavour);
528
my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
532
my $marcurlsarray       = GetMarcUrls    ($record,$marcflavour);
529
my $marchostsarray  = GetMarcHosts($record,$marcflavour);
533
my $marchostsarray      = GetMarcHosts($record,$marcflavour);
530
my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
534
my $subtitle            = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
531
535
532
    $template->param(
536
    $template->param(
533
                     MARCNOTES               => $marcnotesarray,
537
                    MARCNOTES               => $marcnotesarray,
534
                     MARCSUBJCTS             => $marcsubjctsarray,
538
                    MARCSUBJCTS             => $marcsubjctsarray,
535
                     MARCAUTHORS             => $marcauthorsarray,
539
                    MARCAUTHORS             => $marcauthorsarray,
536
                     MARCSERIES              => $marcseriesarray,
540
                    MARCSERIES              => $marcseriesarray,
537
                     MARCURLS                => $marcurlsarray,
541
                    MARCURLS                => $marcurlsarray,
538
		     MARCHOSTS               => $marchostsarray,
542
                    MARCHOSTS               => $marchostsarray,
539
                     norequests              => $norequests,
543
                    norequests              => $norequests,
540
                     RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
544
                    RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
541
                     itemdata_ccode          => $itemfields{ccode},
545
                    itemdata_ccode          => $itemfields{ccode},
542
                     itemdata_enumchron      => $itemfields{enumchron},
546
                    itemdata_enumchron      => $itemfields{enumchron},
543
                     itemdata_uri            => $itemfields{uri},
547
                    itemdata_uri            => $itemfields{uri},
544
                     itemdata_copynumber     => $itemfields{copynumber},
548
                    itemdata_copynumber     => $itemfields{copynumber},
545
                     itemdata_itemnotes          => $itemfields{itemnotes},
549
                    itemdata_itemnotes      => $itemfields{itemnotes},
546
                     authorised_value_images => $biblio_authorised_value_images,
550
                    authorised_value_images => $biblio_authorised_value_images,
547
                     subtitle                => $subtitle,
551
                    subtitle                => $subtitle,
548
    );
552
    );
549
553
550
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
554
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
Lines 590-600 if ( $isbn or $ean or $oclc or $upc ) { Link Here
590
    $content_identifier_exists = 1;
594
    $content_identifier_exists = 1;
591
}
595
}
592
$template->param(
596
$template->param(
593
	normalized_upc => $upc,
597
    normalized_upc => $upc,
594
	normalized_ean => $ean,
598
    normalized_ean => $ean,
595
	normalized_oclc => $oclc,
599
    normalized_oclc => $oclc,
596
	normalized_isbn => $isbn,
600
    normalized_isbn => $isbn,
597
	content_identifier_exists =>  $content_identifier_exists,
601
    content_identifier_exists =>  $content_identifier_exists,
598
);
602
);
599
603
600
# COinS format FIXME: for books Only
604
# COinS format FIXME: for books Only
Lines 628-641 foreach ( @$reviews ) { Link Here
628
    $_->{cardnumber}    = $borrowerData->{'cardnumber'};
632
    $_->{cardnumber}    = $borrowerData->{'cardnumber'};
629
    $_->{datereviewed} = format_date($_->{datereviewed});
633
    $_->{datereviewed} = format_date($_->{datereviewed});
630
    if ($borrowerData->{'borrowernumber'} eq $borrowernumber) {
634
    if ($borrowerData->{'borrowernumber'} eq $borrowernumber) {
631
		$_->{your_comment} = 1;
635
        $_->{your_comment} = 1;
632
		$loggedincommenter = 1;
636
        $loggedincommenter = 1;
633
	}
637
    }
634
}
638
}
635
639
636
640
637
if(C4::Context->preference("ISBD")) {
641
if(C4::Context->preference("ISBD")) {
638
	$template->param(ISBD => 1);
642
    $template->param(ISBD => 1);
639
}
643
}
640
644
641
$template->param(
645
$template->param(
Lines 676-689 foreach my $sc_field (@sc_fields) { Link Here
676
    $row_data{branch}  = $sc_field->subfield('9');
680
    $row_data{branch}  = $sc_field->subfield('9');
677
681
678
    if ($row_data{text} && $row_data{branch}) { 
682
    if ($row_data{text} && $row_data{branch}) { 
679
	push (@serialcollections, \%row_data);
683
        push (@serialcollections, \%row_data);
680
    }
684
    }
681
}
685
}
682
686
683
if (scalar(@serialcollections) > 0) {
687
if (scalar(@serialcollections) > 0) {
684
    $template->param(
688
    $template->param(
685
	serialcollection  => 1,
689
    serialcollection  => 1,
686
	serialcollections => \@serialcollections);
690
    serialcollections => \@serialcollections);
687
}
691
}
688
692
689
# Amazon.com Stuff
693
# Amazon.com Stuff
Lines 734-745 my $syndetics_elements; Link Here
734
if ( C4::Context->preference("SyndeticsEnabled") ) {
738
if ( C4::Context->preference("SyndeticsEnabled") ) {
735
    $template->param("SyndeticsEnabled" => 1);
739
    $template->param("SyndeticsEnabled" => 1);
736
    $template->param("SyndeticsClientCode" => C4::Context->preference("SyndeticsClientCode"));
740
    $template->param("SyndeticsClientCode" => C4::Context->preference("SyndeticsClientCode"));
737
	eval {
741
    eval {
738
	    $syndetics_elements = &get_syndetics_index($isbn,$upc,$oclc);
742
        $syndetics_elements = &get_syndetics_index($isbn,$upc,$oclc);
739
	    for my $element (values %$syndetics_elements) {
743
        for my $element (values %$syndetics_elements) {
740
		$template->param("Syndetics$element"."Exists" => 1 );
744
            $template->param("Syndetics$element"."Exists" => 1 );
741
		#warn "Exists: "."Syndetics$element"."Exists";
745
            #warn "Exists: "."Syndetics$element"."Exists";
742
	}
746
        }
743
    };
747
    };
744
    warn $@ if $@;
748
    warn $@ if $@;
745
}
749
}
Lines 747-768 if ( C4::Context->preference("SyndeticsEnabled") ) { Link Here
747
if ( C4::Context->preference("SyndeticsEnabled")
751
if ( C4::Context->preference("SyndeticsEnabled")
748
        && C4::Context->preference("SyndeticsSummary")
752
        && C4::Context->preference("SyndeticsSummary")
749
        && ( exists($syndetics_elements->{'SUMMARY'}) || exists($syndetics_elements->{'AVSUMMARY'}) ) ) {
753
        && ( exists($syndetics_elements->{'SUMMARY'}) || exists($syndetics_elements->{'AVSUMMARY'}) ) ) {
750
	eval {
754
    eval {
751
	    my $syndetics_summary = &get_syndetics_summary($isbn,$upc,$oclc, $syndetics_elements);
755
        my $syndetics_summary = &get_syndetics_summary($isbn,$upc,$oclc, $syndetics_elements);
752
	    $template->param( SYNDETICS_SUMMARY => $syndetics_summary );
756
        $template->param( SYNDETICS_SUMMARY => $syndetics_summary );
753
	};
757
    };
754
	warn $@ if $@;
758
    warn $@ if $@;
755
759
756
}
760
}
757
761
758
if ( C4::Context->preference("SyndeticsEnabled")
762
if ( C4::Context->preference("SyndeticsEnabled")
759
        && C4::Context->preference("SyndeticsTOC")
763
        && C4::Context->preference("SyndeticsTOC")
760
        && exists($syndetics_elements->{'TOC'}) ) {
764
        && exists($syndetics_elements->{'TOC'}) ) {
761
	eval {
765
    eval {
762
    my $syndetics_toc = &get_syndetics_toc($isbn,$upc,$oclc);
766
        my $syndetics_toc = &get_syndetics_toc($isbn,$upc,$oclc);
763
    $template->param( SYNDETICS_TOC => $syndetics_toc );
767
        $template->param( SYNDETICS_TOC => $syndetics_toc );
764
	};
768
    };
765
	warn $@ if $@;
769
    warn $@ if $@;
766
}
770
}
767
771
768
if ( C4::Context->preference("SyndeticsEnabled")
772
if ( C4::Context->preference("SyndeticsEnabled")
Lines 772-778 if ( C4::Context->preference("SyndeticsEnabled") Link Here
772
    my $syndetics_excerpt = &get_syndetics_excerpt($isbn,$upc,$oclc);
776
    my $syndetics_excerpt = &get_syndetics_excerpt($isbn,$upc,$oclc);
773
    $template->param( SYNDETICS_EXCERPT => $syndetics_excerpt );
777
    $template->param( SYNDETICS_EXCERPT => $syndetics_excerpt );
774
    };
778
    };
775
	warn $@ if $@;
779
    warn $@ if $@;
776
}
780
}
777
781
778
if ( C4::Context->preference("SyndeticsEnabled")
782
if ( C4::Context->preference("SyndeticsEnabled")
Lines 781-792 if ( C4::Context->preference("SyndeticsEnabled") Link Here
781
    my $syndetics_reviews = &get_syndetics_reviews($isbn,$upc,$oclc,$syndetics_elements);
785
    my $syndetics_reviews = &get_syndetics_reviews($isbn,$upc,$oclc,$syndetics_elements);
782
    $template->param( SYNDETICS_REVIEWS => $syndetics_reviews );
786
    $template->param( SYNDETICS_REVIEWS => $syndetics_reviews );
783
    };
787
    };
784
	warn $@ if $@;
788
    warn $@ if $@;
785
}
789
}
786
790
787
if ( C4::Context->preference("SyndeticsEnabled")
791
if ( C4::Context->preference("SyndeticsEnabled")
788
    && C4::Context->preference("SyndeticsAuthorNotes")
792
    && C4::Context->preference("SyndeticsAuthorNotes")
789
	&& exists($syndetics_elements->{'ANOTES'}) ) {
793
    && exists($syndetics_elements->{'ANOTES'}) ) {
790
    eval {
794
    eval {
791
    my $syndetics_anotes = &get_syndetics_anotes($isbn,$upc,$oclc);
795
    my $syndetics_anotes = &get_syndetics_anotes($isbn,$upc,$oclc);
792
    $template->param( SYNDETICS_ANOTES => $syndetics_anotes );
796
    $template->param( SYNDETICS_ANOTES => $syndetics_anotes );
Lines 843-876 if (C4::Context->preference("OPACShelfBrowser")) { Link Here
843
}
847
}
844
848
845
if (C4::Context->preference("BakerTaylorEnabled")) {
849
if (C4::Context->preference("BakerTaylorEnabled")) {
846
	$template->param(
850
    $template->param(
847
		BakerTaylorEnabled  => 1,
851
        BakerTaylorEnabled  => 1,
848
		BakerTaylorImageURL => &image_url(),
852
        BakerTaylorImageURL => &image_url(),
849
		BakerTaylorLinkURL  => &link_url(),
853
        BakerTaylorLinkURL  => &link_url(),
850
		BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
854
        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
851
	);
855
    );
852
	my ($bt_user, $bt_pass);
856
    my ($bt_user, $bt_pass);
853
	if ($isbn and
857
    if ($isbn and
854
		$bt_user = C4::Context->preference('BakerTaylorUsername') and
858
        $bt_user = C4::Context->preference('BakerTaylorUsername') and
855
		$bt_pass = C4::Context->preference('BakerTaylorPassword')    )
859
        $bt_pass = C4::Context->preference('BakerTaylorPassword')    )
856
	{
860
    {
857
		$template->param(
861
        $template->param(
858
		BakerTaylorContentURL   =>
862
        BakerTaylorContentURL   =>
859
		sprintf("http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
863
        sprintf("http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
860
				$bt_user,$bt_pass,$isbn)
864
                $bt_user,$bt_pass,$isbn)
861
		);
865
        );
862
	}
866
    }
863
}
867
}
864
868
865
my $tag_quantity;
869
my $tag_quantity;
866
if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail')) {
870
if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail')) {
867
	$template->param(
871
    $template->param(
868
		TagsEnabled => 1,
872
        TagsEnabled => 1,
869
		TagsShowOnDetail => $tag_quantity,
873
        TagsShowOnDetail => $tag_quantity,
870
		TagsInputOnDetail => C4::Context->preference('TagsInputOnDetail')
874
        TagsInputOnDetail => C4::Context->preference('TagsInputOnDetail')
871
	);
875
    );
872
	$template->param(TagLoop => get_tags({biblionumber=>$biblionumber, approved=>1,
876
    $template->param(TagLoop => get_tags({biblionumber=>$biblionumber, approved=>1,
873
								'sort'=>'-weight', limit=>$tag_quantity}));
877
                                'sort'=>'-weight', limit=>$tag_quantity}));
874
}
878
}
875
879
876
if (C4::Context->preference("OPACURLOpenInNewWindow")) {
880
if (C4::Context->preference("OPACURLOpenInNewWindow")) {
877
- 

Return to bug 7379