本文整理匯總了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();
}
示例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;
}
示例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;
}
示例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);
}