[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Emails/ -> DetailView.php (source)

   1  <?php
   2  /*********************************************************************************
   3   * The contents of this file are subject to the SugarCRM Public License Version 1.1.2
   4   * ("License"); You may not use this file except in compliance with the 
   5   * License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
   6   * Software distributed under the License is distributed on an  "AS IS"  basis,
   7   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
   8   * the specific language governing rights and limitations under the License.
   9   * The Original Code is:  SugarCRM Open Source
  10   * The Initial Developer of the Original Code is SugarCRM, Inc.
  11   * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
  12   * All Rights Reserved.
  13   * Contributor(s): ______________________________________.
  14   ********************************************************************************/
  15  /*********************************************************************************
  16   * $Header: /advent/projects/wesat/vtiger_crm/sugarcrm/modules/Emails/DetailView.php,v 1.22 2005/03/24 19:09:21 rank Exp $
  17   * Description:  TODO: To be written.
  18   * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
  19   * All Rights Reserved.
  20   * Contributor(s): ______________________________________..
  21   ********************************************************************************/
  22  
  23  require_once ('Smarty_setup.php');
  24  require_once ('data/Tracker.php');
  25  require_once ('modules/Emails/Emails.php');
  26  require_once ('include/upload_file.php');
  27  require_once ('include/database/PearDatabase.php');
  28  require_once ('include/utils/utils.php');
  29  
  30  global $log;
  31  global $app_strings;
  32  global $mod_strings;
  33  global $currentModule;
  34  
  35  $focus = new Emails();
  36  
  37  $smarty = new vtigerCRM_Smarty;
  38  if(isset($_REQUEST['record'])) 
  39  {
  40      global $adb;
  41      $focus->retrieve_entity_info($_REQUEST['record'],"Emails");
  42      $log->info("Entity info successfully retrieved for DetailView.");
  43      $focus->id = $_REQUEST['record'];
  44      $query = 'select email_flag,from_email,to_email,cc_email,bcc_email from vtiger_emaildetails where emailid ='.$focus->id;
  45      $result = $adb->query($query);
  46          $smarty->assign('FROM_MAIL',$adb->query_result($result,0,'from_email'));    
  47      $to_email = ereg_replace('###',', ',$adb->query_result($result,0,'to_email'));
  48      $smarty->assign('TO_MAIL',to_html($to_email));    
  49      $smarty->assign('CC_MAIL',to_html(ereg_replace('###',', ',$adb->query_result($result,0,'cc_email'))));    
  50          $smarty->assign('BCC_MAIL',to_html(ereg_replace('###',', ',$adb->query_result($result,0,'bcc_email'))));    
  51          $smarty->assign('EMAIL_FLAG',$adb->query_result($result,0,'email_flag'));    
  52      if($focus->column_fields['name'] != '')
  53              $focus->name = $focus->column_fields['name'];        
  54      else
  55          $focus->name = $focus->column_fields['subject'];
  56  }
  57  if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') 
  58  {
  59      $focus->id = "";
  60  } 
  61  
  62  //needed when creating a new email with default values passed in 
  63  if (isset($_REQUEST['contact_name']) && is_null($focus->contact_name)) 
  64  {
  65      $focus->contact_name = $_REQUEST['contact_name'];
  66  }
  67  if (isset($_REQUEST['contact_id']) && is_null($focus->contact_id)) 
  68  {
  69      $focus->contact_id = $_REQUEST['contact_id'];
  70  }
  71  if (isset($_REQUEST['opportunity_name']) && is_null($focus->parent_name)) 
  72  {
  73      $focus->parent_name = $_REQUEST['opportunity_name'];
  74  }
  75  if (isset($_REQUEST['opportunity_id']) && is_null($focus->parent_id)) 
  76  {
  77      $focus->parent_id = $_REQUEST['opportunity_id'];
  78  }
  79  if (isset($_REQUEST['account_name']) && is_null($focus->parent_name)) 
  80  {
  81      $focus->parent_name = $_REQUEST['account_name'];
  82  }
  83  if (isset($_REQUEST['account_id']) && is_null($focus->parent_id)) 
  84  {
  85      $focus->parent_id = $_REQUEST['account_id'];
  86  }
  87  if (isset($_REQUEST['parent_name'])) 
  88  {
  89          $focus->parent_name = $_REQUEST['parent_name'];
  90  }
  91  if (isset($_REQUEST['parent_id'])) 
  92  {
  93          $focus->parent_id = $_REQUEST['parent_id'];
  94  }
  95  if (isset($_REQUEST['parent_type'])) 
  96  {
  97          $focus->parent_type = $_REQUEST['parent_type'];
  98  }
  99  if (isset($_REQUEST['filename']) && is_null($focus->filename)) 
 100  {
 101          $focus->filename = $_REQUEST['filename'];
 102  }
 103  elseif (is_null($focus->parent_type)) 
 104  {
 105          $focus->parent_type = $app_list_strings['record_type_default_key'];
 106  }
 107  
 108  global $theme;
 109  $theme_path="themes/".$theme."/";
 110  $image_path=$theme_path."images/";
 111  require_once ($theme_path.'layout_utils.php');
 112  
 113  $log->info("Email detail view");
 114  
 115  $submenu = array('LBL_EMAILS_TITLE'=>'index.php?module=Emails&action=index','LBL_WEBMAILS_TITLE'=>'index.php?module=squirrelmail-1.4.4&action=redirect');
 116  $sec_arr = array('index.php?module=Emails&action=index'=>'Emails','index.php?module=squirrelmail-1.4.4&action=redirect'=>'Emails'); 
 117  
 118  $smarty->assign("MOD", $mod_strings);
 119  $smarty->assign("APP", $app_strings);
 120  
 121  $smarty->assign("UPDATEINFO",updateInfo($focus->id));
 122  if (isset($_REQUEST['return_module'])) $smarty->assign("RETURN_MODULE", $_REQUEST['return_module']);
 123  if (isset($_REQUEST['return_action'])) $smarty->assign("RETURN_ACTION", $_REQUEST['return_action']);
 124  if (isset($_REQUEST['return_id'])) $smarty->assign("RETURN_ID", $_REQUEST['return_id']);
 125  $smarty->assign("THEME", $theme);
 126  $smarty->assign("IMAGE_PATH", $image_path);
 127  $category = getParentTab();
 128  $smarty->assign("CATEGORY",$category);
 129  
 130  if (isset($focus->name)) $smarty->assign("NAME", $focus->name);
 131      else $smarty->assign("NAME", "");
 132  
 133  $entries = getBlocks($currentModule,"detail_view",'',$focus->column_fields);
 134  $entries['Email Information']['4']['Description']['value'] = from_html($entries['Email Information']['4']['Description']['value']);
 135  $smarty->assign("BLOCKS", $entries['Email Information']);
 136  $smarty->assign("SINGLE_MOD", 'Email');
 137  
 138  $smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
 139  
 140  if(isPermitted("Emails","EditView",$_REQUEST['record']) == 'yes')
 141      $smarty->assign("EDIT_DUPLICATE","permitted");
 142  
 143  if(isPermitted("Emails","Delete",$_REQUEST['record']) == 'yes')
 144      $smarty->assign("DELETE","permitted");
 145  $smarty->assign("ID",$focus->id);
 146  
 147  $check_button = Button_Check($module);
 148  $smarty->assign("CHECK", $check_button);
 149      
 150  //Constructing the Related Lists from here
 151  $smarty->assign("MODULE",$currentModule);
 152  $smarty->assign("SENDER",$email_id);
 153  if($_REQUEST['mode'] != 'ajax')
 154      $smarty->display("EmailDetailView.tpl");
 155  else
 156      $smarty->display("EmailDetails.tpl")
 157  ?>


Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7