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

(-)a/Koha/Biblio.pm (-17 / +12 lines)
Lines 127-136 sub record_schema { Link Here
127
127
128
    my $record = $biblio->metadata_record(
128
    my $record = $biblio->metadata_record(
129
        {
129
        {
130
            [ embed_items => 1|0,
130
            [
131
              opac        => 1|0,
131
                embed_items         => 1 | 0,
132
              patron      => $patron,
132
                interface           => 'opac' | 'intranet',
133
              expand_coded_fields => 1|0 ]
133
                patron              => $patron,
134
                expand_coded_fields => 1 | 0
135
            ]
134
        }
136
        }
135
    );
137
    );
136
138
Lines 146-177 sub metadata_record { Link Here
146
148
147
    my $record = $self->metadata->record;
149
    my $record = $self->metadata->record;
148
150
149
    if ( $params->{embed_items} or $params->{opac} ) {
151
    if ( $params->{embed_items} or $params->{interface} ) {
150
152
151
        # There's need for a RecordProcessor, let's do it!
153
        # There's need for a RecordProcessor, let's do it!
152
        my @filters;
154
        my @filters;
153
        my $options = {
155
        my $options = {
154
            interface     => 'opac',
156
            interface     => $params->{interface},
155
            frameworkcode => $self->frameworkcode,
157
            frameworkcode => $self->frameworkcode,
156
        };
158
        };
157
159
158
        if ( $params->{embed_items} ) {
160
        if ( $params->{embed_items} ) {
159
            push @filters, 'EmbedItems';
161
            push @filters, 'EmbedItems';
160
            if ( $params->{opac} ) {
162
            if ( $params->{interface} eq 'opac' ) {
161
                $options->{items} = $self->items->filter_by_visible_in_opac(
163
                $options->{items} = $self->items->filter_by_visible_in_opac(
162
                    {
164
                    { ( $params->{patron} ? ( patron => $params->{patron} ) : () ) } );
163
                        (
165
            } else {
164
                            $params->{patron} ? ( patron => $params->{patron} ) : ()
165
                        )
166
                    }
167
                );
168
            }
169
            else {
170
                $options->{items} = $self->items;
166
                $options->{items} = $self->items;
171
            }
167
            }
172
        }
168
        }
173
169
174
        if ( $params->{opac} ) {
170
        if ( $params->{interface} ) {
175
            push @filters, 'ViewPolicy';
171
            push @filters, 'ViewPolicy';
176
        }
172
        }
177
173
178
- 

Return to bug 31224