Lines 37-42
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
Link Here
|
37 |
|
37 |
|
38 |
my $index = $input->param('index') || 'biblios'; |
38 |
my $index = $input->param('index') || 'biblios'; |
39 |
my $op = $input->param('op') || 'list'; |
39 |
my $op = $input->param('op') || 'list'; |
|
|
40 |
my $action = $input->param('action') || ''; |
40 |
my @messages; |
41 |
my @messages; |
41 |
|
42 |
|
42 |
my $database = Koha::Database->new(); |
43 |
my $database = Koha::Database->new(); |
Lines 97-108
if ( $op eq 'edit' ) {
Link Here
|
97 |
$schema->storage->txn_commit; |
98 |
$schema->storage->txn_commit; |
98 |
} |
99 |
} |
99 |
} |
100 |
} |
100 |
elsif( $op eq 'reset' ) { |
101 |
elsif( $op eq 'admin') { |
101 |
# TODO Move this feature to the interface |
102 |
if( $input->param('admin_password') eq C4::Context->config('elasticsearch_admin_password') ){ |
102 |
my $sure = $input->param('i_know_what_i_am_doing'); |
103 |
if ( $action eq 'reset' ) { |
103 |
if ( $sure ) { |
104 |
Koha::SearchMarcMaps->search->delete; |
104 |
Koha::SearchMarcMaps->search->delete; |
105 |
Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings; |
105 |
Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings; |
106 |
$template->param( mappings_reset = 1 ); |
|
|
107 |
} |
108 |
elsif ( $action eq 'reindex' ) { |
109 |
#TODO reindex needs some refactorig to allow this option |
110 |
} |
111 |
} |
112 |
else { |
113 |
$template->param( admin_badpassword => 1 ); |
106 |
} |
114 |
} |
107 |
} |
115 |
} |
108 |
|
116 |
|
Lines 139-144
$template->param(
Link Here
|
139 |
indexes => \@indexes, |
147 |
indexes => \@indexes, |
140 |
all_search_fields => \@all_search_fields, |
148 |
all_search_fields => \@all_search_fields, |
141 |
messages => \@messages, |
149 |
messages => \@messages, |
|
|
150 |
show_admin_options => C4::Context->config('elasticsearch_admin_password') ? 1 : 0, |
142 |
); |
151 |
); |
143 |
|
152 |
|
144 |
output_html_with_http_headers $input, $cookie, $template->output; |
153 |
output_html_with_http_headers $input, $cookie, $template->output; |