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

(-)a/catalogue/detail.pl (-58 / +8 lines)
Lines 190-204 $template->param( Link Here
190
);
190
);
191
191
192
my $itemtypes = { map { $_->itemtype => $_ } @{ Koha::ItemTypes->search_with_localization->as_list } };
192
my $itemtypes = { map { $_->itemtype => $_ } @{ Koha::ItemTypes->search_with_localization->as_list } };
193
my $all_items = $biblio->items->search_ordered;
193
my $params;
194
my @items;
195
my $patron = Koha::Patrons->find( $borrowernumber );
194
my $patron = Koha::Patrons->find( $borrowernumber );
196
while ( my $item = $all_items->next ) {
195
$params->{ itemlost } = 0 if $patron->category->hidelostitems && !$showallitems;
197
    push @items, $item
196
my @items = $biblio->items->search_ordered( $params )->as_list;
198
      unless $item->itemlost
199
      && $patron->category->hidelostitems
200
      && !$showallitems;
201
}
202
197
203
# flag indicating existence of at least one item linked via a host record
198
# flag indicating existence of at least one item linked via a host record
204
my $hostrecords;
199
my $hostrecords;
Lines 210-215 if ( $hostitems->count ) { Link Here
210
}
205
}
211
206
212
my $dat = &GetBiblioData($biblionumber);
207
my $dat = &GetBiblioData($biblionumber);
208
$dat->{'count'} = $biblio->items->count + $hostitems->count;
209
$dat->{'showncount'} = scalar @items + $hostitems->count;
210
$dat->{'hiddencount'} = $dat->{'count'} - $dat->{'showncount'};
211
212
213
213
214
#is biblio a collection and are bundles enabled
214
#is biblio a collection and are bundles enabled
215
my $leader = $marc_record->leader();
215
my $leader = $marc_record->leader();
Lines 320-335 if ( defined $dat->{'itemtype'} ) { Link Here
320
    $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }->imageurl );
320
    $dat->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $dat->{itemtype} }->imageurl );
321
}
321
}
322
322
323
$dat->{'count'} = $all_items->count + $hostitems->count;
324
$dat->{'showncount'} = scalar @items + $hostitems->count;
325
$dat->{'hiddencount'} = $all_items->count + $hostitems->count - scalar @items;
326
327
my $shelflocations =
328
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $fw, kohafield => 'items.location' } ) };
329
my $collections =
330
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $fw, kohafield => 'items.ccode' } ) };
331
my $copynumbers =
332
  { map { $_->{authorised_value} => $_->{lib} } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => $fw, kohafield => 'items.copynumber' } ) };
