[Koha-bugs] [Bug 13429] New: Add helper SQL functions for report use

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Dec 10 13:07:57 CET 2014


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

            Bug ID: 13429
           Summary: Add helper SQL functions for report use
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Database
          Assignee: gmcharlt at gmail.com
          Reporter: pasi.kallinen at pttk.fi
        QA Contact: testopia at bugs.koha-community.org

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)

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


More information about the Koha-bugs mailing list