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

(-)a/catalogue/detail.pl (-47 / +52 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($copynumbers) && 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/catalogue/moredetail.pl (-9 / +17 lines)
Lines 31-39 use C4::Output; Link Here
31
use C4::Auth;
31
use C4::Auth;
32
use C4::Serials;
32
use C4::Serials;
33
use C4::Dates qw/format_date/;
33
use C4::Dates qw/format_date/;
34
use C4::Circulation;  # to use itemissues
34
use C4::Circulation;    # to use itemissues
35
use C4::Members; # to use GetMember
35
use C4::Members;        # to use GetMember
36
use C4::Search;		# enabled_staff_search_views
36
use C4::Search;	        # enabled_staff_search_views
37
use C4::Members qw/GetHideLostItemsPreference/;
37
use C4::Members qw/GetHideLostItemsPreference/;
38
38
39
my $query=new CGI;
39
my $query=new CGI;
Lines 115-122 $data->{'count'}=$totalcount; Link Here
115
$data->{'showncount'}=$showncount;
115
$data->{'showncount'}=$showncount;
116
$data->{'hiddencount'}=$hiddencount;  # can be zero
116
$data->{'hiddencount'}=$hiddencount;  # can be zero
117
117
118
my $ccodes= GetKohaAuthorisedValues('items.ccode',$fw);
118
my $ccodes      = GetKohaAuthorisedValues('items.ccode',$fw);
119
my $itemtypes = GetItemTypes;
119
my $copynumbers = GetKohaAuthorisedValues('items.copynumber',$fw);
120
my $itemtypes   = GetItemTypes;
120
121
121
$data->{'itemtypename'} = $itemtypes->{$data->{'itemtype'}}->{'description'};
122
$data->{'itemtypename'} = $itemtypes->{$data->{'itemtype'}}->{'description'};
122
123
Lines 132-139 foreach my $item (@items){ Link Here
132
    $item->{'itype'}                   = $itemtypes->{ $item->{'itype'} }->{'description'};
133
    $item->{'itype'}                   = $itemtypes->{ $item->{'itype'} }->{'description'};
133
    $item->{'replacementprice'}        = sprintf( "%.2f", $item->{'replacementprice'} );
134
    $item->{'replacementprice'}        = sprintf( "%.2f", $item->{'replacementprice'} );
134
    $item->{$_}                        = format_date( $item->{$_} ) foreach qw/datelastborrowed dateaccessioned datelastseen lastreneweddate/;
135
    $item->{$_}                        = format_date( $item->{$_} ) foreach qw/datelastborrowed dateaccessioned datelastseen lastreneweddate/;
135
    $item->{'copyvol'}                 = $item->{'copynumber'};
136
    if ( defined $item->{'copynumber'} ) {
136
137
        $item->{'displaycopy'} = 1;
138
        if ($copynumbers) {
139
            $item->{'copyvol'} = $copynumbers->{ $item->{'copynumber'} }
140
        }
141
        else {
142
            $item->{'copyvol'} = $item->{'copynumber'};
143
        }
144
    }
137
145
138
    # item has a host number if its biblio number does not match the current bib
146
    # item has a host number if its biblio number does not match the current bib
139
    if ($item->{biblionumber} ne $biblionumber){
147
    if ($item->{biblionumber} ne $biblionumber){
Lines 170-178 foreach my $item (@items){ Link Here
170
    }
178
    }
171
}
179
}
172
$template->param(count => $data->{'count'},
180
$template->param(count => $data->{'count'},
173
	subscriptionsnumber => $subscriptionsnumber,
181
    subscriptionsnumber => $subscriptionsnumber,
174
    subscriptiontitle   => $data->{title},
182
    subscriptiontitle   => $data->{title},
175
	C4::Search::enabled_staff_search_views,
183
    C4::Search::enabled_staff_search_views,
176
);
184
);
177
185
178
$template->param(
186
$template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt (-1 / +1 lines)
Lines 56-62 Link Here
56
	    [% END %]
56
	    [% END %]
57
            [% IF ( ITEM_DAT.collection ) %]<li><span class="label">Collection:</span> [% ITEM_DAT.collection %]</li> [% END %]
57
            [% IF ( ITEM_DAT.collection ) %]<li><span class="label">Collection:</span> [% ITEM_DAT.collection %]</li> [% END %]
58
            <li><span class="label">Item Callnumber:</span> [% ITEM_DAT.itemcallnumber %]&nbsp;</li>
58
            <li><span class="label">Item Callnumber:</span> [% ITEM_DAT.itemcallnumber %]&nbsp;</li>
59
            [% IF ( ITEM_DAT.copyvol ) %]<li><span class="label">Copy / Vol :</span> [% ITEM_DAT.copyvol %]&nbsp;</li> [% END %]
59
            [% IF ( ITEM_DAT.displaycopy ) %]<li><span class="label">Copy / Vol :</span> [% ITEM_DAT.copyvol %]&nbsp;</li> [% END %]
60
            [% IF ( ITEM_DAT.replacementprice ) %]<li><span class="label">Replacement Price:</span> [% ITEM_DAT.replacementprice %]&nbsp;</li> [% END %]
60
            [% IF ( ITEM_DAT.replacementprice ) %]<li><span class="label">Replacement Price:</span> [% ITEM_DAT.replacementprice %]&nbsp;</li> [% END %]
61
            </ol></div>
61
            </ol></div>
62
           <div class="listgroup"><h4>Statuses [% IF ( ITEM_DAT.status_advisory ) %](
62
           <div class="listgroup"><h4>Statuses [% IF ( ITEM_DAT.status_advisory ) %](
(-)a/opac/opac-detail.pl (-110 / +112 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 420-427 if ( $itemtype ) { Link Here
420
    $dat->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} );
420
    $dat->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} );
421
    $dat->{'description'} = $itemtypes->{$itemtype}->{'description'};
421
    $dat->{'description'} = $itemtypes->{$itemtype}->{'description'};
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
    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
    my $copynumber = $itm->{'copynumber'};
488
    $itm->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumbers) && defined($copynumber) && exists( $copynumbers->{$copynumber} ) );
