View | Details | Raw Unified | Return to bug 18645
Collapse All | Expand All

(-)a/C4/Auth.pm (+16 lines)
Lines 2029-2034 sub get_all_subpermissions { Link Here
2029
    return $all_perms;
2029
    return $all_perms;
2030
}
2030
}
2031
2031
2032
=head2 check_feature_tool_required
2033
2034
my $featuretoolrequired = C4::Auth->check_feature_tool_required();
2035
2036
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
2037
2038
=cut
2039
sub check_feature_tool_required {
2040
    my $dbh = C4::Context->dbh;
2041
    my $sth = $dbh->prepare("
2042
       SELECT featuretoolrequired FROM userflags WHERE bit = 0");
2043
    $sth->execute();
2044
    my $onboardingrequired = $sth->fetchrow();
2045
    return $onboardingrequired;
2046
}
2047
2032
=head2 haspermission
2048
=head2 haspermission
2033
2049
2034
  $flags = ($userid, $flagsrequired);
2050
  $flags = ($userid, $flagsrequired);
(-)a/Koha/Patron.pm (+19 lines)
Lines 635-640 sub get_enrollable_clubs { Link Here
635
    return wantarray ? $e->as_list : $e;
635
    return wantarray ? $e->as_list : $e;
636
}
636
}
637
637
638
=head3 check_if_patrons_have_flags
639
640
my $patron_has_flags = Koha::Patron->check_if_patrons_have_flag    s();
641
642
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
643
644
=cut
645
sub check_if_patrons_have_flags {
646
     my $dbh = C4::Context->dbh;
647
     my $sth = $dbh->prepare("
648
          select * from borrowers where flags != 'NULL'");
649
     $sth->execute();
650
     my $no_patrons_with_flags;
651
     if ( $sth->rows ) {
652
          $no_patrons_with_flags = 1;
653
     }
654
     return $no_patrons_with_flags;
655
}
656
638
=head3 account_locked
657
=head3 account_locked
639
658
640
my $is_locked = $patron->account_locked
659
my $is_locked = $patron->account_locked
(-)a/admin/preferences.pl (-1 / +3 lines)
Lines 165-171 sub TransformPrefsToHTML { Link Here
165
                        } else {
165
                        } else {
166
                            $value = $row->{'value'};
166
                            $value = $row->{'value'};
167
                        }
167
                        }
168
                        my $chunk = _get_chunk( $value, %$piece );
168
                        my $source = "preferences";
169
                        my $chunk = _get_chunk( $value, $source, %$piece );
169
170
170
                        # No highlighting of inputs yet, but would be useful
171
                        # No highlighting of inputs yet, but would be useful
171
                        $chunk->{'highlighted'} = 1 if ( $searchfield && $name =~ /^$searchfield$/i );
172
                        $chunk->{'highlighted'} = 1 if ( $searchfield && $name =~ /^$searchfield$/i );
