| Summary: | Add helper functions to create links in reports | ||
|---|---|---|---|
| Product: | Koha | Reporter: | paxed <pasi.kallinen> |
| Component: | Database | Assignee: | Galen Charlton <gmcharlt> |
| Status: | NEW --- | QA Contact: | Testopia <testopia> |
| Severity: | enhancement | ||
| Priority: | P5 - low | ||
| Version: | Main | ||
| Hardware: | All | ||
| OS: | All | ||
| GIT URL: | Initiative type: | --- | |
| Sponsorship status: | --- | Crowdfunding goal: | 0 |
| Patch complexity: | --- | Documentation contact: | |
| Documentation submission: | Text to go in the release notes: | ||
| Version(s) released in: | Circulation function: | ||
I am not sure about the suggested implementation and we do some automatic linking now. Maybe this could be closed? |
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)