333
my (@itemloop, @otheritemloop, %itemfields);
323
my (@itemloop, @otheritemloop, %itemfields);
334
324
335
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
325
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $fw, kohafield => 'items.itemlost', authorised_value => [ -and => {'!=' => undef }, {'!=' => ''}] });
Lines 371-384 foreach my $item (@items) { Link Here
371
    my $item_info = $item->unblessed;
361
    my $item_info = $item->unblessed;
372
    $item_info->{itemtype} = $itemtypes->{$item->effective_itemtype};
362
    $item_info->{itemtype} = $itemtypes->{$item->effective_itemtype};
373
363
374
    #get shelf location and collection code description if they are authorised value.
375
    # same thing for copy number
376
    my $shelfcode = $item->location;
377
    $item_info->{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
378
    my $ccode = $item->ccode;
379
    $item_info->{'ccode'} = $collections->{$ccode} if ( defined( $ccode ) && defined($collections) && exists( $collections->{$ccode} ) );
380
    my $copynumber = $item->copynumber;
381
    $item_info->{'copynumber'} = $copynumbers->{$copynumber} if ( defined($copynumber) && defined($copynumbers) && exists( $copynumbers->{$copynumber} ) );
382
    foreach (qw(ccode enumchron copynumber stocknumber itemnotes itemnotes_nonpublic uri )) {
364
    foreach (qw(ccode enumchron copynumber stocknumber itemnotes itemnotes_nonpublic uri )) {
383
        $itemfields{$_} = 1 if $item->$_;
365
        $itemfields{$_} = 1 if $item->$_;
384
    }
366
    }
Lines 398-418 foreach my $item (@items) { Link Here
398
        $item_info->{first_hold} = $first_hold;
380
        $item_info->{first_hold} = $first_hold;
399
    }
381
    }
400
382
401
    $item_info->{checkout} = $item->checkout;
402
403
    # Check the transit status
404
    my $transfer = $item->get_transfer;
405
    if ( $transfer ) {
406
        $item_info->{transfer} = $transfer;
407
    }
408
409
    foreach my $f (qw( itemnotes )) {
410
        if ($item_info->{$f}) {
411
            $item_info->{$f} =~ s|\n|<br />|g;
412
            $itemfields{$f} = 1;
413
        }
414
    }
415
416
    #item has a host number if its biblio number does not match the current bib
383
    #item has a host number if its biblio number does not match the current bib
417
384
418
    if ($item->biblionumber ne $biblionumber){
385
    if ($item->biblionumber ne $biblionumber){
Lines 444-466 foreach my $item (@items) { Link Here
444
411
445
    $item_info->{can_be_edited} = $patron->can_edit_item( $item );
412
    $item_info->{can_be_edited} = $patron->can_edit_item( $item );
446
413
447
    if ( C4::Context->preference("LocalCoverImages") == 1 ) {
448
        $item_info->{cover_images} = $item->cover_images;
449
    }
450
451
    if ( C4::Context->preference('UseRecalls') ) {
452
        $item_info->{recall} = $item->recall;
453
    }
454
455
    if ( C4::Context->preference('IndependentBranches') ) {
456
        my $userenv = C4::Context->userenv();
457
        if ( not C4::Context->IsSuperLibrarian()
458
            and $userenv->{branch} ne $item->homebranch ) {
459
            $item_info->{cannot_be_edited} = 1;
460
            $item_info->{not_same_branch} = 1;
461
        }
462
    }
463
464
    if ( $item->is_bundle ) {
414
    if ( $item->is_bundle ) {
465
        $item_info->{bundled} =
415
        $item_info->{bundled} =
466
          $item->bundle_items->search( { itemlost => { '!=' => 0 } } )
416
          $item->bundle_items->search( { itemlost => { '!=' => 0 } } )
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-178 / +171 lines)
Lines 380-571 Link Here
380
        <tbody>
380
        <tbody>
381
            [% FOREACH item IN items %]
381
            [% FOREACH item IN items %]
382
                <tr id="item_[% item.itemnumber | html %]" data-itemnumber="[% item.itemnumber | html %]" data-duedate="[% item.datedue | html %]">
382
                <tr id="item_[% item.itemnumber | html %]" data-itemnumber="[% item.itemnumber | html %]" data-duedate="[% item.datedue | html %]">
383
                [% IF (StaffDetailItemSelection) %]
383
                [%- IF (StaffDetailItemSelection) %]
384
                    <td style="text-align:center;vertical-align:middle">
384
                    <td style="text-align:center;vertical-align:middle">
385
                        [% IF item.can_be_edited %]
385
                        [%- IF item.can_be_edited %]
386
                            <input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" />
386
                            <input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" />
387
                        [% END %]
387
                        [%- END %]
388
                    </td>
388
                    </td>
389
                [% END %]
389
                [%- END %]
390
                    [% IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
390
                    [%- IF Koha.Preference('LocalCoverImages') && ( tab == 'holdings' && itemloop_has_images || tab == 'otherholdings' && otheritemloop_has_images ) %]
391
                        <td class="cover">
391
                        <td class="cover">
392
                            <div class="bookcoverimg">
392
                            <div class="bookcoverimg">
393
                                <div class="cover-slider">
393
                                <div class="cover-slider">
394
                                    [% FOREACH image IN item.cover_images %]
394
                                    [%- FOREACH image IN item.object.cover_images %]
395
                                        <div class="cover-image local-coverimg">
395
                                        <div class="cover-image local-coverimg">
396
                                            <a href="/cgi-bin/koha/catalogue/image.pl?itemnumber=[% image.itemnumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]" title="Local cover image">
396
                                            <a href="/cgi-bin/koha/catalogue/image.pl?itemnumber=[% image.itemnumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]" title="Local cover image">
397
                                                <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" alt="Local cover image" data-link="/cgi-bin/koha/catalogue/imageviewer.pl?itemnumber=[% item.itemnumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]" />
397
                                                <img src="/cgi-bin/koha/catalogue/image.pl?thumbnail=1&amp;imagenumber=[% image.imagenumber | uri %]" alt="Local cover image" data-link="/cgi-bin/koha/catalogue/imageviewer.pl?itemnumber=[% item.itemnumber | uri %]&amp;imagenumber=[% image.imagenumber | uri %]" />
398
                                            </a>
398
                                            </a>
399
                                        </div>
399
                                        </div>
400
                                    [% END %]
400
                                    [%- END %]
401
                                </div>
401
                                </div>
402
                            </div>
402
                            </div>
403
                        </td>
403
                        </td>
404
                    [% END %]
404
                    [%- END %]
405
405
406
                    [% IF ( item_level_itypes ) %]
406
                    [%- IF ( item_level_itypes ) %]
407
                        <td class="itype">
407
                        <td class="itype">
408
                            [% SET itemtype = item.itemtype %]
408
                            [%- SET itemtype = item.itemtype %]
409
                            [% IF !noItemTypeImages && itemtype.image_location('intranet') %]
409
                            [%- IF !noItemTypeImages && itemtype.image_location('intranet') %]
410
                                <img src="[% itemtype.image_location('intranet') | html %]" alt="[% itemtype.translated_description | html %]" title="[% itemtype.translated_description | html %]" />
410
                                <img src="[% itemtype.image_location('intranet') | html %]" alt="[% itemtype.translated_description | html %]" title="[% itemtype.translated_description | html %]" />
411
                            [% END %]
411
                            [%- END %]
412
                            <span class="itypedesc itypetext">[% itemtype.translated_description | html %]</span>
412
                            <span class="itypedesc itypetext">[% itemtype.translated_description | html %]</span>
413
                        </td>
413
                        </td>
414
                    [% END %]
414
                    [%- END %]
415
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.holdingbranch ) | html %] [% END %]</td>
415
                    <td class="location">[% UNLESS ( singlebranchmode ) %][% Branches.GetName( item.holdingbranch ) | html %] [% END %]</td>
416
                    <td class="homebranch">
416
                    <td class="homebranch">
417
                        <span class="homebranchdesc">[% Branches.GetName(item.homebranch) | html %]</span>
417
                        <span class="homebranchdesc">[% Branches.GetName(item.homebranch) | html %]</span>
418
                        <span class="shelvingloc">
418
                        <span class="shelvingloc">
419
<!--
419
                    [%# If permanent location is defined, show description or code and 
420
If permanent location is defined, show description or code and display current location in parentheses. If not, display current location.
420
                        display current location in parentheses. If not, display current location.
421
Note that permanent location is a code, and location may be an authval.
421
                        Note that permanent location is a code, and location may be an authval.
422
-->
422
                    %]
423
                            [% IF item.permanent_location %]
423
                            [%- IF item.permanent_location %]
424
                                [% SET permloc_authval = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.permanent_location ) %]
424
                                [%- SET permloc_authval = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.permanent_location ) %]
425
                                [% permloc_authval | html %]
425
                                [%- permloc_authval | html %]
426
                                [% IF item.location AND item.location != permloc_authval AND item.location != item.permanent_location %]
426
                                [%- SET item_locatoin = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) %]
427
                                    ([% item.location | html %])
427
                                [%- IF item_location AND item_location != permloc_authval AND item.location != item.permanent_location %]
428
                                [% END %]
428
                                    ([% item_location | html %])
429
                            [% ELSE %]
429
                                [%- END %]
430
                                [% item.location | html %]
430
                            [%- ELSE %]
431
                            [% END %]
431
                                [%- item_location | html %]
432
                            [%- END %]
432
                        </span>
433
                        </span>
433
                    </td>
434
                    </td>
434
                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode | html %]</td>[% END %]
