"New Ticket"-Button in Callerlog

Hello,

on the cti telephone panel on the left side, there is a “+” with a link to create a new ticket with the user, which is actually ringing. The button is a bit useless for me, because it vanishes, if the call is answered.

So i tried to put the button to the users on the caller log. I have added the buttons

-section to caller_log.jst.eco in the cti-section. The button shows up right at the customer name on the callerlog (if the customer is known, else no button will show up) and is clickable. However, the click event seems to have no event listener like the button on the left side. How can i add the event listener or where i have to do this? (It seems, that i must do that anywhere else then in caller_log.jst.eco)

Next question - if this is working, how can i publish this, so it finds it’s way to the source code, if it is usefull?

1 Like

Forgot my picture…

Ok, i have done it by adding a href to #/ticket/create/customer/$id

How is the process to add it to the zammad source?

Hey @richie_77 and thanks for this idea :smiley:

I guess this might be a good starting point :sunglasses:

1 Like

I will have a look at it. :slight_smile:

It is a bit unclear, how much feedback i have to earn…

" * Do not open an issue on GitHub until you have collected positive feedback about the change. GitHub issues are primarily intended for bug reports and fixes."

A feature request thread on this board might be an option to collect this kind of feedback.
I personally would feel that a new ticket button on every entry would reduce the overview of the affected view a lot. But that’s just my view on this and might be irrelevant.

In the end Product Owner of Zammad will decide if this is going to be a core feature or not.

So i have done the feature request.

If you plan to develop it for your self then I can try to give you some advice. The current frontend is basically also MVC. You have a template, controller and model.

To get knowledge about code it makes sense to search a lot. Often for JavaScript there are some CSS classes used like js-phoneMenuItem or js-newTicket. If you search for this you will find the code in the controller of the CTI. E.g.

https://github.com/zammad/zammad/blob/a91131f84c142e7c8f02d6f1bfb76aa0c94acf29/app/assets/javascripts/app/controllers/cti.coffee#L49-L55

So there is some kind of global event which is executed while rendering the sidebar and it will assign some click events for the ticket creation.

If you add code to the caller_log.jst.eco it might make sense to search for the spot where the template for the main content is rendered. Usually it’s something like App.view('cti/caller_log'). Here it is also in the same file a bit below:

https://github.com/zammad/zammad/blob/a91131f84c142e7c8f02d6f1bfb76aa0c94acf29/app/assets/javascripts/app/controllers/cti.coffee#L178

You would need to code some events after rendering in there to support the click event there as well.

If you want to keep your changes maintainable in your system as a package, I recommend you to read my tutorials.