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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt (-2 / +54 lines)
Lines 91-96 Link Here
91
            f.authtypecode.value = authtypecode;
91
            f.authtypecode.value = authtypecode;
92
            f.submit();
92
            f.submit();
93
        });
93
        });
94
        $('#preview').click(function (){
95
            var content="<h3>Authority #: [% authid %]</h3><hr>";
96
            content+="<div style='color:#004d99;'>";
97
            var line=1;
98
            var has_input=0;
99
            var sf_has_input=0;
100
            $("#authoritytabs").find("[id^=tag_]").each(function(){
101
                //check if tag has content
102
                has_input=0;
103
                $(this).find(".input_marceditor").each(function(){
104
                    if($(this).val()) has_input=1;
105
                });
106
107
                if(has_input){
108
                    line=1;
109
                    //tag
110
                    var $tag = $(this).find(".tagnum").text();
111
                    content += $tag.replace("*",") +"&nbsp;&nbsp;";
112
                    //indicators
113
                    $(this).find(".indicator").each(function(){
114
                        if( $(this).val() ) content += $(this).val();
115
                        else content += "_";
116
                    });
117
                    content += "&nbsp;&nbsp;";
118
                    //subfields
119
                    $(this).find(".subfield_line").each(function(){
120
                        //check if subfield has content
121
                        sf_has_input=0;
122
                        $(this).find(".input_marceditor").each(function(){
123
                            if($(this).val()) sf_has_input=1;
124
                    });
125
                    if(sf_has_input){
126
                        if(line>1) content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
127
                        //code
128
                        $(this).find(".subfieldcode").each(function(){
129
                            $(this).find(".flat").each(function(){
130
                                if($(this).val()!="00")
131
                                    content += "\$"+$(this).val()+"&nbsp;&nbsp;";
132
                            });
133
                        });
134
                        //value
135
                        $(this).find(".input_marceditor").each(function(){
136
                            content += "<span style='color:#000;'>"+$(this).val()+"</span>";
137
                        });
138
                        content+="</br>";
139
                        line+=1;
140
                    }
141
                }
142
            });
143
         });
94
    });
144
    });
95
145
96
    function selectTab( tablink ){
146
    function selectTab( tablink ){
Lines 357-362 Link Here
357
                                [% END %]
407
                                [% END %]
358
                            </ul> <!-- /#settings-menu -->
408
                            </ul> <!-- /#settings-menu -->
359
                        </div> <!-- /.btn-group -->
409
                        </div> <!-- /.btn-group -->
410
                        <div class="btn-group">
411
                            <a class="btn btn-default" id="preview" href="#"><i class="fa fa-eye"></i> MARC Preview</a>
412
                        </div>
360
                        <div class="btn-group">
413
                        <div class="btn-group">
361
                            [% IF ( authid ) %]
414
                            [% IF ( authid ) %]
362
                                <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/detail.pl?authid=[% authid | url %]">Cancel</a>
415
                                <a class="btn btn-default" id="cancel" href="/cgi-bin/koha/authorities/detail.pl?authid=[% authid | url %]">Cancel</a>
Lines 643-649 Link Here
643
                </form>
696
                </form>
644
697
645
                [% INCLUDE 'modals/cataloguing_create_av.inc' %]
698
                [% INCLUDE 'modals/cataloguing_create_av.inc' %]
646
699
                [% INCLUDE 'modals/edit_authority_preview.inc' %]
647
            </div>
700
            </div>
648
        </div>
701
        </div>
649
    </div>
702
    </div>
650
- 

Return to bug 29825