From bf95414993cf64eefe45ef4fc49a622af8054b35 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Thu, 28 Sep 2017 14:10:56 +0000 Subject: [PATCH] Bug 19247 - Added ability to skip feature release tool The administrator can now skip the feature release tool on the update process and it will be displayed to the next superlibrarian user that logs in. Because librarian staff are likely to be more familiar with the system preference settings that a library would want to set than an IT support administrator Test plan: 1. Go to Administrator->global system preferences->Local use 2. Set the version number to 16.120033 (Note: only 1 decimal place) and save 3. Go through the update process and notice that after submitting the 'Update database structure' page you are prompted to login and the main page appears if you logged in with the correct credentials 4. Apply patch 5. Repeat steps 1 and 2 6. Notice the button text on the 'Update database structure' page has changed and now it says 'Continue to feature release tool' 7. Notice there is also a skip button. Click the skip button and notice you are redirected to the staff intranet login page. 8. Login with the Koha db administrator credentials and notice that the Koha main page is displayed 9. Logout and enter superlibrarian user credentials and submit the login form 10. Notice you are redirected to the Koha web installer login page 11. Login with the Koha db administrator credentials 12. Notice the feature release change tool is displayed 13. Alter the NumSavedReports and the TalkingTechItivaPhoneNotification values and select the 'Save all preferences' button 14. Query the values of these two sysprefs in the systempreferences database table and notice they have been changed to what you submitted 15. Click the 'Log into Koha staff intranet' button 16. Notice the intranet login page appears 17. Login and the main page will be displayed 18. Repeat steps 1,2 and click the 'Continue to feature release tool' button 19. Notice the feature release tool is displayed and repeat steps 13 and 14 20. Click the 'Log into Koha staff intranet' button, login as either Koha db administrator or as a superlibrarian (it doesn't matter which you log in as) and the Koha staff intranet mainpage will be displayed 21. Log out and then log back in again and notice the staff intranet is still displayed. Note you are not redirected to the Koha web installer login page to go through the feature release change tool because you have already gone through it Sponsored-By: Catalyst IT https://bugs.koha-community.org/show_bug.cgi?id=18645 --- C4/Auth.pm | 16 ++++ Koha/Patron.pm | 19 +++++ admin/preferences.pl | 4 +- ...g_version_column_to_systempreferences_table.sql | 85 +++++++++++----------- installer/data/mysql/kohastructure.sql | 1 + installer/featurereleasetool.pl | 32 +++++--- installer/install.pl | 12 ++- .../en/modules/installer/featurereleasetool.tt | 75 +++++++++++++++++-- .../prog/en/modules/installer/step3.tt | 1 + mainpage.pl | 16 ++++ 10 files changed, 198 insertions(+), 63 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index d22e935..d641b96 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -2029,6 +2029,22 @@ sub get_all_subpermissions { return $all_perms; } +=head2 check_feature_tool_required + +my $featuretoolrequired = C4::Auth->check_feature_tool_required(); + +Returns 1 from the userflags table if the authenticating user is required to be redirected to the feature release tool process. The 'featuretoolrequired' field is set in the mainpage.pl + +=cut +sub check_feature_tool_required { + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare(" + SELECT featuretoolrequired FROM userflags WHERE bit = 0"); + $sth->execute(); + my $onboardingrequired = $sth->fetchrow(); + return $onboardingrequired; +} + =head2 haspermission $flags = ($userid, $flagsrequired); diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 015cb41..a24b04f 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -635,6 +635,25 @@ sub get_enrollable_clubs { return wantarray ? $e->as_list : $e; } +=head3 check_if_patrons_have_flags + +my $patron_has_flags = Koha::Patron->check_if_patrons_have_flag s(); + +All sample patrons that can optionally be installed whilst running the Koha web installer have the flag value of NULL, this subroutine checks if any borrower records in the borrowers table contain a number, and so this means that they must have been manually added. If there is a numberical flag returned then this subroutine will return a 1 to mainpage.pl script to ensure that users are appropriately redirected to the feature release change tool + +=cut +sub check_if_patrons_have_flags { + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare(" + select * from borrowers where flags != 'NULL'"); + $sth->execute(); + my $no_patrons_with_flags; + if ( $sth->rows ) { + $no_patrons_with_flags = 1; + } + return $no_patrons_with_flags; +} + =head3 account_locked my $is_locked = $patron->account_locked diff --git a/admin/preferences.pl b/admin/preferences.pl index 16fa2fd..04e752a 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -165,7 +165,8 @@ sub TransformPrefsToHTML { } else { $value = $row->{'value'}; } - my $chunk = _get_chunk( $value, %$piece ); + my $source = "preferences"; + my $chunk = _get_chunk( $value, $source, %$piece ); # No highlighting of inputs yet, but would be useful $chunk->{'highlighted'} = 1 if ( $searchfield && $name =~ /^$searchfield$/i ); @@ -225,6 +226,7 @@ sub SearchPrefs { my ( $input, $searchfield ) = @_; my @tabs; + warn $input, $searchfield; my %tab_files = _get_pref_files( $input ); our @terms = split( /\s+/, $searchfield ); diff --git a/installer/data/mysql/atomicupdate/18645_adding_version_column_to_systempreferences_table.sql b/installer/data/mysql/atomicupdate/18645_adding_version_column_to_systempreferences_table.sql index b89f681..8428d6e 100644 --- a/installer/data/mysql/atomicupdate/18645_adding_version_column_to_systempreferences_table.sql +++ b/installer/data/mysql/atomicupdate/18645_adding_version_column_to_systempreferences_table.sql @@ -1,66 +1,69 @@ ALTER TABLE systempreferences ADD version varchar(12) DEFAULT NULL; +ALTER TABLE systempreferences ADD display_choices mediumtext DEFAULT NULL; +INSERT INTO systempreferences (variable, explanation) VALUES ("PreviousVersion", "The most recent Koha database version that this Koha instance upgraded from. WARNING: Do not change this, it is used by the feature release tool to display appropriate installed system preferences after each update process"); UPDATE systempreferences SET version="16.06.00.003" WHERE variable ="MaxItemsToProcessForBatchMod"; UPDATE systempreferences SET version="16.06.00.003" WHERE variable ="MaxItemsToDisplayForBatchDel"; UPDATE systempreferences SET version="16.06.00.004" WHERE variable ="OPACXSLTListsDisplay"; UPDATE systempreferences SET version="16.06.00.004" WHERE variable ="XSLTListsDisplay"; UPDATE systempreferences SET version="16.06.00.005" WHERE variable ="XSLTListsDisplay"; -UPDATE systempreferences SET version="16.06.00.006" WHERE variable="RefundLostOnReturnControl"; +UPDATE systempreferences SET version="16.06.00.006", display_choices="check-in library.|item home branch.|item holding branch." WHERE variable="RefundLostOnReturnControl"; UPDATE systempreferences SET version="16.06.00.007" WHERE variable="PatronQuickAddFields"; -UPDATE systempreferences SET version="16.06.00.008" WHERE variable="CheckPrevCheckout"; -UPDATE systempreferences SET version="16.06.00.009" WHERE variable="IntranetCatalogSearchPulldown"; +UPDATE systempreferences SET version="16.06.00.008", display_choices="Do|Unless overridden, do|Unless overridden, do not|Do not" WHERE variable="CheckPrevCheckout"; +UPDATE systempreferences SET version="16.06.00.009", display_choices="Don't show|Show" WHERE variable="IntranetCatalogSearchPulldown"; UPDATE systempreferences SET version="16.06.00.010" WHERE variable="MaxOpenSuggestions"; -UPDATE systempreferences SET version="16.06.00.011" WHERE variable="NovelistSelectStaffEnabled"; -UPDATE systempreferences SET version="16.06.00.011" WHERE variable="NovelistSelectStaffView"; -UPDATE systempreferences SET version="16.06.00.013" WHERE variable="OPACResultsLibrary"; -UPDATE systempreferences SET version="16.06.00.015" WHERE variable="HoldsLog"; -UPDATE systempreferences SET version="16.06.00.020" WHERE variable="SwitchOnSiteCheckouts"; -UPDATE systempreferences SET version="16.06.00.027" WHERE variable="TrackLastPatronActivity"; -UPDATE systempreferences SET version="16.06.00.021" WHERE variable="PatronSelfRegistrationEmailMustBeUnique"; +UPDATE systempreferences SET version="16.06.00.011", display_choices="Don't add|add" WHERE variable="NovelistSelectStaffEnabled"; +UPDATE systempreferences SET version="16.06.00.011", display_choices="in a tab|above the holdings table|below the holdings table" WHERE variable="NovelistSelectStaffView"; +UPDATE systempreferences SET version="16.06.00.013", display_choices="home library|current location" WHERE variable="OPACResultsLibrary"; +UPDATE systempreferences SET version="16.06.00.015", display_choices="Don't log|Log" WHERE variable="HoldsLog"; +UPDATE systempreferences SET version="16.06.00.020", display_choices="Don't switch|Switch" WHERE variable="SwitchOnSiteCheckouts"; +UPDATE systempreferences SET version="16.06.00.027", display_choices="Don't|Do" WHERE variable="TrackLastPatronActivity"; +UPDATE systempreferences SET version="16.06.00.021", display_choices="Do not consider|Consider" WHERE variable="PatronSelfRegistrationEmailMustBeUnique"; UPDATE systempreferences SET version="16.06.00.023" WHERE variable="timeout"; -UPDATE systempreferences SET version="16.06.00.025" WHERE variable="makePreviousSerialAvailable"; +UPDATE systempreferences SET version="16.06.00.025", display_choices="Do not make|Make" WHERE variable="makePreviousSerialAvailable"; UPDATE systempreferences SET version="16.06.00.026" WHERE variable="PatronSelfRegistrationLibraryList"; -UPDATE systempreferences SET version="16.06.00.027" WHERE variable="TrackLastPatronActivity"; -UPDATE systempreferences SET version="16.06.00.029" WHERE variable="UsageStatsLibraryType"; -UPDATE systempreferences SET version="16.06.00.029" WHERE variable="UsageStatsCountry"; -UPDATE systempreferences SET version="16.06.00.030" WHERE variable="OPACHoldingsDefaultSortField"; -UPDATE systempreferences SET version="16.06.00.031" WHERE variable="PatronSelfRegistrationPrefillForm"; -UPDATE systempreferences SET version="16.06.00.035" WHERE variable="AllowItemsOnHoldCheckoutSCO"; -UPDATE systempreferences SET version="16.06.00.036" WHERE variable="HouseboundModule"; -UPDATE systempreferences SET version="16.06.00.037" WHERE variable="ArticleRequests"; -UPDATE systempreferences SET version="16.06.00.037" WHERE variable="ArticleRequestsMandatoryFields"; -UPDATE systempreferences SET version="16.06.00.037" WHERE variable="ArticleRequestsMandatoryFieldsItemsOnly"; -UPDATE systempreferences SET version="16.06.00.037" WHERE variable="ArticleRequestsMandatoryFieldsRecordOnly"; -UPDATE systempreferences SET version="16.06.00.038" WHERE variable="DefaultPatronSearchFields"; -UPDATE systempreferences SET version="16.06.00.041" WHERE variable="AggressiveMatchOnISSN"; -UPDATE systempreferences SET version="16.06.00.045" WHERE variable="BorrowerRenewalPeriodBase"; +UPDATE systempreferences SET version="16.06.00.027", display_choices="Don't|Do" WHERE variable="TrackLastPatronActivity"; +UPDATE systempreferences SET version="16.06.00.029", display_choices="public|school|academic|research|private|society or association|corporate|government|religious organization|subscription" WHERE variable="UsageStatsLibraryType"; +UPDATE systempreferences SET version="16.06.00.029", options="Afghanistan|Albania|Algeria|Andorra|Angola|Angitua & Deps|Argentina|Armenia|Australia|Austria|Azerbaijan|Bahamas|Bahrain|Bangladesh|Barbados|Belarus|Barbados|Belgium|Beliza|Benin|Bhutan|Bolizia|Bosnia Herz.|Botswana|Brazil|Brunei|Bulgaria|Burkina|Burundi|Cambodia|Cameroon|Canada|Capre Verde|Centr. Afr. Rep|Chad|Chile|China|Colombia|Comoros|Congo|Costa Rica|Croatia|Cuba|Cyprus|Czeck Rpublic|Denmark|Djibouti|Dominica|Dominican Rep.|East Timor|Ecuador|Egypt|El Salvador|Equator. Guinea|Eritrea|Estonia|Ethiopia|Fiji|Finland|France|Gabon|Gambia|Georgia|Germany|Ghana|Greece|Grenada|Guatemala|Guinea|Guinea-Bissau|Guyana|Haiti|Honduras|Hungary|Iceland|India|Indonesia|Iran|Iraq|Ireland|Isreal|Italy|Ivory Coast|Jamaica|Japan|Jordan|Kazakhstan|Kenya|Kiribati|Korea North|Korea South|Kosovo|Kuwait|Kyrgyzstan|Laos|Latvia|Lebanon|Lesotho|Liberia|Libya|Liechtenstein|Lithuania|Luxembourg|Macedonia|Madagascar|Malawi|Malyasia|Maldives|Mali|Malta|Marshall Isl.|Mauritania|Mauritius|Mexico|Micronesia|Moldova|Monaco|Mongolia|Montenegro|Morocco|Mozambique|Myanmar|Namibia|Nauru|Nepal|Netherlands|New Zealand|Nicaragua|Niger|Nigeria|Norway|Oman|Pakistan|Palau|Papua N. Guinea|Paraguay|Peru|Philippines|Poland|Portugal|Qatar|Romania|Russian Fed.|Rwanada|St Kitts & Nev.|St Lucia|St Vincent|Samoa|San Marino|Sao Tome|Saudi Arabia|Senegal|Serbia|Seychelles|Sierra Leone|Singapore|Slovakia|Slovenia|Solomon Islands|Somalia|South Africa|Spain|Sri Lanka|Sudan|Suriname|Swaziland|Sweden|Switzerland|Syria|Taiwan|Tajikistan|Tanzania|Thailand|Togo|Tonga|Trinidad & Tob.|Tunisia|Turkey|Turkmenistan|Tuvalu|Uganda|Ukraine|UAE|United Kingdom|USA|Uruguay|Uzbekistan|Vanuatu|Vatican City|Venezuela|Vietnam|Yemen|Zambia|Zimbabwe", display_choices="Afghanistan|Albania|Algeria|Andorra|Angola|Angitua & Deps|Argentina|Armenia|Australia|Austria|Azerbaijan|Bahamas|Bahrain|Bangladesh|Barbados|Belarus|Barbados|Belgium|Beliza|Benin|Bhutan|Bolizia|Bosnia Herz.|Botswana|Brazil|Brunei|Bulgaria|Burkina|Burundi|Cambodia|Cameroon|Canada|Capre Verde|Centr. Afr. Rep|Chad|Chile|China|Colombia|Comoros|Congo|Costa Rica|Croatia|Cuba|Cyprus|Czeck Rpublic|Denmark|Djibouti|Dominica|Dominican Rep.|East Timor|Ecuador|Egypt|El Salvador|Equator. Guinea|Eritrea|Estonia|Ethiopia|Fiji|Finland|France|Gabon|Gambia|Georgia|Germany|Ghana|Greece|Grenada|Guatemala|Guinea|Guinea-Bissau|Guyana|Haiti|Honduras|Hungary|Iceland|India|Indonesia|Iran|Iraq|Ireland|Isreal|Italy|Ivory Coast|Jamaica|Japan|Jordan|Kazakhstan|Kenya|Kiribati|Korea North|Korea South|Kosovo|Kuwait|Kyrgyzstan|Laos|Latvia|Lebanon|Lesotho|Liberia|Libya|Liechtenstein|Lithuania|Luxembourg|Macedonia|Madagascar|Malawi|Malyasia|Maldives|Mali|Malta|Marshall Isl.|Mauritania|Mauritius|Mexico|Micronesia|Moldova|Monaco|Mongolia|Montenegro|Morocco|Mozambique|Myanmar|Namibia|Nauru|Nepal|Netherlands|New Zealand|Nicaragua|Niger|Nigeria|Norway|Oman|Pakistan|Palau|Papua N. Guinea|Paraguay|Peru|Philippines|Poland|Portugal|Qatar|Romania|Russian Fed.|Rwanada|St Kitts & Nev.|St Lucia|Saint Vincent|Samoa|San Marino|Sao Tome|Saudi Arabia|Senegal|Serbia|Seychelles|Sierra Leone|Singapore|Slovakia|Slovenia|Solomon Islands|Somalia|South Africa|Spain|Sri Lanka|Sudan|Suriname|Swaziland|Sweden|Switzerland|Syria|Taiwan|Tajikistan|Tanzania|Thailand|Togo|Tonga|Trinidad & Tob.|Tunisia|Turkey|Turkmenistan|Tuvalu|Uganda|Ukraine|UAE|United Kingdom|USA|Uruguay|Uzbekistan|Vanuatu|Vatican City|Venezuela|Vietnam|Yemen|Zambia|Zimbabwe" WHERE variable="UsageStatsCountry"; +UPDATE systempreferences SET version="16.06.00.030", display_choices="First column of the table|Home library|Holding library" WHERE variable="OPACHoldingsDefaultSortField"; +UPDATE systempreferences SET version="16.06.00.031", display_choices="Do not display and prefill|Display and prefill" WHERE variable="PatronSelfRegistrationPrefillForm"; +UPDATE systempreferences SET version="16.06.00.035", display_choices="Don't allow|Allow" WHERE variable="AllowItemsOnHoldCheckoutSCO"; +UPDATE systempreferences SET version="16.06.00.036", display_choices="Disable|Enable" WHERE variable="HouseboundModule"; +UPDATE systempreferences SET version="16.06.00.037", display_choices="Don't enable|Enable" WHERE variable="ArticleRequests"; +UPDATE systempreferences SET version="16.06.00.037", display_choices="Title|Author|Volume|Issue|Date|Pages|Chapters" WHERE variable="ArticleRequestsMandatoryFields"; +UPDATE systempreferences SET version="16.06.00.037", display_choices="Title|Author|Volume|Issue|Date|Pages|Chapters" WHERE variable="ArticleRequestsMandatoryFieldsItemsOnly"; +UPDATE systempreferences SET version="16.06.00.037", display_choices="Title|Author|Volume|Issue|Date|Pages|Chapters" WHERE variable="ArticleRequestsMandatoryFieldsRecordOnly"; +UPDATE systempreferences SET version="16.06.00.038", display_choices="surname,firstname,othernames,cardnumber,userid" WHERE variable="DefaultPatronSearchFields"; +UPDATE systempreferences SET version="16.06.00.041", display_choices="don't|do" WHERE variable="AggressiveMatchOnISSN"; +UPDATE systempreferences SET version="16.06.00.045", display_choices="current membership expiry date.|current date.|the latter of the current and expiry date." WHERE variable="BorrowerRenewalPeriodBase"; UPDATE systempreferences SET version="16.06.00.049" WHERE variable="ReplytoDefault"; UPDATE systempreferences SET version="16.06.00.049" WHERE variable="ReturnpathDefault"; -UPDATE systempreferences SET version="16.12.00.005" WHERE variable="AuthorityMergeMode"; +UPDATE systempreferences SET version="16.12.00.005", display_choices="loose|strict" WHERE variable="AuthorityMergeMode"; UPDATE systempreferences SET version="16.12.00.008" WHERE variable="MarcItemFieldsToOrder"; -UPDATE systempreferences SET version="16.12.00.009" WHERE variable="OPACHoldsIfAvailableAtPickup"; +UPDATE systempreferences SET version="16.12.00.009", display_choices="Don't allow|Allow" WHERE variable="OPACHoldsIfAvailableAtPickup"; UPDATE systempreferences SET version="16.12.00.009" WHERE variable="OPACHoldsIfAvailableAtPickupExceptions"; -UPDATE systempreferences SET version="16.12.00.010" WHERE variable="OverDriveCirculation"; -UPDATE systempreferences SET version="16.12.00.012" WHERE variable="OpacNewsLibrarySelect"; -UPDATE systempreferences SET version="16.12.00.013" WHERE variable="CircSidebar"; -UPDATE systempreferences SET version="16.12.00.014" WHERE variable="LoadSearchHistoryToTheFirstLoggedUser"; +UPDATE systempreferences SET version="16.12.00.010", display_choices="Don't enable|Enable" WHERE variable="OverDriveCirculation"; +UPDATE systempreferences SET version="16.12.00.012", display_choices="Don't display|Display" WHERE variable="OpacNewsLibrarySelect"; +UPDATE systempreferences SET version="16.12.00.013", display_choices="Deactivate|Activate" WHERE variable="CircSidebar"; +UPDATE systempreferences SET version="16.12.00.014", display_choices="Don't load|Load" WHERE variable="LoadSearchHistoryToTheFirstLoggedUser"; UPDATE systempreferences SET version="16.12.00.015" WHERE variable="UsageStatsGeolocation"; -UPDATE systempreferences SET version="16.12.00.015" WHERE variable="UsageStatsLibrariesInfo"; +UPDATE systempreferences SET version="16.12.00.015", display_choices="Do not Share|Share" WHERE variable="UsageStatsLibrariesInfo"; UPDATE systempreferences SET version="16.12.00.015" WHERE variable="UsageStatsPublicID"; -UPDATE systempreferences SET version="16.12.00.017" WHERE variable="CumulativeRestrictionPeriods"; -UPDATE systempreferences SET version="16.12.00.020" WHERE variable="HoldFeeMode"; -UPDATE systempreferences SET version="16.12.00.021" WHERE variable="RenewalLog"; +UPDATE systempreferences SET version="16.12.00.017", display_choices="Don't cumulate|Cumulate" WHERE variable="CumulativeRestrictionPeriods"; +UPDATE systempreferences SET version="16.12.00.020", display_choices="any time a hold is placed.|only if all items are checked out and the record has at least one hold already.|any time a hold is collected." WHERE variable="HoldFeeMode"; +UPDATE systempreferences SET version="16.12.00.021", display_choices="Don't log|Log" WHERE variable="RenewalLog"; UPDATE systempreferences SET version="16.12.00.023" WHERE variable="AuthorityMergeLimit"; UPDATE systempreferences SET version="16.12.00.024" WHERE variable="OverdueNoticeBcc"; +UPDATE systempreferences SET version="16.12.00.024" WHERE variable="NoticeBcc"; UPDATE systempreferences SET version="16.12.00.025" WHERE variable="UploadPurgeTemporaryFilesDays"; -UPDATE systempreferences SET version="16.12.00.028" WHERE variable="AddressFormat"; -UPDATE systempreferences SET version="16.12.00.029" WHERE variable="AllowCheckoutNotes"; -UPDATE systempreferences SET version="16.12.00.032" WHERE variable="ExcludeHolidaysFromMaxPickUpDelay"; -UPDATE systempreferences SET version="16.12.00.033" WHERE variable="TranslateNotices"; -UPDATE systempreferences SET version="16.12.00.034" WHERE variable="OPACFineNoRenewalsBlockAutoRenew"; +UPDATE systempreferences SET version="16.12.00.028", display_choices="Germany style ([Address][Street number] - [ZIP/Postal Code] - [Country])|French style ([Street number][Address] - [ZIP/Postal COde][City] - [Country])|US style ([Street number], [Address] - [City], [ ZIP/Postal Code], [Country})" WHERE variable="AddressFormat"; +UPDATE systempreferences SET version="16.12.00.029", display_choices="Don't allow|Allow" WHERE variable="AllowCheckoutNotes"; +UPDATE systempreferences SET version="16.12.00.032", display_choices="Don't allow|Allow" WHERE variable="ExcludeHolidaysFromMaxPickUpDelay"; +UPDATE systempreferences SET version="16.12.00.033", display_choices="Don't allow|Allow" WHERE variable="TranslateNotices"; +UPDATE systempreferences SET version="16.12.00.034", display_choices="Block|Allow" WHERE variable="OPACFineNoRenewalsBlockAutoRenew"; UPDATE systempreferences SET version="16.12.00.036" WHERE variable="NumSavedReports"; UPDATE systempreferences SET version="16.12.00.037" WHERE variable="FailedLoginAttempts"; UPDATE systempreferences SET version="16.12.00.038" WHERE variable="ExportRemoveFields"; -UPDATE systempreferences SET version="16.12.00.039" WHERE variable="TalkingTechItivaPhoneNotification"; +UPDATE systempreferences SET version="16.12.00.039", display_choices="Disable|Enable" WHERE variable="TalkingTechItivaPhoneNotification"; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index e227125..e469aae 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2252,6 +2252,7 @@ CREATE TABLE `userflags` ( `flag` varchar(30) default NULL, `flagdesc` varchar(255) default NULL, `defaulton` int(11) default NULL, + `featuretoolrequired` int(1) default NULL, PRIMARY KEY (`bit`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/installer/featurereleasetool.pl b/installer/featurereleasetool.pl index 88f24db..2307525 100755 --- a/installer/featurereleasetool.pl +++ b/installer/featurereleasetool.pl @@ -34,7 +34,7 @@ use C4::NewsChannels; use Data::Dumper; use Koha::DateUtils; use Date::Calc qw/Date_to_Days Today/; - +our $lang; my $query = new CGI; my $step = $query->param('step'); @@ -106,16 +106,28 @@ my @prefsloop; my @lines = split /\n/, $file; foreach my $line (@lines) { my $query = qq| - SELECT variable, value, options, explanation from systempreferences WHERE version= ? |; + SELECT variable, value, options, display_choices, explanation, type from systempreferences WHERE version= ? |; my $sth = $dbh->prepare($query); $sth->execute($line); - while (my ($variable, $value, $options, $explanation) =$sth->fetchrow) { - push @prefsloop, { - variable => $variable, - value => $value, - options => $options, - explanation => $explanation, - }; + while (my ($variable, $value, $options, $display_choices, $explanation, $type) = $sth->fetchrow) { + if ($options) { + push @prefsloop, { + variable => $variable, + value => $value, + options => $options, + explanation => $explanation, + type => $type, + display_choices => $display_choices, + }; + } else { + push @prefsloop, { + variable => $variable, + value => $value, + explanation => $explanation, + type => $type, + display_choices => $display_choices, + }; + } } }; @@ -123,6 +135,7 @@ $template->param( prefs => \@prefsloop, submitted_form => $op ); #If the user has finished using the feature release change tool then redirect to mainpage if ( $op && $op eq 'finished' ) { + $dbh->do(q{UPDATE userflags SET featuretoolrequired = 0 WHERE bit = ?}, {}, 0); print $query->redirect("/cgi-bin/koha/mainpage.pl"); exit; } @@ -138,7 +151,6 @@ elsif ( $op && $op eq 'save' ) { #Submit changed systempreferences } } - #Submit news item my $id = $query->param('id'); my $title = $query->param('title'); diff --git a/installer/install.pl b/installer/install.pl index c3d31a4..1ed2cca 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -226,6 +226,12 @@ elsif ( $step && $step == 3 ) { # # we have finished, just redirect to mainpage. # + $dbh->do(q{UPDATE userflags SET featuretoolrequired = 1 WHERE bit = ?}, {}, 0); + my $dbversion = $query->param('dbversion'); + my $dbquery = qq| + UPDATE systempreferences SET value = ? WHERE variable = "PreviousVersion" |; + my $sth = $dbh->prepare($dbquery); + $sth->execute($dbversion); print $query->redirect("/cgi-bin/koha/mainpage.pl"); exit; } @@ -383,7 +389,7 @@ elsif ( $step && $step == 3 ) { my $now = POSIX::strftime( "%Y-%m-%dT%H:%M:%S", localtime() ); my $logdir = C4::Context->config('logdir'); - warn my $dbversion = C4::Context->preference('Version'); + my $dbversion = C4::Context->preference('Version'); my $kohaversion = Koha::version; $kohaversion =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/; @@ -406,7 +412,7 @@ elsif ( $step && $step == 3 ) { my $fh; open( $fh, "<", $logfilepath ) or die "Cannot open log file $logfilepath: $!"; - warn my @report = <$fh>; + my @report = <$fh>; close $fh; if (@report) { $template->param( update_report => @@ -478,7 +484,7 @@ elsif ( $step && $step == 3 ) { # if there is none, then we need to install the database # if ( C4::Context->preference('Version') ) { - warn my $dbversion = C4::Context->preference('Version'); + my $dbversion = C4::Context->preference('Version'); $dbversion =~ /(.*)\.(..)(..)(...)/; $dbversion = "$1.$2.$3.$4"; $template->param( diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/featurereleasetool.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/featurereleasetool.tt index c1778a7..e51bace 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/featurereleasetool.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/featurereleasetool.tt @@ -60,6 +60,21 @@ td, th { .preftitle { text-align:center; } + +.pref_text_input { + width: 90%; + height: 30px; +} + +.pref_binary_input { + width: 90%; + height: 30px; +} + +.pref_choice_input { + width: 90%; + height: 30px; +} [% IF ( finish ) %][% END %] @@ -77,9 +92,10 @@ td, th {
-

New sysprefs added to Koha since [% dbversion %]

+

New sysprefs added to Koha since Koha [% dbversion %]

-
+

The system preferences listed below were all installed in the update from Koha [% dbversion %] to Koha [% kohaversion %]. The default values of each of the system preferences are displayed for you to review and modify and submit by selecting the 'Save all preferences' button

+ @@ -95,12 +111,52 @@ td, th { [% END %] @@ -117,7 +173,10 @@ td, th { Koha 17.05 release notes link
-

Next and submit

+ + +

+ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt index 9af8e6e..1b55e80 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt @@ -247,6 +247,7 @@

Everything went okay. Update done.

[% END %]

Continue to feature release tool

+

Skip feature release tool and login to Koha

[% END # / IF updatestructure %] diff --git a/mainpage.pl b/mainpage.pl index c1df82b..cb3b907 100755 --- a/mainpage.pl +++ b/mainpage.pl @@ -89,6 +89,22 @@ $template->param( # unless ($loggedinuser) { $template->param(adminWarning => 1); +} else { + my $patron_has_flags = Koha::Patron->check_if_patrons_have_flags(); + if ($patron_has_flags) { + my $featuretoolrequired = C4::Auth->check_feature_tool_required(); + if ($featuretoolrequired) { + my $kohaversion = Koha::version(); + my $dbh = C4::Context->dbh; + my $dbquery = qq| + SELECT value FROM systempreferences WHERE variable="PreviousVersion" |; + my $sth = $dbh->prepare($dbquery); + $sth->execute(); + my $dbversion = $sth->fetchrow; + print $query->redirect("/cgi-bin/koha/installer/featurereleasetool.pl?dbversion=$dbversion&kohaversion=$kohaversion"); + exit; + } + } } output_html_with_http_headers $query, $cookie, $template->output; -- 2.1.4
[% pref.explanation %] + - [% IF (pref.value != '') %] - - [% ELSE %] - No default value - [% END %] + [% IF (pref.value != '') %] + [% IF (pref.type == "Integer") || (pref.type == "integer" ) || (pref.type == "Free") %] + + [% ELSIF (pref.type == "Choice") %] + + [% ELSIF (pref.type == "YesNo") %] + + [% END %] + [% ELSE %] + No default value + [% END %]