Bug 13088: Add a syspref so the user can chose the amount of facets to show
authorTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 20 Oct 2014 16:46:28 +0000 (13:46 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Mon, 27 Oct 2014 15:21:20 +0000 (12:21 -0300)
This patch introduces a syspref (FacetMaxCount) that controls how many
facets to show for each category (e.g. Author).

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref

index 600279d..a18f7b6 100644 (file)
@@ -119,6 +119,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('ExpireReservesOnHolidays', '1', NULL, 'If false, reserves at a library will not be canceled on days the library is not open.', 'YesNo'),
 ('ExtendedPatronAttributes','0',NULL,'Use extended patron IDs and attributes','YesNo'),
 ('FacetLabelTruncationLength','20',NULL,'Specify the facet max length in OPAC','Integer'),
+('FacetMaxCount','20',NULL,'Specify the max facet count for each category','Integer'),
 ('FilterBeforeOverdueReport','0','','Do not run overdue report until filter selected','YesNo'),
 ('FineNotifyAtCheckin','0',NULL,'If ON notify librarians of overdue fines on the items they are checking in.','YesNo'),
 ('finesCalendar','noFinesWhenClosed','ignoreCalendar|noFinesWhenClosed','Specify whether to use the Calendar in calculating duedates and fines','Choice'),
index 79cccee..3e6fa99 100755 (executable)
@@ -8806,7 +8806,6 @@ if ( CheckVersion($DBversion) ) {
     });
     print "Upgrade to $DBversion done (Bug 12296 - search box replaceable with a system preference)\n";
     SetVersion($DBversion);
-    SetVersion ($DBversion);
 }
 
 $DBversion = "3.17.00.029";
@@ -8858,6 +8857,16 @@ if ( CheckVersion($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.17.00.XXX";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do(q{
+        INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type)
+        VALUES('FacetMaxCount', '20','Specify the max facet count for each category',NULL,'Integer')
+    });
+    print "Upgrade to $DBversion done (Bug 13088 - Allow the user to specify a max amount of facets to show)\n";
+    SetVersion($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)
index eee5cc9..c6a19bf 100644 (file)
@@ -180,6 +180,12 @@ Searching:
               default: 20
             - records from the search results.
         -
+            - Show up to
+            - pref: FacetMaxCount
+              class: integer
+              default: 20
+            - facets for each category.
+        -
             - By default, show
             - pref: OPACnumSearchResults
               class: integer