Commit 8d2e75ec authored by Timmer, Marius's avatar Timmer, Marius

Bugfix

ArticleAttachmentIndex() and ArticleAttachment() are not longer a part of the TicketObject.
Additionally fixed a bug comparing two wrong values to determinate weather a result should be printed or not.
y
parent 31a71ea4
......@@ -13,6 +13,7 @@ our @ObjectDependencies = (
'Kernel::System::Log',
'Kernel::System::Queue',
'Kernel::System::Ticket',
'Kernel::System::Ticket::Article',
'Kernel::System::User'
);
......@@ -25,6 +26,7 @@ sub new {
LogObject => $Kernel::OM->Get('Kernel::System::Log'),
QueueObject => $Kernel::OM->Get('Kernel::System::Queue'),
TicketObject => $Kernel::OM->Get('Kernel::System::Ticket'),
ArticleObject => $Kernel::OM->Get('Kernel::System::Ticket::Article'),
UserObject => $Kernel::OM->Get('Kernel::System::User'),
MainObject => $Kernel::OM->Get('Kernel::System::Main')
};
......@@ -120,7 +122,7 @@ sub Run {
$Self->StoreAttachments(
TicketID => $TicketID,
FilePrefix => $Filepath . $QueueName .'_'. $TicketID .'_'. $TicketData{TicketNumber} .'_',
Print => $PrintStatus
Print => $Param{Print}
);
}
}
......@@ -172,7 +174,11 @@ sub StoreAttachments {
# Here we iterate through all articles from the current ticket we still
# have. The Attachments for each article will be found.
for my $ArticleID (sort keys %ArticleIDs) {
my %Attachments = $Self->{TicketObject}->ArticleAttachmentIndex(
my $ArticleBackendObject = $Self->{ArticleObject}->BackendForArticle(
TicketID => $Param{TicketID},
ArticleID => $ArticleID
);
my %Attachments = $ArticleBackendObject->ArticleAttachmentIndex(
ArticleID => $ArticleID,
UserID => $Self->{UserID},
ExcludePlainText => 0,
......@@ -190,7 +196,7 @@ sub StoreAttachments {
# each other. So we have to ignore it.
next;
}
my %AttachmentData = $Self->{TicketObject}->ArticleAttachment(
my %AttachmentData = $ArticleBackendObject->ArticleAttachment(
ArticleID => $ArticleID,
FileID => $FileID,
UserID => $Self->{UserID}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment