[Koha-bugs] [Bug 8995] Show OpenURL links in OPAC search results

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Jun 30 12:16:08 CEST 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8995

Jonathan Druart <jonathan.druart at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #26899|0                           |1
        is obsolete|                            |
  Attachment #26900|0                           |1
        is obsolete|                            |
  Attachment #26901|0                           |1
        is obsolete|                            |

--- Comment #21 from Jonathan Druart <jonathan.druart at biblibre.com> ---
Created attachment 29357
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=29357&action=edit
Bug 8995: Show OpenURL links in OPAC search results

This patch use GetCOinS sub to provide an OpenURL link in OPAC search
results. It uses 4 new system preferences:
  - OpenURLinOPACResults: enable or disable this feature
  - OpenURLResolverURL: url of the openURL resolver
  - OpenURLText: text of the link
  - OpenURLImageLocation: image of the link

Link is displayed as an image if OpenURLImageLocation is defined, and as
text otherwise.
It works both with and without XSLT enabled.

Changes made to GetCOinSBiblio:

For 'journal':
- Title should be in rft.jtitle instead of rft.title
- rft.date, rft.aulast, rft.aufirst, rft.au, rft.pub and rft.pages have
  no meaning for a subscription, so they are simply removed from URL

This patch refactors GetCOinSBiblio, so the construction of URL is done
only at the end. This way we do not have ugly
  $var .= "&$value"
in the function body.

Also use URI::Escape instead of custom regexps.

Test plan:
1/ Enable syspref OPACShowOpenURL and put your OpenURL resolver URL in
OpenURLResolverURL syspref (if you don't have one, just fill it with
some fake URL, you'll have to check if OpenURL links are correct)
2/ If you want, set the other sysprefs OpenURLImageLocation and
OpenURLText
3/ Fill syspref OPACHideOpenURLForItemTypes with some (not all) of your
item types.
4/ Empty sysprefs OPACXSLTDetailsDisplay and OPACXSLTResultsDisplay
5/ Go to OPAC and launch a search.
6/ Check you have in the results (near the title) the OpenURL link (only
for itemtypes that are not in OPACHideOpenURLForItemTypes)
7/ Go to the detail page of one of those and check you have the OpenURL
link too. (Above tags)
8/ Set sysprefs OPACXSLTDetailsDisplay and OPACXSLTResultsDisplay to
"default"
9/ Repeat steps 5 to 7

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list