Koha/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/blinddetail-biblio-search.tmpl
Nahuel ANGELINETTI 1bbc0324c4 (bug #3411) escape authorities values
The values are not escaped in javascript, so if there is double quotes, the authority cannot be imported because of javascript error. This patch fix this.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
2009-09-30 11:30:04 +02:00

58 lines
1.8 KiB
Cheetah

<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<Title>Koha -- Authority details</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<script type="text/javascript">
window.onload = go();
function go(){
var index_start = "<!-- TMPL_VAR NAME='index' -->";
var whichfield;
try {
whichfield = opener.opener.document.getElementById(index_start);
} catch(e) {
return;
}
// browse all its subfields
var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input');
var re = /^tag_\d*_code_/;
for(var i=0, len = subfields.length ; i< len ; i++) { // browse all subfields
if(subfields[i].getAttribute('name').match(re)){ // it s a subfield
var code = subfields[i]; // code is the first input
var subfield = subfields[i+1]; // subfield the second
<!-- TMPL_IF NAME="clear" -->
if (subfield){subfield.value="" ;}
<!--TMPL_ELSE-->
if(code.value=='9'){
subfield.value = "<!-- TMPL_VAR ESCAPE="JS" NAME="authid" -->";
}
<!-- TMPL_LOOP NAME="0XX" -->
<!-- TMPL_LOOP NAME="subfield" -->
if (code.value == "<!-- TMPL_VAR ESCAPE="JS" NAME="marc_subfield" -->"){
subfield.value = "<!-- TMPL_VAR ESCAPE="JS" NAME="marc_value" -->";
}
<!-- /TMPL_LOOP -->
<!-- /TMPL_LOOP -->
<!--/TMPL_IF-->
}
}
opener.close();
window.close();
return false;
}
</script>
</head>
<body>
<div id="doc" class="yui-t7">
<div id="bd">
<div class="yui-g">
</div>
</div>
</div>
<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->