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

(-)a/cataloguing/value_builder/marc21_leader.pl (-6 / +3 lines)
Lines 20-31 Link Here
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
21
22
use Modern::Perl;
22
use Modern::Perl;
23
use CGI qw ( -utf8 );
23
24
24
use C4::Auth;
25
use C4::Auth;
25
use CGI qw ( -utf8 );
26
use C4::Context;
26
use C4::Context;
27
28
use C4::Search;
29
use C4::Output;
27
use C4::Output;
30
28
31
my $builder = sub {
29
my $builder = sub {
Lines 39-52 function Focus$function_name(event) { Link Here
39
    if(!document.getElementById(event.data.id).value){
37
    if(!document.getElementById(event.data.id).value){
40
        document.getElementById(event.data.id).value = '     nam a22     7a 4500';
38
        document.getElementById(event.data.id).value = '     nam a22     7a 4500';
41
    }
39
    }
42
    return 1;
43
}
40
}
44
41
45
function Click$function_name(event) {
42
function Click$function_name(event) {
46
    defaultvalue=document.getElementById(event.data.id).value;
43
    defaultvalue=document.getElementById(event.data.id).value;
47
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
44
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
48
49
}
45
}
46
50
//]]>
47
//]]>
51
</script>
48
</script>
52
";
49
";
Lines 94-97 my $launcher = sub { Link Here
94
    output_html_with_http_headers $input, $cookie, $template->output;
91
    output_html_with_http_headers $input, $cookie, $template->output;
95
};
92
};
96
93
97
return { builder => $builder, launcher => $launcher };
94
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/marc21_leader_book.pl (-91 lines)
Lines 1-91 Link Here
1
#!/usr/bin/perl
2
3
# Converted to new plugin style (Bug 13437)
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;
25
use CGI qw ( -utf8 );
26
use C4::Context;
27
28
use C4::Search;
29
use C4::Output;
30
31
my $builder = sub {
32
    my ( $params ) = @_;
33
    my $function_name = $params->{id};
34
    my $res           = "
35
<script type=\"text/javascript\">
36
//<![CDATA[
37
38
function Click$function_name(event) {
39
    defaultvalue=document.getElementById(event.data.id).value;
40
    newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
41
42
}
43
//]]>
44
</script>
45
";
46
47
    return $res;
48
};
49
50
my $launcher = sub {
51
    my ( $params ) = @_;
52
    my $input = $params->{cgi};
53
    my $index   = $input->param('index');
54
    my $result  = $input->param('result');
55
56
    my $dbh = C4::Context->dbh;
57
58
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
59
        {   template_name   => "cataloguing/value_builder/marc21_leader.tt",
60
            query           => $input,
61
            type            => "intranet",
62
            authnotrequired => 0,
63
            flagsrequired   => { editcatalogue => '*' },
64
            debug           => 1,
65
        }
66
    );
67
    $result = "     nam         7a      " unless $result;
68
    my $f5  = substr( $result, 5,  1 );
69
    my $f6  = substr( $result, 6,  1 );
70
    my $f7  = substr( $result, 7,  1 );
71
    my $f8  = substr( $result, 8,  1 );
72
    my $f9  = substr( $result, 9,  1 );
73
    my $f17 = substr( $result, 17, 1 );
74
    my $f18 = substr( $result, 18, 1 );
75
    my $f19 = substr( $result, 19, 1 );
76
77
    $template->param(
78
        index     => $index,
79
        "f5$f5"   => 1,
80
        "f6$f6"   => 1,
81
        "f7$f7"   => 1,
82
        "f8$f8"   => 1,
83
        "f9$f9"   => 1,
84
        "f17$f17" => 1,
85
        "f18$f18" => 1,
86
        "f19$f19" => 1,
87
    );
88
    output_html_with_http_headers $input, $cookie, $template->output;
89
};
90
91
return { builder => $builder, launcher => $launcher };
(-)a/installer/data/mysql/atomicupdate/14201_marc21_leader_book.sql (+2 lines)
Line 0 Link Here
1
-- move marc21_leader_book to marc21_leader
2
update marc_subfield_structure set value_builder='marc21_leader.pl' where value_builder='marc21_leader_book.pl';
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_book.tt (-339 lines)
Lines 1-338 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Koha &rsaquo; Cataloging &rsaquo; Leader builder</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
<body id="cat_marc21_leader_book" class="cat" style="padding:1em;">
6
<form name="f_pop" onsubmit="report()" action="">
7
<input type="hidden" name="plugin_name" value="marc21_leader_book.pl" />
8
<table>
9
	<tr>
