Bug 9915: Allow sql_params to be passed to a report using the OPAC svc/report interface
authorChris Cormack <chris@bigballofwax.co.nz>
Sun, 24 Mar 2013 07:29:18 +0000 (20:29 +1300)
committerGalen Charlton <gmc@esilibrary.com>
Sun, 20 Apr 2014 22:54:04 +0000 (22:54 +0000)
commit91619116129f37eca3088a90bb67975d8dd78301
tree248b8f07df3239e4c03d4dc5469c07b895b13722
parent9708138a86dd66e876bf3ff6e24dfdf1ae3d51d9
Bug 9915: Allow sql_params to be passed to a report using the OPAC svc/report interface

Test plan:

1/ Make a public report that contains SQL parameters
2/ Test it from the staff side
3/ Hit the url like
cgi-bin/koha/svc/report?id=1&sql_params=chris&sql_params=chris2
4/ Test you get JSON

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.

Tested with a public report:
select * from items
  - cgi-bin/koha/svc/report?id=6
  - URL shows JSON and all items
select * from items where itype = <<itype>>
  - cgi-bin/koha/svc/report?id=6&sql_params=BK
  - URL shows JSON and only BK items
select * from items where itype = <<itype>> and homebranch = <<homebranch>>
  - cgi-bin/koha/svc/report?id=6&sql_params=BK&sql_params=MPL
  - URL shows JSON and only BK items in MPL
select * from items where itype = <<itype|itemtypes>> and homebranch = <<homebranch|branches>>
  - same as above
  - URL shows JSON and only BK items in MPL
select * from items where dateaccessioned = 2013-12-15
  - cgi-bin/koha/svc/report?id=6&sql_params=BK&sql_params=MPL&sql_params=2013-12-15
  - URL shows JSON and correct items

Note: This will currently only work for public reports!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
opac/svc/report