Lines 1-6
Link Here
|
1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
2 |
|
2 |
|
3 |
|
|
|
4 |
# Copyright 2000-2002 Katipo Communications |
3 |
# Copyright 2000-2002 Katipo Communications |
5 |
# |
4 |
# |
6 |
# This file is part of Koha. |
5 |
# This file is part of Koha. |
Lines 19-47
Link Here
|
19 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
18 |
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
20 |
|
19 |
|
21 |
use strict; |
20 |
use strict; |
22 |
#use warnings; FIXME - Bug 2505 |
21 |
use warnings; |
23 |
use C4::Auth; |
22 |
|
24 |
use CGI; |
23 |
use CGI; |
25 |
use C4::Context; |
|
|
26 |
|
24 |
|
|
|
25 |
use C4::Auth; |
26 |
use C4::Context; |
27 |
use C4::Search; |
27 |
use C4::Search; |
28 |
use C4::Output; |
28 |
use C4::Output; |
29 |
|
29 |
|
30 |
=head1 |
30 |
# This plugin has been moved to the new style using $building_plugins |
31 |
|
31 |
|
32 |
plugin_parameters : other parameters added when the plugin is called by the dopop function |
32 |
our $building_plugins; |
|
|
33 |
if(defined $building_plugins) { |
34 |
pass_script_for_marc21_leader(); |
35 |
} |
36 |
else { |
37 |
run_marc21_leader_plugin(); |
38 |
} |
33 |
|
39 |
|
34 |
=cut |
40 |
#------------------------------------------------------------------------------- |
35 |
|
41 |
|
36 |
sub plugin_parameters { |
42 |
sub pass_script_for_marc21_leader { |
37 |
my ($dbh,$record,$tagslib,$i,$tabloop) = @_; |
43 |
my $n=@$building_plugins; |
38 |
return ""; |
44 |
return if $n==0; |
39 |
} |
45 |
my $field_number= $building_plugins->[$n-1]->{fieldno}; |
40 |
|
46 |
|
41 |
sub plugin_javascript { |
47 |
my $function_name= $field_number; |
42 |
my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_; |
48 |
my $res=" |
43 |
my $function_name= $field_number; |
|
|
44 |
my $res=" |
45 |
<script type=\"text/javascript\"> |
49 |
<script type=\"text/javascript\"> |
46 |
//<![CDATA[ |
50 |
//<![CDATA[ |
47 |
|
51 |
|
Lines 53-108
function Focus$function_name(subfield_managed) {
Link Here
|
53 |
} |
57 |
} |
54 |
|
58 |
|
55 |
function Blur$function_name(subfield_managed) { |
59 |
function Blur$function_name(subfield_managed) { |
56 |
return 1; |
60 |
return 1; |
57 |
} |
61 |
} |
58 |
|
62 |
|
59 |
function Clic$function_name(i) { |
63 |
function Clic$function_name(i) { |
60 |
defaultvalue=document.getElementById(\"$field_number\").value; |
64 |
defaultvalue=document.getElementById(\"$field_number\").value; |
61 |
newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader.pl&index=$field_number&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); |
65 |
newin=window.open(\"../cataloguing/value_builder/marc21_leader.pl?index=$field_number&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes'); |
62 |
|
|
|
63 |
} |
66 |
} |
64 |
//]]> |
67 |
//]]> |
65 |
</script> |
68 |
</script> |
66 |
"; |
69 |
"; |
67 |
|
70 |
$building_plugins->[$n-1]->{function}= $function_name; |
68 |
return ($function_name,$res); |
71 |
$building_plugins->[$n-1]->{javascript}= $res; |
69 |
} |
72 |
} |
70 |
sub plugin { |
73 |
|
71 |
my ($input) = @_; |
74 |
sub run_marc21_leader_plugin { |
72 |
my $index= $input->param('index'); |
75 |
my $input = new CGI; |
73 |
my $result= $input->param('result'); |
76 |
my $index= $input->param('index'); |
74 |
|
77 |
my $result= $input->param('result'); |
75 |
|
78 |
|
76 |
my $dbh = C4::Context->dbh; |
79 |
my $dbh = C4::Context->dbh; |
77 |
|
80 |
|
78 |
my ($template, $loggedinuser, $cookie) |
81 |
my ($template, $loggedinuser, $cookie) = get_template_and_user( |
79 |
= get_template_and_user({template_name => "cataloguing/value_builder/marc21_leader.tmpl", |
82 |
{ |
80 |
query => $input, |
83 |
template_name => "cataloguing/value_builder/marc21_leader.tmpl", |
81 |
type => "intranet", |
84 |
query => $input, |
82 |
authnotrequired => 0, |
85 |
type => "intranet", |
83 |
flagsrequired => {editcatalogue => '*'}, |
86 |
authnotrequired => 0, |
84 |
debug => 1, |
87 |
flagsrequired => {editcatalogue => '*'}, |
85 |
}); |
88 |
debug => 1, |
86 |
$result = " nam a22 7a 4500" unless $result; |
89 |
}); |
87 |
my $f5 = substr($result,5,1); |
90 |
$result = " nam a22 7a 4500" unless $result; |
88 |
my $f6 = substr($result,6,1); |
91 |
my $f5 = substr($result,5,1); |
89 |
my $f7 = substr($result,7,1); |
92 |
my $f6 = substr($result,6,1); |
90 |
my $f8 = substr($result,8,1); |
93 |
my $f7 = substr($result,7,1); |
91 |
my $f17 = substr($result,17,1); |
94 |
my $f8 = substr($result,8,1); |
92 |
my $f18 = substr($result,18,1); |
95 |
my $f17 = substr($result,17,1); |
93 |
my $f19 = substr($result,19,1); |
96 |
my $f18 = substr($result,18,1); |
94 |
my $f2023 = substr($result,20,4); |
97 |
my $f19 = substr($result,19,1); |
95 |
$template->param(index => $index, |
98 |
my $f2023 = substr($result,20,4); |
96 |
"f5$f5" => 1, |
99 |
$template->param( |
97 |
"f6$f6" => 1, |
100 |
index => $index, |
98 |
"f7$f7" => 1, |
101 |
"f5$f5" => 1, |
99 |
"f8$f8" => 1, |
102 |
"f6$f6" => 1, |
100 |
"f17$f17" => 1, |
103 |
"f7$f7" => 1, |
101 |
"f18$f18" => 1, |
104 |
"f8$f8" => 1, |
102 |
"f19$f19" => 1, |
105 |
"f17$f17" => 1, |
103 |
"f2023" => $f2023, |
106 |
"f18$f18" => 1, |
104 |
); |
107 |
"f19$f19" => 1, |
105 |
output_html_with_http_headers $input, $cookie, $template->output; |
108 |
"f2023" => $f2023, |
|
|
109 |
); |
110 |
output_html_with_http_headers $input, $cookie, $template->output; |
106 |
} |
111 |
} |
107 |
|
112 |
|
108 |
1; |
113 |
1; |