Bug 24305: Fix links to batch tools when report's columns do not contain integers
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 26 Dec 2019 10:11:55 +0000 (11:11 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 24 Jan 2020 15:19:33 +0000 (15:19 +0000)
commit00020bdfa9614b5627303fbd095e32b5cb5384b8
tree9570645b25cd917d2f42e06f13908508cf7da81a
parent6a2223356bd332d666863cb9a75aad4c43c28b71
Bug 24305: Fix links to batch tools when report's columns do not contain integers

If report's columns do not only contain integers, we should not point to
batch tools.
For instance, if the value is a link, the batch tools will not work as
they will not retrieve the id (itemnnumber or biblionumber) properly

Test plan:
Create a report like:
    SELECT CONCAT('<a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', biblionumber, '&itemnumber=', itemnumber, '#edititem', '\">', itemnumber, '</a>' ) AS itemnumber
    FROM items
    LIMIT 10;
Execute it
=> There is not link to the batch tools

Edit the report like:
    SELECT itemnumber
    FROM items
    LIMIT 10;
Execute it
=> There is a link to the batch tools

Edit the report like

    SELECT itemnumber, CONCAT('<a href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=', biblionumber, '&itemnumber=', itemnumber, '#edititem', '\">', itemnumber, '</a>' ) AS itemnumber
    FROM items
    LIMIT 10;
Execute it
=> There is link to the batch tools

Try other combinations with biblionumber.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt