3bf4238dcfedf165801446716ae96fe2b3393423
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / value_builder / marc21_field_006.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% SET footerjs = 1 %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>006 builder &rsaquo; Cataloging &rsaquo; Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 </head>
8
9 <body id="cat_marc21_field_006" class="cat" style="padding:1em;" onload="loadXmlValues()">
10 <h1>006 Fixed-length data elements--Additional material characteristics--General information</h1>
11
12 <table>
13     <tr id="tr_result">
14     </tr>
15 </table>
16 <h4 id="h4_result">&quot;[% result | html %]&quot;</h4>
17
18 <form name="f_pop" id="f_pop" onsubmit="report()" action="">
19 <input type="hidden" name="plugin_name" value="marc21_field_006.pl" />
20 <input type="hidden" id="[% index | html %]" name="index" value="[% index | html %]" />
21 <input type="hidden" id="result" name="result" value="[% result | html %]" />
22 <table id="table_material_types">
23     <tr id="tr_material_types">
24         <td><label for="material_type" title="Select a type of material to specify the variable values">Type of material</label></td>
25         <td>
26             <select name="material_type" id="material_type" title="Select a type of material to specify the variable values" onchange="changeTypeofMaterial(this.form)">
27                 <option value="">Select a type of material</option>
28             </select>
29         </td>
30     </tr>
31 </table>
32 <fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
33 </form>
34
35 [% MACRO jsinclude BLOCK %]
36     [% Asset.js("js/xmlControlfield.js") | $raw %]
37     <script>
38         var objXmlControlField;
39         var tr_result;
40         var h4_result;
41
42         function loadXmlValues(){
43             [% IF ( errorXml ) %]
44             alert("[% errorXml | html %]");
45             [% ELSE %]
46             var form = document.f_pop;
47             h4_result = document.getElementById("h4_result");
48             tr_result = document.getElementById("tr_result");
49             objXmlControlField = new xmlControlField('[% tagfield | html %]', 'f_pop', document.getElementById('material_type'), document.getElementById('table_material_types'), 'h4_result', 'tr_result', '', '[% themelang | html %]', '[% marcflavour | html %]');
50             [% IF ( material_configuration ) %]
51             objXmlControlField.idMaterial = "[% material_configuration | html %]";
52             [% END %]
53             objXmlControlField.loadXmlValues();
54             renderResult(tr_result, (form.result.value != "")?form.result.value:returnValueParam("result"));
55             [% END %]
56         } // loadXmlValues
57
58         function changeTypeofMaterial(form){
59             if (form.material_type.options[form.material_type.selectedIndex].value != "" && confirm(_("Show values for '%s' material type?").format(form.material_type.options[form.material_type.selectedIndex].text))) {
60                 objXmlControlField.setIdMaterial(form.material_type.options[form.material_type.selectedIndex].value);
61                 objXmlControlField.renderTemplate();
62                 renderResult(tr_result, form.result.value, true);
63             }
64         } // changeTypeofMaterial
65
66         function report() {
67             var doc   = opener.document;
68             var field = doc.getElementById("[% index | html %]");
69             field.value = document.getElementById("result").value;
70             self.close();
71             return false;
72         }
73     </script>
74 [% END %]
75
76 [% INCLUDE 'intranet-bottom.inc' popup_window=1 %]