本文整理汇总了PHP中Vtiger_Datetime_UIType::getDateTimeValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Vtiger_Datetime_UIType::getDateTimeValue方法的具体用法?PHP Vtiger_Datetime_UIType::getDateTimeValue怎么用?PHP Vtiger_Datetime_UIType::getDateTimeValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vtiger_Datetime_UIType
的用法示例。
在下文中一共展示了Vtiger_Datetime_UIType::getDateTimeValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDisplayValue
/**
* Function to retieve display value for a field
* @param <String> $fieldName - field name for which values need to get
* @return <String>
*/
public function getDisplayValue($fieldName, $recordId = false)
{
if ($fieldName == 'login_time' || $fieldName == 'logout_time') {
if ($this->get($fieldName) != '0000-00-00 00:00:00') {
return Vtiger_Datetime_UIType::getDateTimeValue($this->get($fieldName));
} else {
return '---';
}
} else {
return $this->get($fieldName);
}
}
示例2: getListViewRecords
//.........这里部分代码省略.........
$value = Vtiger_Functions::decimalTimeFormat($value);
$value = $value['short'];
} elseif ($field->getUIType() == '27') {
if ($value == 'I') {
$value = getTranslatedString('LBL_INTERNAL', $module);
} elseif ($value == 'E') {
$value = getTranslatedString('LBL_EXTERNAL', $module);
} else {
$value = ' --';
}
$value = Vtiger_Functions::textLength($value);
} elseif ($field->getFieldDataType() == 'picklist') {
$value = Vtiger_Language_Handler::getTranslatedString($value, $module);
$value = textlength_check($value);
} elseif ($field->getFieldDataType() == 'date' || $field->getFieldDataType() == 'datetime') {
if ($value != '' && $value != '0000-00-00') {
$fieldDataType = $field->getFieldDataType();
if ($module == 'Calendar' && ($fieldName == 'date_start' || $fieldName == 'due_date')) {
if ($fieldName == 'date_start') {
$timeField = 'time_start';
} else {
if ($fieldName == 'due_date') {
$timeField = 'time_end';
}
}
$timeFieldValue = $this->db->query_result($result, $i, $timeField);
if (!empty($timeFieldValue)) {
$value .= ' ' . $timeFieldValue;
//TO make sure it takes time value as well
$fieldDataType = 'datetime';
}
}
if ($fieldDataType == 'datetime') {
$value = Vtiger_Datetime_UIType::getDateTimeValue($value);
} else {
if ($fieldDataType == 'date') {
$date = new DateTimeField($value);
$value = $date->getDisplayDate();
}
}
} elseif ($value == '0000-00-00') {
$value = '';
}
} elseif ($field->getFieldDataType() == 'time') {
if (!empty($value)) {
$userModel = Users_Privileges_Model::getCurrentUserModel();
if ($userModel->get('hour_format') == '12') {
$value = Vtiger_Time_UIType::getTimeValueInAMorPM($value);
}
}
} elseif ($field->getFieldDataType() == 'currency') {
if ($value != '') {
if ($field->getUIType() == 72) {
if ($fieldName == 'unit_price') {
$currencyId = getProductBaseCurrency($recordId, $module);
$cursym_convrate = getCurrencySymbolandCRate($currencyId);
$currencySymbol = $cursym_convrate['symbol'];
} else {
$currencyInfo = getInventoryCurrencyInfo($module, $recordId);
$currencySymbol = $currencyInfo['currency_symbol'];
}
$value = CurrencyField::convertToUserFormat($value, null, true);
$row['currencySymbol'] = $currencySymbol;
$value = CurrencyField::appendCurrencySymbol($value, $currencySymbol);
} else {
if (!empty($value)) {
示例3: getListViewRecords
//.........这里部分代码省略.........
}
} elseif ($field->getFieldDataType() == 'picklist') {
//not check for permissions for non admin users for status and activity type field
if ($module == 'Calendar' && ($fieldName == 'taskstatus' || $fieldName == 'eventstatus' || $fieldName == 'activitytype')) {
$value = Vtiger_Language_Handler::getTranslatedString($value, $module);
$value = textlength_check($value);
} else {
if ($value != '' && !$is_admin && $this->picklistRoleMap[$fieldName] && !in_array($value, $this->picklistValueMap[$fieldName]) && strtolower($value) != '--none--' && strtolower($value) != 'none') {
$value = "<font color='red'>" . Vtiger_Language_Handler::getTranslatedString('LBL_NOT_ACCESSIBLE', $module) . "</font>";
} else {
$value = Vtiger_Language_Handler::getTranslatedString($value, $module);
$value = textlength_check($value);
}
}
} elseif ($field->getFieldDataType() == 'date' || $field->getFieldDataType() == 'datetime') {
if ($value != '' && $value != '0000-00-00') {
$fieldDataType = $field->getFieldDataType();
if ($module == 'Calendar' && ($fieldName == 'date_start' || $fieldName == 'due_date')) {
if ($fieldName == 'date_start') {
$timeField = 'time_start';
} else {
if ($fieldName == 'due_date') {
$timeField = 'time_end';
}
}
$timeFieldValue = $this->db->query_result($result, $i, $timeField);
if (!empty($timeFieldValue)) {
$value .= ' ' . $timeFieldValue;
//TO make sure it takes time value as well
$fieldDataType = 'datetime';
}
}
if ($fieldDataType == 'datetime') {
$value = Vtiger_Datetime_UIType::getDateTimeValue($value);
} else {
if ($fieldDataType == 'date') {
$date = new DateTimeField($value);
$value = $date->getDisplayDate();
}
}
} elseif ($value == '0000-00-00') {
$value = '';
}
} elseif ($field->getFieldDataType() == 'time') {
if (!empty($value)) {
$value = Vtiger_Time_UIType::getTimeValueInAMorPM($value);
}
} elseif ($field->getFieldDataType() == 'currency') {
if ($value != '') {
if ($field->getUIType() == 72) {
if ($fieldName == 'unit_price') {
$currencyId = getProductBaseCurrency($recordId, $module);
$cursym_convrate = getCurrencySymbolandCRate($currencyId);
$currencySymbol = $cursym_convrate['symbol'];
} else {
$currencyInfo = getInventoryCurrencyInfo($module, $recordId);
$currencySymbol = $currencyInfo['currency_symbol'];
}
$value = CurrencyField::convertToUserFormat($value, null, true);
$row['currencySymbol'] = $currencySymbol;
// $value = CurrencyField::appendCurrencySymbol($currencyValue, $currencySymbol);
} else {
if (!empty($value)) {
$value = CurrencyField::convertToUserFormat($value);
}
}