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

(-)a/opac/opac-MARCdetail.pl (-2 / +22 lines)
Lines 52-65 use MARC::Record; Link Here
52
use C4::Biblio;
52
use C4::Biblio;
53
use C4::Acquisition;
53
use C4::Acquisition;
54
use C4::Koha;
54
use C4::Koha;
55
use C4::Items;
56
use List::MoreUtils qw/any/;
55
57
56
my $query = new CGI;
58
my $query = new CGI;
57
59
58
my $dbh = C4::Context->dbh;
60
my $dbh = C4::Context->dbh;
59
61
60
my $biblionumber = $query->param('biblionumber');
62
my $biblionumber = $query->param('biblionumber');
63
if ( ! $biblionumber ) {
64
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
65
    exit;
66
}
67
68
my @all_items = GetItemsInfo($biblionumber);
69
my @items2hide;
70
if (scalar @all_items >= 1) {
71
    push @items2hide, GetHiddenItemnumbers(@all_items);
72
73
    if (scalar @items2hide == scalar @all_items ) {
74
       print $query->redirect("/cgi-bin/koha/errors/404.pl");
75
       exit;
76
    }
77
}
78
61
my $itemtype     = &GetFrameworkCode($biblionumber);
79
my $itemtype     = &GetFrameworkCode($biblionumber);
62
my $tagslib      = &GetMarcStructure( 0, $itemtype );
80
my $tagslib      = &GetMarcStructure( 0, $itemtype );
81
my ($tag_itemnumber,$subtag_itemnumber) = &GetMarcFromKohaField('items.itemnumber',$itemtype);
63
my $biblio = GetBiblioData($biblionumber);
82
my $biblio = GetBiblioData($biblionumber);
64
$biblionumber = $biblio->{biblionumber};
83
$biblionumber = $biblio->{biblionumber};
65
my $record = GetMarcBiblio($biblionumber, 1);
84
my $record = GetMarcBiblio($biblionumber, 1);
Lines 209-215 for ( my $tabloop = 0 ; $tabloop <= 9 ; $tabloop++ ) { Link Here
209
    $template->param( "tab" . $tabloop . "XX" => \@loop_data );
228
    $template->param( "tab" . $tabloop . "XX" => \@loop_data );
210
}
229
}
211
230
212
213
# now, build item tab !
231
# now, build item tab !
214
# the main difference is that datas are in lines and not in columns : thus, we build the <th> first, then the values...
232
# the main difference is that datas are in lines and not in columns : thus, we build the <th> first, then the values...
215
# loop through each tag
233
# loop through each tag
Lines 223-228 foreach my $field (@fields) { Link Here
223
    next if ( $field->tag() < 10 );
241
    next if ( $field->tag() < 10 );
224
    my @subf = $field->subfields;
242
    my @subf = $field->subfields;
225
    my %this_row;
243
    my %this_row;
244
    next if ( ($field->tag() eq $tag_itemnumber) &&
245
              (any { $field->subfield($subtag_itemnumber) eq $_ }
246
                   @items2hide) );
226
247
227
    # loop through each subfield
248
    # loop through each subfield
228
    for my $i ( 0 .. $#subf ) {
249
    for my $i ( 0 .. $#subf ) {
229
- 

Return to bug 10876