Browse Source

Bug 7249: Syspref to control number of rows in web service results

The original patches for bug 7249 had a hardcoded limit of ten rows in the
results returned by the web service. This patch adds a SvcMaxReportRows syspref
which allows the librarian to choose how many rows should be returned by the
web service.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
3.10.x
Jared Camins-Esakov 12 years ago
committed by Paul Poulain
parent
commit
02a6d2b1d0
  1. 1
      installer/data/mysql/sysprefs.sql
  2. 7
      installer/data/mysql/updatedatabase.pl
  3. 8
      koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/web_services.pref
  4. 2
      opac/svc/report
  5. 4
      svc/report

1
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');

7
installer/data/mysql/updatedatabase.pl

@ -5232,6 +5232,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)

8
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.

2
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);

4
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);

Loading…
Cancel
Save