1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Framework plugin example › Cataloguing › Koha</title>
3 [% INCLUDE 'doc-head-close.inc' %]
6 <body id="cat_unimarc_field_325j" class="cat" style="padding:1em;">
8 <h3>UNIMARC field 325j builder</h3>
10 <form name="f_pop" action="" id="form">
13 <td><label for="f0">Terms of access to the reproduction :</label></td>
15 <select name="f0" id="f0">
16 [% IF ( f0 == "1" ) %]
17 <option value="1" selected="selected">1 - free-to-read</option>
19 <option value="1">1 - free-to-read</option>
22 [% IF ( f0 == "2" ) %]
23 <option value="2" selected="selected">2 - free-to-read, partly</option>
25 <option value="2">2 - free-to-read, partly</option>
28 [% IF ( f0 == "3" ) %]
29 <option value="3" selected="selected">3 - free-to-read, after embargo</option>
31 <option value="3">3 - free-to-read, after embargo</option>
34 [% IF ( f0 == "4" ) %]
35 <option value="4" selected="selected">4 - fully</option>
37 <option value="4">4 - fully</option>
40 [% IF ( f0 == "5" ) %]
41 <option value="5" selected="selected">5 - free-to-read upon subscription (requires signing up)</option>
43 <option value="5">5 - free-to-read upon subscription (requires signing up)</option>
49 <td><label for="f1">Qualifier type :</label></td>
51 <select name="f1" id="f1">
52 [% IF ( f1 == "l" ) %]
53 <option value="l" selected="selected">l - latest</option>
55 <option value="l" >l - latest</option>
58 [% IF ( f1 == "p" ) %]
59 <option value="p" selected="selected">p - previous</option>
61 <option value="p">p - previous</option>
64 [% IF ( f1 == "x" ) %]
65 <option value="" selected="selected">x - not applicable</option>
67 <option value="">x - not applicable</option>
70 [% IF ( f1 == "#" ) %]
71 <option value="#" selected="selected"># - no attempt to code</option>
73 <option value="#"># - no attempt to code</option>
79 <td><label for="f2">Unit under embargo :</label></td>
81 <select name="f2" id="f2">
82 [% IF ( f2 == "m" ) %]
83 <option value="m" selected="selected">m - month(s) time</option>
85 <option value="m">m - month(s) time</option>
88 [% IF ( f2 == "w" ) %]
89 <option value="w" selected="selected">w - week(s) time</option>
91 <option value="w">w - week(s) time</option>
94 [% IF ( f2 == "y" ) %]
95 <option value="y" selected="selected">y - year(s) time</option>
97 <option value="y">y - year(s) time</option>
100 [% IF ( f2 == "i" ) %]
101 <option value="i" selected="selected">i - issue(s) part</option>
103 <option value="i">i - issue(s) part</option>
106 [% IF ( f2 == "x" ) %]
107 <option value="" selected="selected">x - not applicable</option>
109 <option value="">x - not applicable</option>
112 [% IF ( f2 == "#" ) %]
113 <option value="#" selected="selected"># - no attempt to code</option>
115 <option value="#"># - no attempt to code</option>
121 <td><label for="f3">Number of units under embargo :</label></td>
123 <input name="f3" id="f3" inputmode="numeric" pattern="\d{1,2}" value="[% f3 | html %]"></input>
127 <p><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a> </p>
131 $("#form").on('submit', submitMyForm);
132 $("#f0").on('change', function() {
133 document.f_pop.f1.disabled = false;
134 document.f_pop.f2.disabled = false;
135 document.f_pop.f3.disabled = false;
137 if ( document.f_pop.f0.value != "3" ) {
138 document.f_pop.f1.value = "x";
139 document.f_pop.f2.value = "x";
140 document.f_pop.f1.disabled = true;
141 document.f_pop.f2.disabled = true;
142 document.f_pop.f3.disabled = true;
145 $("#f0").trigger('change');
147 function submitMyForm(event) {
148 event.preventDefault();
149 var doc = opener.document;
150 var field = doc.getElementById("[% index | html %]");
151 if ( document.f_pop.f0.value == "3" ) {
152 var f3v = document.f_pop.f3.value.padStart(2, '0');
153 document.f_pop.f3.value = f3v;
156 field.value = document.f_pop.f0.value+
157 document.f_pop.f1.value+
158 document.f_pop.f2.value+
159 document.f_pop.f3.value;
164 [% INCLUDE 'popup-bottom.inc' %]