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

(-)a/Koha/CodeList/Unimarc/MediumOfPerformance.pm (+473 lines)
Line 0 Link Here
1
package Koha::CodeList::Unimarc::MediumOfPerformance;
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
use utf8;
20
21
use Koha::I18N;
22
23
sub voices {
24
    return {
25
        'val' => N__('alto'),
26
        'vbr' => N__('baritone'),
27
        'vbs' => N__('bass'),
28
        'vca' => N__('child alto'),
29
        'vcs' => N__('child soprano'),
30
        'vct' => N__('countertenor'),
31
        'vcv' => N__('child voice'),
32
        'vma' => N__('man\'s voice'),
33
        'vms' => N__('mezzo-soprano'),
34
        'vrc' => N__('reciting child\'s voice'),
35
        'vre' => N__('reciting voice'),
36
        'vrm' => N__('reciting man\'s voice'),
37
        'vrw' => N__('reciting woman\'s voice'),
38
        'vso' => N__('soprano'),
39
        'vte' => N__('tenor'),
40
        'vun' => N__('voice - unspecified'),
41
        'vwo' => N__('woman\'s voice'),
42
        'vzz' => N__('voice - other'),
43
    };
44
}
45
46
sub woodwinds {
47
    return {
48
        'wba' => N__('bassoon'),
49
        'wbh' => N__('basset-horn'),
50
        'wbp' => N__('bagpipe'),
51
        'wcl' => N__('clarinet'),
52
        'wcr' => N__('cromorne'),
53
        'wdb' => N__('double bassoon'),
54
        'wdi' => N__('didjeridu'),
55
        'wdu' => N__('dulcian'),
56
        'wdv' => N__('dvojnice'),
57
        'weh' => N__('english horn'),
58
        'wfg' => N__('flageolet'),
59
        'wfi' => N__('fife'),
60
        'wfl' => N__('flute'),
61
        'wga' => N__('tabor pipe'),
62
        'wge' => N__('gemshorn'),
63
        'whp' => N__('hornpipe'),
64
        'wmo' => N__('mouth organ'),
65
        'wmu' => N__('musette'),
66
        'wna' => N__('ney'),
67
        'woa' => N__('oboe d\'amore'),
68
        'wob' => N__('oboe'),
69
        'woh' => N__('oboe da caccia'),
70
        'wpi' => N__('piccolo'),
71
        'wpo' => N__('pommer'),
72
        'wpp' => N__('panpipes'),
73
        'wra' => N__('racket'),
74
        'wre' => N__('recorder'),
75
        'wro' => N__('rothophone'),
76
        'wsa' => N__('saxophone'),
77
        'wsh' => N__('shakuhachi'),
78
        'wsn' => N__('zurna'),
79
        'wsr' => N__('sarrusophone'),
80
        'wsu' => N__('sordun'),
81
        'wun' => N__('woodwind - unspecified'),
82
        'wvu' => N__('vox humana'),
83
        'wzz' => N__('woodwind - other'),
84
    };
85
}
86
87
sub brass {
88
    return {
89
        'bah' => N__('alphorn'),
90
        'bbd' => N__('bombardon'),
91
        'bbh' => N__('bersag horn'),
92
        'bbu' => N__('bugle'),
93
        'bca' => N__('carnyx'),
94
        'bch' => N__('cow horn'),
95
        'bcl' => N__('clarion'),
96
        'bco' => N__('cornet'),
97
        'bct' => N__('cornett'),
98
        'bdx' => N__('duplex'),
99
        'beu' => N__('euphonium'),
100
        'bhh' => N__('hunting horn'),
101
        'bho' => N__('horn'),
102
        'bht' => N__('herald\'s trumpet'),
103
        'bkb' => N__('keyed bugle'),
104
        'bol' => N__('oliphant'),
105
        'bop' => N__('ophicleide'),
106
        'bph' => N__('post horn'),
107
        'brh' => N__('russian horn'),
108
        'bse' => N__('serpent'),
109
        'bsh' => N__('shofar'),
110
        'bsr' => N__('sarrusophone'),
111
        'btb' => N__('trombone'),
112
        'btr' => N__('trumpet'),
113
        'btu' => N__('tuba'),
114
        'bun' => N__('brass - unspecified'),
115
        'bvb' => N__('valved bugle'),
116
        'bwt' => N__('wagner tuba'),
117
        'bzz' => N__('brass - other'),
118
    };
119
}
120
121
sub strings_bowed {
122
    return {
123
        'sar' => N__('arpeggione'),
124
        'sba' => N__('baryton'),
125
        'sbt' => N__('bassett'),
126
        'sbu' => N__('bumbass'),
127
        'scr' => N__('crwth'),
128
        'sdb' => N__('double bass'),
129
        'sdf' => N__('five-string double bass'),
130
        'sfi' => N__('fiddle, viol (family)'),
131
        'sli' => N__('lira da braccio'),
132
        'sln' => N__('lirone'),
133
        'sny' => N__('keyed fiddle'),
134
        'sob' => N__('octobass'),
135
        'spo' => N__('kit'),
136
        'sps' => N__('psalmodicon'),
137
        'sre' => N__('rebec'),
138
        'stm' => N__('trumpet marine'),
139
        'sun' => N__('strings, bowed - unspecified'),
140
        'sva' => N__('viola'),
141
        'svc' => N__('cello'),
142
        'sve' => N__('violone'),
143
        'svg' => N__('viol'),
144
        'svl' => N__('violin'),
145
        'szz' => N__('strings, bowed - other'),
146
    };
147
}
148
149
sub strings_plucked {
150
    return {
151
        'tal' => N__('archlute'),
152
        'tat' => N__('harp-psaltery'),
153
        'tbb' => N__('barbitos'),
154
        'tbi' => N__('biwa'),
155
        'tbj' => N__('banjo'),
156
        'tbl' => N__('balalaika'),
157
        'tbo' => N__('bouzouki'),
158
        'tci' => N__('cittern'),
159
        'tct' => N__('citole'),
160
        'tcz' => N__('cobza'),
161
        'tgu' => N__('guitar'),
162
        'tha' => N__('harp'),
163
        'thg' => N__('hawaiian guitar'),
164
        'tih' => N__('Irish harp'),
165
        'tkh' => N__('kithara'),
166
        'tko' => N__('kora'),
167
        'tkt' => N__('koto'),
168
        'tlf' => N__('lute (family)'),
169
        'tlg' => N__('lyre-guitar'),
170
        'tlu' => N__('lute'),
171
        'tma' => N__('mandolin'),
172
        'tmd' => N__('mandore'),
173
        'tpi' => N__('pipa'),
174
        'tps' => N__('psaltery'),
175
        'tpx' => N__('phorminx'),
176
        'tqa' => N__('qānūn'),
177
        'tsh' => N__('shamisen'),
178
        'tsi' => N__('sitār'),
179
        'tth' => N__('theorbo'),
180
        'ttn' => N__('tanbur'),
181
        'tud' => N__('oud'),
182
        'tuk' => N__('ukulele'),
183
        'tun' => N__('strings, plucked - unspecified'),
184
        'tzi' => N__('zither'),
185
        'tzz' => N__('strings, plucked - other'),
186
    };
187
}
188
189
sub keyboard {
190
    return {
191
        'kac' => N__('accordion'),
192
        'kce' => N__('celesta'),
193
        'kcl' => N__('clavichord'),
194
        'kco' => N__('claviorgan'),
195
        'kcy' => N__('clavicytherium'),
196
        'kfp' => N__('fortepiano'),
197
        'kgl' => N__('glockenspiel'),
198
        'khm' => N__('harmonium'),
199
        'khp' => N__('harpsichord'),
200
        'kmp' => N__('melopiano'),
201
        'kor' => N__('organ'),
202
        'kpf' => N__('piano'),
203
        'kps' => N__('plucked string keyboard'),
204
        'kre' => N__('regals'),
205
        'ksi' => N__('sirenion'),
206
        'ksp' => N__('sostenente piano'),
207
        'kst' => N__('spinet'),
208
        'kun' => N__('keyboard - unspecified'),
209
        'kvg' => N__('virginal'),
210
        'kzz' => N__('keyboard - other'),
211
    };
212
}
213
214
sub percussion {
215
    return {
216
        'pab' => N__('aeolian bells'),
217
        'pad' => N__('arabian drum'),
218
        'pag' => N__('agogo'),
219
        'pan' => N__('anvil'),
220
        'pbb' => N__('boobams'),
221
        'pbd' => N__('bass drum'),
222
        'pbl' => N__('bells'),
223
        'pbo' => N__('bongos'),
224
        'pbp' => N__('metal bells plate'),
225
        'pca' => N__('castanets'),
226
        'pcb' => N__('cabaca'),
227
        'pcc' => N__('chinese cymbals'),
228
        'pcg' => N__('conga'),
229
        'pch' => N__('chains'),
230
        'pci' => N__('dulcimer'),
231
        'pcr' => N__('crash cymbal'),
232
        'pct' => N__('crotales'),
233
        'pcv' => N__('claves'),
234
        'pcw' => N__('cowbell'),
235
        'pcy' => N__('cymbal'),
236
        'pdr' => N__('drum'),
237
        'pds' => N__('drums'),
238
        'pfc' => N__('finger cymbals'),
239
        'pfd' => N__('friction drum'),
240
        'pfl' => N__('flexatone'),
241
        'pgn' => N__('gun'),
242
        'pgo' => N__('gong'),
243
        'pgu' => N__('güiro'),
244
        'pha' => N__('hammer'),
245
        'phb' => N__('handbell'),
246
        'phh' => N__('hi-hat'),
247
        'pje' => N__('jembe'),
248
        'pji' => N__('jingles'),
249
        'pli' => N__('lithophone'),
250
        'plj' => N__('lujon'),
251
        'pmb' => N__('marimba'),
252
        'pmd' => N__('military drum'),
253
        'pme' => N__('metallophone'),
254
        'pnv' => N__('nail violin'),
255
        'pra' => N__('ratchet'),
256
        'prs' => N__('rain stick'),
257
        'prt' => N__('roto-toms'),
258
        'psc' => N__('sizzle cymbals'),
259
        'pse' => N__('sound-effect instrument'),
260
        'psl' => N__('slit-drum'),
261
        'psm' => N__('sistrum'),
262
        'psn' => N__('siren'),
263
        'psp' => N__('sandpaper'),
264
        'pss' => N__('sound sculpture'),
265
        'pst' => N__('steel drum'),
266
        'psw' => N__('switch whip'),
267
        'ptb' => N__('tabor'),
268
        'ptc' => N__('turkish crescent'),
269
        'pte' => N__('temple block'),
270
        'ptg' => N__('tuned gong'),
271
        'pti' => N__('timpani'),
272
        'ptl' => N__('triangle'),
273
        'ptm' => N__('thunder machine'),
274
        'pto' => N__('tarol'),
275
        'ptr' => N__('tambourine'),
276
        'ptt' => N__('tom-tom'),
277
        'pun' => N__('percussion - unspecified'),
278
        'pvi' => N__('vibraphone'),
279
        'pvs' => N__('vibra-slap'),
280
        'pwh' => N__('whip'),
281
        'pwm' => N__('wind machine'),
282
        'pwo' => N__('woodblocks'),
283
        'pxr' => N__('xylorimba'),
284
        'pxy' => N__('xylophone'),
285
        'pzz' => N__('percussion - other'),
286
    };
287
}
288
289
sub electronic {
290
    return {
291
        'eco' => N__('computer'),
292
        'ecs' => N__('computerized musical station'),
293
        'ect' => N__('computerized tape'),
294
        'eds' => N__('digital space device'),
295
        'eea' => N__('electro-acoustic device'),
296
        'eli' => N__('live electronic'),
297
        'ely' => N__('lyricon'),
298
        'eme' => N__('meta-instrument'),
299
        'emu' => N__('multimedial device'),
300
        'eos' => N__('oscillator'),
301
        'esp' => N__('space device'),
302
        'esy' => N__('synthesizer'),
303
        'eta' => N__('tape'),
304
        'eth' => N__('theremin'),
305
        'eun' => N__('electronic - non specified'),
306
        'ezz' => N__('electronic - other'),
307
    };
308
}
309
310
sub misc {
311
    return {
312
        'mah' => N__('aeolian harp'),
313
        'mbo' => N__('barrel organ'),
314
        'mbr' => N__('bullroarer'),
315
        'mbs' => N__('bass'),
316
        'mbw' => N__('musical bow'),
317
        'mbx' => N__('musical box'),
318
        'mck' => N__('chekker'),
319
        'mcl' => N__('musical clock'),
320
        'mco' => N__('continuo'),
321
        'mgh' => N__('glassharmonika'),
322
        'mgt' => N__('glass trumpet'),
323
        'mha' => N__('harmonica'),
324
        'mhg' => N__('hurdy-gurdy'),
325
        'mjh' => N__('jew\'s harp'),
326
        'mla' => N__('lamellaphone'),
327
        'mmc' => N__('monochord'),
328
        'mme' => N__('melodica'),
329
        'mmi' => N__('mirliton'),
330
        'mml' => N__('melodic instrument'),
331
        'mms' => N__('musical saw'),
332
        'moc' => N__('ocarina'),
333
        'mpo' => N__('polyphonic instrument'),
334
        'mpp' => N__('player piano'),
335
        'mra' => N__('rabāb'),
336
        'mss' => N__('sound sculpture'),
337
        'msw' => N__('swanee whistle'),
338
        'mtf' => N__('tuning-fork'),
339
        'mui' => N__('instrument - non specified'),
340
        'mun' => N__('instrument or voice - non specified'),
341
        'mwd' => N__('wind instrument'),
342
        'mwh' => N__('whistle'),
343
        'mzz' => N__('other'),
344
    };
345
}
346
347
sub choruses {
348
    return {
349
        'cch' => N__('children\'s choir'),
350
        'cme' => N__('men\'s choir'),
351
        'cmi' => N__('mixed choir'),
352
        'cre' => N__('reciting choir'),
353
        'cun' => N__('choir - unspecified'),
354
        'cve' => N__('vocal ensemble'),
355
        'cwo' => N__('women\'s choir'),
356
        'czz' => N__('choir - other'),
357
    };
358
}
359
360
sub orchestras {
361
    return {
362
        'oba' => N__('band'),
363
        'obi' => N__('big band'),
364
        'obr' => N__('brass band'),
365
        'och' => N__('chamber orchestra'),
366
        'oco' => N__('combo'),
367
        'odo' => N__('dance orchestra'),
368
        'ofu' => N__('full orchestra'),
369
        'oga' => N__('gamelan'),
370
        'oie' => N__('instrumental ensemble'),
371
        'oiv' => N__('vocal and instrumental ensemble'),
372
        'oja' => N__('jazz band'),
373
        'ope' => N__('percussion orchestra'),
374
        'orb' => N__('ragtime band'),
375
        'osb' => N__('steel band'),
376
        'ost' => N__('string orchestra'),
377
        'oun' => N__('orchestra - unspecified'),
378
        'owi' => N__('wind orchestra'),
379
        'ozz' => N__('orchestra - other'),
380
    };
381
}
382
383
sub conductors {
384
    return {
385
        'qce' => N__('live electronic conductor'),
386
        'qch' => N__('choir conductor, chorus master'),
387
        'qco' => N__('conductor'),
388
        'qlc' => N__('light conductor'),
389
        'qzz' => N__('conductor - other'),
390
    };
391
}
392
393
sub other_performers {
394
    return {
395
        'zab' => N__('acrobat'),
396
        'zac' => N__('child actor'),
397
        'zas' => N__('silent actor'),
398
        'zat' => N__('actor'),
399
        'zaw' => N__('actress'),
400
        'zda' => N__('dancer'),
401
        'zel' => N__('light engineer'),
402
        'zes' => N__('sound engineer'),
403
        'zju' => N__('juggler'),
404
        'zmi' => N__('mime'),
405
        'zwp' => N__('walk-on part'),
406
        'zzz' => N__('performer - other'),
407
    };
408
}
409
410
sub tessitura {
411
    return {
412
        'a' => N__p('tessitura', 'sopranino'),
413
        'b' => N__p('tessitura', 'soprano'),
414
        'c' => N__p('tessitura', 'alto'),
415
        'd' => N__p('tessitura', 'tenor'),
416
        'e' => N__p('tessitura', 'baritone'),
417
        'f' => N__p('tessitura', 'bass'),
418
        'g' => N__p('tessitura', 'contrabass'),
419
        'h' => N__p('tessitura', 'sub-contrabass'),
420
        'i' => N__p('tessitura', 'sopracute'),
421
        'j' => N__p('tessitura', 'high'),
422
        'k' => N__p('tessitura', 'medium'),
423
        'l' => N__p('tessitura', 'low'),
424
        'm' => N__p('tessitura', 'prepared'),
425
    };
426
}
427
428
sub number_of_hands_or_keys {
429
    return {
430
        '1' => N__p('music', 'one hand'),
431
        '2' => N__p('music', 'two players on one instrument'),
432
        '3' => N__p('music', 'three hands'),
433
        '4' => N__p('music', 'four hands'),
434
        '6' => N__p('music', 'six hands'),
435
        '8' => N__p('music', 'eight hands'),
436
        'a' => N__p('music', 'A'),
437
        'b' => N__p('music', 'B flat'),
438
        'c' => N__p('music', 'C'),
439
        'd' => N__p('music', 'D'),
440
        'e' => N__p('music', 'E'),
441
        'f' => N__p('music', 'F'),
442
        'g' => N__p('music', 'G'),
443
        'h' => N__p('music', 'B'),
444
        'i' => N__p('music', 'E flat'),
445
        'j' => N__p('music', 'A flat'),
446
        'k' => N__p('music', 'D flat'),
447
        'l' => N__p('music', 'F sharp'),
448
        'n' => N__p('music', 'Instrument played in non standard way'),
449
        's' => N__p('music', 'non standard string number'),
450
    };
451
}
452
453
sub other {
454
    return {
455
        'r' => N__('electric'),
456
        's' => N__('electronic'),
457
        't' => N__('midi'),
458
        'v' => N__('amplified'),
459
        'w' => N__('recorded'),
460
        'q' => N__('antiquity'),
461
        'y' => N__('ethnic, traditional'),
462
    };
463
}
464
465
sub other2 {
466
    return {
467
        'b' => N__('ad libitum'),
468
        'c' => N__('may take place of the preceding code / alternative'),
469
        'd' => N__('used by the same player as the preceding code'),
470
    };
471
}
472
473
1;
(-)a/Koha/I18N.pm (-4 / +4 lines)
Lines 168-186 sub __npx { Link Here
168
}
168
}
169
169
170
sub N__ {
170
sub N__ {
171
    return @_;
171
    return $_[0];
172
}
172
}
173
173
174
sub N__n {
174
sub N__n {
175
    return @_;
175
    return $_[0];
176
}
176
}
177
177
178
sub N__p {
178
sub N__p {
179
    return @_;
179
    return $_[1];
180
}
180
}
181
181
182
sub N__np {
182
sub N__np {
183
    return @_;
183
    return $_[1];
184
}
184
}
185
185
186
sub _base_directory {
186
sub _base_directory {
(-)a/cataloguing/value_builder/unimarc_field_146b.pl (+126 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Scalar::Util;
21
22
use C4::Auth qw( get_template_and_user );
23
use C4::Output qw( output_html_with_http_headers );
24
25
use Koha::I18N;
26
use Koha::CodeList::Unimarc::MediumOfPerformance;
27
28
my $builder = sub {
29
    my $params = shift;
30
    my $id = $params->{id};
31
32
    return qq|
33
<script>
34
function Click$id (event) {
35
    event.preventDefault();
36
    const value = document.getElementById(event.data.id).value;
37
    const url = new URL('/cgi-bin/koha/cataloguing/plugin_launcher.pl', location);
38
    url.searchParams.set('plugin_name', 'unimarc_field_146b.pl');
39
    url.searchParams.set('id', event.data.id);
40
    url.searchParams.set('value', value);
41
    window.open(url.toString(), 'tag_editor', 'width=700,height=700,toolbar=false,scrollbars=yes');
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_146b.tt",
51
        query => $cgi,
52
        type => 'intranet',
53
        flagsrequired => { editcatalogue => '*' },
54
    });
55
56
    my @category_optgroups = (
57
        { label => __('Voices'), values => Koha::CodeList::Unimarc::MediumOfPerformance->voices() },
58
        { label => __('Woodwinds'), values => Koha::CodeList::Unimarc::MediumOfPerformance->woodwinds() },
59
        { label => __('Brass instruments'), values => Koha::CodeList::Unimarc::MediumOfPerformance->brass() },
60
        { label => __('Strings, bowed'), values => Koha::CodeList::Unimarc::MediumOfPerformance->strings_bowed() },
61
        { label => __('Strings, plucked'), values => Koha::CodeList::Unimarc::MediumOfPerformance->strings_plucked() },
62
        { label => __('Keyboard'), values => Koha::CodeList::Unimarc::MediumOfPerformance->keyboard() },
63
        { label => __('Percussion'), values => Koha::CodeList::Unimarc::MediumOfPerformance->percussion() },
64
        { label => __('Electric / electronic instruments and devices'), values => Koha::CodeList::Unimarc::MediumOfPerformance->electronic() },
65
        { label => __('Miscellaneous, other, unspecified instruments'), values => Koha::CodeList::Unimarc::MediumOfPerformance->misc() },
66
        { label => __('Other performers'), values => Koha::CodeList::Unimarc::MediumOfPerformance->other_performers() },
67
    );
68
69
    foreach my $optgroup (@category_optgroups) {
70
        my $values = delete $optgroup->{values};
71
        $optgroup->{options} = [
72
            map {
73
                { value => $_, label => __( $values->{$_} ) }
74
            } sort keys %$values
75
        ];
76
    }
77
78
    my $tessitura_hash = Koha::CodeList::Unimarc::MediumOfPerformance->tessitura();
79
    my @tessitura_options = map {
80
        { value => $_, label => __p('tessitura', $tessitura_hash->{$_}) }
81
    } sort keys %$tessitura_hash;
82
83
    my $number_of_hands_or_keys_hash = Koha::CodeList::Unimarc::MediumOfPerformance->number_of_hands_or_keys();
84
    my @number_of_hands_or_keys_options = map {
85
        { value => $_, label => __p('music', $number_of_hands_or_keys_hash->{$_}) }
86
    } sort keys %$number_of_hands_or_keys_hash;
87
88
    my $other_hash = Koha::CodeList::Unimarc::MediumOfPerformance->other();
89
    my @other_options = map {
90
        { value => $_, label => __($other_hash->{$_}) }
91
    } sort keys %$other_hash;
92
93
    my $other2_hash = Koha::CodeList::Unimarc::MediumOfPerformance->other2();
94
    my @other2_options = map {
95
        { value => $_, label => __($other2_hash->{$_}) }
96
    } sort keys %$other2_hash;
97
98
    my $value = $cgi->param('value');
99
    my $number = substr($value, 0, 2);
100
    unless (Scalar::Util::looks_like_number($number)) {
101
        $number = '';
102
    }
103
    my $category = substr($value, 2, 3);
104
    my $tessitura = substr($value, 5, 1);
105
    my $number_of_hands_or_keys = substr($value, 6, 1);
106
    my $other = substr($value, 7, 1);
107
    my $other2 = substr($value, 8, 1);
108
109
    $template->param(
110
        id => scalar $cgi->param('id'),
111
        number => $number,
112
        category => $category,
113
        tessitura => $tessitura,
114
        number_of_hands_or_keys => $number_of_hands_or_keys,
115
        other => $other,
116
        other2 => $other2,
117
        category_optgroups => \@category_optgroups,
118
        tessitura_options => \@tessitura_options,
119
        number_of_hands_or_keys_options => \@number_of_hands_or_keys_options,
120
        other_options => \@other_options,
121
        other2_options => \@other2_options,
122
    );
123
    output_html_with_http_headers $cgi, $cookie, $template->output;
124
};
125
126
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/unimarc_field_146c.pl (+127 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Scalar::Util;
21
22
use C4::Auth qw( get_template_and_user );
23
use C4::Output qw( output_html_with_http_headers );
24
25
use Koha::I18N;
26
use Koha::CodeList::Unimarc::MediumOfPerformance;
27
28
my $builder = sub {
29
    my $params = shift;
30
    my $id = $params->{id};
31
32
    return qq|
33
<script>
34
function Click$id (event) {
35
    event.preventDefault();
36
    const value = document.getElementById(event.data.id).value;
37
    const url = new URL('/cgi-bin/koha/cataloguing/plugin_launcher.pl', location);
38
    url.searchParams.set('plugin_name', 'unimarc_field_146c.pl');
39
    url.searchParams.set('id', event.data.id);
40
    url.searchParams.set('value', value);
41
    window.open(url.toString(), 'tag_editor', 'width=700,height=700,toolbar=false,scrollbars=yes');
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_146c.tt",
51
        query => $cgi,
52
        type => 'intranet',
53
        flagsrequired => { editcatalogue => '*' },
54
    });
55
56
    my @category_optgroups = (
57
        { label => __('Voices'), values => Koha::CodeList::Unimarc::MediumOfPerformance->voices() },
58
        { label => __('Woodwinds'), values => Koha::CodeList::Unimarc::MediumOfPerformance->woodwinds() },
59
        { label => __('Brass instruments'), values => Koha::CodeList::Unimarc::MediumOfPerformance->brass() },
60
        { label => __('Strings, bowed'), values => Koha::CodeList::Unimarc::MediumOfPerformance->strings_bowed() },
61
        { label => __('Strings, plucked'), values => Koha::CodeList::Unimarc::MediumOfPerformance->strings_plucked() },
62
        { label => __('Keyboard'), values => Koha::CodeList::Unimarc::MediumOfPerformance->keyboard() },
63
        { label => __('Percussion'), values => Koha::CodeList::Unimarc::MediumOfPerformance->percussion() },
64
        { label => __('Electric / electronic instruments and devices'), values => Koha::CodeList::Unimarc::MediumOfPerformance->electronic() },
65
        { label => __('Miscellaneous, other, unspecified instruments'), values => Koha::CodeList::Unimarc::MediumOfPerformance->misc() },
66
        { label => __('Conductors'), values => Koha::CodeList::Unimarc::MediumOfPerformance->conductors() },
67
        { label => __('Other performers'), values => Koha::CodeList::Unimarc::MediumOfPerformance->other_performers() },
68
    );
69
70
    foreach my $optgroup (@category_optgroups) {
71
        my $values = delete $optgroup->{values};
72
        $optgroup->{options} = [
73
            map {
74
                { value => $_, label => __( $values->{$_} ) }
75
            } sort keys %$values
76
        ];
77
    }
78
79
    my $tessitura_hash = Koha::CodeList::Unimarc::MediumOfPerformance->tessitura();
80
    my @tessitura_options = map {
81
        { value => $_, label => __p('tessitura', $tessitura_hash->{$_}) }
82
    } sort keys %$tessitura_hash;
83
84
    my $number_of_hands_or_keys_hash = Koha::CodeList::Unimarc::MediumOfPerformance->number_of_hands_or_keys();
85
    my @number_of_hands_or_keys_options = map {
86
        { value => $_, label => __p('music', $number_of_hands_or_keys_hash->{$_}) }
87
    } sort keys %$number_of_hands_or_keys_hash;
88
89
    my $other_hash = Koha::CodeList::Unimarc::MediumOfPerformance->other();
90
    my @other_options = map {
91
        { value => $_, label => __($other_hash->{$_}) }
92
    } sort keys %$other_hash;
93
94
    my $other2_hash = Koha::CodeList::Unimarc::MediumOfPerformance->other2();
95
    my @other2_options = map {
96
        { value => $_, label => __($other2_hash->{$_}) }
97
    } sort keys %$other2_hash;
98
99
    my $value = $cgi->param('value');
100
    my $number = substr($value, 0, 2);
101
    unless (Scalar::Util::looks_like_number($number)) {
102
        $number = '';
103
    }
104
    my $category = substr($value, 2, 3);
105
    my $tessitura = substr($value, 5, 1);
106
    my $number_of_hands_or_keys = substr($value, 6, 1);
107
    my $other = substr($value, 7, 1);
108
    my $other2 = substr($value, 8, 1);
109
110
    $template->param(
111
        id => scalar $cgi->param('id'),
112
        number => $number,
113
        category => $category,
114
        tessitura => $tessitura,
115
        number_of_hands_or_keys => $number_of_hands_or_keys,
116
        other => $other,
117
        other2 => $other2,
118
        category_optgroups => \@category_optgroups,
119
        tessitura_options => \@tessitura_options,
120
        number_of_hands_or_keys_options => \@number_of_hands_or_keys_options,
121
        other_options => \@other_options,
122
        other2_options => \@other2_options,
123
    );
124
    output_html_with_http_headers $cgi, $cookie, $template->output;
125
};
126
127
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/unimarc_field_146d.pl (+107 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Scalar::Util;
21
22
use C4::Auth qw( get_template_and_user );
23
use C4::Output qw( output_html_with_http_headers );
24
25
use Koha::I18N;
26
use Koha::CodeList::Unimarc::MediumOfPerformance;
27
28
my $builder = sub {
29
    my $params = shift;
30
    my $id = $params->{id};
31
32
    return qq|
33
<script>
34
function Click$id (event) {
35
    event.preventDefault();
36
    const value = document.getElementById(event.data.id).value;
37
    const url = new URL('/cgi-bin/koha/cataloguing/plugin_launcher.pl', location);
38
    url.searchParams.set('plugin_name', 'unimarc_field_146d.pl');
39
    url.searchParams.set('id', event.data.id);
40
    url.searchParams.set('value', value);
41
    window.open(url.toString(), 'tag_editor', 'width=700,height=700,toolbar=false,scrollbars=yes');
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_146d.tt",
51
        query => $cgi,
52
        type => 'intranet',
53
        flagsrequired => { editcatalogue => '*' },
54
    });
55
56
    my @category_optgroups = (
57
        { label => __('Choruses'), values => Koha::CodeList::Unimarc::MediumOfPerformance->choruses() },
58
        { label => __('Orchestras, ensembles'), values => Koha::CodeList::Unimarc::MediumOfPerformance->orchestras() },
59
    );
60
61
    foreach my $optgroup (@category_optgroups) {
62
        my $values = delete $optgroup->{values};
63
        $optgroup->{options} = [
64
            map {
65
                { value => $_, label => __( $values->{$_} ) }
66
            } sort keys %$values
67
        ];
68
    }
69
70
    my $other_hash = Koha::CodeList::Unimarc::MediumOfPerformance->other();
71
    my @other_options = map {
72
        { value => $_, label => __($other_hash->{$_}) }
73
    } sort keys %$other_hash;
74
75
    my $other2_hash = Koha::CodeList::Unimarc::MediumOfPerformance->other2();
76
    my @other2_options = map {
77
        { value => $_, label => __($other2_hash->{$_}) }
78
    } sort keys %$other2_hash;
79
80
    my $value = $cgi->param('value');
81
    my $number = substr($value, 0, 2);
82
    unless (Scalar::Util::looks_like_number($number)) {
83
        $number = '';
84
    }
85
    my $category = substr($value, 2, 3);
86
    my $number_of_real_parts = substr($value, 5, 2);
87
    unless (Scalar::Util::looks_like_number($number_of_real_parts)) {
88
        $number_of_real_parts = '';
89
    }
90
    my $other = substr($value, 7, 1);
91
    my $other2 = substr($value, 8, 1);
92
93
    $template->param(
94
        id => scalar $cgi->param('id'),
95
        number => $number,
96
        category => $category,
97
        number_of_real_parts => $number_of_real_parts,
98
        other => $other,
99
        other2 => $other2,
100
        category_optgroups => \@category_optgroups,
101
        other_options => \@other_options,
102
        other2_options => \@other2_options,
103
    );
104
    output_html_with_http_headers $cgi, $cookie, $template->output;
105
};
106
107
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/unimarc_field_146e.pl (+127 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Scalar::Util;
21
22
use C4::Auth qw( get_template_and_user );
23
use C4::Output qw( output_html_with_http_headers );
24
25
use Koha::I18N;
26
use Koha::CodeList::Unimarc::MediumOfPerformance;
27
28
my $builder = sub {
29
    my $params = shift;
30
    my $id = $params->{id};
31
32
    return qq|
33
<script>
34
function Click$id (event) {
35
    event.preventDefault();
36
    const value = document.getElementById(event.data.id).value;
37
    const url = new URL('/cgi-bin/koha/cataloguing/plugin_launcher.pl', location);
38
    url.searchParams.set('plugin_name', 'unimarc_field_146e.pl');
39
    url.searchParams.set('id', event.data.id);
40
    url.searchParams.set('value', value);
41
    window.open(url.toString(), 'tag_editor', 'width=700,height=700,toolbar=false,scrollbars=yes');
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_146e.tt",
51
        query => $cgi,
52
        type => 'intranet',
53
        flagsrequired => { editcatalogue => '*' },
54
    });
55
56
    my @category_optgroups = (
57
        { label => __('Voices'), values => Koha::CodeList::Unimarc::MediumOfPerformance->voices() },
58
        { label => __('Woodwinds'), values => Koha::CodeList::Unimarc::MediumOfPerformance->woodwinds() },
59
        { label => __('Brass instruments'), values => Koha::CodeList::Unimarc::MediumOfPerformance->brass() },
60
        { label => __('Strings, bowed'), values => Koha::CodeList::Unimarc::MediumOfPerformance->strings_bowed() },
61
        { label => __('Strings, plucked'), values => Koha::CodeList::Unimarc::MediumOfPerformance->strings_plucked() },
62
        { label => __('Keyboard'), values => Koha::CodeList::Unimarc::MediumOfPerformance->keyboard() },
63
        { label => __('Percussion'), values => Koha::CodeList::Unimarc::MediumOfPerformance->percussion() },
64
        { label => __('Electric / electronic instruments and devices'), values => Koha::CodeList::Unimarc::MediumOfPerformance->electronic() },
65
        { label => __('Miscellaneous, other, unspecified instruments'), values => Koha::CodeList::Unimarc::MediumOfPerformance->misc() },
66
        { label => __('Conductors'), values => Koha::CodeList::Unimarc::MediumOfPerformance->conductors() },
67
        { label => __('Other performers'), values => Koha::CodeList::Unimarc::MediumOfPerformance->other_performers() },
68
    );
69
70
    foreach my $optgroup (@category_optgroups) {
71
        my $values = delete $optgroup->{values};
72
        $optgroup->{options} = [
73
            map {
74
                { value => $_, label => __( $values->{$_} ) }
75
            } sort keys %$values
76
        ];
77
    }
78
79
    my $tessitura_hash = Koha::CodeList::Unimarc::MediumOfPerformance->tessitura();
80
    my @tessitura_options = map {
81
        { value => $_, label => __p('tessitura', $tessitura_hash->{$_}) }
82
    } sort keys %$tessitura_hash;
83
84
    my $number_of_hands_or_keys_hash = Koha::CodeList::Unimarc::MediumOfPerformance->number_of_hands_or_keys();
85
    my @number_of_hands_or_keys_options = map {
86
        { value => $_, label => __p('music', $number_of_hands_or_keys_hash->{$_}) }
87
    } sort keys %$number_of_hands_or_keys_hash;
88
89
    my $other_hash = Koha::CodeList::Unimarc::MediumOfPerformance->other();
90
    my @other_options = map {
91
        { value => $_, label => __($other_hash->{$_}) }
92
    } sort keys %$other_hash;
93
94
    my $other2_hash = Koha::CodeList::Unimarc::MediumOfPerformance->other2();
95
    my @other2_options = map {
96
        { value => $_, label => __($other2_hash->{$_}) }
97
    } sort keys %$other2_hash;
98
99
    my $value = $cgi->param('value');
100
    my $number = substr($value, 0, 2);
101
    unless (Scalar::Util::looks_like_number($number)) {
102
        $number = '';
103
    }
104
    my $category = substr($value, 2, 3);
105
    my $tessitura = substr($value, 5, 1);
106
    my $number_of_hands_or_keys = substr($value, 6, 1);
107
    my $other = substr($value, 7, 1);
108
    my $other2 = substr($value, 8, 1);
109
110
    $template->param(
111
        id => scalar $cgi->param('id'),
112
        number => $number,
113
        category => $category,
114
        tessitura => $tessitura,
115
        number_of_hands_or_keys => $number_of_hands_or_keys,
116
        other => $other,
117
        other2 => $other2,
118
        category_optgroups => \@category_optgroups,
119
        tessitura_options => \@tessitura_options,
120
        number_of_hands_or_keys_options => \@number_of_hands_or_keys_options,
121
        other_options => \@other_options,
122
        other2_options => \@other2_options,
123
    );
124
    output_html_with_http_headers $cgi, $cookie, $template->output;
125
};
126
127
return { builder => $builder, launcher => $launcher };
(-)a/cataloguing/value_builder/unimarc_field_146f.pl (+124 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use Scalar::Util;
21
22
use C4::Auth qw( get_template_and_user );
23
use C4::Output qw( output_html_with_http_headers );
24
25
use Koha::I18N;
26
use Koha::CodeList::Unimarc::MediumOfPerformance;
27
28
my $builder = sub {
29
    my $params = shift;
30
    my $id = $params->{id};
31
32
    return qq|
33
<script>
34
function Click$id (event) {
35
    event.preventDefault();
36
    const value = document.getElementById(event.data.id).value;
37
    const url = new URL('/cgi-bin/koha/cataloguing/plugin_launcher.pl', location);
38
    url.searchParams.set('plugin_name', 'unimarc_field_146f.pl');
39
    url.searchParams.set('id', event.data.id);
40
    url.searchParams.set('value', value);
41
    window.open(url.toString(), 'tag_editor', 'width=700,height=700,toolbar=false,scrollbars=yes');
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_146f.tt",
51
        query => $cgi,
52
        type => 'intranet',
53
        flagsrequired => { editcatalogue => '*' },
54
    });
55
56
    my @category_optgroups = (
57
        { label => __('Woodwinds'), values => Koha::CodeList::Unimarc::MediumOfPerformance->woodwinds() },
58
        { label => __('Brass instruments'), values => Koha::CodeList::Unimarc::MediumOfPerformance->brass() },
59
        { label => __('Strings, bowed'), values => Koha::CodeList::Unimarc::MediumOfPerformance->strings_bowed() },
60
        { label => __('Strings, plucked'), values => Koha::CodeList::Unimarc::MediumOfPerformance->strings_plucked() },
61
        { label => __('Keyboard'), values => Koha::CodeList::Unimarc::MediumOfPerformance->keyboard() },
62
        { label => __('Percussion'), values => Koha::CodeList::Unimarc::MediumOfPerformance->percussion() },
63
        { label => __('Electric / electronic instruments and devices'), values => Koha::CodeList::Unimarc::MediumOfPerformance->electronic() },
64
        { label => __('Miscellaneous, other, unspecified instruments'), values => Koha::CodeList::Unimarc::MediumOfPerformance->misc() },
65
    );
66
67
    foreach my $optgroup (@category_optgroups) {
68
        my $values = delete $optgroup->{values};
69
        $optgroup->{options} = [
70
            map {
71
                { value => $_, label => __( $values->{$_} ) }
72
            } sort keys %$values
73
        ];
74
    }
75
76
    my $tessitura_hash = Koha::CodeList::Unimarc::MediumOfPerformance->tessitura();
77
    my @tessitura_options = map {
78
        { value => $_, label => __p('tessitura', $tessitura_hash->{$_}) }
79
    } sort keys %$tessitura_hash;
80
81
    my $number_of_hands_or_keys_hash = Koha::CodeList::Unimarc::MediumOfPerformance->number_of_hands_or_keys();
82
    my @number_of_hands_or_keys_options = map {
83
        { value => $_, label => __p('music', $number_of_hands_or_keys_hash->{$_}) }
84
    } sort keys %$number_of_hands_or_keys_hash;
85
86
    my $other_hash = Koha::CodeList::Unimarc::MediumOfPerformance->other();
87
    my @other_options = map {
88
        { value => $_, label => __($other_hash->{$_}) }
89
    } sort keys %$other_hash;
90
91
    my $other2_hash = Koha::CodeList::Unimarc::MediumOfPerformance->other2();
92
    my @other2_options = map {
93
        { value => $_, label => __($other2_hash->{$_}) }
94
    } sort keys %$other2_hash;
95
96
    my $value = $cgi->param('value');
97
    my $number = substr($value, 0, 2);
98
    unless (Scalar::Util::looks_like_number($number)) {
99
        $number = '';
100
    }
101
    my $category = substr($value, 2, 3);
102
    my $tessitura = substr($value, 5, 1);
103
    my $number_of_hands_or_keys = substr($value, 6, 1);
104
    my $other = substr($value, 7, 1);
105
    my $other2 = substr($value, 8, 1);
106
107
    $template->param(
108
        id => scalar $cgi->param('id'),
109
        number => $number,
110
        category => $category,
111
        tessitura => $tessitura,
112
        number_of_hands_or_keys => $number_of_hands_or_keys,
113
        other => $other,
114
        other2 => $other2,
115
        category_optgroups => \@category_optgroups,
116
        tessitura_options => \@tessitura_options,
117
        number_of_hands_or_keys_options => \@number_of_hands_or_keys_options,
118
        other_options => \@other_options,
119
        other2_options => \@other2_options,
120
    );
121
    output_html_with_http_headers $cgi, $cookie, $template->output;
122
};
123
124
return { builder => $builder, launcher => $launcher };
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_146b.tt (+141 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Framework plugin unimarc_field_146b &rsaquo; Cataloguing &rsaquo; Koha</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
6
<body id="unimarc_field_146b" class="cat">
7
    <div class="container-fluid">
8
        <h1>Framework plugin for UNIMARC 146$b</h1>
9
10
        <form class="form-horizontal" id="form">
11
            <input type="hidden" id="id" name="id" value="[% id | html %]">
12
13
            <div class="form-group">
14
                <label for="number" class="col-sm-3 control-label">Number of instruments or voices</label>
15
                <div class="col-sm-9">
16
                    <input inputmode="numeric" pattern="^[0-9]{0,2}$" title="a number between 0 and 99 (inclusive)" id="number" name="number" value="[% number | html %]">
17
                    <p class="help-block">A number between 0 and 99 (inclusive)</p>
18
                </div>
19
            </div>
20
            <div class="form-group">
21
                <label for="category" class="col-sm-3 control-label">Category of instrument or voice</label>
22
                <div class="col-sm-9">
23
                    <select class="form-control" id="category">
24
                        <option value=""></option>
25
                        [% FOREACH optgroup IN category_optgroups %]
26
                            <optgroup label="[% optgroup.label | html %]">
27
                                [% FOREACH option IN optgroup.options %]
28
                                    [% IF option.value == category %]
29
                                        <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %] ([% optgroup.label | html %])</option>
30
                                    [% ELSE %]
31
                                        <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %] ([% optgroup.label | html %])</option>
32
                                    [% END %]
33
                                [% END %]
34
                            </optgroup>
35
                        [% END %]
36
                    </select>
37
                </div>
38
            </div>
39
40
            <div class="form-group">
41
                <label for="tessitura" class="col-sm-3 control-label">Tessitura</label>
42
                <div class="col-sm-9">
43
                    <select class="form-control" id="tessitura">
44
                        <option value=""></option>
45
                        [% FOREACH option IN tessitura_options %]
46
                            [% IF option.value == tessitura %]
47
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
48
                            [% ELSE %]
49
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
50
                            [% END %]
51
                        [% END %]
52
                    </select>
53
                </div>
54
            </div>
55
56
            <div class="form-group">
57
                <label for="number_of_hands_or_keys" class="col-sm-3 control-label">Number of hands / players; keys of pitched instruments</label>
58
                <div class="col-sm-9">
59
                    <select class="form-control" id="number_of_hands_or_keys">
60
                        <option value=""></option>
61
                        [% FOREACH option IN number_of_hands_or_keys_options %]
62
                            [% IF option.value == number_of_hands_or_keys %]
63
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
64
                            [% ELSE %]
65
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
66
                            [% END %]
67
                        [% END %]
68
                    </select>
69
                </div>
70
            </div>
71
72
            <div class="form-group">
73
                <label for="other" class="col-sm-3 control-label">Other (position 7)</label>
74
                <div class="col-sm-9">
75
                    <select class="form-control" id="other">
76
                        <option value=""></option>
77
                        [% FOREACH option IN other_options %]
78
                            [% IF option.value == other %]
79
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
80
                            [% ELSE %]
81
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
82
                            [% END %]
83
                        [% END %]
84
                    </select>
85
                </div>
86
            </div>
87
            <div class="form-group">
88
                <label for="other2" class="col-sm-3 control-label">Other (position 8)</label>
89
                <div class="col-sm-9">
90
                    <select class="form-control" id="other2">
91
                        <option value=""></option>
92
                        [% FOREACH option IN other2_options %]
93
                            [% IF option.value == other2 %]
94
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
95
                            [% ELSE %]
96
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
97
                            [% END %]
98
                        [% END %]
99
                    </select>
100
                </div>
101
            </div>
102
103
            <div class="form-group">
104
                <div class="col-sm-offset-3 col-sm-9">
105
                    <button type="submit">OK</button>
106
                    <a href="#" class="cancel close">Cancel</a>
107
                </div>
108
            </div>
109
        </form>
110
    </div>
111
112
    [% INCLUDE 'select2.inc' %]
113
    <script>
114
        $(document).ready(function () {
115
            $('#category').select2();
116
        });
117
    </script>
118
119
    <script>
120
        document.getElementById('form').addEventListener('submit', function (ev) {
121
            ev.preventDefault();
122
            const id = document.getElementById('id').value;
123
            const number = document.getElementById('number').value;
124
            const category = document.getElementById('category').value;
125
            const tessitura = document.getElementById('tessitura').value;
126
            const number_of_hands_or_keys = document.getElementById('number_of_hands_or_keys').value;
127
            const other = document.getElementById('other').value;
128
            const other2 = document.getElementById('other2').value;
129
            const value =
130
                (number ? number.toString().padStart(2, '0') : 'uu') +
131
                category.padStart(3, ' ') +
132
                tessitura.padStart(1, ' ') +
133
                number_of_hands_or_keys.padStart(1, ' ') +
134
                other.padStart(1, ' ') +
135
                other2.padStart(1, ' ');
136
            opener.document.getElementById(id).value = value;
137
            window.close();
138
        });
139
    </script>
140
141
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_146c.tt (+141 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Framework plugin unimarc_field_146c &rsaquo; Cataloguing &rsaquo; Koha</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
6
<body id="unimarc_field_146c" class="cat">
7
    <div class="container-fluid">
8
        <h1>Framework plugin for UNIMARC 146$c</h1>
9
10
        <form class="form-horizontal" id="form">
11
            <input type="hidden" id="id" name="id" value="[% id | html %]">
12
13
            <div class="form-group">
14
                <label for="number" class="col-sm-3 control-label">Number of instruments or voices</label>
15
                <div class="col-sm-9">
16
                    <input inputmode="numeric" pattern="^[0-9]{0,2}$" title="a number between 0 and 99 (inclusive)" id="number" name="number" value="[% number | html %]">
17
                    <p class="help-block">A number between 0 and 99 (inclusive)</p>
18
                </div>
19
            </div>
20
            <div class="form-group">
21
                <label for="category" class="col-sm-3 control-label">Category of instrument or voice</label>
22
                <div class="col-sm-9">
23
                    <select class="form-control" id="category">
24
                        <option value=""></option>
25
                        [% FOREACH optgroup IN category_optgroups %]
26
                            <optgroup label="[% optgroup.label | html %]">
27
                                [% FOREACH option IN optgroup.options %]
28
                                    [% IF option.value == category %]
29
                                        <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %] ([% optgroup.label | html %])</option>
30
                                    [% ELSE %]
31
                                        <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %] ([% optgroup.label | html %])</option>
