Bug 17322 - Translation breaks opac-ics.tt
[koha.git] / cataloguing / value_builder / unimarc_field_225a_bis.pl
blob8bfa488d1b186b74061dd53e3063c63e861e7920
1 #!/usr/bin/perl
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>.
18 =head1 SYNOPSIS
20 This plugin is used to fill 225$a with a value already existing in
21 biblioitems.collectiontitle
23 =cut
25 use Modern::Perl;
27 use C4::Auth;
28 use CGI qw( -utf8 );
29 use C4::Context;
31 use C4::Output;
33 sub plugin_javascript {
34 my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
35 my $function_name = $field_number;
36 my $res = "
37 <script type=\"text/javascript\">
38 function Clic$function_name(index) {
39 window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_225a_bis.pl&index=\"+index,\"unimarc225a\",'width=500,height=400,toolbar=false,scrollbars=no');
41 </script>
44 return ( $function_name, $res );
47 sub plugin {
48 my ($input) = @_;
49 my $index = $input->param('index');
51 my ($template, $loggedinuser, $cookie) = get_template_and_user({
52 template_name => "cataloguing/value_builder/unimarc_field_225a_bis.tt",
53 query => $input,
54 type => "intranet",
55 authnotrequired => 0,
56 flagsrequired => { editcatalogue => '*' },
57 debug => 1,
58 });
60 $template->param(index => $index);
62 output_html_with_http_headers $input, $cookie, $template->output;