コード例 #1
0
ファイル: EventGoogleInfo.php プロジェクト: mslokhat/corebos
* The Initial Developer of the Original Code is IT-Solutions4You s.r.o.
* Portions created by IT-Solutions4You s.r.o. are Copyright(C) IT-Solutions4You s.r.o.
* All Rights Reserved.
********************************************************************************/
include_once "modules/Calendar4You/GoogleSync4You.php";
require_once "modules/Calendar4You/Calendar4You.php";
require_once "modules/Calendar4You/CalendarUtils.php";
global $app_strings, $current_user, $current_language, $app_strings;
$eventid = $_REQUEST["eventid"];
$userid = $_REQUEST["userid"];
$geventid = $_REQUEST["geventid"];
$typeid = $_REQUEST["typeid"];
error_reporting(0);
$GoogleSync4You = new GoogleSync4You();
$GoogleSync4You->setAccessDataForUser($userid);
$GoogleSync4You->connectToGoogle();
if ($GoogleSync4You->isLogged()) {
    $add_into_vtiger = true;
    $c_time_zone = new DateTimeZone($current_user->time_zone);
    if ($current_user->hour_format == '') {
        $format = 'am/pm';
    } else {
        $format = $current_user->hour_format;
    }
    $c_mod_strings = return_specified_module_language($current_language, "Calendar");
    $event = $GoogleSync4You->getGoogleCalEvent($geventid);
    $recurrence = $event->recurrence;
    if ($recurrence != "") {
        $add_into_vtiger = false;
        $Lines = explode("<br />", nl2br($recurrence));
        foreach ($Lines as $line) {
コード例 #2
0
 function getGoogleSyncClass($save_user_id, $event, $selected_calendar = '')
 {
     global $adb;
     $GoogleSync4You = new GoogleSync4You();
     $have_access_data = $GoogleSync4You->setAccessDataForUser($save_user_id, true);
     if ($have_access_data) {
         $GoogleSync4You->connectToGoogle();
         if ($GoogleSync4You->is_logged) {
             $GoogleSync4You->setEvent($event);
             if ($selected_calendar == '') {
                 $selected_calendar = $GoogleSync4You->getSCalendar(1);
             }
             $is_disabled = $GoogleSync4You->isDisabled(1);
             //export
             if (!$is_disabled && $selected_calendar != '') {
                 return $GoogleSync4You;
             }
         }
     }
     return false;
 }