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


PHP Vtiger_Datetime_UIType::getDateTimeValue方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:cannking,项目名称:vtigercrm-debug,代码行数:17,代码来源:Record.php

示例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)) {
开发者ID:Bergdahls,项目名称:YetiForceCRM,代码行数:67,代码来源:ListViewController.php

示例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);
                         }
                     }
开发者ID:nouphet,项目名称:vtigercrm-6.0.0-ja,代码行数:67,代码来源:ListViewController.php


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