Sunday, 05 November 2017
  2 Replies
  3.5K Visits
0
Votes
Undo
Hello,

I try to create a JEvents from an other component ?

For the others event component, I use this type of code :

\JModelLegacy::addIncludePath(JPATH_SITE . '/administrator/components/com_yyy/models', 'XXXModel');
\JLoader::import('components.com_yyy.helpers.yyy', JPATH_ADMINISTRATOR);
\JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_yyy/tables');

$ev_model = \JModelLegacy::getInstance('Event', 'XXXX');
$ev_model->save($e);


In Jevents, i didn't find the same structure.

COuld you help me ?
Tuesday, 07 November 2017 10:04
·
#195108
0
Votes
Undo
You need to defined a LOT of data to create an event - dates, times, descriptions, title, category, calendar, repeat pattern, location, contact etc. so a simple one line function isn't possible.

I would suggest you take a look at the save method of the icalevent.php controller in the backend for ideas on how you could code this up
Tuesday, 07 November 2017 10:30
·
#195112
0
Votes
Undo
Thanks.

So you use in admin $vevent = iCalEvent::iCalEventFromData($data); to store an event through iCalEvent in site.

I understand that is not possible in one line but all the data aren't mandatory ;-)


Many thanks, I'm going to wrok on it :)
  • Page :
  • 1
There are no replies made for this post yet.