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

(-)a/opac/opac-MARCdetail.pl (-27 / +36 lines)
Lines 1-26 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Copyright 2000-2002 Katipo Communications
4
# Parts copyright 2010 BibLibre
5
#
6
# This file is part of Koha.
3
# This file is part of Koha.
7
#
4
#
8
# Koha is free software; you can redistribute it and/or modify it under the
5
#       Copyright (C) 2000-2002 Katipo Communications
9
# terms of the GNU General Public License as published by the Free Software
6
# Parts Copyright (C) 2010      BibLibre
10
# Foundation; either version 2 of the License, or (at your option) any later
7
# Parts Copyright (C) 2013      Mark Tompsett
11
# version.
8
#
9
# Koha is free software; you can redistribute it and/or modify it
10
# under the terms of the GNU General Public License as published by
11
# the Free Software Foundation; either version 3 of the License, or
12
# (at your option) any later version.
12
#
13
#
13
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14
# Koha is distributed in the hope that it will be useful, but
14
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
16
#
18
#
17
# You should have received a copy of the GNU General Public License along
19
# You should have received a copy of the GNU General Public License
18
# with Koha; if not, write to the Free Software Foundation, Inc.,
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
20
22
21
=head1 NAME
23
=head1 NAME
22
24
23
MARCdetail.pl : script to show a biblio in MARC format
25
opac-MARCdetail.pl : script to show a biblio in MARC format
24
26
25
=head1 SYNOPSIS
27
=head1 SYNOPSIS
26
28
Lines 41-48 the items attached to the biblio Link Here
41
43
42
=cut
44
=cut
43
45
44
use strict;
46
use Modern::Perl;
45
use warnings;
46
47
47
use C4::Auth;
48
use C4::Auth;
48
use C4::Context;
49
use C4::Context;
Lines 172-183 for ( my $tabloop = 0 ; $tabloop <= 9 ; $tabloop++ ) { Link Here
172
            # loop through each subfield
173
            # loop through each subfield
173
            for my $i ( 0 .. $#subf ) {
174
            for my $i ( 0 .. $#subf ) {
174
                $subf[$i][0] = "@" unless defined($subf[$i][0]);
175
                $subf[$i][0] = "@" unless defined($subf[$i][0]);
175
                my $sf_def = $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] };
176
                my $sf_def = $tagslib->{ $fields[$x_i]->tag() };
176
                next if ( ($sf_def->{tab}||0) != $tabloop );
177
                $sf_def = $sf_def->{ $subf[$i][0] } if defined($sf_def);
177
                next if ( ($sf_def->{hidden}||0) > 0 );
178
                my ($tab,$hidden,$lib);
179
                $tab = $sf_def->{tab} if defined($sf_def);
180
                $tab = $tab // int($fields[$x_i]->tag()/100);
181
                $hidden = $sf_def->{hidden} if defined($sf_def);
182
                $hidden = $hidden // 0;
183
                next if ( $tab != $tabloop );
184
                next if ( $hidden > 0 );
178
                my %subfield_data;
185
                my %subfield_data;
179
                $subfield_data{marc_lib} = ($sf_def->{lib} eq $previous) ?  '--' : $sf_def->{lib};
186
                $lib = $sf_def->{lib} if defined($sf_def);
180
                $previous = $sf_def->{lib};
187
                $lib = $lib // '--';
188
                $subfield_data{marc_lib} = ($lib eq $previous) ?  '--' : $lib;
189
                $previous = $lib;
181
                $subfield_data{link} = $sf_def->{link};
190
                $subfield_data{link} = $sf_def->{link};
182
                $subf[$i][1] =~ s/\n/<br\/>/g;
191
                $subf[$i][1] =~ s/\n/<br\/>/g;
183
                if ( $sf_def->{isurl} ) {
192
                if ( $sf_def->{isurl} ) {
Lines 211-222 for ( my $tabloop = 0 ; $tabloop <= 9 ; $tabloop++ ) { Link Here
211
                    $tag_data{tag} = $tagslib->{ $fields[$x_i]->tag() }->{lib};
220
                    $tag_data{tag} = $tagslib->{ $fields[$x_i]->tag() }->{lib};
212
                }
221
                }
213
                else {
222
                else {
214
                    $tag_data{tag} =
223
                    my $sf_def = $tagslib->{ $fields[$x_i]->tag() };
215
                        $fields[$x_i]->tag() 
224
                    my $lib;
216
                      . ' '
225
                    $lib = $sf_def->{lib} if defined($sf_def);
226
                    $lib = $lib // '';
227
                    $tag_data{tag} = $fields[$x_i]->tag() . ' '
217
                      . C4::Koha::display_marc_indicators($fields[$x_i])
228
                      . C4::Koha::display_marc_indicators($fields[$x_i])
218
                      . ' - '
229
                      . " - $lib";
219
                      . $tagslib->{ $fields[$x_i]->tag() }->{lib};
220
                }
230
                }
221
            }
231
            }
222
            my @tmp = @subfields_data;
232
            my @tmp = @subfields_data;
223
- 

Return to bug 11242