From c11d2bf06f9751afcaa6ba5d19b9448f8a547610 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 9 Aug 2010 15:24:29 -0400 Subject: [PATCH] Proposed fix for Bug 5106 - Simplify MARC view choices in the OPAC - Eliminates the "Extended MARC View" tab - Points the "MARC View" tab to opac-MARCDetail.pl as it is when XSLT is off - Offers a "view plain" link on opac-MARCDetail.pl. Clicking this link would replace the standard labeled MARC view with an unformatted view similar to the one displayed in the pop-up modal MARC view. - When viewing the "plain view," clicking the "view labeled" link will return you to the standard labeled MARC view. - Adds a new XSL file for displaying MARC data in a slightly-more-formatted manner (compared to one big
 block).
---
 koha-tmpl/opac-tmpl/prog/en/css/opac.css           |    5 +-
 .../opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl |   22 +---
 .../opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl |  107 +++++++++++++-------
 .../opac-tmpl/prog/en/modules/opac-detail.tmpl     |    8 --
 .../prog/en/xslt/MARC21slim2OPACDetail.xsl         |    5 +-
 .../prog/en/xslt/MARC21slim2OPACMARCdetail.xsl     |   55 ++++++++++
 opac/opac-showmarc.pl                              |   35 +++++--
 7 files changed, 158 insertions(+), 79 deletions(-)
 create mode 100644 koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACMARCdetail.xsl

diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css
index 5142dd2..83acdbd 100644
--- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css
+++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css
@@ -1957,4 +1957,7 @@ div.ft {
 	font-size:90%;
 	list-style:disc outside url("../../images/item-bullet.gif");
 	padding:0.2em 0;
-}
\ No newline at end of file
+}
+#plainmarc table { margin: .7em 0 0 0; font-family: monospace; font-size: 95%; }
+#plainmarc th { white-space: nowrap; text-align:left; vertical-align: top; padding: 2px; }
+#plainmarc td { padding : 2px; vertical-align: top; }
\ No newline at end of file
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl
index 039e2ea..ab4a776 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl
@@ -7,14 +7,6 @@
 	}); 
 //]]>
 
-
-
-
-
-
-
 
 
 
@@ -24,21 +16,17 @@
 
 
     
-
+
+ diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl index 319d0d7..5a0d04e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl @@ -1,12 +1,43 @@ Koha Online Catalog › MARC Details for Record No. - - - - - @@ -15,28 +46,25 @@
-
-

MARC View

-
- ">Normal View - - -" title="MARC" rel="gb_page_center[600,500]">MARC View - Expanded MARC View - -MARC View - +

MARC View

+ -

(Record no. )

- +

(Record no. )

+ + +
+
+
@@ -136,9 +164,10 @@
+
- + + + + + + + + + + + + + + + + + + _ + +
+
+ + \ No newline at end of file diff --git a/opac/opac-showmarc.pl b/opac/opac-showmarc.pl index 7eb934e..c9ae256 100755 --- a/opac/opac-showmarc.pl +++ b/opac/opac-showmarc.pl @@ -63,17 +63,30 @@ if ($importid) { } if ($view eq 'card') { -$xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord; -my $xslfile = C4::Context->config('opachtdocs')."/prog/en/xslt/compact.xsl"; -my $parser = XML::LibXML->new(); -my $xslt = XML::LibXSLT->new(); -my $source = $parser->parse_string($xmlrecord); -my $style_doc = $parser->parse_file($xslfile); -my $stylesheet = $xslt->parse_stylesheet($style_doc); -my $results = $stylesheet->transform($source); -my $newxmlrecord = $stylesheet->output_string($results); -#warn $newxmlrecord; -print $input->header(), $newxmlrecord; + $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord; + my $xslfile = C4::Context->config('opachtdocs')."/prog/en/xslt/compact.xsl"; + my $parser = XML::LibXML->new(); + my $xslt = XML::LibXSLT->new(); + my $source = $parser->parse_string($xmlrecord); + my $style_doc = $parser->parse_file($xslfile); + my $stylesheet = $xslt->parse_stylesheet($style_doc); + my $results = $stylesheet->transform($source); + my $newxmlrecord = $stylesheet->output_string($results); + #warn $newxmlrecord; + print $input->header(), $newxmlrecord; + exit; +} elsif ($view eq 'html'){ + $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord; + my $xslfile = C4::Context->config('opachtdocs')."/prog/en/xslt/MARC21slim2OPACMARCdetail.xsl"; + my $parser = XML::LibXML->new(); + my $xslt = XML::LibXSLT->new(); + my $source = $parser->parse_string($xmlrecord); + my $style_doc = $parser->parse_file($xslfile); + my $stylesheet = $xslt->parse_stylesheet($style_doc); + my $results = $stylesheet->transform($source); + my $newxmlrecord = $stylesheet->output_string($results); + #warn $newxmlrecord; + print $input->header(), $newxmlrecord; exit; } else { $record =GetMarcBiblio($biblionumber) unless $record; -- 1.7.0.4
CopiesCopies
@@ -157,23 +186,23 @@ -
-
+
+
-
-
- - + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl index b1fdf84..d369173 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -47,14 +47,6 @@ YAHOO.util.Event.onContentReady("furtherm", function () { - - - - - - diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl index 3572379..628cbce 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -170,10 +170,9 @@ diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACMARCdetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACMARCdetail.xsl new file mode 100644 index 0000000..ee4058a --- /dev/null +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACMARCdetail.xsl @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + +
+ 000 + + +
+
+ + +
+ + + +
+ +