489
    
487
    if ( defined $itm->{'location'} ) {
490
    if ( defined $itm->{'location'} ) {
488
        $itm->{'location_description'} = $shelflocations->{ $itm->{'location'} };
491
        $itm->{'location_description'} = $shelflocations->{ $itm->{'location'} };
489
    }
492
    }
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'} ) );
502
     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' ] ) );
503
     # warn( Data::Dumper->Dump( [ $item_authorised_value_images ], [ 'item_authorised_value_images' ] ) );
501
504
502
     if ( $itm->{'itemlost'} ) {
505
    if ( $itm->{'itemlost'} ) {
503
         my $lostimageinfo = List::Util::first { $_->{'category'} eq 'LOST' } @$item_authorised_value_images;
506
        my $lostimageinfo = List::Util::first { $_->{'category'} eq 'LOST' } @$item_authorised_value_images;
504
         $itm->{'lostimageurl'}   = $lostimageinfo->{ 'imageurl' };
507
        $itm->{'lostimageurl'}   = $lostimageinfo->{ 'imageurl' };
505
         $itm->{'lostimagelabel'} = $lostimageinfo->{ 'label' };
508
        $itm->{'lostimagelabel'} = $lostimageinfo->{ 'label' };
506
     }
509
    }
507
510
508
     if( $itm->{'count_reserves'}){
511
    if( $itm->{'count_reserves'}){
509
          if( $itm->{'count_reserves'} eq "Waiting"){ $itm->{'waiting'} = 1; }
512
        if( $itm->{'count_reserves'} eq "Waiting"){ $itm->{'waiting'} = 1; }
510
          if( $itm->{'count_reserves'} eq "Reserved"){ $itm->{'onhold'} = 1; }
513
        if( $itm->{'count_reserves'} eq "Reserved"){ $itm->{'onhold'} = 1; }
511
     }
514
    }
512
    
515
513
     my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
516
    my ( $transfertwhen, $transfertfrom, $transfertto ) = GetTransfers($itm->{itemnumber});
514
     if ( defined( $transfertwhen ) && $transfertwhen ne '' ) {
517
    if ( defined( $transfertwhen ) && $transfertwhen ne '' ) {
515
        $itm->{transfertwhen} = format_date($transfertwhen);
518
        $itm->{transfertwhen} = format_date($transfertwhen);
516
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
519
        $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
517
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
520
        $itm->{transfertto}   = $branches->{$transfertto}{branchname};
518
     }
521
    }
