View | Details | Raw Unified | Return to bug 13437
Collapse All | Expand All

(-)a/cataloguing/value_builder/marc21_field_003.pl (-8 / +11 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
5
4
# Copyright 2000-2002 Katipo Communications
6
# Copyright 2000-2002 Katipo Communications
5
#
7
#
Lines 18-30 Link Here
18
# You should have received a copy of the GNU General Public License
20
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
22
21
use strict;
23
use Modern::Perl;
22
#use warnings; FIXME - Bug 2505
23
use C4::Context;
24
use C4::Context;
24
25
25
sub plugin_javascript {
26
my $builder = sub {
26
    my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
27
    my ( $params ) = @_;
27
    my $function_name= $field_number;
28
    my $function_name = $params->{id};
28
29
29
    my $org = C4::Context->preference('MARCOrgCode');
30
    my $org = C4::Context->preference('MARCOrgCode');
30
    my $res  = "
31
    my $res  = "
Lines 32-43 sub plugin_javascript { Link Here
32
//<![CDATA[
33
//<![CDATA[
33
34
34
function Focus$function_name(subfield_managed) {
35
function Focus$function_name(subfield_managed) {
35
    document.getElementById(\"$field_number\").value='$org';
36
    document.getElementById(\"$params->{id}\").value='$org';
36
    return 0;
37
    return 0;
37
}
38
}
38
39
39
//]]>
40
//]]>
40
</script>
41
</script>
41
";
42
";
42
    return ($function_name,$res);
43
    return $res;
43
}
44
};
45
46
return { builder => $builder };
(-)a/cataloguing/value_builder/marc21_field_005.pl (-8 / +11 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-28 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
#use warnings; FIXME - Bug 2505
22
23
23
sub plugin_javascript {
24
my $builder = sub {
24
    my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
25
    my ( $params ) = @_;
25
    my $function_name= $field_number;
26
    my $function_name = $params->{id};
26
27
27
    # find today's date
28
    # find today's date
28
    my @a= (localtime) [5,4,3,2,1,0]; $a[0]+=1900; $a[1]++;
29
    my @a= (localtime) [5,4,3,2,1,0]; $a[0]+=1900; $a[1]++;
Lines 33-44 sub plugin_javascript { Link Here
33
//<![CDATA[
34
//<![CDATA[
34
35
35
function Focus$function_name(subfield_managed) {
36
function Focus$function_name(subfield_managed) {
36
    document.getElementById(\"$field_number\").value='$date';
37
    document.getElementById(\"$params->{id}\").value='$date';
37
    return 0;
38
    return 0;
38
}
39
}
39
40
40
//]]>
41
//]]>
41
</script>
42
</script>
42
";
43
";
43
    return ($function_name,$res);
44
    return $res;
44
}
45
};
46
47
return { builder => $builder };
(-)a/cataloguing/value_builder/marc21_field_006.pl (-13 / +17 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-24 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
#use warnings; FIXME - Bug 2505
22
use C4::Auth;
23
use C4::Auth;
23
use CGI qw ( -utf8 );
24
use CGI qw ( -utf8 );
24
use C4::Context;
25
use C4::Context;
Lines 28-54 use C4::Output; Link Here
28
29
29
use XML::LibXML;
30
use XML::LibXML;
30
31
31
sub plugin_javascript {
32
my $builder = sub {
32
    my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_;
33
    my ( $params ) = @_;
33
    my $function_name = $field_number;
34
    my $function_name = $params->{id};
34
    my $res           = "
35
    my $res           = "
35
<script type=\"text/javascript\">
36
<script type=\"text/javascript\">
36
//<![CDATA[
37
//<![CDATA[
37
38
38
function Clic$function_name(i) {
39
function Click$function_name(i) {
39
	defaultvalue=document.getElementById(\"$field_number\").value;
40
	defaultvalue=document.getElementById(\"$params->{id}\").value;
40
	newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_006.pl&index=$field_number&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
41
	newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_006.pl&index=$params->{id}&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
41
42
42
}
43
}
43
//]]>
44
//]]>
44
</script>
45
</script>
45
";
46
";
46
47
47
    return ($function_name, $res);
48
    return $res;
48
}
49
};
49
50
50
sub plugin {
51
my $launcher = sub {
51
    my ($input) = @_;
52
    my ( $params ) = @_;
53
    my $input = $params->{cgi};
52
    my $index   = $input->param('index');
54
    my $index   = $input->param('index');
53
    my $result  = $input->param('result');
55
    my $result  = $input->param('result');
54
56
Lines 86-89 sub plugin { Link Here
86
            errorXml => $errorXml,
88
            errorXml => $errorXml,
87
    );
89
    );
88
    output_html_with_http_headers $input, $cookie, $template->output;
90
    output_html_with_http_headers $input, $cookie, $template->output;
89
}
91
};
92
93
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_field_007.pl (-13 / +17 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-25 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
23
22
#use warnings; FIXME - Bug 2505
23
use C4::Auth;
24
use C4::Auth;
24
use CGI qw ( -utf8 );
25
use CGI qw ( -utf8 );
25
use C4::Context;
26
use C4::Context;
Lines 27-53 use C4::Context; Link Here
27
use C4::Search;
28
use C4::Search;
28
use C4::Output;
29
use C4::Output;
29
30
30
sub plugin_javascript {
31
my $builder = sub {
31
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
32
    my ( $params ) = @_;
32
    my $function_name = $field_number;
33
    my $function_name = $params->{id};
33
    my $res           = "
34
    my $res           = "
34
<script type=\"text/javascript\">
35
<script type=\"text/javascript\">
35
//<![CDATA[
36
//<![CDATA[
36
37
37
function Clic$function_name(i) {
38
function Click$function_name(i) {
38
	defaultvalue=document.getElementById(\"$field_number\").value;
39
	defaultvalue=document.getElementById(\"$params->{id}\").value;
39
	newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_007.pl&index=$field_number&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
40
	newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_007.pl&index=$params->{id}&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
40
41
41
}
42
}
42
//]]>
43
//]]>
43
</script>
44
</script>
44
";
45
";
45
46
46
    return ( $function_name, $res );
47
    return $res;
47
}
48
};
48
49
49
sub plugin {
50
my $launcher = sub {
50
    my ($input) = @_;
51
    my ( $params ) = @_;
52
    my $input = $params->{cgi};
51
    my $index   = $input->param('index');
53
    my $index   = $input->param('index');
52
    my $result  = $input->param('result');
54
    my $result  = $input->param('result');
53
55
Lines 144-147 sub plugin { Link Here
144
        "f22$f22" => $f22,
146
        "f22$f22" => $f22,
145
    );
147
    );
146
    output_html_with_http_headers $input, $cookie, $template->output;
148
    output_html_with_http_headers $input, $cookie, $template->output;
147
}
149
};
150
151
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_field_008.pl (-15 / +19 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-24 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
#use warnings; FIXME - Bug 2505
22
use C4::Auth;
23
use C4::Auth;
23
use CGI qw ( -utf8 );
24
use CGI qw ( -utf8 );
24
use C4::Context;
25
use C4::Context;
Lines 36-65 sub date_entered { Link Here
36
    return substr($year, 2, 2) . sprintf("%0.2d", $mon) . sprintf("%0.2d", $mday);
37
    return substr($year, 2, 2) . sprintf("%0.2d", $mon) . sprintf("%0.2d", $mday);
37
}
38
}
38
39
39
sub plugin_javascript {
40
my $builder = sub {
40
    my ($dbh, $record, $tagslib, $field_number, $tabloop) = @_;
41
    my ( $params ) = @_;
41
42
42
    my $lang = C4::Context->preference('DefaultLanguageField008' );
43
    my $lang = C4::Context->preference('DefaultLanguageField008' );
43
    $lang = "eng" unless $lang;
44
    $lang = "eng" unless $lang;
44
    $lang = pack("A3", $lang);
45
    $lang = pack("A3", $lang);
45
46
46
    my $function_name = $field_number;
47
    my $function_name = $params->{id};
47
    my $dateentered = date_entered();
48
    my $dateentered = date_entered();
48
    my $res           = "
49
    my $res           = "
49
<script type=\"text/javascript\">
50
<script type=\"text/javascript\">
50
//<![CDATA[
51
//<![CDATA[
51
52
52
function Focus$function_name(subfield_managed) {
53
function Focus$function_name(subfield_managed) {
53
	if ( document.getElementById(\"$field_number\").value ) {
54
	if ( document.getElementById(\"$params->{id}\").value ) {
54
	}
55
	}
55
	else {
56
	else {
56
        document.getElementById(\"$field_number\").value='$dateentered' + 'b        xxu||||| |||| 00| 0 $lang d';
57
        document.getElementById(\"$params->{id}\").value='$dateentered' + 'b        xxu||||| |||| 00| 0 $lang d';
57
	}
58
	}
58
    return 1;
59
    return 1;
59
}
60
}
60
61
61
function Clic$function_name(i) {
62
function Click$function_name(i) {
62
	defaultvalue=document.getElementById(\"$field_number\").value;
63
	defaultvalue=document.getElementById(\"$params->{id}\").value;
63
    //Retrieve full leader string and pass it to the 008 tag editor
64
    //Retrieve full leader string and pass it to the 008 tag editor
64
    var leader_value = \$(\"input[id^='tag_000']\").val();
65
    var leader_value = \$(\"input[id^='tag_000']\").val();
65
    var leader_parameter = \"\";
66
    var leader_parameter = \"\";
Lines 67-84 function Clic$function_name(i) { Link Here
67
        //Only add the parameter to the URL if there is a value to add
68
        //Only add the parameter to the URL if there is a value to add
68
        leader_parameter = \"&leader=\"+leader_value;
69
        leader_parameter = \"&leader=\"+leader_value;
69
    }
70
    }
70
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008.pl&index=$field_number&result=\"+defaultvalue+leader_parameter,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
71
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008.pl&index=$params->{id}&result=\"+defaultvalue+leader_parameter,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
71
72
72
}
73
}
73
//]]>
74
//]]>
74
</script>
75
</script>
75
";
76
";
76
77
77
    return ($function_name, $res);
78
    return $res;
78
}
79
};
79
80
80
sub plugin {
81
my $launcher = sub {
81
    my ($input) = @_;
82
    my ( $params ) = @_;
83
    my $input = $params->{cgi};
82
    my $lang = C4::Context->preference('DefaultLanguageField008' );
84
    my $lang = C4::Context->preference('DefaultLanguageField008' );
83
    $lang = "eng" unless $lang;
85
    $lang = "eng" unless $lang;
84
    $lang = pack("A3", $lang);
86
    $lang = pack("A3", $lang);
Lines 170-173 sub plugin { Link Here
170
            material_configuration => $material_configuration,
172
            material_configuration => $material_configuration,
171
    );
173
    );
172
    output_html_with_http_headers $input, $cookie, $template->output;
174
    output_html_with_http_headers $input, $cookie, $template->output;
173
}
175
};
176
177
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_field_008_authorities.pl (-15 / +19 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-24 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
#use warnings; FIXME - Bug 2505
22
use C4::Auth;
23
use C4::Auth;
23
use CGI qw ( -utf8 );
24
use CGI qw ( -utf8 );
24
use C4::Context;
25
use C4::Context;
Lines 37-45 sub date_entered { Link Here
37
    return substr($year,2,2).sprintf ("%0.2d", $mon).sprintf ("%0.2d",$mday);
38
    return substr($year,2,2).sprintf ("%0.2d", $mon).sprintf ("%0.2d",$mday);
38
}
39
}
39
40
40
sub plugin_javascript {
41
my $builder = sub {
41
    my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
42
    my ( $params ) = @_;
42
    my $function_name= $field_number;
43
    my $function_name = $params->{id};
43
    my $dateentered = date_entered();
44
    my $dateentered = date_entered();
44
    my $defaultval = Field008();
45
    my $defaultval = Field008();
45
    my $res="
46
    my $res="
Lines 47-78 sub plugin_javascript { Link Here
47
//<![CDATA[
48
//<![CDATA[
48
49
49
function Focus$function_name(subfield_managed) {
50
function Focus$function_name(subfield_managed) {
50
    if (!document.getElementById(\"$field_number\").value) {
51
    if (!document.getElementById(\"$params->{id}\").value) {
51
    var authtype=document.forms['f'].elements['authtypecode'].value;
52
    var authtype=document.forms['f'].elements['authtypecode'].value;
52
    var fieldval='$dateentered$defaultval';
53
    var fieldval='$dateentered$defaultval';
53
    if(authtype && (authtype == 'TOPIC_TERM' || authtype == 'GENRE/FORM' || authtype == 'CHRON_TERM')) {
54
    if(authtype && (authtype == 'TOPIC_TERM' || authtype == 'GENRE/FORM' || authtype == 'CHRON_TERM')) {
54
      fieldval= fieldval.substr(0,14)+'b'+fieldval.substr(15);
55
      fieldval= fieldval.substr(0,14)+'b'+fieldval.substr(15);
55
    }
56
    }
56
        document.getElementById(\"$field_number\").value=fieldval;
57
        document.getElementById(\"$params->{id}\").value=fieldval;
57
    }
58
    }
58
    return 1;
59
    return 1;
59
}
60
}
60
61
61
function Clic$function_name(i) {
62
function Click$function_name(i) {
62
    var authtype=document.forms['f'].elements['authtypecode'].value;
63
    var authtype=document.forms['f'].elements['authtypecode'].value;
63
    defaultvalue=document.getElementById(\"$field_number\").value;
64
    defaultvalue=document.getElementById(\"$params->{id}\").value;
64
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008_authorities.pl&index=$field_number&result=\"+defaultvalue+\"&authtypecode=\"+authtype,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
65
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008_authorities.pl&index=$params->{id}&result=\"+defaultvalue+\"&authtypecode=\"+authtype,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
65
66
66
}
67
}
67
//]]>
68
//]]>
68
</script>
69
</script>
69
";
70
";
70
71
71
    return ($function_name,$res);
72
    return $res;
72
}
73
};
73
74
74
sub plugin {
75
my $launcher = sub {
75
    my ($input) = @_;
76
    my ( $params ) = @_;
77
    my $input = $params->{cgi};
76
    my $index= $input->param('index');
78
    my $index= $input->param('index');
77
    my $result= $input->param('result');
79
    my $result= $input->param('result');
78
    my $authtype= $input->param('authtypecode')||'';
80
    my $authtype= $input->param('authtypecode')||'';
Lines 108-114 sub plugin { Link Here
108
        );
110
        );
109
    }
111
    }
110
    output_html_with_http_headers $input, $cookie, $template->output;
112
    output_html_with_http_headers $input, $cookie, $template->output;
111
}
113
};
112
114
113
sub Field008 {
115
sub Field008 {
114
  my $pref= C4::Context->preference(PREF_008);
116
  my $pref= C4::Context->preference(PREF_008);
Lines 121-123 sub Field008 { Link Here
121
  }
123
  }
122
  return substr($pref,0,34);  #ignore remainder
124
  return substr($pref,0,34);  #ignore remainder
123
}
125
}
126
127
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_field_040c.pl (-8 / +11 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-29 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
#use warnings; FIXME - Bug 2505
22
use C4::Context;
23
use C4::Context;
23
24
24
sub plugin_javascript {
25
my $builder = sub {
25
    my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
26
    my ( $params ) = @_;
26
    my $function_name= $field_number;
27
    my $function_name = $params->{id};
27
28
28
    my $org = C4::Context->preference('MARCOrgCode');
29
    my $org = C4::Context->preference('MARCOrgCode');
29
    my $res  = "
30
    my $res  = "
Lines 31-42 sub plugin_javascript { Link Here
31
//<![CDATA[
32
//<![CDATA[
32
33
33
function Focus$function_name(subfield_managed) {
34
function Focus$function_name(subfield_managed) {
34
    document.getElementById(\"$field_number\").value='$org';
35
    document.getElementById(\"$params->{id}\").value='$org';
35
    return 0;
36
    return 0;
36
}
37
}
37
38
38
//]]>
39
//]]>
39
</script>
40
</script>
40
";
41
";
41
    return ($function_name,$res);
42
    return $res;
42
}
43
};
44
45
return { builder => $builder };
(-)a/cataloguing/value_builder/marc21_field_040d.pl (-8 / +11 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-29 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
#use warnings; FIXME - Bug 2505
22
use C4::Context;
23
use C4::Context;
23
24
24
sub plugin_javascript {
25
my $builder = sub {
25
    my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
26
    my ( $params ) = @_;
26
    my $function_name = $field_number;
27
    my $function_name = $params->{id};
27
28
28
    my $org = C4::Context->preference('MARCOrgCode');
29
    my $org = C4::Context->preference('MARCOrgCode');
29
    my $res  = "
30
    my $res  = "
Lines 31-42 sub plugin_javascript { Link Here
31
//<![CDATA[
32
//<![CDATA[
32
33
33
function Focus$function_name(subfield_managed) {
34
function Focus$function_name(subfield_managed) {
34
    document.getElementById(\"$field_number\").value='$org';
35
    document.getElementById(\"$params->{id}\").value='$org';
35
    return 0;
36
    return 0;
36
}
37
}
37
38
38
//]]>
39
//]]>
39
</script>
40
</script>
40
";
41
";
41
    return ($function_name,$res);
42
    return $res;
42
}
43
};
44
45
return { builder => $builder };
(-)a/cataloguing/value_builder/marc21_field_245h.pl (-9 / +12 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright 2009 Kyle Hall <kyle.m.hall@gmail.com>
5
# Copyright 2009 Kyle Hall <kyle.m.hall@gmail.com>
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-41 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
#use warnings; FIXME - Bug 2505
22
use C4::Context;
23
use C4::Context;
23
24
24
sub plugin_javascript {
25
my $builder = sub {
25
    my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
26
    my ( $params ) = @_;
26
    my $function_name = $field_number;
27
    my $function_name = $params->{id};
27
28
28
    my $res  = "
29
    my $res  = "
29
<script type=\"text/javascript\">
30
<script type=\"text/javascript\">
30
//<![CDATA[
31
//<![CDATA[
31
32
32
function Blur$function_name(index) {
33
function Blur$function_name(index) {
33
    var fieldValue = document.getElementById(\"$field_number\").value;
34
    var fieldValue = document.getElementById(\"$params->{id}\").value;
34
    if (  fieldValue.substring(0,1) != '[' 
35
    if (  fieldValue.substring(0,1) != '[' 
35
          &&
36
          &&
36
          fieldValue.substring(fieldValue.length-1) != '[' 
37
          fieldValue.substring(fieldValue.length-1) != '[' 
37
        ) {
38
        ) {
38
      document.getElementById(\"$field_number\").value = '[' + fieldValue + ']';
39
      document.getElementById(\"$params->{id}\").value = '[' + fieldValue + ']';
39
    }
40
    }
40
    return 0;
41
    return 0;
41
}
42
}
Lines 43-47 function Blur$function_name(index) { Link Here
43
//]]>
44
//]]>
44
</script>
45
</script>
45
";
46
";
46
    return ($function_name,$res);
47
    return $res;
47
}
48
};
49
50
return { builder => $builder };
(-)a/cataloguing/value_builder/marc21_leader.pl (-15 / +19 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-25 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
23
22
#use warnings; FIXME - Bug 2505
23
use C4::Auth;
24
use C4::Auth;
24
use CGI qw ( -utf8 );
25
use CGI qw ( -utf8 );
25
use C4::Context;
26
use C4::Context;
Lines 27-60 use C4::Context; Link Here
27
use C4::Search;
28
use C4::Search;
28
use C4::Output;
29
use C4::Output;
29
30
30
sub plugin_javascript {
31
my $builder = sub {
31
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
32
    my ( $params ) = @_;
32
    my $function_name = $field_number;
33
    my $function_name = $params->{id};
33
    my $res           = "
34
    my $res           = "
34
<script type=\"text/javascript\">
35
<script type=\"text/javascript\">
35
//<![CDATA[
36
//<![CDATA[
36
37
37
function Focus$function_name(subfield_managed) {
38
function Focus$function_name(subfield_managed) {
38
    if(!document.getElementById(\"$field_number\").value){
39
    if(!document.getElementById(\"$params->{id}\").value){
39
        document.getElementById(\"$field_number\").value = '     nam a22     7a 4500';
40
        document.getElementById(\"$params->{id}\").value = '     nam a22     7a 4500';
40
    }
41
    }
41
    return 1;
42
    return 1;
42
}
43
}
43
44
44
function Clic$function_name(i) {
45
function Click$function_name(i) {
45
	defaultvalue=document.getElementById(\"$field_number\").value;
46
	defaultvalue=document.getElementById(\"$params->{id}\").value;
46
	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');
47
	newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader.pl&index=$params->{id}&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
47
48
48
}
49
}
49
//]]>
50
//]]>
50
</script>
51
</script>
51
";
52
";
52
53
53
    return ( $function_name, $res );
54
    return $res;
54
}
55
};
55
56
56
sub plugin {
57
my $launcher = sub {
57
    my ($input) = @_;
58
    my ( $params ) = @_;
59
    my $input = $params->{cgi};
58
    my $index   = $input->param('index');
60
    my $index   = $input->param('index');
59
    my $result  = $input->param('result');
61
    my $result  = $input->param('result');
60
62
Lines 90-93 sub plugin { Link Here
90
        "f2023"   => $f2023,
92
        "f2023"   => $f2023,
91
    );
93
    );
92
    output_html_with_http_headers $input, $cookie, $template->output;
94
    output_html_with_http_headers $input, $cookie, $template->output;
93
}
95
};
96
97
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_leader_authorities.pl (-15 / +19 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-25 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
23
22
#use warnings; FIXME - Bug 2505
23
use C4::Auth;
24
use C4::Auth;
24
use CGI qw ( -utf8 );
25
use CGI qw ( -utf8 );
25
use C4::Context;
26
use C4::Context;
Lines 27-60 use C4::Context; Link Here
27
use C4::Search;
28
use C4::Search;
28
use C4::Output;
29
use C4::Output;
29
30
30
sub plugin_javascript {
31
my $builder = sub {
31
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
32
    my ( $params ) = @_;
32
    my $function_name = $field_number;
33
    my $function_name = $params->{id};
33
    my $res           = "
34
    my $res           = "
34
<script type=\"text/javascript\">
35
<script type=\"text/javascript\">
35
//<![CDATA[
36
//<![CDATA[
36
37
37
function Focus$function_name(subfield_managed) {
38
function Focus$function_name(subfield_managed) {
38
    if(!document.getElementById(\"$field_number\").value){
39
    if(!document.getElementById(\"$params->{id}\").value){
39
        document.getElementById(\"$field_number\").value = '     nz  a22     n  4500';
40
        document.getElementById(\"$params->{id}\").value = '     nz  a22     n  4500';
40
    }
41
    }
41
    return 1;
42
    return 1;
42
}
43
}
43
44
44
function Clic$function_name(i) {
45
function Click$function_name(i) {
45
	defaultvalue=document.getElementById(\"$field_number\").value;
46
	defaultvalue=document.getElementById(\"$params->{id}\").value;
46
	newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader_authorities.pl&index=$field_number&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
47
	newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader_authorities.pl&index=$params->{id}&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
47
48
48
}
49
}
49
//]]>
50
//]]>
50
</script>
51
</script>
51
";
52
";
52
53
53
    return ( $function_name, $res );
54
    return $res;
54
}
55
};
55
56
56
sub plugin {
57
my $launcher = sub {
57
    my ($input) = @_;
58
    my ( $params ) = @_;
59
    my $input = $params->{cgi};
58
    my $index   = $input->param('index');
60
    my $index   = $input->param('index');
59
    my $result  = $input->param('result');
61
    my $result  = $input->param('result');
60
62
Lines 88-91 sub plugin { Link Here
88
        "f2023"   => $f2023,
90
        "f2023"   => $f2023,
89
    );
91
    );
90
    output_html_with_http_headers $input, $cookie, $template->output;
92
    output_html_with_http_headers $input, $cookie, $template->output;
91
}
93
};
94
95
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_leader_book.pl (-13 / +17 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-25 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
23
22
#use warnings; FIXME - Bug 2505
23
use C4::Auth;
24
use C4::Auth;
24
use CGI qw ( -utf8 );
25
use CGI qw ( -utf8 );
25
use C4::Context;
26
use C4::Context;
Lines 27-53 use C4::Context; Link Here
27
use C4::Search;
28
use C4::Search;
28
use C4::Output;
29
use C4::Output;
29
30
30
sub plugin_javascript {
31
my $builder = sub {
31
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
32
    my ( $params ) = @_;
32
    my $function_name = $field_number;
33
    my $function_name = $params->{id};
33
    my $res           = "
34
    my $res           = "
34
<script type=\"text/javascript\">
35
<script type=\"text/javascript\">
35
//<![CDATA[
36
//<![CDATA[
36
37
37
function Clic$function_name(i) {
38
function Click$function_name(i) {
38
	defaultvalue=document.getElementById(\"$field_number\").value;
39
	defaultvalue=document.getElementById(\"$params->{id}\").value;
39
	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');
40
	newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader.pl&index=$params->{id}&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
40
41
41
}
42
}
42
//]]>
43
//]]>
43
</script>
44
</script>
44
";
45
";
45
46
46
    return ( $function_name, $res );
47
    return $res;
47
}
48
};
48
49
49
sub plugin {
50
my $launcher = sub {
50
    my ($input) = @_;
51
    my ( $params ) = @_;
52
    my $input = $params->{cgi};
51
    my $index   = $input->param('index');
53
    my $index   = $input->param('index');
52
    my $result  = $input->param('result');
54
    my $result  = $input->param('result');
53
55
Lines 84-87 sub plugin { Link Here
84
        "f19$f19" => 1,
86
        "f19$f19" => 1,
85
    );
87
    );
86
    output_html_with_http_headers $input, $cookie, $template->output;
88
    output_html_with_http_headers $input, $cookie, $template->output;
87
}
89
};
90
91
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_leader_computerfile.pl (-13 / +17 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-25 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
23
22
#use warnings; FIXME - Bug 2505
23
use C4::Auth;
24
use C4::Auth;
24
use CGI qw ( -utf8 );
25
use CGI qw ( -utf8 );
25
use C4::Context;
26
use C4::Context;
Lines 27-53 use C4::Context; Link Here
27
use C4::Search;
28
use C4::Search;
28
use C4::Output;
29
use C4::Output;
29
30
30
sub plugin_javascript {
31
my $builder = sub {
31
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
32
    my ( $params ) = @_;
32
    my $function_name = $field_number;
33
    my $function_name = $params->{id};
33
    my $res           = "
34
    my $res           = "
34
<script type=\"text/javascript\">
35
<script type=\"text/javascript\">
35
//<![CDATA[
36
//<![CDATA[
36
37
37
function Clic$function_name(i) {
38
function Click$function_name(i) {
38
	defaultvalue=document.getElementById(\"$field_number\").value;
39
	defaultvalue=document.getElementById(\"$params->{id}\").value;
39
	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');
40
	newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader.pl&index=$params->{id}&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
40
41
41
}
42
}
42
//]]>
43
//]]>
43
</script>
44
</script>
44
";
45
";
45
46
46
    return ( $function_name, $res );
47
    return $res;
47
}
48
};
48
49
49
sub plugin {
50
my $launcher = sub {
50
    my ($input) = @_;
51
    my ( $params ) = @_;
52
    my $input = $params->{cgi};
51
    my $index   = $input->param('index');
53
    my $index   = $input->param('index');
52
    my $result  = $input->param('result');
54
    my $result  = $input->param('result');
53
55
Lines 84-87 sub plugin { Link Here
84
        "f19$f19" => 1,
86
        "f19$f19" => 1,
85
    );
87
    );
86
    output_html_with_http_headers $input, $cookie, $template->output;
88
    output_html_with_http_headers $input, $cookie, $template->output;
87
}
89
};
90
91
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_leader_video.pl (-12 / +16 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright 2000-2002 Katipo Communications
5
# Copyright 2000-2002 Katipo Communications
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-25 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
23
22
#use warnings; FIXME - Bug 2505
23
use C4::Auth;
24
use C4::Auth;
24
use CGI qw ( -utf8 );
25
use CGI qw ( -utf8 );
25
use C4::Context;
26
use C4::Context;
Lines 27-41 use C4::Context; Link Here
27
use C4::Search;
28
use C4::Search;
28
use C4::Output;
29
use C4::Output;
29
30
30
sub plugin_javascript {
31
my $builder = sub {
31
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
32
    my ( $params ) = @_;
32
    my $function_name = $field_number;
33
    my $function_name = $params->{id};
33
    my $res           = "
34
    my $res           = "
34
<script type=\"text/javascript\">
35
<script type=\"text/javascript\">
35
//<![CDATA[
36
//<![CDATA[
36
37
37
function Clic$function_name(i) {
38
function Click$function_name(i) {
38
	defaultvalue=document.getElementById(\"$field_number\").value;
39
	defaultvalue=document.getElementById(\"$params->{id}\").value;
39
	newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader.pl&index=\"+i+\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
40
	newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader.pl&index=\"+i+\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
40
41
41
}
42
}
Lines 43-53 function Clic$function_name(i) { Link Here
43
</script>
44
</script>
44
";
45
";
45
46
46
    return ( $function_name, $res );
47
    return $res;
47
}
48
};
48
49
49
sub plugin {
50
my $launcher = sub {
50
    my ($input) = @_;
51
    my ( $params ) = @_;
52
    my $input = $params->{cgi};
51
    my $index   = $input->param('index');
53
    my $index   = $input->param('index');
52
    my $result  = $input->param('result');
54
    my $result  = $input->param('result');
53
55
Lines 84-87 sub plugin { Link Here
84
        "f19$f19" => 1,
86
        "f19$f19" => 1,
85
    );
87
    );
86
    output_html_with_http_headers $input, $cookie, $template->output;
88
    output_html_with_http_headers $input, $cookie, $template->output;
87
}
89
};
90
91
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_linking_section.pl (-13 / +16 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
# Converted to new plugin style (Bug 13437)
4
3
# Copyright Biblibre 2007 - CILEA 2011
5
# Copyright Biblibre 2007 - CILEA 2011
4
#
6
#
5
# This file is part of Koha.
7
# This file is part of Koha.
Lines 17-24 Link Here
17
# You should have received a copy of the GNU General Public License
19
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
21
20
use strict;
22
use Modern::Perl;
21
use warnings;
22
23
23
use CGI qw ( -utf8 );
24
use CGI qw ( -utf8 );
24
use C4::Output;
25
use C4::Output;
Lines 33-56 use MARC::Record; Link Here
33
use C4::Branch;
34
use C4::Branch;
34
use C4::ItemType;
35
use C4::ItemType;
35
36
36
sub plugin_javascript {
37
my $builder = sub {
37
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
38
    my ( $params ) = @_;
38
    my $function_name = $field_number;
39
    my $function_name = $params->{id};
39
    my $res           = "
40
    my $res           = "
40
  <script type='text/javascript'>
41
  <script type='text/javascript'>
41
             function Clic$function_name(i) {
42
             function Click$function_name(i) {
42
                       defaultvalue=document.getElementById(\"$field_number\").value;
43
                       defaultvalue=document.getElementById(\"$params->{id}\").value;
43
                 window.open(\"/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=\" + i + \"&result=\"+defaultvalue,\"marc21_field_7\"+i+\"\",'width=900,height=700,toolbar=false,scrollbars=yes');
44
                 window.open(\"/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=\" + i + \"&result=\"+defaultvalue,\"marc21_field_7\"+i+\"\",'width=900,height=700,toolbar=false,scrollbars=yes');
44
45
45
             }
46
             }
46
      </script>
47
      </script>
47
      ";
48
      ";
48
49
49
    return ( $function_name, $res );
50
    return $res;
50
}
51
};
51
52
52
sub plugin {
53
my $launcher = sub {
53
    my ($query)   = @_;
54
    my ( $params ) = @_;
55
    my $query = $params->{cgi};
54
    my $dbh       = C4::Context->dbh;
56
    my $dbh       = C4::Context->dbh;
55
    my $op        = $query->param('op');
57
    my $op        = $query->param('op');
56
    # -- op could be equal to
58
    # -- op could be equal to
Lines 311-314 sub plugin { Link Here
311
        );
313
        );
312
    }
314
    }
313
    output_html_with_http_headers $query, $cookie, $template->output;
315
    output_html_with_http_headers $query, $cookie, $template->output;
314
}
316
};
317
318
return { builder => $builder, launcher => $launcher };
315
- 

Return to bug 13437