Skip to content

Commit

Permalink
Merge branch 'rel-11_0' into rel-11_1
Browse files Browse the repository at this point in the history
  • Loading branch information
bschmalhofer committed Dec 13, 2024
2 parents f8b9658 + e604197 commit 591634b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Kernel/Language/ar_SA.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5303,7 +5303,7 @@ sub Data {
'Check to activate this date' => 'حدد لتمكين هذا التاريخ',
'%s TB' => '‎%s تيرابايت (TB)',
'%s GB' => '‎%s غيغابايت (GB)',
'%s MB' => 's% ميغاباي ‎(MB)',
'%s MB' => '‎%s ميغابايت (MB)',
'%s KB' => '‎%s كيلوبايت (KB)',
'%s B' => '‎%s بايت (B)',
'No Permission!' => 'لا توجد صلاحيات!',
Expand Down
2 changes: 2 additions & 0 deletions Kernel/Modules/AdminDynamicFieldReference.pm
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ sub _AddAction {

# differentiate only between autocomplete and dropdown
$FieldConfig{EditFieldMode} = $FieldConfig{EditFieldMode} eq 'AutoComplete' ? 'AutoComplete' : 'Dropdown';
$FieldConfig{PossibleNone} = $FieldConfig{EditFieldMode} eq 'AutoComplete' ? 1 : $FieldConfig{PossibleNone};

# multiselect excludes multivalue
$FieldConfig{MultiValue} = $FieldConfig{Multiselect} ? 0 : $FieldConfig{MultiValue};
Expand Down Expand Up @@ -721,6 +722,7 @@ sub _ChangeAction {

# differentiate only between autocomplete and dropdown
$FieldConfig{EditFieldMode} = $FieldConfig{EditFieldMode} eq 'AutoComplete' ? 'AutoComplete' : 'Dropdown';
$FieldConfig{PossibleNone} = $FieldConfig{EditFieldMode} eq 'AutoComplete' ? 1 : $FieldConfig{PossibleNone};

# multiselect excludes multivalue
$FieldConfig{MultiValue} = $FieldConfig{Multiselect} ? 0 : $FieldConfig{MultiValue};
Expand Down
1 change: 1 addition & 0 deletions Kernel/System/Ticket.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6362,6 +6362,7 @@ sub TicketAccountTime {
Data => {
TicketID => $Param{TicketID},
ArticleID => $Param{ArticleID},
TimeUnits => $Param{TimeUnit}
},
UserID => $Param{UserID},
);
Expand Down
24 changes: 24 additions & 0 deletions Kernel/System/Ticket/Article.pm
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,30 @@ sub ArticleAccountedTimeGet {
$AccountedTime += $TimeUnit;
}

return $AccountedTime if $AccountedTime;

# article not found in time_accounting table, check if it is deleted and sum former times
return if !$DBObject->Prepare(
SQL => 'SELECT id FROM article_version WHERE source_article_id = ? AND article_delete = 1 ORDER BY id DESC',
Bind => [ \$Param{ArticleID} ],
Limit => 1,
);

if ( my ($DeletedArticleID) = $DBObject->FetchrowArray ) {

# db query
return if !$DBObject->Prepare(
SQL => 'SELECT time_unit FROM time_accounting_version WHERE article_id = ?',
Bind => [ \$DeletedArticleID ],
);

# Sum the result rows, even if usually there is only one row.
while ( my ($TimeUnit) = $DBObject->FetchrowArray ) {
$TimeUnit =~ s/,/./g;
$AccountedTime += $TimeUnit;
}
}

return $AccountedTime;
}

Expand Down
4 changes: 2 additions & 2 deletions Kernel/System/Ticket/ArticleFeatures.pm
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,10 @@ sub ArticleRestore {

=head2 DeleteVersionData()
Delete all version data for an article.
Delete all version data for all articles in a ticket.
my $Success = $ArticleFeaturesObject->DeleteVersionData(
ArticleID => 123, # required
TicketID => 123, # required
);
Returns:
Expand Down

0 comments on commit 591634b

Please sign in to comment.