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

(-)a/cataloguing/value_builder/unimarc_field_181-2.pl (+65 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2014 Rijksmuseum
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# Koha is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20
use Modern::Perl;
21
22
use Date::Calc;
23
24
use Koha::Util::FrameworkPlugin qw(wrapper);
25
use C4::Auth qw( get_template_and_user );
26
use CGI qw ( -utf8 );
27
use C4::Context;
28
use C4::Output qw( output_html_with_http_headers );
29
30
my $builder= sub {
31
    my $params = shift;
32
    my $id = $params->{id};
33
34
    return qq|
35
<script>
36
37
function Click$id(event) {
38
    var fieldvalue=\$('#'+event.data.id).val();
39
    window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_181-2.pl&index=\"+event.data.id+\"&result=\"+fieldvalue,\"tag_editor\",'width=700,height=700,toolbar=false,scrollbars=yes');
40
    return false; /* prevents scrolling */
41
}
42
</script>|;
43
};
44
45
my $launcher= sub {
46
    my $params = shift;
47
    my $cgi = $params->{cgi};
48
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
49
        template_name => "cataloguing/value_builder/unimarc_field_181-2.tt",
50
        query => $cgi,
51
        type => "intranet",
52
        flagsrequired => {editcatalogue => '*'},
53
    });
54
    $template->param(
55
        index => scalar $cgi->param('index'),
56
        result => scalar $cgi->param('result'),
57
        cgi => $cgi,
58
    );
59
    output_html_with_http_headers $cgi, $cookie, $template->output;
60
};
61
62
# Return the hashref with the builder and launcher to FrameworkPlugin object.
63
# NOTE: If you do not need a popup but only use e.g. Focus, Blur etc. for a
64
# particular plugin, you only need to define and return the builder.
65
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/unimarc_field_181a.pl (+74 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2014 Rijksmuseum
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# Koha is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20
use Modern::Perl;
21
22
use Date::Calc;
23
24
use Koha::Util::FrameworkPlugin qw(wrapper);
25
use C4::Auth qw( get_template_and_user );
26
use CGI qw ( -utf8 );
27
use C4::Context;
28
use C4::Output qw( output_html_with_http_headers );
29
30
my $builder= sub {
31
    my $params = shift;
32
    my $id = $params->{id};
33
34
    return qq|
35
<script>
36
37
function Click$id(event) {
38
    var fieldvalue=\$('#'+event.data.id).val();
39
    window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_181a.pl&index=\"+event.data.id+\"&result=\"+fieldvalue,\"tag_editor\",'width=700,height=700,toolbar=false,scrollbars=yes');
40
    return false; /* prevents scrolling */
41
}
42
</script>|;
43
};
44
45
my $launcher= sub {
46
    my $params = shift;
47
    my $cgi = $params->{cgi};
48
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
49
        template_name => "cataloguing/value_builder/unimarc_field_181a.tt",
50
        query => $cgi,
51
        type => "intranet",
52
        flagsrequired => {editcatalogue => '*'},
53
    });
54
    my $results = scalar $cgi->param('result');
55
56
    $template->param(
57
        index => scalar $cgi->param('index'),
58
        result => $results,
59
    );
60
61
    # Return the result of the position in the string, ex: abcde = 1=a, 2=b, 3=c...
