@@ -, +, @@ day --- .../data/mysql/atomicupdate/Bug_17187_dbrev.perl | 30 ++++++++++++++++++++++ installer/data/mysql/sysprefs.sql | 2 +- .../prog/en/modules/admin/preferences/admin.pref | 1 - 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/Bug_17187_dbrev.perl --- a/installer/data/mysql/atomicupdate/Bug_17187_dbrev.perl +++ a/installer/data/mysql/atomicupdate/Bug_17187_dbrev.perl @@ -0,0 +1,30 @@ +#!/usr/bin/perl + +use Modern::Perl; +use C4::Context; + +my $dbh = C4::Context->dbh; +my $DBversion = 'XXX'; + +# @RM: Copy from here + +#if ( CheckVersion($DBversion) ) { +if ( 1 ) { #FIXME + my $pref = C4::Context->preference('timeout'); + if( !$pref || $pref eq '12000000' ) { + # update if pref is null or equals old default value + $dbh->do(q| +UPDATE systempreferences SET value = '1d', type = 'Free' +WHERE variable = 'timeout' + |); + print "Upgrade to $DBversion done (Bug 17187)\nNote: Pref value for timeout has been adjusted.\n"; + } else { + # only update pref type + $dbh->do(q| +UPDATE systempreferences SET type = 'Free' +WHERE variable = 'timeout' + |); + print "Upgrade to $DBversion done (Bug 17187)\nNote: Pref value for timeout has not been adjusted.\n"; + } + #SetVersion($DBversion); #FIXME +} --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -499,7 +499,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('template','prog','','Define the preferred staff interface template','Themes'), ('ThingISBN','0','','Use with FRBRizeEditions. If ON, Koha will use the ThingISBN web service in the Editions tab on the detail pages.','YesNo'), ('TimeFormat','24hr','12hr|24hr','Defines the global time format for visual output.','Choice'), -('timeout','12000000',NULL,'Inactivity timeout for cookies authentication (in seconds)','Integer'), +('timeout','1d',NULL,'Inactivity timeout for cookies authentication','Free'), ('todaysIssuesDefaultSortOrder','desc','asc|desc','Specify the sort order of Todays Issues on the circulation page','Choice'), ('TraceCompleteSubfields','0','0','Force subject tracings to only match complete subfields.','YesNo'), ('TraceSubjectSubdivisions','0','1','Create searches on all subdivisions for subject tracings.','YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref @@ -75,7 +75,6 @@ Administration: - - Automatically log out users after - pref: timeout - class: integer - seconds of inactivity. Adding d will specify it in days, e.g. 1d is timeout of one day. - - pref: AutoLocation --