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

(-)a/koha-tmpl/opac-tmpl/prog/en/css/opac.css (+4 lines)
Lines 2000-2002 div.ft { Link Here
2000
	background-color : rgb(239, 254, 213);
2000
	background-color : rgb(239, 254, 213);
2001
	background-color : rgba(239, 254, 213, 0.4);
2001
	background-color : rgba(239, 254, 213, 0.4);
2002
}
2002
}
2003
#plainmarc table { border: 0; margin: .7em 0 0 0; font-family: monospace; font-size: 95%; }
2004
#plainmarc th { background-color : #FFF; border: 0; white-space: nowrap; text-align:left; vertical-align: top; padding: 2px; }
2005
#plainmarc td { border: 0; padding : 2px; vertical-align: top; }
2006
>>>>>>> Proposed fix for Bug 5106 - Simplify MARC view choices in the OPAC
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl (-17 / +5 lines)
Lines 21-34 Link Here
21
     });
21
     });
22
//]]>
22
//]]>
23
</script>
23
</script>
24
<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" --><script type="text/javascript">
25
    var GB_ROOT_DIR = "/opac-tmpl/prog/en/lib/greybox/";
26
</script>
27
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/AJS.js"></script>
28
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/AJS_fx.js"></script>
29
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/gb_scripts.js"></script>
30
<link href="/opac-tmpl/prog/en/lib/greybox/gb_styles.css" rel="stylesheet" type="text/css" />
31
<!-- /TMPL_IF -->
32
</head>
24
</head>
33
<body id="opac-isbddetail">
25
<body id="opac-isbddetail">
34
26
Lines 38-58 Link Here
38
30
39
31
40
    <div id="yui-main">
32
    <div id="yui-main">
41
    <div class="yui-b"><div id="opac-detail" class="yui-ge">
33
    <div class="yui-b">
34
    <div id="opac-detail" class="yui-ge">
42
    <div class="yui-u first">
35
    <div class="yui-u first">
43
    <div class="container">
36
    <div class="container">
44
    <div id="catalogue_detail_biblio">
37
    <div id="catalogue_detail_biblio">
45
	
38
	
46
     <h1 style="float:left;margin:0 1em 1em 0;">ISBD View</h1> <div id="views">
39
     <h1 style="float:left;margin:0 1em 1em 0;">ISBD View</h1> <div id="views">
47
	 <span class="view"><a id="Normalview" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">Normal View</a></span> <!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" -->
40
	 <span class="view"><a id="Normalview" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">Normal View</a></span> <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">MARC View</a></span> <span class="view"><span id="ISBDview">ISBD View</span></span></div>
48
<span class="view"><a id="MARCviewPop" href="/cgi-bin/koha/opac-showmarc.pl?id=<!-- TMPL_VAR NAME="biblionumber" -->" title="MARC" rel="gb_page_center[600,500]">MARC View</a></span>
41
49
       <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">Expanded MARC View</a></span>
50
<!-- TMPL_ELSE -->
51
<span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">MARC View</a></span>
52
<!-- /TMPL_IF --> <span class="view"><span id="ISBDview">ISBD View</span></span>
53
</div>
54
    <div id="isbdcontents"><!-- TMPL_VAR name="ISBD" --></div>
42
    <div id="isbdcontents"><!-- TMPL_VAR name="ISBD" --></div>
55
	
43
56
	</div>
44
	</div>
57
	</div>
45
	</div>
58
	</div>
46
	</div>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl (-40 / +64 lines)
Lines 17-32 Link Here
17
            YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionfurthersearchesMenu);
17
            YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionfurthersearchesMenu);
18
     });
18
     });
19
<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" -->
19
<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" -->
20
    var GB_ROOT_DIR = "/opac-tmpl/prog/en/lib/greybox/";
20
$(document).ready(function(){
21
    $.ajaxSetup({
22
        error:function(x,e){
23
            switch (x.status) {
24
                case 200: break;
25
                default:
26
                $('#switchview').parent().html("<div class=\"dialog alert\">"+_("Sorry, plain view is temporarily unavailable")+".</div>");
27
                $("#plainmarc").hide();
28
                $("#labeledmarc").show();
29
                break;
30
            }
31
        }
32
    });
33
34
    var loaded = 0;
35
    $("#switchview").toggle(
36
      function () {
37
        $(this).text(_("view labeled"));
38
        $("#labeledmarc").hide();
39
        if(!loaded){
40
            $("#plainmarc").show().html("<div style=\"margin:1em;padding:1em;border:1px solid #EEE;font-size:150%;\"><img src=\"/opac-tmpl/prog/images/loading.gif\" /> "+_("Loading")+"...</div>").load("/cgi-bin/koha/opac-showmarc.pl","id=<!-- TMPL_VAR name="biblionumber" -->&viewas=html");
41
            loaded = 1;
42
        } else {
43
            $("#plainmarc").show();
44
        }
45
      },
46
      function () {
47
        $(this).text(_("view plain"));
48
        $("#labeledmarc").show();
49
        $("#plainmarc").hide();
50
      }
51
    );
52
});
21
<!-- /TMPL_IF -->
53
<!-- /TMPL_IF -->
22
//]]>
54
//]]>
23
</script>
55
</script>
24
<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" -->
25
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/AJS.js"></script>
26
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/AJS_fx.js"></script>
27
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/gb_scripts.js"></script>
28
<link href="/opac-tmpl/prog/en/lib/greybox/gb_styles.css" rel="stylesheet" type="text/css" />
29
<!-- /TMPL_IF -->
30
</head>
56
</head>
31
<body id="opac-marcdetail">
57
<body id="opac-marcdetail">
32
58
Lines 34-61 Link Here
34
   <div id="bd">
60
   <div id="bd">
35
<!--TMPL_INCLUDE NAME="masthead.inc" -->
61
<!--TMPL_INCLUDE NAME="masthead.inc" -->
36
62
37
38
    <div id="yui-main">
63
    <div id="yui-main">
39
    <div class="yui-b"><div id="opac-detail" class="yui-ge">
64
    <div class="yui-b"><div id="opac-detail" class="yui-ge">
40
    <div class="yui-u first">
65
    <div class="yui-u first">
41
    <div class="container">
66
    <div class="container">
42
    <div id="catalogue_detail_biblio">
67
    <div id="catalogue_detail_biblio">
43
68
44
	<h1 style="float:left;margin: 0 1em 1em 0;">MARC View</h1>
69
    <h2 style="float:left;margin: 0 1em 1em 0;">MARC View</h2>
45
	<div id="views">
70
    <div id="views">
46
	<span class="view"><a id="Normalview" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">Normal View</a></span> 
71
    <span class="view"><a id="Normalview" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">Normal View</a></span> 
47
48
<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" -->
49
<span class="view"><a id="MARCviewPop" href="/cgi-bin/koha/opac-showmarc.pl?id=<!-- TMPL_VAR NAME="biblionumber" -->" title="MARC" rel="gb_page_center[600,500]">MARC View</a></span>
50
        <span class="view"><span id="MARCview">Expanded MARC View</span></span>
51
<!-- TMPL_ELSE -->
52
<span class="view"><span id="MARCview">MARC View</span>
53
<!-- /TMPL_IF -->
54
72
55
 <!-- TMPL_IF NAME="ISBD" --><span class="view"><a id="ISBDview"  href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">ISBD View</a></span><!-- /TMPL_IF -->
73
<span class="view"><span id="MARCview">MARC View</span></span>
74
<!-- TMPL_IF NAME="ISBD" --><span class="view"><a id="ISBDview"  href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">ISBD View</a></span><!-- /TMPL_IF -->
56
</div>
75
</div>
57
    <h1 style="clear:both;"><!-- TMPL_VAR NAME="bibliotitle" --> (Record no. <!-- TMPL_VAR NAME="biblionumber" -->)</h1>
76
    <h3 style="clear:both;"><!-- TMPL_VAR NAME="bibliotitle" --> (Record no. <!-- TMPL_VAR NAME="biblionumber" -->)</h3>
58
	<table id="marc">
77
    <!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" -->
78
    <div>[ <a id="switchview" href="/cgi-bin/koha/opac-showmarc.pl?id=<!-- TMPL_VAR NAME="biblionumber" -->&amp;viewas=html">view plain</a> ]</div>
79
    <div id="plainmarc"></div><!-- /TMPL_IF -->
80
    <div id="labeledmarc">
81
    <table id="marc">
59
        <!-- TMPL_LOOP name="0XX" -->
82
        <!-- TMPL_LOOP name="0XX" -->
60
        <tr><th colspan="2"><!-- TMPL_VAR name="tag" --></th></tr>
83
        <tr><th colspan="2"><!-- TMPL_VAR name="tag" --></th></tr>
61
        <!-- TMPL_LOOP name="subfield" -->
84
        <!-- TMPL_LOOP name="subfield" -->
Lines 155-163 Link Here
155
            <!-- /TMPL_LOOP -->
178
            <!-- /TMPL_LOOP -->
156
        <!-- /TMPL_LOOP -->
179
        <!-- /TMPL_LOOP -->
157
    </table>
180
    </table>
181
    </div>
158
<!-- TMPL_IF NAME="item_header_loop" -->
182
<!-- TMPL_IF NAME="item_header_loop" -->
159
        <table id="items">
183
        <table id="items">
160
			<caption>Copies</caption>
