Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Fixed articleget old stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
richieri committed Apr 4, 2020
1 parent 13336ab commit 42a203f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Custom/LigeroEasyConnector.sopm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<otrs_package version="1.1">
<Name>LigeroEasyConnector</Name>
<Version>6.1.3</Version>
<Version>6.1.4</Version>
<Vendor>Ligero</Vendor>
<URL>http://complemento.net.br/</URL>
<License>GNU GENERAL PUBLIC LICENSE Version 2, June 1991</License>
Expand Down
52 changes: 26 additions & 26 deletions Kernel/GenericInterface/Invoker/Ligero/LigeroEasyConnector.pm
Original file line number Diff line number Diff line change
Expand Up @@ -147,34 +147,34 @@ sub PrepareRequest {
$Ticket{CustomerUser} = $Ticket{CustomerUserID};
}

### Get Article
if(IsStringWithData( $Param{Data}->{ArticleID} )){
%Article = $Kernel::OM->Get('Kernel::System::Ticket')->ArticleGet(
ArticleID => $Param{Data}->{ArticleID},
DynamicFields => 1,
Extended => 1,
UserID => 1
);
$Article{CustomerUser} = $Article{CustomerUserID};

delete $Article{$_} for grep /^((?!DynamicField_)).*ID$/, keys %Article;

my %Attachments = $Kernel::OM->Get('Kernel::System::Ticket')->ArticleAttachmentIndex(ArticleID => $Param{Data}->{ArticleID}, UserID => 1);
# ### Get Article
# if(IsStringWithData( $Param{Data}->{ArticleID} )){
# %Article = $Kernel::OM->Get('Kernel::System::Ticket')->ArticleGet(
# ArticleID => $Param{Data}->{ArticleID},
# DynamicFields => 1,
# Extended => 1,
# UserID => 1
# );
# $Article{CustomerUser} = $Article{CustomerUserID};

# delete $Article{$_} for grep /^((?!DynamicField_)).*ID$/, keys %Article;

# my %Attachments = $Kernel::OM->Get('Kernel::System::Ticket')->ArticleAttachmentIndex(ArticleID => $Param{Data}->{ArticleID}, UserID => 1);

for (keys %Attachments){
my %Attachment = $Kernel::OM->Get('Kernel::System::Ticket')->ArticleAttachment(
ArticleID => $Param{Data}->{ArticleID},
FileID => $_, # as returned by ArticleAttachmentIndex
UserID => 1,
);
my %At;
$At{Content} = encode_base64($Attachment{Content});
$At{ContentType} = $Attachments{$_}->{ContentType};
$At{Filename} = $Attachments{$_}->{Filename};
# for (keys %Attachments){
# my %Attachment = $Kernel::OM->Get('Kernel::System::Ticket')->ArticleAttachment(
# ArticleID => $Param{Data}->{ArticleID},
# FileID => $_, # as returned by ArticleAttachmentIndex
# UserID => 1,
# );
# my %At;
# $At{Content} = encode_base64($Attachment{Content});
# $At{ContentType} = $Attachments{$_}->{ContentType};
# $At{Filename} = $Attachments{$_}->{Filename};

push @Ats, \%At;
}
}
# push @Ats, \%At;
# }
# }

#### Get Service if Any
if($Ticket{ServiceID}){
Expand Down

0 comments on commit 42a203f

Please sign in to comment.