Bug 22774: New systempreferences for suggestions added to sysprefs.sql
authorNazlı Çetin <nazli@devinim.com.tr>
Fri, 21 Feb 2020 14:08:16 +0000 (14:08 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 14 Apr 2020 15:42:03 +0000 (16:42 +0100)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/atomicupdate/bug_22774.perl [new file with mode: 0644]
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref

diff --git a/installer/data/mysql/atomicupdate/bug_22774.perl b/installer/data/mysql/atomicupdate/bug_22774.perl
new file mode 100644 (file)
index 0000000..42f5340
--- /dev/null
@@ -0,0 +1,18 @@
+$DBversion = '19.12.00.XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    # you can use $dbh here like:
+    # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" );
+    $dbh->do( q{
+            INSERT IGNORE INTO systempreferences (variable,value,explanation,type) VALUES
+                ('MaxTotalSuggestions','','Number of total suggestions','Free'),
+                ('NumberOfSuggestionDays','','days','Free')
+            });
+    # or perform some test and warn
+    # if( !column_exists( 'biblio', 'biblionumber' ) ) {
+    #    warn "There is something wrong";
+    # }
+
+    # Always end with this (adjust the bug info)
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 22774 - Limit Purchase Suggestion in a specified Time period)\n";
+}
index cb15cf9..52ff06a 100644 (file)
@@ -323,6 +323,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('maxRecordsForFacets','20',NULL,NULL,'Integer'),
 ('maxreserves','50','','Define maximum number of holds a patron can place','Integer'),
 ('MaxSearchResultsItemsPerRecordStatusCheck','20','','Max number of items per record for which to check transit and hold status','Integer'),
+('MaxTotalSuggestions','',NULL,'Number of total suggestions','Free'),
+('NumberOfSuggestionDays','',NULL,'days','Free'),
 ('MembershipExpiryDaysNotice','',NULL,'Send an account expiration notice that a patron\'s card is about to expire after','Integer'),
 ('MergeReportFields','',NULL,'Displayed fields for deleted MARC records after merge','Free'),
 ('minPasswordLength','3',NULL,'Specify the minimum length of a patron/staff password','free'),
index 485d17d..e8b6ed1 100644 (file)
@@ -710,6 +710,14 @@ OPAC:
             - pref: MaxOpenSuggestions
               class: integer
             - "open suggestions. Leave empty for no limit. **Note: this setting does not affect anonymous suggestions"
+        -
+            - Number of total suggestions
+            - pref: MaxTotalSuggestions
+              class: integer
+            - "for"
+            - pref: NumberOfSuggestionDays
+              class: integer
+            - "days."
     Privacy:
         -
             - pref: AnonSuggestions