By ntm91307 on Wednesday, 10 April 2019
Replies 1
Likes 0
Views 894
Votes 0
I am creating a simple Reservation Booking site using JEvents. I want the user to select dates from the calendar and when the event is saved I'd like to trigger a PHP script that makes API calls to a pricing site and return the results for user approval.

I've got the API and am working on the module to support it. What I need to know is does JEvents have a way to make the call to my code when an event is created?

Thank you....
Hello,

Is this post creation or pre-creation? In essenance yes, you can create a Plugin and hook it in. See:

For pre-creation


$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin("jevents");
$res = $dispatcher->trigger( 'onBeforeSaveEvent' , array(&$array, &$rrule, $dryrun));


For post-creation:


$dispatcher = JEventDispatcher::getInstance();
JPluginHelper::importPlugin("jevents");
$res = $dispatcher->trigger( 'onAfterSaveEvent' , array(&$vevent, false));



Many thanks
Tony
·
Thursday, 11 April 2019 09:04
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post