Customization form of creating ticket by the customer

English! place to talk about development, programming and coding
Post Reply
trudelmer
Znuny newbie
Posts: 2
Joined: 03 Mar 2016, 15:51
Znuny Version: 5.0.6
Real Name: Rodrigo Soares
Company: CEEE

Customization form of creating ticket by the customer

Post by trudelmer »

Hello, I'm trying to make a customization but as I am not Perl programmer I tended difficulty.
OTRS 5.0.6

1 - Added two new fields in the table ARTICLE
alter table ARTICLE add fl1 VARCHAR2(250) NULL;
alter table ARTICLE add fl2 VARCHAR2(250) NULL;


2 - I added the hidden fields in the form /opt/otrs/Kernel/Output/HTML/Templates/Standard/CustomerTicketMessage.tt
<input type="hidden" value="abcd" name="fl1" id="fl1">
<input type="hidden" value="efgh" name="fl2" id="fl2">

3 - /opt/otrs/Kernel/System/Ticket/Article.pm did change the file to the database
283 return if !$DBObject->Do(
284 SQL => 'INSERT INTO article '
285 . '(ticket_id, article_type_id, article_sender_type_id, a_from, a_reply_to, a_to, '
286 . 'a_cc, a_subject, a_message_id, a_message_id_md5, a_in_reply_to, a_references, a_body, a_content_type, '
287 . 'content_path, valid_id, incoming_time, create_time, create_by, change_time, change_by, fl1, fl2) '
288 . 'VALUES '
289 . '(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, current_timestamp, ?, current_timestamp, ?, ?, ?)',
290 Bind => [
291 \$Param{TicketID}, \$Param{ArticleTypeID}, \$Param{SenderTypeID},
292 \$Param{From}, \$Param{ReplyTo}, \$Param{To},
293 \$Param{Cc}, \$Param{Subject}, \$Param{MessageID},
294 \$Param{MD5},
295 \$Param{InReplyTo}, \$Param{References}, \$Param{Body},
296 \$Param{ContentType}, \$Self->{ArticleContentPath}, \$ValidID,
297 \$IncomingTime, \$Param{UserID}, \$Param{UserID},
298 \$Param{fl1}, \$Param{fl2},
299 ],
300 );

4 - Also changed the /opt/otrs/Kernel/Modules/CustomerTicketMessage.pm file to see if it works
538 # create new ticket, do db insert
539 my $TicketID = $TicketObject->TicketCreate(
540 QueueID => $NewQueueID,
541 TypeID => $GetParam{TypeID},
542 ServiceID => $GetParam{ServiceID},
543 SLAID => $GetParam{SLAID},
544 Title => $GetParam{Subject},
545 PriorityID => $GetParam{PriorityID},
546 Priority => $GetParam{Priority},
547 fl1 => $GetParam{fl1},
548 fl2 => $GetParam{fl2},

But when the form is submitted (the customer at ticket creation) data is not recorded in the database. There is also no error message, the ticket is created normally.
Any programmer could tell me where I am going wrong? I missed define something in a file?

I do not want to use dynamic field !!! I've done a customization with dynamic field but I'm leaving for a new challenge.

I appreciate any help. Thank you
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Customization form of creating ticket by the customer

Post by jojo »

Please use the Dynamic Fields as intented. OTRS is a complex software, so changing database will break upgradability.
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
trudelmer
Znuny newbie
Posts: 2
Joined: 03 Mar 2016, 15:51
Znuny Version: 5.0.6
Real Name: Rodrigo Soares
Company: CEEE

Re: Customization form of creating ticket by the customer

Post by trudelmer »

I agree with you, you can already do with the dynamic field but I'm trying to understand the programming of OTRS for this reason I posted the question on the forum of the developers, I am a subject of the student and I'm interested in understanding how the framework transfers the inputs between modules .
jojo
Znuny guru
Posts: 15019
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Customization form of creating ticket by the customer

Post by jojo »

you also have to consider the backend modules in Kernel/System (like Ticket.pm). Did you read the developer manual (http://doc.otrs.org)
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Post Reply