On TicketClose do AgentTicketPrint

Moderator: crythias

Locked
sale1902
Znuny newbie
Posts: 13
Joined: 23 Dec 2011, 11:44
Znuny Version: 3.0.8
Real Name: Aleksandar Jovanović
Company: M.A.I. Trade

On TicketClose do AgentTicketPrint

Post by sale1902 »

Hey,

this is what i want to do.

I set up few dynamic fields that are showing on TicketClose screen. That part works ok. One of the dynamic fields is "Print this ticket to pdf" which is a checkbox.
What i would like to know is how can i set up that when this checkbox field is checked, ticket is printing to pdf.

I tried playing with various files but i am not good at all with Perl, so i am really struggling. If someone could point me in right direction, i would be greatful.

I tried playing with AgentTicketActionCommon.pm, but best thing i achieved is to print every ticket to pdf (no matter what dynamic field value is).
OTRS v3.2.7. on Ubuntu server 11.10.
MySQL database
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: On TicketClose do AgentTicketPrint

Post by crythias »

sale1902 wrote:how can i set up that when this checkbox field is checked, ticket is printing to pdf.
you should find out what the "Print" button on the page does and mimic it.
(What does that mean?)
it does this:

Code: Select all

http://otrsserver/otrs/index.pl?Action=AgentTicketPrint;TicketID=xx
(How can I make a checkbox do that?)

(But I need to pass the ticket ID? How?)
Maybe you can just print the ticket before closing it.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
sale1902
Znuny newbie
Posts: 13
Joined: 23 Dec 2011, 11:44
Znuny Version: 3.0.8
Real Name: Aleksandar Jovanović
Company: M.A.I. Trade

Re: On TicketClose do AgentTicketPrint

Post by sale1902 »

Hey Crythias, thanks alot for this, however, this is only a partly solution for me.

What this does for me is it prints (opens new page) the ticket while it's still not closed, so last part of it is not in the report.
What i need is : if checkbox state = checked (this doesn't necessarilly have to be a checkbox, any type of dynamic field works for me)
after ticket close -> do AgentTicketPrint;TicketID.

If you have some other idea i would be greatful, meanwhille i'll keep trying by myself :)
OTRS v3.2.7. on Ubuntu server 11.10.
MySQL database
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: On TicketClose do AgentTicketPrint

Post by crythias »

sale1902 wrote:What this does for me is it prints (opens new page) the ticket while it's still not closed, so last part of it is not in the report.
so don't put the notes in the close form. I don't. I just put a period (.) as I close. If there's a note I need to do, I'll just add it.

(But this is too many steps)
So don't enable the note in the close ticket stage (via sysconfig). The note won't be required and will just close the ticket.

(but I need to create a "final resolution" note.)
That's easy. create a note-type (note-final) as available to choose. You just add it as available note types in sysconfig.

Steps:
Add final note (or a reply if you want to communicate with the user).
print ticket
close ticket.

Optional: add "next state" to note or reply via sysconfig which means you can set it as closed when you submit.

(But this kicks me out of the ticket)
so press back and click print

(Still too many clicks!)
OK, what can I say? start programming.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Locked