Bug 14585: Fixing up online help on main page
[koha.git] / cataloguing / value_builder / unimarc_field_700-4.pl
blob1f540dfbd2c9dc7f20638d4c5d58510ce97babdb
1 #!/usr/bin/perl
3 # written 10/5/2002 by Paul
5 # Copyright 2000-2002 Katipo Communications
7 # This file is part of Koha.
9 # Koha is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
14 # Koha is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with Koha; if not, see <http://www.gnu.org/licenses>.
22 use strict;
23 #use warnings; FIXME - Bug 2505
24 use C4::Auth;
25 use CGI;
26 use C4::Context;
28 use C4::Search;
29 use C4::Output;
31 =head1 NAME
33 plugin unimarc_field_700-4
35 =head1 SYNOPSIS
37 This plug-in deals with unimarc field 700-4 (
39 =head1 DESCRIPTION
41 =head1 FUNCTIONS
43 =over 2
45 =cut
47 sub plugin_parameters {
48 my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
49 return "";
52 sub plugin_javascript {
53 my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
54 my $function_name= $field_number;
55 my $res = "
56 <script>
57 function Focus$function_name(index) {
58 return 1;
61 function Blur$function_name(subfield_managed) {
62 return 1;
65 function Clic$function_name(subfield_managed) {
66 defaultvalue=document.getElementById(\"$field_number\").value;
67 newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_700-4.pl&result=\"+defaultvalue+\"&index=$field_number\",\"value_builder\",'width=500,height=400,toolbar=false,scrollbars=yes');
70 </script>
73 return ($function_name,$res);
76 sub plugin {
77 my ($input) = @_;
78 my $index= $input->param('index');
79 my $index2= $input->param('index2');
80 $index2=-1 unless($index2);
81 my $result= $input->param('result');
84 my $dbh = C4::Context->dbh;
86 my ($template, $loggedinuser, $cookie) = get_template_and_user(
88 template_name => "cataloguing/value_builder/unimarc_field_700-4.tt",
89 query => $input,
90 type => "intranet",
91 authnotrequired => 0,
92 flagsrequired => { editcatalogue => '*' },
93 debug => 1,
96 $template->param(index => $index,
97 index2 => $index2,
98 "f1_$result" => "f1_".$result,
100 output_html_with_http_headers $input, $cookie, $template->output;