本文整理汇总了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;
}
示例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;
}
}