3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
20 use C4::Auth qw( get_template_and_user );
21 use C4::Output qw( output_html_with_http_headers );
27 my $id = $params->{id};
31 function Click$id(event) {
32 event.preventDefault();
33 const value = document.getElementById(event.data.id).value;
34 const url = new URL('/cgi-bin/koha/cataloguing/plugin_launcher.pl', location);
35 url.searchParams.set('plugin_name', 'unimarc_field_146a.pl');
36 url.searchParams.set('id', event.data.id);
37 url.searchParams.set('value', value);
38 window.open(url.toString(), 'tag_editor', 'width=700,height=700,toolbar=false,scrollbars=yes');
45 my $cgi = $params->{cgi};
46 my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
47 template_name => "cataloguing/value_builder/unimarc_field_146a.tt",
50 flagsrequired => { editcatalogue => '*' },
54 { value => 'a', label => __('vocal a cappella music') },
55 { value => 'b', label => __('instrumental music') },
56 { value => 'c', label => __('vocal and instrumental music') },
57 { value => 'd', label => __('electroacoustic music') },
58 { value => 'e', label => __('mixed media music (electroacoustic and other media)') },
59 { value => 'u', label => __('undefined, variable (e.g. Renaissance vocal or instrumental music)') },
60 { value => 'z', label => __('other (e.g. ordinary objects or natural sounds)') },
64 id => scalar $cgi->param('id'),
65 value => scalar $cgi->param('value'),
68 output_html_with_http_headers $cgi, $cookie, $template->output;
71 return { builder => $builder, launcher => $launcher };