當前位置: 首頁>>代碼示例>>PHP>>正文


PHP vCal::get_vcal_freebusy方法代碼示例

本文整理匯總了PHP中vCal::get_vcal_freebusy方法的典型用法代碼示例。如果您正苦於以下問題:PHP vCal::get_vcal_freebusy方法的具體用法?PHP vCal::get_vcal_freebusy怎麽用?PHP vCal::get_vcal_freebusy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在vCal的用法示例。


在下文中一共展示了vCal::get_vcal_freebusy方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: vCal

        static function cache_sugar_vcal_freebusy(&$user_focus)
        {
            $focus = new vCal();
            // set freebusy members and save
            $arr = array('user_id'=>$user_focus->id,'type'=>'vfb','source'=>'sugar');
            $focus->retrieve_by_string_fields($arr);


            $focus->content = $focus->get_vcal_freebusy($user_focus,false);
            $focus->type = 'vfb';
            $focus->date_modified = null;
            $focus->source = 'sugar';
            $focus->user_id = $user_focus->id;
            $focus->save();
        }
開發者ID:auf,項目名稱:crm_auf_org,代碼行數:15,代碼來源:vCal.php

示例2: array

 function get_freebusy_activities(&$user_focus, &$start_date_time, &$end_date_time)
 {
     $act_list = array();
     $vcal_focus = new vCal();
     $vcal_str = $vcal_focus->get_vcal_freebusy($user_focus);
     $lines = explode("\n", $vcal_str);
     foreach ($lines as $line) {
         $dates_arr = array();
         if (preg_match('/^FREEBUSY.*?:([^\\/]+)\\/([^\\/]+)/i', $line, $matches)) {
             $dates_arr[] = DateTimeUtil::parse_utc_date_time($matches[1]);
             $dates_arr[] = DateTimeUtil::parse_utc_date_time($matches[2]);
             $act_list[] = new CalendarActivity($dates_arr);
         }
     }
     usort($act_list, 'sort_func_by_act_date');
     return $act_list;
 }
開發者ID:aldridged,項目名稱:gtg-sugar,代碼行數:17,代碼來源:Calendar.php

示例3: array

 function get_freebusy_activities($user_focus, $start_date_time, $end_date_time)
 {
     $act_list = array();
     $vcal_focus = new vCal();
     $vcal_str = $vcal_focus->get_vcal_freebusy($user_focus);
     $lines = explode("\n", $vcal_str);
     $utc = new DateTimeZone("UTC");
     foreach ($lines as $line) {
         if (preg_match('/^FREEBUSY.*?:([^\\/]+)\\/([^\\/]+)/i', $line, $matches)) {
             $dates_arr = array(SugarDateTime::createFromFormat(vCal::UTC_FORMAT, $matches[1], $utc), SugarDateTime::createFromFormat(vCal::UTC_FORMAT, $matches[2], $utc));
             $act_list[] = new CalendarActivity($dates_arr);
         }
     }
     return $act_list;
 }
開發者ID:NALSS,項目名稱:SuiteCRM,代碼行數:15,代碼來源:CalendarActivity.php

示例4: testget_vcal_freebusy

 public function testget_vcal_freebusy()
 {
     $vcal = new vCal();
     $user_focus = new User('1');
     $expectedStart = "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//SugarCRM//SugarCRM Calendar//EN\r\nBEGIN:VFREEBUSY\r\nORGANIZER;CN= :VFREEBUSY\r\n";
     $expectedEnd = "END:VFREEBUSY\r\nEND:VCALENDAR\r\n";
     $result = $vcal->get_vcal_freebusy($user_focus);
     $this->assertStringStartsWith($expectedStart, $result);
     $this->assertStringEndsWith($expectedEnd, $result);
 }
開發者ID:sacredwebsite,項目名稱:SuiteCRM,代碼行數:10,代碼來源:vCalTest.php


注:本文中的vCal::get_vcal_freebusy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。