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


PHP DateTimeField::getFullcalenderDateTimevalue方法代码示例

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


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

示例1: getEntity

 public function getEntity()
 {
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $db = PearDatabase::getInstance();
     $data = $this->getQuery();
     $result = $db->pquery($data['query'], $data['params']);
     $return = [];
     while ($record = $db->fetch_array($result)) {
         $item = [];
         $crmid = $record['activityid'];
         $activitytype = $record['activitytype'];
         $item['id'] = $crmid;
         $item['title'] = $record['subject'];
         $item['url'] = 'index.php?module=' . $this->getModuleName() . '&view=Detail&record=' . $crmid;
         $item['set'] = $record['activitytype'] == 'Task' ? 'Task' : 'Event';
         $item['lok'] = $record['location'];
         $item['pri'] = $record['priority'];
         $item['sta'] = $record['status'];
         $item['vis'] = $record['visibility'];
         $item['state'] = $record['state'];
         //Relation
         $item['link'] = $record['link'];
         $item['linkl'] = $record['linklabel'];
         $item['linkm'] = $record['linkmod'];
         //Process
         $item['process'] = $record['process'];
         $item['procl'] = $record['processlabel'];
         $item['procm'] = $record['processmod'];
         if ($record['linkmod'] != 'Accounts' && (!empty($record['link']) || !empty($record['process']))) {
             $findId = 0;
             $findMod = '';
             if (!empty($record['link'])) {
                 $findId = $record['link'];
                 $findMod = $record['linkmod'];
             }
             if (!empty($record['process'])) {
                 $findId = $record['process'];
                 $findMod = $record['processmod'];
             }
             $tabInfo = $this->relationAcounts[$findMod];
             if ($tabInfo) {
                 $findResult = $db->pquery('SELECT accountid, accountname FROM vtiger_account ' . 'INNER JOIN ' . $tabInfo[0] . ' ON vtiger_account.accountid = ' . $tabInfo[0] . '.' . $tabInfo[2] . ' WHERE ' . $tabInfo[1] . ' = ?;', [$findId]);
                 if ($db->num_rows($findResult) > 0) {
                     $item['accid'] = $db->query_result_raw($findResult, 0, 'accountid');
                     $item['accname'] = $db->query_result_raw($findResult, 0, 'accountname');
                 }
             }
         }
         $dateTimeFieldInstance = new DateTimeField($record['date_start'] . ' ' . $record['time_start']);
         $userDateTimeString = $dateTimeFieldInstance->getFullcalenderDateTimevalue($currentUser);
         $dateTimeComponents = explode(' ', $userDateTimeString);
         $dateComponent = $dateTimeComponents[0];
         $startTimeFormated = $dateTimeComponents[1];
         //Conveting the date format in to Y-m-d . since full calendar expects in the same format
         $startDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->get('date_format'));
         $dateTimeFieldInstance = new DateTimeField($record['due_date'] . ' ' . $record['time_end']);
         $userDateTimeString = $dateTimeFieldInstance->getFullcalenderDateTimevalue($currentUser);
         $dateTimeComponents = explode(' ', $userDateTimeString);
         $dateComponent = $dateTimeComponents[0];
         $endTimeFormated = $dateTimeComponents[1];
         //Conveting the date format in to Y-m-d . since full calendar expects in the same format
         $endDateFormated = DateTimeField::__convertToDBFormat($dateComponent, $currentUser->get('date_format'));
         $item['start'] = $startDateFormated . ' ' . $startTimeFormated;
         $item['end'] = $endDateFormated . ' ' . $endTimeFormated;
         $item['allDay'] = $record['allday'] == 1 ? true : false;
         $item['className'] = ' userCol_' . $record['smownerid'] . ' calCol_' . $activitytype;
         $return[] = $item;
     }
     return $return;
 }
开发者ID:noclav,项目名称:UpdatePackages,代码行数:70,代码来源:Calendar.php

示例2: pullTasks

 protected function pullTasks($start, $end, &$result, $color = null, $textColor = 'white')
 {
     $user = Users_Record_Model::getCurrentUserModel();
     $db = PearDatabase::getInstance();
     $moduleModel = Vtiger_Module_Model::getInstance('Calendar');
     $userAndGroupIds = array_merge(array($user->getId()), $this->getGroupsIdsForUsers($user->getId()));
     $queryGenerator = new QueryGenerator($moduleModel->get('name'), $user);
     $queryGenerator->setFields(array('activityid', 'subject', 'taskstatus', 'activitytype', 'date_start', 'time_start', 'due_date', 'time_end', 'id'));
     $query = $queryGenerator->getQuery();
     $query .= " AND vtiger_activity.activitytype = 'Task' AND ";
     $currentUser = Users_Record_Model::getCurrentUserModel();
     $hideCompleted = $currentUser->get('hidecompletedevents');
     if ($hideCompleted) {
         $query .= "vtiger_activity.status != 'Completed' AND ";
     }
     $query .= " ((date_start >= ? AND due_date < ?) OR ( due_date >= ?))";
     $params = array($start, $end, $start);
     $params = array_merge($params, $userAndGroupIds);
     $query .= " AND vtiger_crmentity.smownerid IN (" . generateQuestionMarks($userAndGroupIds) . ")";
     $queryResult = $db->pquery($query, $params);
     while ($record = $db->fetchByAssoc($queryResult)) {
         $item = array();
         $crmid = $record['activityid'];
         $item['title'] = decode_html($record['subject']) . ' - (' . decode_html(vtranslate($record['status'], 'Calendar')) . ')';
         $item['status'] = $record['status'];
         $item['activitytype'] = $record['activitytype'];
         $item['id'] = $crmid;
         $dateTimeFieldInstance = new DateTimeField($record['date_start'] . ' ' . $record['time_start']);
         $userDateTimeString = $dateTimeFieldInstance->getFullcalenderDateTimevalue();
         $dateTimeComponents = explode(' ', $userDateTimeString);
         $dateComponent = $dateTimeComponents[0];
         //Conveting the date format in to Y-m-d . since full calendar expects in the same format
         $dataBaseDateFormatedString = DateTimeField::__convertToDBFormat($dateComponent, $user->get('date_format'));
         $item['start'] = $dataBaseDateFormatedString . ' ' . $dateTimeComponents[1];
         $item['end'] = $record['due_date'];
         $item['url'] = sprintf('index.php?module=Calendar&view=Detail&record=%s', $crmid);
         $item['color'] = $color;
         $item['textColor'] = $textColor;
         $item['module'] = $moduleModel->getName();
         $result[] = $item;
     }
 }
开发者ID:lsmonki,项目名称:vtigercrm,代码行数:42,代码来源:Feed.php


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