Bug 13429 - Add helper functions to create links in reports
Summary: Add helper functions to create links in reports
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-10 12:07 UTC by paxed
Modified: 2023-07-28 20:20 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2014-12-10 12:07:57 UTC
To make creating SQL reports easier, there should be some helper functions in the database.
For example, looking at the SQL Reports Library, there are several functions that create URLs to the staff client:

CONCAT('<a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber=',biblio.biblionumber,'\">',biblio.biblionumber,'</a>')


Adding the following function:

DROP FUNCTION IF EXISTS StaffUrl;
DELIMITER $$
CREATE FUNCTION StaffUrl(url text, linkname text) RETURNS text
BEGIN
   RETURN CONCAT('<a href=\"/cgi-bin/koha/', url, '\">', linkname, '</a>');
END$$


The example above would turn into

StaffUrl(CONCAT('catalogue/detail.pl?biblionumber=',biblio.biblionumber), biblio.biblionumber)
Comment 1 Katrin Fischer 2023-07-28 20:20:40 UTC
I am not sure about the suggested implementation and we do some automatic linking now. Maybe this could be closed?