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

(-)a/catalogue/ISBDdetail.pl (-7 / +9 lines)
Lines 77-89 if ( not defined $biblionumber ) { Link Here
77
}
77
}
78
78
79
my $record = GetMarcBiblio($biblionumber,1);
79
my $record = GetMarcBiblio($biblionumber,1);
80
my $record_processor = Koha::RecordProcessor->new({
81
    filters => 'ViewPolicy',
82
    options => {
83
        interface => 'intranet',
84
    },
85
});
86
$record_processor->process($record);
87
80
88
if ( not defined $record ) {
81
if ( not defined $record ) {
89
       # biblionumber invalid -> report and exit
82
       # biblionumber invalid -> report and exit
Lines 95-100 if ( not defined $record ) { Link Here
95
}
88
}
96
89
97
my $framework = GetFrameworkCode( $biblionumber );
90
my $framework = GetFrameworkCode( $biblionumber );
91
my $record_processor = Koha::RecordProcessor->new({
92
    filters => 'ViewPolicy',
93
    options => {
94
        interface => 'intranet',
95
        frameworkcode => $framework
96
    },
97
});
98
$record_processor->process($record);
99
98
my $res = GetISBDView({
100
my $res = GetISBDView({
99
    'record'    => $record,
101
    'record'    => $record,
100
    'template'  => 'intranet',
102
    'template'  => 'intranet',
(-)a/opac/opac-ISBDdetail.pl (-2 / +8 lines)
Lines 97-103 if ( ! $record ) { Link Here
97
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
97
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
98
    exit;
98
    exit;
99
}
99
}
100
my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
100
my $framework = GetFrameworkCode( $biblionumber );
101
my $record_processor = Koha::RecordProcessor->new({
102
    filters => 'ViewPolicy',
103
    options => {
104
        interface => 'opac',
105
        frameworkcode => $framework
106
    }
107
});
101
$record_processor->process($record);
108
$record_processor->process($record);
102
109
103
# some useful variables for enhanced content;
110
# some useful variables for enhanced content;
Lines 149-155 $template->param( Link Here
149
156
150
my $norequests = 1;
157
my $norequests = 1;
151
my $allow_onshelf_holds;
158
my $allow_onshelf_holds;
152
my $framework = GetFrameworkCode( $biblionumber );
153
my $res = GetISBDView({
159
my $res = GetISBDView({
154
    'record'    => $record,
160
    'record'    => $record,
155
    'template'  => 'opac',
161
    'template'  => 'opac',
(-)a/opac/opac-MARCdetail.pl (-12 / +19 lines)
Lines 69-74 if ( ! $biblionumber ) { Link Here
69
    exit;
69
    exit;
70
}
70
}
71
71
72
my $record = GetMarcBiblio($biblionumber, 1);
73
if ( ! $record ) {
74
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
75
    exit;
76
}
77
72
my @all_items = GetItemsInfo($biblionumber);
78
my @all_items = GetItemsInfo($biblionumber);
73
my @items2hide;
79
my @items2hide;
74
if (scalar @all_items >= 1) {
80
if (scalar @all_items >= 1) {
Lines 80-96 if (scalar @all_items >= 1) { Link Here
80
    }
86
    }
81
}
87
}
82
88
83
my $itemtype     = &GetFrameworkCode($biblionumber);
89
my $framework = &GetFrameworkCode( $biblionumber );
84
my $tagslib      = &GetMarcStructure( 0, $itemtype );
90
my $tagslib = &GetMarcStructure( 0, $framework );
85
my ($tag_itemnumber,$subtag_itemnumber) = &GetMarcFromKohaField('items.itemnumber',$itemtype);
91
my ($tag_itemnumber,$subtag_itemnumber) = &GetMarcFromKohaField('items.itemnumber',$framework);
86
my $biblio = GetBiblioData($biblionumber);
92
my $biblio = GetBiblioData($biblionumber);
87
$biblionumber = $biblio->{biblionumber};
93
88
my $record = GetMarcBiblio($biblionumber, 1);
94
my $record_processor = Koha::RecordProcessor->new({
89
if ( ! $record ) {
95
    filters => 'ViewPolicy',
90
    print $query->redirect("/cgi-bin/koha/errors/404.pl");
96
    options => {
91
    exit;
97
        interface => 'opac',
92
}
98
        frameworkcode => $framework
93
my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
99
    }
100
});
94
$record_processor->process($record);
101
$record_processor->process($record);
95
102
96
# open template
103
# open template
Lines 104-110 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
104
    }
111
    }
105
);
112
);
106
113
107
my ($bt_tag,$bt_subtag) = GetMarcFromKohaField('biblio.title',$itemtype);
114
my ($bt_tag,$bt_subtag) = GetMarcFromKohaField('biblio.title',$framework);
108
$template->param(
115
$template->param(
109
    bibliotitle => $biblio->{title},
116
    bibliotitle => $biblio->{title},
110
) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible.
117
) if $tagslib->{$bt_tag}->{$bt_subtag}->{hidden} <= 0 && # <=0 OPAC visible.
Lines 291-297 foreach my $field (@fields) { Link Here
291
    push @item_loop, $item if $item;
298
    push @item_loop, $item if $item;
292
}
299
}
293
my ( $holdingbrtagf, $holdingbrtagsubf ) =
300
my ( $holdingbrtagf, $holdingbrtagsubf ) =
294
  &GetMarcFromKohaField( "items.holdingbranch", $itemtype );
301
  &GetMarcFromKohaField( "items.holdingbranch", $framework );
295
@item_loop =
302
@item_loop =
296
  sort { ($a->{$holdingbrtagsubf}||'') cmp ($b->{$holdingbrtagsubf}||'') } @item_loop;
303
  sort { ($a->{$holdingbrtagsubf}||'') cmp ($b->{$holdingbrtagsubf}||'') } @item_loop;
297
304
(-)a/opac/opac-basket.pl (-1 / +7 lines)
Lines 63-69 foreach my $biblionumber ( @bibs ) { Link Here
63
63
64
    my $dat              = &GetBiblioData($biblionumber);
64
    my $dat              = &GetBiblioData($biblionumber);
65
    next unless $dat;
65
    next unless $dat;
66
    my $record = &GetMarcBiblio($biblionumber);
66
67
    my $record = &GetMarcBiblio( $biblionumber );
68
    my $framework = &GetFrameworkCode( $biblionumber );
69
    $record_processor->options({
70
        interface => 'opac',
71
        frameworkcode => $framework
72
    });
67
    $record_processor->process($record);
73
    $record_processor->process($record);
68
    next unless $record;
74
    next unless $record;
69
    my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
75
    my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
(-)a/opac/opac-detail.pl (-1 / +8 lines)
Lines 89-95 if ( ! $record ) { Link Here
89
    print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
89
    print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
90
    exit;
90
    exit;
91
}
91
}
92
my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
92
my $framework = &GetFrameworkCode( $biblionumber );
93
my $record_processor = Koha::RecordProcessor->new({
94
    filters => 'ViewPolicy',
95
    options => {
96
        interface => 'opac',
97
        frameworkcode => $framework
98
    }
99
});
93
$record_processor->process($record);
100
$record_processor->process($record);
94
101
95
# redirect if opacsuppression is enabled and biblio is suppressed
102
# redirect if opacsuppression is enabled and biblio is suppressed
(-)a/opac/opac-downloadcart.pl (+5 lines)
Lines 69-74 if ($bib_list && $format) { Link Here
69
        foreach my $biblio (@bibs) {
69
        foreach my $biblio (@bibs) {
70
70
71
            my $record = GetMarcBiblio($biblio, 1);
71
            my $record = GetMarcBiblio($biblio, 1);
72
            my $framework = &GetFrameworkCode( $biblio );
73
            $record_processor->options({
74
                interface => 'opac',
75
                frameworkcode => $framework
76
            });
72
            $record_processor->process($record);
77
            $record_processor->process($record);
73
78
74
            next unless $record;
79
            next unless $record;
(-)a/opac/opac-downloadshelf.pl (-2 / +5 lines)
Lines 53-59 my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( Link Here
53
my $shelfnumber = $query->param('shelfnumber');
53
my $shelfnumber = $query->param('shelfnumber');
54
my $format  = $query->param('format');
54
my $format  = $query->param('format');
55
my $context = $query->param('context');
55
my $context = $query->param('context');
56
my $dbh     = C4::Context->dbh;
57
56
58
my $shelf = Koha::Virtualshelves->find( $shelfnumber );
57
my $shelf = Koha::Virtualshelves->find( $shelfnumber );
59
if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) {
58
if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) {
Lines 83-88 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
83
                my $biblionumber = $content->biblionumber->biblionumber;
82
                my $biblionumber = $content->biblionumber->biblionumber;
84
83
85
                my $record = GetMarcBiblio($biblionumber, 1);
84
                my $record = GetMarcBiblio($biblionumber, 1);
85
                my $framework = &GetFrameworkCode( $biblionumber );
86
                $record_processor->options({
87
                    interface => 'opac',
88
                    frameworkcode => $framework
89
                });
86
                $record_processor->process($record);
90
                $record_processor->process($record);
87
                next unless $record;
91
                next unless $record;
88
92
Lines 96-102 if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { Link Here
96
                    $output .= marc2bibtex($record, $biblionumber);
100
                    $output .= marc2bibtex($record, $biblionumber);
97
                }
101
                }
98
                elsif ( $format eq 'isbd' ) {
102
                elsif ( $format eq 'isbd' ) {
99
                    my $framework = GetFrameworkCode( $biblionumber );
100
                    $output   .= GetISBDView({
103
                    $output   .= GetISBDView({
101
                        'record'    => $record,
104
                        'record'    => $record,
102
                        'template'  => 'opac',
105
                        'template'  => 'opac',
(-)a/opac/opac-export.pl (-3 / +8 lines)
Lines 45-52 if(!$marc) { Link Here
45
}
45
}
46
46
47
# ASSERT: There is a biblionumber, because GetMarcBiblio returned something.
47
# ASSERT: There is a biblionumber, because GetMarcBiblio returned something.
48
48
my $framework = GetFrameworkCode( $biblionumber );
49
my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' });
49
my $record_processor = Koha::RecordProcessor->new({
50
    filters => 'ViewPolicy',
51
    options => {
52
        interface => 'opac',
53
        frameworkcode => $framework
54
    }
55
});
50
$record_processor->process($marc);
56
$record_processor->process($marc);
51
57
52
if ($format =~ /endnote/) {
58
if ($format =~ /endnote/) {
Lines 90-96 elsif ($format =~ /marcstd/) { Link Here
90
    $format = 'marcstd';
96
    $format = 'marcstd';
91
}
97
}
92
elsif ( $format =~ /isbd/ ) {
98
elsif ( $format =~ /isbd/ ) {
93
    my $framework = GetFrameworkCode( $biblionumber );
94
    $marc   = GetISBDView({
99
    $marc   = GetISBDView({
95
        'record'    => $marc,
100
        'record'    => $marc,
96
        'template'  => 'opac',
101
        'template'  => 'opac',
(-)a/opac/opac-shelves.pl (+5 lines)
Lines 261-266 if ( $op eq 'view' ) { Link Here
261
                my $biblionumber = $content->biblionumber->biblionumber;
261
                my $biblionumber = $content->biblionumber->biblionumber;
262
                my $this_item    = GetBiblioData($biblionumber);
262
                my $this_item    = GetBiblioData($biblionumber);
263
                my $record = GetMarcBiblio($biblionumber);
263
                my $record = GetMarcBiblio($biblionumber);
264
                my $framework = GetFrameworkCode( $biblionumber );
265
                $record_processor->options({
266
                    interface => 'opac',
267
                    frameworkcode => $framework
268
                });
264
                $record_processor->process($record);
269
                $record_processor->process($record);
265
270
266
                if ( $xslfile ) {
271
                if ( $xslfile ) {
(-)a/opac/opac-showmarc.pl (-3 / +5 lines)
Lines 48-55 if ($importid) { Link Here
48
}
48
}
49
else {
49
else {
50
    $record = GetMarcBiblio($biblionumber);
50
    $record = GetMarcBiblio($biblionumber);
51
    my $frameworkcode = GetFrameworkCode($biblionumber);
51
    my $framework = GetFrameworkCode($biblionumber);
52
    $record_processor->options({ frameworkcode => $frameworkcode});
52
    $record_processor->options({
53
        interface => 'opac',
54
        frameworkcode => $framework
55
    });
53
}
56
}
54
57
55
if(!ref $record) {
58
if(!ref $record) {
56
- 

Return to bug 11592