RE: [otrs] Set default of "Answered?" to Yes?

Tyler, thanks so much for your detailed information. As I don't want tickets that have *just* been created to have the answered = 1 I believe the option of changing AgentCompose.pm makes more sense. I've located the following lines and will list a couple of ways in which I have attempted to change them. I've seen absolutely no change in the operation of the AgentCompose screen. Perhaps you can offer a quick pointer or two? Original: # set answerd $Self->{TicketObject}->TicketSetAnswered( TicketID => $Self->{TicketID}, UserID => $Self->{UserID}, Answered => $GetParam{Answered} || 0, ); I've tried changing the 'Answered' line in the following ways (Sorry about my COMPLETE ignorance regarding perl programming!!!!) Answered => '1' || 0, Answered => '8' || 0, (a non-zero and non-one value) Answered => 1 || 0, Answered => 0 || 1, Etc... Thanks in advance... - Pete McDonnell Manager, Technical Services Hip Interactive
-----Original Message----- From: Tyler Hepworth [mailto:raklet@gmail.com] Sent: Wednesday, October 27, 2004 7:06 PM To: User questions and discussions about OTRS. Subject: Re: [otrs] Set default of "Answered?" to Yes?
On Wed, 27 Oct 2004 14:58:35 -0600, Tyler Hepworth
wrote: On Wed, 27 Oct 2004 14:40:28 -0400, Pete McDonnell
wrote: Rudi, do you think this is something that would have to be set using Perl code (altering the function, perhaps?) Or might one be able to change the order in which the options are displayed using HTML changes?
I wonder if it's simply displaying them in alphabetical order right now?
No it is not. If you look at Contact Customer (phone), it is set to "yes". If you look at Compose Answer (email) it is set to "no". I am digging through the source code to figure out how this is generated. Please be patient as I hope to have something figured out by the end of today.
Ok, I have some insight on this with a NOT RECOMMENDED fix.
The code for Compose Answer is contained in AgentCompose.pm The code for Contact Customer is in AgentPhone.pm.
Here is the gist of it
if $Param{Answered} is defined then set the select option value to display the defined value. Otherwise, set the selected value to "Yes" and display that.
When dumping the result of $Param{Answered}, AgentCompose.pm returns the value "0", which is a defined value and corresponds to the state "No". If you change the value to "Yes" and submit it, then the next time you work on the ticket $Param{Answered} returns a value of 1 and displays "Yes" in the ticket screen. So this works as it should. It is built that way by design.
Where does $Param{Answered} come from you might ask? It is stored in the database in the table "ticket". The column is "ticket_answered". So, ultimately, what is displayed in the ticket screen (yes or no) depends on what is stored in the database. All new tickets are created with a default value of "0".
Why does Contact Customer show "yes" then? Dumping the result of $Param{Answered} returns undef - it is not defined. I have set a ticket to "No", submitted, and reopened, but it always displays "Yes" even if the value in the database is "No". This is a bug that needs to be fixed.
So, how can I make Contact Customer (email) display yes (other than setting it to yes and saving it). You have to break the system. You either have to reprogram the ticket module to make the default value of new tickets "1" which would be a lie. Or you can modify $Param{Answered} in AgentCompose.pm to set it to undef. Which would make the ticket also show "Yes" regardless of whether that is really true. _______________________________________________ OTRS mailing list: otrs - Webpage: http://otrs.org/ Archive: http://lists.otrs.org/pipermail/otrs To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/otrs Support oder Consulting für Ihr OTRS System? => http://www.otrs.de/

On Thu, 28 Oct 2004 18:09:50 -0400, Pete McDonnell
Tyler, thanks so much for your detailed information. As I don't want tickets that have *just* been created to have the answered = 1 I believe the option of changing AgentCompose.pm makes more sense. I've located the following lines and will list a couple of ways in which I have attempted to change them. I've seen absolutely no change in the operation of the AgentCompose screen. Perhaps you can offer a quick pointer or two?
Original: # set answerd $Self->{TicketObject}->TicketSetAnswered( TicketID => $Self->{TicketID}, UserID => $Self->{UserID}, Answered => $GetParam{Answered} || 0, ); I've tried changing the 'Answered' line in the following ways (Sorry about my COMPLETE ignorance regarding perl programming!!!!)
Answered => '1' || 0, Answered => '8' || 0, (a non-zero and non-one value) Answered => 1 || 0, Answered => 0 || 1, Etc...
Thanks in advance...
Okay, here is a diff patch that will give you the behavior you want. Note, this breaks the program and cause "Is Ticket Answered" to always show "Yes" regardless of what is in the database; however, despite the showing of "Yes", the value does update appropriately in the backend so you should still get the ultimate goal of what you are trying to achieve. --- Kernel/Modules/AgentCompose.pm (revision 15) +++ Kernel/Modules/AgentCompose.pm (working copy) @@ -634,6 +634,7 @@ $Param{'StdAttachmentsStrg'} .= "</select>\n"; } # answered strg + $Param{Answered} = undef; if (defined($Param{Answered})) { $Param{'AnsweredYesNoOption'} = $Self->{LayoutObject}->OptionStrgHashRef( Data => $Self->{ConfigObject}->Get('YesNoOptions'), Hth, Tyler Hepworth
participants (2)
-
Pete McDonnell
-
Tyler Hepworth