Bug 30941: Add cataloguing plugins for 146$bcdef (UNIMARC)
[srvgit] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / value_builder / unimarc_field_146c.tt
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' %]