Lines 22-28
use Modern::Perl;
Link Here
|
22 |
|
22 |
|
23 |
use CGI; |
23 |
use CGI; |
24 |
use C4::Output qw( output_html_with_http_headers ); |
24 |
use C4::Output qw( output_html_with_http_headers ); |
25 |
use C4::Auth qw( get_template_and_user haspermission ); |
25 |
use C4::Auth qw( get_template_and_user haspermission ); |
26 |
use C4::Biblio qw( ModBiblio ); |
26 |
use C4::Biblio qw( ModBiblio ); |
27 |
use C4::Context; |
27 |
use C4::Context; |
28 |
use Koha::DateUtils qw( dt_from_string ); |
28 |
use Koha::DateUtils qw( dt_from_string ); |
Lines 35-48
use URI::Escape qw( uri_escape_utf8 );
Link Here
|
35 |
# ======================== |
35 |
# ======================== |
36 |
# MAIN |
36 |
# MAIN |
37 |
#========================= |
37 |
#========================= |
38 |
my $input = CGI->new; |
38 |
my $input = CGI->new; |
39 |
my $biblionumber = $input->param('biblionumber'); |
39 |
my $biblionumber = $input->param('biblionumber'); |
40 |
my $record_source_id = $input->param('record_source_id') // ''; |
40 |
my $record_source_id = $input->param('record_source_id') // ''; |
41 |
my $save = $input->param('save') // ''; |
41 |
my $save = $input->param('save') // ''; |
|
|
42 |
my $biblio = Koha::Biblios->find($biblionumber); |
42 |
|
43 |
|
43 |
if ($save) { |
44 |
if ($save) { |
44 |
my $biblio = Koha::Biblios->find($biblionumber); |
45 |
$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 } ); |
46 |
my $indexer = Koha::SearchEngine::Indexer->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); |
47 |
$indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" ); |
47 |
$indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" ); |
48 |
print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber"); |
48 |
print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber"); |
Lines 50-65
if ($save) {
Link Here
|
50 |
|
50 |
|
51 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
51 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
52 |
{ |
52 |
{ |
53 |
template_name => "cataloguing/record_source.tt", |
53 |
template_name => "cataloguing/record_source.tt", |
54 |
query => $input, |
54 |
query => $input, |
55 |
type => "intranet", |
55 |
type => "intranet", |
56 |
flagsrequired => { editcatalogue => 'set_record_sources' }, |
56 |
flagsrequired => { editcatalogue => 'set_record_sources' }, |
57 |
}); |
57 |
} |
|
|
58 |
); |
58 |
|
59 |
|
59 |
my $record_sources = Koha::RecordSources->search(); |
60 |
my $record_sources = Koha::RecordSources->search(); |
60 |
|
61 |
|
61 |
$template->param( |
62 |
$template->param( |
62 |
biblionumber => $biblionumber, |
63 |
biblio => $biblio, |
63 |
record_sources => $record_sources, |
64 |
record_sources => $record_sources, |
64 |
); |
65 |
); |
65 |
|
66 |
|