Re: Edit internal messages

Juan Manuel Clavero Almirón <[email protected]> Tue, 21 Nov 2017 08:46:32 +0000
Newsgroups gmane.comp.otrs.devel
Message-ID <4E6C4135180B424CBFC6C6DE9456154A01B56311A1@SCPDPSEXMB03P.ssib.local>
Hi sepp,

I understand that you want to allow edition of subject or body. If so,  I haven't tested it but I think it would be like follows:

You have to call the ArticleUpdate twice:
> once with key subject and value of the subject form
> another with key body and value of the body form

if you want also to allow one person to edit the article of another one, maybe you should look to modify the from field

Kind regards,
Juan Clavero

-----Mensaje original-----
De: dev [mailto:[email protected]] En nombre de Josef Penzkofer
Enviado el: martes, 21 de noviembre de 2017 9:39
Para: [email protected]
Asunto: [dev] Edit internal messages

Hi community,

because of our agents (1st Level-Support) do not work all together at teh same time, I insert another dashlet "Internal Messages". Therefore I copied the functionality of "AgentTicketPhone". This means, all this posted internal messages are tickets.

The mask for posting a message contains only an edit-box for the subject and another for the content. All other fields are prefilled and disabled.

Now I try to add a function to edit a message afterwards it was created.

Here is, what I achieved till now:
1.) File: ArticleEdit.pm
Directory: /Kernel/Output/HTML/FilterElementPost

This file provides a button "Edit" into the articlemenu and the corresponding link.
 
2.) File: AgentArticleEdit.pm
Directory: /Custom/Kernel/Modules

Tis file contains the calling function:
my $Success = $TicketObject->ArticleUpdate(
  ArticleID => $GetParam{ArticleID},
  UserID    => $Self->{UserID},
);

3.) Core-file (Standard Core-File of OTRS)
File: Article.pm
Directory: /Kernel/System/ticket

This file contains:
=item ArticleUpdate()
update an article
Note: Keys "Body", "Subject", "From", "To", "Cc", "ReplyTo", "ArticleType" and "SenderType" are implemented.

    my $Success = $TicketObject->ArticleUpdate(
        ArticleID => 123,
        Key       => 'Body',
        Value     => 'New Body',
        UserID    => 123,
        TicketID  => 123,
    );

    my $Success = $TicketObject->ArticleUpdate(
        ArticleID => 123,
        Key       => 'ArticleType',
        Value     => 'email-internal',
        UserID    => 123,
        TicketID  => 123,
    );

Events:
    ArticleUpdate

=cut

sub ArticleUpdate {
...
}

4.) Output-File for edit-mask
A *.tt file, that provides a mask with to editboxes and a button to update the message.

Now, when clicking the button "edit" in a zoomed message (ticket), a new Popup-window appears and I could edit the subject or the content. 

But when clicking the button "update", an error-screen appears and the otrs-logfile contains the following error-message:
[Error][Kernel::System::Ticket::Article::ArticleUpdate][2074] Need Key!

I know, the Key is needed for the SQL-Statement to update the corresponding field into the database.

How could I set this value for "Key"?

Thanks in advance.

Sepp





_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/mailman/listinfo/dev
_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/mailman/listinfo/dev