Lines 225-230 sub SearchPrefs { Link Here
225
    my ( $input, $searchfield ) = @_;
226
    my ( $input, $searchfield ) = @_;
226
    my @tabs;
227
    my @tabs;
227
228
229
    warn $input, $searchfield;
228
    my %tab_files = _get_pref_files( $input );
230
    my %tab_files = _get_pref_files( $input );
229
    our @terms = split( /\s+/, $searchfield );
231
    our @terms = split( /\s+/, $searchfield );
230
232
(-)a/installer/data/mysql/atomicupdate/18645_adding_version_column_to_systempreferences_table.sql (-41 / +44 lines)
Lines 1-66 Link Here
1
ALTER TABLE systempreferences ADD version varchar(12) DEFAULT NULL;
1
ALTER TABLE systempreferences ADD version varchar(12) DEFAULT NULL;
2
ALTER TABLE systempreferences ADD display_choices mediumtext DEFAULT NULL;
3
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");
2
UPDATE systempreferences SET version="16.06.00.003" WHERE variable ="MaxItemsToProcessForBatchMod";
4
UPDATE systempreferences SET version="16.06.00.003" WHERE variable ="MaxItemsToProcessForBatchMod";
3
UPDATE systempreferences SET version="16.06.00.003" WHERE variable ="MaxItemsToDisplayForBatchDel";
5
UPDATE systempreferences SET version="16.06.00.003" WHERE variable ="MaxItemsToDisplayForBatchDel";
4
UPDATE systempreferences SET version="16.06.00.004" WHERE variable ="OPACXSLTListsDisplay";
6
UPDATE systempreferences SET version="16.06.00.004" WHERE variable ="OPACXSLTListsDisplay";
5
UPDATE systempreferences SET version="16.06.00.004" WHERE variable ="XSLTListsDisplay";
7
UPDATE systempreferences SET version="16.06.00.004" WHERE variable ="XSLTListsDisplay";
6
UPDATE systempreferences SET version="16.06.00.005" WHERE variable ="XSLTListsDisplay";
8
UPDATE systempreferences SET version="16.06.00.005" WHERE variable ="XSLTListsDisplay";
7
UPDATE systempreferences SET version="16.06.00.006" WHERE variable="RefundLostOnReturnControl";
9
UPDATE systempreferences SET version="16.06.00.006", display_choices="check-in library.|item home branch.|item holding branch." WHERE variable="RefundLostOnReturnControl";
8
UPDATE systempreferences SET version="16.06.00.007" WHERE variable="PatronQuickAddFields";
10
UPDATE systempreferences SET version="16.06.00.007" WHERE variable="PatronQuickAddFields";
9
UPDATE systempreferences SET version="16.06.00.008" WHERE variable="CheckPrevCheckout";
11
UPDATE systempreferences SET version="16.06.00.008", display_choices="Do|Unless overridden, do|Unless overridden, do not|Do not" WHERE variable="CheckPrevCheckout";
10
UPDATE systempreferences SET version="16.06.00.009" WHERE variable="IntranetCatalogSearchPulldown";
12
UPDATE systempreferences SET version="16.06.00.009", display_choices="Don't show|Show" WHERE variable="IntranetCatalogSearchPulldown";
11
UPDATE systempreferences SET version="16.06.00.010" WHERE variable="MaxOpenSuggestions";
13
UPDATE systempreferences SET version="16.06.00.010" WHERE variable="MaxOpenSuggestions";
12
UPDATE systempreferences SET version="16.06.00.011" WHERE variable="NovelistSelectStaffEnabled";
14
UPDATE systempreferences SET version="16.06.00.011", display_choices="Don't add|add" WHERE variable="NovelistSelectStaffEnabled";
13
UPDATE systempreferences SET version="16.06.00.011" WHERE variable="NovelistSelectStaffView";
15
UPDATE systempreferences SET version="16.06.00.011", display_choices="in a tab|above the holdings table|below the holdings table" WHERE variable="NovelistSelectStaffView";
14
UPDATE systempreferences SET version="16.06.00.013" WHERE variable="OPACResultsLibrary";
16
UPDATE systempreferences SET version="16.06.00.013", display_choices="home library|current location" WHERE variable="OPACResultsLibrary";
15
UPDATE systempreferences SET version="16.06.00.015" WHERE variable="HoldsLog";
17
UPDATE systempreferences SET version="16.06.00.015", display_choices="Don't log|Log" WHERE variable="HoldsLog";
16
UPDATE systempreferences SET version="16.06.00.020" WHERE variable="SwitchOnSiteCheckouts";
18
UPDATE systempreferences SET version="16.06.00.020", display_choices="Don't switch|Switch" WHERE variable="SwitchOnSiteCheckouts";
17
UPDATE systempreferences SET version="16.06.00.027" WHERE variable="TrackLastPatronActivity";
19
UPDATE systempreferences SET version="16.06.00.027", display_choices="Don't|Do" WHERE variable="TrackLastPatronActivity";
18
UPDATE systempreferences SET version="16.06.00.021" WHERE variable="PatronSelfRegistrationEmailMustBeUnique";
20
UPDATE systempreferences SET version="16.06.00.021", display_choices="Do not consider|Consider" WHERE variable="PatronSelfRegistrationEmailMustBeUnique";
19
UPDATE systempreferences SET version="16.06.00.023" WHERE variable="timeout";
21
UPDATE systempreferences SET version="16.06.00.023" WHERE variable="timeout";
20
UPDATE systempreferences SET version="16.06.00.025" WHERE variable="makePreviousSerialAvailable";
22
UPDATE systempreferences SET version="16.06.00.025", display_choices="Do not make|Make" WHERE variable="makePreviousSerialAvailable";
21
UPDATE systempreferences SET version="16.06.00.026" WHERE variable="PatronSelfRegistrationLibraryList";
23
UPDATE systempreferences SET version="16.06.00.026" WHERE variable="PatronSelfRegistrationLibraryList";
22
UPDATE systempreferences SET version="16.06.00.027" WHERE variable="TrackLastPatronActivity";
24
UPDATE systempreferences SET version="16.06.00.027", display_choices="Don't|Do" WHERE variable="TrackLastPatronActivity";
23
UPDATE systempreferences SET version="16.06.00.029" WHERE variable="UsageStatsLibraryType";
25
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";
24
UPDATE systempreferences SET version="16.06.00.029" WHERE variable="UsageStatsCountry";
26
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";
25
UPDATE systempreferences SET version="16.06.00.030" WHERE variable="OPACHoldingsDefaultSortField";
27
UPDATE systempreferences SET version="16.06.00.030", display_choices="First column of the table|Home library|Holding library" WHERE variable="OPACHoldingsDefaultSortField";
26
UPDATE systempreferences SET version="16.06.00.031" WHERE variable="PatronSelfRegistrationPrefillForm";
28
UPDATE systempreferences SET version="16.06.00.031", display_choices="Do not display and prefill|Display and prefill" WHERE variable="PatronSelfRegistrationPrefillForm";
27
UPDATE systempreferences SET version="16.06.00.035" WHERE variable="AllowItemsOnHoldCheckoutSCO";
29
UPDATE systempreferences SET version="16.06.00.035", display_choices="Don't allow|Allow" WHERE variable="AllowItemsOnHoldCheckoutSCO";
28
UPDATE systempreferences SET version="16.06.00.036" WHERE variable="HouseboundModule";
30
UPDATE systempreferences SET version="16.06.00.036", display_choices="Disable|Enable" WHERE variable="HouseboundModule";
29
UPDATE systempreferences SET version="16.06.00.037" WHERE variable="ArticleRequests";
31
UPDATE systempreferences SET version="16.06.00.037", display_choices="Don't enable|Enable" WHERE variable="ArticleRequests";
30
UPDATE systempreferences SET version="16.06.00.037" WHERE variable="ArticleRequestsMandatoryFields";
32
UPDATE systempreferences SET version="16.06.00.037", display_choices="Title|Author|Volume|Issue|Date|Pages|Chapters" WHERE variable="ArticleRequestsMandatoryFields";
31
UPDATE systempreferences SET version="16.06.00.037" WHERE variable="ArticleRequestsMandatoryFieldsItemsOnly";
33
UPDATE systempreferences SET version="16.06.00.037", display_choices="Title|Author|Volume|Issue|Date|Pages|Chapters" WHERE variable="ArticleRequestsMandatoryFieldsItemsOnly";
32
UPDATE systempreferences SET version="16.06.00.037" WHERE variable="ArticleRequestsMandatoryFieldsRecordOnly";
34
UPDATE systempreferences SET version="16.06.00.037", display_choices="Title|Author|Volume|Issue|Date|Pages|Chapters" WHERE variable="ArticleRequestsMandatoryFieldsRecordOnly";
33
UPDATE systempreferences SET version="16.06.00.038" WHERE variable="DefaultPatronSearchFields";
35
UPDATE systempreferences SET version="16.06.00.038", display_choices="surname,firstname,othernames,cardnumber,userid" WHERE variable="DefaultPatronSearchFields";
34
UPDATE systempreferences SET version="16.06.00.041" WHERE variable="AggressiveMatchOnISSN";
36
UPDATE systempreferences SET version="16.06.00.041", display_choices="don't|do" WHERE variable="AggressiveMatchOnISSN";
35
UPDATE systempreferences SET version="16.06.00.045" WHERE variable="BorrowerRenewalPeriodBase";
37
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";
36
UPDATE systempreferences SET version="16.06.00.049" WHERE variable="ReplytoDefault";
38
UPDATE systempreferences SET version="16.06.00.049" WHERE variable="ReplytoDefault";
37
UPDATE systempreferences SET version="16.06.00.049" WHERE variable="ReturnpathDefault";
39
UPDATE systempreferences SET version="16.06.00.049" WHERE variable="ReturnpathDefault";
38
UPDATE systempreferences SET version="16.12.00.005" WHERE variable="AuthorityMergeMode";
40
UPDATE systempreferences SET version="16.12.00.005", display_choices="loose|strict" WHERE variable="AuthorityMergeMode";
39
UPDATE systempreferences SET version="16.12.00.008" WHERE variable="MarcItemFieldsToOrder";
41
UPDATE systempreferences SET version="16.12.00.008" WHERE variable="MarcItemFieldsToOrder";
40
UPDATE systempreferences SET version="16.12.00.009" WHERE variable="OPACHoldsIfAvailableAtPickup";
42
UPDATE systempreferences SET version="16.12.00.009", display_choices="Don't allow|Allow" WHERE variable="OPACHoldsIfAvailableAtPickup";
41
UPDATE systempreferences SET version="16.12.00.009" WHERE variable="OPACHoldsIfAvailableAtPickupExceptions";
43
UPDATE systempreferences SET version="16.12.00.009" WHERE variable="OPACHoldsIfAvailableAtPickupExceptions";
42
UPDATE systempreferences SET version="16.12.00.010" WHERE variable="OverDriveCirculation";
44
UPDATE systempreferences SET version="16.12.00.010", display_choices="Don't enable|Enable" WHERE variable="OverDriveCirculation";
43
UPDATE systempreferences SET version="16.12.00.012" WHERE variable="OpacNewsLibrarySelect";
45
UPDATE systempreferences SET version="16.12.00.012", display_choices="Don't display|Display" WHERE variable="OpacNewsLibrarySelect";
44
UPDATE systempreferences SET version="16.12.00.013" WHERE variable="CircSidebar";
46
UPDATE systempreferences SET version="16.12.00.013", display_choices="Deactivate|Activate" WHERE variable="CircSidebar";
45
UPDATE systempreferences SET version="16.12.00.014" WHERE variable="LoadSearchHistoryToTheFirstLoggedUser";
47
UPDATE systempreferences SET version="16.12.00.014", display_choices="Don't load|Load" WHERE variable="LoadSearchHistoryToTheFirstLoggedUser";
46
UPDATE systempreferences SET version="16.12.00.015" WHERE variable="UsageStatsGeolocation";
48
UPDATE systempreferences SET version="16.12.00.015" WHERE variable="UsageStatsGeolocation";
47
UPDATE systempreferences SET version="16.12.00.015" WHERE variable="UsageStatsLibrariesInfo";
49
UPDATE systempreferences SET version="16.12.00.015", display_choices="Do not Share|Share" WHERE variable="UsageStatsLibrariesInfo";
48
UPDATE systempreferences SET version="16.12.00.015" WHERE variable="UsageStatsPublicID";
50
UPDATE systempreferences SET version="16.12.00.015" WHERE variable="UsageStatsPublicID";
49
UPDATE systempreferences SET version="16.12.00.017" WHERE variable="CumulativeRestrictionPeriods";
51
UPDATE systempreferences SET version="16.12.00.017", display_choices="Don't cumulate|Cumulate" WHERE variable="CumulativeRestrictionPeriods";
50
UPDATE systempreferences SET version="16.12.00.020" WHERE variable="HoldFeeMode";
52
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";
51
UPDATE systempreferences SET version="16.12.00.021" WHERE variable="RenewalLog";
53
UPDATE systempreferences SET version="16.12.00.021", display_choices="Don't log|Log"  WHERE variable="RenewalLog";
52
UPDATE systempreferences SET version="16.12.00.023" WHERE variable="AuthorityMergeLimit";
54
UPDATE systempreferences SET version="16.12.00.023" WHERE variable="AuthorityMergeLimit";
53
UPDATE systempreferences SET version="16.12.00.024" WHERE variable="OverdueNoticeBcc";
55
UPDATE systempreferences SET version="16.12.00.024" WHERE variable="OverdueNoticeBcc";
56
UPDATE systempreferences SET version="16.12.00.024" WHERE variable="NoticeBcc";
54
UPDATE systempreferences SET version="16.12.00.025" WHERE variable="UploadPurgeTemporaryFilesDays";
57
UPDATE systempreferences SET version="16.12.00.025" WHERE variable="UploadPurgeTemporaryFilesDays";
55
UPDATE systempreferences SET version="16.12.00.028" WHERE variable="AddressFormat";
58
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";
56
UPDATE systempreferences SET version="16.12.00.029" WHERE variable="AllowCheckoutNotes";
59
UPDATE systempreferences SET version="16.12.00.029", display_choices="Don't allow|Allow" WHERE variable="AllowCheckoutNotes";
57
UPDATE systempreferences SET version="16.12.00.032" WHERE variable="ExcludeHolidaysFromMaxPickUpDelay";
60
UPDATE systempreferences SET version="16.12.00.032", display_choices="Don't allow|Allow" WHERE variable="ExcludeHolidaysFromMaxPickUpDelay";
58
UPDATE systempreferences SET version="16.12.00.033" WHERE variable="TranslateNotices";
61
UPDATE systempreferences SET version="16.12.00.033", display_choices="Don't allow|Allow" WHERE variable="TranslateNotices";
59
UPDATE systempreferences SET version="16.12.00.034" WHERE variable="OPACFineNoRenewalsBlockAutoRenew";
62
UPDATE systempreferences SET version="16.12.00.034", display_choices="Block|Allow" WHERE variable="OPACFineNoRenewalsBlockAutoRenew";
60
UPDATE systempreferences SET version="16.12.00.036" WHERE variable="NumSavedReports";
63
UPDATE systempreferences SET version="16.12.00.036" WHERE variable="NumSavedReports";
61
UPDATE systempreferences SET version="16.12.00.037" WHERE variable="FailedLoginAttempts";
64
UPDATE systempreferences SET version="16.12.00.037" WHERE variable="FailedLoginAttempts";
62
UPDATE systempreferences SET version="16.12.00.038" WHERE variable="ExportRemoveFields";
65
UPDATE systempreferences SET version="16.12.00.038" WHERE variable="ExportRemoveFields";
63
UPDATE systempreferences SET version="16.12.00.039" WHERE variable="TalkingTechItivaPhoneNotification";
66
UPDATE systempreferences SET version="16.12.00.039", display_choices="Disable|Enable"  WHERE variable="TalkingTechItivaPhoneNotification";
64
67
65
68
66
69
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 2252-2257 CREATE TABLE `userflags` ( Link Here
2252
  `flag` varchar(30) default NULL,
2252
  `flag` varchar(30) default NULL,
2253
  `flagdesc` varchar(255) default NULL,
2253
  `flagdesc` varchar(255) default NULL,
2254
  `defaulton` int(11) default NULL,
2254
  `defaulton` int(11) default NULL,
2255
  `featuretoolrequired` int(1) default NULL,
2255
  PRIMARY KEY  (`bit`)
2256
  PRIMARY KEY  (`bit`)
2256
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2257
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
2257
2258
(-)a/installer/featurereleasetool.pl (-10 / +22 lines)
Lines 34-40 use C4::NewsChannels; Link Here
34
use Data::Dumper;
34
use Data::Dumper;
35
use Koha::DateUtils;
35
use Koha::DateUtils;
36
use Date::Calc qw/Date_to_Days Today/;
36
use Date::Calc qw/Date_to_Days Today/;
37
37
our $lang;
38
38
39
my $query = new CGI;
39
my $query = new CGI;
40
my $step  = $query->param('step');
40
my $step  = $query->param('step');
Lines 106-121 my @prefsloop; Link Here
106
my @lines = split /\n/, $file;
106
my @lines = split /\n/, $file;
107
foreach my $line (@lines) {
107
foreach my $line (@lines) {
108
    my $query = qq|
108
    my $query = qq|
109
       SELECT variable, value, options, explanation from systempreferences WHERE version= ? |;
109
       SELECT variable, value, options, display_choices, explanation, type from systempreferences WHERE version= ? |;
110
    my $sth = $dbh->prepare($query);
110
    my $sth = $dbh->prepare($query);
111
    $sth->execute($line);
111
    $sth->execute($line);
112
    while (my ($variable, $value, $options, $explanation) =$sth->fetchrow) {
112
    while (my ($variable, $value, $options, $display_choices, $explanation, $type) = $sth->fetchrow) {
113
        push @prefsloop, {
113
        if ($options) {
114
            variable => $variable,
114
            push @prefsloop, {
115
            value    => $value,
115
                variable => $variable,
116
            options  => $options,
116
                value    => $value,
117
            explanation => $explanation,
117
                options  => $options,
118
        };
118
                explanation => $explanation,
119
                type     => $type,
120
                display_choices  => $display_choices,
121
            };
122
        } else {
123
            push @prefsloop, {
124
                variable => $variable,
125
                value    => $value,
126
                explanation => $explanation,
127
                type     => $type,
128
                display_choices  => $display_choices,
129
            };
130
        }
119
    }
131
    }
120
};
132
};
121
133
Lines 123-128 $template->param( prefs => \@prefsloop, submitted_form => $op ); Link Here
123
135
124
#If the user has finished using the feature release change tool then redirect to mainpage
136
#If the user has finished using the feature release change tool then redirect to mainpage
125
if ( $op && $op eq 'finished' ) {
137
if ( $op && $op eq 'finished' ) {
138
    $dbh->do(q{UPDATE userflags SET featuretoolrequired = 0 WHERE bit = ?}, {}, 0);
126
    print $query->redirect("/cgi-bin/koha/mainpage.pl");
139
    print $query->redirect("/cgi-bin/koha/mainpage.pl");
127
    exit;
140
    exit;
128
}
141
}
Lines 138-144 elsif ( $op && $op eq 'save' ) { #Submit changed systempreferences Link Here
138
    }
151
    }
139
}
152
}
140
153
141
142
#Submit news item
154
#Submit news item
143
my $id      = $query->param('id');
155
my $id      = $query->param('id');
144
my $title   = $query->param('title');
156
my $title   = $query->param('title');
(-)a/installer/install.pl (-3 / +9 lines)
Lines 226-231 elsif ( $step && $step == 3 ) { Link Here
226
        #
226
        #
227
        # we have finished, just redirect to mainpage.
227
        # we have finished, just redirect to mainpage.
228
        #
228
        #
229
        $dbh->do(q{UPDATE userflags SET featuretoolrequired = 1 WHERE bit = ?}, {}, 0);
230
        my $dbversion = $query->param('dbversion');
231
        my $dbquery = qq|
232
          UPDATE systempreferences SET value = ? WHERE variable = "PreviousVersion" |;
233
        my $sth = $dbh->prepare($dbquery);
234
        $sth->execute($dbversion);
229
        print $query->redirect("/cgi-bin/koha/mainpage.pl");
235
        print $query->redirect("/cgi-bin/koha/mainpage.pl");
230
        exit;
236
        exit;
231
    }
