function insertEvent(&$vevent) { $data = $this->parseEventData($vevent); if (!is_null($data)){ if(!$this->haveAccess($data['event']['owner'])) { $data['event']['owner'] = $GLOBALS['obm']['uid']; } $id = run_query_calendar_add_event($data['event'], $data['entities']); $this->updateStates($data['states'], $id); $this->updateAlerts($vevent->get('x-obm-alert'), $id); } else { $this->event_error ++; } return $id; }
} else { // Insert "others attendees" as private contacts if ($params['others_attendees'] != "") { $others_attendees = run_query_insert_others_attendees($params); $entities['contact'] = array_merge($entities['contact'], $others_attendees); } // Insert "other files" as private documents if (count($params['other_files']) > 0) { $other_files = run_query_insert_other_files($params); if (!$other_files) { $display['msg'] .= display_warn_msg("$l_event : $l_warn_file_upload"); } else { $entities['document'] = array_merge($entities['document'], $other_files); } } $event_id = run_query_calendar_add_event($params, $entities); $params["calendar_id"] = $event_id; if ($params['date_begin']->compare(Of_Date::today()) <= 0) { $display['msg'] .= display_warn_msg("$l_event : $l_warn_date_past"); } if ($params['show_user_calendar']) $current_view->set_users($params['sel_user_id']); if ($params['show_resource_calendar']) $current_view->set_resources($params['sel_resource_id']); $current_view->set_date($params["date_begin"]); $detailurl = basename($_SERVER['SCRIPT_NAME'])."?action=detailconsult&calendar_id=$event_id"; $detail = "<a class='B' href='$detailurl'>".phpStringToJsString($GLOBALS[l_details])."</a>"; if($GLOBALS['display']['warm_add_organizer'] == true){ redirect_warn($params, "$l_event: $l_insert_ok - $l_event_add_organizer - $detail"); } else { redirect_ok($params, "$l_event: $l_insert_ok - $detail");