32
                                    [% END %]
33
                                [% END %]
34
                            </optgroup>
35
                        [% END %]
36
                    </select>
37
                </div>
38
            </div>
39
40
            <div class="form-group">
41
                <label for="tessitura" class="col-sm-3 control-label">Tessitura</label>
42
                <div class="col-sm-9">
43
                    <select class="form-control" id="tessitura">
44
                        <option value=""></option>
45
                        [% FOREACH option IN tessitura_options %]
46
                            [% IF option.value == tessitura %]
47
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
48
                            [% ELSE %]
49
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
50
                            [% END %]
51
                        [% END %]
52
                    </select>
53
                </div>
54
            </div>
55
56
            <div class="form-group">
57
                <label for="number_of_hands_or_keys" class="col-sm-3 control-label">Number of hands / players; keys of pitched instruments</label>
58
                <div class="col-sm-9">
59
                    <select class="form-control" id="number_of_hands_or_keys">
60
                        <option value=""></option>
61
                        [% FOREACH option IN number_of_hands_or_keys_options %]
62
                            [% IF option.value == number_of_hands_or_keys %]
63
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
64
                            [% ELSE %]
65
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
66
                            [% END %]
67
                        [% END %]
68
                    </select>
69
                </div>
70
            </div>
71
72
            <div class="form-group">
