is there any event system after ticket submit?

  • saman2
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 4 months ago #140476 by saman2
hi 
if i want create plugin for notify to custom service or for example send SMS to user, what event or trigger can be use? for example is there any onAfterTicketSubmit?
thank you

ارتباط با من : samansamani2@yahoo.com

Please Log in or Create an account to join the conversation.

More
3 years 4 months ago #140483 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic is there any event system after ticket submit?
Hello

It was not supported but I just added code to support it. You can download latest package of the extension, upgrade it to your site.

Then you can write a plugin (group helpdeskpro - see plugins/helpdeskpro for some examples) which listen for some event triggers below:
Code:
/* This event is triggered after ticket stored */ public function onAfterStoreTicket($row) { // $row is a ticket object } /* This event is triggered when a comment is added to a ticket */ public function onAfterStoreComment($row, $ticket) { // $row is a comment object // $ticket is a ticket object }

Let me know if you need more assist

Tuan

Please Log in or Create an account to join the conversation.

  • saman2
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 9 months ago #145618 by saman2
i create this plugin but it is not work. do not any action after submit ticket in backend or frontend...
i use this code:
Code:
// No direct access to this file defined('_JEXEC') or die('Restricted access'); /***[JCBGUI.class_extends.head.1.$$$$]***/ use Joomla\CMS\Application\CMSApplication; use Joomla\CMS\Plugin\CMSPlugin; /***[/JCBGUI$$$$]***/ /***[JCBGUI.class_extends.comment.1.$$$$]***/ /**  * Helpdeskpro - Helpdesk_bale_sms plugin.  *  * @package   Helpdesk_bale_sms  * @since     1.0.0  *//***[/JCBGUI$$$$]***/ class PlgHelpdeskproHelpdesk_bale_sms extends CMSPlugin { /***[JCBGUI.joomla_plugin.main_class_code.1.$$$$]***/ /* This event is triggered after ticket stored */ public function onAfterStoreTicket($row) { echo '<pre>'; var_dump($row); echo '</pre>'; exit(); } /* This event is triggered when a comment is added to a ticket */ public function onAfterStoreComment($row, $ticket) {     echo '<pre>';     var_dump($row);     echo '</pre>';     exit(); }/***[/JCBGUI$$$$]***/     public function onViewTicket($row)     { //        echo '<pre>'; //        var_dump($row); //        echo '</pre>'; //        exit();     } }
can you put a example developer plugin such as some other joomla extension?
thank you...

ارتباط با من : samansamani2@yahoo.com

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago #145638 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic is there any event system after ticket submit?
Guess something wrong with your plugin. You can try to test it using one of Helpdesk Pro core plugins:

1. Enable Helpdesk Pro - Ticket Attachments plugin

2. Add the code below to plugins/helpdeskpro/attachments/attachments.php
Code:
public function onAfterStoreTicket($row) { die('onAfterStoreTicket triggered'); }

Then try to submit a ticket. The code will be executed, you will see the text onAfterStoreTicket triggered

In the xml file which defines the plugin, make sure you set group attribute to helpdeskpro

You can create a new plugin base on one of existing plugin

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc