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

(-)a/catalogue/showmarc.pl (-2 / +8 lines)
Lines 54-63 if(!ref $record) { Link Here
54
    exit;
54
    exit;
55
}
55
}
56
56
57
if($view eq 'card') {
57
if($view eq 'card' || $view eq 'html') {
58
    my $xml = $importid ? $record->as_xml(): GetXmlBiblio($biblionumber);
58
    my $xml = $importid ? $record->as_xml(): GetXmlBiblio($biblionumber);
59
    my $xsl = C4::Context->preference('marcflavour') eq 'UNIMARC'
59
    my $xsl;
60
    if ( $view eq 'card' ){
61
        $xsl = C4::Context->preference('marcflavour') eq 'UNIMARC'
60
              ? 'UNIMARC_compact.xsl' : 'compact.xsl';
62
              ? 'UNIMARC_compact.xsl' : 'compact.xsl';
63
    }
64
    else {
65
        $xsl = 'plainMARC.xsl';
66
    }
61
    my $htdocs = C4::Context->config('intrahtdocs');
67
    my $htdocs = C4::Context->config('intrahtdocs');
62
    my ($theme, $lang) = C4::Templates::themelanguage($htdocs, $xsl, 'intranet', $input);
68
    my ($theme, $lang) = C4::Templates::themelanguage($htdocs, $xsl, 'intranet', $input);
63
    $xsl = "$htdocs/$theme/$lang/xslt/$xsl";
69
    $xsl = "$htdocs/$theme/$lang/xslt/$xsl";
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css (+7 lines)
Lines 1724-1729 span.permissiondesc { Link Here
1724
	color: black;
1724
	color: black;
1725
}
1725
}
1726
1726
1727
#marcPreview table { border: 0; margin: .7em 0 0 0; font-family: monospace; font-size: 95%; }
1728
#marcPreview th { background-color : #FFF; border: 0; white-space: nowrap; text-align:left; vertical-align: top; padding: 2px; }
1729
#marcPreview td { border: 0; padding : 2px; vertical-align: top; }
1730
#marcPreview tbody tr:nth-child(2n+1) td { background-color: #FFF; }
1731
#marcPreview { width : 80%; margin-left : -40%; }
1732
@media (max-width: 767px) { #marcPreview { margin: 0; width : auto; } }
1733
1727
#cartDetails {
1734
#cartDetails {
1728
	background-color : #FFF;
1735
	background-color : #FFF;
1729
	border: 1px solid #739acf;
1736
	border: 1px solid #739acf;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-2 / +22 lines)
Lines 175-180 function verify_images() { Link Here
175
    [% IF ( LocalCoverImages && ! localimages.0 ) %]
175
    [% IF ( LocalCoverImages && ! localimages.0 ) %]
176
        showNoImageMessage();
176
        showNoImageMessage();
177
    [% END %]
177
    [% END %]
178
        $("body").on("click",".previewMARC", function(e){
179
            e.preventDefault();
180
            var page = $(this).attr("href");
181
            $("#marcPreview .modal-body").load(page + " table");
182
            $('#marcPreview').modal({show:true});
183
        });
184
        $("#marcPreview").on("hidden", function(){
185
            $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
186
        });
178
    });
187
    });
179
188
180
     [% IF ( AmazonCoverImages ) %]$(window).load(function() {
189
     [% IF ( AmazonCoverImages ) %]$(window).load(function() {
Lines 363-369 function verify_images() { Link Here
363
                    [% END %]
372
                    [% END %]
364
                    </span>
373
                    </span>
365
        [% END %]
374
        [% END %]
366
        <span id="catalogue_detail_marc_preview" class="results_summary"><span class="label">MARC Preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Show</a></span>
375
        <span id="catalogue_detail_marc_preview" class="results_summary"><span class="label">MARC Preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]&amp;viewas=html" title="MARC" class="previewMARC">Show</a></span>
367
        [% IF ( holdcount ) %]<span class="results_summary"><span class="label">Holds:</span> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></span>[% ELSE %][% END %]
376
        [% IF ( holdcount ) %]<span class="results_summary"><span class="label">Holds:</span> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></span>[% ELSE %][% END %]
368
377
369
        [% IF ( AmazonCoverImages ) %]</div><div class="yui-u" id="bookcoverimg">
378
        [% IF ( AmazonCoverImages ) %]</div><div class="yui-u" id="bookcoverimg">
Lines 1009-1015 function verify_images() { Link Here
1009
</form>
1018
</form>
1010
</div>
1019
</div>
1011
1020
1012
1021
<div id="marcPreview" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="marcPreviewLabel" aria-hidden="true">
1022
    <div class="modal-header">
1023
        <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
1024
        <h3 id="marcPreviewLabel">MARC preview</h3>
1025
    </div>
1026
    <div class="modal-body">
1027
        <div id="loading"> <img src="[% interface %]/[% theme %]/img/loading-small.gif" alt="" /> Loading </div>
1028
    </div>
1029
    <div class="modal-footer">
1030
        <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
1031
    </div>
1032
</div>
1013
1033
1014
</div>
1034
</div>
1015
</div>
1035
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/xslt/plainMARC.xsl (-1 / +59 lines)
Line 0 Link Here
0
- 
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
3
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
4
    <xsl:output method="html" encoding="UTF-8"/>
5
6
    <xsl:template match="/">
7
        <html>
8
          <head><title>MARC View</title></head>
9
          <body>
10
           <xsl:apply-templates/>
11
          </body>
12
        </html>
13
    </xsl:template>
14
15
    <xsl:template match="marc:record">
16
        <table>
17
            <tr>
18
                <th style="white-space:nowrap">
19
                    000
20
                </th>
21
                <td colspan="2"></td>
22
                <td>
23
                    <xsl:value-of select="marc:leader"/>
24
                </td>
25
            </tr>
26
            <xsl:apply-templates select="marc:datafield|marc:controlfield"/>
27
        </table>
28
    </xsl:template>
29
30
    <xsl:template match="marc:controlfield">
31
        <tr>
32
            <th style="white-space:nowrap">
33
                <xsl:value-of select="@tag"/>
34
            </th>
35
            <td colspan="2"></td>
36
            <td>
37
                <xsl:value-of select="."/>
38
            </td>
39
        </tr>
40
    </xsl:template>
41
42
    <xsl:template match="marc:datafield">
43
        <tr>
44
            <th style="white-space:nowrap">
45
                <xsl:value-of select="@tag"/>
46
            </th>
47
            <td><xsl:value-of select="@ind1"/></td>
48
            <td><xsl:value-of select="@ind2"/></td>
49
            <td><xsl:apply-templates select="marc:subfield"/></td>
50
        </tr>
51
    </xsl:template>
52
53
    <xsl:template match="marc:subfield">
54
        <strong>_<xsl:value-of select="@code"/></strong> <xsl:value-of select="."/>
55
        <xsl:choose>
56
        <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when><xsl:otherwise><br /></xsl:otherwise></xsl:choose>
57
    </xsl:template>
58
59
</xsl:stylesheet>

Return to bug 13151