Skip to content

Commit

Permalink
Accept suggestions from CodePolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Nov 9, 2023
1 parent 147a2e0 commit 0f96855
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 24 deletions.
1 change: 0 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1553,4 +1553,3 @@

# OTOBO 10.0.0 beta1 2020-01-30
- First official OTOBO release, yippie!

5 changes: 3 additions & 2 deletions Kernel/GenericInterface/Transport/HTTP/REST.pm
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ sub RequesterPerformRequest {

# Add authentication options if configured.
if ( IsHashRefWithData( $Config->{Authentication} ) && IsStringWithData( $Config->{Authentication}->{AuthType} ) ) {

# basic auth
if (
$Config->{Authentication}->{AuthType} eq 'BasicAuth'
Expand Down Expand Up @@ -718,7 +719,7 @@ sub RequesterPerformRequest {
}

my $KinitString = 'kinit -k -t ' . $Config->{Authentication}->{KerberosKeytab} . ' ' . $Config->{Authentication}->{KerberosUser};
my $LogMessage = qx{$KinitString 2>&1};
my $LogMessage = qx{$KinitString 2>&1};

if ( IsStringWithData($LogMessage) ) {
$Self->{DebuggerObject}->Error(
Expand All @@ -731,7 +732,7 @@ sub RequesterPerformRequest {
};
}
}
}
}

if ( $Param{CustomHeader} ) {
%Headers = (
Expand Down
4 changes: 2 additions & 2 deletions Kernel/Modules/AdminAppointmentCalendarManage.pm
Original file line number Diff line number Diff line change
Expand Up @@ -993,10 +993,10 @@ sub _TicketAppointments {
Key => 'Plus_60',
Value => $LayoutObject->{LanguageObject}->Translate('+1 hour'),
},
{
{
Key => 'Plus_480',
Value => $LayoutObject->{LanguageObject}->Translate('+1 day'),
},
},
);

my @EndDateTypes = ( @EndPlusTypes, @DynamicFieldTypes );
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Modules/AdminCustomerUser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ sub _Edit {
if ($UseAutoComplete) {

my $Value = $Param{ $Entry->[0] } || $Param{CustomerID};
$Value = $LayoutObject->Output(
$Value = $LayoutObject->Output(
Template => "[% Data.Value | html %]",
Data => {
Value => $Value,
Expand Down
2 changes: 1 addition & 1 deletion Kernel/Modules/AdminGenericInterfaceTransportHTTPREST.pm
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ sub _ShowEdit {

# Create Authentication types select.
$Param{AuthenticationStrg} = $LayoutObject->BuildSelection(
Data => ['BasicAuth', 'Kerberos'],
Data => [ 'BasicAuth', 'Kerberos' ],
Name => 'AuthType',
SelectedValue => $Param{AuthType} || '-',
PossibleNone => 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ sub MigrateConfigItems {
my $CICount = scalar @ConfigItems;

my $Errors = 0;
for my $ConfigItemID ( @ConfigItems ) {
for my $ConfigItemID (@ConfigItems) {

$Count++;

Expand Down
1 change: 1 addition & 0 deletions Kernel/System/DynamicField.pm
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ sub DynamicFieldList {
}

if ( $Param{Namespace} && $Param{Namespace} ne 'All' ) {

# select all fields without a namespace
if ( $Param{Namespace} eq '<none>' ) {
push @WhereClauses, 'name NOT LIKE ?';
Expand Down
33 changes: 17 additions & 16 deletions Kernel/System/Stats/Dynamic/ArticleList.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# OTOBO is a web-based ticketing system for service organisations.
# --
# Copyright (C) 2001-2020 OTRS AG, https://otrs.com/
# Copyright (C) 2019-2022 Rother OSS GmbH, https://otobo.de/
# Copyright (C) 2019-2023 Rother OSS GmbH, https://otobo.de/
# --
# This program 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
Expand Down Expand Up @@ -57,7 +57,7 @@ sub new {
# get the dynamic fields for ticket object
$Self->{DynamicField} = $Kernel::OM->Get('Kernel::System::DynamicField')->DynamicFieldListGet(
Valid => 1,
ObjectType => ['Ticket', 'Article'],
ObjectType => [ 'Ticket', 'Article' ],
);

return $Self;
Expand Down Expand Up @@ -1317,41 +1317,42 @@ sub GetStatTable {

# add the number of articles if needed
if ( $TicketAttributes{NumberOfArticles} ) {
$Ticket{NumberOfArticles} = $Kernel::OM->Get('Kernel::System::Ticket::Article')->ArticleList(
$Ticket{NumberOfArticles} = $Kernel::OM->Get('Kernel::System::Ticket::Article')->ArticleList(
TicketID => $TicketID,
UserID => 1
);
}

my $DynamicFieldObject = $Kernel::OM->Get('Kernel::System::DynamicField');
my @ArticleDynField;
my $DynamicFieldObject = $Kernel::OM->Get('Kernel::System::DynamicField');
my @ArticleDynField;

ATTRIBUTE:
for my $ArticleDynField (keys %TicketAttributes) {
ATTRIBUTE:
for my $ArticleDynField ( keys %TicketAttributes ) {
next ATTRIBUTE if $ArticleDynField !~ /DynamicField_/;

$ArticleDynField =~ s/DynamicField_//;
$ArticleDynField =~ s/DynamicField_//;

my $DynamicField = $DynamicFieldObject->DynamicFieldGet(
Name => $ArticleDynField,
);

next ATTRIBUTE if $DynamicField->{ObjectType} ne "Article";
push(@ArticleDynField, $ArticleDynField);
}
next ATTRIBUTE if $DynamicField->{ObjectType} ne "Article";

push @ArticleDynField, $ArticleDynField;
}

if ( IsArrayRefWithData(\@ArticleDynField) ) {
if ( IsArrayRefWithData( \@ArticleDynField ) ) {

my @ArticleList = $Kernel::OM->Get('Kernel::System::Ticket::Article')->ArticleList(
TicketID => $TicketID,
UserID => 1
);

for my $MetaArticle (@ArticleList) {
my %Article = $Kernel::OM->Get('Kernel::System::Ticket::Article')->BackendForArticle( %{$MetaArticle} )->ArticleGet( %{$MetaArticle}, DynamicFields => 1 );

for my $ArticleA ( @ArticleDynField ) {
$Ticket{"DynamicField_".$ArticleA} = $Article{"DynamicField_".$ArticleA} || '';
for my $ArticleA (@ArticleDynField) {
$Ticket{ "DynamicField_" . $ArticleA } = $Article{ "DynamicField_" . $ArticleA } || '';
}
}
}
Expand Down Expand Up @@ -1384,7 +1385,7 @@ sub GetStatTable {
for my $DynamicFieldConfig ( @{ $Self->{DynamicField} } ) {
next DYNAMICFIELD if !IsHashRefWithData($DynamicFieldConfig);
next DYNAMICFIELD if !$DynamicFieldConfig->{Name};
next DYNAMICFIELD if $DynamicFieldConfig->{ObjectType} ne "Ticket";
next DYNAMICFIELD if $DynamicFieldConfig->{ObjectType} ne "Ticket";

# skip all fields that does not match with current field name ($1)
# without the 'DynamicField_' prefix
Expand Down

0 comments on commit 0f96855

Please sign in to comment.