Exemplo n.º 1
0
///////////////////////////////////////////////////////////////////////////////
  $retour = of_category_query_delete('event', 'category1', $params);
  if ($retour) {
    $display['msg'] .= display_ok_msg("$l_category1 : $l_delete_ok");
  } else {
    $display['msg'] .= display_err_msg("$l_category1 : $l_delete_error");
  }
  $tags_q = run_query_calendar_get_alltags($obm['uid']) ;
  $display['detail'] .= dis_calendar_admin_index($tags_q);
  
} elseif ($action == 'reset')  {
///////////////////////////////////////////////////////////////////////////////
  if(!$params['force']) {
    $display['detail'] .= dis_calendar_reset($params);
  } else {
    run_query_calendar_reset($obm['uid'],$params);
    $display['detail'] .= dis_calendar_calendar_view($params, $current_view);
  }

} elseif ($action == 'export')  {
///////////////////////////////////////////////////////////////////////////////
  $display['detail'] .= dis_icalendar_export($params);

} elseif ($action == 'import')  {
///////////////////////////////////////////////////////////////////////////////
  $display['detail'] .= dis_icalendar_import($params);

} elseif ($action == 'ics_insert')  {
///////////////////////////////////////////////////////////////////////////////
  if (!empty($params["ics_tmp"])) {
    if(   !array_key_exists("fi_ics", $_FILES)
Exemplo n.º 2
0
 /**
  * Perform the import of the vcalendar
  */
 private function user_vcalendar_import($fd, $user_id)
 {
     include_once 'php/calendar/calendar_query.inc';
     include_once 'php/calendar/event_observer.php';
     include_once 'obminclude/lib/Solr/Document.php';
     include_once 'obminclude/of/of_indexingService.inc';
     include_once 'obminclude/of/vcalendar/Utils.php';
     include_once 'obminclude/of/vcalendar/writer/OBM.php';
     include_once 'obminclude/of/vcalendar/reader/ICS.php';
     $remember_uid = $GLOBALS['obm']['uid'];
     $GLOBALS['obm']['uid'] = $user_id;
     // some kind of sudo $user_id
     //reset calendar
     run_query_calendar_reset($user_id, array('delete_meeting' => true));
     //restore calendar
     $reader = new Vcalendar_Reader_ICS($fd);
     $document = $reader->getDocument();
     $writer = new Vcalendar_Writer_OBM(true);
     $writer->writeDocument($document);
     $document->destroy();
     $GLOBALS['obm']['uid'] = $remember_uid;
 }