[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/modules/Vtiger/uitypes/ -> Reminder.php (source)

   1  <?php
   2  /*+***********************************************************************************
   3   * The contents of this file are subject to the vtiger CRM Public License Version 1.0
   4   * ("License"); You may not use this file except in compliance with the License
   5   * The Original Code is:  vtiger CRM Open Source
   6   * The Initial Developer of the Original Code is vtiger.
   7   * Portions created by vtiger are Copyright (C) vtiger.
   8   * All Rights Reserved.
   9   *************************************************************************************/
  10  
  11  class Vtiger_Reminder_UIType extends Vtiger_Date_UIType {
  12  
  13      /**
  14       * Function to get the Template name for the current UI Type object
  15       * @return <String> - Template Name
  16       */
  17  	public function getTemplateName() {
  18          return 'uitypes/Reminder.tpl';
  19      }
  20      
  21      /**
  22       * Function to get the Detailview template name for the current UI Type Object
  23       * @return <String> - Template Name
  24       */
  25  	public function getDetailViewTemplateName() {
  26          return 'uitypes/ReminderDetailView.tpl';
  27      }
  28      
  29      /**
  30       * Function to get the Display Value, for the current field type with given DB Insert Value
  31       * @param <Object> $value
  32       * @return <Object>
  33       */
  34  	public function getDisplayValue($value) {
  35          $reminder_value = '';
  36          $reminder_time = $this->getEditViewDisplayValue($value);
  37          if(!empty($reminder_time[0])){
  38              $reminder_value = $reminder_time[0].' '.vtranslate('LBL_DAYS');
  39          }
  40          if(!empty($reminder_time[1])){
  41              $reminder_value = $reminder_value.' '.$reminder_time[1].' '.vtranslate('LBL_HOURS');
  42          }
  43          if(!empty($reminder_time[2])){
  44              $reminder_value = $reminder_value.' '.$reminder_time[2].' '.vtranslate('LBL_MINUTES');
  45          }
  46          
  47          return $reminder_value;
  48      }
  49      
  50      /**
  51       * Function to get the display value in edit view
  52       * @param $value
  53       * @return converted value
  54       */
  55  	public function getEditViewDisplayValue($value) {
  56          if($value != 0 ){
  57              $rem_days = floor($value/(24*60));
  58              $rem_hrs = floor(($value-$rem_days*24*60)/60);
  59              $rem_min = ($value-($rem_days*24*60))%60;
  60              $reminder_time = array($rem_days , $rem_hrs, $rem_min);
  61              return $reminder_time;
  62          }else{
  63              return '';
  64          }
  65      }
  66      
  67  }


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1