435
                    [%- IF ( itemdata_ccode ) %]<td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>[% END %]
435
                    [% IF Koha.Preference('EnableItemGroups') %]<td class="item_group">[% item.object.item_group.description | html %]</td>[% END %]
436
                    [%- IF Koha.Preference('EnableItemGroups') %]<td class="item_group">[% item.object.item_group.description | html %]</td>[% END %]
436
                    <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td>
437
                    <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber | html %][% END %]</td>
437
                    [% IF ( volinfo ) %]
438
                    [%- IF ( volinfo ) %]
438
                        [% SET serial = item.itemserial.serial %]
439
                        [%- SET serial = item.itemserial.serial %]
439
                        [% IF itemdata_publisheddate #If there is at least one published date, use it for sorting %]
440
                        [%- IF itemdata_publisheddate #If there is at least one published date, use it for sorting %]
440
                            <td class="enumchron" data-order="[% serial.publisheddate | html %]">
441
                            <td class="enumchron" data-order="[% serial.publisheddate | html %]">
441
                        [% ELSE %]
442
                        [%- ELSE %]
442
                            <td class="enumchron">
443
                            <td class="enumchron">
443
                        [% END %]
444
                        [%- END %]
444
                            [% IF ( itemdata_enumchron ) %]
445
                            [%- IF ( itemdata_enumchron ) %]
445
                                [% IF item.enumchron && serial.serialseq %]
446
                                [%- IF item.enumchron && serial.serialseq %]
446
                                    <span class="enum">[% item.enumchron | html %]</span>
447
                                    <span class="enum">[% item.enumchron | html %]</span>
447
                                    [% IF ( item.serialseq && item.enumchron != serial.serialseq ) %]
448
                                    [%- IF ( item.serialseq && item.enumchron != serial.serialseq ) %]
448
                                        <span class="sep"> -- </span>
449
                                        <span class="sep"> -- </span>
449
                                        <span class="serialseq">[% serial.serialseq | html %]</span>
450
                                        <span class="serialseq">[% serial.serialseq | html %]</span>
450
                                    [% END %]
451
                                    [%- END %]
451
                                [% ELSIF item.enumchron %]
452
                                [%- ELSIF item.enumchron %]
452
                                    <span class="enum">[% item.enumchron | html %]</span>
453
                                    <span class="enum">[% item.enumchron | html %]</span>
453
                                [% ELSIF item.serialseq %]
454
                                [%- ELSIF item.serialseq %]
454
                                    <span class="serialseq">[% serial.serialseq | html %]</span>
455
                                    <span class="serialseq">[% serial.serialseq | html %]</span>
455
                                [% END %]
456
                                [%- END %]
456
                                [% IF serial.publisheddate %]
457
                                [%- IF serial.publisheddate %]
457
                                    <span class="pubdate">([% serial.publisheddate | $KohaDates %])</span>
458
                                    <span class="pubdate">([% serial.publisheddate | $KohaDates %])</span>
458
                                [% END %]
459
                                [%- END %]
459
                            [% END %]
460
                            [%- END %]
460
                            </span>
461
                            </span>
461
                        </td>
462
                        </td>
462
                    [% END %]
463
                    [%- END %]
463
                    <td class="status">
464
                    <td class="status">
464
465
465
                        [% IF item.checkout %]
466
                        [%- IF item.object.checkout %]
466
                          [% IF item.checkout.onsite_checkout %]
467
                          [%- IF item.checkout.onsite_checkout %]
467
                            <span>Currently in local use
468
                            <span>Currently in local use
468
                          [% ELSE %]
469
                          [%- ELSE %]
469
                            <span class="datedue">Checked out
470
                            <span class="datedue">Checked out
470
                          [% END %]
471
                          [%- END %]
471
                                [% UNLESS ( item.not_same_branch) %]
472
                                [%- IF item.can_be_edited %]
472
                                  [% IF item.checkout.onsite_checkout %]
473
                                  [%- IF item.object.checkout.onsite_checkout %]
473
                                    by
474
                                    by
474
                                  [% ELSE %]
475
                                  [%- ELSE %]
475
                                    to
476
                                    to
476
                                  [% END %]
477
                                  [%- END %]
477
                                  [% INCLUDE 'patron-title.inc' patron=item.checkout.patron hide_patron_infos_if_needed=1 %]
478
                                  [% INCLUDE 'patron-title.inc' patron=item.checkout.patron hide_patron_infos_if_needed=1 %]
478
                                [% END %]
479
                                [%- END %]
479
                                : due [% item.checkout.date_due | $KohaDates as_due_date => 1 %]
480
                                : due [% item.object.checkout.date_due | $KohaDates as_due_date => 1 %]
480
                            </span>
481
                            </span>
481
                        [% ELSIF ( item.transfer ) %]
482
                        [%- ELSIF ( transfer = item.object.get_transfer ) %]
482
                            [% IF (item.transfer.datesent) %]
483
                            [%- IF (transfer.datesent) %]
483
                                <span class="intransit">In transit from [% Branches.GetName( item.transfer.frombranch ) | html %] to [% Branches.GetName( item.transfer.tobranch ) | html %] since [% item.transfer.datesent | $KohaDates %]</span>
484
                                <span class="intransit">In transit from [% Branches.GetName( transfer.frombranch ) | html %] to [% Branches.GetName( transfer.tobranch ) | html %] since [% transfer.datesent | $KohaDates %]</span>
484
                            [% ELSE %]
485
                            [%- ELSE %]
485
                                <span class="transitrequested">Transit pending from [% Branches.GetName( item.transfer.frombranch ) | html %] to [% Branches.GetName( item.transfer.tobranch ) | html %] since [% item.transfer.daterequested | $KohaDates %]</span>
486
                                <span class="transitrequested">Transit pending from [% Branches.GetName( transfer.frombranch ) | html %] to [% Branches.GetName( transfer.tobranch ) | html %] since [% item.transfer.daterequested | $KohaDates %]</span>
486
487
487
                            [% END %]
488
                            [%- END %]
488
                        [% END %]
489
                        [%- END -%]
489
490
490
                        [% IF ( item.itemlost ) %]
491
                        [%- IF ( item.itemlost ) %]
491
                            [% IF itemlostloop %]
492
                            [%- SET itemlost_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => item.itemlost ) %]
492
                                [% FOREACH itemlostloo IN itemlostloop %]
493
                            [%- IF itemlostloop %]
493
                                    [% IF itemlostloo.authorised_value == item.itemlost %]
494
                                <span class="lost">[% itemlost_description | html %]</span>
494
                                        <span class="lost">[% itemlostloo.lib | html %]</span>
495
                            [%- ELSE %]
495
                                    [% END %]
496
                                [% END %]
497
                            [% ELSE %]
498
                                <span class="lost">Unavailable (lost or missing)</span>
496
                                <span class="lost">Unavailable (lost or missing)</span>
499
                            [% END %]
497
                            [%- END %]
500
                        [% END %]
498
                        [%- END -%]
501
499
502
                        [% IF ( item.withdrawn ) %]
500
                        [%- IF ( item.withdrawn ) %]
503
                            [% IF itemwithdrawnloop %]
501
                            [%- SET withdrawn_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) %]
