diff --git a/AUTHORS.md b/AUTHORS.md index 1f7fb1515b2..802f515d9bd 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -41,6 +41,7 @@ The following persons contributed to Znuny: * Henrik Vetter * IB Development Team * Igor Djuric +* Ivo Oliveira <128880860+Bashizz@users.noreply.github.com> * Jan Steinweg * JannisKleinrensing <71767611+JannisKleinrensing@users.noreply.github.com> * Jaroslav Balaz diff --git a/CHANGES.md b/CHANGES.md index 54b8a1a7551..eb68b1f94f8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,8 @@ # 7.1.4 2024-??-?? + - 2025-01-21 Fixed Bug - Problem when handling errors in the owner field in the activity dialog. Thanks to Daylton Rodrigues (@dayltonr) for reporting. [#627](https://github.com/znuny/Znuny/issues/627). + - 2025-01-16 Increased size of columns profile_key and profile_value of database table search_profile. + - 2025-01-15 Sector Nord AG: Fixed module check for calendar plugin. Thanks to Sector Nord AG (@jsinagowitz). [PR#623](https://github.com/znuny/Znuny/pull/623) + - 2024-12-23 Improved ACL checks in ticket overview modules. - 2024-12-10 System configuration option SendmailEncodingForce is now a selection instead of a text field. - 2024-12-10 Fixed "From" and "To" not being expandable for an article in ticket zoom. Thanks to Oliver Freyermuth (@olifre) for reporting. [#605](https://github.com/znuny/Znuny/issues/605) - 2024-12-09 Fixed multiple notifications being sent for empty process tickets (event NotificationNewTicket). diff --git a/Kernel/Modules/AgentTicketProcess.pm b/Kernel/Modules/AgentTicketProcess.pm index 3d697f590cb..d1054d542d0 100644 --- a/Kernel/Modules/AgentTicketProcess.pm +++ b/Kernel/Modules/AgentTicketProcess.pm @@ -3572,7 +3572,7 @@ sub _RenderOwner { # set server errors my $ServerError = ''; - if ( IsHashRefWithData( $Param{Error} ) && $Param{Error}->{'Owner'} ) { + if ( IsHashRefWithData( $Param{Error} ) && $Param{Error}->{'OwnerID'} ) { $ServerError = 'ServerError'; } diff --git a/Kernel/Output/HTML/TicketOverview/Medium.pm b/Kernel/Output/HTML/TicketOverview/Medium.pm index 2178bd6e0b2..179a865475e 100644 --- a/Kernel/Output/HTML/TicketOverview/Medium.pm +++ b/Kernel/Output/HTML/TicketOverview/Medium.pm @@ -479,19 +479,7 @@ sub _Show { sort keys %Actions; } - my $ACL = $TicketObject->TicketAcl( - Data => \%PossibleActions, - Action => $Self->{Action}, - TicketID => $Article{TicketID}, - ReturnType => 'Action', - ReturnSubType => '-', - UserID => $Self->{UserID}, - ); - my %AclAction = %PossibleActions; - if ($ACL) { - %AclAction = $TicketObject->TicketAclActionData(); - } # get main object my $MainObject = $Kernel::OM->Get('Kernel::System::Main'); @@ -500,6 +488,22 @@ sub _Show { my @ActionItems; if ( ref $ConfigObject->Get('Ticket::Frontend::PreMenuModule') eq 'HASH' ) { my %Menus = %{ $ConfigObject->Get('Ticket::Frontend::PreMenuModule') }; + + if (%Menus) { + my $ACL = $TicketObject->TicketAcl( + Data => \%PossibleActions, + Action => $Self->{Action}, + TicketID => $Article{TicketID}, + ReturnType => 'Action', + ReturnSubType => '-', + UserID => $Self->{UserID}, + ); + + if ($ACL) { + %AclAction = $TicketObject->TicketAclActionData(); + } + } + MENU: for my $Menu ( sort keys %Menus ) { @@ -676,78 +680,6 @@ sub _Show { } } - # create output - $LayoutObject->Block( - Name => 'AgentAnswer', - Data => { - %Param, - %Article, - %AclAction, - }, - ); - - if ( - $ConfigObject->Get('Frontend::Module')->{AgentTicketCompose} - && ( !defined $AclAction{AgentTicketCompose} || $AclAction{AgentTicketCompose} ) - ) - { - my $Access = 1; - my $Config = $ConfigObject->Get("Ticket::Frontend::AgentTicketCompose"); - if ( $Config->{Permission} ) { - my $Ok = $TicketObject->TicketPermission( - Type => $Config->{Permission}, - TicketID => $Param{TicketID}, - UserID => $Self->{UserID}, - LogNo => 1, - ); - if ( !$Ok ) { - $Access = 0; - } - if ($Access) { - $LayoutObject->Block( - Name => 'AgentAnswerCompose', - Data => { - %Param, - %Article, - %AclAction, - }, - ); - } - } - } - if ( - $ConfigObject->Get('Frontend::Module')->{AgentTicketPhoneOutbound} - && ( - !defined $AclAction{AgentTicketPhoneOutbound} - || $AclAction{AgentTicketPhoneOutbound} - ) - ) - { - my $Access = 1; - my $Config = $ConfigObject->Get("Ticket::Frontend::AgentTicketPhoneOutbound"); - if ( $Config->{Permission} ) { - my $OK = $TicketObject->TicketPermission( - Type => $Config->{Permission}, - TicketID => $Param{TicketID}, - UserID => $Self->{UserID}, - LogNo => 1, - ); - if ( !$OK ) { - $Access = 0; - } - } - if ($Access) { - $LayoutObject->Block( - Name => 'AgentAnswerPhoneOutbound', - Data => { - %Param, - %Article, - %AclAction, - }, - ); - } - } - # ticket type if ( $ConfigObject->Get('Ticket::Type') ) { $LayoutObject->Block( @@ -1064,7 +996,6 @@ sub _Show { Data => { %Param, %Article, - %AclAction, }, ); diff --git a/Kernel/Output/HTML/TicketOverview/Preview.pm b/Kernel/Output/HTML/TicketOverview/Preview.pm index c1e44e2918b..273c0467e49 100644 --- a/Kernel/Output/HTML/TicketOverview/Preview.pm +++ b/Kernel/Output/HTML/TicketOverview/Preview.pm @@ -513,19 +513,7 @@ sub _Show { sort keys %Actions; } - my $ACL = $TicketObject->TicketAcl( - Data => \%PossibleActions, - Action => $Self->{Action}, - TicketID => $Article{TicketID}, - ReturnType => 'Action', - ReturnSubType => '-', - UserID => $Self->{UserID}, - ); - my %AclAction = %PossibleActions; - if ($ACL) { - %AclAction = $TicketObject->TicketAclActionData(); - } # get main object my $MainObject = $Kernel::OM->Get('Kernel::System::Main'); @@ -534,6 +522,22 @@ sub _Show { my @ActionItems; if ( ref $ConfigObject->Get('Ticket::Frontend::PreMenuModule') eq 'HASH' ) { my %Menus = %{ $ConfigObject->Get('Ticket::Frontend::PreMenuModule') }; + + if (%Menus) { + my $ACL = $TicketObject->TicketAcl( + Data => \%PossibleActions, + Action => $Self->{Action}, + TicketID => $Article{TicketID}, + ReturnType => 'Action', + ReturnSubType => '-', + UserID => $Self->{UserID}, + ); + + if ($ACL) { + %AclAction = $TicketObject->TicketAclActionData(); + } + } + MENU: for my $Menu ( sort keys %Menus ) { @@ -769,77 +773,6 @@ sub _Show { } } - # create output - $LayoutObject->Block( - Name => 'AgentAnswer', - Data => { - %Param, - %Article, - %AclAction, - }, - ); - if ( - $ConfigObject->Get('Frontend::Module')->{AgentTicketCompose} - && ( !defined $AclAction{AgentTicketCompose} || $AclAction{AgentTicketCompose} ) - ) - { - my $Access = 1; - my $Config = $ConfigObject->Get('Ticket::Frontend::AgentTicketCompose'); - if ( $Config->{Permission} ) { - my $Ok = $TicketObject->Permission( - Type => $Config->{Permission}, - TicketID => $Param{TicketID}, - UserID => $Self->{UserID}, - LogNo => 1, - ); - if ( !$Ok ) { - $Access = 0; - } - if ($Access) { - $LayoutObject->Block( - Name => 'AgentAnswerCompose', - Data => { - %Param, - %Article, - %AclAction, - }, - ); - } - } - } - if ( - $ConfigObject->Get('Frontend::Module')->{AgentTicketPhoneOutbound} - && ( - !defined $AclAction{AgentTicketPhoneOutbound} - || $AclAction{AgentTicketPhoneOutbound} - ) - ) - { - my $Access = 1; - my $Config = $ConfigObject->Get('Ticket::Frontend::AgentTicketPhoneOutbound'); - if ( $Config->{Permission} ) { - my $OK = $TicketObject->Permission( - Type => $Config->{Permission}, - TicketID => $Param{TicketID}, - UserID => $Self->{UserID}, - LogNo => 1, - ); - if ( !$OK ) { - $Access = 0; - } - } - if ($Access) { - $LayoutObject->Block( - Name => 'AgentAnswerPhoneOutbound', - Data => { - %Param, - %Article, - %AclAction, - }, - ); - } - } - # ticket type if ( $ConfigObject->Get('Ticket::Type') ) { $LayoutObject->Block( @@ -1191,7 +1124,6 @@ sub _Show { Data => { %Param, %Article, - %AclAction, }, ); } @@ -1259,14 +1191,7 @@ sub _Show { ); # check if compose link should be shown - if ( - $ConfigObject->Get('Frontend::Module')->{AgentTicketCompose} - && ( - !defined $AclAction{AgentTicketCompose} - || $AclAction{AgentTicketCompose} - ) - ) - { + if ( $ConfigObject->Get('Frontend::Module')->{AgentTicketCompose} ) { my $Access = 1; my $Config = $ConfigObject->Get('Ticket::Frontend::AgentTicketCompose'); if ( $Config->{Permission} ) { @@ -1319,7 +1244,6 @@ sub _Show { Data => { %Param, %Article, - %AclAction, }, ); return \$Output; diff --git a/Kernel/Output/HTML/TicketOverview/Small.pm b/Kernel/Output/HTML/TicketOverview/Small.pm index f03872dccc0..1b69f4e569c 100644 --- a/Kernel/Output/HTML/TicketOverview/Small.pm +++ b/Kernel/Output/HTML/TicketOverview/Small.pm @@ -542,23 +542,27 @@ sub Run { sort keys %Actions; } - my $ACL = $TicketObject->TicketAcl( - Data => \%PossibleActions, - Action => $Self->{Action}, - TicketID => $Article{TicketID}, - ReturnType => 'Action', - ReturnSubType => '-', - UserID => $Self->{UserID}, - ); my %AclAction = %PossibleActions; - if ($ACL) { - %AclAction = $TicketObject->TicketAclActionData(); - } # run ticket pre menu modules my @ActionItems; if ( ref $ConfigObject->Get('Ticket::Frontend::PreMenuModule') eq 'HASH' ) { my %Menus = %{ $ConfigObject->Get('Ticket::Frontend::PreMenuModule') }; + + if (%Menus) { + my $ACL = $TicketObject->TicketAcl( + Data => \%PossibleActions, + Action => $Self->{Action}, + TicketID => $Article{TicketID}, + ReturnType => 'Action', + ReturnSubType => '-', + UserID => $Self->{UserID}, + ); + if ($ACL) { + %AclAction = $TicketObject->TicketAclActionData(); + } + } + my @Items; MENU: for my $Menu ( sort keys %Menus ) { diff --git a/Kernel/System/Calendar/Plugin.pm b/Kernel/System/Calendar/Plugin.pm index ea53a308922..524ad478fdb 100644 --- a/Kernel/System/Calendar/Plugin.pm +++ b/Kernel/System/Calendar/Plugin.pm @@ -152,12 +152,13 @@ sub PluginFunction { } my $PluginObject = $Self->{Plugins}->{ $Param{PluginKey} }->{Object}; + my $PluginModule = $Self->{Plugins}->{ $Param{PluginKey} }->{Module}; my $PluginFunction = $Param{PluginFunction}; - if ( $MainObject->Require( $PluginObject, Silent => 1 ) ) { + if ( !$MainObject->Require( $PluginModule, Silent => 1 ) ) { $LogObject->Log( Priority => 'error', - Message => "Sorry, can't load $PluginObject!", + Message => "Sorry, can't load $PluginModule!", ); return; } diff --git a/Kernel/System/Crypt/SMIME.pm b/Kernel/System/Crypt/SMIME.pm index 7509dc695ec..6f4fe631f41 100644 --- a/Kernel/System/Crypt/SMIME.pm +++ b/Kernel/System/Crypt/SMIME.pm @@ -632,7 +632,10 @@ sub KeysList { my $DBObject = $Kernel::OM->Get('Kernel::System::DB'); return if !$DBObject->Prepare( - SQL => "SELECT * FROM smime_keys", + SQL => ' + SELECT id, key_hash, key_type, file_name, email_address, expiration_date, fingerprint, subject, create_time + FROM smime_keys + ', ); my @KeysList; diff --git a/scripts/Migration/Znuny/UpgradeDatabaseStructure.pm b/scripts/Migration/Znuny/UpgradeDatabaseStructure.pm index c6ec77cec85..e0285bfcf1a 100644 --- a/scripts/Migration/Znuny/UpgradeDatabaseStructure.pm +++ b/scripts/Migration/Znuny/UpgradeDatabaseStructure.pm @@ -44,6 +44,10 @@ sub Run { Message => 'Create missing primary keys for database tables.', Module => 'CreatePrimaryKeys', }, + { + Message => 'Increase size of columns of database table search_profile', + Module => 'SearchProfile', + }, ); return 1 if !@Tasks; diff --git a/scripts/Migration/Znuny/UpgradeDatabaseStructure/SearchProfile.pm b/scripts/Migration/Znuny/UpgradeDatabaseStructure/SearchProfile.pm new file mode 100644 index 00000000000..6db98225942 --- /dev/null +++ b/scripts/Migration/Znuny/UpgradeDatabaseStructure/SearchProfile.pm @@ -0,0 +1,49 @@ +# -- +# Copyright (C) 2021 Znuny GmbH, https://znuny.org/ +# -- +# This software comes with ABSOLUTELY NO WARRANTY. For details, see +# the enclosed file COPYING for license information (AGPL). If you +# did not receive this file, see http://www.gnu.org/licenses/agpl.txt. +# -- + +package scripts::Migration::Znuny::UpgradeDatabaseStructure::SearchProfile; ## no critic + +use strict; +use warnings; + +use parent qw(scripts::Migration::Base); + +our @ObjectDependencies; + +=head1 SYNOPSIS + +Increases size of columns of database table search_profile. + +=cut + +sub Run { + my ( $Self, %Param ) = @_; + + return if !$Self->_IncreaseColumnsSize(%Param); + + return 1; +} + +sub _IncreaseColumnsSize { + my ( $Self, %Param ) = @_; + + my @XMLStrings = ( + ' + + + ', + ); + + return if !$Self->ExecuteXMLDBArray( + XMLArray => \@XMLStrings, + ); + + return 1; +} + +1; diff --git a/scripts/database/schema.mysql.sql b/scripts/database/schema.mysql.sql index 842129c7d07..f9f797ac9f9 100644 --- a/scripts/database/schema.mysql.sql +++ b/scripts/database/schema.mysql.sql @@ -1126,8 +1126,8 @@ CREATE TABLE search_profile ( login VARCHAR (200) NOT NULL, profile_name VARCHAR (200) NOT NULL, profile_type VARCHAR (30) NOT NULL, - profile_key VARCHAR (200) NOT NULL, - profile_value VARCHAR (200) NULL, + profile_key TEXT NOT NULL, + profile_value TEXT NULL, PRIMARY KEY(id), INDEX search_profile_login (login), INDEX search_profile_profile_name (profile_name) diff --git a/scripts/database/schema.oracle.sql b/scripts/database/schema.oracle.sql index 97161ac234e..edf99f21b25 100644 --- a/scripts/database/schema.oracle.sql +++ b/scripts/database/schema.oracle.sql @@ -4195,8 +4195,8 @@ CREATE TABLE search_profile ( login VARCHAR2 (200) NOT NULL, profile_name VARCHAR2 (200) NOT NULL, profile_type VARCHAR2 (30) NOT NULL, - profile_key VARCHAR2 (200) NOT NULL, - profile_value VARCHAR2 (200) NULL + profile_key VARCHAR2 (2000) NOT NULL, + profile_value VARCHAR2 (2000) NULL ); ALTER TABLE search_profile ADD CONSTRAINT PK_search_profile PRIMARY KEY (id); BEGIN diff --git a/scripts/database/schema.postgresql.sql b/scripts/database/schema.postgresql.sql index ea9513e496d..04f2e96615c 100644 --- a/scripts/database/schema.postgresql.sql +++ b/scripts/database/schema.postgresql.sql @@ -1967,8 +1967,8 @@ CREATE TABLE search_profile ( login VARCHAR (200) NOT NULL, profile_name VARCHAR (200) NOT NULL, profile_type VARCHAR (30) NOT NULL, - profile_key VARCHAR (200) NOT NULL, - profile_value VARCHAR (200) NULL, + profile_key VARCHAR (2000) NOT NULL, + profile_value VARCHAR (2000) NULL, PRIMARY KEY(id) ); DO $$ diff --git a/scripts/database/schema.xml b/scripts/database/schema.xml index ff81c11eb70..87535d1b947 100644 --- a/scripts/database/schema.xml +++ b/scripts/database/schema.xml @@ -1704,8 +1704,8 @@ - - + +