10
		<td>1-4 Record size</td>
11
		<td>(auto-filled)</td>
12
	</tr>
13
	<tr>
14
		<td>5- Record status</td>
15
		<td>
16
			<select name="f5" id="f5" size="1">
17
			[% IF ( f5a ) %]
18
				<option value=" " selected="selected">a- Increase in encoding level</option>
19
			[% ELSE %]
20
				<option value=" ">a- Increase in encoding level</option>
21
			[% END %]
22
23
			[% IF ( f5c ) %]
24
				<option value="c" selected="selected">c- Corrected or revised</option>
25
			[% ELSE %]
26
				<option value="c">c- Corrected or revised</option>
27
			[% END %]
28
			[% IF ( f5d ) %]
29
				<option value="d" selected="selected">d- Deleted</option>
30
			[% ELSE %]
31
				<option value="d">d- Deleted</option>
32
			[% END %]
33
			[% IF ( f5n ) %]
34
				<option value="n" selected="selected">n- New</option>
35
			[% ELSE %]
36
				<option value="n">n- New</option>
37
			[% END %]
38
			[% IF ( f5p ) %]
39
				<option value="p" selected="selected">p- Increase in encoding level from prepublication</option>
40
			[% ELSE %]
41
				<option value="p">p- Increase in encoding level from prepublication</option>
42
			[% END %]
43
			</select>
44
		</td>
45
	</tr>
46
	<tr>
47
		<td>6- Type of record</td>
48
		<td>
49
			<select name="f6" id="f6" size="1">
50
			[% IF ( f6a ) %]
51
				<option value="a" selected="selected">a- Language material (monography)</option>
52
			[% ELSE %]
53
				<option value="a">a- Language material (monography)</option>
54
			[% END %]
55
			[% IF ( f6c ) %]
56
				<option value="c" selected="selected">c- Notated music</option>
57
			[% ELSE %]
58
				<option value="c">c- Notated music</option>
59
			[% END %]
60
			[% IF ( f6d ) %]
61
				<option value="d" selected="selected">d- Manuscript notated music</option>
62
			[% ELSE %]
63
				<option value="d">d- Manuscript notated music</option>
64
			[% END %]
65
			[% IF ( f6e ) %]
66
				<option value="e" selected="selected">e- Cartographic material</option>
67
			[% ELSE %]
68
				<option value="e">e- Cartographic material</option>
69
			[% END %]
70
			[% IF ( f6f ) %]
71
				<option value="f" selected="selected">f - Manuscript cartographic material</option>
72
			[% ELSE %]
73
				<option value="f">f - Manuscript cartographic material</option>
74
			[% END %]
75
			[% IF ( f6g ) %]
76
				<option value="g" selected="selected">g - Projected medium</option>
77
			[% ELSE %]
78
				<option value="g">g - Projected medium</option>
79
			[% END %]
80
			[% IF ( f6i ) %]
81
				<option value="i" selected="selected">i - Nonmusical sound recording</option>
82
			[% ELSE %]
83
				<option value="i">i - Nonmusical sound recording</option>
84
			[% END %]
85
			[% IF ( f6j ) %]
86
				<option value="j" selected="selected">j - Musical sound recording</option>
87
			[% ELSE %]
88
				<option value="j">j - Musical sound recording</option>
89
			[% END %]
90
			[% IF ( f6k ) %]
91
				<option value="k" selected="selected">k - Two-dimensional nonprojectable graphic</option>
92
			[% ELSE %]
93
				<option value="k">k - Two-dimensional nonprojectable graphic</option>
94
			[% END %]
95
			[% IF ( f6m ) %]
96
				<option value="m" selected="selected">m - Computer file</option>
97
			[% ELSE %]
98
				<option value="m">m - Computer file</option>
99
			[% END %]
100
			[% IF ( f6o ) %]
101
				<option value="o" selected="selected">o - Kit</option>
102
			[% ELSE %]
103
				<option value="o">o - Kit</option>
104
			[% END %]
105
			[% IF ( f6r ) %]
106
				<option value="r" selected="selected">r - Three-dimensional artifact or naturally occurring object</option>