73
                <label for="other" class="col-sm-3 control-label">Other (position 7)</label>
74
                <div class="col-sm-9">
75
                    <select class="form-control" id="other">
76
                        <option value=""></option>
77
                        [% FOREACH option IN other_options %]
78
                            [% IF option.value == other %]
79
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
80
                            [% ELSE %]
81
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
82
                            [% END %]
83
                        [% END %]
84
                    </select>
85
                </div>
86
            </div>
87
            <div class="form-group">
88
                <label for="other2" class="col-sm-3 control-label">Other (position 8)</label>
89
                <div class="col-sm-9">
90
                    <select class="form-control" id="other2">
91
                        <option value=""></option>
92
                        [% FOREACH option IN other2_options %]
93
                            [% IF option.value == other2 %]
94
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
95
                            [% ELSE %]
96
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
97
                            [% END %]
98
                        [% END %]
99
                    </select>
100
                </div>
101
            </div>
102
103
            <div class="form-group">
104
                <div class="col-sm-offset-3 col-sm-9">
105
                    <button type="submit">OK</button>
106
                    <a href="#" class="cancel close">Cancel</a>
107
                </div>
108
            </div>
109
        </form>
110
    </div>
111
112
    [% INCLUDE 'select2.inc' %]
113
    <script>
114
        $(document).ready(function () {
115
            $('#category').select2();
116
        });
