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


PHP Zend_Gdata_Calendar::newReminder方法代码示例

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


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

示例1: 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

示例2: setReminder

/**
 * Adds a reminder to the event specified as a parameter.
 *
 * @param  Zend_Http_Client $client  The authenticated client object
 * @param  string           $eventId The event ID string
 * @param  integer          $minutes Minutes before event to set reminder
 * @return Zend_Gdata_Calendar_EventEntry|null The updated entry
 */
function setReminder(Zend_Http_Client $client, $eventId, $minutes = 15)
{
    $gc = new Zend_Gdata_Calendar($client);
    $method = "alert";
    if ($event = getEvent($client, $eventId)) {
        $times = $event->when;
        foreach ($times as $when) {
            $reminder = $gc->newReminder();
            $reminder->setMinutes($minutes);
            $reminder->setMethod($method);
            $when->reminder = array($reminder);
        }
        $eventNew = $event->save();
        return $eventNew;
    } else {
        return null;
    }
}
开发者ID:jon9872,项目名称:zend-framework,代码行数:26,代码来源:Calendar-expanded.php

示例3: 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

示例4: send_sms

function send_sms($param_google_username, $param_google_password, $param_title, $param_content)
{
    /**
     * @Include Zend_Loader
     */
    require_once 'Zend/Loader.php';
    /**
     * @Load Zend_Gdata
     */
    Zend_Loader::loadClass('Zend_Gdata');
    /**
     * @Load Zend_Gdata_AuthSub
     */
    Zend_Loader::loadClass('Zend_Gdata_AuthSub');
    /**
     * @Load Zend_Gdata_ClientLogin
     */
    Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
    /**
     * @Load Zend_Gdata_HttpClient
     */
    Zend_Loader::loadClass('Zend_Gdata_HttpClient');
    /**
     * @Load Zend_Gdata_Calendar
     */
    Zend_Loader::loadClass('Zend_Gdata_Calendar');
    // Parameters for ClientAuth authentication
    $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
    $user = $param_google_username;
    $pass = $param_google_password;
    // 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($param_title);
    //$event->where = array($service->newWhere("Mountain View, California"));
    $event->content = $service->newContent($param_content);
    // Set the date using RFC 3339 format.
    $startDate = date("Y-m-d");
    //"2009-01-15";
    $startTime = date("H:i", strtotime("+3 minutes"));
    $endDate = date("Y-m-d");
    $endTime = date("H:i", strtotime("+6 minutes"));
    $tzOffset = "+08";
    $when = $service->newWhen();
    $when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
    $when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
    // Create a new reminder object. It should be set to send an email
    // to the user 10 minutes beforehand.
    $reminder = $service->newReminder();
    $reminder->method = "sms";
    $reminder->minutes = "2";
    $when->reminders = array($reminder);
    $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
    if ($newEvent = $service->insertEvent($event)) {
        return true;
    } else {
        return false;
    }
}
开发者ID:shojibflamon,项目名称:Bar-Code-example,代码行数:66,代码来源:SMS.php


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