From 3f0eeb9c28691e079da1b1a009502b7ee674165e Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 20 Dec 2010 20:11:26 +0100 Subject: [PATCH] Proposed fix for Bug 5106 - Simplify MARC view choices in the OPAC (Conflict marker fix 2nd try) - 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 
Signed-off-by: Chris Cormack 
---
 koha-tmpl/opac-tmpl/prog/en/css/opac.css      |   5 +
 .../prog/en/modules/opac-ISBDdetail.tmpl      |  22 +---
 .../prog/en/modules/opac-MARCdetail.tmpl      | 104 +++++++++++-------
 .../prog/en/modules/opac-detail.tmpl          |   8 --
 .../prog/en/xslt/MARC21slim2OPACDetail.xsl    |   5 +-
 .../en/xslt/MARC21slim2OPACMARCdetail.xsl     |  55 +++++++++
 koha-tmpl/opac-tmpl/prog/images/loading.gif   | Bin 0 -> 3208 bytes
 opac/opac-showmarc.pl                         |  35 ++++--
 8 files changed, 155 insertions(+), 79 deletions(-)
 create mode 100644 koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACMARCdetail.xsl
 create mode 100644 koha-tmpl/opac-tmpl/prog/images/loading.gif

diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css
index bfff594be2..68cc572a2f 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 475d681ebf..305dfced89 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 8f5182e37e..fba0c08c24 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 @@
+
- + + + + + + + + + + + + + + + + + + _ + +
+
+ + \ No newline at end of file diff --git a/koha-tmpl/opac-tmpl/prog/images/loading.gif b/koha-tmpl/opac-tmpl/prog/images/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..3c2f7c058836808f7f1f5f9a4bdf37d4e5f9284a GIT binary patch literal 3208 zcmc(ic~Dc=9>*`aOO|`};l05I0veErPzymNWmO?SfPgFlg5pAq3huH91c9)G1Y`|i z4JZjDhG<1Z5!{L(f?6D`8``H2sCB`;j(xVT^L)Wphk5_LnZEPqnRDmP=X1Wl@66!` z`n$Ttvj7(G763kc_y7RFrAwCz3JSWqx*8f9xLj^@boA)x=);E(&z?OyXU-f5f{bVW zSl0ix;3aK}PuV15r6r~$u;RDIr*GdCFLF%Wxp^00{VN2}j0dehpey_$SMt2W{1!QK zKojHE!m014ehNU3O@{&#81Ry?oX#6DZ$$v0J3e>A35z_WBvJ<_#BKo;WU| zlhe}qUa=5u3mwW&3lJ7s?M1x36dY=FTw|QvgGz$IR&C=!53NBJpfA=OKGM`_RmbT% znZm9NNG{r+6zds~vIJC01Jq2Sfd~xI=Y0{MfaQy zn2ZzlCpfx2_e$RKF6Y3;lDC^Ctng6>y!>|IX5edIqlS+PO-?8+ z`B&W3L?HdjNFjrNI!Jn^_xX`vLz8IS;`MxK?2dHilQLyLW(Kk1FgksCojERsJ!?iEkw+`1cDYq6akXxle%?Jr<{{=0nz`Kk-S^@n0J8?VXMIkDd80qP5Zm)#`}B9q`aYD-x25 zc@QMAn3TmSh+$G`MJqYrrZlSzXqzXwkxe}q+R{=~MXl6{TMe0tZ;lxDwHaEwS~Tn) z%Z4-bbN=m#CC+_Hj=V@B(_K9qdqPDt^t)b6FaB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ou$DNS@CB>aXDEiy1~>dAVzrxJXf|%q~{3 zV+sT$5OlN3ch~51Ia#f2Dy#?LDRKz$p>(uvXKchk3lKrb!5U$BE`ni$=yiZPfK&CDbpRi{y#a8x>Lvn-cH8Z2YFcxCWPvAg{g4_(vBgWOcI!oCDiIr*tgFD z0>S>ZbG=}lo*<*B9x-NM2+WPPzk!bHFPppF5E{UBX{72*x15C{|HfBzB=y)?!u4((=0EgFLA_ z6`T@*qVPu%h`}%=g4~IcPci+B9@-2D7oZGStf5opdO-$lH-c!vJHV>+`Sv#v^E=-M zy2;5mj{xJ#ck$qxWMVRMnc%^tr=x`E2j(mK&uiab@cCNZ3*; z{}ciWc1dFPu?S2#l*O}QL#Hy~RyUEaitnx6%8J5aG?N#&&2ooOFi*BoP^rKruGE6e zcty2q{Z3UiqprS6E6a4e(ctyDh^*`q;E_{?+fE^2WEl1@`Khci${^T>BfB-uBvB zWRm+Rso1^=^H?Vo|byTTbgxVWRzkrjj8ud(@m}8ax_s zY?YdiajB#$UkG9tIz0b*bBDr_s}UX3GqXvExGLdpADx_i0config('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; -- 2.39.5
CopiesCopies
@@ -176,23 +200,23 @@ -
-
+
+ -
+ + + +
+ +