184
            <caption>Copies</caption>
161
                <tr>
185
                <tr>
162
                    <!-- TMPL_LOOP name="item_header_loop" -->
186
                    <!-- TMPL_LOOP name="item_header_loop" -->
163
                        <th>
187
                        <th>
Lines 176-198 Link Here
176
    </div>
200
    </div>
177
    </div>
201
    </div>
178
    </div>
202
    </div>
179
	<div class="yui-u">
203
    <div class="yui-u">
180
	<div class="container">
204
    <div class="container">
181
<ul id="action">
205
<ul id="action">
182
206
183
<!-- TMPL_UNLESS NAME="norequests" -->
207
<!-- TMPL_UNLESS NAME="norequests" -->
184
        <!-- TMPL_IF NAME="opacuserlogin" -->
208
        <!-- TMPL_IF NAME="opacuserlogin" -->
185
		<!-- TMPL_IF NAME="RequestOnOpac" -->
209
        <!-- TMPL_IF NAME="RequestOnOpac" -->
186
			<!-- TMPL_IF NAME="AllowOnShelfHolds" -->
210
            <!-- TMPL_IF NAME="AllowOnShelfHolds" -->
187
				<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a></li>
211
                <li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a></li>
188
			<!-- TMPL_ELSE -->
212
            <!-- TMPL_ELSE -->
189
				<!-- TMPL_IF NAME="ItemsIssued" -->
213
                <!-- TMPL_IF NAME="ItemsIssued" -->
190
					<li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a></li>
214
                    <li><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a></li>
191
				<!-- /TMPL_IF -->
215
                <!-- /TMPL_IF -->
192
			<!-- /TMPL_IF -->
216
            <!-- /TMPL_IF -->
193
217
194
        	<!-- /TMPL_IF -->
218
            <!-- /TMPL_IF -->
195
	<!-- /TMPL_IF -->
219
    <!-- /TMPL_IF -->
196
<!-- /TMPL_UNLESS -->
220
<!-- /TMPL_UNLESS -->
197
        <li><a class="print" href="/cgi-bin/koha/opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
221
        <li><a class="print" href="/cgi-bin/koha/opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
198
            Print
222
            Print
Lines 223-233 Link Here
223
</div>
247
</div>
224
<!-- /TMPL_IF -->
248
<!-- /TMPL_IF -->
225
249
226
		<div id="export">
250
        <div id="export">
227
		<form method="get" action="/cgi-bin/koha/opac-export.pl">
251
        <form method="get" action="/cgi-bin/koha/opac-export.pl">
228
		<label for="format">Save Record:</label>
252
        <label for="format">Save Record:</label>
229
	    <select name="format" id="format">
253
        <select name="format" id="format">
230
		<option value="">-- Choose Format --</option>
254
        <option value="">-- Choose Format --</option>
231
        <option value="mods">MODS (XML)</option>
255
        <option value="mods">MODS (XML)</option>
232
        <option value="dc">Dublin Core (XML)</option>
256
        <option value="dc">Dublin Core (XML)</option>
233
        <option value="marcxml">MARCXML</option>
257
        <option value="marcxml">MARCXML</option>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl (-8 lines)
Lines 47-60 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
47
<style type="text/css">
47
<style type="text/css">
48
    #addtagl { display: none; }
48
    #addtagl { display: none; }
49
</style>
49
</style>
50
<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" --><script type="text/javascript">
51
    var GB_ROOT_DIR = "/opac-tmpl/prog/en/lib/greybox/";                               
52
</script>
53
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/AJS.js"></script>
54
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/AJS_fx.js"></script>
55
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/gb_scripts.js"></script>
56
<link href="/opac-tmpl/prog/en/lib/greybox/gb_styles.css" rel="stylesheet" type="text/css" />
57
<!-- /TMPL_IF -->
58
50
59
</head>
51
</head>
60
<body id="opac-detail">
52
<body id="opac-detail">
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl (-3 / +2 lines)
Lines 181-190 Link Here
181
        </xsl:choose>
181
        </xsl:choose>
182
        <div id="views">
182
        <div id="views">
183
        <span class="view"><span id="Normalview">Normal View</span> </span>
183
        <span class="view"><span id="Normalview">Normal View</span> </span>
184
        <span class="view"><a id="MARCviewPop" href="/cgi-bin/koha/opac-showmarc.pl?id={marc:datafield[@tag=999]/marc:subfield[@code='c']}" title="MARC" rel="gb_page_center[600,500]">MARC View</a></span>
184
        <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber={marc:datafield[@tag=999]/marc:subfield[@code='c']}" title="MARC">MARC View</a></span>
185
        <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber={marc:datafield[@tag=999]/marc:subfield[@code='c']}" title="MARC">Expanded MARC View</a></span>
