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 (-78 lines)
Lines 1-78 Link Here
1
[% USE raw %]
2
[% PROCESS 'i18n.inc' %]
3
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>[% FILTER collapse %]
6
    [% t("UNIMARC field 123d builder") | html %] &rsaquo;
7
    [% t("Cataloguing") | html %] &rsaquo;
8
    [% t("Koha") | html %]
9
[% END %]</title>
10
[% INCLUDE 'doc-head-close.inc' %]
11
</head>
12
<body id="cat_unimarc_field_123d" class="cat" style="padding:1em;">
13
    <h1>UNIMARC field 123d builder</h1>
14
    <div class="page-section">
15
        <form name="f_pop" action="">
16
            <table>
17
                <tr>
18
                    <td><label for="f1">Hemisphere:</label></td>
19
                    <td>
20
                        <select name="f1" id="f1">
21
22
                            [% IF ( f1w ) %]
23
                                <option value="w" selected="selected">west</option>
24
                            [% ELSE %]
25
                                <option value="w">west</option>
26
                            [% END %]
27
                            [% IF ( f1e ) %]
28
                                <option value="e" selected="selected">east</option>
29
                            [% ELSE %]
30
                                <option value="e">east</option>
31
                            [% END %]
32
                            [% IF ( f1n ) %]
33
                                <option value="n" selected="selected">north</option>
34
                            [% ELSE %]
35
                                <option value="n">north</option>
36
                            [% END %]
37
                            [% IF ( f1s ) %]
38
                                <option value="s" selected="selected">south</option>
39
                            [% ELSE %]
40
                                <option value="s">south</option>
41
                            [% END %]
42
                        </select>
43
                    </td></tr>
44
45
                <tr><td><label for="f2">Degree (complete with 0):</label></td>
46
                    <td><input type="text" name="f2" id="f2" maxlength="3" size="4" value="[% f2 | html %]" /></td>
47
                </tr>
48
                <tr><td><label for="f3">Minute (complete with 0):</label></td>
49
                    <td><input type="text" name="f3" id="f3" maxlength="2" size="3" value="[% f3 | html %]" /></td>
50
                </tr>
51
                <tr><td><label for="f4">Second (complete with 0):</label></td>
52
                    <td><input type="text" name="f4" id="f4" maxlength="2" size="3" value="[% f4 | html %]" /></td>
53
                </tr>
54
            </table>
55
            <fieldset class="action"><input type="button" class="btn btn-primary" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></fieldset>
56
        </form>
57
    </div> <!-- /.page-section -->
58
59
[% MACRO jsinclude BLOCK %]
60
    <script>
61
        function report() {
62
            document.f_pop.f2.value=document.f_pop.f2.value+'   ';
63
            document.f_pop.f3.value=document.f_pop.f3.value+'  ';
64
            document.f_pop.f4.value=document.f_pop.f4.value+'  ';
65
            document.f_pop.f2.value=document.f_pop.f2.value.substring(0,3);
66
            document.f_pop.f3.value=document.f_pop.f3.value.substring(0,2);
67
            document.f_pop.f4.value=document.f_pop.f4.value.substring(0,2);
68
69
            var doc   = opener.document;
70
            var field = doc.getElementById("[% index | html %]");
71
            field.value =  document.f_pop.f1.value+document.f_pop.f2.value+document.f_pop.f3.value+document.f_pop.f4.value;
72
            window.close();
73
            return false;
74
        }
75
    </script>
