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 91-146 Link Here
91
            f.authtypecode.value = authtypecode;
91
            f.authtypecode.value = authtypecode;
92
            f.submit();
92
            f.submit();
93
        });
93
        });
94
        $('#preview').click(function (){
94
        $("#preview").click(function () {
95
            var content="<h3>Authority #: [% authid %]</h3><hr>";
95
            var content = "<h3>Authority #: [% authid | html %]</h3><hr>";
96
            content+="<div style='color:#004d99;'>";
96
            content += "<div style=\"color:#004d99;\">";
97
            var line=1;
97
            var line = 1;
98
            var has_input=0;
98
            var has_input = 0;
99
            var sf_has_input=0;
99
            var sf_has_input = 0;
100
            $("#authoritytabs").find("[id^=tag_]").each(function(){
100
            $("#authoritytabs").find("[id^=tag_]").each(function () {
101
                //check if tag has content
101
                //check if tag has content
102
                has_input=0;
102
                has_input = 0;
103
                $(this).find(".input_marceditor").each(function(){
103
                $(this).find(".input_marceditor").each(function () {
104
                    if($(this).val()) has_input=1;
104
                    if ($(this).val()) has_input = 1;
105
                });
105
                });
106
106
107
                if(has_input){
107
                if (has_input) {
108
                    line=1;
108
                    line = 1;
109
                    //tag
109
                    //tag
110
                    var $tag = $(this).find(".tagnum").text();
110
                    var $tag = $(this).find(".tagnum").text();
111
                    content += $tag.replace("*",") +"&nbsp;&nbsp;";
111
                    content += $tag.replace("*", "") + "&nbsp;&nbsp;";
112
                    //indicators
112
                    //indicators
113
                    $(this).find(".indicator").each(function(){
113
                    $(this).find(".indicator").each(function () {
114
                        if( $(this).val() ) content += $(this).val();
114
                        if ($(this).val()) content += $(this).val();
115
                        else content += "_";
115
                        else content += "_";
116
                    });
116
                    });
117
                    content += "&nbsp;&nbsp;";
117
                    content += "&nbsp;&nbsp;";
118
                    //subfields
118
                    //subfields
119
                    $(this).find(".subfield_line").each(function(){
119
                    $(this).find(".subfield_line").each(function () {
120
                        //check if subfield has content
120
                        //check if subfield has content
121
                        sf_has_input=0;
121
                        sf_has_input = 0;
122
                        $(this).find(".input_marceditor").each(function(){
122
                        $(this).find(".input_marceditor").each(function () {
123
                            if($(this).val()) sf_has_input=1;
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
                        });
124
                        });
138
                        content+="</br>";
125
                        if (sf_has_input) {
139
                        line+=1;
126
                            if (line > 1) content += "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
140
                    }
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
                    });
141
                }
142
                }
142
            });
143
            });
143
         });
144
            $("#auloadpreview").html( content );
145
            $("#auEditPreview").modal();
146
        });
144
    });
147
    });
145
148
146
    function selectTab( tablink ){
149
    function selectTab( tablink ){
Lines 305-311 Link Here
305
    }
308
    }
306
</script>
309
</script>
307
[% Asset.css("css/addbiblio.css") | $raw %]
310
[% Asset.css("css/addbiblio.css") | $raw %]
308
311
<style>
312
    #auloadpreview { font-family: monospace; }
313
</style>
309
</head>
314
</head>
310
<body id="auth_authorities" class="auth">
315
<body id="auth_authorities" class="auth">
311
316
312
- 

Return to bug 29825