186
<xsl:if test="$ShowISBD!='0'">
185
<xsl:if test="$ShowISBD!='0'">
187
        <span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber={marc:datafield[@tag=999]/marc:subfield[@code='c']}">Card View (ISBD)</a></span>
186
        <span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber={marc:datafield[@tag=999]/marc:subfield[@code='c']}">ISBD View</a></span>
188
</xsl:if>
187
</xsl:if>
189
        </div>
188
        </div>
190
189
(-)a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACMARCdetail.xsl (+55 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3
	<xsl:output method="html"/>
4
5
	<xsl:template match="/">
6
		<html>
7
			<xsl:apply-templates/>
8
		</html>
9
	</xsl:template>
10
11
	<xsl:template match="marc:record">
12
		<table>
13
			<tr>
14
				<th style="white-space:nowrap">
15
					000
16
				</th>
17
				<td colspan="2"></td>
18
				<td>
19
					<xsl:value-of select="marc:leader"/>
20
				</td>
21
			</tr>
22
			<xsl:apply-templates select="marc:datafield|marc:controlfield"/>
23
		</table>
24
	</xsl:template>
25
26
	<xsl:template match="marc:controlfield">
27
		<tr>
28
			<th style="white-space:nowrap">
29
				<xsl:value-of select="@tag"/>
30
			</th>
31
			<td colspan="2"></td>
32
			<td>
33
				<xsl:value-of select="."/>
34
			</td>
35
		</tr>
36
	</xsl:template>
37
38
	<xsl:template match="marc:datafield">
39
		<tr>
40
			<th style="white-space:nowrap">
41
				<xsl:value-of select="@tag"/>
42
			</th>
43
			<td><xsl:value-of select="@ind1"/></td>
44
			<td><xsl:value-of select="@ind2"/></td>
45
			<td><xsl:apply-templates select="marc:subfield"/></td>
46
		</tr>
47
	</xsl:template>
48
49
	<xsl:template match="marc:subfield">
50
		<strong>_<xsl:value-of select="@code"/></strong> <xsl:value-of select="."/>
51
		<xsl:choose>
52
		<xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when><xsl:otherwise><br /></xsl:otherwise></xsl:choose>
53
	</xsl:template>
54
55
</xsl:stylesheet>
(-)a/opac/opac-showmarc.pl (-12 / +24 lines)
Lines 63-79 if ($importid) { Link Here
63
}
63
}
64
		
64
		
65
if ($view eq 'card') {
65
if ($view eq 'card') {
66
$xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord;
66
    $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord;
67
my $xslfile = C4::Context->config('opachtdocs')."/prog/en/xslt/compact.xsl";
67
    my $xslfile = C4::Context->config('opachtdocs')."/prog/en/xslt/compact.xsl";
68
my $parser = XML::LibXML->new();
68
    my $parser = XML::LibXML->new();
69
my $xslt   = XML::LibXSLT->new();
69
    my $xslt   = XML::LibXSLT->new();
70
my $source = $parser->parse_string($xmlrecord);
70
    my $source = $parser->parse_string($xmlrecord);
71
my $style_doc = $parser->parse_file($xslfile);
71
    my $style_doc = $parser->parse_file($xslfile);
72
my $stylesheet = $xslt->parse_stylesheet($style_doc);
72
    my $stylesheet = $xslt->parse_stylesheet($style_doc);
73
my $results = $stylesheet->transform($source);
73
    my $results = $stylesheet->transform($source);
74
my $newxmlrecord = $stylesheet->output_string($results);
74
    my $newxmlrecord = $stylesheet->output_string($results);
75
#warn $newxmlrecord;
75
    #warn $newxmlrecord;
76
print $input->header(), $newxmlrecord;
76
    print $input->header(), $newxmlrecord;
77
    exit;
78
} elsif ($view eq 'html'){
79
    $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord;
80
    my $xslfile = C4::Context->config('opachtdocs')."/prog/en/xslt/MARC21slim2OPACMARCdetail.xsl";
81
    my $parser = XML::LibXML->new();
82
    my $xslt   = XML::LibXSLT->new();
83
    my $source = $parser->parse_string($xmlrecord);
84
    my $style_doc = $parser->parse_file($xslfile);
85
    my $stylesheet = $xslt->parse_stylesheet($style_doc);
86
    my $results = $stylesheet->transform($source);
87
    my $newxmlrecord = $stylesheet->output_string($results);
88
    #warn $newxmlrecord;
89
    print $input->header(), $newxmlrecord;
77
    exit;
90
    exit;
78
} else {
91
} else {
79
    $record =GetMarcBiblio($biblionumber) unless $record; 
92
    $record =GetMarcBiblio($biblionumber) unless $record; 
80
- 

Return to bug 5106