76
[% END %]
77
78
[% 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 3-16 Link Here
3
[% SET footerjs = 1 %]
3
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>[% FILTER collapse %]
5
<title>[% FILTER collapse %]
6
    [% t("UNIMARC field 123e builder") | html %] &rsaquo;
6
    [% t("UNIMARC field 123d/e/f/g builder") | html %] &rsaquo;
7
    [% t("Cataloguing") | html %] &rsaquo;
7
    [% t("Cataloguing") | html %] &rsaquo;
8
    [% t("Koha") | html %]
8
    [% t("Koha") | html %]
9
[% END %]</title>
9
[% END %]</title>
10
[% INCLUDE 'doc-head-close.inc' %]
10
[% INCLUDE 'doc-head-close.inc' %]
11
</head>
11
</head>
12
<body id="cat_unimarc_field_123e" class="cat" style="padding:1em;">
12
<body id="cat_unimarc_field_123d/e/f/g" class="cat" style="padding:1em;">
13
    <h1>UNIMARC field 123e builder</h1>
13
    <h1>UNIMARC field 123d/e/f/g builder</h1>
14
    <div class="page-section">
14
    <div class="page-section">
15
        <form name="f_pop" action="">
15
        <form name="f_pop" action="">
16
            <table>
16
            <table>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123f.tt (-79 lines)
Lines 1-79 Link Here
1
[% USE raw %]
2
[% PROCESS 'i18n.inc' %]
3
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>[% FILTER collapse %]
6
    [% t("UNIMARC field 123f builder") | html %] &rsaquo;
7
    [% t("Cataloguing") | html %] &rsaquo;
8
    [% t("Koha") | html %]
9
[% END %]</title>
10
[% INCLUDE 'doc-head-close.inc' %]
11
</head>
12
<body id="cat_unimarc_field_123f" class="cat" style="padding:1em;">
13
    <h1>UNIMARC field 123f builder</h1>
14
    <div class="page-section">
15
        <form name="f_pop" action="">
16
            <table>
17
                <tr>
18
                    <td><label for="f1">Hemisphere:</label></td>
19
                    <td>
20
                        <select name="f1" id="f1">
21
22
                            [% IF ( f1w ) %]
23
                                <option value="w" selected="selected">west</option>
24
                            [% ELSE %]
25
                                <option value="w">west</option>
26
                            [% END %]
27
                            [% IF ( f1e ) %]
28
                                <option value="e" selected="selected">east</option>
29
                            [% ELSE %]
30
                                <option value="e">east</option>
31
                            [% END %]
32
                            [% IF ( f1n ) %]
33
                                <option value="n" selected="selected">north</option>
34
                            [% ELSE %]
35
                                <option value="n">north</option>
36
                            [% END %]
37
                            [% IF ( f1s ) %]
38
                                <option value="s" selected="selected">south</option>
39
                            [% ELSE %]
40
                                <option value="s">south</option>
41
                            [% END %]
42
                        </select>
43
                    </td></tr>
44
45
                <tr><td><label for="f2">Degree (complete with 0):</label></td>
46
                    <td><input type="text" name="f2" id="f2" maxlength="3" size="4" value="[% f2 | html %]" /></td>
47
                </tr>
48
                <tr><td><label for="f3">Minute (complete with 0):</label></td>
49
                    <td><input type="text" name="f3" id="f3" maxlength="2" size="3" value="[% f3 | html %]" /></td>
50
                </tr>
51
                <tr><td><label for="f4">Second (complete with 0):</label></td>
52
                    <td><input type="text" name="f4" id="f4" maxlength="2" size="3" value="[% f4 | html %]" /></td>
53
                </tr>
54
            </table>
55
            <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>
56
        </form>
57
    </div> <!-- /.page-section -->
58
59
[% MACRO jsinclude BLOCK %]
60
    <script>
61
        function report() {
62
            document.f_pop.f2.value=document.f_pop.f2.value+'   ';
63
            document.f_pop.f3.value=document.f_pop.f3.value+'  ';
64
            document.f_pop.f4.value=document.f_pop.f4.value+'  ';
65
            document.f_pop.f2.value=document.f_pop.f2.value.substring(0,3);
66
            document.f_pop.f3.value=document.f_pop.f3.value.substring(0,2);
67
            document.f_pop.f4.value=document.f_pop.f4.value.substring(0,2);
68
69
            var doc   = opener.document;
70
            var field = doc.getElementById("[% index | html %]");
71
72
            field.value =  document.f_pop.f1.value+document.f_pop.f2.value+document.f_pop.f3.value+document.f_pop.f4.value;
73
            window.close();
74
            return false;
75
        }
76
    </script>
77
[% END %]
78
79
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123g.tt (-80 lines)
Lines 1-79 Link Here
1
[% USE raw %]
2
[% PROCESS 'i18n.inc' %]
3
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>[% FILTER collapse %]
6
    [% t("UNIMARC field 123g builder") | html %] &rsaquo;
7
    [% t("Cataloguing") | html %] &rsaquo;
8
    [% t("Koha") | html %]
9
[% END %]</title>
10
[% INCLUDE 'doc-head-close.inc' %]
11
</head>
12
<body id="cat_unimarc_field_123g" class="cat" style="padding:1em;">
13
    <h1>UNIMARC field 123g builder</h1>
14
    <div class="page-section">
15
        <form name="f_pop" action="">
16
            <table>
17
                <tr>
18
                    <td><label for="f1">Hemisphere:</label></td>
19
                    <td>
20
                        <select name="f1" id="f1">
21
22
                            [% IF ( f1w ) %]
23
                                <option value="w" selected="selected">west</option>
24
                            [% ELSE %]
25
                                <option value="w">west</option>
26
                            [% END %]
27
                            [% IF ( f1e ) %]
28
                                <option value="e" selected="selected">east</option>
29
                            [% ELSE %]
30
                                <option value="e">east</option>
31
                            [% END %]
32
                            [% IF ( f1n ) %]
33
                                <option value="n" selected="selected">north</option>
34
                            [% ELSE %]
35
                                <option value="n">north</option>
36
                            [% END %]
37
                            [% IF ( f1s ) %]
38
                                <option value="s" selected="selected">south</option>
39
                            [% ELSE %]
40
                                <option value="s">south</option>
41
                            [% END %]
42
                        </select>
43
                    </td></tr>
44
45
                <tr><td><label for="f2">Degree (complete with 0):</label></td>
46
                    <td><input type="text" name="f2" id="f2" maxlength="3" size="4" value="[% f2 | html %]" /></td>
47
                </tr>
48
                <tr><td><label for="f3">Minute (complete with 0):</label></td>
49
                    <td><input type="text" name="f3" id="f3" maxlength="2" size="3" value="[% f3 | html %]" /></td>
50
                </tr>
51
                <tr><td><label for="f4">Second (complete with 0):</label></td>
52
                    <td><input type="text" name="f4" id="f4" maxlength="2" size="3" value="[% f4 | html %]" /></td>
53
                </tr>
54
            </table>
55
            <fieldset class="action"><input type="button" class="btn btn-primary" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></fieldset>
56
        </form>
57
    </div> <!-- /.page-section -->
58
59
[% MACRO jsinclude BLOCK %]
60
    <script>
61
        function report() {
62
            document.f_pop.f2.value=document.f_pop.f2.value+'   ';
63
            document.f_pop.f3.value=document.f_pop.f3.value+'  ';
64
            document.f_pop.f4.value=document.f_pop.f4.value+'  ';
65
            document.f_pop.f2.value=document.f_pop.f2.value.substring(0,3);
66
            document.f_pop.f3.value=document.f_pop.f3.value.substring(0,2);
67
            document.f_pop.f4.value=document.f_pop.f4.value.substring(0,2);
68
69
            var doc   = opener.document;
70
            var field = doc.getElementById("[% index | html %]");
71
72
            field.value =  document.f_pop.f1.value+document.f_pop.f2.value+document.f_pop.f3.value+document.f_pop.f4.value;
73
            window.close();
74
            return false;
75
        }
76
    </script>
77
[% END %]
78
79
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
80
- 

Return to bug 34657