504
                                [% FOREACH itemwithdrawnloo IN itemwithdrawnloop %]
502
                            [%- IF withdrawn_description %]
505
                                    [% IF itemwithdrawnloo.authorised_value == item.withdrawn %]
503
                                <span class="wdn">[% withdrawn_description | html %]</span>
506
                                        <span class="wdn">[% itemwithdrawnloo.lib | html %]</span>
504
                            [%- ELSE %]
507
                                    [% END %]
508
                                [% END %]
509
                            [% ELSE %]
510
                                <span class="wdn">Withdrawn</span>
505
                                <span class="wdn">Withdrawn</span>
511
                            [% END %]
506
                            [%- END %]
512
                        [% END %]
507
                        [%- END -%]
513
508
514
                        [% IF ( item.damaged ) %]
509
                        [%- IF ( item.damaged ) %]
515
                            [% IF itemdamagedloop %]
510
                            [%- SET damaged_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => item.damaged ) %]
516
                                [% FOREACH itemdamagedloo IN itemdamagedloop %]
511
                            [%- IF damaged_description %]
517
                                    [% IF itemdamagedloo.authorised_value == item.damaged %]
512
                                <span class="dmg">[% damaged_description | html %]</span>
518
                                        <span class="dmg">[% itemdamagedloo.lib | html %]</span>
