|
Lines 1111-1120
sub GetMarcSubfieldStructureFromKohaField {
Link Here
|
| 1111 |
=head2 GetMarcBiblio |
1111 |
=head2 GetMarcBiblio |
| 1112 |
|
1112 |
|
| 1113 |
my $record = GetMarcBiblio({ |
1113 |
my $record = GetMarcBiblio({ |
| 1114 |
biblionumber => $biblionumber, |
1114 |
biblionumber => $biblionumber, |
| 1115 |
embed_items => $embeditems, |
1115 |
embed_items => $embeditems, |
| 1116 |
opac => $opac, |
1116 |
opac => $opac, |
| 1117 |
borcat => $patron_category }); |
1117 |
borcat => $patron_category, |
|
|
1118 |
patron_branch => $patron_branch }); |
| 1118 |
|
1119 |
|
| 1119 |
Returns MARC::Record representing a biblio record, or C<undef> if the |
1120 |
Returns MARC::Record representing a biblio record, or C<undef> if the |
| 1120 |
biblionumber doesn't exist. |
1121 |
biblionumber doesn't exist. |
|
Lines 1144-1149
If the OpacHiddenItemsExceptions system preference is set, this patron category
Link Here
|
| 1144 |
can be used to make visible OPAC items which would be normally hidden. |
1145 |
can be used to make visible OPAC items which would be normally hidden. |
| 1145 |
It only makes sense in combination both embed_items and opac values true. |
1146 |
It only makes sense in combination both embed_items and opac values true. |
| 1146 |
|
1147 |
|
|
|
1148 |
=item C<$patron_branch> |
| 1149 |
|
| 1150 |
If the OpacHiddenItemsLocalExceptions system preference is |
| 1151 |
set, this patron branchcode can be used to make visible OPAC |
| 1152 |
items which would be normally hidden. It only makes sense in |
| 1153 |
combination both embed_items and opac values true. |
| 1154 |
|
| 1147 |
=back |
1155 |
=back |
| 1148 |
|
1156 |
|
| 1149 |
=cut |
1157 |
=cut |
|
Lines 1156-1165
sub GetMarcBiblio {
Link Here
|
| 1156 |
return; |
1164 |
return; |
| 1157 |
} |
1165 |
} |
| 1158 |
|
1166 |
|
| 1159 |
my $biblionumber = $params->{biblionumber}; |
1167 |
my $biblionumber = $params->{biblionumber}; |
| 1160 |
my $embeditems = $params->{embed_items} || 0; |
1168 |
my $embeditems = $params->{embed_items} || 0; |
| 1161 |
my $opac = $params->{opac} || 0; |
1169 |
my $opac = $params->{opac} || 0; |
| 1162 |
my $borcat = $params->{borcat} // q{}; |
1170 |
my $borcat = $params->{borcat} // q{}; |
|
|
1171 |
my $patron_branch = $params->{patron_branch} // q{}; |
| 1163 |
|
1172 |
|
| 1164 |
if (not defined $biblionumber) { |
1173 |
if (not defined $biblionumber) { |
| 1165 |
carp 'GetMarcBiblio called with undefined biblionumber'; |
1174 |
carp 'GetMarcBiblio called with undefined biblionumber'; |
|
Lines 1188-1197
sub GetMarcBiblio {
Link Here
|
| 1188 |
C4::Biblio::_koha_marc_update_bib_ids( $record, $frameworkcode, $biblionumber, |
1197 |
C4::Biblio::_koha_marc_update_bib_ids( $record, $frameworkcode, $biblionumber, |
| 1189 |
$biblioitemnumber ); |
1198 |
$biblioitemnumber ); |
| 1190 |
C4::Biblio::EmbedItemsInMarcBiblio({ |
1199 |
C4::Biblio::EmbedItemsInMarcBiblio({ |
| 1191 |
marc_record => $record, |
1200 |
marc_record => $record, |
| 1192 |
biblionumber => $biblionumber, |
1201 |
biblionumber => $biblionumber, |
| 1193 |
opac => $opac, |
1202 |
opac => $opac, |
| 1194 |
borcat => $borcat }) |
1203 |
borcat => $borcat, |
|
|
1204 |
patron_branch => $patron_branch }) |
| 1195 |
if ($embeditems); |
1205 |
if ($embeditems); |
| 1196 |
|
1206 |
|
| 1197 |
return $record; |
1207 |
return $record; |
|
Lines 2771-2780
sub ModZebra {
Link Here
|
| 2771 |
=head2 EmbedItemsInMarcBiblio |
2781 |
=head2 EmbedItemsInMarcBiblio |
| 2772 |
|
2782 |
|
| 2773 |
EmbedItemsInMarcBiblio({ |
2783 |
EmbedItemsInMarcBiblio({ |
| 2774 |
marc_record => $marc, |
2784 |
marc_record => $marc, |
| 2775 |
biblionumber => $biblionumber, |
2785 |
biblionumber => $biblionumber, |
| 2776 |
item_numbers => $itemnumbers, |
2786 |
item_numbers => $itemnumbers, |
| 2777 |
opac => $opac }); |
2787 |
opac => $opac, |
|
|
2788 |
borcat => $patron_categorycode, |
| 2789 |
patron_branch => $patron_branch }); |
| 2778 |
|
2790 |
|
| 2779 |
Given a MARC::Record object containing a bib record, |
2791 |
Given a MARC::Record object containing a bib record, |
| 2780 |
modify it to include the items attached to it as 9XX |
2792 |
modify it to include the items attached to it as 9XX |
|
Lines 2783-2796
if $itemnumbers is defined, only specified itemnumbers are embedded.
Link Here
|
| 2783 |
|
2795 |
|
| 2784 |
If $opac is true, then opac-relevant suppressions are included. |
2796 |
If $opac is true, then opac-relevant suppressions are included. |
| 2785 |
|
2797 |
|
| 2786 |
If opac filtering will be done, borcat should be passed to properly |
2798 |
If opac filtering will be done, borcat and patron_branch should |
| 2787 |
override if necessary. |
2799 |
be passed to properly override if necessary. |
| 2788 |
|
2800 |
|
| 2789 |
=cut |
2801 |
=cut |
| 2790 |
|
2802 |
|
| 2791 |
sub EmbedItemsInMarcBiblio { |
2803 |
sub EmbedItemsInMarcBiblio { |
| 2792 |
my ($params) = @_; |
2804 |
my ($params) = @_; |
| 2793 |
my ($marc, $biblionumber, $itemnumbers, $opac, $borcat); |
2805 |
my ($marc, $biblionumber, $itemnumbers, $opac, $borcat, $patron_branch); |
| 2794 |
$marc = $params->{marc_record}; |
2806 |
$marc = $params->{marc_record}; |
| 2795 |
if ( !$marc ) { |
2807 |
if ( !$marc ) { |
| 2796 |
carp 'EmbedItemsInMarcBiblio: No MARC record passed'; |
2808 |
carp 'EmbedItemsInMarcBiblio: No MARC record passed'; |
|
Lines 2800-2805
sub EmbedItemsInMarcBiblio {
Link Here
|
| 2800 |
$itemnumbers = $params->{item_numbers}; |
2812 |
$itemnumbers = $params->{item_numbers}; |
| 2801 |
$opac = $params->{opac}; |
2813 |
$opac = $params->{opac}; |
| 2802 |
$borcat = $params->{borcat} // q{}; |
2814 |
$borcat = $params->{borcat} // q{}; |
|
|
2815 |
$patron_branch = $params->{patron_branch} // q{}; |
| 2803 |
|
2816 |
|
| 2804 |
$itemnumbers = [] unless defined $itemnumbers; |
2817 |
$itemnumbers = [] unless defined $itemnumbers; |
| 2805 |
|
2818 |
|
|
Lines 2831-2837
sub EmbedItemsInMarcBiblio {
Link Here
|
| 2831 |
$opachiddenitems |
2844 |
$opachiddenitems |
| 2832 |
? C4::Items::GetHiddenItemnumbers({ |
2845 |
? C4::Items::GetHiddenItemnumbers({ |
| 2833 |
items => \@items2pass, |
2846 |
items => \@items2pass, |
| 2834 |
borcat => $borcat }) |
2847 |
borcat => $borcat, |
|
|
2848 |
patron_branch => $patron_branch }) |
| 2835 |
: (); |
2849 |
: (); |
| 2836 |
# Convert to a hash for quick searching |
2850 |
# Convert to a hash for quick searching |
| 2837 |
my %hiddenitems = map { $_ => 1 } @hiddenitems; |
2851 |
my %hiddenitems = map { $_ => 1 } @hiddenitems; |