117
    </script>
118
119
    <script>
120
        document.getElementById('form').addEventListener('submit', function (ev) {
121
            ev.preventDefault();
122
            const id = document.getElementById('id').value;
123
            const number = document.getElementById('number').value;
124
            const category = document.getElementById('category').value;
125
            const tessitura = document.getElementById('tessitura').value;
126
            const number_of_hands_or_keys = document.getElementById('number_of_hands_or_keys').value;
127
            const other = document.getElementById('other').value;
128
            const other2 = document.getElementById('other2').value;
129
            const value =
130
                (number ? number.toString().padStart(2, '0') : 'uu') +
131
                category.padStart(3, ' ') +
132
                tessitura.padStart(1, ' ') +
133
                number_of_hands_or_keys.padStart(1, ' ') +
134
                other.padStart(1, ' ') +
135
                other2.padStart(1, ' ');
136
            opener.document.getElementById(id).value = value;
137
            window.close();
138
        });
139
    </script>
140
141
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_146d.tt (+116 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Framework plugin unimarc_field_146d &rsaquo; Cataloguing &rsaquo; Koha</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
6
<body id="unimarc_field_146d" class="cat">
7
    <div class="container-fluid">
8
        <h1>Framework plugin for UNIMARC 146$d</h1>
9
10
        <form class="form-horizontal" id="form">
11
            <input type="hidden" id="id" name="id" value="[% id | html %]">
12
13
            <div class="form-group">
14
                <label for="number" class="col-sm-3 control-label">Number of ensembles</label>
15
                <div class="col-sm-9">
16
                    <input inputmode="numeric" pattern="^[0-9]{0,2}$" title="a number between 0 and 99 (inclusive)" id="number" name="number" value="[% number | html %]">
17
                    <p class="help-block">A number between 0 and 99 (inclusive)</p>
18
                </div>
19
            </div>
20
21
            <div class="form-group">
22
                <label for="category" class="col-sm-3 control-label">Category of ensemble</label>
23
                <div class="col-sm-9">
24
                    <select class="form-control" id="category">
25
                        <option value=""></option>
26
                        [% FOREACH optgroup IN category_optgroups %]
27
                            <optgroup label="[% optgroup.label | html %]">
28
                                [% FOREACH option IN optgroup.options %]
29
                                    [% IF option.value == category %]
30
                                        <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %] ([% optgroup.label | html %])</option>