519
}
522
}
520
523
521
## get notes and subjects from MARC record
524
## get notes and subjects from MARC record
522
my $dbh              = C4::Context->dbh;
525
my $dbh                 = C4::Context->dbh;
523
my $marcnotesarray   = GetMarcNotes   ($record,$marcflavour);
526
my $marcnotesarray      = GetMarcNotes   ($record,$marcflavour);
524
my $marcisbnsarray   = GetMarcISBN    ($record,$marcflavour);
527
my $marcisbnsarray      = GetMarcISBN    ($record,$marcflavour);
525
my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour);
528
my $marcauthorsarray    = GetMarcAuthors ($record,$marcflavour);
526
my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour);
529
my $marcsubjctsarray    = GetMarcSubjects($record,$marcflavour);
527
my $marcseriesarray  = GetMarcSeries  ($record,$marcflavour);
530
my $marcseriesarray     = GetMarcSeries  ($record,$marcflavour);
528
my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
531
my $marcurlsarray       = GetMarcUrls    ($record,$marcflavour);
529
my $marchostsarray  = GetMarcHosts($record,$marcflavour);
532
my $marchostsarray      = GetMarcHosts($record,$marcflavour);
530
my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
533
my $subtitle            = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
531
534
532
    $template->param(
535
    $template->param(
533
                     MARCNOTES               => $marcnotesarray,
536
                    MARCNOTES               => $marcnotesarray,
534
                     MARCSUBJCTS             => $marcsubjctsarray,
537
                    MARCSUBJCTS             => $marcsubjctsarray,
535
                     MARCAUTHORS             => $marcauthorsarray,
538
                    MARCAUTHORS             => $marcauthorsarray,
536
                     MARCSERIES              => $marcseriesarray,
539
                    MARCSERIES              => $marcseriesarray,
537
                     MARCURLS                => $marcurlsarray,
540
                    MARCURLS                => $marcurlsarray,
538
		     MARCHOSTS               => $marchostsarray,
541
                    MARCHOSTS               => $marchostsarray,
539
                     norequests              => $norequests,
542
                    norequests              => $norequests,
540
                     RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
543
                    RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
541
                     itemdata_ccode          => $itemfields{ccode},
544
                    itemdata_ccode          => $itemfields{ccode},
542
                     itemdata_enumchron      => $itemfields{enumchron},
545
                    itemdata_enumchron      => $itemfields{enumchron},
543
                     itemdata_uri            => $itemfields{uri},
546
                    itemdata_uri            => $itemfields{uri},
544
                     itemdata_copynumber     => $itemfields{copynumber},
547
                    itemdata_copynumber     => $itemfields{copynumber},
545
                     itemdata_itemnotes          => $itemfields{itemnotes},
548
                    itemdata_itemnotes      => $itemfields{itemnotes},
546
                     authorised_value_images => $biblio_authorised_value_images,
549
                    authorised_value_images => $biblio_authorised_value_images,
547
                     subtitle                => $subtitle,
550
                    subtitle                => $subtitle,
548
    );
551
    );