513
                            [%- ELSE %]
519
                                    [% END %]
520
                                [% END %]
521
                            [% ELSE %]
522
                                <span class="dmg">Damaged</span>
514
                                <span class="dmg">Damaged</span>
523
                            [% END %]
515
                            [%- END %]
524
                        [% END %]
516
                        [%- END -%]
525
517
526
                        [% IF ( item.notforloan || item.itemtype.notforloan ) %]
518
                        [%- IF ( item.notforloan || item.itemtype.notforloan ) %]
527
                            <span class="notforloan">Not for loan
519
                            <span class="notforloan">Not for loan
528
                            [% SET not_for_loan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
520
                            [%- SET not_for_loan_description = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
529
                            [% IF not_for_loan_description %]
521
                            [%- IF not_for_loan_description %]
530
                                <span class="reason">([% not_for_loan_description | html %])</span>
522
                                <span class="reason">([% not_for_loan_description | html %])</span>
531
                            [% END %]
523
                            [%- END %]
532
                            </span>
524
                            </span>
533
                        [% END %]
525
                        [%- END -%]
534
526
535
                        [% SET hold = item.first_hold %]
527
                        [%- SET hold = item.first_hold %]
536
                        [% IF hold %]
528
                        [%- IF hold %]
537
                            [% IF hold.waitingdate %]
529
                            [%- IF hold.waitingdate %]
538
                                <span class="waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %][% IF ( hold.desk_id ) %], [% hold.desk.desk_name | html %][% END %] since [% hold.waitingdate | $KohaDates %].</span>
530
                                <span class="waitingat">Waiting at [% Branches.GetName( hold.branchcode ) | html %][% IF ( hold.desk_id ) %], [% hold.desk.desk_name | html %][% END %] since [% hold.waitingdate | $KohaDates %].</span>
539
                                [% IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
531
                                [%- IF canreservefromotherbranches AND ( hold.waitingdate OR hold.priority == 1 ) %]
540
                                    <span class="heldfor">Hold for:</span>
532
                                    <span class="heldfor">Hold for:</span>
541
                                    [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
533
                                    [%- INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
542
                                [% END %]
534
                                [%- END %]
543
                            [% ELSE %]
535
                            [%- ELSE %]
544
                                <span class="holdonitem">There is an item level hold on this item (priority = [% hold.priority | html %]).</span>
536
                                <span class="holdonitem">There is an item level hold on this item (priority = [% hold.priority | html %]).</span>
545
                            [% END %]
537
                            [%- END %]
546
                        [% END %]
538
                        [%- END -%]
547
539
548
                        [% SET recall = item.recall %]
540
                        [% IF Koha.Preference('UseRecalls') %]
549
                        [% IF recall %]
541
                            [%- SET recall = item.object.recall %]
550
                            [% IF recall.waiting_date %]
542
                            [%- IF recall %]
551
                                <span>Waiting at [% Branches.GetName( recall.pickup_library_id ) | html %] since [% recall.waiting_date | $KohaDates %]</span>
543
                                [%- IF recall.waiting_date %]
552
                            [% ELSE %]
544
                                    <span>Waiting at [% Branches.GetName( recall.pickup_library_id ) | html %] since [% recall.waiting_date | $KohaDates %]</span>
553
                                [% patron_link = BLOCK %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.patron_id | uri %]">[% recall.patron.firstname | html %] [% recall.patron.surname | html %] ([% recall.patron.cardnumber | html %])</a>[% END %]
545
                                [%- ELSE %]
554
                                <span>recalled by [% patron_link| $raw %] on [% recall.created_date | $KohaDates %]</span>
546
                                    [%- patron_link = BLOCK %]<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% recall.patron_id | uri %]">[% recall.patron.firstname | html %] [% recall.patron.surname | html %] ([% recall.patron.cardnumber | html %])</a>[% END %]
555
                            [% END %]
547
                                    <span>recalled by [% patron_link| $raw %] on [% recall.created_date | $KohaDates %]</span>
556
                        [% END %]
548
                                [%- END %]
557
549
                            [%- END -%]
558
                        [% UNLESS ( item.notforloan || item.itemtype.notforloan || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfer || hold || ( Koha.Preference('UseRecalls') && recall ) ) %]
550
                        [%- END -%]
551
552
                        [%- UNLESS ( item.notforloan || item.itemtype.notforloan || item.onloan || item.itemlost || item.withdrawn || item.damaged || item.transfer || hold || ( Koha.Preference('UseRecalls') && recall ) ) %]
559
                            <span>Available</span>
553
                            <span>Available</span>
560
                        [% END %]
554
                        [%- END -%]
561
555
562
                        [% IF ( item.restricted ) %]
556
                        [%- IF ( item.restricted ) %]
563
                            <span class="restricted">([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted ) | html %])</span>
557
                            <span class="restricted">([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted ) | html %])</span>
564
                        [% END %]
558
                        [%- END -%]
565
559
566
                        [% IF ( item.bundle_host ) %]
560
                        [%- IF ( item.bundle_host ) %]
567
                            <span class="bundled">In bundle: [% INCLUDE 'biblio-title.inc' biblio = item.bundle_host.biblio link = 1 %]</span>
561
                            <span class="bundled">In bundle: [% INCLUDE 'biblio-title.inc' biblio = item.bundle_host.biblio link = 1 %]</span>
568
                        [% END %]
562
                        [%- END -%]
569
563
570
                    </td>
564
                    </td>
571
                    <td class="datelastseen" data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</td>
565
                    <td class="datelastseen" data-order="[% item.datelastseen | html %]">[% item.datelastseen | $KohaDates %]</td>
Lines 574-665 Note that permanent location is a code, and location may be an authval. Link Here
574
                    <td class="dateaccessioned" data-order="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</td>
568
                    <td class="dateaccessioned" data-order="[% item.dateaccessioned | html %]">[% item.dateaccessioned | $KohaDates %]</td>
575
                    <td class="datelastborrowed" data-order="[% item.datelastborrowed | html %]">[% item.datelastborrowed | $KohaDates %]</td>
569
                    <td class="datelastborrowed" data-order="[% item.datelastborrowed | html %]">[% item.datelastborrowed | $KohaDates %]</td>
576
                    <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% item.itemnumber | uri %]&amp;biblionumber=[% item.biblionumber | uri %]&amp;bi=[% item.biblioitemnumber | uri %]#item[% item.itemnumber | uri %]">[% item.barcode | html %]</a></td>
570
                    <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% item.itemnumber | uri %]&amp;biblionumber=[% item.biblionumber | uri %]&amp;bi=[% item.biblioitemnumber | uri %]#item[% item.itemnumber | uri %]">[% item.barcode | html %]</a></td>