31
                                    [% ELSE %]
32
                                        <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %] ([% optgroup.label | html %])</option>
33
                                    [% END %]
34
                                [% END %]
35
                            </optgroup>
36
                        [% END %]
37
                    </select>
38
                </div>
39
            </div>
40
41
            <div class="form-group">
42
                <label for="number_of_real_parts" class="col-sm-3 control-label">Number of real parts</label>
43
                <div class="col-sm-9">
44
                    <input inputmode="numeric" pattern="^[0-9]{0,2}$" title="a number between 0 and 99 (inclusive)" id="number_of_real_parts" value="[% number_of_real_parts | html %]">
45
                    <p class="help-block">A number between 0 and 99 (inclusive)</p>
46
                </div>
47
            </div>
48
49
            <div class="form-group">
50
                <label for="other" class="col-sm-3 control-label">Other (position 7)</label>
51
                <div class="col-sm-9">
52
                    <select class="form-control" id="other">
53
                        <option value=""></option>
54
                        [% FOREACH option IN other_options %]
55
                            [% IF option.value == other %]
56
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
57
                            [% ELSE %]
58
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
59
                            [% END %]
60
                        [% END %]
61
                    </select>
62
                </div>
63
            </div>
64
            <div class="form-group">
65
                <label for="other2" class="col-sm-3 control-label">Other (position 8)</label>
