From 149ab008959e86feeeac2b0836371f122e3865a6 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Fri, 21 Jul 2017 22:43:38 +0000 Subject: [PATCH] Bug 18645 -Koha feature release change tool This tool is displayed at the end of the update process to display all the new system preferences added during the update so that the administrator can view and modify their default values if neccessary The administrator also has the ability to 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 --- C4/Auth.pm | 16 + Koha/Patron.pm | 19 + admin/preferences.pl | 122 ++++--- admin/systempreferences.pl | 1 + ...g_version_column_to_systempreferences_table.sql | 102 ++++++ installer/data/mysql/kohastructure.sql | 1 + installer/featurereleasetool.pl | 192 ++++++++++ installer/install.pl | 19 +- koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 5 + .../intranet-tmpl/prog/en/includes/newsform.inc | 98 +++++ koha-tmpl/intranet-tmpl/prog/en/includes/team.inc | 403 +++++++++++++++++++++ .../prog/en/modules/admin/preferences.tt | 182 +++++----- .../en/modules/installer/featurereleasetool.tt | 210 +++++++++++ .../prog/en/modules/installer/step3.tt | 5 +- .../prog/en/modules/tools/koha-news.tt | 76 +--- mainpage.pl | 16 + tools/koha-news.pl | 4 +- 17 files changed, 1242 insertions(+), 229 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/18645_adding_version_column_to_systempreferences_table.sql create mode 100755 installer/featurereleasetool.pl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/newsform.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/team.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/installer/featurereleasetool.tt diff --git a/C4/Auth.pm b/C4/Auth.pm index bf1457e..4a8b011 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -2030,6 +2030,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 92e70a5..81841eb 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -652,6 +652,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 032789f..04e752a 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -58,74 +58,74 @@ sub GetTab { } sub _get_chunk { - my ( $value, %options ) = @_; + my ( $value, %options ) = @_; - my $name = $options{'pref'}; - my $chunk = { name => $name, value => $value, type => $options{'type'} || 'input', class => $options{'class'} }; + my $name = $options{'pref'}; + my $chunk = { name => $name, value => $value, type => $options{'type'} || 'input', class => $options{'class'} }; - if ( $options{'class'} && $options{'class'} eq 'password' ) { - $chunk->{'input_type'} = 'password'; - } elsif ( $options{'class'} && $options{'class'} eq 'date' ) { - $chunk->{'dateinput'} = 1; - } elsif ( $options{'type'} && ( $options{'type'} eq 'opac-languages' || $options{'type'} eq 'staff-languages' ) ) { - my $current_languages = { map { +$_, 1 } split( /\s*,\s*/, $value ) }; + if ( $options{'class'} && $options{'class'} eq 'password' ) { + $chunk->{'input_type'} = 'password'; + } elsif ( $options{'class'} && $options{'class'} eq 'date' ) { + $chunk->{'dateinput'} = 1; + } elsif ( $options{'type'} && ( $options{'type'} eq 'opac-languages' || $options{'type'} eq 'staff-languages' ) ) { + my $current_languages = { map { +$_, 1 } split( /\s*,\s*/, $value ) }; - my $theme; - my $interface; - if ( $options{'type'} eq 'opac-languages' ) { + my $theme; + my $interface; + if ( $options{'type'} eq 'opac-languages' ) { # this is the OPAC - $interface = 'opac'; - $theme = C4::Context->preference('opacthemes'); - } else { - # this is the staff client - $interface = 'intranet'; - $theme = C4::Context->preference('template'); - } - $chunk->{'languages'} = getTranslatedLanguages( $interface, $theme, $lang, $current_languages ); - $chunk->{'type'} = 'languages'; - } elsif ( $options{ 'choices' } ) { - if ( $options{'choices'} && ref( $options{ 'choices' } ) eq '' ) { - if ( $options{'choices'} eq 'class-sources' ) { - my $sources = GetClassSources(); - $options{'choices'} = { map { $_ => $sources->{$_}->{'description'} } keys %$sources }; - } elsif ( $options{'choices'} eq 'opac-templates' ) { - $options{'choices'} = { map { $_ => $_ } getallthemes( 'opac' ) } - } elsif ( $options{'choices'} eq 'staff-templates' ) { - $options{'choices'} = { map { $_ => $_ } getallthemes( 'intranet' ) } - } else { - die 'Unrecognized source of preference values: ' . $options{'choices'}; - } - } - - $value ||= 0; + $interface = 'opac'; + $theme = C4::Context->preference('opacthemes'); + } else { + # this is the staff client + $interface = 'intranet'; + $theme = C4::Context->preference('template'); + } + $chunk->{'languages'} = getTranslatedLanguages( $interface, $theme, $lang, $current_languages ); + $chunk->{'type'} = 'languages'; + } elsif ( $options{ 'choices' } ) { + if ( $options{'choices'} && ref( $options{ 'choices' } ) eq '' ) { + if ( $options{'choices'} eq 'class-sources' ) { + my $sources = GetClassSources(); + $options{'choices'} = { map { $_ => $sources->{$_}->{'description'} } keys %$sources }; + } elsif ( $options{'choices'} eq 'opac-templates' ) { + $options{'choices'} = { map { $_ => $_ } getallthemes( 'opac' ) } + } elsif ( $options{'choices'} eq 'staff-templates' ) { + $options{'choices'} = { map { $_ => $_ } getallthemes( 'intranet' ) } + } else { + die 'Unrecognized source of preference values: ' . $options{'choices'}; + } + } + + $value ||= 0; $chunk->{'type'} = 'select'; - $chunk->{'CHOICES'} = [ - sort { $a->{'text'} cmp $b->{'text'} } - map { { text => $options{'choices'}->{$_}, value => $_, selected => ( $_ eq $value || ( $_ eq '' && ( $value eq '0' || !$value ) ) ) } } - keys %{ $options{'choices'} } - ]; - } elsif ( $options{'multiple'} ) { - my @values; - @values = split /,/, $value if defined($value); - $chunk->{type} = 'multiple'; - $chunk->{CHOICES} = [ - sort { $a->{'text'} cmp $b->{'text'} } - map { - my $option_value = $_; - { - text => $options{multiple}->{$option_value}, - value => $option_value, - selected => (grep /^$option_value$/, @values) ? 1 : 0, - } - } - keys %{ $options{multiple} } - ]; - } + $chunk->{'CHOICES'} = [ + sort { $a->{'text'} cmp $b->{'text'} } + map { { text => $options{'choices'}->{$_}, value => $_, selected => ( $_ eq $value || ( $_ eq '' && ( $value eq '0' || !$value ) ) ) } } + keys %{ $options{'choices'} } + ]; + } elsif ( $options{'multiple'} ) { + my @values; + @values = split /,/, $value if defined($value); + $chunk->{type} = 'multiple'; + $chunk->{CHOICES} = [ + sort { $a->{'text'} cmp $b->{'text'} } + map { + my $option_value = $_; + { + text => $options{multiple}->{$option_value}, + value => $option_value, + selected => (grep /^$option_value$/, @values) ? 1 : 0, + } + } + keys %{ $options{multiple} } + ]; + } $chunk->{ 'type_' . $chunk->{'type'} } = 1; - return $chunk; + return $chunk; } sub TransformPrefsToHTML { @@ -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/admin/systempreferences.pl b/admin/systempreferences.pl index 67e0638..223c41b 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -339,6 +339,7 @@ if ( $op eq 'add_form' ) { unless C4::Context->config('demo'); print $input->redirect("/cgi-bin/koha/admin/systempreferences.pl?tab="); exit; + ################## DELETE_CONFIRM ################################## # called by default form, used to confirm deletion of data in DB } elsif ( $op eq 'delete_confirm' ) { 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 new file mode 100644 index 0000000..5aec7fb --- /dev/null +++ b/installer/data/mysql/atomicupdate/18645_adding_version_column_to_systempreferences_table.sql @@ -0,0 +1,102 @@ +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", 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", 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", 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", 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", 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", 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", 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", 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", 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", 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", 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", display_choices="Disable|Enable" WHERE variable="TalkingTechItivaPhoneNotification"; +UPDATE systempreferences SET version="17.06.00.004" WHERE variable="GoogleOpenIDConnectAutoRegister"; +UPDATE systempreferences SET version="17.06.00.004" WHERE variable="GoogleOpenIDConnectDefaultCategory"; +UPDATE systempreferences SET version="17.06.00.004" WHERE variable="GoogleOpenIDConnectDefaultBranch"; +UPDATE systempreferences SET version="17.06.00.005" WHERE variable="StaffLangSelectorMode"; +UPDATE systempreferences SET version="17.06.00.010" WHERE variable="DefaultCountryField008"; +UPDATE systempreferences SET version="17.06.00.013" WHERE variable="staffClientBaseURL"; +UPDATE systempreferences SET version="17.06.00.015" WHERE variable="SelfCheckoutByLogin"; +UPDATE systempreferences SET version="17.06.00.016" WHERE variable="RequireStrongPassword"; +UPDATE systempreferences SET version="17.06.00.018" WHERE variable="useDefaultReplacementCost"; +UPDATE systempreferences SET version="17.06.00.018" WHERE variable="ProcessingFeeNote"; +UPDATE systempreferences SET version="17.06.00.020" WHERE variable="OpacLocationOnDetail"; +UPDATE systempreferences SET version="17.06.00.021" WHERE variable="SCOMainUserBlock"; +UPDATE systempreferences SET version="17.06.00.023" WHERE variable="MarkLostItemsAsReturned"; +UPDATE systempreferences SET version="17.06.00.024" WHERE variable="OPACUserSummary"; +UPDATE systempreferences SET version="17.06.00.026" WHERE variable="BlockReturnOfLostItems"; +UPDATE systempreferences SET version="17.06.00.028" WHERE variable="ILLModule"; +UPDATE systempreferences SET version="17.06.00.028" WHERE variable="ILLModuleCopyrightClearance'; + + + + + + + + + + + + + + + + + + + diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 4f2bd98..9cc7660 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2260,6 +2260,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 new file mode 100755 index 0000000..91525f2 --- /dev/null +++ b/installer/featurereleasetool.pl @@ -0,0 +1,192 @@ +#!/usr/bin/perl + +# This file is part of Koha. +# +# Copyright (C) 2017 Catalyst IT +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use strict; +use warnings; +use diagnostics; + +use C4::InstallAuth; +use CGI qw ( -utf8 ); +use POSIX qw(strftime); +use Koha; +use C4::Context; +use C4::Output; +use C4::Templates; +use C4::Languages qw(getAllLanguages getTranslatedLanguages); +use C4::Installer; +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'); +my $kohaversion = $query->param('kohaversion'); #Retrieve kohaversion number from url +my $dbversion = $query->param('dbversion'); +my $dbh = C4::Context->dbh; +my $op = $query->param('op'); +my $language = $query->param('language'); +my ( $template, $loggedinuser, $cookie ); + +my $all_languages = getAllLanguages(); + +if ( defined($language) ) { + C4::Templates::setlanguagecookie( $query, $language, "install.pl?step=1" ); +} + +#Set featurereleasetool.tt as template +( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "installer/featurereleasetool.tt", + query => $query, + type => "intranet", + authnotrequired => 0, + debug => 1, + } +); + +#Database settings +my $installer = C4::Installer->new(); +my %info; +$info{'dbname'} = C4::Context->config("database"); +$info{'dbms'} = ( + C4::Context->config("db_scheme") + ? C4::Context->config("db_scheme") + : "mysql" +); +$info{'hostname'} = C4::Context->config("hostname"); +$info{'port'} = C4::Context->config("port"); +$info{'user'} = C4::Context->config("user"); +$info{'password'} = C4::Context->config("pass"); +$info{'tls'} = C4::Context->config("tls"); + if ($info{'tls'} && $info{'tls'} eq 'yes'){ + $info{'ca'} = C4::Context->config('ca'); + $info{'cert'} = C4::Context->config('cert'); + $info{'key'} = C4::Context->config('key'); + $info{'tlsoptions'} = ";mysql_ssl=1;mysql_ssl_client_key=".$info{key}.";mysql_ssl_client_cert=".$info{cert}.";mysql_ssl_ca_file=".$info{ca}; + $info{'tlscmdline'} = " --ssl-cert ". $info{cert} . " --ssl-key " . $info{key} . " --ssl-ca ".$info{ca}." " + } + +my $location = "feature"; + +$template->param( + 'kohaversion' => $kohaversion, + 'dbversion' => $dbversion, + 'location' => $location, +); + +my $logdir = C4::Context->config('logdir'); +my @logs = `cd $logdir && ls -t | grep "updatedatabase_2*"`; + +my $filename_suffix = $logs[0]; +my $path = $logdir . '/' . $filename_suffix; +my $file; +my $count = 0; +$file = `cat $path`; +$file = `echo "$file" | grep -Eo '?[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+?'`; + +my @prefsloop; +my @lines = split /\n/, $file; +foreach my $line (@lines) { + my $query = qq| + 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, $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, + }; + } + } +}; + +$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; +} +elsif ( $op && $op eq 'save' ) { #Submit changed systempreferences + unless ( C4::Context->config( 'demo' ) ) { + foreach my $param ( $query->param() ) { + my ( $prefname ) = ( $param =~ /pref_(.*)/ ); + next if ( !defined( $prefname ) ); + my $wholevalue = join( ',', $query->param($param) ); + my ($name, $value) = split(/,/,$wholevalue); + C4::Context->set_preference( $name, $value ); + } + } +} + +#Submit news item +my $id = $query->param('id'); +my $title = $query->param('title'); +my $content = $query->param('featurecontent'); +my $expirationdate; +if ( $query->param('expirationdate') ) { + $expirationdate = output_pref({ dt => dt_from_string( scalar $query->param('expirationdate') ), dateformat => 'iso', dateonly => 1 } ); +} +my $timestamp = output_pref({ dt => dt_from_string( scalar $query->param('timestamp') ), dateformat => 'iso', dateonly => 1 }); +my $number = $query->param('number'); +my $lang = $query->param('lang'); +my $branchcode = $query->param('branch'); + +my $error_message = $query->param('error_message'); +$branchcode = undef if (defined($branchcode) && $branchcode eq ''); + +$template->param( error_message => $error_message ) if $error_message; + +my $new_detail = get_opac_new($id); + +if ($title) { + my $newsposting = add_opac_new( + { + title => $title, + content => $content, + lang => $lang, + expirationdate => $expirationdate, + timestamp => $timestamp, + number => $number, + branchcode => $branchcode, + borrowernumber => $loggedinuser, + } + ); + if ($newsposting) { + $template->param( newsposted => $newsposting ); + } +} + +output_html_with_http_headers $query, $cookie, $template->output; diff --git a/installer/install.pl b/installer/install.pl index ac43214..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; } @@ -237,6 +243,11 @@ elsif ( $step && $step == 3 ) { # And we redirect people to mainpage. # The installer will have to relogin since we do not pass cookie to redirection. $template->param( "$op" => 1 ); + }elsif ( $op && $op eq 'featurereleasetool' ) { + my $dbversion = $query->param('dbversion'); + my $kohaversion = $query->param('kohaversion'); + print $query->redirect("/cgi-bin/koha/installer/featurereleasetool.pl?dbversion=$dbversion&kohaversion=$kohaversion"); + exit; } elsif ( $op && $op eq 'addframeworks' ) { @@ -382,6 +393,11 @@ elsif ( $step && $step == 3 ) { my $kohaversion = Koha::version; $kohaversion =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/; + $template->param( + "dbversion" => $dbversion, + "kohaversion" => $kohaversion + ); + my $filename_suffix = join '_', $now, $dbversion, $kohaversion; my ( $logfilepath, $logfilepath_errors ) = ( chk_log( $logdir, "updatedatabase_$filename_suffix" ), @@ -400,7 +416,8 @@ elsif ( $step && $step == 3 ) { close $fh; if (@report) { $template->param( update_report => - [ map { { line => $_ } } split( /\n/, join( '', @report ) ) ] + [ map { { line => $_ } } split( /\n/, join( '', @report ) ) ], + raw_report => @report ); $template->param( has_update_succeeds => 1 ); } diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css index 9a18b09..d505809 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css @@ -3137,3 +3137,8 @@ fieldset.rows + fieldset.action { table#ill-requests { width: 100% !important; } + +#news_posted { + width: 50%; + background-color: #F1F1F1; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/newsform.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/newsform.inc new file mode 100644 index 0000000..54ec220 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/newsform.inc @@ -0,0 +1,98 @@ +
+ [% IF location == "feature" %] +
+ [% ELSIF location == "intranet" %] + + [% END %] + + + + +
+ OPAC and Koha news +
  1. + + +
  2. +
  3. + + +
  4. +
  5. + + [% IF location == "feature" %] + Required + [% ELSE %] + Required + [% END %] +
  6. +
  7. + + +
    [% INCLUDE 'date-format.inc' %]
    +
  8. +
  9. + + +
    [% INCLUDE 'date-format.inc' %]
    +
  10. +
  11. + + [% IF ( new_detail.number ) %] + + [% ELSE %] + + [% END %] +
  12. +
  13. + [% IF location=="feature" %] +

    +
    + Our institution is proud to announce that we have upgraded our Koha library management system to Koha version [%kohaversion%]. This new Koha version comes with many new exciting features. +
    +

    Read about the enhancements here: Koha 17.05 release notes link

    +

    During the upgrade the following new systempreferences were also installed:

    + [% FOREACH pref IN prefs %] + [% pref.variable %] + [% pref.value %] + [% END %] +
    +
    + [% ELSIF location=="intranet" %] + + [% END %] +
  14. +
+ +
+
+
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/team.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/team.inc new file mode 100644 index 0000000..ce64b1e --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/team.inc @@ -0,0 +1,403 @@ +
+

Special thanks to the following organizations

+ + +

Koha 17.05 release team

+ + +

Koha development team

+ +

Contributing companies and institutions

+
    +
  • BibLibre, France
  • +
  • Bibliotheksservice-Zentrum Baden-Württemberg (BSZ), Germany
  • +
  • ByWater Solutions, USA
  • +
  • Calyx, Australia
  • +
  • Catalyst IT, New Zealand
  • +
  • C & P Bibliography Services, USA
  • +
  • Hochschule für Gesundheit (hsg), Germany
  • +
  • Katipo Communications, New Zealand
  • +
  • KEEP SOLUTIONS, Portugal
  • +
  • KohaAloha, New Zealand
  • +
  • LibLime, USA
  • +
  • Libriotech, Norway
  • +
  • Nelsonville Public Library, Ohio, USA
  • +
  • Prosentient Systems, Australia
  • +
  • PTFS, Maryland, USA
  • +
  • PTFS Europe Ltd, United Kingdom
  • +
  • Rijksmuseum, Amsterdam, The Netherlands
  • +
  • SAN-Ouest Provence, France
  • +
  • software.coop, United Kingdom
  • +
  • Tamil, France
  • +
  • Universidad Nacional de Córdoba, Argentina
  • +
  • Xercode, Spain
  • +
+ +

Additional thanks to...

+
    +
  • Irma Birchall
  • +
  • Rachel Hamilton-Williams (Kaitiaki from 2004 to present)
  • +
  • Stephen Hedges (early Documentation Manager)
  • +
  • Brooke Johnson
  • +
  • Jo Ransom
  • +
  • Nicholas Rosasco (Documentation Compiler)
  • +
  • Regula Sebastiao
  • +
+
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt index 7d884a7..7f57f2a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt @@ -76,119 +76,117 @@
No system preferences matched your search for: [% searchfield |html %]
- [% ELSIF searchfield %]

You searched for: [% searchfield | html %]

[% END %] [% FOREACH TAB IN TABS %] -
-

[% TAB.tab_title %] preferences

-
- [% UNLESS ( searchfield ) %]
[% END %] - - - - [% FOREACH LINE IN TAB.LINES %] - [% IF ( LINE.is_group_title ) %] - [% UNLESS ( loop.first ) %][% END %] -

[% LINE.title %]

- - - [% UNLESS ( loop.last ) %][% END %] - [% ELSE %] - [% IF ( loop.first ) %]
PreferenceValue
[% END %] - - -
PreferenceValue
- - [% FOREACH NAME IN LINE.NAMES %] - - [% UNLESS ( loop.last ) %]
[% END %] - [% END %] -
-
- [% FOREACH CHUNK IN LINE.CHUNKS %] - [% IF ( CHUNK.type_text ) %] +
+

[% TAB.tab_title %] preferences

+ + [% UNLESS ( searchfield ) %]
[% END %] + + + [% FOREACH LINE IN TAB.LINES %] + [% IF ( LINE.is_group_title ) %] + [% UNLESS ( loop.first ) %]
[% END %] +

[% LINE.title %]

+ + + [% UNLESS ( loop.last ) %][% END %] + [% ELSE %] + [% IF ( loop.first ) %]
PreferenceValue
[% END %] + + + - - [% IF ( loop.last ) %]
PreferenceValue
+ + [% FOREACH NAME IN LINE.NAMES %] + + [% UNLESS ( loop.last ) %]
[% END %] + [% END %] +
+
+ [% FOREACH CHUNK IN LINE.CHUNKS %] + [% IF ( CHUNK.type_text ) %] [% CHUNK.contents %] - [% ELSIF ( CHUNK.type_input ) %] + [% ELSIF ( CHUNK.type_input ) %] [% IF ( CHUNK.dateinput ) %][% INCLUDE 'date-format.inc' %][% END %] - [% ELSIF ( CHUNK.type_select ) %] + [% ELSIF ( CHUNK.type_select ) %] [% ELSIF ( CHUNK.type_multiple ) %] - [% ELSIF ( CHUNK.type_textarea ) || ( CHUNK.type_htmlarea )%] + [% ELSIF ( CHUNK.type_textarea ) || ( CHUNK.type_htmlarea )%] [% IF ( CHUNK.type_htmlarea ) && ( Koha.Preference('UseWYSIWYGinSystemPreferences') ) %] - + [% ELSE %] - - - + + + [% END %] - [% ELSIF ( CHUNK.type_languages ) %] -
- [% FOREACH language IN CHUNK.languages %] - [% IF ( language.plural ) %] -
- [% IF ( language.native_description ) %][% language.native_description %][% ELSE %][% language.rfc4646_subtag %][% END %] -
- [% FOREACH sublanguages_loo IN language.sublanguages_loop %] -
- - [% IF ( sublanguages_loo.enabled ) %] - - [% ELSE %] - + [% ELSIF ( CHUNK.type_languages ) %] +
+ [% FOREACH language IN CHUNK.languages %] + [% IF ( language.plural ) %] +
+ [% IF ( language.native_description ) %][% language.native_description %][% ELSE %][% language.rfc4646_subtag %][% END %] +
+ [% FOREACH sublanguages_loo IN language.sublanguages_loop %] +
+ + [% IF ( sublanguages_loo.enabled ) %] + + [% ELSE %] + + [% END %] +
[% END %] -
- [% END %] - [% ELSE %] -
- + [% ELSE %] +
+ [% IF ( language.group_enabled ) %] - + [% ELSE %] - + + [% END %] +
[% END %] - [% END %] - [% END %] -
- [% END %] - [% END %] -
[% END %] - [% END %] - [% END %] -
Cancel
-
-
- [% END %] + + [% END %] + [% END %] + + + [% IF ( loop.last ) %][% END %] + [% END %] + [% END %] +
Cancel
+ + + [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/featurereleasetool.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/featurereleasetool.tt new file mode 100644 index 0000000..e51bace --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/featurereleasetool.tt @@ -0,0 +1,210 @@ +[% INCLUDE 'doc-head-open.inc' %] + +Koha › Web installer › Feature Release Change Tool + + + +[% IF ( finish ) %][% END %] +[% INCLUDE 'installer-doc-head-close.inc' %] + + + +
+
+
+

Koha

+
+ + +
+ +
+

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

+
+ + + + + + + + [% FOREACH pref IN prefs %] + + + + + + [% END %] +
Preference DescriptionValue
+ + [% pref.variable %] + + [% pref.explanation %] + + [% 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 %] +
+ [% IF !(submitted_form) %] + + [% END %] +
+
+
+ +
+

Koha version [% kohaversion %] release notes

+ Koha 17.05 release notes link +
+
+
+ +

+
+
+
+
+ + + + +[% INCLUDE 'intranet-bottom.inc' %] 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 42f1295..d241474 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/installer/step3.tt @@ -235,7 +235,7 @@ [% END # / IF default %] [% IF ( updatestructure ) %] -

Updating database structure

+

Updating database structure from [%dbversion%] to [%kohaversion%]

[% IF ( has_update_succeeds ) %]

Update report :

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt index dd1ae84..f62985e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt @@ -96,79 +96,9 @@ Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %] [% IF ( op == 'add' ) %][% default_lang = lang %] [% ELSE %][% default_lang = new_detail.lang %] [% END %] -
- - -
- OPAC and Koha news -
  1. - - -
  2. -
  3. - - -
  4. -
  5. - - Required -
  6. -
  7. - - -
    [% INCLUDE 'date-format.inc' %]
    -
  8. -
  9. - - -
    [% INCLUDE 'date-format.inc' %]
    -
  10. -
  11. - - [% IF ( new_detail.number ) %] - - [% ELSE %] - - [% END %] -
  12. -
  13. - -
  14. -
-
- -
Cancel
-
+ + [% INCLUDE 'newsform.inc' %] + [% ELSE %]
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; diff --git a/tools/koha-news.pl b/tools/koha-news.pl index 61c3ec6..2515884 100755 --- a/tools/koha-news.pl +++ b/tools/koha-news.pl @@ -83,8 +83,10 @@ foreach my $language ( @$tlangs ) { } } +my $location = "intranet"; $template->param( lang_list => \@lang_list, - branchcode => $branchcode ); + branchcode => $branchcode, + location => $location ); my $op = $cgi->param('op') // ''; -- 2.1.4