577
                    [% IF ( itemdata_uri ) %]
571
                    [%- IF ( itemdata_uri ) %]
578
                        [% IF item.uri.split(' \| ').size > 1 %]
572
                        [%- IF item.uri.split(' \| ').size > 1 %]
579
                            <td class="uri">
573
                            <td class="uri">
580
                                [% FOREACH uri IN item.uri.split(' \| ') %]<a href="[% uri | url %]">[% uri | html %]</a><br>[% END %]
574
                                [%- FOREACH uri IN item.uri.split(' \| ') %]<a href="[% uri | url %]">[% uri | html %]</a><br>[% END %]
581
                            </td>
575
                            </td>
582
                        [% ELSE %]
576
                        [%- ELSE %]
583
                            <td class="uri">
577
                            <td class="uri">
584
                                [% IF item.uri %]
578
                                [%- IF item.uri %]
585
                                    <a href="[% item.uri | url %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
579
                                    <a href="[% item.uri | url %]">[% IF Koha.Preference('URLLinkText') %][% Koha.Preference('URLLinkText') | html %][% ELSE %]Link to resource[% END %]</a>
586
                                [% END %]
580
                                [%- END %]
587
                            </td>
581
                            </td>
588
                        [% END %]
582
                        [%- END %]
589
                    [% END %]