549
552
550
if (C4::Context->preference("AlternateHoldingsField") && scalar @items == 0) {
553
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;
593
    $content_identifier_exists = 1;
591
}
594
}
592
$template->param(
595
$template->param(
593
	normalized_upc => $upc,
596
    normalized_upc => $upc,
594
	normalized_ean => $ean,
597
    normalized_ean => $ean,
595
	normalized_oclc => $oclc,
598
    normalized_oclc => $oclc,
596
	normalized_isbn => $isbn,
599
    normalized_isbn => $isbn,
597
	content_identifier_exists =>  $content_identifier_exists,
600
    content_identifier_exists =>  $content_identifier_exists,
598
);
601
);
599
602
600
# COinS format FIXME: for books Only
603
# COinS format FIXME: for books Only
Lines 628-641 foreach ( @$reviews ) { Link Here
628
    $_->{cardnumber}    = $borrowerData->{'cardnumber'};
631
    $_->{cardnumber}    = $borrowerData->{'cardnumber'};
629
    $_->{datereviewed} = format_date($_->{datereviewed});
632
    $_->{datereviewed} = format_date($_->{datereviewed});
630
    if ($borrowerData->{'borrowernumber'} eq $borrowernumber) {
633
    if ($borrowerData->{'borrowernumber'} eq $borrowernumber) {
631
		$_->{your_comment} = 1;
634
        $_->{your_comment} = 1;
632
		$loggedincommenter = 1;
635
        $loggedincommenter = 1;
633
	}
636
    }
634
}
637
}
635
638
636
639
637
if(C4::Context->preference("ISBD")) {
640
if(C4::Context->preference("ISBD")) {
638
	$template->param(ISBD => 1);
641
    $template->param(ISBD => 1);
639
}
642
}
640
643
641
$template->param(
644
$template->param(
Lines 676-689 foreach my $sc_field (@sc_fields) { Link Here
676
    $row_data{branch}  = $sc_field->subfield('9');
679
    $row_data{branch}  = $sc_field->subfield('9');
677
680
678
    if ($row_data{text} && $row_data{branch}) { 
681
    if ($row_data{text} && $row_data{branch}) { 
679
	push (@serialcollections, \%row_data);
682
        push (@serialcollections, \%row_data);
680
    }
683
    }
681
}
684
}
682
685
683
if (scalar(@serialcollections) > 0) {
686
if (scalar(@serialcollections) > 0) {
684
    $template->param(
687
    $template->param(
685
	serialcollection  => 1,
688
    serialcollection  => 1,
686
	serialcollections => \@serialcollections);
689
    serialcollections => \@serialcollections);
687
}
690
}
688
691
689
# Amazon.com Stuff
692
# Amazon.com Stuff
Lines 734-745 my $syndetics_elements; Link Here
734
if ( C4::Context->preference("SyndeticsEnabled") ) {
737
if ( C4::Context->preference("SyndeticsEnabled") ) {
735
    $template->param("SyndeticsEnabled" => 1);
738
    $template->param("SyndeticsEnabled" => 1);
736
    $template->param("SyndeticsClientCode" => C4::Context->preference("SyndeticsClientCode"));
739
    $template->param("SyndeticsClientCode" => C4::Context->preference("SyndeticsClientCode"));
737
	eval {
740
    eval {
738
	    $syndetics_elements = &get_syndetics_index($isbn,$upc,$oclc);
741
        $syndetics_elements = &get_syndetics_index($isbn,$upc,$oclc);
739
	    for my $element (values %$syndetics_elements) {
742
        for my $element (values %$syndetics_elements) {
740
		$template->param("Syndetics$element"."Exists" => 1 );
743
            $template->param("Syndetics$element"."Exists" => 1 );
741
		#warn "Exists: "."Syndetics$element"."Exists";
744
            #warn "Exists: "."Syndetics$element"."Exists";
742
	}
745
        }
743
    };
746
    };
744
    warn $@ if $@;
747
    warn $@ if $@;
745
}
748
}
Lines 747-768 if ( C4::Context->preference("SyndeticsEnabled") ) { Link Here
747
if ( C4::Context->preference("SyndeticsEnabled")
750
if ( C4::Context->preference("SyndeticsEnabled")
748
        && C4::Context->preference("SyndeticsSummary")
751
        && C4::Context->preference("SyndeticsSummary")
749
        && ( exists($syndetics_elements->{'SUMMARY'}) || exists($syndetics_elements->{'AVSUMMARY'}) ) ) {
752
        && ( exists($syndetics_elements->{'SUMMARY'}) || exists($syndetics_elements->{'AVSUMMARY'}) ) ) {
750
	eval {
753
    eval {
751
	    my $syndetics_summary = &get_syndetics_summary($isbn,$upc,$oclc, $syndetics_elements);
754
        my $syndetics_summary = &get_syndetics_summary($isbn,$upc,$oclc, $syndetics_elements);
752
	    $template->param( SYNDETICS_SUMMARY => $syndetics_summary );
755
        $template->param( SYNDETICS_SUMMARY => $syndetics_summary );
753
	};
756
    };
754
	warn $@ if $@;
757
    warn $@ if $@;
755
758
756
}
759
}
757
760
758
if ( C4::Context->preference("SyndeticsEnabled")
761
if ( C4::Context->preference("SyndeticsEnabled")
759
        && C4::Context->preference("SyndeticsTOC")
762
        && C4::Context->preference("SyndeticsTOC")
760
        && exists($syndetics_elements->{'TOC'}) ) {
763
        && exists($syndetics_elements->{'TOC'}) ) {
761
	eval {
764
    eval {
762
    my $syndetics_toc = &get_syndetics_toc($isbn,$upc,$oclc);
765
        my $syndetics_toc = &get_syndetics_toc($isbn,$upc,$oclc);
763
    $template->param( SYNDETICS_TOC => $syndetics_toc );
766
        $template->param( SYNDETICS_TOC => $syndetics_toc );
764
	};
767
    };
765
	warn $@ if $@;
768
    warn $@ if $@;
766
}
769
}
767
770
768
if ( C4::Context->preference("SyndeticsEnabled")
771
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);
775
    my $syndetics_excerpt = &get_syndetics_excerpt($isbn,$upc,$oclc);
773
    $template->param( SYNDETICS_EXCERPT => $syndetics_excerpt );
776
    $template->param( SYNDETICS_EXCERPT => $syndetics_excerpt );
774
    };
777
    };