62
    my @x = split(//, $results);
63
    my $i = 1;
64
    for my $fresult (@x) {
65
        $template->param("f$i" => $fresult);
66
        ++$i;
67
    }
68
    output_html_with_http_headers $cgi, $cookie, $template->output;
69
};
70
71
# Return the hashref with the builder and launcher to FrameworkPlugin object.
72
# NOTE: If you do not need a popup but only use e.g. Focus, Blur etc. for a
73
# particular plugin, you only need to define and return the builder.
74
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/unimarc_field_181b.pl (+72 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2014 Rijksmuseum
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# Koha is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20
use Modern::Perl;
21
22
use Date::Calc;
23
24
use Koha::Util::FrameworkPlugin qw(wrapper);
25
use C4::Auth qw( get_template_and_user );
26
use CGI qw ( -utf8 );
27
use C4::Context;
28
use C4::Output qw( output_html_with_http_headers );
29
use Data::Dumper;
30
31
my $builder= sub {
32
    my $params = shift;
33
    my $id = $params->{id};
34
35
    return qq|
36
<script>
37
38
function Click$id(event) {
39
    var fieldvalue=\$('#'+event.data.id).val();
40
    window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_181b.pl&index=\"+event.data.id+\"&result=\"+fieldvalue,\"tag_editor\",'width=700,height=700,toolbar=false,scrollbars=yes');
41
    return false; /* prevents scrolling */
42
}
43
</script>|;
44
};
45
46
my $launcher= sub {
47
    my $params = shift;
48
    my $cgi = $params->{cgi};
49
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
50
        template_name => "cataloguing/value_builder/unimarc_field_181b.tt",
51
        query => $cgi,
52
        type => "intranet",
53
        flagsrequired => {editcatalogue => '*'},
54
    });
55
    my $results = scalar $cgi->param('result');
56
    $template->param(
57
        index => scalar $cgi->param('index'),
58
        result => $results,
59
    );
60
61
    # Return the result of the position in the string, ex: abcde = 1=a, 2=b, 3=c...
62
    my @x = split(//, $results);
63
    my $i = 1;
64
    for my $fresult (@x) {
65
        $template->param("f$i" => $fresult);
66
        ++$i;
67
    }
68
69
    output_html_with_http_headers $cgi, $cookie, $template->output;
70
};
71
72
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/unimarc_field_181c.pl (+70 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# Copyright 2014 Rijksmuseum
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# Koha is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20
use Modern::Perl;
21
22
use Date::Calc;
23
24
use Koha::Util::FrameworkPlugin qw(wrapper);
25
use C4::Auth qw( get_template_and_user );
26
use CGI qw ( -utf8 );
27
use C4::Context;
28
use C4::Output qw( output_html_with_http_headers );
29
30
31
my $builder= sub {
32
    my $params = shift;
33
    my $id = $params->{id};
34
35
    return qq|
36
<script>
37
38
function Click$id(event) {
39
    var fieldvalue=\$('#'+event.data.id).val();
40
    window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_181c.pl&index=\"+event.data.id+\"&result=\"+fieldvalue,\"tag_editor\",'width=700,height=700,toolbar=false,scrollbars=yes');
41
    return false; /* prevents scrolling */
42
}
43
</script>|;
44
};
45
46
my $launcher= sub {
47
    my $params = shift;
48
    my $cgi = $params->{cgi};
49
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
50
        template_name => "cataloguing/value_builder/unimarc_field_181c.tt",
51
        query => $cgi,
52
        type => "intranet",
53
        flagsrequired => {editcatalogue => '*'},
54
    });
55
    my $results = scalar $cgi->param('result');
56
    my $input_a = substr $results, 0, 3;
57
58
    $template->param(
59
        index => scalar $cgi->param('index'),
60
        result => $results,
61
        f1 => $input_a,
62
    );
63
64
    output_html_with_http_headers $cgi, $cookie, $template->output;