583
                    [%- END %]
590
                    [% IF ( itemdata_copynumber ) %]
584
                    [%- IF ( itemdata_copynumber ) %]
591
                        <td class="copynumber">[% item.copynumber | html %]</td>
585
                        <td class="copynumber">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.copynumber', authorised_value => item.copynumber ) | html %]</td>
592
                    [% END %]
586
                    [%- END %]
593
                    [% IF ( itemdata_stocknumber ) %]
587
                    [%- IF ( itemdata_stocknumber ) %]
594
                        <td class="stocknumber">[% item.stocknumber | html %]</td>
588
                        <td class="stocknumber">[% item.stocknumber | html %]</td>
595
                    [% END %]
589
                    [%- END %]
596
                    [% IF materials %]
590
                    [%- IF materials %]
597
                        <td class="materials"> [% item.materials | html %] </td>
591
                        <td class="materials"> [% item.materials | html %] </td>
598
                    [% END %]
592
                    [%- END %]
599
                    [% IF ( itemdata_itemnotes ) %]
593
                    [%- IF ( itemdata_itemnotes ) %]
600
                        <td><div class="itemnotes">[% item.itemnotes | $raw %]</div></td>
594
                    <td><div class="itemnotes">[% item.object.itemnotes.replace('\n','<br />') | $raw %]</div></td>
601
                    [% END %]
595
                    [%- END %]
602
                    [% IF itemdata_nonpublicnotes %]
596
                    [%- IF itemdata_nonpublicnotes %]
603
                        <td class="nonpublicnote">[% item.itemnotes_nonpublic | html %]</td>
597
                        <td class="nonpublicnote">[% item.itemnotes_nonpublic | html %]</td>
604
                    [% END %]
598
                    [%- END %]
605
                    [% IF ( hostrecords ) %]
599
                    [%- IF ( hostrecords ) %]
606
                        <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber | uri %]" >[% item.hosttitle | html %]</a>[% END %]</td>
600
                        <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber | uri %]" >[% item.hosttitle | html %]</a>[% END %]</td>
607
                    [% END %]
601
                    [%- END %]
608
                    [% IF ( analyze ) %]
602
                    [%- IF ( analyze ) %]
609
                        <td>
603
                        <td>
610
                            [% IF ( item.countanalytics ) %]
604
                            [%- IF ( item.countanalytics ) %]
611
                                <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% item.itemnumber | uri %]">[% item.countanalytics | html %] analytics</a>
605
                                <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% item.itemnumber | uri %]">[% item.countanalytics | html %] analytics</a>
612
                            [% END %]
606
                            [%- END %]
613
                        </td>
607
                        </td>
614
                    [% END %]
608
                    [%- END %]
615
                    [% IF ( analyze ) %]
609
                    [%- IF ( analyze ) %]
616
                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber | uri %]&amp;hostitemnumber=[% item.itemnumber | uri %]">Create analytics</a></td>
610
                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber | uri %]&amp;hostitemnumber=[% item.itemnumber | uri %]">Create analytics</a></td>
617
                    [% END %]
611
                    [%- END -%]
