Main Koha release repository https://koha-community.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

100 lines
4.2 KiB

[% USE raw %]
[% USE Asset %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Cataloging &rsaquo; 008 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="cat_marc21_field_008" class="cat" style="padding:1em;" onload="loadXmlValues()">
<h3> 008 Fixed-length data elements--Additional material characteristics--General information</h3>
<table>
<tr id="tr_result">
</tr>
</table>
<h4 id="h4_result">&quot;[% result | html %]&quot;</h4>
<form name="f_pop" id="f_pop" style="display:block" onsubmit="report()" action="">
<div id="toolbar">
<div class="btn-group">
<button type="submit" class="btn btn-default btn-sm"><i class="fa fa-save"></i> Save</button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-default btn-sm close_window"><i class="fa fa-remove"></i> Cancel</button>
</div>
</div>
<input type="hidden" name="plugin_name" value="marc21_field_008.pl" />
<input type="hidden" id="[% index | html %]" name="index" value="[% index | html %]" />
<input type="hidden" name="result" id="result" value="[% result | html %]" />
<table id="table_material_types">
<tr id="tr_material_types">
<td><label for="material_type" title="Select a type of material to specify the variable values">Type of Material</label></td>
<td>
<select name="material_type" id="material_type" title="Select a type of material to specify the variable values" onchange="changeTypeofMaterial(this.form)">
<option value="">Select a type of material</option>
</select>
</td>
</tr>
</table>
</form>
[% MACRO jsinclude BLOCK %]
[% Asset.js("lib/hc-sticky.js") | $raw %]
[% Asset.js("js/xmlControlfield.js") | $raw %]
<script>
var Sticky;
$(document).ready(function(){
Sticky = $("#toolbar");
Sticky.hcSticky({
stickTo: "#f_pop",
stickyClass: "floating"
});
$(".close_window").on("click", function(e){
e.preventDefault();
window.close();
});
});
var objXmlControlField;
var tr_result;
var h4_result;
function loadXmlValues(){
[% IF ( errorXml ) %]
alert("[% errorXml | html %]");
[% ELSE %]
var form = document.f_pop;
h4_result = document.getElementById("h4_result");
tr_result = document.getElementById("tr_result");
objXmlControlField = new xmlControlField('[% tagfield | html %]', 'f_pop', document.getElementById('material_type'), document.getElementById('table_material_types'), 'h4_result', 'tr_result', '', '[% themelang | html %]', '[% marcflavour | html %]');
[%# If material type configuration is found using the leader, use that type when rendering. Otherwise, the default of BKS will be used %]
[% IF ( material_configuration ) %]
objXmlControlField.idMaterial = "[% material_configuration | html %]";
[% END %]
objXmlControlField.loadXmlValues();
renderResult(tr_result, (form.result.value != "")?form.result.value:returnValueParam("result"));
[% END %]
} // loadXmlValues
function changeTypeofMaterial(form){
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))) {
objXmlControlField.setIdMaterial(form.material_type.options[form.material_type.selectedIndex].value);
objXmlControlField.renderTemplate();
renderResult(tr_result, form.result.value, true);
}
} // changeTypeofMaterial
function report() {
var doc = opener.document;
var field = doc.getElementById("[% index | html %]");
field.value = document.getElementById("result").value;
self.close();
return false;
}
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]