107
			[% ELSE %]
108
				<option value="r">r - Three-dimensional artifact or naturally occurring object</option>
109
			[% END %]
110
			[% IF ( f6t ) %]
111
				<option value="t" selected="selected">t - Manuscript language material</option>
112
			[% ELSE %]
113
				<option value="t">t - Manuscript language material</option>
114
			[% END %]
115
			</select>
116
		</td>
117
	</tr>
118
	<tr>
119
		<td>7- Bibliographic level</td>
120
		<td>
121
			<select name="f7" id="f7" size="1">
122
				[% IF ( f7a ) %]
123
					<option value="a" selected="selected">a- Monographic component part</option>
124
				[% ELSE %]
125
					<option value="a">a- Monographic component part</option>
126
				[% END %]
127
				[% IF ( f7b ) %]
128
					<option value="b" selected="selected">b- Serial component part</option>
129
				[% ELSE %]
130
					<option value="b">a- Serial component part</option>
131
				[% END %]
132
				[% IF ( f7c ) %]
133
					<option value="c" selected="selected">c- Collection</option>
134
				[% ELSE %]
135
					<option value="c">c- Collection</option>
136
				[% END %]
137
				[% IF ( f7d ) %]
138
					<option value="d" selected="selected">d- Subunit</option>
139
				[% ELSE %]
140
					<option value="d">d- Subunit</option>
141
				[% END %]
142
				[% IF ( f7i ) %]
143
					<option value="i" selected="selected">i- Integrating resource</option>
144
				[% ELSE %]
145
					<option value="i">i- Integrating resource</option>
146
				[% END %]
147
				[% IF ( f7m ) %]
148
					<option value="m" selected="selected">m- Monograph/item</option>
149
				[% ELSE %]
150
					<option value="m">m- Monograph/item</option>
151
				[% END %]
152
				[% IF ( f7s ) %]
153
					<option value="s" selected="selected">s- Serial</option>
154
				[% ELSE %]
155
					<option value="s">s- Serial</option>
156
				[% END %]
157
			</select>
158
		</td>
159
	</tr>
160
	
161
	<tr>
162
		<td>8- Hierarchic level</td>
163
		<td>
164
			<select name="f8" id="f8" size="1">
165
				[% IF ( f8 ) %]
166
					<option value=" " selected="selected">No specific type</option>
167
				[% ELSE %]
168
					<option value=" ">No specific type</option>
169
				[% END %]
170
				[% IF ( f8a ) %]
171
					<option value="a" selected="selected">a- Archival</option>
172
				[% ELSE %]
173
					<option value="a">a- Archival</option>
174
				[% END %]
175
			</select>
176
		</td>
177
	</tr>
178
179
	<tr>
180
		<td>9- Encoding</td>
181
		<td>
182
			<select name="f9" id="f9" size="1">
183
				[% IF ( f9 ) %]
184
					<option value=" " selected="selected">MARC-8</option>
185
				[% ELSE %]
186
					<option value=" ">MARC-8</option>
187
				[% END %]
188
				[% IF ( f9a ) %]
189
					<option value="a" selected="selected">a- UCS/Unicode</option>
190
				[% ELSE %]
191
					<option value="a">a- UCS/Unicode</option>
192
				[% END %]
193
			</select>
194
		</td>
195
	</tr>
196
	<tr>
197
		<td>10-16 indicator/subfields/size</td>
198
		<td>(auto-filled)</td>
199
	<tr>
200
		<td>17- Encoding</td>
201
		<td>
202
			<select name="f17" id="f17" size="1">
203
				[% IF ( f17 ) %]
204
					<option value=" " selected="selected">full level</option>
205
				[% ELSE %]
206
					<option value=" ">Full level</option>
207
				[% END %]
208
				[% IF ( f171 ) %]
209
					<option value="1" selected="selected">1- Full level, material not examined</option>
210
				[% ELSE %]
211
					<option value="1">1- Full level, material not examined</option>
212
				[% END %]
213
				[% IF ( f172 ) %]
214
					<option value="2" selected="selected">2 - Less-than-full level, material not examined</option>
215
				[% ELSE %]
216
					<option value="2">2 - Less-than-full level, material not examined</option>
217
				[% END %]
218
				[% IF ( f173 ) %]
219
					<option value="3" selected="selected">3- Abbreviated level</option>
