By elecoest on Sunday, 05 November 2017
Replies 2
Likes 0
Views 2.8K
Votes 0
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 ?
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
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
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
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post