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>.
25 use Koha
::Util
::FrameworkPlugin qw
|date_entered
|;
27 use constant FIXLEN_DATA_ELTS
=> 'baaaaaaa';
31 my $function_name = $params->{id
};
32 my $dateentered = date_entered
();
33 my $defaultval = FIXLEN_DATA_ELTS
;
35 <script type=\"text/javascript\">
38 function Focus$function_name(event) {
39 if (!document.getElementById(event.data.id).value) {
40 var authtype=document.forms['f'].elements['authtypecode'].value;
41 var fieldval='$dateentered$defaultval';
42 document.getElementById(event.data.id).value=fieldval;
47 function Click$function_name(event) {
48 var authtype=document.forms['f'].elements['authtypecode'].value;
49 defaultvalue=document.getElementById(event.data.id).value;
50 newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008_classifications.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue+\"&authtypecode=\"+authtype,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
62 my $input = $params->{cgi
};
63 my $index = $input->param('index');
64 my $result = $input->param('result');
65 my $authtype = $input->param('authtypecode') || '';
67 my $defaultval = FIXLEN_DATA_ELTS
;
69 my ($template, $loggedinuser, $cookie) = get_template_and_user
({
70 template_name
=> "cataloguing/value_builder/marc21_field_008_classifications.tt",
74 flagsrequired
=> { editcatalogue
=> '*' },
77 my $dateentered = date_entered
();
78 $result = "$dateentered$defaultval" unless $result;
81 $f[$_]=substr($result,$_,$_==0?
6:1);
83 $template->param(index => $index);
85 $f[0] = $dateentered if !$f[0] || $f[0]=~/\s/;
86 $template->param(f1
=> $f[0]);
91 "f$_".($f[$_] eq '|'?
'pipe': $f[$_]) => $f[$_],
94 output_html_with_http_headers
$input, $cookie, $template->output;
97 return { builder
=> $builder, launcher
=> $launcher };