From 73a58ddf3cbd339fbd04ab014439146583e95157 Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Wed, 27 Sep 2017 07:50:48 +0000 Subject: [PATCH] Bug 19247 - Followup: QA test tool fixes Test plan: 1. Run QA test tools and notice that all files pass --- admin/preferences.pl | 1 - installer/featurereleasetool.pl | 11 +- installer/install.pl | 4 +- .../intranet-tmpl/prog/en/includes/newsform.inc | 34 +++--- .../intranet-tmpl/prog/en/includes/prefs-table.inc | 114 -------------------- .../prog/en/modules/admin/preferences.tt | 115 ++++++++++++++++++++- 6 files changed, 136 insertions(+), 143 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/prefs-table.inc diff --git a/admin/preferences.pl b/admin/preferences.pl index 4476e75..16fa2fd 100755 --- a/admin/preferences.pl +++ b/admin/preferences.pl @@ -33,7 +33,6 @@ use File::Spec; use IO::File; use YAML::Syck qw(); use List::MoreUtils qw(any); -use C4::Sysprefs; $YAML::Syck::ImplicitTyping = 1; $YAML::Syck::ImplicitUnicode = 1; our $lang; diff --git a/installer/featurereleasetool.pl b/installer/featurereleasetool.pl index 18fb546..88f24db 100755 --- a/installer/featurereleasetool.pl +++ b/installer/featurereleasetool.pl @@ -24,18 +24,16 @@ 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 Koha; use Data::Dumper; use Koha::DateUtils; use Date::Calc qw/Date_to_Days Today/; -use C4::NewsChannels; my $query = new CGI; @@ -99,10 +97,8 @@ my @logs = `cd $logdir && ls -t | grep "updatedatabase_2*"`; my $filename_suffix = $logs[0]; my $path = $logdir . '/' . $filename_suffix; -my $fh; my $file; my $count = 0; -my $version; $file = `cat $path`; $file = `echo "$file" | grep -Eo '?[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+?'`; @@ -130,12 +126,11 @@ if ( $op && $op eq 'finished' ) { print $query->redirect("/cgi-bin/koha/mainpage.pl"); exit; } -elsif ( $op && $op eq 'save' ) { #Submit changed systempreferences +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 ); @@ -144,7 +139,7 @@ elsif ( $op && $op eq 'save' ) { #Submit changed systempreferences } -#Submit news item +#Submit news item my $id = $query->param('id'); my $title = $query->param('title'); my $content = $query->param('featurecontent'); diff --git a/installer/install.pl b/installer/install.pl index 97e9d99..c3d31a4 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -238,8 +238,8 @@ elsif ( $step && $step == 3 ) { # The installer will have to relogin since we do not pass cookie to redirection. $template->param( "$op" => 1 ); }elsif ( $op && $op eq 'featurereleasetool' ) { - warn my $dbversion = $query->param('dbversion'); - warn my $kohaversion = $query->param('kohaversion'); + my $dbversion = $query->param('dbversion'); + my $kohaversion = $query->param('kohaversion'); print $query->redirect("/cgi-bin/koha/installer/featurereleasetool.pl?dbversion=$dbversion&kohaversion=$kohaversion"); exit; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/newsform.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/newsform.inc index f2e740f..54ec220 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/newsform.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/newsform.inc @@ -8,32 +8,32 @@ -
+
OPAC and Koha news
  1. @@ -49,17 +49,21 @@
  2. - Required + [% IF location == "feature" %] + Required + [% ELSE %] + Required + [% END %]
  3. -
    [% INCLUDE 'date-format.inc' %]
    +
    [% INCLUDE 'date-format.inc' %]
  4. -
    [% INCLUDE 'date-format.inc' %]
    +
    [% INCLUDE 'date-format.inc' %]
  5. diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-table.inc deleted file mode 100644 index b2d1eff..0000000 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/prefs-table.inc +++ /dev/null @@ -1,114 +0,0 @@ - [% 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 %] - - - - - [% 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 ) %] - [% IF ( CHUNK.dateinput ) %][% INCLUDE 'date-format.inc' %][% END %] - [% ELSIF ( CHUNK.type_select ) %] - - [% ELSIF ( CHUNK.type_multiple ) %] - - [% 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 %] - - [% END %] -
    - [% END %] - [% ELSE %] -
    - - [% IF ( language.group_enabled ) %] - - [% ELSE %] - - [% END %] -
    - [% END %] - [% END %] -
    - [% END %] - [% END %] -
    [% END %] - [% END %] - [% END %] - [% IF screen == 'preferences' %] -
    Cancel
    - [% ELSIF screen == 'featurereleasetool' %] -
    Cancel
    - [% END %] -
    -
    - [% END %] 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 b83a4a8..f39c9c7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tt @@ -76,10 +76,119 @@
    No system preferences matched your search for: [% searchfield |html %]
    + [% ELSE %] +

    You searched for: [% searchfield | html %]

    [% END %] - [% screen = 'preferences' %] - [% INCLUDE 'prefs-table.inc' %] - + [% 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 %] + + + + + [% 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 ) %] + [% IF ( CHUNK.dateinput ) %][% INCLUDE 'date-format.inc' %][% END %] + [% ELSIF ( CHUNK.type_select ) %] + + [% ELSIF ( CHUNK.type_multiple ) %] + + [% 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 %] + + [% END %] +
    + [% END %] + [% ELSE %] +
    + + [% IF ( language.group_enabled ) %] + + [% ELSE %] + + [% END %] +
    + [% END %] + [% END %] +
    + [% END %] + [% END %] +
    [% END %] + [% END %] + [% END %] +
    Cancel
    +
    +
    + [% END %] +
    [% INCLUDE 'prefs-menu.inc' %] -- 2.1.4