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


PHP Appointment::readAppointment方法代码示例

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


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

示例1: add_Activities

 /**
  * Function to get activities
  * @param  array $current_user  - user data
  * @param  string $free_busy    - 
  */
 function add_Activities($current_user, $free_busy = '')
 {
     if (isset($current_user->start_hour) && $current_user->start_hour != '') {
         list($sthour, $stmin) = explode(":", $current_user->start_hour);
         $hr = $sthour + 0;
         $this->day_start_hour = $hr;
     } else {
         $this->day_start_hour = 8;
     }
     if (isset($current_user->end_hour) && $current_user->end_hour != '') {
         list($endhour, $endmin) = explode(":", $current_user->end_hour);
         $endhour = $endhour + 0;
         $this->day_end_hour = $endhour;
     } else {
         $this->day_end_hour = 23;
     }
     if ($this->view == 'week') {
         $start_datetime = $this->date_time->getThisweekDaysbyIndex(1);
         $end_datetime = $this->date_time->getThisweekDaysbyIndex(7);
     } elseif ($this->view == 'month') {
         $start_datetime = $this->date_time->getThismonthDaysbyIndex(0);
         $end_datetime = $this->date_time->getThismonthDaysbyIndex($this->date_time->daysinmonth - 1);
     } elseif ($this->view == 'year') {
         $start_datetime = $this->date_time->getThisyearMonthsbyIndex(0);
         $end_datetime = $this->date_time->get_first_day_of_changed_year('increment');
     } else {
         $start_datetime = $this->date_time;
         $end_datetime = $this->date_time->getTodayDatetimebyIndex(23);
     }
     $activities = array();
     $activities = Appointment::readAppointment($current_user->id, $start_datetime, $end_datetime, $this->view);
     if (!empty($activities)) {
         foreach ($activities as $key => $value) {
             if ($this->view == 'day') {
                 if (empty($this->day_slice[$value->formatted_datetime]->activities)) {
                     $this->day_slice[$value->formatted_datetime]->activities = array();
                 }
                 array_push($this->day_slice[$value->formatted_datetime]->activities, $value);
             } elseif ($this->view == 'week') {
                 if (empty($this->week_slice[$value->formatted_datetime]->activities)) {
                     $this->week_slice[$value->formatted_datetime]->activities = array();
                 }
                 array_push($this->week_slice[$value->formatted_datetime]->activities, $value);
             } elseif ($this->view == 'month') {
                 if (empty($this->month_array[$value->formatted_datetime]->activities)) {
                     $this->month_array[$value->formatted_datetime]->activities = array();
                 }
                 array_push($this->month_array[$value->formatted_datetime]->activities, $value);
             } elseif ($this->view == 'year') {
                 if (empty($this->year_array[$value->formatted_datetime]->activities)) {
                     $this->year_array[$value->formatted_datetime]->activities = array();
                 }
                 array_push($this->year_array[$value->formatted_datetime]->activities, $value);
             } else {
                 die("view:" . $this->view . " is not defined");
             }
         }
     }
 }
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:64,代码来源:Calendar.php


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