Skip to content

Commit

Permalink
Issue #1467: Tidied.
Browse files Browse the repository at this point in the history
  • Loading branch information
svenoe authored and Sven committed Dec 7, 2021
1 parent 8178630 commit d6e1111
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 3,771 deletions.
21 changes: 11 additions & 10 deletions Kernel/Modules/AdminCustomerAccept.pm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ sub Run {
my $DataStorageObject = $Kernel::OM->Get('Kernel::System::DataStorage');

my $Output = $LayoutObject->Header();
$Output .= $LayoutObject->NavigationBar();
$Output .= $LayoutObject->NavigationBar();

my %GetParam;
my %Data = $DataStorageObject->Get(
Expand All @@ -67,7 +67,7 @@ sub Run {
Type => 'CustomerAccept',
);

my @LanguageIDs = $ParamObject->GetArray( Param => 'LanguageID' );
my @LanguageIDs = $ParamObject->GetArray( Param => 'LanguageID' );
$GetParam{LanguageID} = \@LanguageIDs;

my $Error;
Expand All @@ -94,7 +94,7 @@ sub Run {
UserID => $Self->{UserID},
);

if ( $Success ) {
if ($Success) {
$Data{$LanguageID} = $GetParam{Message}->{$LanguageID};
}
else {
Expand All @@ -117,7 +117,8 @@ sub Run {
}

# add rich text editor
if ( $RichText ) {
if ($RichText) {

# set up rich text editor
$LayoutObject->SetRichTextParameters(
Data => \%Param,
Expand All @@ -130,7 +131,7 @@ sub Run {
# get language ids from message parameter, use English if no message is given
# make sure English is the first language
my @LanguageIDs;
if ( %Data ) {
if (%Data) {
if ( $Data{en} ) {
push @LanguageIDs, 'en';
}
Expand Down Expand Up @@ -185,7 +186,7 @@ sub Run {
for my $LanguageID (@LanguageIDs) {

# format the content according to the content type
if ( $RichText ) {
if ($RichText) {

# make sure body is rich text (if body is based on config)
if (
Expand Down Expand Up @@ -218,10 +219,10 @@ sub Run {
Name => 'PrivacyPolicyLanguage',
Data => {
%Param,
Body => $Data{$LanguageID}->{Body} || '',
LanguageID => $LanguageID,
Language => $Languages{$LanguageID},
BodyServerError => $GetParam{ $LanguageID . '_BodyServerError' } || '',
Body => $Data{$LanguageID}->{Body} || '',
LanguageID => $LanguageID,
Language => $Languages{$LanguageID},
BodyServerError => $GetParam{ $LanguageID . '_BodyServerError' } || '',
},
);

Expand Down
4 changes: 2 additions & 2 deletions Kernel/Modules/CustomerAccept.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ sub new {
bless( $Self, $Type );

my $ConfigObject = $Kernel::OM->Get('Kernel::Config');
$Self->{InfoKey} = $ConfigObject->Get('CustomerPanel::InfoKey');
$Self->{InfoKey} = $ConfigObject->Get('CustomerPanel::InfoKey');

return $Self;
}
Expand Down Expand Up @@ -110,7 +110,7 @@ sub Run {
else {

# show info
$Output = $LayoutObject->CustomerHeader();
$Output = $LayoutObject->CustomerHeader();
$Output .= $LayoutObject->Output(
TemplateFile => 'CustomerAccept',
Data => {
Expand Down
6 changes: 3 additions & 3 deletions Kernel/Modules/CustomerGenericContent.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ sub Run {
);
}

if ( !$ModuleMap{ $ModuleKey } ) {
if ( !$ModuleMap{$ModuleKey} ) {
return $LayoutObject->FatalError(
Message => Translatable('Invalid Key!'),
);
}

my $Module = 'Kernel::Output::HTML::GenericContent::' . $ModuleMap{ $ModuleKey };
if ( !$Kernel::OM->Get('Kernel::System::Main')->Require( $Module ) ) {
my $Module = 'Kernel::Output::HTML::GenericContent::' . $ModuleMap{$ModuleKey};
if ( !$Kernel::OM->Get('Kernel::System::Main')->Require($Module) ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Message => "Failed to require '$Module' defined for '$ModuleKey'!",
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Output/HTML/GenericContent/About.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# --

package Kernel::Output::HTML::GenericContent::Aboutt;
package Kernel::Output::HTML::GenericContent::About;

use strict;
use warnings;
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Output/HTML/GenericContent/Accept.pm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ sub Content {
);

LANGUAGE:
for my $Language ( @Languages ) {
for my $Language (@Languages) {
next LANGUAGE if !$Language;

my $Content = $DataStorageObject->Get(
Expand Down
13 changes: 7 additions & 6 deletions Kernel/System/DataStorage.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ our @ObjectDependencies = (
'Kernel::Config',
'Kernel::System::Cache',
'Kernel::System::DB',
'Kernel::System::DateTime',
'Kernel::System::Log',
'Kernel::System::Storable',
);

=head1 NAME
Expand Down Expand Up @@ -137,8 +138,8 @@ sub Get {
my $SQL = "SELECT ds_key, ds_value FROM data_storage WHERE ds_type = ?";

return if !$DBObject->Prepare(
SQL => $SQL,
Bind => [ \$Param{Type} ],
SQL => $SQL,
Bind => [ \$Param{Type} ],
);

my %Data;
Expand All @@ -148,7 +149,7 @@ sub Get {
Data => $Row[1],
);
};

if ( !$Data{ $Row[0] } ) {
$Kernel::OM->Get('Kernel::System::Log')->Log(
Priority => 'error',
Expand Down Expand Up @@ -198,7 +199,7 @@ sub Set {
return;
}

$Self->Delete( %Param );
$Self->Delete(%Param);

$Param{UserID} //= 1;

Expand All @@ -210,7 +211,7 @@ sub Set {

return if !$Kernel::OM->Get('Kernel::System::DB')->Do(
SQL => "INSERT INTO data_storage (ds_type, ds_key, ds_value, create_time, create_by) VALUES (?, ?, ?, current_timestamp, ?)",
Bind => [ \$Param{Type}, \$Param{Key}, \$Dump, \$Param{UserID}],
Bind => [ \$Param{Type}, \$Param{Key}, \$Dump, \$Param{UserID} ],
);

$Kernel::OM->Get('Kernel::System::Cache')->Set(
Expand Down
Loading

0 comments on commit d6e1111

Please sign in to comment.