[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 Mar 11 22:41:41 CET 2019


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

Josef Moravec <josef.moravec at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #86483|0                           |1
        is obsolete|                            |
  Attachment #86484|0                           |1
        is obsolete|                            |
  Attachment #86485|0                           |1
        is obsolete|                            |
  Attachment #86486|0                           |1
        is obsolete|                            |
  Attachment #86487|0                           |1
        is obsolete|                            |
  Attachment #86488|0                           |1
        is obsolete|                            |
  Attachment #86489|0                           |1
        is obsolete|                            |

--- Comment #92 from Josef Moravec <josef.moravec at gmail.com> ---
Created attachment 86490
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86490&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.

This development consider the value of syspref OPACURLOpenInNewWindow
when building the link.

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 OPACOpenURLItemTypes 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 in OPACOpenURLItemTypes).
Toggle OPACURLOpenInNewWindow syspref and check that the behaviour of
the link is correct.
7/ Go to the detail page of one of those and check you have the OpenURL
link too. (Above tags)
Toggle OPACURLOpenInNewWindow syspref and check that the behaviour of
the link is correct.
8/ Set sysprefs OPACXSLTDetailsDisplay and OPACXSLTResultsDisplay to
"default" and repeat steps 5 to 7

Signed-off-by: Paola Rossi <paola.rossi at cineca.it>

Signed-off-by: Magnus Enger <magnus at libriotech.no>

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


More information about the Koha-bugs mailing list