66
                <div class="col-sm-9">
67
                    <select class="form-control" id="other2">
68
                        <option value=""></option>
69
                        [% FOREACH option IN other2_options %]
70
                            [% IF option.value == other2 %]
71
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
72
                            [% ELSE %]
73
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
74
                            [% END %]
75
                        [% END %]
76
                    </select>
77
                </div>
78
            </div>
79
80
            <div class="form-group">
81
                <div class="col-sm-offset-3 col-sm-9">
82
                    <button type="submit">OK</button>
83
                    <a href="#" class="cancel close">Cancel</a>
84
                </div>
85
            </div>
86
        </form>
87
    </div>
88
89
    [% INCLUDE 'select2.inc' %]
90
    <script>
91
        $(document).ready(function () {
92
            $('#category').select2();
93
        });
94
    </script>
95
96
    <script>
97
        document.getElementById('form').addEventListener('submit', function (ev) {
98
            ev.preventDefault();
99
            const id = document.getElementById('id').value;
100
            const number = document.getElementById('number').value;
101
            const category = document.getElementById('category').value;
102
            const number_of_real_parts = document.getElementById('number_of_real_parts').value;
103
            const other = document.getElementById('other').value;
104
            const other2 = document.getElementById('other2').value;
105
            const value =
106
                (number ? number.toString().padStart(2, '0') : 'uu') +
107
                category.padStart(3, ' ') +
108
                (number_of_real_parts ? number_of_real_parts.toString().padStart(2, '0') : '##') +
109
                other.padStart(1, ' ') +
110
                other2.padStart(1, ' ');
111
            opener.document.getElementById(id).value = value;
112
            window.close();
113
        });
