Bug 3098 - XSLT stylesheet does not obey OPACURLOpenInNewWindow syspref
Summary: XSLT stylesheet does not obey OPACURLOpenInNewWindow syspref
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: rel_3_0
Hardware: PC All
: PATCH-Sent (DO NOT USE) normal (vote)
Assignee: Chris Cormack
QA Contact:
URL:
Keywords:
Depends on:
Blocks: 5919
  Show dependency treegraph
 
Reported: 2009-04-08 01:57 UTC by Jane Wagner
Modified: 2012-10-25 23:04 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
patch (6.11 KB, patch)
2011-03-22 21:33 UTC, Nicole C. Engard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:06:22 UTC


---- Reported by jwagner@ptfs.com 2009-04-08 13:57:48 ----

The OPACURLOpenInNewWindow syspref works if the XSLTDetailsDisplay syspref is turned off (i.e., if the system is not using the XSLT stylesheets).  However, if the XSLTDetailsDisplay syspref is turned on, the system ignores the OPACURLOpenInNewWindow setting and opens URLs in the same window.  The XSLT stylesheet needs to open this syspref if it is set.



---- Additional Comments From jwagner@ptfs.com 2009-07-24 16:24:53 ----

Still haven't been able to figure out how to pass a syspref to the XSLT files and get it obeyed, but I did an interim hard-coded fix to force the OPAC to open URLs in new windows:

Under koha-tmpl/opac-tmpl/prog/en/xslt, in MARC21slim2OPACDetail.xsl and
MARC21slim2OPACResults.xsl, under the 856 section, search for the line

<a><xsl:attribute name="href"><xsl:value-of
select="marc:subfield[@code='u']"/></xsl:attribute>

Change the beginning <a> as follows:

<a target="_blank">


This is an interim fix until the larger problem of passing/obeying sysprefs gets solved.



---- Additional Comments From jwagner@ptfs.com 2009-08-23 20:03:34 ----

Sent patch combined with http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3108, http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3545. Modified C4/XSLT.pm based on code written by Frédéric Demians (thanks!) to pass the values of the sysprefs to the .xsl files.  Modified the .xsl files to implement them.  Now, if OPACURLOpenInNewWindow is on, the OPAC MARC21 XSLT results list and title display will open a URL in a new browser window.





---- Additional Comments From jwagner@ptfs.com 2009-08-23 20:11:10 ----

Patch sent August 23, 2009. 

As a followup, in MARC21slim2OPACResults.xsl, there was a check for the 856 indicator 2 to be 0 before it would show the URL in the results list. There was no such check in the details xsl.  The apparent intent was that if people consistently coded the 856 ind 2 correctly, the display would just show 856s with 2nd indicator of 0 on the results list, to include URLs that point directly to the resource, not alternative versions.  I believe that many, if not most, sites may have either (1) incorrect settings on 856s migrated into Koha or (2) people creating records in Koha who don't know what indicators to use.  Therefore, I deleted the check for 856 _0 in the results list.  It will now show all 856s present in the record.




---- Additional Comments From gmcharlt@gmail.com 2009-09-16 01:43:02 ----

Patch pushed.  Please test and close.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:06 UTC  ---

This bug was previously known as _bug_ 3098 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3098

Unknown operating system Windows 2000. Setting to default OS "All".
Actual time not defined. Setting to 0.0
The original reporter of this bug does not have
   an account here. Reassigning to the person who moved
   it here: chris@bigballofwax.co.nz.
   Previous reporter was jwagner@ptfs.com.
The original assignee of this bug does not have
   an account here. Reassigning to the default assignee
   for the component, chris@bigballofwax.co.nz.
   Previous assignee was jwagner@ptfs.com.

Comment 1 Nicole C. Engard 2011-03-22 21:33:53 UTC
Created attachment 3406 [details] [review]
patch
Comment 2 Nicole C. Engard 2011-03-22 21:34:16 UTC
updated patch from jared signed off
Comment 3 Chris Cormack 2011-03-24 00:47:53 UTC
Should this be now Signed off? or is there more to come?
Comment 4 Chris Cormack 2011-03-24 07:15:12 UTC
Pushed, please test