I am using Case Logic hook to create a meeting when the user clicks on a custom checkbox. The meeting event is created but never shows up on the calendar. After some searching around I noticed that there is not a record for the meeting in the meetings_users table. Manually adding a record in this table results in the meeting showing up on the calendar.
Taken from the populateSeedData.php, here is what I am using to create the meeting.
$meeting = BeanFactory::newBean('Meetings');
$meeting->name = $bean->name;
$meeting->date_start = create_date() . ' ' . create_time();
$meeting->duration_hours = 1;
$meeting->duration_minutes = 0;
$meeting->assigned_user_id = $bean->assigned_user_id;
$meeting->assigned_user_name = $bean->assigned_user_name;
$meeting->description = $bean->name;
$meeting->status = "Planned";
$meeting->contact_id = $bean->contact_id;
$meeting->parent_id = $bean->id;
$meeting->parent_type = 'Cases';
// dont update vcal
$meeting->update_vcal = false;
$meeting->save();
$meeting->set_accept_status($meeting->assigned_user_id, 'accept');
$bean->meetingid_c = $meeting->id;
I even replaced the code
$meeting->set_accept_status($meeting->assigned_user_id, 'accept');
with:
$focus = BeanFactory::newBean('Meetings');
$focus->id = $meeting->id;
$test = $focus->set_accept_status($meeting->assigned_user_id, 'accept');
I wanted to see what I might be doing wrong or if there were any other options before I add a statement to just add the record manually.
While I am at it can someone tell me what vcal is?
Tony