114
    </script>
115
116
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_146e.tt (+141 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Framework plugin unimarc_field_146e &rsaquo; Cataloguing &rsaquo; Koha</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
6
<body id="unimarc_field_146e" class="cat">
7
    <div class="container-fluid">
8
        <h1>Framework plugin for UNIMARC 146$e</h1>
9
10
        <form class="form-horizontal" id="form">
11
            <input type="hidden" id="id" name="id" value="[% id | html %]">
12
13
            <div class="form-group">
14
                <label for="number" class="col-sm-3 control-label">Number of instruments or voices</label>
15
                <div class="col-sm-9">
16
                    <input inputmode="numeric" pattern="^[0-9]{0,2}$" title="a number between 0 and 99 (inclusive)" id="number" name="number" value="[% number | html %]">
17
                    <p class="help-block">A number between 0 and 99 (inclusive)</p>
18
                </div>
19
            </div>
20
            <div class="form-group">
21
                <label for="category" class="col-sm-3 control-label">Category of instrument or voice</label>
22
                <div class="col-sm-9">
23
                    <select class="form-control" id="category">
24
                        <option value=""></option>
25
                        [% FOREACH optgroup IN category_optgroups %]
26
                            <optgroup label="[% optgroup.label | html %]">
27
                                [% FOREACH option IN optgroup.options %]
28
                                    [% IF option.value == category %]
29
                                        <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %] ([% optgroup.label | html %])</option>
30
                                    [% ELSE %]
31
                                        <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %] ([% optgroup.label | html %])</option>
32
                                    [% END %]
33
                                [% END %]
34
                            </optgroup>
35
                        [% END %]
36
                    </select>
37
                </div>
38
            </div>
39
40
            <div class="form-group">
41
                <label for="tessitura" class="col-sm-3 control-label">Tessitura</label>
42
                <div class="col-sm-9">
43
                    <select class="form-control" id="tessitura">
44
                        <option value=""></option>
45
                        [% FOREACH option IN tessitura_options %]
46
                            [% IF option.value == tessitura %]
47
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
48
                            [% ELSE %]
49
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
50
                            [% END %]
51
                        [% END %]
52
                    </select>
53
                </div>
54
            </div>
55
56
            <div class="form-group">
