function export_google_calendar()
 {
     $users = ExternalCalendarUsers::findAll(array('conditions' => "sync = 1"));
     foreach ($users as $user) {
         // log user in
         $contact = Contacts::findById($user->getContactId());
         CompanyWebsite::instance()->logUserIn($contact);
         ExternalCalendarController::export_google_calendar_for_user($user);
         CompanyWebsite::instance()->logUserOut();
     }
 }
 function repetitive_event_related_edit($event, $data)
 {
     // run the query to set the event data
     $event->setFromAttributes($data);
     $this->registerInvitations($data, $event, false);
     if (isset($data['confirmAttendance'])) {
         $this->change_invitation_state($data['confirmAttendance'], $event->getId(), $user_filter);
     }
     try {
         DB::beginWork();
         $event->save();
         $object_controller = new ObjectController();
         $object_controller->add_to_members($event, array_var($task_data, 'members'));
         $object_controller->add_subscribers($event);
         $object_controller->link_to_new_object($event);
         $object_controller->add_custom_properties($event);
         $object_controller->add_reminders($event);
         $event->resetIsRead();
         DB::commit();
         if ($event->getSpecialID() != "") {
             $externalCalendarController = new ExternalCalendarController();
             $externalCalendarController->sync_event_on_extern_calendar($event);
         }
         ApplicationLogs::createLog($event, ApplicationLogs::ACTION_EDIT);
     } catch (Exception $e) {
         DB::rollback();
     }
     //try
 }
Beispiel #3
0
function export_google_calendar()
{
    _log("export with google calendar...");
    $externalCalendarController = new ExternalCalendarController();
    $externalCalendarController->export_google_calendar();
    _log("end export with google calendar...");
}