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

(-)a/cataloguing/value_builder/unimarc_field_700-4.pl (-71 lines)
Lines 1-71 Link Here
1
#!/usr/bin/perl
2
3
# written 10/5/2002 by Paul
4
5
# Copyright 2000-2002 Katipo Communications
6
#
7
# This file is part of Koha.
8
#
9
# Koha is free software; you can redistribute it and/or modify it
10
# under the terms of the GNU General Public License as published by
11
# the Free Software Foundation; either version 3 of the License, or
12
# (at your option) any later version.
13
#
14
# Koha is distributed in the hope that it will be useful, but
15
# WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
# GNU General Public License for more details.
18
#
19
# You should have received a copy of the GNU General Public License
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
22
use Modern::Perl;
23
24
use C4::Auth qw( get_template_and_user );
25
use CGI qw ( -utf8 );
26
use C4::Context;
27
28
use C4::Search;
29
use C4::Output qw( output_html_with_http_headers );
30
31
sub plugin_javascript {
32
my ($dbh,$record,$tagslib,$field_number) = @_;
33
my $function_name= $field_number;
34
my $res  = "
35
<script>
36
function Clic$function_name(event) {
37
    event.preventDefault();
38
    defaultvalue=document.getElementById(event.data.id).value;
39
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_700-4.pl&result=\"+defaultvalue+\"&index=\" + event.data.id, \"value_builder\",'width=500,height=400,toolbar=false,scrollbars=yes');
40
41
}
42
</script>
43
";
44
45
return ($function_name,$res);
46
}
47
48
sub plugin {
49
my ($input) = @_;
50
	my $index= $input->param('index');
51
	my $index2= $input->param('index2');
52
	$index2=-1 unless($index2);
53
	my $result= $input->param('result');
54
55
56
	my $dbh = C4::Context->dbh;
57
58
    my ($template, $loggedinuser, $cookie) = get_template_and_user(
59
        {
60
            template_name   => "cataloguing/value_builder/unimarc_field_700-4.tt",
61
            query           => $input,
62
            type            => "intranet",
63
            flagsrequired   => { editcatalogue => '*' },
64
        }
65
    );
66
	$template->param(index => $index,
67
							index2 => $index2,
68
							"f1_$result" => "f1_".$result,
69
							);
70
        output_html_with_http_headers $input, $cookie, $template->output;
71
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_700-4.tt (-85 lines)
Lines 1-84 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 700-4 builder") | html %]
7
    [% t("Cataloging") | html %] &rsaquo;
8
    [% t("Koha") | html %]
9
[% END %]</title>
10
[% INCLUDE 'doc-head-close.inc' %]
11
</head>
12
13
<body id="cat_unimarc_field_700-4" class="cat value_builder">
14
    <h1>UNIMARC field 700-4 builder</h1>
15
    <p>Sélectionnez la valeur pour le champ 700 $4. Elle sera automatiquement reportée dans la zone 700 $8 qui suit.</p>
16
    <form name="f_pop" onsubmit="report()" action="">
17
        <div class="page-section">
18
            <table>
19
                <tr>
20
                    <td><label for="f1">Code date publication </label></td><td><select name="f1" id="f1">
21
                            [% IF ( f1_075 ) %]
22
                                <option value="075 - postface" selected="selected">postface</option>
23
                            [% ELSE %]
24
                                <option value="075 - postface">postface</option>
25
                            [% END %]
26
27
                            [% IF ( f1_651 ) %]
28
                                <option value="651 - dir. de publication" selected="selected">dir. de publication</option>
29
                            [% ELSE %]
30
                                <option value="651 - dir. de publication">dir. de publication</option>
31
                            [% END %]
32
33
                            [% IF ( f1_440 ) %]
34
                                <option value="440 - illustrateur" selected="selected">illustrateur</option>
35
                            [% ELSE %]
36
                                <option value="440 - illustrateur">illustrateur</option>
37
                            [% END %]
38
39
                            [% IF ( f1_080 ) %]
40
                                <option value="080 - préface, notes" selected="selected">préface, notes</option>
41
                            [% ELSE %]
42
                                <option value="080 - préface, notes">préface, notes</option>
43
                            [% END %]
44
45
                            [% IF ( f1_730 ) %]
46
                                <option value="730 - traducteur" selected="selected">traducteur</option>
47
                            [% ELSE %]
48
                                <option value="730 - traducteur">traducteur</option>
49
                            [% END %]
50
                        </select>
51
                    </td>
52
                </tr>
53
            </table>
54
        </div> <!-- /.page-section -->
55
56
        <nav class="navbar navbar-default navbar-fixed-bottom">
57
            <div class="container-fluid">
58
                <fieldset class="action">
59
                    <input type="submit" class="btn btn-primary" value="Save" />
60
                    <button class="btn btn-default close_window">Cancel</button>
61
                </fieldset>
62
            </div>
63
        </nav>
64
65
    </form>
66
67
[% MACRO jsinclude BLOCK %]
68
    <script>
69
        function report() {
70
            x = document.f_pop.f1.value.split(' - ');
71
            var doc   = opener.document;
72
            var field = doc.getElementById("[% index | html %]");
73
74
            field.value =  x[0];
75
            if ([% index2 | html %] > 0) {
76
                opener.document.f.field_value[[% index2 | html %]].value= x[1];
77
            }
78
            self.close();
79
            return false;
80
        }
81
    </script>
82
[% END %]
83
84
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
85
- 

Return to bug 3007