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