Bug 5697: Automatic linking in guided reports
authorOwen Leonard <oleonard@myacpl.org>
Mon, 8 Nov 2021 19:06:59 +0000 (19:06 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 10 Dec 2021 20:51:13 +0000 (10:51 -1000)
commit988d8c0bd047a6a55196f4aa04005b2e89ae9a71
tree788c58c4289816fe4a439b0fc41224b12b8f2d19
parent3ba74940ee730e92ad7061f27f18390cc6308364
Bug 5697: Automatic linking in guided reports

This patch modifies the output of reports so that if certain columns are
returned the data in the colums automatically offer menus of actions:

- borrowernumber: View, edit, check out
- cardnumber: Check out
- itemnumber: View, edit
- biblionumber: View, edit

Like the menu of batch operations, this functionality is available only
if the column is returned with its original name (e.g. biblionumber or
[[biblionumber|Biblio number]] but not "biblionumber AS `Biblio
number`).

To test, apply the patch and run a report which will return examples of
each kind of data. I used:

SELECT biblio.biblionumber , biblio.title, items.itemnumber,
items.itemcallnumber, items.barcode, borrowers.firstname,
borrowers.surname, borrowers.borrowernumber, borrowers.cardnumber
FROM issues
LEFT JOIN borrowers ON borrowers.borrowernumber=issues.borrowernumber
LEFT JOIN items ON issues.itemnumber=items.itemnumber
LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
ORDER BY RAND() LIMIT 50

When the report runs you should see that the data in each affected
column is displayed as a link, each of which should trigger the correct
menu. Test each case to confirm that the correct page is opened.

Test the "toggle data menus" control. Clicking it should hide and show
the menus in the report results. The selection persists until the
user logs out.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt