当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Gdata_Calendar::newWhen方法代码示例

本文整理汇总了PHP中Zend_Gdata_Calendar::newWhen方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Gdata_Calendar::newWhen方法的具体用法?PHP Zend_Gdata_Calendar::newWhen怎么用?PHP Zend_Gdata_Calendar::newWhen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Gdata_Calendar的用法示例。


在下文中一共展示了Zend_Gdata_Calendar::newWhen方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: g_cal_createEvent

function g_cal_createEvent($client, $title = 'Untitled', $desc = '', $where = '', $startDate = '2008-01-01', $startTime = '0', $endDate = '2008-01-01', $endTime = '0', $tzOffset = '-08')
{
    $gdataCal = new Zend_Gdata_Calendar($client);
    $newEvent = $gdataCal->newEventEntry();
    $newEvent->title = $gdataCal->newTitle($title);
    $newEvent->where = array($gdataCal->newWhere($where));
    $newEvent->content = $gdataCal->newContent("{$desc}");
    if ($startTime == '0' || $startTime == '') {
        //Make this an All-Day Event
        $when = $gdataCal->newWhen();
        $when->startTime = "{$startDate}";
        $when->endTime = "{$endDate}";
    } else {
        $when = $gdataCal->newWhen();
        $when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
        $when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
    }
    $newEvent->when = array($when);
    // Upload the event to the calendar server
    // A copy of the event as it is recorded on the server is returned
    $createdEvent = $gdataCal->insertEvent($newEvent);
    /*
      //Store the new eventID in the cohelitack database
    	//g_cal_updateEvent($client, $createdEvent->id, "New Title");
    	echo "\$event->getLink('edit')->href: " . $createdEvent->getLink('edit')->href . "<br>\n";
    	echo "\$event->getId(): " . $createdEvent->getId() . "<br>\n";
    	
    	$myEvent = getEvent($client,$createdEvent->getId());
    	echo "\$myEvent->getId(): " . $myEvent->getId() . "<br>\n";
    	
    	//g_cal_deleteEventByUrl($client,$createdEvent->getLink('edit')->href);
    	//g_cal_deleteEventById($client,$createdEvent->getId());
    */
    return $createdEvent->getLink('edit')->href;
}
开发者ID:evanhsu,项目名称:siskiyourappellers,代码行数:35,代码来源:g_calendar_functions.php

示例2: addEvent

 function addEvent($title = 'Новый заказ', $desc = 'Описание заказа', $where = 'интернет-магазин', $startDate, $endDate, $sms_reminder)
 {
     try {
         set_include_path('.' . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] . '/modules/gcalendar/' . PATH_SEPARATOR . get_include_path());
         include_once 'Zend/Loader.php';
         Zend_Loader::loadClass('Zend_Gdata');
         Zend_Loader::loadClass('Zend_Gdata_AuthSub');
         Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
         Zend_Loader::loadClass('Zend_Gdata_HttpClient');
         Zend_Loader::loadClass('Zend_Gdata_Calendar');
         $client = Zend_Gdata_ClientLogin::getHttpClient($this->_user, $this->_pass, "cl");
         $gdataCal = new Zend_Gdata_Calendar($client);
         $newEvent = $gdataCal->newEventEntry();
         $newEvent->title = $gdataCal->newTitle($title);
         $newEvent->where = array($gdataCal->newWhere($where));
         $newEvent->content = $gdataCal->newContent($desc);
         $when = $gdataCal->newWhen();
         $when->startTime = $startDate;
         $when->endTime = $endDate;
         if (intval($sms_reminder)) {
             $reminder = $gdataCal->newReminder();
             $reminder->method = "sms";
             $reminder->minutes = "0";
             $when->reminders = array($reminder);
         }
         $newEvent->when = array($when);
         $createdEvent = $gdataCal->insertEvent($newEvent);
         return $createdEvent->id->text;
     } catch (Exception $ex) {
         // Report the exception to the user
     }
 }
开发者ID:sonicse,项目名称:gcalendar_prestashop,代码行数:32,代码来源:GCalendarEvent.php

示例3: setPlanning

 public function setPlanning($startDate, $endDate, $title, $content)
 {
     // Parameters for ClientAuth authentication
     ProjectConfiguration::registerZend();
     Zend_Loader::loadClass('Zend_Gdata');
     Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
     Zend_Loader::loadClass('Zend_Gdata_Calendar');
     $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
     $user = sfConfig::get('app_gmail_user');
     $pass = sfConfig::get('app_gmail_pwd');
     // Create an authenticated HTTP client
     $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
     // Create an instance of the Calendar service
     $service = new Zend_Gdata_Calendar($client);
     // Create a new entry using the calendar service's magic factory method
     $event = $service->newEventEntry();
     // Populate the event with the desired information
     // Note that each attribute is crated as an instance of a matching class
     $event->title = $service->newTitle($title);
     $event->where = array($service->newWhere("Paris, France"));
     $event->content = $service->newContent($content);
     // Set the date using RFC 3339 format.
     $tzOffset = "+02";
     $when = $service->newWhen();
     //$when->startTime = "{$start_date}.000{$tzOffset}:00";
     //$when->endTime = "{$end_date}.000{$tzOffset}:00";
     $when->startTime = "{$startDate}:00.000{$tzOffset}:00";
     $when->endTime = "{$endDate}:00.000{$tzOffset}:00";
     $event->when = array($when);
     // Upload the event to the calendar server
     // A copy of the event as it is recorded on the server is returned
     $newEvent = $service->insertEvent($event);
 }
开发者ID:sfinx13,项目名称:appsmartproject,代码行数:33,代码来源:MobilyrentLocationTable.class.php

示例4: createEvent

 /**
  * Creates an event on the authenticated user's default calendar with the
  * specified event details.
  *
  * @param  Zend_Http_Client $client    The authenticated client object
  * @param  string           $title     The event title
  * @param  string           $desc      The detailed description of the event
  * @param  string           $where
  * @param  string           $startDate The start date of the event in YYYY-MM-DD format
  * @param  string           $startTime The start time of the event in HH:MM 24hr format
  * @param  string           $endDate   The end date of the event in YYYY-MM-DD format
  * @param  string           $endTime   The end time of the event in HH:MM 24hr format
  * @param  string           $tzOffset  The offset from GMT/UTC in [+-]DD format (eg -08)
  * @return string The ID URL for the event.
  */
 function createEvent($client, $title = 'Tennis with Beth', $desc = 'Meet for a quick lesson', $where = 'On the courts', $startDate = '2008-01-20', $startTime = '10:00', $endDate = '2008-01-20', $endTime = '11:00', $tzOffset = '-08')
 {
     $gc = new Zend_Gdata_Calendar($client);
     $newEntry = $gc->newEventEntry();
     $newEntry->title = $gc->newTitle(trim($title));
     $newEntry->where = array($gc->newWhere($where));
     $newEntry->content = $gc->newContent($desc);
     $newEntry->content->type = 'text';
     $when = $gc->newWhen();
     $when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
     $when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
     $newEntry->when = array($when);
     $createdEntry = $gc->insertEvent($newEntry);
     return $createdEntry->id->text;
 }
开发者ID:RamonCidL,项目名称:Carrilanas,代码行数:30,代码来源:CarreraConInscripciones.php

示例5: createEvent

function createEvent($client, $title = 'Tennis with Beth', $desc = 'Meet for a quick lesson', $startDate = '2012-01-20', $endDate = '2012-01-20')
{
    $gdataCal = new Zend_Gdata_Calendar($client);
    $newEvent = $gdataCal->newEventEntry();
    $newEvent->title = $gdataCal->newTitle($title);
    //$newEvent->where = array($gdataCal->newWhere($where));
    $newEvent->content = $gdataCal->newContent("{$desc}");
    $when = $gdataCal->newWhen();
    $when->startTime = "{$startDate}";
    $when->endTime = "{$endDate}";
    $newEvent->when = array($when);
    // Upload the event to the calendar server
    // A copy of the event as it is recorded on the server is returned
    $createdEvent = $gdataCal->insertEvent($newEvent);
    return $createdEvent->id->text;
}
开发者ID:rasomu,项目名称:chuza,代码行数:16,代码来源:publish_calendar.php

