diff --git a/CHANGES.md b/CHANGES.md index 9bfda1ae51..b4049251a6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -612,5 +612,3 @@ # OTOBO 10.0.0 beta1 2020-01-30 - First official OTOBO release, yippie! - - diff --git a/Kernel/Autoload/Test.pm b/Kernel/Autoload/Test.pm index 47f7d7d988..68bfd29bb3 100644 --- a/Kernel/Autoload/Test.pm +++ b/Kernel/Autoload/Test.pm @@ -14,9 +14,9 @@ # along with this program. If not, see . # -- -use Kernel::System::Valid; ## no critic (Modules::RequireExplicitPackage) +use Kernel::System::Valid; ## no critic (Modules::RequireExplicitPackage) -package Kernel::System::Valid; ## no critic (Modules::RequireFilenameMatchesPackage) +package Kernel::System::Valid; ## no critic (Modules::RequireFilenameMatchesPackage) use strict; use warnings; diff --git a/Kernel/Autoload/Znuny4OTOBOPasswordPolicy.pm b/Kernel/Autoload/Znuny4OTOBOPasswordPolicy.pm index 5981cd20db..7adaed0046 100644 --- a/Kernel/Autoload/Znuny4OTOBOPasswordPolicy.pm +++ b/Kernel/Autoload/Znuny4OTOBOPasswordPolicy.pm @@ -15,9 +15,9 @@ # along with this program. If not, see . # -- -use Kernel::Output::HTML::Layout; ## no critic (Modules::RequireExplicitPackage) +use Kernel::Output::HTML::Layout; ## no critic (Modules::RequireExplicitPackage) -package Kernel::Output::HTML::Layout; ## no critic (Modules::RequireFilenameMatchesPackage) +package Kernel::Output::HTML::Layout; ## no critic (Modules::RequireFilenameMatchesPackage) use strict; use warnings; @@ -29,7 +29,7 @@ our @ObjectDependencies = ( # disable redefine warnings in this scope { - no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings) + no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings) # backup original Redirect() my $Redirect = \&Kernel::Output::HTML::Layout::Redirect; diff --git a/Kernel/GenericInterface/ErrorHandling/RequestRetry.pm b/Kernel/GenericInterface/ErrorHandling/RequestRetry.pm index 4de7fc4a2a..272b94edeb 100644 --- a/Kernel/GenericInterface/ErrorHandling/RequestRetry.pm +++ b/Kernel/GenericInterface/ErrorHandling/RequestRetry.pm @@ -167,8 +167,7 @@ sub Run { # Calculate interval for next execution. my $RetryInterval; if ( IsStringWithData( $Param{PastExecutionData}->{RetryInterval} ) ) { - $RetryInterval - = int( $Param{PastExecutionData}->{RetryInterval} * $Param{ModuleConfig}->{RetryIntervalFactor} ); + $RetryInterval = int( $Param{PastExecutionData}->{RetryInterval} * $Param{ModuleConfig}->{RetryIntervalFactor} ); if ( IsStringWithData( $Param{ModuleConfig}->{RetryIntervalMax} ) && $RetryInterval > $Param{ModuleConfig}->{RetryIntervalMax} diff --git a/Kernel/Language.pm b/Kernel/Language.pm index 18ffb62ff7..e5996d4fd2 100644 --- a/Kernel/Language.pm +++ b/Kernel/Language.pm @@ -274,7 +274,7 @@ sub Translate { # Expecting that the replacements do not contain a '%'. # That the substitutions stop at the first undefined replacement can be considered a bug. - for my $Replacement ( @Replacements ) { + for my $Replacement (@Replacements) { return $Text unless defined $Replacement; $Text =~ s/\%(?:s|d)/$Replacement/; diff --git a/Kernel/Modules/AgentTicketActionCommon.pm b/Kernel/Modules/AgentTicketActionCommon.pm index 0f481f2b2a..6f4b9eb432 100644 --- a/Kernel/Modules/AgentTicketActionCommon.pm +++ b/Kernel/Modules/AgentTicketActionCommon.pm @@ -842,7 +842,7 @@ sub Run { # Do not validate only if object type is Article and CreateArticle value is not defined, or Field is invisible. if ( !( $DynamicFieldConfig->{ObjectType} eq 'Article' && !$GetParam{CreateArticle} ) - && $Visibility{ 'DynamicField_'.$DynamicFieldConfig->{Name} } + && $Visibility{ 'DynamicField_' . $DynamicFieldConfig->{Name} } ) { diff --git a/Kernel/Modules/AgentTicketEmail.pm b/Kernel/Modules/AgentTicketEmail.pm index 1d362fe3ff..27036f8b16 100644 --- a/Kernel/Modules/AgentTicketEmail.pm +++ b/Kernel/Modules/AgentTicketEmail.pm @@ -1423,7 +1423,7 @@ sub Run { my $ValidationResult; # do not validate on invisible fields - if ( !$ExpandCustomerName && $Visibility{ 'DynamicField_'.$DynamicFieldConfig->{Name} } ) { + if ( !$ExpandCustomerName && $Visibility{ 'DynamicField_' . $DynamicFieldConfig->{Name} } ) { $ValidationResult = $DynamicFieldBackendObject->EditFieldValueValidate( DynamicFieldConfig => $DynamicFieldConfig, diff --git a/Kernel/Modules/AgentTicketPhone.pm b/Kernel/Modules/AgentTicketPhone.pm index 2d06ee01e1..1c798ecd65 100644 --- a/Kernel/Modules/AgentTicketPhone.pm +++ b/Kernel/Modules/AgentTicketPhone.pm @@ -1237,7 +1237,7 @@ sub Run { my $ValidationResult; # do not validate on invisible fields - if ( !$ExpandCustomerName && $Visibility{ 'DynamicField_'.$DynamicFieldConfig->{Name} } ) { + if ( !$ExpandCustomerName && $Visibility{ 'DynamicField_' . $DynamicFieldConfig->{Name} } ) { $ValidationResult = $DynamicFieldBackendObject->EditFieldValueValidate( DynamicFieldConfig => $DynamicFieldConfig, diff --git a/Kernel/Modules/CustomerTicketMessage.pm b/Kernel/Modules/CustomerTicketMessage.pm index 411564ce5c..593ecbee71 100644 --- a/Kernel/Modules/CustomerTicketMessage.pm +++ b/Kernel/Modules/CustomerTicketMessage.pm @@ -628,7 +628,7 @@ sub Run { my $ValidationResult; # do not validate on insisible fields - if ( $Visibility{ 'DynamicField_'.$DynamicFieldConfig->{Name} } ) { + if ( $Visibility{ 'DynamicField_' . $DynamicFieldConfig->{Name} } ) { $ValidationResult = $BackendObject->EditFieldValueValidate( DynamicFieldConfig => $DynamicFieldConfig, diff --git a/Kernel/Modules/CustomerTicketZoom.pm b/Kernel/Modules/CustomerTicketZoom.pm index e6ea446f6c..8b6dfb587c 100644 --- a/Kernel/Modules/CustomerTicketZoom.pm +++ b/Kernel/Modules/CustomerTicketZoom.pm @@ -747,7 +747,7 @@ sub Run { my $ValidationResult; # do not validate invisible fields - if ( $Visibility{ 'DynamicField_'.$DynamicFieldConfig->{Name} } ) { + if ( $Visibility{ 'DynamicField_' . $DynamicFieldConfig->{Name} } ) { $ValidationResult = $BackendObject->EditFieldValueValidate( DynamicFieldConfig => $DynamicFieldConfig, PossibleValuesFilter => $PossibleValuesFilter, diff --git a/Kernel/Modules/Installer.pm b/Kernel/Modules/Installer.pm index 42271b3024..c1a275a65b 100644 --- a/Kernel/Modules/Installer.pm +++ b/Kernel/Modules/Installer.pm @@ -1229,7 +1229,7 @@ sub Run { # Only if we have mod_perl we have to restart. if ( exists $ENV{MOD_PERL} ) { - eval 'require mod_perl'; ## no critic qw(BuiltinFunctions::ProhibitStringyEval) + eval 'require mod_perl'; ## no critic qw(BuiltinFunctions::ProhibitStringyEval) if ( defined $mod_perl::VERSION ) { $Webserver = 'Apache2 + mod_perl'; if ( -f '/etc/SuSE-release' ) { diff --git a/Kernel/Modules/MigrateFromOTRS.pm b/Kernel/Modules/MigrateFromOTRS.pm index a1ef8c5ac4..e0abae0f55 100644 --- a/Kernel/Modules/MigrateFromOTRS.pm +++ b/Kernel/Modules/MigrateFromOTRS.pm @@ -588,7 +588,7 @@ sub _Finish { # Only if we have mod_perl we have to restart. if ( exists $ENV{MOD_PERL} ) { - eval 'require mod_perl'; ## no critic qw(BuiltinFunctions::ProhibitStringyEval) + eval 'require mod_perl'; ## no critic qw(BuiltinFunctions::ProhibitStringyEval) if ( defined $mod_perl::VERSION ) { $Webserver = 'systemctl restart apache2'; if ( -f '/etc/SuSE-release' ) { diff --git a/Kernel/Output/HTML/Layout.pm b/Kernel/Output/HTML/Layout.pm index f303b818a6..1acb84a082 100644 --- a/Kernel/Output/HTML/Layout.pm +++ b/Kernel/Output/HTML/Layout.pm @@ -80,7 +80,7 @@ sub new { my ( $Type, %Param ) = @_; # allocate new hash for object - my $Self = bless { %Param }, $Type; + my $Self = bless {%Param}, $Type; # set debug $Self->{Debug} = 0; @@ -146,7 +146,7 @@ sub new { # set charset if there is no charset given $Self->{UserCharset} = 'utf-8'; - $Self->{Charset} = $Self->{UserCharset}; # just for compat. + $Self->{Charset} = $Self->{UserCharset}; # just for compat. $Self->{SessionID} = $Param{SessionID} || ''; $Self->{SessionName} = $Param{SessionName} || 'SessionID'; $Self->{CGIHandle} = $Kernel::OM->Get('Kernel::System::Web::Request')->ScriptName() || 'No-$ENV{"SCRIPT_NAME"}'; @@ -377,7 +377,7 @@ EOF # force a theme based on host name my $DefaultThemeHostBased = $ConfigObject->Get('DefaultTheme::HostBased'); - my $Host = $ENV{HTTP_HOST}; + my $Host = $ENV{HTTP_HOST}; if ( $DefaultThemeHostBased && $Host ) { THEME: @@ -658,7 +658,7 @@ sub Redirect { } sub Login { - my ($Self, %Param) = @_; + my ( $Self, %Param ) = @_; # set Action parameter for the loader $Self->{Action} = 'Login'; @@ -1221,8 +1221,7 @@ sub NotifyNonUpdatedTickets { ); return $Self->Notify( - Info => $Self->{LanguageObject} - ->Translate( "The following tickets are not updated: %s.", $NonUpdatedTicketsString ), + Info => $Self->{LanguageObject}->Translate( "The following tickets are not updated: %s.", $NonUpdatedTicketsString ), ); } @@ -1243,7 +1242,7 @@ generates the HTML for the page begin in the Agent interface. =cut sub Header { - my ($Self, %Param) = @_; + my ( $Self, %Param ) = @_; # extract params my $Type = $Param{Type} || ''; @@ -1521,8 +1520,7 @@ sub Header { # See bug#13790 (https://bugs.otrs.org/show_bug.cgi?id=13790). if ( $ConfigObject->Get('Ticket::ArchiveSystem') && $Modules{$Key}->{Block} eq 'ToolBarSearchFulltext' ) { - $Modules{$Key}->{SearchInArchive} - = $ConfigObject->Get('Ticket::Frontend::AgentTicketSearch')->{Defaults}->{SearchInArchive}; + $Modules{$Key}->{SearchInArchive} = $ConfigObject->Get('Ticket::Frontend::AgentTicketSearch')->{Defaults}->{SearchInArchive}; } $Self->Block( @@ -1559,8 +1557,7 @@ sub Header { if ( $ConfigObject->Get('Frontend::AvatarEngine') eq 'Gravatar' && $Self->{UserEmail} ) { my $DefaultIcon = $ConfigObject->Get('Frontend::Gravatar::DefaultImage') || 'mp'; $Kernel::OM->Get('Kernel::System::Encode')->EncodeOutput( \$Self->{UserEmail} ); - $Param{Avatar} - = '//www.gravatar.com/avatar/' . md5_hex( lc $Self->{UserEmail} ) . '?s=100&d=' . $DefaultIcon; + $Param{Avatar} = '//www.gravatar.com/avatar/' . md5_hex( lc $Self->{UserEmail} ) . '?s=100&d=' . $DefaultIcon; } else { my %User = $Kernel::OM->Get('Kernel::System::User')->GetUserData( @@ -1801,7 +1798,7 @@ sub Print { my ( $Self, %Param ) = @_; # the string referenced by $Param{Content} might be modified here - $Self->ApplyOutputFilters( %Param ); + $Self->ApplyOutputFilters(%Param); # There seems to be a bug in FastCGI that it cannot handle unicode output properly. # Work around this by converting to an utf8 byte stream instead. @@ -1814,7 +1811,7 @@ sub Print { # Disable perl warnings in case of printing unicode private chars, # see https://rt.perl.org/Public/Bug/Display.html?id=121226. - no warnings 'nonchar'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings) + no warnings 'nonchar'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings) print ${ $Param{Output} }; @@ -5109,7 +5106,7 @@ sub RichTextDocumentServe { $Param{Data}->{Content} = $SafetyCheckResult{String}; - # Show confirmation button to load external content explicitly only if BlockLoadingRemoteContent is disabled. + # Show confirmation button to load external content explicitly only if BlockLoadingRemoteContent is disabled. if ( $SafetyCheckResult{Replace} && !$Kernel::OM->Get('Kernel::Config')->Get('Ticket::Frontend::BlockLoadingRemoteContent') diff --git a/Kernel/Output/PDF/Ticket.pm b/Kernel/Output/PDF/Ticket.pm index bb13a18df4..ecc4ca4762 100644 --- a/Kernel/Output/PDF/Ticket.pm +++ b/Kernel/Output/PDF/Ticket.pm @@ -415,7 +415,7 @@ sub _PDFOutputTicketInfos { $Responsible = $Ticket{Responsible} || '-'; } - if ( $Responsible ) { + if ($Responsible) { my $Row = { Key => $LayoutObject->{LanguageObject}->Translate('Responsible'), Value => $Responsible, diff --git a/Kernel/System/Calendar/Export/ICal.pm b/Kernel/System/Calendar/Export/ICal.pm index 9acff9510b..d926a0fbd5 100644 --- a/Kernel/System/Calendar/Export/ICal.pm +++ b/Kernel/System/Calendar/Export/ICal.pm @@ -430,7 +430,7 @@ sub Export { } { - no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings) + no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings) # Include product name and version in product ID property for debugging purposes, by redefining # external library method. diff --git a/Kernel/System/Calendar/Import/ICal.pm b/Kernel/System/Calendar/Import/ICal.pm index a100529a3e..fc23ee498b 100644 --- a/Kernel/System/Calendar/Import/ICal.pm +++ b/Kernel/System/Calendar/Import/ICal.pm @@ -760,7 +760,7 @@ sub _FormatTime { } { - no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings) + no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings) # Include additional optional repeatable properties used by some iCalendar implementations, in # order to prevent Perl warnings. diff --git a/Kernel/System/Console/Command/Dev/Tools/ImportFakeEmails.pm b/Kernel/System/Console/Command/Dev/Tools/ImportFakeEmails.pm index b862845d82..7474189357 100644 --- a/Kernel/System/Console/Command/Dev/Tools/ImportFakeEmails.pm +++ b/Kernel/System/Console/Command/Dev/Tools/ImportFakeEmails.pm @@ -36,7 +36,7 @@ package MyIMAP { ## no critic qw(Modules::ProhibitMultiplePackages) our $AUTOLOAD; sub new { - my ($Class, %Param) = @_; + my ( $Class, %Param ) = @_; $Param{TotalProcessed} = 0; $Param{Processed} = {}; @@ -110,7 +110,7 @@ test %s'; return wantarray ? @Lines : \@Lines; } - sub select { ## no critic qw(Subroutines::ProhibitBuiltinHomonyms) + sub select { ## no critic qw(Subroutines::ProhibitBuiltinHomonyms) my $Self = shift; return $Self->{Total} - $Self->{TotalProcessed}; @@ -249,7 +249,7 @@ sub _ImportEmails { # Redefine PostMaster::Run so we can fail some messages # and keep this change local to the current scope - no strict 'refs'; ## no critic (TestingAndDebugging::ProhibitNoStrict) + no strict 'refs'; ## no critic (TestingAndDebugging::ProhibitNoStrict) local *{'Kernel::System::MailAccount::IMAP::Connect'} = sub { my ( $Self, %Param ) = @_; diff --git a/Kernel/System/DB/mysql.pm b/Kernel/System/DB/mysql.pm index 56b8ae3a57..63c95df749 100644 --- a/Kernel/System/DB/mysql.pm +++ b/Kernel/System/DB/mysql.pm @@ -33,7 +33,7 @@ sub new { my ( $Class, %Param ) = @_; # allocate new hash for object - return bless { %Param }, $Class; + return bless {%Param}, $Class; } sub LoadPreferences { diff --git a/Kernel/System/Email/Sendmail.pm b/Kernel/System/Email/Sendmail.pm index 37a27006d4..c226352e82 100644 --- a/Kernel/System/Email/Sendmail.pm +++ b/Kernel/System/Email/Sendmail.pm @@ -131,7 +131,7 @@ sub Send { my $FH; my $GenErrorMessage = sub { return sprintf( q{Can't send message: %s!}, shift, ); }; - if ( !open( $FH, '|-', "$Sendmail $Arg " ) ) { ## no critic qw(InputOutput::RequireBriefOpen) + if ( !open( $FH, '|-', "$Sendmail $Arg " ) ) { ## no critic qw(InputOutput::RequireBriefOpen) my $ErrorMessage = $GenErrorMessage->($!); $Param{CommunicationLogObject}->ObjectLog( diff --git a/Kernel/System/Main.pm b/Kernel/System/Main.pm index cf8d80625c..f624b7676b 100644 --- a/Kernel/System/Main.pm +++ b/Kernel/System/Main.pm @@ -132,11 +132,10 @@ sub RequireBaseClass { # Load the module, if not already loaded. return if !$Self->Require($Module); - my $CallingClass = caller(0); { - no strict 'refs'; ## no critic (TestingAndDebugging::ProhibitNoStrict) + no strict 'refs'; ## no critic (TestingAndDebugging::ProhibitNoStrict) # Check if the base class was already loaded. # This can happen in persistent environments as mod_perl (see bug#9686). diff --git a/Kernel/System/MigrateFromOTRS/Base.pm b/Kernel/System/MigrateFromOTRS/Base.pm index 96ad6dd58e..24b9624140 100644 --- a/Kernel/System/MigrateFromOTRS/Base.pm +++ b/Kernel/System/MigrateFromOTRS/Base.pm @@ -114,7 +114,7 @@ sub CleanLicenseHeader { # Read parse content from _ChangeLicenseHeaderRules my @Parser = $Self->_ChangeLicenseHeaderRules(); - my $Parse = first { $FilePathAndName =~ m/$_->{File}/ } @Parser; + my $Parse = first { $FilePathAndName =~ m/$_->{File}/ } @Parser; if ( !$Parse ) { @@ -1222,7 +1222,7 @@ sub PackageMigrateIgnorePackages { { PackageName => 'Znuny4OTRS-EscalationSuspend', IgnoreType => 'Ignore', - Comment => 'Znuny4OTRS-EscalationSuspend package is integrated in OTOBO standard in a newer version.', + Comment => 'Znuny4OTRS-EscalationSuspend package is integrated in OTOBO standard in a newer version.', }, { PackageName => 'Znuny4OTRS-ExternalURLJump', @@ -1334,79 +1334,256 @@ sub DBRenameTables { # The values were determined by looking at the patches in scripts/database/otobo-schema.xml. sub DBShortenedColumns { return - { Table => 'acl', Column => 'name' }, - { Table => 'acl_sync', Column => 'acl_id' }, - { Table => 'article_data_mime_send_error', Column => 'message_id' }, - { Table => 'article_search_index', Column => 'article_key' }, - { Table => 'article_sender_type', Column => 'name' }, - { Table => 'auto_response', Column => 'name' }, - { Table => 'auto_response_type', Column => 'name' }, - { Table => 'calendar', Column => 'name' }, - { Table => 'cloud_service_config', Column => 'name' }, - { Table => 'communication_channel', Column => 'name' }, - { Table => 'communication_log', Column => 'direction' }, - { Table => 'communication_log', Column => 'status' }, - { Table => 'communication_log', Column => 'transport' }, - { Table => 'communication_log_obj_lookup', Column => 'object_type' }, - { Table => 'communication_log_object', Column => 'status' }, - { Table => 'communication_log_object_entry', Column => 'log_key' }, - { Table => 'customer_company', Column => 'name' }, - { Table => 'customer_preferences', Column => 'user_id' }, - { Table => 'customer_user', Column => 'login' }, - { Table => 'dynamic_field', Column => 'name' }, - { Table => 'dynamic_field_obj_id_name', Column => 'object_name' }, - { Table => 'follow_up_possible', Column => 'name' }, - { Table => 'form_draft', Column => 'action' }, - { Table => 'generic_agent_jobs', Column => 'job_name' }, - { Table => 'gi_webservice_config', Column => 'name' }, - { Table => 'groups_table', Column => 'name' }, - { Table => 'notification_event', Column => 'name' }, - { Table => 'notification_event_item', Column => 'event_key' }, - { Table => 'notification_event_item', Column => 'event_value' }, - { Table => 'postmaster_filter', Column => 'f_name' }, - { Table => 'queue', Column => 'name' }, - { Table => 'roles', Column => 'name' }, - { Table => 'salutation', Column => 'name' }, - { Table => 'search_profile', Column => 'login' }, - { Table => 'search_profile', Column => 'profile_name' }, - { Table => 'service', Column => 'name' }, - { Table => 'service_customer_user', Column => 'customer_user_login' }, - { Table => 'signature', Column => 'name' }, - { Table => 'sla', Column => 'name' }, - { Table => 'standard_attachment', Column => 'name' }, - { Table => 'standard_template', Column => 'name' }, - { Table => 'sysconfig_default', Column => 'name' }, - { Table => 'sysconfig_default_version', Column => 'name' }, - { Table => 'sysconfig_modified', Column => 'name' }, - { Table => 'sysconfig_modified_version', Column => 'name' }, - { Table => 'ticket', Column => 'customer_user_id' }, - { Table => 'ticket', Column => 'title' }, - { Table => 'ticket_history_type', Column => 'name' }, - { Table => 'ticket_index', Column => 'queue' }, - { Table => 'ticket_lock_type', Column => 'name' }, - { Table => 'ticket_loop_protection', Column => 'sent_to' }, - { Table => 'ticket_priority', Column => 'name' }, - { Table => 'ticket_state', Column => 'name' }, - { Table => 'ticket_state_type', Column => 'name' }, - { Table => 'ticket_type', Column => 'name' }, - { Table => 'users', Column => 'login' }, - { Table => 'valid', Column => 'name' }, - { Table => 'virtual_fs', Column => 'filename' }, - { Table => 'virtual_fs_db', Column => 'filename' }; + { + Table => 'acl', + Column => 'name' + }, + { + Table => 'acl_sync', + Column => 'acl_id' + }, + { + Table => 'article_data_mime_send_error', + Column => 'message_id' + }, + { + Table => 'article_search_index', + Column => 'article_key' + }, + { + Table => 'article_sender_type', + Column => 'name' + }, + { + Table => 'auto_response', + Column => 'name' + }, + { + Table => 'auto_response_type', + Column => 'name' + }, + { + Table => 'calendar', + Column => 'name' + }, + { + Table => 'cloud_service_config', + Column => 'name' + }, + { + Table => 'communication_channel', + Column => 'name' + }, + { + Table => 'communication_log', + Column => 'direction' + }, + { + Table => 'communication_log', + Column => 'status' + }, + { + Table => 'communication_log', + Column => 'transport' + }, + { + Table => 'communication_log_obj_lookup', + Column => 'object_type' + }, + { + Table => 'communication_log_object', + Column => 'status' + }, + { + Table => 'communication_log_object_entry', + Column => 'log_key' + }, + { + Table => 'customer_company', + Column => 'name' + }, + { + Table => 'customer_preferences', + Column => 'user_id' + }, + { + Table => 'customer_user', + Column => 'login' + }, + { + Table => 'dynamic_field', + Column => 'name' + }, + { + Table => 'dynamic_field_obj_id_name', + Column => 'object_name' + }, + { + Table => 'follow_up_possible', + Column => 'name' + }, + { + Table => 'form_draft', + Column => 'action' + }, + { + Table => 'generic_agent_jobs', + Column => 'job_name' + }, + { + Table => 'gi_webservice_config', + Column => 'name' + }, + { + Table => 'groups_table', + Column => 'name' + }, + { + Table => 'notification_event', + Column => 'name' + }, + { + Table => 'notification_event_item', + Column => 'event_key' + }, + { + Table => 'notification_event_item', + Column => 'event_value' + }, + { + Table => 'postmaster_filter', + Column => 'f_name' + }, + { + Table => 'queue', + Column => 'name' + }, + { + Table => 'roles', + Column => 'name' + }, + { + Table => 'salutation', + Column => 'name' + }, + { + Table => 'search_profile', + Column => 'login' + }, + { + Table => 'search_profile', + Column => 'profile_name' + }, + { + Table => 'service', + Column => 'name' + }, + { + Table => 'service_customer_user', + Column => 'customer_user_login' + }, + { + Table => 'signature', + Column => 'name' + }, + { + Table => 'sla', + Column => 'name' + }, + { + Table => 'standard_attachment', + Column => 'name' + }, + { + Table => 'standard_template', + Column => 'name' + }, + { + Table => 'sysconfig_default', + Column => 'name' + }, + { + Table => 'sysconfig_default_version', + Column => 'name' + }, + { + Table => 'sysconfig_modified', + Column => 'name' + }, + { + Table => 'sysconfig_modified_version', + Column => 'name' + }, + { + Table => 'ticket', + Column => 'customer_user_id' + }, + { + Table => 'ticket', + Column => 'title' + }, + { + Table => 'ticket_history_type', + Column => 'name' + }, + { + Table => 'ticket_index', + Column => 'queue' + }, + { + Table => 'ticket_lock_type', + Column => 'name' + }, + { + Table => 'ticket_loop_protection', + Column => 'sent_to' + }, + { + Table => 'ticket_priority', + Column => 'name' + }, + { + Table => 'ticket_state', + Column => 'name' + }, + { + Table => 'ticket_state_type', + Column => 'name' + }, + { + Table => 'ticket_type', + Column => 'name' + }, + { + Table => 'users', + Column => 'login' + }, + { + Table => 'valid', + Column => 'name' + }, + { + Table => 'virtual_fs', + Column => 'filename' + }, + { + Table => 'virtual_fs_db', + Column => 'filename' + }; } # list of files that need to be copied sub CopyFileListfromOTRSToOTOBO { my @Files = ( '/Kernel/Config.pm', - '/Kernel/Config.po', # what is that ? + '/Kernel/Config.po', # what is that ? '/var/httpd/htdocs/index.html', '/var/article', '/var/stats', ); # Under Docker there is no var/cron - if ( ! $ENV{OTOBO_RUNS_UNDER_DOCKER} ) { + if ( !$ENV{OTOBO_RUNS_UNDER_DOCKER} ) { push @Files, '/var/cron'; } diff --git a/Kernel/System/MigrateFromOTRS/CloneDB/Driver/mysql.pm b/Kernel/System/MigrateFromOTRS/CloneDB/Driver/mysql.pm index f321cb0f91..2742b5beab 100644 --- a/Kernel/System/MigrateFromOTRS/CloneDB/Driver/mysql.pm +++ b/Kernel/System/MigrateFromOTRS/CloneDB/Driver/mysql.pm @@ -157,7 +157,7 @@ END_SQL ) || return {}; my %Result; - while ( my ($Column, $Type) = $Param{DBObject}->FetchrowArray() ) { + while ( my ( $Column, $Type ) = $Param{DBObject}->FetchrowArray() ) { $Result{$Column} = $Type; } @@ -275,7 +275,7 @@ sub AlterTableAddColumn { my %ColumnInfos = %{ $Param{ColumnInfos} }; my $QuotedTable = $Param{DBObject}->QuoteIdentifier( Table => $Param{Table} ); - my $SQL = "ALTER TABLE $QuotedTable ADD $Param{Column} $ColumnInfos{DATA_TYPE}"; + my $SQL = "ALTER TABLE $QuotedTable ADD $Param{Column} $ColumnInfos{DATA_TYPE}"; if ( $ColumnInfos{LENGTH} ) { $SQL .= " \($ColumnInfos{LENGTH}\)"; diff --git a/Kernel/System/MigrateFromOTRS/CloneDB/Driver/oracle.pm b/Kernel/System/MigrateFromOTRS/CloneDB/Driver/oracle.pm index e250ef432f..9f8fbcb76a 100644 --- a/Kernel/System/MigrateFromOTRS/CloneDB/Driver/oracle.pm +++ b/Kernel/System/MigrateFromOTRS/CloneDB/Driver/oracle.pm @@ -374,7 +374,7 @@ sub AlterTableAddColumn { my %ColumnInfos = %{ $Param{ColumnInfos} }; my $QuotedTable = $Param{DBObject}->QuoteIdentifier( Table => $Param{Table} ); - my $SQL = "ALTER TABLE $QuotedTable ADD $Param{Column} $ColumnInfos{DATA_TYPE}"; + my $SQL = "ALTER TABLE $QuotedTable ADD $Param{Column} $ColumnInfos{DATA_TYPE}"; if ( $ColumnInfos{LENGTH} ) { $SQL .= " \($ColumnInfos{LENGTH}\)"; diff --git a/Kernel/System/MigrateFromOTRS/CloneDB/Driver/postgresql.pm b/Kernel/System/MigrateFromOTRS/CloneDB/Driver/postgresql.pm index 8a1a48f06d..161c484a70 100644 --- a/Kernel/System/MigrateFromOTRS/CloneDB/Driver/postgresql.pm +++ b/Kernel/System/MigrateFromOTRS/CloneDB/Driver/postgresql.pm @@ -223,8 +223,8 @@ END_SQL ) || return {}; my %Result; - while ( my ($Column, $Type) = $Param{DBObject}->FetchrowArray() ) { - $Result{ $Column } = $Type; + while ( my ( $Column, $Type ) = $Param{DBObject}->FetchrowArray() ) { + $Result{$Column} = $Type; } return \%Result; @@ -342,7 +342,7 @@ sub AlterTableAddColumn { my %ColumnInfos = %{ $Param{ColumnInfos} }; my $QuotedTable = $Param{DBObject}->QuoteIdentifier( Table => $Param{Table} ); - my $SQL = qq{ALTER TABLE $QuotedTable ADD $Param{Column} $ColumnInfos{DATA_TYPE}}; + my $SQL = qq{ALTER TABLE $QuotedTable ADD $Param{Column} $ColumnInfos{DATA_TYPE}}; if ( $ColumnInfos{LENGTH} ) { $SQL .= " \($ColumnInfos{LENGTH}\)"; diff --git a/Kernel/System/MigrateFromOTRS/OTOBOCopyFilesFromOTRS.pm b/Kernel/System/MigrateFromOTRS/OTOBOCopyFilesFromOTRS.pm index d89fa2d9d6..6573a61f56 100644 --- a/Kernel/System/MigrateFromOTRS/OTOBOCopyFilesFromOTRS.pm +++ b/Kernel/System/MigrateFromOTRS/OTOBOCopyFilesFromOTRS.pm @@ -90,7 +90,7 @@ sub Run { } # check needed parameters - for my $Key ( qw(OTRSData) ) { + for my $Key (qw(OTRSData)) { if ( !$Param{$Key} ) { $Kernel::OM->Get('Kernel::System::Log')->Log( Priority => 'error', @@ -146,7 +146,7 @@ sub Run { ); return { - Message => $Self->{LanguageObject}->Translate( $Message ), + Message => $Self->{LanguageObject}->Translate($Message), Comment => $Self->{LanguageObject}->Translate( "Can't access OTRS Home: %s!", $Param{OTRSData}->{OTRSHome} ), Successful => 0, }; @@ -213,9 +213,9 @@ sub Run { print STDERR "EXIT: $ExitCode \n OTRSPath: $OTRSPathFile\n OTOBO: $OTOBOPathFile\n "; return { - Message => $Self->{LanguageObject}->Translate($Message), - Comment => $Self->{LanguageObject}->Translate(q{Can't copy or move files from OTRS!}), - Successful => 0, + Message => $Self->{LanguageObject}->Translate($Message), + Comment => $Self->{LanguageObject}->Translate(q{Can't copy or move files from OTRS!}), + Successful => 0, }; } } @@ -265,9 +265,9 @@ sub Run { $Self->DisableSecureMode(); return { - Message => $Self->{LanguageObject}->Translate($Message), - Comment => $Self->{LanguageObject}->Translate("All needed files copied and migrated, perfect!"), - Successful => 1, + Message => $Self->{LanguageObject}->Translate($Message), + Comment => $Self->{LanguageObject}->Translate("All needed files copied and migrated, perfect!"), + Successful => 1, }; } @@ -295,14 +295,14 @@ sub ReConfigure { # content of changed config file my $Config = ''; { - open my $In, '<:encoding(utf-8)', $ConfigFile ## no critic qw(InputOutput::RequireBriefOpen) - or return "Can't open $ConfigFile: $!"; ## no critic qw(OTOBO::ProhibitLowPrecedenceOps) + open my $In, '<:encoding(utf-8)', $ConfigFile ## no critic qw(InputOutput::RequireBriefOpen) + or return "Can't open $ConfigFile: $!"; ## no critic qw(OTOBO::ProhibitLowPrecedenceOps) LINE: while ( my $Line = <$In> ) { # keep empty lines or comments. - if ( ! $Line || $Line =~ m/^\s*#/ || $Line =~ m/^\s*$/ ) { + if ( !$Line || $Line =~ m/^\s*#/ || $Line =~ m/^\s*$/ ) { $Config .= $Line; next LINE; diff --git a/Kernel/System/MigrateFromOTRS/OTOBOMigrateConfigFromOTRS.pm b/Kernel/System/MigrateFromOTRS/OTOBOMigrateConfigFromOTRS.pm index 452cf4b58b..285c24f550 100644 --- a/Kernel/System/MigrateFromOTRS/OTOBOMigrateConfigFromOTRS.pm +++ b/Kernel/System/MigrateFromOTRS/OTOBOMigrateConfigFromOTRS.pm @@ -79,7 +79,7 @@ sub Run { my $SysConfigObject = $Kernel::OM->Get('Kernel::System::SysConfig'); my $SysConfigDBObject = $Kernel::OM->Get('Kernel::System::SysConfig::DB'); - my $Epoch = $DateTimeObject->ToEpoch(); + my $Epoch = $DateTimeObject->ToEpoch(); $CacheObject->Set( Type => 'OTRSMigration', diff --git a/Kernel/System/MigrateFromOTRS/OTOBOOTRSConnectionCheck.pm b/Kernel/System/MigrateFromOTRS/OTOBOOTRSConnectionCheck.pm index 62d40be7b7..fc19f0f81b 100644 --- a/Kernel/System/MigrateFromOTRS/OTOBOOTRSConnectionCheck.pm +++ b/Kernel/System/MigrateFromOTRS/OTOBOOTRSConnectionCheck.pm @@ -282,7 +282,7 @@ sub _CheckConfigpmAndWriteCache { Key => 'OTRSDBSettings', Value => { DBType => $CacheOptions{DBType}, - DBHost => $CacheOptions{DBHost}, # usually needs to be adapted when running under Docker + DBHost => $CacheOptions{DBHost}, # usually needs to be adapted when running under Docker DBUser => $CacheOptions{DBUser}, DBPassword => $CacheOptions{DBPassword}, DBName => $CacheOptions{DBName}, diff --git a/Kernel/System/MigrateFromOTRS/OTOBOOTRSDBCheck.pm b/Kernel/System/MigrateFromOTRS/OTOBOOTRSDBCheck.pm index 0339643a5b..668e5732d7 100644 --- a/Kernel/System/MigrateFromOTRS/OTOBOOTRSDBCheck.pm +++ b/Kernel/System/MigrateFromOTRS/OTOBOOTRSDBCheck.pm @@ -97,9 +97,9 @@ sub Run { } # create OTRS DB connection - my $Message = $Self->{LanguageObject}->Translate("Try database connect and sanity checks."); + my $Message = $Self->{LanguageObject}->Translate("Try database connect and sanity checks."); my $CloneDBBackendObject = $Kernel::OM->Get('Kernel::System::MigrateFromOTRS::CloneDB::Backend'); - my $SourceDBObject = $CloneDBBackendObject->CreateOTRSDBConnection( + my $SourceDBObject = $CloneDBBackendObject->CreateOTRSDBConnection( OTRSDBSettings => $Param{DBData}, ); diff --git a/Kernel/System/SysConfig.pm b/Kernel/System/SysConfig.pm index 30163d330a..93f83ea741 100644 --- a/Kernel/System/SysConfig.pm +++ b/Kernel/System/SysConfig.pm @@ -1006,8 +1006,7 @@ sub SettingEffectiveValueGet { && $Param{Value}->[0]->{Hash}->[0]->{DefaultItem}->[0]->{$Attribute}->[0]->{DefaultItem} ) { - $Attributes{DefaultItem} - = $Param{Value}->[0]->{Hash}->[0]->{DefaultItem}->[0]->{$Attribute}->[0]->{DefaultItem}; + $Attributes{DefaultItem} = $Param{Value}->[0]->{Hash}->[0]->{DefaultItem}->[0]->{$Attribute}->[0]->{DefaultItem}; } next ATTRIBUTE if grep { $Attribute eq $_ } ( qw (Array Hash), @ValueAttributeList ); @@ -2651,15 +2650,15 @@ sub ConfigurationXML2DB { # Update default setting. my $Success = $SysConfigDBObject->DefaultSettingUpdate( - DefaultID => $DefaultSetting->{DefaultID}, - Name => $Settings{$SettingName}->{XMLContentParsed}->{Name}, - Description => $Settings{$SettingName}->{XMLContentParsed}->{Description}->[0]->{Content} || '', - Navigation => $Settings{$SettingName}->{XMLContentParsed}->{Navigation}->[0]->{Content} || '', - IsInvisible => $Settings{$SettingName}->{XMLContentParsed}->{Invisible} || 0, - IsReadonly => $Settings{$SettingName}->{XMLContentParsed}->{ReadOnly} || 0, - IsRequired => $Settings{$SettingName}->{XMLContentParsed}->{Required} || 0, - IsValid => $Settings{$SettingName}->{XMLContentParsed}->{Valid} || 0, - HasConfigLevel => $Settings{$SettingName}->{XMLContentParsed}->{ConfigLevel} || 100, + DefaultID => $DefaultSetting->{DefaultID}, + Name => $Settings{$SettingName}->{XMLContentParsed}->{Name}, + Description => $Settings{$SettingName}->{XMLContentParsed}->{Description}->[0]->{Content} || '', + Navigation => $Settings{$SettingName}->{XMLContentParsed}->{Navigation}->[0]->{Content} || '', + IsInvisible => $Settings{$SettingName}->{XMLContentParsed}->{Invisible} || 0, + IsReadonly => $Settings{$SettingName}->{XMLContentParsed}->{ReadOnly} || 0, + IsRequired => $Settings{$SettingName}->{XMLContentParsed}->{Required} || 0, + IsValid => $Settings{$SettingName}->{XMLContentParsed}->{Valid} || 0, + HasConfigLevel => $Settings{$SettingName}->{XMLContentParsed}->{ConfigLevel} || 100, UserModificationPossible => $Settings{$SettingName}->{XMLContentParsed}->{UserModificationPossible} || 0, UserModificationActive => $Settings{$SettingName}->{XMLContentParsed}->{UserModificationActive} @@ -2721,14 +2720,14 @@ sub ConfigurationXML2DB { ); $DefaultSettingsAdd{ $Settings{$SettingName}->{XMLContentParsed}->{Name} } = { - Name => $Settings{$SettingName}->{XMLContentParsed}->{Name}, - Description => $Settings{$SettingName}->{XMLContentParsed}->{Description}->[0]->{Content} || '', - Navigation => $Settings{$SettingName}->{XMLContentParsed}->{Navigation}->[0]->{Content} || '', - IsInvisible => $Settings{$SettingName}->{XMLContentParsed}->{Invisible} || 0, - IsReadonly => $Settings{$SettingName}->{XMLContentParsed}->{ReadOnly} || 0, - IsRequired => $Settings{$SettingName}->{XMLContentParsed}->{Required} || 0, - IsValid => $Settings{$SettingName}->{XMLContentParsed}->{Valid} || 0, - HasConfigLevel => $Settings{$SettingName}->{XMLContentParsed}->{ConfigLevel} || 100, + Name => $Settings{$SettingName}->{XMLContentParsed}->{Name}, + Description => $Settings{$SettingName}->{XMLContentParsed}->{Description}->[0]->{Content} || '', + Navigation => $Settings{$SettingName}->{XMLContentParsed}->{Navigation}->[0]->{Content} || '', + IsInvisible => $Settings{$SettingName}->{XMLContentParsed}->{Invisible} || 0, + IsReadonly => $Settings{$SettingName}->{XMLContentParsed}->{ReadOnly} || 0, + IsRequired => $Settings{$SettingName}->{XMLContentParsed}->{Required} || 0, + IsValid => $Settings{$SettingName}->{XMLContentParsed}->{Valid} || 0, + HasConfigLevel => $Settings{$SettingName}->{XMLContentParsed}->{ConfigLevel} || 100, UserModificationPossible => $Settings{$SettingName}->{XMLContentParsed}->{UserModificationPossible} || 0, UserModificationActive => $Settings{$SettingName}->{XMLContentParsed}->{UserModificationActive} @@ -2952,9 +2951,9 @@ sub ConfigurationNavigationTree { ); } - # Until now we have structure of the Navigation tree without sub-node count. We need this number to disable - # click on empty nodes. We could implement that in the _NavigationTree, but it's not efficient(loop of 1800+ settings). - # Instead, we extend result in the _NavigationTreeNodeCount. + # Until now we have structure of the Navigation tree without sub-node count. We need this number to disable + # click on empty nodes. We could implement that in the _NavigationTree, but it's not efficient(loop of 1800+ settings). + # Instead, we extend result in the _NavigationTreeNodeCount. %Result = $Self->_NavigationTreeNodeCount( Tree => \%Result, Settings => \@Settings, @@ -4143,7 +4142,7 @@ sub ConfigurationDump { SettingList => \@SettingsList, OnlyValues => $Param{OnlyValues}, ); - if ( %UserSettings ) { + if (%UserSettings) { %Result = ( %Result, %UserSettings ); } } @@ -4180,8 +4179,7 @@ sub ConfigurationLoad { } } - my %ConfigurationRaw - = %{ $Kernel::OM->Get('Kernel::System::YAML')->Load( Data => $Param{ConfigurationYAML} ) || {} }; + my %ConfigurationRaw = %{ $Kernel::OM->Get('Kernel::System::YAML')->Load( Data => $Param{ConfigurationYAML} ) || {} }; if ( !%ConfigurationRaw ) { $Kernel::OM->Get('Kernel::System::Log')->Log( @@ -4364,8 +4362,7 @@ sub ConfigurationLockedSettingsList { return if !IsArrayRefWithData( \@DefaultSettingsList ); if ( $Param{ExclusiveLockUserID} ) { - @DefaultSettingsList - = map { $_->{Name} } grep { $_->{ExclusiveLockUserID} eq $Param{ExclusiveLockUserID} } @DefaultSettingsList; + @DefaultSettingsList = map { $_->{Name} } grep { $_->{ExclusiveLockUserID} eq $Param{ExclusiveLockUserID} } @DefaultSettingsList; } else { @DefaultSettingsList = map { $_->{Name} } @DefaultSettingsList; @@ -4880,7 +4877,7 @@ sub OverriddenFileNameGet { return if !$LastDeployment{EffectiveValueStrg}; { - eval $LastDeployment{EffectiveValueStrg}; ## no critic qw(BuiltinFunctions::ProhibitStringyEval) + eval $LastDeployment{EffectiveValueStrg}; ## no critic qw(BuiltinFunctions::ProhibitStringyEval) Kernel::Config::Files::ZZZAAuto->Load($ConfigFromDB); } @@ -5117,11 +5114,11 @@ sub _FileWriteAtomic { } # write to a temp file - my $TempFilename = $Param{Filename} . '.' . $$; # append the processs id + my $TempFilename = $Param{Filename} . '.' . $$; # append the processs id { - my $Success = open( my $FH, ">$Self->{FileMode}", $TempFilename ); ## no critic qw(InputOutput::RequireBriefOpen) - if ( ! $Success ) { + my $Success = open( my $FH, ">$Self->{FileMode}", $TempFilename ); ## no critic qw(InputOutput::RequireBriefOpen) + if ( !$Success ) { $Kernel::OM->Get('Kernel::System::Log')->Log( Priority => 'error', diff --git a/Kernel/System/SysConfig/ValueType/WorkingHours.pm b/Kernel/System/SysConfig/ValueType/WorkingHours.pm index c1ae4b6ddc..4530002751 100644 --- a/Kernel/System/SysConfig/ValueType/WorkingHours.pm +++ b/Kernel/System/SysConfig/ValueType/WorkingHours.pm @@ -273,7 +273,7 @@ sub ModifiedValueGet { 'ValueType' => 'Day', }; - if ( @HourItems ) { + if (@HourItems) { $Item->{Item} = \@HourItems; } else { diff --git a/Kernel/System/Ticket/Article/Backend/MIMEBase.pm b/Kernel/System/Ticket/Article/Backend/MIMEBase.pm index 0358d48e54..5fefc0850d 100644 --- a/Kernel/System/Ticket/Article/Backend/MIMEBase.pm +++ b/Kernel/System/Ticket/Article/Backend/MIMEBase.pm @@ -1070,7 +1070,7 @@ Write a plain email to storage. This is a delegate method from active backend. =cut -sub ArticleWritePlain { ## no critic qw(Subroutines::RequireArgUnpacking) +sub ArticleWritePlain { ## no critic qw(Subroutines::RequireArgUnpacking) my $Self = shift; return $Kernel::OM->Get( $Self->{ArticleStorageModule} )->ArticleWritePlain(@_); @@ -1101,7 +1101,7 @@ Returns: =cut sub ArticlePlain { - my ($Self, @Args) = @_; + my ( $Self, @Args ) = @_; return $Kernel::OM->Get( $Self->{ArticleStorageModule} )->ArticlePlain(@Args); } diff --git a/Kernel/System/Ticket/CustomExample.pm b/Kernel/System/Ticket/CustomExample.pm index 8c57089965..87d3f322df 100644 --- a/Kernel/System/Ticket/CustomExample.pm +++ b/Kernel/System/Ticket/CustomExample.pm @@ -23,7 +23,7 @@ our $ObjectManagerDisabled = 1; # disable redefine warnings in this scope { - no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings) + no warnings 'redefine'; ## no critic qw(TestingAndDebugging::ProhibitNoWarnings) # as example redefine the TicketXXX() of Kernel::System::Ticket sub Kernel::System::Ticket::TicketXXX { diff --git a/Kernel/System/UnitTest.pm b/Kernel/System/UnitTest.pm index c8f03eb775..4b547b9668 100644 --- a/Kernel/System/UnitTest.pm +++ b/Kernel/System/UnitTest.pm @@ -104,13 +104,13 @@ sub Run { # run tests in a subdir when requested my $Directory = "$Home/scripts/test"; - if ( $DirectoryParam ) { + if ($DirectoryParam) { $Directory .= "/$DirectoryParam"; $Directory =~ s/\.//g; } # Determine which tests should be skipped because of UnitTest::Blacklist - my (@SkippedTests, @ActualTests); + my ( @SkippedTests, @ActualTests ); { # Get patterns for blacklisted tests my @BlacklistPatterns; @@ -140,7 +140,7 @@ sub Run { for my $File (@Files) { # check if only some tests are requested - if ( @ExecuteTestPatterns ) { + if (@ExecuteTestPatterns) { next FILE unless any { $File =~ /\/\Q$_\E\.t$/smx } @ExecuteTestPatterns; } @@ -190,6 +190,7 @@ sub Run { $Cmd =~ s{%TestOk%}{$TestOk}iesmxg; my $TestNotOk = $Parser->actual_failed(); $Cmd =~ s{%TestNotOk%}{$TestNotOk}iesmxg; + #use Data::Dumper; #warn Dumper( [ 'LLL', $Cmd, $TestScript, $TestInfo, $Parser ] ); @@ -200,7 +201,7 @@ sub Run { ); } - my $Aggregate = $Harness->runtests( @ActualTests ); + my $Aggregate = $Harness->runtests(@ActualTests); if (@SkippedTests) { print "Following blacklisted tests were skipped:\n"; diff --git a/Kernel/System/UnitTest/Helper.pm b/Kernel/System/UnitTest/Helper.pm index 39cc576792..77c2a099d4 100644 --- a/Kernel/System/UnitTest/Helper.pm +++ b/Kernel/System/UnitTest/Helper.pm @@ -190,6 +190,7 @@ sub TestUserCreate { # code that emits test events for the subtest my $Code = sub { + # Disable email checks to create new user. my $ConfigObject = $Kernel::OM->Get('Kernel::Config'); local $ConfigObject->{CheckEmailAddresses} = 0; @@ -212,11 +213,11 @@ sub TestUserCreate { last COUNT if $TestUserID; } - bail_out( 'Could not create test user login' ) unless $TestUserLogin; - bail_out( 'Could not create test user' ) unless $TestUserID; + bail_out('Could not create test user login') unless $TestUserLogin; + bail_out('Could not create test user') unless $TestUserID; # looks good so far - pass( "Created test user $TestUserID" ); + pass("Created test user $TestUserID"); # Remember UserID of the test user to later set it to invalid # in the destructor. @@ -228,7 +229,7 @@ sub TestUserCreate { for my $GroupName ( @{ $Param{Groups} || [] } ) { my $GroupID = $GroupObject->GroupLookup( Group => $GroupName ); - bail_out( "Cannot find group $GroupName" ) unless $GroupID; + bail_out("Cannot find group $GroupName") unless $GroupID; $GroupObject->PermissionGroupUserAdd( GID => $GroupID, @@ -242,9 +243,9 @@ sub TestUserCreate { rw => 1, }, UserID => 1, - ) || bail_out( "Could not add test user $TestUserLogin to group $GroupName" ); + ) || bail_out("Could not add test user $TestUserLogin to group $GroupName"); - pass( "Added test user $TestUserLogin to group $GroupName" ); + pass("Added test user $TestUserLogin to group $GroupName"); } # Set user language. @@ -255,10 +256,17 @@ sub TestUserCreate { Value => $UserLanguage, ); - note( "Set user UserLanguage to $UserLanguage" ); + note("Set user UserLanguage to $UserLanguage"); }; - run_subtest( 'TestUserCreate', $Code, { buffered => 1, inherit_trace => 1 } ); + run_subtest( + 'TestUserCreate', + $Code, + { + buffered => 1, + inherit_trace => 1 + } + ); $Context->release(); @@ -286,6 +294,7 @@ sub TestCustomerUserCreate { my $TestUser; my $Code = sub { + # Disable email checks to create new user. my $ConfigObject = $Kernel::OM->Get('Kernel::Config'); local $ConfigObject->{CheckEmailAddresses} = 0; @@ -310,8 +319,8 @@ sub TestCustomerUserCreate { last COUNT if $TestUser; } - bail_out( 'Could not create test user' ) unless $TestUser; - pass( "Created test customer user $TestUser" ); + bail_out('Could not create test user') unless $TestUser; + pass("Created test customer user $TestUser"); # Remember UserID of the test user to later set it to invalid # in the destructor. @@ -326,10 +335,17 @@ sub TestCustomerUserCreate { Value => $UserLanguage, ); - note( "Set customer user UserLanguage to $UserLanguage" ); + note("Set customer user UserLanguage to $UserLanguage"); }; - run_subtest( 'TestCustomerUsers', $Code, { buffered => 1, inherit_trace => 1 } ); + run_subtest( + 'TestCustomerUsers', + $Code, + { + buffered => 1, + inherit_trace => 1 + } + ); $Context->release(); @@ -345,7 +361,7 @@ Starts a database transaction (in order to isolate the test from the static data =cut sub BeginWork { - my ( $Self ) = @_; + my ($Self) = @_; my $DBObject = $Kernel::OM->Get('Kernel::System::DB'); $DBObject->Connect(); @@ -363,7 +379,7 @@ Should only be called when BeginWork() has been called before. =cut sub Rollback { - my ( $Self ) = @_; + my ($Self) = @_; return $Kernel::OM->Get('Kernel::System::DB')->Rollback(); } @@ -879,7 +895,7 @@ sub TestDatabaseCleanup { # Get a list of all tables in database. my @Tables = $DBObject->ListTables(); - if ( @Tables ) { + if (@Tables) { my $TableList = join ', ', sort @Tables; my $DBType = $DBObject->{'DB::Type'}; diff --git a/Kernel/System/UnitTest/Selenium/WebElement.pm b/Kernel/System/UnitTest/Selenium/WebElement.pm index f52c487560..871b24e08a 100644 --- a/Kernel/System/UnitTest/Selenium/WebElement.pm +++ b/Kernel/System/UnitTest/Selenium/WebElement.pm @@ -54,7 +54,7 @@ This works only in OTOBO. =cut sub VerifiedSubmit { - my $Self = shift; + my $Self = shift; my $Context = context(); @@ -100,13 +100,20 @@ sub VerifiedClick { $Self->driver()->WaitFor( JavaScript => 'return typeof(Core) == "object" && typeof(Core.App) == "object" && Core.App.PageLoadComplete' - ) || $Context->throw( "OTOBO API verification failed after element click." ); + ) || $Context->throw("OTOBO API verification failed after element click."); }; - my $Pass = run_subtest( 'VerifiedClick', $Code, { buffered => 1, inherit_trace => 1 } ); + my $Pass = run_subtest( + 'VerifiedClick', + $Code, + { + buffered => 1, + inherit_trace => 1 + } + ); # run_subtest() does an implicit eval(), but we want do bail out on the first error - $Context->throw( 'command failed' ) unless $Pass; + $Context->throw('command failed') unless $Pass; $Context->release();