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 127-182 Link Here
127
            Sticky.hcSticky('refresh');
127
            Sticky.hcSticky('refresh');
128
        });
128
        });
129
129
130
        $('#preview').click(function (){
130
        $("#preview").click(function () {
131
            var content="<h3>Authority #: [% authid %]</h3><hr>";
131
            var content = "<h3>Authority #: [% authid | html %]</h3><hr>";
132
            content+="<div style='color:#004d99;'>";
132
            content += "<div style=\"color:#004d99;\">";
133
            var line=1;
133
            var line = 1;
134
            var has_input=0;
134
            var has_input = 0;
135
            var sf_has_input=0;
135
            var sf_has_input = 0;
136
            $("#authoritytabs").find("[id^=tag_]").each(function(){
136
            $("#authoritytabs").find("[id^=tag_]").each(function () {
137
                //check if tag has content
137
                //check if tag has content
138
                has_input=0;
138
                has_input = 0;
139
                $(this).find(".input_marceditor").each(function(){
139
                $(this).find(".input_marceditor").each(function () {
140
                    if($(this).val()) has_input=1;
140
                    if ($(this).val()) has_input = 1;
141
                });
141
                });
142
142
143
                if(has_input){
143
                if (has_input) {
144
                    line=1;
144
                    line = 1;
145
                    //tag
145
                    //tag
146
                    var $tag = $(this).find(".tagnum").text();
146
                    var $tag = $(this).find(".tagnum").text();
147
                    content += $tag.replace("*",") +"&nbsp;&nbsp;";
147
                    content += $tag.replace("*", "") + "&nbsp;&nbsp;";
148
                    //indicators
148
                    //indicators
149
                    $(this).find(".indicator").each(function(){
149
                    $(this).find(".indicator").each(function () {
150
                        if( $(this).val() ) content += $(this).val();
150
                        if ($(this).val()) content += $(this).val();
151
                        else content += "_";
151
                        else content += "_";
152
                    });
152
                    });
153
                    content += "&nbsp;&nbsp;";
153
                    content += "&nbsp;&nbsp;";
154
                    //subfields
154
                    //subfields
155
                    $(this).find(".subfield_line").each(function(){
155
                    $(this).find(".subfield_line").each(function () {
156
                        //check if subfield has content
156
                        //check if subfield has content
157
                        sf_has_input=0;
157
                        sf_has_input = 0;
158
                        $(this).find(".input_marceditor").each(function(){
158
                        $(this).find(".input_marceditor").each(function () {
159
                            if($(this).val()) sf_has_input=1;
159
                            if ($(this).val()) sf_has_input = 1;
160
                    });
161
                    if(sf_has_input){
162
                        if(line>1) content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
163
                        //code
164
                        $(this).find(".subfieldcode").each(function(){
165
                            $(this).find(".flat").each(function(){
166
                                if($(this).val()!="00")
167
                                    content += "\$"+$(this).val()+"&nbsp;&nbsp;";
168
                            });
169
                        });
170
                        //value
171
                        $(this).find(".input_marceditor").each(function(){
172
                            content += "<span style='color:#000;'>"+$(this).val()+"</span>";
173
                        });
160
                        });
174
                        content+="</br>";
161
                        if (sf_has_input) {
175
                        line+=1;
162
                            if (line > 1) content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
176
                    }
163
                            //code
164
                            $(this).find(".subfieldcode").each(function () {
165
                                $(this).find(".flat").each(function () {
166
                                    if ($(this).val() != "00")
167
                                        content += "\$" + $(this).val() + "&nbsp;&nbsp;";
168
                                });
169
                            });
170
                            //value
171
                            $(this).find(".input_marceditor").each(function () {
172
                                content += "<span style=\"color:#000;\">" + $(this).val() + "</span>";
173
                            });
174
                            content += "</br>";
175
                            line += 1;
176
                        }
177
                    });
177
                }
178
                }
178
            });
179
            });
179
         });
180
            $("#auloadpreview").html( content );
181
            $("#auEditPreview").modal();
182
        });
180
    });
183
    });
181
184
182
    function selectTab( tablink ){
185
    function selectTab( tablink ){
Lines 421-427 Link Here
421
    });
424
    });
422
</script>
425
</script>
423
[% Asset.css("css/addbiblio.css") | $raw %]
426
[% Asset.css("css/addbiblio.css") | $raw %]
424
427
<style>
428
    #auloadpreview { font-family: monospace; }
429
</style>
425
</head>
430
</head>
426
<body id="auth_authorities" class="auth">
431
<body id="auth_authorities" class="auth">
427
432
428
- 

Return to bug 29825