示例6: explode

 function created_event_google_calendar($object, $event)
 {
     require_once 'Zend/Loader.php';
     Zend_Loader::loadClass('Zend_Gdata');
     Zend_Loader::loadClass('Zend_Gdata_AuthSub');
     Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
     Zend_Loader::loadClass('Zend_Gdata_Calendar');
     $users = ExternalCalendarUsers::findByContactId();
     $calendar = ExternalCalendars::findById($event->getExtCalId());
     $user = $users->getAuthUser();
     $pass = $users->getAuthPass();
     $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
     $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
     $calendarUrl = 'http://www.google.com/calendar/feeds/' . $calendar->getCalendarUser() . '/private/full';
     $gdataCal = new Zend_Gdata_Calendar($client);
     $newEvent = $gdataCal->newEventEntry();
     $newEvent->title = $gdataCal->newTitle($event->getObjectName());
     $newEvent->content = $gdataCal->newContent($event->getDescription());
     $star_time = explode(" ", $event->getStart()->format("Y-m-d H:i:s"));
     $end_time = explode(" ", $event->getDuration()->format("Y-m-d H:i:s"));
     if ($event->getTypeId() == 2) {
         $when = $gdataCal->newWhen();
         $when->startTime = $star_time[0];
         $when->endTime = $end_time[0];
         $newEvent->when = array($when);
     } else {
         $when = $gdataCal->newWhen();
         $when->startTime = $star_time[0] . "T" . $star_time[1] . ".000-00:00";
         $when->endTime = $end_time[0] . "T" . $end_time[1] . ".000-00:00";
         $newEvent->when = array($when);
     }
     // insert event
     $createdEvent = $gdataCal->insertEvent($newEvent, $calendarUrl);
     $event_id = explode("/", $createdEvent->id->text);
     $special_id = end($event_id);
     $event->setSpecialID($special_id);
     $event->setExtCalId($calendar->getId());
     $event->save();
 }
开发者ID:rorteg,项目名称:fengoffice,代码行数:39,代码来源:ObjectController.class.php

示例7: createEvent

 /**
 * Create an event
 * @param String $client Access token
 * @param Associative Array $eventArray
 *                          'desc'      =>  'This is a description for the event',
 								'where'     =>  'Location',
 								'startDate' =>  'YYYY-MM-DD',
 								'startTime' =>  'HH:MM', // 24hr time
 								'endDate'   =>  'YYYY-MM-DD',
 								'endTime'   =>  'HH:MM', // 24hr time
 								'tzOffset'  =>  '00' // timezone offset from GMT
 * @return String - ID of created event
 */
 function createEvent($client, $eventArray)
 {
     $gdataCal = new Zend_Gdata_Calendar($client);
     $newEvent = $gdataCal->newEventEntry();
     $newEvent->title = $gdataCal->newTitle($eventArray['title']);
     $newEvent->where = array($gdataCal->newWhere($eventArray['where']));
     $newEvent->content = $gdataCal->newContent($eventArray['desc']);
     $when = $gdataCal->newWhen();
     $when->startTime = "{$eventArray['startDate']}T{$eventArray['startTime']}:00.000{$eventArray['tzOffset']}:00";
     $when->endTime = "{$eventArray['endDate']}T{$eventArray['endTime']}:00.000{$eventArray['tzOffset']}:00";
     $newEvent->when = array($when);
     //upload the even to the calendar server
     //a copy of the event as it is recorded on the server is returned
     $createdEvent = $gdataCal->insertEvent($newEvent);
     return $createdEvent->id->text;
 }
开发者ID:abdullahbutt,项目名称:Codeigniter-Gcal,代码行数:29,代码来源:Gcal.php

示例8: GoogleCalendar

