Esempio n. 1
0
 public function getDisplayValue($value)
 {
     if ($this->getName() === 'enabled') {
         $moduleName = 'Settings:Webforms';
         if ($value) {
             return vtranslate('LBL_ACTIVE', $moduleName);
         }
         return vtranslate('LBL_INACTIVE', $moduleName);
     }
     return parent::getDisplayValue($value);
 }
Esempio n. 2
0
	/**
	 * Customize the display value for detail view.
	 */
	public function getDisplayValue($value, $record = false, $recordInstance = false)
	{
		if ($recordInstance) {
			if ($this->getName() == 'date_start') {
				$dateTimeValue = $value . ' ' . $recordInstance->get('time_start');
				$value = $this->getUITypeModel()->getDisplayValue($dateTimeValue);
				list($startDate, $startTime, $meridiem) = explode(' ', $value);
				return $startDate . ' ' . $startTime . ' ' . $meridiem;
			} else if ($this->getName() == 'due_date') {
				$dateTimeValue = $value . ' ' . $recordInstance->get('time_end');
				$value = $this->getUITypeModel()->getDisplayValue($dateTimeValue);
				list($startDate, $startTime, $meridiem) = explode(' ', $value);
				return $startDate . ' ' . $startTime . ' ' . $meridiem;
			}
		}
		return parent::getDisplayValue($value, $record, $recordInstance);
	}
Esempio n. 3
0
 /**
  * Function to retieve display value for a value
  * @param <String> $value - value which need to be converted to display value
  * @return <String> - converted display value
  */
 public function getDisplayValue($value, $record = false, $recordInstance = false)
 {
     $fieldName = $this->getName();
     if ($fieldName == 'filesize' && $recordInstance) {
         $downloadType = $recordInstance->get('filelocationtype');
         if ($downloadType == 'I') {
             $filesize = $value;
             if ($filesize < 1024) {
                 $value = $filesize . ' B';
             } elseif ($filesize > 1024 && $filesize < 1048576) {
                 $value = round($filesize / 1024, 2) . ' KB';
             } else {
                 if ($filesize > 1048576) {
                     $value = round($filesize / (1024 * 1024), 2) . ' MB';
                 }
             }
         } else {
             $value = ' --';
         }
         return $value;
     }
     return parent::getDisplayValue($value, $record, $recordInstance);
 }
Esempio n. 4
0
 /**
  * Function to retieve display value for a value
  * @param <String> $value - value which need to be converted to display value
  * @return <String> - converted display value
  */
 public function getDisplayValue($value, $recordId = false)
 {
     if ($this->get('uitype') == 32) {
         return Vtiger_Language_Handler::getLanguageLabel($value);
     }
     $fieldName = $this->getFieldName();
     if (($fieldName == 'currency_decimal_separator' || $fieldName == 'currency_grouping_separator') && $value == '&nbsp;') {
         return vtranslate('LBL_Space', 'Users');
     }
     return parent::getDisplayValue($value, $recordId);
 }
Esempio n. 5
0
 /**
  * Customize the display value for detail view.
  */
 public function getDisplayValue($value, $record = false, $recordInstance = false)
 {
     if ($recordInstance) {
         if ($this->getName() == 'date_start') {
             $dateTimeValue = $value . ' ' . $recordInstance->get('time_start');
             $value = $this->getUITypeModel()->getDisplayValue($dateTimeValue);
             list($startDate, $startTime) = explode(' ', $value);
             $currentUser = Users_Record_Model::getCurrentUserModel();
             if ($currentUser->get('hour_format') == '12') {
                 $startTime = Vtiger_Time_UIType::getTimeValueInAMorPM($startTime);
             }
             return $startDate . ' ' . $startTime;
         } else {
             if ($this->getName() == 'due_date') {
                 $dateTimeValue = $value . ' ' . $recordInstance->get('time_end');
                 $value = $this->getUITypeModel()->getDisplayValue($dateTimeValue);
                 list($startDate, $startTime) = explode(' ', $value);
                 $currentUser = Users_Record_Model::getCurrentUserModel();
                 if ($currentUser->get('hour_format') == '12') {
                     $startTime = Vtiger_Time_UIType::getTimeValueInAMorPM($startTime);
                 }
                 return $startDate . ' ' . $startTime;
             }
         }
     }
     return parent::getDisplayValue($value, $record, $recordInstance);
 }
Esempio n. 6
0
 /**
  * Function to retieve display value for a value
  * @param <String> $value - value which need to be converted to display value
  * @return <String> - converted display value
  */
 public function getDisplayValue($value, $recordId = false)
 {
     if ($this->get('uitype') == 32) {
         return Vtiger_Language_Handler::getLanguageLabel($value);
     }
     return parent::getDisplayValue($value, $recordId);
 }