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

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

Return to bug 14201