|
Lines 240-246
sub AddBiblio {
Link Here
|
| 240 |
|
240 |
|
| 241 |
=head2 ModBiblio |
241 |
=head2 ModBiblio |
| 242 |
|
242 |
|
| 243 |
ModBiblio( $record,$biblionumber,$frameworkcode); |
243 |
ModBiblio( $record,$biblionumber,$frameworkcode, $disable_autolink); |
| 244 |
|
244 |
|
| 245 |
Replace an existing bib record identified by C<$biblionumber> |
245 |
Replace an existing bib record identified by C<$biblionumber> |
| 246 |
with one supplied by the MARC::Record object C<$record>. The embedded |
246 |
with one supplied by the MARC::Record object C<$record>. The embedded |
|
Lines 256-267
in the C<biblio> and C<biblioitems> tables, as well as
Link Here
|
| 256 |
which fields are used to store embedded item, biblioitem, |
256 |
which fields are used to store embedded item, biblioitem, |
| 257 |
and biblionumber data for indexing. |
257 |
and biblionumber data for indexing. |
| 258 |
|
258 |
|
|
|
259 |
Unless C<$disable_autolink> is passed ModBiblio will relink record headings |
| 260 |
to authorities based on settings in the system preferences. This flag allows |
| 261 |
us to not relink records when the authority linker is saving modifications. |
| 262 |
|
| 259 |
Returns 1 on success 0 on failure |
263 |
Returns 1 on success 0 on failure |
| 260 |
|
264 |
|
| 261 |
=cut |
265 |
=cut |
| 262 |
|
266 |
|
| 263 |
sub ModBiblio { |
267 |
sub ModBiblio { |
| 264 |
my ( $record, $biblionumber, $frameworkcode ) = @_; |
268 |
my ( $record, $biblionumber, $frameworkcode, $disable_autolink ) = @_; |
| 265 |
if (!$record) { |
269 |
if (!$record) { |
| 266 |
carp 'No record passed to ModBiblio'; |
270 |
carp 'No record passed to ModBiblio'; |
| 267 |
return 0; |
271 |
return 0; |
|
Lines 272-278
sub ModBiblio {
Link Here
|
| 272 |
logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $newrecord->as_formatted ); |
276 |
logaction( "CATALOGUING", "MODIFY", $biblionumber, "biblio BEFORE=>" . $newrecord->as_formatted ); |
| 273 |
} |
277 |
} |
| 274 |
|
278 |
|
| 275 |
if (C4::Context->preference('BiblioAddsAuthorities')) { |
279 |
if ( !$disable_autolink && C4::Context->preference('BiblioAddsAuthorities') ) { |
| 276 |
BiblioAutoLink( $record, $frameworkcode ); |
280 |
BiblioAutoLink( $record, $frameworkcode ); |
| 277 |
} |
281 |
} |
| 278 |
|
282 |
|
|
Lines 624-635
safest place.
Link Here
|
| 624 |
|
628 |
|
| 625 |
sub _check_valid_auth_link { |
629 |
sub _check_valid_auth_link { |
| 626 |
my ( $authid, $field ) = @_; |
630 |
my ( $authid, $field ) = @_; |
| 627 |
|
|
|
| 628 |
require C4::AuthoritiesMarc; |
631 |
require C4::AuthoritiesMarc; |
| 629 |
|
632 |
|
| 630 |
my $authorized_heading = |
633 |
my $authorized_heading = |
| 631 |
C4::AuthoritiesMarc::GetAuthorizedHeading( { 'authid' => $authid } ) || ''; |
634 |
C4::AuthoritiesMarc::GetAuthorizedHeading( { 'authid' => $authid } ) || ''; |
| 632 |
|
|
|
| 633 |
return ($field->as_string('abcdefghijklmnopqrstuvwxyz') eq $authorized_heading); |
635 |
return ($field->as_string('abcdefghijklmnopqrstuvwxyz') eq $authorized_heading); |
| 634 |
} |
636 |
} |
| 635 |
|
637 |
|