|
Lines 79-84
BEGIN {
Link Here
|
| 79 |
} |
79 |
} |
| 80 |
|
80 |
|
| 81 |
use Carp; |
81 |
use Carp; |
|
|
82 |
use Try::Tiny; |
| 82 |
|
83 |
|
| 83 |
use Encode qw( decode is_utf8 ); |
84 |
use Encode qw( decode is_utf8 ); |
| 84 |
use List::MoreUtils qw( uniq ); |
85 |
use List::MoreUtils qw( uniq ); |
|
Lines 103-108
use Koha::Acquisition::Currencies;
Link Here
|
| 103 |
use Koha::Biblio::Metadatas; |
104 |
use Koha::Biblio::Metadatas; |
| 104 |
use Koha::Holds; |
105 |
use Koha::Holds; |
| 105 |
use Koha::ItemTypes; |
106 |
use Koha::ItemTypes; |
|
|
107 |
use Koha::Plugins; |
| 106 |
use Koha::SearchEngine; |
108 |
use Koha::SearchEngine; |
| 107 |
use Koha::Libraries; |
109 |
use Koha::Libraries; |
| 108 |
use Koha::Util::MARC; |
110 |
use Koha::Util::MARC; |
|
Lines 233-238
sub AddBiblio {
Link Here
|
| 233 |
C4::OAI::Sets::UpdateOAISetsBiblio($biblionumber, $record); |
235 |
C4::OAI::Sets::UpdateOAISetsBiblio($biblionumber, $record); |
| 234 |
} |
236 |
} |
| 235 |
|
237 |
|
|
|
238 |
_after_biblio_action_hooks({ action => 'create', biblio_id => $biblionumber }); |
| 239 |
|
| 236 |
logaction( "CATALOGUING", "ADD", $biblionumber, "biblio" ) if C4::Context->preference("CataloguingLog"); |
240 |
logaction( "CATALOGUING", "ADD", $biblionumber, "biblio" ) if C4::Context->preference("CataloguingLog"); |
| 237 |
return ( $biblionumber, $biblioitemnumber ); |
241 |
return ( $biblionumber, $biblioitemnumber ); |
| 238 |
} |
242 |
} |
|
Lines 318-323
sub ModBiblio {
Link Here
|
| 318 |
_koha_modify_biblio( $dbh, $oldbiblio, $frameworkcode ); |
322 |
_koha_modify_biblio( $dbh, $oldbiblio, $frameworkcode ); |
| 319 |
_koha_modify_biblioitem_nonmarc( $dbh, $oldbiblio ); |
323 |
_koha_modify_biblioitem_nonmarc( $dbh, $oldbiblio ); |
| 320 |
|
324 |
|
|
|
325 |
_after_biblio_action_hooks({ action => 'modify', biblio_id => $biblionumber }); |
| 326 |
|
| 321 |
# update OAI-PMH sets |
327 |
# update OAI-PMH sets |
| 322 |
if(C4::Context->preference("OAI-PMH:AutoUpdateSets")) { |
328 |
if(C4::Context->preference("OAI-PMH:AutoUpdateSets")) { |
| 323 |
C4::OAI::Sets::UpdateOAISetsBiblio($biblionumber, $record); |
329 |
C4::OAI::Sets::UpdateOAISetsBiblio($biblionumber, $record); |
|
Lines 418-423
sub DelBiblio {
Link Here
|
| 418 |
# from being generated by _koha_delete_biblioitems |
424 |
# from being generated by _koha_delete_biblioitems |
| 419 |
$error = _koha_delete_biblio( $dbh, $biblionumber ); |
425 |
$error = _koha_delete_biblio( $dbh, $biblionumber ); |
| 420 |
|
426 |
|
|
|
427 |
_after_biblio_action_hooks({ action => 'delete', biblio_id => $biblionumber }); |
| 428 |
|
| 421 |
logaction( "CATALOGUING", "DELETE", $biblionumber, "biblio" ) if C4::Context->preference("CataloguingLog"); |
429 |
logaction( "CATALOGUING", "DELETE", $biblionumber, "biblio" ) if C4::Context->preference("CataloguingLog"); |
| 422 |
|
430 |
|
| 423 |
return; |
431 |
return; |
|
Lines 3184-3189
sub ModBiblioMarc {
Link Here
|
| 3184 |
$m_rs->store; |
3192 |
$m_rs->store; |
| 3185 |
|
3193 |
|
| 3186 |
ModZebra( $biblionumber, "specialUpdate", "biblioserver" ); |
3194 |
ModZebra( $biblionumber, "specialUpdate", "biblioserver" ); |
|
|
3195 |
|
| 3187 |
return $biblionumber; |
3196 |
return $biblionumber; |
| 3188 |
} |
3197 |
} |
| 3189 |
|
3198 |
|
|
Lines 3440-3445
sub RemoveAllNsb {
Link Here
|
| 3440 |
1; |
3449 |
1; |
| 3441 |
|
3450 |
|
| 3442 |
|
3451 |
|
|
|
3452 |
=head2 _after_biblio_action_hooks |
| 3453 |
|
| 3454 |
Helper method that takes care of calling all plugin hooks |
| 3455 |
|
| 3456 |
=cut |
| 3457 |
|
| 3458 |
sub _after_biblio_action_hooks { |
| 3459 |
my ( $args ) = @_; |
| 3460 |
|
| 3461 |
my $biblio_id = $args->{biblio_id}; |
| 3462 |
my $action = $args->{action}; |
| 3463 |
|
| 3464 |
if ( C4::Context->preference('UseKohaPlugins') && C4::Context->config("enable_plugins") ) { |
| 3465 |
|
| 3466 |
my @plugins = Koha::Plugins->new->GetPlugins({ |
| 3467 |
method => 'after_biblio_action', |
| 3468 |
}); |
| 3469 |
|
| 3470 |
if (@plugins) { |
| 3471 |
|
| 3472 |
my $biblio = Koha::Biblios->find( $biblio_id ); |
| 3473 |
|
| 3474 |
foreach my $plugin ( @plugins ) { |
| 3475 |
try { |
| 3476 |
$plugin->after_biblio_action({ action => $action, biblio => $biblio, biblio_id => $biblio_id }); |
| 3477 |
} |
| 3478 |
catch { |
| 3479 |
warn "$_"; |
| 3480 |
}; |
| 3481 |
} |
| 3482 |
} |
| 3483 |
} |
| 3484 |
} |
| 3485 |
|
| 3443 |
__END__ |
3486 |
__END__ |
| 3444 |
|
3487 |
|
| 3445 |
=head1 AUTHOR |
3488 |
=head1 AUTHOR |