Bug 15851: Only display the analytics link when required
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 24 Jun 2020 17:50:37 +0000 (14:50 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 3 Sep 2020 12:18:23 +0000 (14:18 +0200)
commit0291c1e7e7a8d24d608830d31a6fdd9d2273f1a7
treeb668cc6b6040862ad0cf675ad900eb672101c206
parentf70df9b19479dc51ddaf76f29aaadafb7907a184
Bug 15851: Only display the analytics link when required

This patch makes opac-detail.pl query for analytics the same way it
would do with the generated link (i.e. based on UseControlNumber) and
passes a flag to the XSLT so it displays (or not) the 'Analytics' link.

To test:
1. Apply the first patch
2. Have a known record without analytics
3. Open the record in the OPAC
=> FAIL: It shows the 'Analytics' link
4. Have a record known to have analytics and open in OPAC, on a separate
   tab
=> SUCCESS: It shows the 'Analytics' link
5. Apply this patch and restart_all
6. Reload the tabs
=> SUCCESS: It shows the link where it has to, and hides it where it
shouldn't be displayed
7. Sign off :-D

Sponsored-by: Orex Digital
Signed-off-by: Hugo Agud <hagud@orex.es>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl
opac/opac-detail.pl