本文整理汇总了PHP中SugarDateTime::getHashList方法的典型用法代码示例。如果您正苦于以下问题:PHP SugarDateTime::getHashList方法的具体用法?PHP SugarDateTime::getHashList怎么用?PHP SugarDateTime::getHashList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SugarDateTime
的用法示例。
在下文中一共展示了SugarDateTime::getHashList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_activities
function add_activities($user, $type = 'sugar')
{
global $timedate;
if ($this->view == 'week' || $this->view == 'shared') {
$end_date_time = $this->date_time->get("+7 days");
} else {
$end_date_time = $this->date_time;
}
$acts_arr = array();
if ($type == 'vfb') {
$acts_arr = CalendarActivity::get_freebusy_activities($user, $this->date_time, $end_date_time);
} else {
$acts_arr = CalendarActivity::get_activities($user->id, $this->show_tasks, $this->date_time, $end_date_time, $this->view);
}
// loop thru each activity for this user
foreach ($acts_arr as $act) {
// get "hashed" time slots for the current activity we are looping through
$start = $timedate->tzUser($act->start_time);
$end = $timedate->tzUser($act->end_time);
$hash_list = SugarDateTime::getHashList($this->view, $start, $end);
for ($j = 0; $j < count($hash_list); $j++) {
if (!isset($this->slice_hash[$hash_list[$j]]) || !isset($this->slice_hash[$hash_list[$j]]->acts_arr[$user->id])) {
$this->slice_hash[$hash_list[$j]]->acts_arr[$user->id] = array();
}
$this->slice_hash[$hash_list[$j]]->acts_arr[$user->id][] = $act;
}
}
}