1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Framework plugin unimarc_field_146c › Cataloguing › Koha</title>
3 [% INCLUDE 'doc-head-close.inc' %]
6 <body id="unimarc_field_146c" class="cat">
7 <div class="container-fluid">
8 <h1>Framework plugin for UNIMARC 146$c</h1>
10 <form class="form-horizontal" id="form">
11 <input type="hidden" id="id" name="id" value="[% id | html %]">
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>
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 %] – [% option.label | html %] ([% optgroup.label | html %])</option>
31 <option value="[% option.value | html %]">[% option.value | html %] – [% option.label | html %] ([% optgroup.label | html %])</option>
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 %] – [% option.label | html %]</option>
49 <option value="[% option.value | html %]">[% option.value | html %] – [% option.label | html %]</option>
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 %] – [% option.label | html %]</option>
65 <option value="[% option.value | html %]">[% option.value | html %] – [% option.label | html %]</option>
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 %] – [% option.label | html %]</option>
81 <option value="[% option.value | html %]">[% option.value | html %] – [% option.label | html %]</option>
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 %] – [% option.label | html %]</option>
96 <option value="[% option.value | html %]">[% option.value | html %] – [% option.label | html %]</option>
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>
112 [% INCLUDE 'select2.inc' %]
114 $(document).ready(function () {
115 $('#category').select2();
120 document.getElementById('form').addEventListener('submit', function (ev) {
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;
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;
141 [% INCLUDE 'popup-bottom.inc' %]