require_once 'includes/classes/googlecalendar.class.php';
define('AT_INCLUDE_PATH', '../../../include/');
require AT_INCLUDE_PATH . 'vitals.inc.php';
$gcalobj = new GoogleCalendar();
$client = $gcalobj->getAuthSubHttpClient();
$gdata_cal = new Zend_Gdata_Calendar($client);
$event_url = $_GET['id'];
$command = $_GET['cmd'];
try {
    //Get the event object from its id.
    $event = $gdata_cal->getCalendarEventEntry($event_url);
    if (strcmp($command, 'delete') == 0) {
        //If event is deleted then call delete method.
        $event->delete();
    } else {
        if (strcmp($command, 'update') == 0) {
            //Update event attributes and then save it in Google Calendar.
            $event->title = $gdata_cal->newTitle($_GET['title']);
            $when = $gdata_cal->newWhen();
            $when->startTime = $_GET['start'];
            $when->endTime = $_GET['end'];
            $event->when = array($when);
            $event->save();
        }
    }
    exit;
} catch (Zend_Gdata_App_Exception $e) {
    //If some error occurs then stop execution and print error.
    echo _AT('calendar_error') . $e->getMessage();
    exit;
}
开发者ID:genaromendezl,项目名称:ATutor,代码行数:31,代码来源:google_calendar_update.php

