From f4e2b957bd8136331719835a0c130a1a560b6104 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 9 Aug 2010 15:24:29 -0400 Subject: [PATCH] [SIGNED-OFF] Proposed fix for Bug 5106 - Simplify MARC view choices in the OPAC (Conflict marker fix) Content-Type: text/plain; charset="utf-8" - 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 replaces 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).

Removed a conflict marker line from Owen's patch (Marcel).

Signed-off-by: Marcel de Rooy 
---
 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 |  104 ++++++++++++--------
 .../opac-tmpl/prog/en/modules/opac-detail.tmpl     |    8 --
 .../prog/en/xslt/MARC21slim2OPACDetail.xsl         |    5 +-
 opac/opac-showmarc.pl                              |   35 +++++--
 6 files changed, 100 insertions(+), 79 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css
index bfff594..68cc572 100644
--- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css
+++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css
@@ -2000,3 +2000,8 @@ div.ft {
 	background-color : rgb(239, 254, 213);
 	background-color : rgba(239, 254, 213, 0.4);
 }
+
+#plainmarc table { border: 0; margin: .7em 0 0 0; font-family: monospace; font-size: 95%; }
+#plainmarc th { background-color : #FFF; border: 0; white-space: nowrap; text-align:left; vertical-align: top; padding: 2px; }
+#plainmarc td { border: 0; padding : 2px; vertical-align: top; }
+
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 475d681..305dfce 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl
@@ -21,14 +21,6 @@
      });
 //]]>
 
-
-
-
-
-
-
 
 
 
@@ -38,21 +30,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 8f5182e..fba0c08 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl @@ -17,16 +17,42 @@ YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionfurthersearchesMenu); }); - var GB_ROOT_DIR = "/opac-tmpl/prog/en/lib/greybox/"; +$(document).ready(function(){ + $.ajaxSetup({ + error:function(x,e){ + switch (x.status) { + case 200: break; + default: + $('#switchview').parent().html("
"+_("Sorry, plain view is temporarily unavailable")+".
"); + $("#plainmarc").hide(); + $("#labeledmarc").show(); + break; + } + } + }); + + var loaded = 0; + $("#switchview").toggle( + function () { + $(this).text(_("view labeled")); + $("#labeledmarc").hide(); + if(!loaded){ + $("#plainmarc").show().html("
"+_("Loading")+"...
").load("/cgi-bin/koha/opac-showmarc.pl","id=&viewas=html"); + loaded = 1; + } else { + $("#plainmarc").show(); + } + }, + function () { + $(this).text(_("view plain")); + $("#labeledmarc").show(); + $("#plainmarc").hide(); + } + ); +}); //]]> - - - - - - @@ -34,28 +60,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. )

+ + +
+
+
@@ -155,9 +178,10 @@
+
- +
CopiesCopies
@@ -176,23 +200,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 e83ea3a..931153b 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 24326f2..5703059 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -181,10 +181,9 @@ diff --git a/opac/opac-showmarc.pl b/opac/opac-showmarc.pl index b379917..9c70d56 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.6.0.6