+
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt
@@ -91,56 +91,59 @@
f.authtypecode.value = authtypecode;
f.submit();
});
- $('#preview').click(function (){
- var content="
Authority #: [% authid %]
";
- content+="
";
- var line=1;
- var has_input=0;
- var sf_has_input=0;
- $("#authoritytabs").find("[id^=tag_]").each(function(){
+ $("#preview").click(function () {
+ var content = "
Authority #: [% authid | html %]
";
+ content += "
";
+ var line = 1;
+ var has_input = 0;
+ var sf_has_input = 0;
+ $("#authoritytabs").find("[id^=tag_]").each(function () {
//check if tag has content
- has_input=0;
- $(this).find(".input_marceditor").each(function(){
- if($(this).val()) has_input=1;
+ has_input = 0;
+ $(this).find(".input_marceditor").each(function () {
+ if ($(this).val()) has_input = 1;
});
- if(has_input){
- line=1;
+ if (has_input) {
+ line = 1;
//tag
var $tag = $(this).find(".tagnum").text();
- content += $tag.replace("*",") +" ";
+ content += $tag.replace("*", "") + " ";
//indicators
- $(this).find(".indicator").each(function(){
- if( $(this).val() ) content += $(this).val();
+ $(this).find(".indicator").each(function () {
+ if ($(this).val()) content += $(this).val();
else content += "_";
});
content += " ";
//subfields
- $(this).find(".subfield_line").each(function(){
+ $(this).find(".subfield_line").each(function () {
//check if subfield has content
- sf_has_input=0;
- $(this).find(".input_marceditor").each(function(){
- if($(this).val()) sf_has_input=1;
- });
- if(sf_has_input){
- if(line>1) content += " ";
- //code
- $(this).find(".subfieldcode").each(function(){
- $(this).find(".flat").each(function(){
- if($(this).val()!="00")
- content += "\$"+$(this).val()+" ";
- });
- });
- //value
- $(this).find(".input_marceditor").each(function(){
- content += ""+$(this).val()+"";
+ sf_has_input = 0;
+ $(this).find(".input_marceditor").each(function () {
+ if ($(this).val()) sf_has_input = 1;
});
- content+="";
- line+=1;
- }
+ if (sf_has_input) {
+ if (line > 1) content += " ";
+ //code
+ $(this).find(".subfieldcode").each(function () {
+ $(this).find(".flat").each(function () {
+ if ($(this).val() != "00")
+ content += "\$" + $(this).val() + " ";
+ });
+ });
+ //value
+ $(this).find(".input_marceditor").each(function () {
+ content += "" + $(this).val() + "";
+ });
+ content += "";
+ line += 1;
+ }
+ });
}
});
- });
+ $("#auloadpreview").html( content );
+ $("#auEditPreview").modal();
+ });
});
function selectTab( tablink ){
@@ -305,7 +308,9 @@
}
[% Asset.css("css/addbiblio.css") | $raw %]
-
+
--