@@ -, +, @@ web service results --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../en/modules/admin/preferences/web_services.pref | 8 +++++++- opac/svc/report | 2 +- svc/report | 4 ++-- 5 files changed, 18 insertions(+), 4 deletions(-) --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -362,3 +362,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES(' INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('AutoResumeSuspendedHolds', '1', NULL , 'Allow suspended holds to be automatically resumed by a set date.', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','all',NULL,'disable|all|details','Choice'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SvcMaxReportRows','10','Maximum number of rows to return via the report web service.',NULL,'Integer'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -5225,6 +5225,13 @@ saved_reports table.)\n"; SetVersion($DBversion); } +$DBversion = "3.09.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SvcMaxReportRows','10','Maximum number of rows to return via the report web service.',NULL,'Integer');"); + print "Upgrade to $DBversion done (Added SvcMaxReportRows syspref)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref @@ -1,4 +1,4 @@ -Web Services: +Web services: OAI-PMH: - - pref: OAI-PMH @@ -38,3 +38,9 @@ Web Services: - pref: ILS-DI:AuthorizedIPs class: Text - allowed IPs to use the ILS-DI services + Reporting: + - + - Only return + - pref: SvcMaxReportRows + class: integer + - rows of a report requested via the reports web service. --- a/opac/svc/report +++ a/opac/svc/report @@ -55,7 +55,7 @@ if ($usecache) { print $query->header; my $offset = 0; -my $limit = 10; +my $limit = C4::Context->preference("SvcMaxReportRows") || 10; my ( $sth, $errors ) = execute_query( $sql, $offset, $limit ); my $lines = $sth->fetchall_arrayref; my $json_text = to_json($lines); --- a/svc/report +++ a/svc/report @@ -30,7 +30,7 @@ my $query = CGI->new(); my $report = $query->param('id'); my $cache; -my $usecache = C4::Context->preference('usecache'); +my $usecache = C4::Context->ismemcached; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -66,7 +66,7 @@ print $query->header; my ( $sql, $type, $name, $notes, $cache_expiry, $public ) = get_saved_report($report); my $offset = 0; -my $limit = 10; +my $limit = C4::Context->preference("SvcMaxReportRows") || 10; my ( $sth, $errors ) = execute_query( $sql, $offset, $limit ); my $lines = $sth->fetchall_arrayref; my $json_text = to_json($lines); --