237
    }
Lines 383-389 elsif ( $step && $step == 3 ) { Link Here
383
389
384
        my $now         = POSIX::strftime( "%Y-%m-%dT%H:%M:%S", localtime() );
390
        my $now         = POSIX::strftime( "%Y-%m-%dT%H:%M:%S", localtime() );
385
        my $logdir      = C4::Context->config('logdir');
391
        my $logdir      = C4::Context->config('logdir');
386
        warn my $dbversion   = C4::Context->preference('Version');
392
        my $dbversion   = C4::Context->preference('Version');
387
        my $kohaversion = Koha::version;
393
        my $kohaversion = Koha::version;
388
        $kohaversion =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/;
394
        $kohaversion =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/;
389
395
Lines 406-412 elsif ( $step && $step == 3 ) { Link Here
406
        my $fh;
412
        my $fh;
407
        open( $fh, "<", $logfilepath )
413
        open( $fh, "<", $logfilepath )
408
          or die "Cannot open log file $logfilepath: $!";
414
          or die "Cannot open log file $logfilepath: $!";
409
        warn my @report = <$fh>;
415
        my @report = <$fh>;
410
        close $fh;
416
        close $fh;
411
        if (@report) {
417
        if (@report) {
412
            $template->param( update_report =>
418
            $template->param( update_report =>
Lines 478-484 elsif ( $step && $step == 3 ) { Link Here
478
     # if there is none, then we need to install the database
484
     # if there is none, then we need to install the database
479
     #
485
     #
480
            if ( C4::Context->preference('Version') ) {
486
            if ( C4::Context->preference('Version') ) {
481
                warn my $dbversion = C4::Context->preference('Version');
487
                my $dbversion = C4::Context->preference('Version');
482
                $dbversion =~ /(.*)\.(..)(..)(...)/;
488
                $dbversion =~ /(.*)\.(..)(..)(...)/;
483
                $dbversion = "$1.$2.$3.$4";
489
                $dbversion = "$1.$2.$3.$4";
484
                $template->param(
490
                $template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/featurereleasetool.tt (-8 / +67 lines)
Lines 60-65 td, th { Link Here
60
.preftitle {
60
.preftitle {
61
    text-align:center;
61
    text-align:center;
62
}
62
}
63
64
.pref_text_input {
65
    width: 90%;
66
    height: 30px;
67
}
68
69
.pref_binary_input {
70
    width: 90%;
71
    height: 30px;
72
}
73
74
.pref_choice_input {
75
    width: 90%;
76
    height: 30px;
77
}
63
</style>
78
</style>
64
79
65
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %]
80
[% IF ( finish ) %]<meta http-equiv="refresh" content="10; url=/cgi-bin/koha/mainpage.pl">[% END %]
Lines 77-85 td, th { Link Here
77
                </div>
92
                </div>
78
93
79
                <div id="syspref" class="content">
94
                <div id="syspref" class="content">
80
                    <h2>New sysprefs added to Koha since [% dbversion %]</h2>
95
                    <h2>New sysprefs added to Koha since Koha [% dbversion %]</h2>
81
                    <div class="prefs-tab">
96
                    <div class="prefs-tab">
82
                            <form action="/cgi-bin/koha/installer/featurereleasetool.pl?dbversion=[%dbversion%]&kohaversion=[%kohaversion%]" method="post">
97
                    <p> 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 </p>
98
                            <form name="featurereleaseform" action="/cgi-bin/koha/installer/featurereleasetool.pl?dbversion=[%dbversion%]&kohaversion=[%kohaversion%]" method="post">
83
                                <input type="hidden" name="op" value="save" />
99
                                <input type="hidden" name="op" value="save" />
84
                                    <table id="releasetoolpreftable">
100
                                    <table id="releasetoolpreftable">
85
                                        <tr>
101
                                        <tr>
Lines 95-106 td, th { Link Here
95
                                            </td>
111
                                            </td>
96
                                            <td>
112
                                            <td>
97
                                                    [% pref.explanation %]
113
                                                    [% pref.explanation %]
114
                                            </td>
98
                                            <td>
115
                                            <td>
99
                                            [% IF (pref.value != '') %]
116
                                                [% IF (pref.value != '') %]
100
                                                <textarea type="text" name="pref_[%pref.variable%]" id="pref_[% pref.variable%]" value="[% pref.value| html %]"> [%pref.value %] </textarea>
117
                                                    [% IF (pref.type == "Integer") || (pref.type == "integer" ) || (pref.type == "Free") %]
101
                                            [% ELSE %]
118
                                                        <input type="text" class="pref_text_input" name="pref_[% pref.variable %]" value="[% pref.value %]">
102
                                                No default value
119
                                                    [% ELSIF (pref.type == "Choice") %]
103
                                            [% END %]
120
                                                        <select name="pref_[% pref.variable %]" class="pref_choice_input">
121
                                                            [% option_value = pref.options.split("\\|") %]
122
                                                            [% option_text = pref.display_choices.split("\\|") %]
123
                                                            [% IF pref.value == option_value.0 %]
124
                                                                <option value="[% option_value.0 %]" selected="selected">[% option_text.0 %] </option>
125
                                                                <option value="[% option_value.1 %]">[% option_text.1 %] </option>
126
                                                                <option value="[% option_value.2 %]">[% option_text.2 %] </option>
127
                                                                <option value="[% option_value.3 %]">[% option_text.3 %] </option>
128
                                                            [% ELSIF pref.value == option_value.1 %]
129
                                                                <option value="[% option_value.0 %]">[% option_text.0 %] </option>
130
                                                                <option value="[% option_value.1 %]" selected="selected">[% option_text.1 %] </option>
131
                                                                <option value="[% option_value.2 %]">[% option_text.2 %] </option>
132
                                                                <option value="[% option_value.3 %]">[% option_text.3 %] </option>
133
                                                            [% ELSIF pref.value == option_value.2 %]
134
                                                                <option value="[% option_value.0 %]">[% option_text.0 %] </option>
135
                                                                <option value="[% option_value.1 %]">[% option_text.1 %] </option>
136
                                                                <option value="[% option_value.2 %]" selected="selected">[% option_text.2 %] </option>
137
                                                                <option value="[% option_value.3 %]">[% option_text.3 %] </option>
138
                                                            [% ELSIF pref.value == option_value.3 %]
139
                                                                <option value="[% option_value.0 %]">[% option_text.0 %] </option>
140
                                                                <option value="[% option_value.1 %]">[% option_text.1 %] </option>
141
                                                                <option value="[% option_value.2 %]">[% option_text.2 %] </option>
142
                                                                <option value="[% option_value.3 %]" selected="selected">[% option_text.3 %] </option>
143
                                                            [% END %]
144
                                                        </select>
145
                                                    [% ELSIF (pref.type == "YesNo") %]
146
                                                        <select id="pref_[% pref.variable %]" class="pref_binary_input" name="pref_[% pref.variable %]">
147
                                                            [% option_text = pref.display_choices.split("\\|") %]
148
                                                            [% IF pref.value == 1 %]
149
                                                                <option value=1 selected="selected"> [% IF option_text %] [% option_text.1 %] [% ELSE %] Yes [% END %]</option>
150
                                                                <option value=0> [% IF option_text %] [% option_text.0 %] [% ELSE %] No [% END %] </option>
151
                                                            [% ELSE %]
152
                                                                <option value=0 selected="selected"> [% IF option_text %] [% option_text.0 %] [% ELSE %] No [% END %]</option>
153
                                                                <option value=1> [% IF option_text %] [% option_text.1 %] [% ELSE %] Yes [% END %]</option>
154
                                                            [% END %]
155
                                                        </select>
156
                                                    [% END %]
157
                                                [% ELSE %]
158
                                                    No default value
159
                                                [% END %]
104
                                            </td>
160
                                            </td>
105
                                        </tr>
161
                                        </tr>
106
                                        [% END %]
162
                                        [% END %]
Lines 117-123 td, th { Link Here
117
                    <a href="https://koha-community.org/koha-17-05-released/"> Koha 17.05 release notes link </a>
173
                    <a href="https://koha-community.org/koha-17-05-released/"> Koha 17.05 release notes link </a>
118
                </div>
174
                </div>
119
                <br>
175
                <br>
120
                <p><a href="/cgi-bin/koha/mainpage.pl" class="btn btn-primary">Next and submit</a></p>
176
                <form name="featurereleaseform" action="/cgi-bin/koha/installer/featurereleasetool.pl" method="post">
177
                    <input type="hidden" name="op" value="finished" />
178
                    <p><button class="btn btn-primary">Log into Koha staff intranet</button></p>
179
                </form>
121
            </div>
180
            </div>
122
        </div>
181
        </div>
123
    </div>
182
    </div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt (+1 lines)
Lines 247-252 Link Here
247
                        <p>Everything went okay. Update done.</p>
247
                        <p>Everything went okay. Update done.</p>
248
                    [% END %]
248
                    [% END %]
249
                    <p><a href="install.pl?step=3&amp;op=featurereleasetool&amp;dbversion=[%dbversion%]&amp;kohaversion=[%kohaversion%]&amp;update_report=[%update_report%]" class="btn btn-primary">Continue to feature release tool</a></p>
249
                    <p><a href="install.pl?step=3&amp;op=featurereleasetool&amp;dbversion=[%dbversion%]&amp;kohaversion=[%kohaversion%]&amp;update_report=[%update_report%]" class="btn btn-primary">Continue to feature release tool</a></p>
250
                    <p><a href="install.pl?step=3&amp;op=finished&amp;dbversion=[%dbversion%]" class="btn btn-primary">Skip feature release tool and login to Koha</a></p>
250
               [% END # / IF updatestructure %]
251
               [% END # / IF updatestructure %]
251
            </div> <!-- / #installer-step3 -->
252
            </div> <!-- / #installer-step3 -->
252
        </div> <!-- / .row -->
253
        </div> <!-- / .row -->
(-)a/mainpage.pl (-1 / +16 lines)
Lines 89-94 $template->param( Link Here
89
#
89
#
90
unless ($loggedinuser) {
90
unless ($loggedinuser) {
91
    $template->param(adminWarning => 1);
91
    $template->param(adminWarning => 1);
92
} else {
93
    my $patron_has_flags = Koha::Patron->check_if_patrons_have_flags();
94
    if ($patron_has_flags) {
95
        my $featuretoolrequired = C4::Auth->check_feature_tool_required();
96
        if ($featuretoolrequired) {
97
            my $kohaversion = Koha::version();
98
            my $dbh = C4::Context->dbh;
99
            my $dbquery = qq|
100
                SELECT value FROM systempreferences WHERE variable="PreviousVersion" |;
101
            my $sth = $dbh->prepare($dbquery);
102
            $sth->execute();
103
            my $dbversion = $sth->fetchrow;
104
            print $query->redirect("/cgi-bin/koha/installer/featurereleasetool.pl?dbversion=$dbversion&kohaversion=$kohaversion");
105
            exit;
106
        }
107
    }
92
}
108
}
93
109
94
output_html_with_http_headers $query, $cookie, $template->output;
110
output_html_with_http_headers $query, $cookie, $template->output;
95
- 

Return to bug 18645