57
                <label for="number_of_hands_or_keys" class="col-sm-3 control-label">Number of hands / players; keys of pitched instruments</label>
58
                <div class="col-sm-9">
59
                    <select class="form-control" id="number_of_hands_or_keys">
60
                        <option value=""></option>
61
                        [% FOREACH option IN number_of_hands_or_keys_options %]
62
                            [% IF option.value == number_of_hands_or_keys %]
63
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
64
                            [% ELSE %]
65
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
66
                            [% END %]
67
                        [% END %]
68
                    </select>
69
                </div>
70
            </div>
71
72
            <div class="form-group">
73
                <label for="other" class="col-sm-3 control-label">Other (position 7)</label>
74
                <div class="col-sm-9">
75
                    <select class="form-control" id="other">
76
                        <option value=""></option>
77
                        [% FOREACH option IN other_options %]
78
                            [% IF option.value == other %]
79
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
80
                            [% ELSE %]
81
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
82
                            [% END %]
83
                        [% END %]
84
                    </select>
85
                </div>
86
            </div>
87
            <div class="form-group">
88
                <label for="other2" class="col-sm-3 control-label">Other (position 8)</label>
89
                <div class="col-sm-9">
90
                    <select class="form-control" id="other2">
91
                        <option value=""></option>
92
                        [% FOREACH option IN other2_options %]
93
                            [% IF option.value == other2 %]
94
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
95
                            [% ELSE %]
96
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
97
                            [% END %]
98
                        [% END %]
99
                    </select>
100
                </div>
101
            </div>
102
103
            <div class="form-group">
104
                <div class="col-sm-offset-3 col-sm-9">
105
                    <button type="submit">OK</button>
106
                    <a href="#" class="cancel close">Cancel</a>
107
                </div>
108
            </div>
109
        </form>
110
    </div>
111
112
    [% INCLUDE 'select2.inc' %]
113
    <script>
114
        $(document).ready(function () {
115
            $('#category').select2();
116
        });
117
    </script>
118
119
    <script>
120
        document.getElementById('form').addEventListener('submit', function (ev) {
121
            ev.preventDefault();
122
            const id = document.getElementById('id').value;
123
            const number = document.getElementById('number').value;
124
            const category = document.getElementById('category').value;
125
            const tessitura = document.getElementById('tessitura').value;
126
            const number_of_hands_or_keys = document.getElementById('number_of_hands_or_keys').value;
127
            const other = document.getElementById('other').value;
128
            const other2 = document.getElementById('other2').value;
129
            const value =
130
                (number ? number.toString().padStart(2, '0') : 'uu') +
131
                category.padStart(3, ' ') +
132
                tessitura.padStart(1, ' ') +
133
                number_of_hands_or_keys.padStart(1, ' ') +
134
                other.padStart(1, ' ') +
135
                other2.padStart(1, ' ');
136
            opener.document.getElementById(id).value = value;
137
            window.close();
138
        });
139
    </script>
140
141
[% INCLUDE 'popup-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_146f.tt (-1 / +141 lines)
Line 0 Link Here
0
- 
1
[% INCLUDE 'doc-head-open.inc' %]
2
<title>Framework plugin unimarc_field_146e &rsaquo; Cataloguing &rsaquo; Koha</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
</head>
5
6
<body id="unimarc_field_146f" class="cat">
7
    <div class="container-fluid">
8
        <h1>Framework plugin for UNIMARC 146$f</h1>
9
10
        <form class="form-horizontal" id="form">
11
            <input type="hidden" id="id" name="id" value="[% id | html %]">
12
13
            <div class="form-group">
14
                <label for="number" class="col-sm-3 control-label">Number of instruments</label>
15
                <div class="col-sm-9">
16
                    <input inputmode="numeric" pattern="^[0-9]{0,2}$" title="a number between 0 and 99 (inclusive)" id="number" name="number" value="[% number | html %]">
17
                    <p class="help-block">A number between 0 and 99 (inclusive)</p>
18
                </div>
19
            </div>
20
            <div class="form-group">
21
                <label for="category" class="col-sm-3 control-label">Category of instrument</label>
22
                <div class="col-sm-9">
23
                    <select class="form-control" id="category">
24
                        <option value=""></option>
25
                        [% FOREACH optgroup IN category_optgroups %]
26
                            <optgroup label="[% optgroup.label | html %]">
27
                                [% FOREACH option IN optgroup.options %]
28
                                    [% IF option.value == category %]
29
                                        <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %] ([% optgroup.label | html %])</option>
30
                                    [% ELSE %]
31
                                        <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %] ([% optgroup.label | html %])</option>
32
                                    [% END %]
33
                                [% END %]
34
                            </optgroup>
35
                        [% END %]
36
                    </select>
37
                </div>
38
            </div>
39
40
            <div class="form-group">
41
                <label for="tessitura" class="col-sm-3 control-label">Tessitura</label>
42
                <div class="col-sm-9">
43
                    <select class="form-control" id="tessitura">
44
                        <option value=""></option>
45
                        [% FOREACH option IN tessitura_options %]
46
                            [% IF option.value == tessitura %]
47
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
48
                            [% ELSE %]
49
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
50
                            [% END %]
51
                        [% END %]
52
                    </select>
53
                </div>
54
            </div>
55
56
            <div class="form-group">
57
                <label for="number_of_hands_or_keys" class="col-sm-3 control-label">Number of hands / players; keys of pitched instruments</label>
58
                <div class="col-sm-9">
59
                    <select class="form-control" id="number_of_hands_or_keys">
60
                        <option value=""></option>
61
                        [% FOREACH option IN number_of_hands_or_keys_options %]
62
                            [% IF option.value == number_of_hands_or_keys %]
63
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
64
                            [% ELSE %]
65
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
66
                            [% END %]
67
                        [% END %]
68
                    </select>
69
                </div>
70
            </div>
71
72
            <div class="form-group">
73
                <label for="other" class="col-sm-3 control-label">Other (position 7)</label>
74
                <div class="col-sm-9">
75
                    <select class="form-control" id="other">
76
                        <option value=""></option>
77
                        [% FOREACH option IN other_options %]
78
                            [% IF option.value == other %]
79
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
80
                            [% ELSE %]
81
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
82
                            [% END %]
83
                        [% END %]
84
                    </select>
85
                </div>
86
            </div>
87
            <div class="form-group">
88
                <label for="other2" class="col-sm-3 control-label">Other (position 8)</label>
89
                <div class="col-sm-9">
90
                    <select class="form-control" id="other2">
91
                        <option value=""></option>
92
                        [% FOREACH option IN other2_options %]
93
                            [% IF option.value == other2 %]
94
                                <option value="[% option.value | html %]" selected>[% option.value | html %] &ndash; [% option.label | html %]</option>
95
                            [% ELSE %]
96
                                <option value="[% option.value | html %]">[% option.value | html %] &ndash; [% option.label | html %]</option>
97
                            [% END %]
98
                        [% END %]
99
                    </select>
100
                </div>
101
            </div>
102
103
            <div class="form-group">
104
                <div class="col-sm-offset-3 col-sm-9">
105
                    <button type="submit">OK</button>
106
                    <a href="#" class="cancel close">Cancel</a>
107
                </div>
108
            </div>
109
        </form>
110
    </div>
111
112
    [% INCLUDE 'select2.inc' %]
113
    <script>
114
        $(document).ready(function () {
115
            $('#category').select2();
116
        });
117
    </script>
118
119
    <script>
120
        document.getElementById('form').addEventListener('submit', function (ev) {
121
            ev.preventDefault();
122
            const id = document.getElementById('id').value;
123
            const number = document.getElementById('number').value;
124
            const category = document.getElementById('category').value;
125
            const tessitura = document.getElementById('tessitura').value;
126
            const number_of_hands_or_keys = document.getElementById('number_of_hands_or_keys').value;
127
            const other = document.getElementById('other').value;
128
            const other2 = document.getElementById('other2').value;
129
            const value =
130
                (number ? number.toString().padStart(2, '0') : 'uu') +
131
                category.padStart(3, ' ') +
132
                tessitura.padStart(1, ' ') +
133
                number_of_hands_or_keys.padStart(1, ' ') +
134
                other.padStart(1, ' ') +
135
                other2.padStart(1, ' ');
136
            opener.document.getElementById(id).value = value;
137
            window.close();
138
        });
139
    </script>
140
141
[% INCLUDE 'popup-bottom.inc' %]

Return to bug 30941