示例9: foreach

        function export_google_calendar() {
		ajx_current("empty");
                
                require_once 'Zend/Loader.php';

                Zend_Loader::loadClass('Zend_Gdata');
                Zend_Loader::loadClass('Zend_Gdata_AuthSub');
                Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
                Zend_Loader::loadClass('Zend_Gdata_Calendar');
                
                $users = ExternalCalendarUsers::findByContactId();
                if($users){
                    if($users->getSync() == 1){
                        $sql = "SELECT ec.* FROM `".TABLE_PREFIX."external_calendars` ec,`".TABLE_PREFIX."external_calendar_users` ecu 
                                WHERE ec.calendar_feng = 1 AND ecu.contact_id = ".logged_user()->getId();
                        $calendar_feng = DB::executeOne($sql);
                        $events = ProjectEvents::findNoSync();

                        $user = $users->getAuthUser();
                        $pass = $users->getAuthPass();
                        $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;

                        try
                        {
                                $client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);  
                                $gdataCal = new Zend_Gdata_Calendar($client);

                                if ($calendar_feng){
                                    foreach ($events as $event){
                                        $calendarUrl = 'http://www.google.com/calendar/feeds/'.$calendar_feng['calendar_user'].'/private/full';

                                        $newEvent = $gdataCal->newEventEntry();
                                        $newEvent->title = $gdataCal->newTitle($event->getObjectName());
                                        $newEvent->content = $gdataCal->newContent($event->getDescription());

                                        $star_time = explode(" ",$event->getStart()->format("Y-m-d H:i:s"));
                                        $end_time = explode(" ",$event->getDuration()->format("Y-m-d H:i:s"));

                                        if($event->getTypeId() == 2){
                                            $when = $gdataCal->newWhen();
                                            $when->startTime = $star_time[0];
                                            $when->endTime = $end_time[0];
                                            $newEvent->when = array($when);
                                        }else{                                    
                                            $when = $gdataCal->newWhen();
                                            $when->startTime = $star_time[0]."T".$star_time[1].".000-00:00";
                                            $when->endTime = $end_time[0]."T".$end_time[1].".000-00:00";
                                            $newEvent->when = array($when);
                                        }

                                        // insert event
                                        $createdEvent = $gdataCal->insertEvent($newEvent, $calendarUrl);

                                        $event_id = explode("/",$createdEvent->id->text);
                                        $special_id = end($event_id); 
                                        $event->setSpecialID($special_id);
                                        $event->setUpdateSync(ProjectEvents::date_google_to_sql($createdEvent->updated));
                                        $event->setExtCalId($calendar_feng['id']);
                                        $event->save();
                                    }                             
                                }else{
                                    $appCalUrl = '';
                                    $calFeed = $gdataCal->getCalendarListFeed();        
                                    foreach ($calFeed as $calF){
                                        $instalation = explode("/", ROOT_URL);
                                        $instalation_name = end($instalation);
                                        if($calF->title->text == lang('feng calendar',$instalation_name)){
                                            $appCalUrl = $calF->content->src;
                                            $t_calendario = $calF->title->text;
                                        }
                                    }    

                                    if($appCalUrl != ""){
                                        $title_cal = $t_calendario;
                                    }else{
                                        $instalation = explode("/", ROOT_URL);
                                        $instalation_name = end($instalation);
                                        $appCal = $gdataCal -> newListEntry();
                                        $appCal -> title = $gdataCal-> newTitle(lang('feng calendar',$instalation_name));                         
                                        $own_cal = "http://www.google.com/calendar/feeds/default/owncalendars/full";                        
                                        $new_cal = $gdataCal->insertEvent($appCal, $own_cal);

                                        $title_cal = $new_cal->title->text;
                                        $appCalUrl = $new_cal->content->src;                                
                                    }               

                                    $cal_src = explode("/",$appCalUrl);
                                    array_pop($cal_src);
                                    $calendar_visibility = end($cal_src);
                                    array_pop($cal_src);
                                    $calendar_user = end($cal_src);                            

                                    $calendar = new ExternalCalendar();
                                    $calendar->setCalendarUser($calendar_user);
                                    $calendar->setCalendarVisibility($calendar_visibility);
                                    $calendar->setCalendarName($title_cal);
                                    $calendar->setExtCalUserId($users->getId());
                                    $calendar->setCalendarFeng(1);
                                    $calendar->save();

//.........这里部分代码省略.........
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:101,代码来源:EventController.class.php

示例10: process


//.........这里部分代码省略.........
             $gcal_event_ids[$short_id] = $eventFeed[$key];
         }
         /* Run through our table data, and build an array of our events indexed by the Google ID
          * (of course not all events may have a Google ID)
          */
         $our_event_ids = array();
         $our_upload_ids = array();
         foreach ($mydata as $gkey => $group) {
             if (is_array($group)) {
                 foreach ($group as $rkey => $row) {
                     if ($row->{$gcal_id_element}) {
                         $our_event_ids[$row->{$gcal_id_element}] = $mydata[$gkey][$rkey];
                     } else {
                         $our_upload_ids[] = $mydata[$gkey][$rkey];
                     }
                 }
             }
         }
         // Now go through the google events id's, and process the ones which aren't in our table.
         $our_event_adds = array();
         foreach ($gcal_event_ids as $id => $event) {
             if (!array_key_exists($id, $our_event_ids)) {
                 // we don't have the ID, so add the event to our table
                 $row = array();
                 $row[$gcal_start_date_element] = strftime('%Y-%m-%d %H:%M:%S', strtotime($event->when[0]->startTime));
                 $row[$gcal_end_date_element] = strftime('%Y-%m-%d %H:%M:%S', strtotime($event->when[0]->endTime));
                 $row[$gcal_label_element] = $event->title->text;
                 $row[$gcal_desc_element] = $event->content->text;
                 $row[$gcal_id_element] = $id;
                 if ($gcal_userid_element_long) {
                     $row[$gcal_userid_element] = $our_userid;
                 }
                 $listModel->storeRow($row, 0);
             }
         }
         // If upload syncing (from us to gcal) is enabled ...
         if ($gcal_sync_upload == 'both' || $gcal_sync_upload == 'to') {
             // Grab the tzOffset.  Note that gcal want +/-XX (like -06)
             // but J! gives us +/-X (like -6) so we sprintf it to the right format
             $config = JFactory::getConfig();
             $tzOffset = (int) $config->getValue('config.offset');
             $tzOffset = sprintf('%+03d', $tzOffset);
             // Loop thru the array we built earlier of events we have that aren't in gcal
             foreach ($our_upload_ids as $id => $event) {
                 // Skip if a userid element is specified, and doesn't match the owner of this gcal
                 if ($gcal_userid_element_long) {
                     if ($event->{$gcal_userid_element} != $our_userid) {
                         continue;
                     }
                 }
                 // Now start building the gcal event structure
                 $newEvent = $gdataCal->newEventEntry();
                 $newEvent->title = $gdataCal->newTitle($event->{$gcal_label_element});
                 if ($gcal_desc_element_long) {
                     $newEvent->content = $gdataCal->newContent($event->{$gcal_desc_element});
                 } else {
                     $newEvent->content = $gdataCal->newContent($event->{$gcal_label_element});
                 }
                 $when = $gdataCal->newWhen();
                 // Grab the start date, apply the tx offset, and format it for gcal
                 $start_date = JFactory::getDate($event->{$gcal_start_date_element});
                 $start_date->setOffset($tzOffset);
                 $start_fdate = $start_date->toFormat('%Y-%m-%d %H:%M:%S');
                 $date_array = explode(' ', $start_fdate);
                 $when->startTime = "{$date_array[0]}T{$date_array[1]}.000{$tzOffset}:00";
                 /* We have to provide an end date for gcal, so if we don't have one,
                  * default it to start date + 1 hour
                  */
                 if ($event->{$gcal_end_date_element} == '0000-00-00 00:00:00') {
                     $startstamp = strtotime($event->{$gcal_start_date_element});
                     $endstamp = $startstamp + 60 * 60;
                     $event->{$gcal_end_date_element} = strftime('%Y-%m-%d %H:%M:%S', $endstamp);
                 }
                 // Grab the end date, apply the tx offset, and format it for gcal
                 $end_date = JFactory::getDate($event->{$gcal_end_date_element});
                 $end_date->setOffset($tzOffset);
                 $end_fdate = $end_date->toFormat('%Y-%m-%d %H:%M:%S');
                 $date_array = explode(' ', $end_fdate);
                 $when->endTime = "{$date_array[0]}T{$date_array[1]}.000{$tzOffset}:00";
                 $newEvent->when = array($when);
                 // Fire off the insertEvent to gcal, catch any errors
                 try {
                     $retEvent = $gdataCal->insertEvent($newEvent);
                 } catch (Zend_Gdata_App_HttpException $he) {
                     $errStr = 'Problem adding event: ' . $he->getRawResponseBody() . "\n";
                     continue;
                 }
                 /* So, insertEvent worked, grab the gcal ID from the returned event data,
                  * and update our event record with the short version of the ID
                  */
                 $gcal_id = $this->_getGcalShortId($retEvent->id->text);
                 $our_id = $event->id;
                 $query = $db->getQuery(true);
                 $query->update($table_name)->set($gcal_id_element . ' = ' . $db->quote($gcal_id))->where('id = ' . $db->quote($our_id));
                 $db->setQuery($query);
                 $db->query();
             }
         }
     }
 }
开发者ID:rogeriocc,项目名称:fabrik,代码行数:101,代码来源:gcalsync.php

示例11: die

                if ($mail->Send() == false) {
                    die($mail->ErrInfo);
                }
            }
        }
    }
    //$maxPrivacy = query("SELECT MAX(level) FROM privacy")[0]["MAX(level)"];
    $maxPrivacy = $_POST["privacy"];
    for ($privacy = $_POST["privacy"]; $privacy <= $maxPrivacy; $privacy++) {
        $gc = new Zend_Gdata_Calendar($_SESSION["client"]);
        $newEntry = $gc->newEventEntry();
        $newEntry->title = $gc->newTitle($_POST["name"]);
        $newEntry->where = array($gc->newWhere($_POST["location"]));
        $newEntry->content = $gc->newContent($_POST["info"]);
        $newEntry->content->type = 'text';
        $when = $gc->newWhen();
        $calStartDate = date('c', strtotime($startDatetime));
        $calEndDate = date('c', strtotime($endDatetime));
        $when->startTime = $calStartDate;
        $when->endTime = $calEndDate;
        $newEntry->when = array($when);
        $url = query("SELECT link FROM calendarLinks WHERE id = ?", $_POST["club"] . "." . $privacy);
        $url = $url[0]["link"];
        $createdEntry = $gc->insertEvent($newEntry, $url);
    }
    //redirect to home page
    redirect("/");
} else {
    // create list of clubs that the currently logged in user owns
    $privacy = query("SELECT * FROM privacy WHERE description = 'admin'");
    $privacy = $privacy[0]["level"];
开发者ID:ramyarangan,项目名称:CS50Organizations,代码行数:31,代码来源:makeEvent.php

示例12: createEvent

 /**
  * Creates an event on the authenticated users default calendar with the
  * specified event details.
  *
  * @return string The id URL for the event.
  */
 public function createEvent(TA_Model_Resource_Db_Table_Row_Abstract $values)
 {
     $values = $this->_modifyValues($values);
     $gc = new Zend_Gdata_Calendar($this->_client);
     $newEntry = $gc->newEventEntry();
     // set event properties
     $newEntry->title = $gc->newTitle(trim($values['title']));
     $newEntry->where = array($gc->newWhere($values['location']));
     $newEntry->content = $gc->newContent($values['description']);
     $newEntry->content->type = 'text';
     $when = $gc->newWhen();
     $start = date_create($values['start']);
     $end = date_create($values['end']);
     $when->startTime = date_format($start, 'Y-m-d\\TH:i:s.000P');
     $when->endTime = date_format($end, 'Y-m-d\\TH:i:s.000P');
     $newEntry->when = array($when);
     $createdEntry = $gc->insertEvent($newEntry);
     return $createdEntry->id->text;
 }
开发者ID:GEANT,项目名称:CORE,代码行数:25,代码来源:GoogleTest.php

示例13: updateEvent

 static function updateEvent(&$newEvent, $bean, $user)
 {
     $client = self::getClient($user);
     if ($client != false) {
         $gdataCal = new Zend_Gdata_Calendar($client);
         global $timedate;
         $date_time_start = $bean->date_start . ' ' . $bean->time_start;
         if (toTimestamp($date_time_start) < mktime(0, 0, 0, 1, 1, 2001)) {
             //$date_time_start = DateTime::get_time_start($timedate->to_db_date($bean->date_start,false),$bean->time_start.":00");
             //$date_time_start = $date_time_start->get_mysql_date().' '.$date_time_start->get_mysql_time();
             $date_time_start = date($timedate->get_db_date_time_format(), strtotime($bean->date_start));
         }
         //$date_time_start = $timedate->handle_offset($date_time_start, $timedate->get_db_date_time_format(), true);
         $time = toTimestamp($date_time_start);
         $duration = $bean->duration_hours * 60 * 60 + $bean->duration_minutes * 60;
         $when = $gdataCal->newWhen();
         $when->startTime = strftime("%Y-%m-%dT%H:%M:%S.000+00:00", $time);
         $when->endTime = strftime("%Y-%m-%dT%H:%M:%S.000+00:00", $time + $duration);
         // Tasks
         if (isset($bean->date_due) === true) {
             $date_time_end = $bean->date_due . ' ' . $bean->time_due;
             if (toTimestamp($date_time_start) < mktime(0, 0, 0, 1, 1, 2001)) {
                 $date_time_end = date($timedate->get_db_date_time_format(), strtotime($bean->date_due));
             }
             $time = toTimestamp($date_time_end);
             $when->endTime = strftime("%Y-%m-%dT%H:%M:%S.000+00:00", $time);
         }
         // Tasks
         if ($bean->reminder_time < 0) {
             $when->reminders = array();
         } else {
             $mins = (int) ($bean->reminder_time / 60);
             // reminder_time are seconds
             if ($mins < 5) {
                 $mins = 5;
             }
             $reminder = $gdataCal->newReminder();
             //$reminder->method = "sms";
             $reminder->minutes = $mins;
             $when->reminders = array($reminder);
         }
         $newEvent->when = array($when);
         /** Conditionals **/
         if ($bean->module_dir == "Meetings") {
             $newEvent->where = array($gdataCal->newWhere($bean->location));
             $newEvent->title = $gdataCal->newTitle("Встреча: " . $bean->name);
         } elseif ($bean->module_dir == "Calls") {
             $newEvent->title = $gdataCal->newTitle("Звонок: " . $bean->name);
         } elseif ($bean->module_dir == "Tasks") {
             $newEvent->title = $gdataCal->newTitle("Задача: " . $bean->name);
         }
         $newEvent->content = $gdataCal->newContent($bean->description);
     }
 }
开发者ID:omusico,项目名称:sugar_work,代码行数:54,代码来源:GoogleSync.php

示例14: transformToTargetRecord

 /**
  * Tarsform  Vtiger Records to Google Records
  * @param <array> $vtEvents 
  * @return <array> tranformed vtiger Records
  */
 public function transformToTargetRecord($vtEvents)
 {
     $records = array();
     foreach ($vtEvents as $vtEvent) {
         $gcalendar = new Zend_Gdata_Calendar($this->apiInstance);
         if ($vtEvent->getMode() == WSAPP_SyncRecordModel::WSAPP_UPDATE_MODE || $vtEvent->getMode() == WSAPP_SyncRecordModel::WSAPP_DELETE_MODE) {
             try {
                 $newEntry = $gcalendar->getCalendarEventEntry($vtEvent->get('_id'));
             } catch (Exception $e) {
                 continue;
             }
         } else {
             $newEntry = $gcalendar->newEventEntry();
         }
         $newEntry->title = $gcalendar->newTitle($vtEvent->get('subject'));
         $newEntry->where = array($gcalendar->newWhere($vtEvent->get('location')));
         $newEntry->content = $gcalendar->newContent($vtEvent->get('description'));
         $newEntry->content->type = 'text';
         $oldtz = date_default_timezone_get();
         date_default_timezone_set('GMT');
         $startDate = $vtEvent->get('date_start');
         $startTime = $vtEvent->get('time_start');
         $endDate = $vtEvent->get('due_date');
         $endTime = $vtEvent->get('time_end');
         if (empty($endTime)) {
             $endTime = "00:00";
         }
         $when = $gcalendar->newWhen();
         $when->startTime = date('c', strtotime("{$startDate} {$startTime}"));
         if (!empty($endDate)) {
             $when->endTime = date('c', strtotime("{$endDate} {$endTime}"));
         }
         date_default_timezone_set($oldtz);
         $newEntry->when = array($when);
         $recordModel = Google_Calendar_Model::getInstanceFromValues(array('entity' => $newEntry));
         $recordModel->setType($this->getSynchronizeController()->getSourceType())->setMode($vtEvent->getMode())->setSyncIdentificationKey($vtEvent->get('_syncidentificationkey'));
         $recordModel = $this->performBasicTransformations($vtEvent, $recordModel);
         $recordModel = $this->performBasicTransformationsToTargetRecords($recordModel, $vtEvent);
         $records[] = $recordModel;
     }
     return $records;
 }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:47,代码来源:Calendar.php

示例15: createWebContentEvent

/**
 * Creates a new web content event on the authenticated user's default 
 * calendar with the specified event details. For simplicity, the event 
 * is created as an all day event and does not include a description.
 *
 * @param Zend_Http_Client $client The authenticated client object
 * @param string $title The event title
 * @param string $startDate The start date of the event in YYYY-MM-DD format
 * @param string $endDate The end time of the event in HH:MM 24hr format
 * @param string $icon URL pointing to a 16x16 px icon representing the event.
 * @param string $url The URL containing the web content for the event.
 * @param string $height The desired height of the web content pane.
 * @param string $width The desired width of the web content pane.
 * @param string $type The MIME type of the web content.
 * @return string The ID URL for the event.
 */
function createWebContentEvent($client, $title = 'World Cup 2006', $startDate = '2006-06-09', $endDate = '2006-06-09', $icon = 'http://www.google.com/calendar/images/google-holiday.gif', $url = 'http://www.google.com/logos/worldcup06.gif', $height = '120', $width = '276', $type = 'image/gif')
{
    $gc = new Zend_Gdata_Calendar($client);
    $newEntry = $gc->newEventEntry();
    $newEntry->title = $gc->newTitle(trim($title));
    $when = $gc->newWhen();
    $when->startTime = $startDate;
    $when->endTime = $endDate;
    $newEntry->when = array($when);
    $wc = $gc->newWebContent();
    $wc->url = $url;
    $wc->height = $height;
    $wc->width = $width;
    $wcLink = $gc->newLink();
    $wcLink->rel = "http://schemas.google.com/gCal/2005/webContent";
    $wcLink->title = $title;
    $wcLink->type = $type;
    $wcLink->href = $icon;
    $wcLink->webContent = $wc;
    $newEntry->link = array($wcLink);
    $createdEntry = $gc->insertEvent($newEntry);
    return $createdEntry->id->text;
}
开发者ID:jorgenils,项目名称:zend-framework,代码行数:39,代码来源:Calendar.php


注:本文中的Zend_Gdata_Calendar::newWhen方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。