65
};
66
67
# Return the hashref with the builder and launcher to FrameworkPlugin object.
68
# NOTE: If you do not need a popup but only use e.g. Focus, Blur etc. for a
69
# particular plugin, you only need to define and return the builder.
70
return { builder => $builder, launcher => $launcher };
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_181-2.tt (+58 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Framework plugin example &rsaquo; Cataloguing &rsaquo; Koha</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
6
<body id="cat_unimarc_field_182-2" class="cat" style="padding:1em;">
7
8
<h3>UNIMARC field 181-2 builder</h3>
9
10
<form name="f_pop" action="">
11
<table>
12
    <tr>
13
        <td><label for="f0">System code :</label></td>
14
        <td>
15
            <select name="f0" id="f0">
16
                [% IF ( f0 == "carr" ) %]
17
                    <option value="RDAcarrier" selected="selected">RDA Carrier</option>
18
                [% ELSE %]
19
                    <option value="RDAcarrier">RDA Carrier</option>
20
                [% END %]
21
22
                [% IF ( f0 == "cont" ) %]
23
                    <option value="RDAcontent" selected="selected">RDA Content</option>
24
                [% ELSE %]
25
                    <option value="RDAcontent">RDA Content</option>
26
                [% END %]
27
28
                [% IF ( f0 == "media" ) %]
29
                    <option value="RDAmedia" selected="selected">RDA Media</option>
30
                [% ELSE %]
31
                    <option value="RDAmedia">RDA Media</option>
32
                [% END %]
33
34
                [% IF ( f0 == "frcarr" ) %]
35
                    <option value="RDAfrCarrier" selected="selected">RDA fr Carrier</option>
36
                [% ELSE %]
37
                    <option value="RDAfrCarrier">RDA fr Carrier</option>
38
                [% END %]
39
            </select>
40
        </td>
41
    </tr>
42
</table>
43
<p><input type="button" value="OK"  onclick="submitMyForm();" /> <a href="#" class="cancel close">Cancel</a> </p>
44
</form>
45
46
<script>
47
48
    function submitMyForm() {
49
        var doc   = opener.document;
50
        var field = doc.getElementById("[% index | html %]");
51
52
        field.value = document.f_pop.f0.value;
53
        window.close();
54
        return false;
55
    }
56
</script>
57
58
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_181a.tt (+143 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Framework plugin example &rsaquo; Cataloguing &rsaquo; Koha</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
6
<body id="cat_unimarc_field_181a" class="cat" style="padding:1em;">
7
8
<h3>UNIMARC field 181a builder</h3>
9
10
<form name="f_pop" action="">
11
<table>
12
    <tr>
13
        <td><label for="f1">Content Form </label></td>
14
        <td>
15
            <select name="f1" id="f1">
16
            [% IF ( f1 == "a" ) %]
17
                <option value="a" selected="selected">a - dataset</option>
18
            [% ELSE %]
19
                <option value="a">a - dataset</option>
20
            [% END %]
21
22
            [% IF ( f1 == "b" ) %]
23
                <option value="b" selected="selected">b - image</option>
24
            [% ELSE %]
25
                <option value="b">b - image</option>
26
            [% END %]
27
28
            [% IF ( f1 == "c" ) %]
29
                <option value="c" selected="selected">c - movement</option>
30
            [% ELSE %]
31
                <option value="c">c - movement</option>
32
            [% END %]
33
34
            [% IF ( f1 == "d" ) %]
35
                <option value="d" selected="selected">d - music</option>
36
            [% ELSE %]
37
                <option value="d">d - music</option>
38
            [% END %]
39
40
            [% IF ( f1 == "e" ) %]
41
                <option value="e" selected="selected">e - object</option>
42
            [% ELSE %]
43
                <option value="e">e - object</option>
44
            [% END %]
45
46
            [% IF ( f1 == "f" ) %]
47
                <option value="f" selected="selected">f - program</option>
48
            [% ELSE %]
49
                <option value="f">f - program</option>
50
            [% END %]
51
52
            [% IF ( f1 == "g" ) %]
53
                <option value="g" selected="selected">g - sounds</option>
54
            [% ELSE %]
55
                <option value="g">g - sounds</option>
56
            [% END %]
57
58
            [% IF ( f1 == "h" ) %]
59
                <option value="h" selected="selected">h - spoken word</option>
60
            [% ELSE %]
61
                <option value="h">h - spoken word</option>
62
            [% END %]
63
64
            [% IF ( f1 == "i" ) %]
65
                <option value="i" selected="selected">i - text</option>
66
            [% ELSE %]
67
                <option value="i">i - text</option>
68
            [% END %]
69
70
            [% IF ( f1 == "m" ) %]
71
                <option value="m" selected="selected">m - multiple contents forms</option>
72
            [% ELSE %]
73
                <option value="m">m - multiple contents forms</option>
74
            [% END %]
75
76
            [% IF ( f1 == "z" ) %]
77
                <option value="z" selected="selected">z - other content form</option>
78
            [% ELSE %]
79
                <option value="z">z - other content form</option>
80
            [% END %]
81
            </select>
82
        </td>
83
    </tr>
84
    <tr>
85
        <td><label for="f2">Extent of applicability </label></td>
86
        <td>
87
            <select name="f2" id="f2">
88
            [% IF ( f2 == "0" ) %]
89
                <option value="0" selected="selected">0 - none</option>
90
            [% ELSE %]
91
                <option value="0">0 - none</option>
92
            [% END %]
93
94
            [% IF ( f2 == "1" ) %]
95
                <option value="1" selected="selected">1 - some</option>
96
            [% ELSE %]
97
                <option value="1">1 - some</option>
98
            [% END %]
99
100
            [% IF ( f2 == "2" ) %]
101
                <option value="2" selected="selected">2 - substantial</option>
102
            [% ELSE %]
103
                <option value="2">2 - substantial</option>
104
            [% END %]
105
106
            [% IF ( f2 == "3" ) %]
107
                <option value="3" selected="selected">3 - predominate</option>
108
            [% ELSE %]
109
                <option value="3">3 - predominate</option>
110
            [% END %]
111
112
            [% IF ( f2 == "4" ) %]
113
                <option value="4" selected="selected">4 - full</option>
114
            [% ELSE %]
115
                <option value="4">4 - full</option>
116
            [% END %]
117
118
            [% IF ( f2 == "" ) %]
119
                <option value=" " selected="selected"># - position not used</option>
120
            [% ELSE %]
121
                <option value=" "># - position not used</option>
122
            [% END %]
123
            </select>
124
        </td>
125
    </tr>
126
127
</table>
128
<p><input type="button" value="OK"  onclick="submitMyForm();" /> <a href="#" class="cancel close">Cancel</a> </p>
129
</form>
130
131
<script>
132
133
    function submitMyForm() {
134
        var doc   = opener.document;
135
        var field = doc.getElementById("[% index | html %]");
136
        field.value = document.f_pop.f1.value+
137
                      document.f_pop.f2.value;
138
        window.close();
139
        return false;
140
    }
141
</script>
142
143
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_181b.tt (+257 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Framework plugin example &rsaquo; Cataloguing &rsaquo; Koha</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
6
<body id="cat_unimarc_field_181b" class="cat" style="padding:1em;">
7
8
<h3>UNIMARC field 181b builder</h3>
9
10
<form name="f_pop" action="">
11
<table>
12
    <tr>
13
        <td><label for="f1">Specification of Type </label></td>
14
        <td>
15
            <select name="f1" id="f1">
16
            [% IF ( f1 == "a" ) %]
17
                <option value="a" selected="selected">a - notated</option>
18
            [% ELSE %]
19
                <option value="a">a - notated</option>
20
            [% END %]
21
22
            [% IF ( f1 == "b" ) %]
23
                <option value="b" selected="selected">b - performed</option>
24
            [% ELSE %]
25
                <option value="b">b - performed</option>
26
            [% END %]
27
28
            [% IF ( f1 == "c" ) %]
29
                <option value="c" selected="selected">c - cartographic</option>
30
            [% ELSE %]
31
                <option value="c">c - cartographic</option>
32
            [% END %]
33
34
            [% IF ( f1 == "x" ) %]
35
                <option value="x" selected="selected">x - not applicable</option>
36
            [% ELSE %]
37
                <option value="x">x - not applicable</option>
38
            [% END %]
39
40
            [% IF ( f1 == " " ) %]
41
                <option value=" " selected="selected"># - position not used</option>
42
            [% ELSE %]
43
                <option value=" "># - position not used</option>
44
            [% END %]
45
            </select>
46
        </td>
47
    </tr>
48
    <tr>
49
        <td><label for="f2">Specification of Motion </label></td>
50
        <td>
51
            <select name="f2" id="f2">
52
            [% IF ( f2 == "a" ) %]
53
                <option value="a" selected="selected">a - moving</option>
54
            [% ELSE %]
55
                <option value="a">a - moving</option>
56
            [% END %]
57
58
            [% IF ( f2 == "b" ) %]
59
                <option value="b" selected="selected">b - still</option>
60
            [% ELSE %]
61
                <option value="b">b - still</option>
62
            [% END %]
63
64
            [% IF ( f2 == "x" ) %]
65
                <option value="x" selected="selected">x - not applicable (resource is not an image)</option>
66
            [% ELSE %]
67
                <option value="x">x - not applicable (resource is not an image)</option>
68
            [% END %]
69
70
            [% IF ( f2 == " " ) %]
71
                <option value=" " selected="selected"># - position not used</option>
72
            [% ELSE %]
73
                <option value=" "># - position not used</option>
74
            [% END %]
75
            </select>
76
        </td>
77
    </tr>
78
    <tr>
79
        <td><label for="f3">Specification of Dimensionality </label></td>
80
        <td>
81
            <select name="f3" id="f3">
82
            [% IF ( f3 == "a" ) %]
83
                <option value="a" selected="selected">a - two-dimensional</option>
84
            [% ELSE %]
85
                <option value="a">a - two-dimensional</option>
86
            [% END %]
87
88
            [% IF ( f3 == "b" ) %]
89
                <option value="b" selected="selected">b - three-dimensional</option>
90
            [% ELSE %]
91
                <option value="b">b - three-dimensional</option>
92
            [% END %]
93
94
            [% IF ( f3 == "x" ) %]
95
                <option value="x" selected="selected">x - not applicable (resource is not an image)</option>
96
            [% ELSE %]
97
                <option value="x">x - not applicable (resource is not an image)</option>
98
            [% END %]
99
100
            [% IF ( f3 == " " ) %]
101
                <option value=" " selected="selected"># - position not used</option>
102
            [% ELSE %]
103
                <option value=" "># - position not used</option>
104
            [% END %]
105
            </select>
106
        </td>
107
    </tr>
108
    <tr>
109
        <td><label for="f4">Sensory Specification 1 </label></td>
110
        <td>
111
112
            <select name="f4" id="f4">
113
            [% IF ( f4 == "a" ) %]
114
                <option value="a" selected="selected">a - aural</option>
115
            [% ELSE %]
116
                <option value="a">a - aural</option>
117
            [% END %]
118
119
            [% IF ( f4 == "b" ) %]
120
                <option value="b" selected="selected">b - gustatory</option>
121
            [% ELSE %]
122
                <option value="b">b - gustatory</option>
123
            [% END %]
124
125
            [% IF ( f4 == "c" ) %]
126
                <option value="c" selected="selected">c - olfactory</option>
127
            [% ELSE %]
128
                <option value="c">c - olfactory</option>
129
            [% END %]
130
131
            [% IF ( f4 == "d" ) %]
132
                <option value="d" selected="selected">d - tactile</option>
133
            [% ELSE %]
134
                <option value="d">d - tactile</option>
135
            [% END %]
136
137
            [% IF ( f4 == "e" ) %]
138
                <option value="e" selected="selected">e - visual</option>
139
            [% ELSE %]
140
                <option value="e">e - visual</option>
141
            [% END %]
142
143
            [% IF ( f4 == "" ) %]
144
                <option value=" " selected="selected"># - position not used</option>
145
            [% ELSE %]
146
                <option value=" "># - position not used</option>
147
            [% END %]
148
            </select>
149
        </td>
150
    </tr>
151
    <tr>
152
        <td><label for="f5">Sensory Specification 2 </label></td>
153
        <td>
154
            <select name="f5" id="f5">
155
            [% IF ( f5 == "a" ) %]
156
                <option value="a" selected="selected">a - aural</option>
157
            [% ELSE %]
158
                <option value="a">a - aural</option>
159
            [% END %]
160
161
            [% IF ( f5 == "b" ) %]
162
                <option value="b" selected="selected">b - gustatory</option>
163
            [% ELSE %]
164
                <option value="b">b - gustatory</option>
165
            [% END %]
166
167
            [% IF ( f5 == "c" ) %]
168
                <option value="c" selected="selected">c - olfactory</option>
169
            [% ELSE %]
170
                <option value="c">c - olfactory</option>
171
            [% END %]
172
173
            [% IF ( f5 == "d" ) %]
174
                <option value="d" selected="selected">d - tactile</option>
175
            [% ELSE %]
176
                <option value="d">d - tactile</option>
177
            [% END %]
178
179
            [% IF ( f5 == "e" ) %]
180
                <option value="e" selected="selected">e - visual</option>
181
            [% ELSE %]
182
                <option value="e">e - visual</option>
183
            [% END %]
184
185
            [% IF ( f5 == "" ) %]
186
                <option value=" " selected="selected"># - position not used</option>
187
            [% ELSE %]
188
                <option value=" "># - position not used</option>
189
            [% END %]
190
            </select>
191
        </td>
192
    </tr>
193
    <tr>
194
        <td><label for="f6">Sensory Specification 3 </label></td>
195
        <td>
196
            <select name="f6" id="f6">
197
            [% IF ( f6 == "a" ) %]
198
                <option value="a" selected="selected">a - aural</option>
199
            [% ELSE %]
200
                <option value="a">a - aural</option>
201
            [% END %]
202
203
            [% IF ( f6 == "b" ) %]
204
                <option value="b" selected="selected">b - gustatory</option>
205
            [% ELSE %]
206
                <option value="b">b - gustatory</option>
207
            [% END %]
208
209
            [% IF ( f6 == "c" ) %]
210
                <option value="c" selected="selected">c - olfactory</option>
211
            [% ELSE %]
212
                <option value="c">c - olfactory</option>
213
            [% END %]
214
215
            [% IF ( f6 == "d" ) %]
216
                <option value="d" selected="selected">d - tactile</option>
217
            [% ELSE %]
218
                <option value="d">d - tactile</option>
219
            [% END %]
220
221
            [% IF ( f6 == "e" ) %]
222
                <option value="e" selected="selected">e - visual</option>
223
            [% ELSE %]
224
                <option value="e">e - visual</option>
225
            [% END %]
226
227
            [% IF ( f6 == "" ) %]
228
                <option value=" " selected="selected"># - position not used</option>
229
            [% ELSE %]
230
                <option value=" "># - position not used</option>
231
            [% END %]
232
            </select>
233
        </td>
234
    </tr>
235
236
</table>
237
<p><input type="button" value="OK"  onclick="submitMyForm();" /> <a href="#" class="cancel close">Cancel</a> </p>
238
</form>
239
240
<script>
241
    // The following function just puts back the value of the input #return
242
    // into the caller's field, referenced by index. And closes the popup.
243
    function submitMyForm() {
244
        var doc   = opener.document;
245
        var field = doc.getElementById("[% index | html %]");
246
        field.value = document.f_pop.f1.value+
247
                      document.f_pop.f2.value+
248
                      document.f_pop.f3.value+
249
                      document.f_pop.f4.value+
250
                      document.f_pop.f5.value+
251
                      document.f_pop.f6.value;
252
        window.close();
253
        return false;
254
    }
255
</script>
256
257
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_181c.tt (-1 / +195 lines)
Line 0 Link Here
0
- 
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Framework plugin example &rsaquo; Cataloguing &rsaquo; Koha</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
6
<body id="cat_unimarc_field_181c" class="cat" style="padding:1em;">
7
8
<h3>UNIMARC field 181c builder</h3>
9
10
<form name="f_pop" action="">
11
<table>
12
    <tr>
13
        <td><label for="f1">Content Type </label></td>
14
        <td>
15
            <select name="f1" id="f1">
16
17
            [% IF ( f1 == "cri" ) %]
18
                <option value=" " selected="selected">cri - cartographic image</option>
19
            [% ELSE %]
20
                <option value=" ">cri - cartographic image</option>
21
            [% END %]
22
23
            [% IF ( f1 == "crm" ) %]
24
                <option value="crm" selected="selected">crm - cartographic moving image</option>
25
            [% ELSE %]
26
                <option value="a">crm - cartographic moving image</option>
27
            [% END %]
28
29
            [% IF ( f1 == "crt" ) %]
30
                <option value="crt" selected="selected">crt - cartographic tactile image</option>
31
            [% ELSE %]
32
                <option value="crt">crt - cartographic tactile image</option>
33
            [% END %]
34
35
            [% IF ( f1 == "crn" ) %]
36
                <option value="crn" selected="selected">crn - cartographic tactile three-dimensional form</option>
37
            [% ELSE %]
38
                <option value="crn">crn - cartographic tactile three-dimensional form</option>
39
            [% END %]
40
41
            [% IF ( f1 == "cod" ) %]
42
                <option value="d" selected="selected">cod - computer dataset</option>
43
            [% ELSE %]
44
                <option value="cod">cod - computer dataset</option>
45
            [% END %]
46
47
            [% IF ( f1 == "crd" ) %]
48
                <option value="crd" selected="selected">crd - cartographic dataset</option>
49
            [% ELSE %]
50
                <option value="crd">crd - cartographic dataset</option>
51
            [% END %]
52
53
            [% IF ( f1 == "crf" ) %]
54
                <option value="crf" selected="selected">crf - cartographic three-dimensional form</option>
55
            [% ELSE %]
56
                <option value="crf">crf - cartographic three-dimensional form</option>
57
            [% END %]
58
59
            [% IF ( f1 == "tdi" ) %]
60
                <option value="tdi" selected="selected">tdi - two-dimensional moving image</option>
61
            [% ELSE %]
62
                <option value="tdi">tdi - two-dimensional moving image</option>
63
            [% END %]
64
65
            [% IF ( f1 == "tdm" ) %]
66
                <option value="tdm" selected="selected">tdm - three-dimensional moving image</option>
67
            [% ELSE %]
68
                <option value="tdm">tdm - three-dimensional moving image</option>
69
            [% END %]
70
71
            [% IF ( f1 == "sti" ) %]
72
                <option value="sti" selected="selected">sti - still image</option>
73
            [% ELSE %]
74
                <option value="sti">sti - still image</option>
75
            [% END %]
76
77
            [% IF ( f1 == "tci" ) %]
78
                <option value="tci" selected="selected">tci - tactile image</option>
79
            [% ELSE %]
80
                <option value="tci">tci - tactile image</option>
81
            [% END %]
82
83
            [% IF ( f1 == "prm" ) %]
84
                <option value="prm" selected="selected">prm - performed music</option>
85
            [% ELSE %]
86
                <option value="prm">prm - performed music</option>
87
            [% END %]
88
89
            [% IF ( f1 == "ntv" ) %]
90
                <option value="ntv" selected="selected">ntv - notated movement</option>
91
            [% ELSE %]
92
                <option value="ntv">ntv - notated movement</option>
93
            [% END %]
94
95
            [% IF ( f1 == "tcn" ) %]
96
                <option value="tcn" selected="selected">tcn - tactile notated movement</option>
97
            [% ELSE %]
98
                <option value="tcn">tcn - tactile notated movement</option>
99
            [% END %]
100
101
            [% IF ( f1 == "tdf" ) %]
102
                <option value="tdf" selected="selected">tdf - three-dimensional form</option>
103
            [% ELSE %]
104
                <option value="tdf">tdf - three-dimensional form</option>
105
            [% END %]
106
107
            [% IF ( f1 == "tcf" ) %]
108
                <option value="tcf" selected="selected">tcf - tactile three-dimensional form</option>
109
            [% ELSE %]
110
                <option value="tcf">tcf - tactile three-dimensional form</option>
111
            [% END %]
112
113
            [% IF ( f1 == "ntm" ) %]
114
                <option value="ntm" selected="selected">ntm - notated music</option>
115
            [% ELSE %]
116
                <option value="ntm">ntm - notated music</option>
117
            [% END %]
118
119
            [% IF ( f1 == "tcm" ) %]
120
                <option value="tcm" selected="selected">tcm - tactical notated music</option>
121
            [% ELSE %]
122
                <option value="tcm">tcm - tactical notated music</option>
123
            [% END %]
124
125
            [% IF ( f1 == "cop" ) %]
126
                <option value="cop" selected="selected">cop - computer program</option>
127
            [% ELSE %]
128
                <option value="cop">cop - computer program</option>
129
            [% END %]
130
131
            [% IF ( f1 == "snd" ) %]
132
                <option value="snd" selected="selected">snd - sounds</option>
133
            [% ELSE %]
134
                <option value="snd">snd - sounds</option>
135
            [% END %]
136
137
            [% IF ( f1 == "txt" ) %]
138
                <option value="txt" selected="selected">txt - text</option>
139
            [% ELSE %]
140
                <option value="txt">txt - text</option>
141
            [% END %]
142
143
            [% IF ( f1 == "tct" ) %]
144
                <option value="tct" selected="selected">tct - tactile text</option>
145
            [% ELSE %]
146
                <option value="tct">tct - tactile text</option>
147
            [% END %]
148
149
            [% IF ( f1 == "spw" ) %]
150
                <option value="spw" selected="selected">spw - spoken word</option>
151
            [% ELSE %]
152
                <option value="spw">spw - spoken word</option>
153
            [% END %]
154
155
            [% IF ( f1 == "xxx" ) %]
156
                <option value="xxx" selected="selected">xxx - other</option>
157
            [% ELSE %]
158
                <option value="xxx">xxx - other</option>
159
            [% END %]
160
161
            [% IF ( f1 == "zzz" ) %]
162
                <option value="zzz" selected="selected">zzz - unspecified</option>
163
            [% ELSE %]
164
                <option value="zzz">zzz - unspecified</option>
165
            [% END %]
166
            </select>
167
        </td>
168
    </tr>
169
170
</table>
171
<p><input type="button" value="OK"  onclick="submitMyForm();" /> <a href="#" class="cancel close">Cancel</a> </p>
172
</form>
173
174
<script>
175
176
    function submitMyForm() {
177
        var doc   = opener.document;
178
        var field = doc.getElementById("[% index | html %]");
179
        subfield();
180
181
        function subfield() {
182
            const tag = $(field).closest('.tag');
183
            const sub = tag.find('[id*="tag_181_subfield_2_"]');
184
            if ( field != 'undefined' ) {
185
                sub[0].value = "RDAcontent";
186
            }
187
            return subfield;
188
        }
189
        field.value = document.f_pop.f1.value;
190
        window.close();
191
        return false;
192
    }
193
</script>
194
195
[% INCLUDE 'popup-bottom.inc' %]

Return to bug 30504