Main Koha release repository
https://koha-community.org
25f134f525
The staff and public catalog reports web services (/svc/report) return JSON output, in particular an array contain an array for each row of the report output. This patch adds a URL parameter, annotated, which when supplied and set to a value that evaluates to Perl true, will cause the output to be emited as a JSON array of hashes, where each hash represents a row of report output and the hash keys are the column names or labels set in the report definition. This patch also moves code around to make diffs between svc/report and opac/svc/report smaller. The suggestion to return an array of hashes was made by Chris Cormack. TEST PLAN --------- 1) Log into staff client 2) Reports 3) Used save reports 4) Click the Action button on any report WITHOUT PARAMETERS. -- with parameters blows up in master and this. 5) Click Edit 6) Make the report public 7) Update the SQL 8) Note the ID number of the report 9) Note the ID number of a non-public report 10) Make up a crazy ID number for a non-existant report 11) In a new tab (with the appropriate edits) https://OPAC/cgi-bin/koha/svc/report?id=# from step 8 -- JSON data has arrays of field values. https://OPAC/cgi-bin/koha/svc/report?id=# from step 8&annotated=1 -- JSON data has arrays of field values. https://OPAC/cgi-bin/koha/svc/report?id=# from step 9 -- Software error: Sorry this report is not public https://OPAC/cgi-bin/koha/svc/report?id=# from step 9&annotated=1 -- Software error: Sorry this report is not public https://OPAC/cgi-bin/koha/svc/report?id=# from step 10 -- Software error: Sorry this report is not public https://OPAC/cgi-bin/koha/svc/report?id=# from step 10&annotated=1 -- Software error: Sorry this report is not public https://STAFF/cgi-bin/koha/svc/report?id=# from step 8 -- JSON data has arrays of field values. https://STAFF/cgi-bin/koha/svc/report?id=# from step 8&annotated=1 -- JSON data has arrays of field values. https://STAFF/cgi-bin/koha/svc/report?id=# from step 9 -- JSON data has arrays of field values. https://STAFF/cgi-bin/koha/svc/report?id=# from step 9&annotated=1 -- JSON data has arrays of field values. https://STAFF/cgi-bin/koha/svc/report?id=# from step 10 -- Software error: hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this) at /usr/share/perl5/JSON.pm line 154. https://STAFF/cgi-bin/koha/svc/report?id=# from step 10&annotated=1 -- Software error: hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this) at /usr/share/perl5/JSON.pm line 154. 12) Apply the patch 13) ~/qa-test-tools/koha-qa.pl -v 2 -c 2 -- There should be no problems. All OK. 14) In a new tab (with the appropriate edits) https://OPAC/cgi-bin/koha/svc/report?id=# from step 8 -- JSON data has arrays of field values. https://OPAC/cgi-bin/koha/svc/report?id=# from step 8&annotated=1 -- JSON data has arrays of hashes with field names as keys https://OPAC/cgi-bin/koha/svc/report?id=# from step 9 -- Software error: Sorry this report is not public https://OPAC/cgi-bin/koha/svc/report?id=# from step 9&annotated=1 -- Software error: Sorry this report is not public https://OPAC/cgi-bin/koha/svc/report?id=# from step 10 -- Software error: There is no such report. https://OPAC/cgi-bin/koha/svc/report?id=# from step 10&annotated=1 -- Software error: There is no such report. https://STAFF/cgi-bin/koha/svc/report?id=# from step 8 -- JSON data has arrays of field values. https://STAFF/cgi-bin/koha/svc/report?id=# from step 8&annotated=1 -- JSON data has arrays of hashes with field names as keys https://STAFF/cgi-bin/koha/svc/report?id=# from step 9 -- JSON data has arrays of field values. https://STAFF/cgi-bin/koha/svc/report?id=# from step 9&annotated=1 -- JSON data has arrays of hashes with field names as keys https://STAFF/cgi-bin/koha/svc/report?id=# from step 10 -- Software error: There is no such report. https://STAFF/cgi-bin/koha/svc/report?id=# from step 10&annotated=1 -- Software error: There is no such report. Signed-off-by: Holger Meißner <h.meissner.82@web.de> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com> |
||
---|---|---|
acqui | ||
admin | ||
authorities | ||
basket | ||
C4 | ||
catalogue | ||
cataloguing | ||
circ | ||
course_reserves | ||
debian | ||
docs | ||
errors | ||
etc | ||
install_misc | ||
installer | ||
Koha | ||
koha-tmpl | ||
labels | ||
members | ||
misc | ||
offline_circ | ||
opac | ||
OpenILS | ||
patron_lists | ||
patroncards | ||
plugins | ||
reports | ||
reserve | ||
reviews | ||
rotating_collections | ||
selenium | ||
serials | ||
services | ||
skel | ||
sms | ||
suggestion | ||
svc | ||
t | ||
tags | ||
test | ||
tmp/modified_authorities | ||
tools | ||
virtualshelves | ||
xt | ||
.htaccess | ||
.mailmap | ||
about.pl | ||
changelanguage.pl | ||
edithelp.pl | ||
fix-perl-path.PL | ||
help.pl | ||
INSTALL | ||
install-CPAN.pl | ||
INSTALL.debian | ||
INSTALL.fedora7 | ||
INSTALL.opensuse | ||
INSTALL.ubuntu | ||
koha_perl_deps.pl | ||
kohaversion.pl | ||
LICENSE | ||
mainpage.pl | ||
Makefile.PL | ||
MANIFEST.SKIP | ||
README | ||
README.robots | ||
rewrite-config.PL |
Koha is a free software integrated library system. Koha is distributed under the GNU GPL version 3 or later. Please read the file LICENSE for more details. To install or upgrade Koha, please see the INSTALL file appropriate to your platform. Report bugs at http://bugs.koha-community.org/ Visit the Koha Project website at http://www.koha-community.org/