[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/modules/Vtiger/uitypes/ -> Email.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_Email_UIType extends Vtiger_Base_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/Email.tpl';
  19      }
  20  
  21  	public function getDisplayValue($value, $recordId) {
  22          $currentUser = Users_Record_Model::getCurrentUserModel();
  23          $internalMailer = $currentUser->get('internal_mailer');
  24          if($value){
  25              $moduleName = $this->get('field')->get('block')->module->name;
  26              $fieldName = $this->get('field')->get('name');
  27              if ($internalMailer == 1) {
  28                  /**
  29                   *  We should not add "emailField" class to user name field.
  30                   *  If we do so, for sending mail from list view is taking that value as a TO field. 
  31                   */
  32                  if($moduleName == "Users" && $fieldName == "user_name"){
  33                      $value = "<a class='cursorPointer' onclick=\"Vtiger_Helper_Js.getInternalMailer($recordId," .
  34                              "'$fieldName','$moduleName');\">" . textlength_check($value) . "</a>";
  35                  }else{
  36                      $value = "<a class='emailField cursorPointer' onclick=\"Vtiger_Helper_Js.getInternalMailer($recordId," .
  37                              "'$fieldName','$moduleName');\">" . textlength_check($value) . "</a>";
  38                  }
  39              } else {
  40                  if($moduleName == "Users" && $fieldName == "user_name"){
  41                      $value = "<a class='cursorPointer'  href='mailto:" . $value . "'>" . textlength_check($value) . "</a>";
  42                  }else{
  43                      $value = "<a class='emailField cursorPointer'  href='mailto:" . $value . "'>" . textlength_check($value) . "</a>";
  44                  }
  45              }
  46          }
  47          return $value;
  48      }
  49  }


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