|
Lines 28-46
use C4::Context;
Link Here
|
| 28 |
use Koha::DateUtils qw( dt_from_string ); |
28 |
use Koha::DateUtils qw( dt_from_string ); |
| 29 |
use Koha::Biblios; |
29 |
use Koha::Biblios; |
| 30 |
use Koha::RecordSources; |
30 |
use Koha::RecordSources; |
|
|
31 |
use Koha::SearchEngine; |
| 32 |
use Koha::SearchEngine::Indexer; |
| 31 |
use URI::Escape qw( uri_escape_utf8 ); |
33 |
use URI::Escape qw( uri_escape_utf8 ); |
| 32 |
|
34 |
|
| 33 |
# ======================== |
35 |
# ======================== |
| 34 |
# MAIN |
36 |
# MAIN |
| 35 |
#========================= |
37 |
#========================= |
| 36 |
my $input = CGI->new; |
38 |
my $input = CGI->new; |
| 37 |
my $biblionumber = $input->param('biblionumber'); # if biblionumber exists, it's a modif, not a new biblio. |
39 |
my $biblionumber = $input->param('biblionumber'); |
| 38 |
my $record_source_id = $input->param('record_source_id') // ''; |
40 |
my $record_source_id = $input->param('record_source_id') // ''; |
| 39 |
my $save = $input->param('save') // ''; |
41 |
my $save = $input->param('save') // ''; |
| 40 |
|
42 |
|
| 41 |
if ($save ne '') { |
43 |
if ($save) { |
| 42 |
my $biblio = Koha::Biblios->find($biblionumber); |
44 |
my $biblio = Koha::Biblios->find($biblionumber); |
| 43 |
$biblio->metadata->set({record_source_id => $record_source_id})->store; |
45 |
$biblio->metadata->set({record_source_id => $record_source_id})->store; |
|
|
46 |
my $indexer = Koha::SearchEngine::Indexer->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
| 47 |
$indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" ); |
| 44 |
print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber"); |
48 |
print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber"); |
| 45 |
} |
49 |
} |
| 46 |
|
50 |
|
| 47 |
- |
|
|