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

(-)a/cataloguing/value_builder/unimarc_field_123d.pl (-2 / +2 lines)
Lines 35-41 my $res=" Link Here
35
function Clic$function_name(event) {
35
function Clic$function_name(event) {
36
    event.preventDefault();
36
    event.preventDefault();
37
    defaultvalue=document.getElementById(event.data.id).value;
37
    defaultvalue=document.getElementById(event.data.id).value;
38
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_123g.pl&index=\" + event.data.id + \"&result=\"+defaultvalue,\"unimarc_field_123g\",'width=1000,height=375,toolbar=false,scrollbars=yes');
38
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_123defg.pl&index=\" + event.data.id + \"&result=\"+defaultvalue,\"unimarc_field_123defg\",'width=1000,height=375,toolbar=false,scrollbars=yes');
39
39
40
}
40
}
41
</script>
41
</script>
Lines 52-58 my ($input) = @_; Link Here
52
	my $dbh = C4::Context->dbh;
52
	my $dbh = C4::Context->dbh;
53
53
54
my ($template, $loggedinuser, $cookie)
54
my ($template, $loggedinuser, $cookie)
55
    = get_template_and_user({template_name => "cataloguing/value_builder/unimarc_field_123g.tt",
55
    = get_template_and_user({template_name => "cataloguing/value_builder/unimarc_field_123defg.tt",
56
			     query => $input,
56
			     query => $input,
57
			     type => "intranet",
57
			     type => "intranet",
58
			     flagsrequired => {editcatalogue => '*'},
58
			     flagsrequired => {editcatalogue => '*'},
(-)a/cataloguing/value_builder/unimarc_field_123e.pl (-70 lines)
Lines 1-70 Link Here
1
#!/usr/bin/perl
2
3
4
# Copyright 2000-2002 Katipo Communications
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
23
use C4::Auth qw( get_template_and_user );
24
use CGI qw ( -utf8 );
25
use C4::Context;
26
27
use C4::Search;
28
use C4::Output qw( output_html_with_http_headers );
29
30
sub plugin_javascript {
31
my ($dbh,$record,$tagslib,$field_number) = @_;
32
my $function_name= $field_number;
33
my $res="
34
<script>
35
function Clic$function_name(event) {
36
    event.preventDefault();
37
    defaultvalue=document.getElementById(event.data.id).value;
38
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_123g.pl&index=\" + event.data.id + \"&result=\"+defaultvalue,\"unimarc_field_123g\",'width=1000,height=375,toolbar=false,scrollbars=yes');
39
40
}
41
</script>
42
";
43
44
return ($function_name,$res);
45
}
46
sub plugin {
47
my ($input) = @_;
48
	my $index= $input->param('index');
49
	my $result= $input->param('result');
50
51
52
	my $dbh = C4::Context->dbh;
53
54
my ($template, $loggedinuser, $cookie)
55
    = get_template_and_user({template_name => "cataloguing/value_builder/unimarc_field_123g.tt",
56
			     query => $input,
57
			     type => "intranet",
58
			     flagsrequired => {editcatalogue => '*'},
59
			     });
60
	my $f1 = substr($result,0,1);
61
	my $f2 = substr($result,1,3);
62
	my $f3 = substr($result,4,2);
63
	my $f4 = substr($result,6,2);
64
	$template->param(index => $index,
65
			 "f1$f1" => 1,
66
			 f2 => $f2,
67
			 f3 => $f3,
68
			 f4 => $f4);
69
        output_html_with_http_headers $input, $cookie, $template->output;
70
}
(-)a/cataloguing/value_builder/unimarc_field_123f.pl (-71 lines)
Lines 1-71 Link Here
1
#!/usr/bin/perl
2
3
4
# Copyright 2000-2002 Katipo Communications
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
23
use C4::Auth qw( get_template_and_user );
24
use CGI qw ( -utf8 );
25
use C4::Context;
26
27
use C4::Search;
28
use C4::Output qw( output_html_with_http_headers );
29
30
sub plugin_javascript {
31
my ($dbh,$record,$tagslib,$field_number) = @_;
32
my $function_name= $field_number;
33
my $res="
34
<script>
35
function Clic$function_name(event) {
36
    event.preventDefault();
37
    defaultvalue=document.getElementById(event.data.id).value;
38
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_123g.pl&index=\" + event.data.id + \"&result=\"+defaultvalue,\"unimarc_field_123g\",'width=1000,height=375,toolbar=false,scrollbars=yes');
39
40
}
41
</script>
42
";
43
44
return ($function_name,$res);
45
}
46
sub plugin {
47
my ($input) = @_;
48
49
	my $index= $input->param('index');
50
	my $result= $input->param('result');
51
52
53
	my $dbh = C4::Context->dbh;
54
55
my ($template, $loggedinuser, $cookie)
56
    = get_template_and_user({template_name => "cataloguing/value_builder/unimarc_field_123g.tt",
57
			     query => $input,
58
			     type => "intranet",
59
			     flagsrequired => {editcatalogue => '*'},
60
			     });
61
	my $f1 = substr($result,0,1);
62
	my $f2 = substr($result,1,3);
63
	my $f3 = substr($result,4,2);
64
	my $f4 = substr($result,6,2);
65
	$template->param(index => $index,
66
			 "f1$f1" => 1,
67
			 f2 => $f2,
68
			 f3 => $f3,
69
			 f4 => $f4);
70
        output_html_with_http_headers $input, $cookie, $template->output;
71
}
(-)a/cataloguing/value_builder/unimarc_field_123g.pl (-70 lines)
Lines 1-70 Link Here
1
#!/usr/bin/perl
2
3
4
# Copyright 2000-2002 Katipo Communications
5
#
6
# This file is part of Koha.
7
#
8
# Koha is free software; you can redistribute it and/or modify it
9
# under the terms of the GNU General Public License as published by
10
# the Free Software Foundation; either version 3 of the License, or
11
# (at your option) any later version.
12
#
13
# Koha is distributed in the hope that it will be useful, but
14
# WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
21
use Modern::Perl;
22
23
use C4::Auth qw( get_template_and_user );
24
use CGI qw ( -utf8 );
25
use C4::Context;
26
27
use C4::Search;
28
use C4::Output qw( output_html_with_http_headers );
29
30
sub plugin_javascript {
31
my ($dbh,$record,$tagslib,$field_number) = @_;
32
my $function_name= $field_number;
33
my $res="
34
<script>
35
function Clic$function_name(event) {
36
    event.preventDefault();
37
    defaultvalue=document.getElementById(event.data.id).value;
38
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_123g.pl&index=\" + event.data.id + \"&result=\"+defaultvalue,\"unimarc_field_123g\",'width=1000,height=375,toolbar=false,scrollbars=yes');
39
40
}
41
</script>
42
";
43
44
return ($function_name,$res);
45
}
46
sub plugin {
47
my ($input) = @_;
48
	my $index= $input->param('index');
49
	my $result= $input->param('result');
50
51
52
	my $dbh = C4::Context->dbh;
53
54
my ($template, $loggedinuser, $cookie)
55
    = get_template_and_user({template_name => "cataloguing/value_builder/unimarc_field_123g.tt",
56
			     query => $input,
57
			     type => "intranet",
58
			     flagsrequired => {editcatalogue => '*'},
59
			     });
60
	my $f1 = substr($result,0,1);
61
	my $f2 = substr($result,1,3);
62
	my $f3 = substr($result,4,2);
63
	my $f4 = substr($result,6,2);
64
	$template->param(index => $index,
65
			 "f1$f1" => 1,
66
			 f2 => $f2,
67
			 f3 => $f3,
68
			 f4 => $f4);
69
        output_html_with_http_headers $input, $cookie, $template->output;
70
}
(-)a/installer/data/mysql/atomicupdate/bug-34657-update-unimarc-123defg-plugins.pl (+18 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "34657",
5
    description => "Update MARC frameworks to use renamed UNIMARC plugin",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        # Do you stuffs here
11
        $dbh->do(q{
12
            UPDATE `marc_subfield_structure` SET `value_builder` = 'unimarc_field_123defg.pl' WHERE (`value_builder` = 'unimarc_field_123d.pl' OR `value_builder` = 'unimarc_field_123e.pl' OR `value_builder` = 'unimarc_field_123f.pl' OR `value_builder` = 'unimarc_field_123g.pl' );
13
        });
14
15
        say $out "Update complete: MARC subfields which were configured to use unimarc_field123d.pl, unimarc_field123e.pl, unimarc_field123f.pl, or unimarc_field123g.pl will now use unimarc_field123defg.pl";
16
17
    },
18
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123d.tt (-72 lines)
Lines 1-72 Link Here
1
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>UNIMARC field 123d builder</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
</head>
6
<body id="cat_unimarc_field_123d" class="cat" style="padding:1em;">
7
    <h1>UNIMARC field 123d builder</h1>
8
    <div class="page-section">
9
        <form name="f_pop" action="">
10
            <table>
11
                <tr>
12
                    <td><label for="f1">Hemisphere:</label></td>
13
                    <td>
14
                        <select name="f1" id="f1">
15
16
                            [% IF ( f1w ) %]
17
                                <option value="w" selected="selected">west</option>
18
                            [% ELSE %]
19
                                <option value="w">west</option>
20
                            [% END %]
21
                            [% IF ( f1e ) %]
22
                                <option value="e" selected="selected">east</option>
23
                            [% ELSE %]
24
                                <option value="e">east</option>
25
                            [% END %]
26
                            [% IF ( f1n ) %]
27
                                <option value="n" selected="selected">north</option>
28
                            [% ELSE %]
29
                                <option value="n">north</option>
30
                            [% END %]
31
                            [% IF ( f1s ) %]
32
                                <option value="s" selected="selected">south</option>
33
                            [% ELSE %]
34
                                <option value="s">south</option>
35
                            [% END %]
36
                        </select>
37
                    </td></tr>
38
39
                <tr><td><label for="f2">Degree (complete with 0):</label></td>
40
                    <td><input type="text" name="f2" id="f2" maxlength="3" size="4" value="[% f2 | html %]" /></td>
41
                </tr>
42
                <tr><td><label for="f3">Minute (complete with 0):</label></td>
43
                    <td><input type="text" name="f3" id="f3" maxlength="2" size="3" value="[% f3 | html %]" /></td>
44
                </tr>
45
                <tr><td><label for="f4">Second (complete with 0):</label></td>
46
                    <td><input type="text" name="f4" id="f4" maxlength="2" size="3" value="[% f4 | html %]" /></td>
47
                </tr>
48
            </table>
49
            <fieldset class="action"><input type="button" class="btn btn-primary" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></fieldset>
50
        </form>
51
    </div> <!-- /.page-section -->
52
53
[% MACRO jsinclude BLOCK %]
54
    <script>
55
        function report() {
56
            document.f_pop.f2.value=document.f_pop.f2.value+'   ';
57
            document.f_pop.f3.value=document.f_pop.f3.value+'  ';
58
            document.f_pop.f4.value=document.f_pop.f4.value+'  ';
59
            document.f_pop.f2.value=document.f_pop.f2.value.substring(0,3);
60
            document.f_pop.f3.value=document.f_pop.f3.value.substring(0,2);
61
            document.f_pop.f4.value=document.f_pop.f4.value.substring(0,2);
62
63
            var doc   = opener.document;
64
            var field = doc.getElementById("[% index | html %]");
65
            field.value =  document.f_pop.f1.value+document.f_pop.f2.value+document.f_pop.f3.value+document.f_pop.f4.value;
66
            window.close();
67
            return false;
68
        }
69
    </script>
70
[% END %]
71
72
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123e.tt (-3 / +3 lines)
Lines 1-10 Link Here
1
[% SET footerjs = 1 %]
1
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>UNIMARC field 123e builder</title>
3
<title>UNIMARC field 123d/e/f/g builder</title>
4
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
5
</head>
5
</head>
6
<body id="cat_unimarc_field_123e" class="cat" style="padding:1em;">
6
<body id="cat_unimarc_field_123d/e/f/g" class="cat" style="padding:1em;">
7
    <h1>UNIMARC field 123e builder</h1>
7
    <h1>UNIMARC field 123d/e/f/g builder</h1>
8
    <div class="page-section">
8
    <div class="page-section">
9
        <form name="f_pop" action="">
9
        <form name="f_pop" action="">
10
            <table>
10
            <table>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123f.tt (-73 lines)
Lines 1-73 Link Here
1
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>UNIMARC field 123f builder</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
</head>
6
<body id="cat_unimarc_field_123f" class="cat" style="padding:1em;">
7
    <h1>UNIMARC field 123f builder</h1>
8
    <div class="page-section">
9
        <form name="f_pop" action="">
10
            <table>
11
                <tr>
12
                    <td><label for="f1">Hemisphere:</label></td>
13
                    <td>
14
                        <select name="f1" id="f1">
15
16
                            [% IF ( f1w ) %]
17
                                <option value="w" selected="selected">west</option>
18
                            [% ELSE %]
19
                                <option value="w">west</option>
20
                            [% END %]
21
                            [% IF ( f1e ) %]
22
                                <option value="e" selected="selected">east</option>
23
                            [% ELSE %]
24
                                <option value="e">east</option>
25
                            [% END %]
26
                            [% IF ( f1n ) %]
27
                                <option value="n" selected="selected">north</option>
28
                            [% ELSE %]
29
                                <option value="n">north</option>
30
                            [% END %]
31
                            [% IF ( f1s ) %]
32
                                <option value="s" selected="selected">south</option>
33
                            [% ELSE %]
34
                                <option value="s">south</option>
35
                            [% END %]
36
                        </select>
37
                    </td></tr>
38
39
                <tr><td><label for="f2">Degree (complete with 0):</label></td>
40
                    <td><input type="text" name="f2" id="f2" maxlength="3" size="4" value="[% f2 | html %]" /></td>
41
                </tr>
42
                <tr><td><label for="f3">Minute (complete with 0):</label></td>
43
                    <td><input type="text" name="f3" id="f3" maxlength="2" size="3" value="[% f3 | html %]" /></td>
44
                </tr>
45
                <tr><td><label for="f4">Second (complete with 0):</label></td>
46
                    <td><input type="text" name="f4" id="f4" maxlength="2" size="3" value="[% f4 | html %]" /></td>
47
                </tr>
48
            </table>
49
            <fieldset class="action"><input type="button" class="btn btn-primary" class="btn btn-primary" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></fieldset>
50
        </form>
51
    </div> <!-- /.page-section -->
52
53
[% MACRO jsinclude BLOCK %]
54
    <script>
55
        function report() {
56
            document.f_pop.f2.value=document.f_pop.f2.value+'   ';
57
            document.f_pop.f3.value=document.f_pop.f3.value+'  ';
58
            document.f_pop.f4.value=document.f_pop.f4.value+'  ';
59
            document.f_pop.f2.value=document.f_pop.f2.value.substring(0,3);
60
            document.f_pop.f3.value=document.f_pop.f3.value.substring(0,2);
61
            document.f_pop.f4.value=document.f_pop.f4.value.substring(0,2);
62
63
            var doc   = opener.document;
64
            var field = doc.getElementById("[% index | html %]");
65
66
            field.value =  document.f_pop.f1.value+document.f_pop.f2.value+document.f_pop.f3.value+document.f_pop.f4.value;
67
            window.close();
68
            return false;
69
        }
70
    </script>
71
[% END %]
72
73
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123g.tt (-74 lines)
Lines 1-73 Link Here
1
[% SET footerjs = 1 %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>UNIMARC field 123g builder</title>
4
[% INCLUDE 'doc-head-close.inc' %]
5
</head>
6
<body id="cat_unimarc_field_123g" class="cat" style="padding:1em;">
7
    <h1>UNIMARC field 123g builder</h1>
8
    <div class="page-section">
9
        <form name="f_pop" action="">
10
            <table>
11
                <tr>
12
                    <td><label for="f1">Hemisphere:</label></td>
13
                    <td>
14
                        <select name="f1" id="f1">
15
16
                            [% IF ( f1w ) %]
17
                                <option value="w" selected="selected">west</option>
18
                            [% ELSE %]
19
                                <option value="w">west</option>
20
                            [% END %]
21
                            [% IF ( f1e ) %]
22
                                <option value="e" selected="selected">east</option>
23
                            [% ELSE %]
24
                                <option value="e">east</option>
25
                            [% END %]
26
                            [% IF ( f1n ) %]
27
                                <option value="n" selected="selected">north</option>
28
                            [% ELSE %]
29
                                <option value="n">north</option>
30
                            [% END %]
31
                            [% IF ( f1s ) %]
32
                                <option value="s" selected="selected">south</option>
33
                            [% ELSE %]
34
                                <option value="s">south</option>
35
                            [% END %]
36
                        </select>
37
                    </td></tr>
38
39
                <tr><td><label for="f2">Degree (complete with 0):</label></td>
40
                    <td><input type="text" name="f2" id="f2" maxlength="3" size="4" value="[% f2 | html %]" /></td>
41
                </tr>
42
                <tr><td><label for="f3">Minute (complete with 0):</label></td>
43
                    <td><input type="text" name="f3" id="f3" maxlength="2" size="3" value="[% f3 | html %]" /></td>
44
                </tr>
45
                <tr><td><label for="f4">Second (complete with 0):</label></td>
46
                    <td><input type="text" name="f4" id="f4" maxlength="2" size="3" value="[% f4 | html %]" /></td>
47
                </tr>
48
            </table>
49
            <fieldset class="action"><input type="button" class="btn btn-primary" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></fieldset>
50
        </form>
51
    </div> <!-- /.page-section -->
52
53
[% MACRO jsinclude BLOCK %]
54
    <script>
55
        function report() {
56
            document.f_pop.f2.value=document.f_pop.f2.value+'   ';
57
            document.f_pop.f3.value=document.f_pop.f3.value+'  ';
58
            document.f_pop.f4.value=document.f_pop.f4.value+'  ';
59
            document.f_pop.f2.value=document.f_pop.f2.value.substring(0,3);
60
            document.f_pop.f3.value=document.f_pop.f3.value.substring(0,2);
61
            document.f_pop.f4.value=document.f_pop.f4.value.substring(0,2);
62
63
            var doc   = opener.document;
64
            var field = doc.getElementById("[% index | html %]");
65
66
            field.value =  document.f_pop.f1.value+document.f_pop.f2.value+document.f_pop.f3.value+document.f_pop.f4.value;
67
            window.close();
68
            return false;
69
        }
70
    </script>
71
[% END %]
72
73
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
74
- 

Return to bug 34657