220
				[% ELSE %]
221
					<option value="3">3- Abbreviated level</option>
222
				[% END %]
223
				[% IF ( f174 ) %]
224
					<option value="4" selected="selected">4- Core level</option>
225
				[% ELSE %]
226
					<option value="4">4- Core level</option>
227
				[% END %]
228
				[% IF ( f175 ) %]
229
					<option value="5" selected="selected">5- Partial (preliminary) level</option>
230
				[% ELSE %]
231
					<option value="5">5- Partial (preliminary) level</option>
232
				[% END %]
233
				[% IF ( f177 ) %]
234
					<option value="7" selected="selected">7- Minimal level</option>
235
				[% ELSE %]
236
					<option value="7">7- Minimal level</option>
237
				[% END %]
238
				[% IF ( f178 ) %]
239
					<option value="8" selected="selected">8- Prepublication level</option>
240
				[% ELSE %]
241
					<option value="8">8- Prepublication level</option>
242
				[% END %]
243
				[% IF ( f17u ) %]
244
					<option value="u" selected="selected">u - Unknown</option>
245
				[% ELSE %]
246
					<option value="u">u - Unknown</option>
247
				[% END %]
248
				[% IF ( f17z ) %]
249
					<option value="z" selected="selected">z- Not applicable</option>
250
				[% ELSE %]
251
					<option value="z">z- Not applicableFull level</option>
252
				[% END %]
253
			</select>
254
		</td>
255
	</tr>
256
257
	<tr>
258
		<td>18 - Descriptive cataloging form</td>
259
		<td>
260
			<select name="f18" id="f18" size="1">
261
				[% IF ( f18 ) %]
262
					<option value=" " selected="selected">Non-ISBD</option>
263
				[% ELSE %]
264
					<option value=" ">Non-ISBD</option>
265
				[% END %]
266
				[% IF ( f18a ) %]
267
					<option value="a" selected="selected">a- AACR 2</option>
268
				[% ELSE %]
269
					<option value="a">a- AACR 2</option>
270
				[% END %]
271
				[% IF ( f18c ) %]
272
					<option value="c" selected="selected">c- ISBD punctuation omitted</option>
273
				[% ELSE %]
274
					<option value="c">c- ISBD punctuation omitted</option>
275
				[% END %]
276
				[% IF ( f18i ) %]
277
					<option value="i" selected="selected">i- ISBD punctuation included</option>
278
				[% ELSE %]
279
					<option value="i">i- ISBD punctuation included</option>
280
				[% END %]
281
				[% IF ( f18u ) %]
282
					<option value="u" selected="selected">u- Unknown</option>
283
				[% ELSE %]
284
					<option value="u">u- Unknown</option>
285
				[% END %]
286
			</select>
287
		</td>
288
	</tr>
289
	
290
	<tr>
291
		<td>19 - Linked record requirement</td>
292
		<td>
293
			<select name="f19" id="f19" size="1">
294
				[% IF ( f19 ) %]
295
					<option value=" " selected="selected">Related record not required</option>
296
				[% ELSE %]
297
					<option value=" ">Related record not required</option>
298
				[% END %]
299
				[% IF ( f18r ) %]
300
					<option value="r" selected="selected">r- Related record required</option>
301
				[% ELSE %]
302
					<option value="r">r- Related record required</option>
303
				[% END %]
304
			</select>
305
		</td>
306
	</tr>
307
	<tr>
308
		<td>20-24 entry map &amp; lengths</td>
309
		<td>(auto-filled)</td>
310
	<tr>
311
312
</table>
313
<fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
314
</form>
315
<script type="text/javascript">//<![CDATA[
316
function report() {
317
            var doc   = opener.document; 
318
            var field = doc.getElementById("[% index %]");
319
        
320
            field.value = 
321
			'     '+
322
            document.f_pop.f5.value+
323
			document.f_pop.f6.value+
324
            document.f_pop.f7.value+
325
			document.f_pop.f8.value+
326
            document.f_pop.f9.value+
327
            '22     '+
328
			document.f_pop.f17.value+
329
            document.f_pop.f18.value+
330
            document.f_pop.f19.value+
331
            '4500';
332
		self.close();
333
		return false;
334
	}
335
	//]]>
336
</script>
337
338
[% INCLUDE 'popup-bottom.inc' %]
339
- 

Return to bug 14201