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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/edit_authority_preview.inc (-4 / +8 lines)
Lines 1-11 Link Here
1
<div id="auEditPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="auEditPreview" aria-hidden="true">
1
<div class="modal" id="auEditPreview" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
2
    <div class="modal-dialog">
2
    <div class="modal-dialog modal-wide" role="document">
3
        <div class="modal-content">
3
        <div class="modal-content">
4
            <div class="modal-header">
4
            <div class="modal-header">
5
                <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
5
                <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span
6
                <h3 id="avCreateLabel">Preview based on MARC structure</h3>
6
                        aria-hidden="true">&times;</span></button>
7
                <h3 class="modal-title" id="avCreateLabel">Preview based on MARC structure</h3>
7
            </div>
8
            </div>
8
            <div class="modal-body" id="auloadpreview"></div>
9
            <div class="modal-body" id="auloadpreview"></div>
10
            <div class="modal-footer">
11
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
12
            </div>
9
        </div> <!-- /.modal-content -->
13
        </div> <!-- /.modal-content -->
10
    </div> <!-- /.modal-dialog -->
14
    </div> <!-- /.modal-dialog -->
11
</div> <!-- /#auEditPreview -->
15
</div> <!-- /#auEditPreview -->
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt (-38 / +42 lines)
Lines 126-181 Link Here
126
            Sticky.hcSticky('refresh');
126
            Sticky.hcSticky('refresh');
127
        });
127
        });
128
128
129
        $('#preview').click(function (){
129
        $("#preview").click(function () {
130
            var content="<h3>Authority #: [% authid %]</h3><hr>";
130
            var content = "<h3>Authority #: [% authid | html %]</h3><hr>";
131
            content+="<div style='color:#004d99;'>";
131
            content += "<div style=\"color:#004d99;\">";
132
            var line=1;
132
            var line = 1;
133
            var has_input=0;
133
            var has_input = 0;
134
            var sf_has_input=0;
134
            var sf_has_input = 0;
135
            $("#authoritytabs").find("[id^=tag_]").each(function(){
135
            $("#authoritytabs").find("[id^=tag_]").each(function () {
136
                //check if tag has content
136
                //check if tag has content
137
                has_input=0;
137
                has_input = 0;
138
                $(this).find(".input_marceditor").each(function(){
138
                $(this).find(".input_marceditor").each(function () {
139
                    if($(this).val()) has_input=1;
139
                    if ($(this).val()) has_input = 1;
140
                });
140
                });
141
141
142
                if(has_input){
142
                if (has_input) {
143
                    line=1;
143
                    line = 1;
144
                    //tag
144
                    //tag
145
                    var $tag = $(this).find(".tagnum").text();
145
                    var $tag = $(this).find(".tagnum").text();
146
                    content += $tag.replace("*",") +"&nbsp;&nbsp;";
146
                    content += $tag.replace("*", "") + "&nbsp;&nbsp;";
147
                    //indicators
147
                    //indicators
148
                    $(this).find(".indicator").each(function(){
148
                    $(this).find(".indicator").each(function () {
149
                        if( $(this).val() ) content += $(this).val();
149
                        if ($(this).val()) content += $(this).val();
150
                        else content += "_";
150
                        else content += "_";
151
                    });
151
                    });
152
                    content += "&nbsp;&nbsp;";
152
                    content += "&nbsp;&nbsp;";
153
                    //subfields
153
                    //subfields
154
                    $(this).find(".subfield_line").each(function(){
154
                    $(this).find(".subfield_line").each(function () {
155
                        //check if subfield has content
155
                        //check if subfield has content
156
                        sf_has_input=0;
156
                        sf_has_input = 0;
157
                        $(this).find(".input_marceditor").each(function(){
157
                        $(this).find(".input_marceditor").each(function () {
158
                            if($(this).val()) sf_has_input=1;
158
                            if ($(this).val()) sf_has_input = 1;
159
                    });
160
                    if(sf_has_input){
161
                        if(line>1) content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
162
                        //code
163
                        $(this).find(".subfieldcode").each(function(){
164
                            $(this).find(".flat").each(function(){
165
                                if($(this).val()!="00")
166
                                    content += "\$"+$(this).val()+"&nbsp;&nbsp;";
167
                            });
168
                        });
169
                        //value
170
                        $(this).find(".input_marceditor").each(function(){
171
                            content += "<span style='color:#000;'>"+$(this).val()+"</span>";
172
                        });
159
                        });
173
                        content+="</br>";
160
                        if (sf_has_input) {
174
                        line+=1;
161
                            if (line > 1) content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
175
                    }
162
                            //code
163
                            $(this).find(".subfieldcode").each(function () {
164
                                $(this).find(".flat").each(function () {
165
                                    if ($(this).val() != "00")
166
                                        content += "\$" + $(this).val() + "&nbsp;&nbsp;";
167
                                });
168
                            });
169
                            //value
170
                            $(this).find(".input_marceditor").each(function () {
171
                                content += "<span style=\"color:#000;\">" + $(this).val() + "</span>";
172
                            });
173
                            content += "</br>";
174
                            line += 1;
175
                        }
176
                    });
176
                }
177
                }
177
            });
178
            });
178
         });
179
            $("#auloadpreview").html( content );
180
            $("#auEditPreview").modal();
181
        });
179
    });
182
    });
180
183
181
    function selectTab( tablink ){
184
    function selectTab( tablink ){
Lines 420-426 Link Here
420
    });
423
    });
421
</script>
424
</script>
422
[% Asset.css("css/addbiblio.css") | $raw %]
425
[% Asset.css("css/addbiblio.css") | $raw %]
423
426
<style>
427
    #auloadpreview { font-family: monospace; }
428
</style>
424
</head>
429
</head>
425
<body id="auth_authorities" class="auth">
430
<body id="auth_authorities" class="auth">
426
431
427
- 

Return to bug 29825