View | Details | Raw Unified | Return to bug 29825
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt (-53 / +52 lines)
Lines 80-138 Link Here
80
        });
80
        });
81
81
82
        $('#preview').click(function (){ 
82
        $('#preview').click(function (){ 
83
        		var content="<h3>Authority #: [% authid %]</h3><hr>";		
83
   		      var content="<h3>Authority #: [% authid %]</h3><hr>";		
84
		        content+="<div style='color:#004d99;'>";
84
            content+="<div style='color:#004d99;'>";
85
        		var line=1;
85
   		      var line=1;
86
        		var has_input=0;
86
   		      var has_input=0;
87
        		var sf_has_input=0;	
87
   		      var sf_has_input=0;	
88
        		$('#authoritytabs').find('[id^=tag_]').each(function(){ 
88
   		      $('#authoritytabs').find('[id^=tag_]').each(function(){ 
89
    		    //check if tag has content
89
			        //check if tag has content
90
		        has_input=0;
90
			        has_input=0;
91
		        $(this).find('.input_marceditor').each(function(){
91
			        $(this).find('.input_marceditor').each(function(){
92
				      if($(this).val()) has_input=1;
92
				        if($(this).val()) has_input=1;
93
		        });
93
		        	});
94
		        if(has_input){
94
95
			        line=1;
95
			        if(has_input){
96
			        //tag
96
				        line=1;
97
			        var $tag = $(this).find('.tagnum').text();
97
				        //tag
98
			        content += $tag.replace('*','') +"&nbsp;&nbsp;";			
98
				        var $tag = $(this).find('.tagnum').text();
99
			        //indicators
99
				        content += $tag.replace('*','') +"&nbsp;&nbsp;";			
100
			        $(this).find('.indicator').each(function(){
100
				        //indicators
101
			      	  if( $(this).val() ) content += $(this).val();
101
				        $(this).find('.indicator').each(function(){
102
				        else content += "_";
102
				          if( $(this).val() ) content += $(this).val();
103
			        });			
103
					        else content += "_";
104
			       content += "&nbsp;&nbsp;";	
104
				        });			
105
        		 //subfields
105
				        content += "&nbsp;&nbsp;";	
106
			       $(this).find('.subfield_line').each(function(){
106
				        //subfields
107
107
				        $(this).find('.subfield_line').each(function(){
108
				     //check if subfield has content
108
					      //check if subfield has content
109
				     sf_has_input=0;
109
					      sf_has_input=0;
110
				     $(this).find('.input_marceditor').each(function(){
110
					      $(this).find('.input_marceditor').each(function(){
111
					    if($(this).val()) sf_has_input=1;
111
						       if($(this).val()) sf_has_input=1;
112
				     });
112
				      	});
113
				     if(sf_has_input){
113
					      if(sf_has_input){
114
					      if(line>1) content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
114
						      if(line>1) content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
115
					      //code
115
						      //code
116
					      $(this).find('.subfieldcode').each(function(){
116
						      $(this).find('.subfieldcode').each(function(){
117
						      $(this).find('.flat').each(function(){
117
							      $(this).find('.flat').each(function(){
118
							      if($(this).val()!='00')
118
								     if($(this).val()!='00')
119
								      content += "\$"+$(this).val()+"&nbsp;&nbsp;";
119
								     content += "\$"+$(this).val()+"&nbsp;&nbsp;";
120
							      });
120
						      });
121
						      });
121
					      });
122
						    //value
122
					      //value
123
						    $(this).find('.input_marceditor').each(function(){					
123
					      $(this).find('.input_marceditor').each(function(){					
124
							    content += "<span style='color:#000;'>"+$(this).val()+"</span>";					
124
					        content += "<span style='color:#000;'>"+$(this).val()+"</span>";					
125
						    });
125
					      });
126
						    content+="</br>";
126
					      content+="</br>";
127
						    line+=1;
127
					      line+=1;
128
					      }
128
				      }
129
				        });
129
			        });
130
			          }	
130
		        }	
131
		          });
131
		        });
132
			
132
		
133
	        $('#auEditPreview').modal('show');
133
           $('#auEditPreview').modal('show');
134
	        $("#auloadpreview").html(content); 
134
           $("#auloadpreview").html(content); 
135
	     });
135
	});
136
136
137
    });
137
    });
138
138
139
- 

Return to bug 29825