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_146h.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_146h.tt",
50 flagsrequired => { editcatalogue => '*' },
54 { value => 'a', label => __('performers total') },
55 { value => 'b', label => __('brass instruments') },
56 { value => 'c', label => __('choirs') },
57 { value => 'd', label => __('wind instruments') },
58 { value => 'e', label => __('electro-acoustic instruments') },
59 { value => 'i', label => __('instruments total') },
60 { value => 'j', label => __('solo instruments') },
61 { value => 'k', label => __('keyboard instruments') },
62 { value => 'l', label => __('solo voices') },
63 { value => 'm', label => __('miscellaneous, other instruments') },
64 { value => 'o', label => __('orchestras') },
65 { value => 'p', label => __('percussion instruments') },
66 { value => 'q', label => __('conductors') },
67 { value => 's', label => __('bowed string instruments') },
68 { value => 't', label => __('plucked string instruments') },
69 { value => 'v', label => __('voices total') },
70 { value => 'w', label => __('woodwind instruments') },
71 { value => 'x', label => __('choral voices') },
72 { value => 'y', label => __('ensemble instruments') },
73 { value => 'z', label => __('devices, other performers') },
76 my $value = $cgi->param('value');
77 my $number = substr($value, 0, 3);
78 my $category = substr($value, 3, 1);
81 id => scalar $cgi->param('id'),
83 category => $category,
86 output_html_with_http_headers $cgi, $cookie, $template->output;
89 return { builder => $builder, launcher => $launcher };