775
	warn $@ if $@;
778
    warn $@ if $@;
776
}
779
}
777
780
778
if ( C4::Context->preference("SyndeticsEnabled")
781
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);
784
    my $syndetics_reviews = &get_syndetics_reviews($isbn,$upc,$oclc,$syndetics_elements);
782
    $template->param( SYNDETICS_REVIEWS => $syndetics_reviews );
785
    $template->param( SYNDETICS_REVIEWS => $syndetics_reviews );
783
    };
786
    };
784
	warn $@ if $@;
787
    warn $@ if $@;
785
}
788
}
786
789
787
if ( C4::Context->preference("SyndeticsEnabled")
790
if ( C4::Context->preference("SyndeticsEnabled")
788
    && C4::Context->preference("SyndeticsAuthorNotes")
791
    && C4::Context->preference("SyndeticsAuthorNotes")
789
	&& exists($syndetics_elements->{'ANOTES'}) ) {
792
    && exists($syndetics_elements->{'ANOTES'}) ) {
790
    eval {
793
    eval {
791
    my $syndetics_anotes = &get_syndetics_anotes($isbn,$upc,$oclc);
794
    my $syndetics_anotes = &get_syndetics_anotes($isbn,$upc,$oclc);
792
    $template->param( SYNDETICS_ANOTES => $syndetics_anotes );
795
    $template->param( SYNDETICS_ANOTES => $syndetics_anotes );
Lines 843-876 if (C4::Context->preference("OPACShelfBrowser")) { Link Here
843
}
846
}
844
847
845
if (C4::Context->preference("BakerTaylorEnabled")) {
848
if (C4::Context->preference("BakerTaylorEnabled")) {
846
	$template->param(
849
    $template->param(
847
		BakerTaylorEnabled  => 1,
850
        BakerTaylorEnabled  => 1,
848
		BakerTaylorImageURL => &image_url(),
851
        BakerTaylorImageURL => &image_url(),
849
		BakerTaylorLinkURL  => &link_url(),
852
        BakerTaylorLinkURL  => &link_url(),
850
		BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
853
        BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
851
	);
854
    );
852
	my ($bt_user, $bt_pass);
855
    my ($bt_user, $bt_pass);
853
	if ($isbn and
856
    if ($isbn and
854
		$bt_user = C4::Context->preference('BakerTaylorUsername') and
857
        $bt_user = C4::Context->preference('BakerTaylorUsername') and
855
		$bt_pass = C4::Context->preference('BakerTaylorPassword')    )
858
        $bt_pass = C4::Context->preference('BakerTaylorPassword')    )
856
	{
859
    {
857
		$template->param(
860
        $template->param(
858
		BakerTaylorContentURL   =>
861
        BakerTaylorContentURL   =>
859
		sprintf("http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
862
        sprintf("http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=%s&Password=%s&ItemKey=%s&Options=Y",
860
				$bt_user,$bt_pass,$isbn)
863
                $bt_user,$bt_pass,$isbn)
861
		);
864
        );
862
	}
865
    }
863
}
866
}
864
867
865
my $tag_quantity;
868
my $tag_quantity;
866
if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail')) {
869
if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->preference('TagsShowOnDetail')) {
867
	$template->param(
870
    $template->param(
868
		TagsEnabled => 1,
871
        TagsEnabled => 1,
869
		TagsShowOnDetail => $tag_quantity,
872
        TagsShowOnDetail => $tag_quantity,
870
		TagsInputOnDetail => C4::Context->preference('TagsInputOnDetail')
873
        TagsInputOnDetail => C4::Context->preference('TagsInputOnDetail')
871
	);
874
    );
872
	$template->param(TagLoop => get_tags({biblionumber=>$biblionumber, approved=>1,
875
    $template->param(TagLoop => get_tags({biblionumber=>$biblionumber, approved=>1,
873
								'sort'=>'-weight', limit=>$tag_quantity}));
876
                                'sort'=>'-weight', limit=>$tag_quantity}));
874
}
877
}
875
878
876
if (C4::Context->preference("OPACURLOpenInNewWindow")) {
879
if (C4::Context->preference("OPACURLOpenInNewWindow")) {
877
- 

Return to bug 7379