618
612
619
                [% IF ShowCourseReserves %]
613
                [%- IF ShowCourseReserves %]
620
                    <td>
614
                    <td>
621
                        [% IF item.course_reserves %]
615
                        [%- IF item.course_reserves %]
622
                            [% FOREACH r IN item.course_reserves %]
616
                            [%- FOREACH r IN item.course_reserves %]
623
                                [% IF r.course.enabled == 'yes' %]
617
                                [%- IF r.course.enabled == 'yes' %]
624
                                    <p>
618
                                    <p>
625
                                      <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% r.course.course_id | uri %]">
619
                                      <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% r.course.course_id | uri %]">
626
                                         [% r.course.course_name | html %]
620
                                         [%- r.course.course_name | html %]
627
                                         <!--[% IF r.course.course_number %] [% r.course.course_number | html %] [% END %]-->
621
                                         <!--[% IF r.course.course_number %] [% r.course.course_number | html %] [% END %]-->
628
                                         [% IF r.course.section %] [% r.course.section | html %] [% END %]
622
                                         [%- IF r.course.section %] [% r.course.section | html %] [% END %]
629
                                         [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) | html %] [% END %]
623
                                         [%- IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) | html %] [% END %]
630
                                      </a>
624
                                      </a>
631
                                   </p>
625
                                   </p>
632
                               [% END %]
626
                               [%- END %]
633
                           [% END %]
627
                           [%- END %]
634
                       [% END %]
628
                       [%- END %]
635
                    </td>
629
                    </td>
636
                [% END %]
630
                [%- END -%]
637
631
638
                [% IF ( SpineLabelShowPrintOnBibDetails ) %]
632
                [%- IF ( SpineLabelShowPrintOnBibDetails ) %]
639
                    <td><a class="btn btn-default btn-xs print-label" href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode | uri %]"><i class="fa fa-print"></i> Print label</a></td>
633
                    <td><a class="btn btn-default btn-xs print-label" href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode | uri %]"><i class="fa fa-print"></i> Print label</a></td>
640
                [% END %]
634
                [%- END -%]
641
635
642
                [% IF CAN_user_editcatalogue_edit_items %]
636
                [%- IF CAN_user_editcatalogue_edit_items %]
643
                    <td class="actions">
637
                    <td class="actions">
644
                        [% IF item.can_be_edited %]
638
                        [%- IF item.can_be_edited %]
645
                            [% IF Koha.Preference('LocalCoverImages') OR Koha.Preference('OPACLocalCoverImages') %]
639
                            [%- IF Koha.Preference('LocalCoverImages') OR Koha.Preference('OPACLocalCoverImages') %]
646
                                <div class="btn-group">
640
                                <div class="btn-group">
647
                                    <a  class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
641
                                    <a  class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
648
                                    <ul class="dropdown-menu pull-right">
642
                                    <ul class="dropdown-menu pull-right">
649
                                        <li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=[% item.itemnumber | uri %]&amp;filetype=image"><i class="fa fa-upload"></i> Upload image</a></li>
643
                                        <li><a href="/cgi-bin/koha/tools/upload-cover-image.pl?itemnumber=[% item.itemnumber | uri %]&amp;filetype=image"><i class="fa fa-upload"></i> Upload image</a></li>
650
                                    </ul>
644
                                    </ul>
651
                                </div>
645
                                </div>
652
                            [% ELSE %]
646
                            [%- ELSE %]
653
                                <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a>
647
                                <a class="btn btn-default btn-xs" href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% item.biblionumber | html %]&itemnumber=[% item.itemnumber | html %]#edititem"><i class="fa fa-pencil"></i> Edit</a>
654
                            [% END %]
648
                            [%- END %]
655
                        [% END %]
649
                        [%- END %]
656
                        [% IF bundlesEnabled %]
650
                        [%- IF bundlesEnabled %]
657
                            <button class="btn btn-default btn-xs details-control"><i class="fa fa-folder"></i> Manage bundle ([% item.bundled | html %]|[% item.bundled_lost | html %])</button>
651
                            <button class="btn btn-default btn-xs details-control"><i class="fa fa-folder"></i> Manage bundle ([% item.bundled | html %]|[% item.bundled_lost | html %])</button>
658
                        [% END %]
652
                        [%- END %]
659
                    </td>
653
                    </td>
660
                [% END %]
654
                [%- END %]
661
                </tr>
655
                </tr>
662
            [% END %]
656
            [%- END %]
663
        </tbody>
657
        </tbody>
664
    </table>
658
    </table>
665
659
666
- 

Return to bug 33167