Lines 134-143
sub record_schema {
Link Here
|
134 |
|
134 |
|
135 |
my $record = $biblio->metadata_record( |
135 |
my $record = $biblio->metadata_record( |
136 |
{ |
136 |
{ |
137 |
[ embed_items => 1|0, |
137 |
[ |
138 |
opac => 1|0, |
138 |
embed_items => 1 | 0, |
139 |
patron => $patron, |
139 |
interface => 'opac' | 'intranet', |
140 |
expand_coded_fields => 1|0 ] |
140 |
patron => $patron, |
|
|
141 |
expand_coded_fields => 1 | 0 |
142 |
] |
141 |
} |
143 |
} |
142 |
); |
144 |
); |
143 |
|
145 |
|
Lines 153-184
sub metadata_record {
Link Here
|
153 |
|
155 |
|
154 |
my $record = $self->metadata->record; |
156 |
my $record = $self->metadata->record; |
155 |
|
157 |
|
156 |
if ( $params->{embed_items} or $params->{opac} ) { |
158 |
if ( $params->{embed_items} or $params->{interface} ) { |
157 |
|
159 |
|
158 |
# There's need for a RecordProcessor, let's do it! |
160 |
# There's need for a RecordProcessor, let's do it! |
159 |
my @filters; |
161 |
my @filters; |
160 |
my $options = { |
162 |
my $options = { |
161 |
interface => 'opac', |
163 |
interface => $params->{interface}, |
162 |
frameworkcode => $self->frameworkcode, |
164 |
frameworkcode => $self->frameworkcode, |
163 |
}; |
165 |
}; |
164 |
|
166 |
|
165 |
if ( $params->{embed_items} ) { |
167 |
if ( $params->{embed_items} ) { |
166 |
push @filters, 'EmbedItems'; |
168 |
push @filters, 'EmbedItems'; |
167 |
if ( $params->{opac} ) { |
169 |
if ( $params->{interface} eq 'opac' ) { |
168 |
$options->{items} = $self->items->filter_by_visible_in_opac( |
170 |
$options->{items} = $self->items->filter_by_visible_in_opac( |
169 |
{ |
171 |
{ ( $params->{patron} ? ( patron => $params->{patron} ) : () ) } ); |
170 |
( |
172 |
} else { |
171 |
$params->{patron} ? ( patron => $params->{patron} ) : () |
|
|
172 |
) |
173 |
} |
174 |
); |
175 |
} |
176 |
else { |
177 |
$options->{items} = $self->items; |
173 |
$options->{items} = $self->items; |
178 |
} |
174 |
} |
179 |
} |
175 |
} |
180 |
|
176 |
|
181 |
if ( $params->{opac} ) { |
177 |
if ( $params->{interface} ) { |
182 |
push @filters, 'ViewPolicy'; |
178 |
push @filters, 'ViewPolicy'; |
183 |
} |
179 |
} |
184 |
|
180 |
|
185 |
- |
|
|