[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Contacts/ -> 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/Contacts/DetailView.php,v 1.38 2005/04/25 05:04:46 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/Contacts/Contacts.php');
  26  require_once ('include/CustomFieldUtil.php');
  27  require_once ('include/database/PearDatabase.php');
  28  require_once ('include/utils/utils.php');
  29  require_once ('user_privileges/default_module_view.php');
  30  
  31  global $log;
  32  global $mod_strings;
  33  global $app_strings;
  34  global $currentModule, $singlepane_view;
  35  
  36  $focus = new Contacts();
  37  
  38  if(isset($_REQUEST['record']) && $_REQUEST['record']!='') {
  39  
  40          $focus->id=$_REQUEST['record'];
  41          $focus->retrieve_entity_info($_REQUEST['record'],'Contacts');
  42       $log->info("Entity info successfully retrieved for Contact DetailView.");
  43      $focus->firstname=$focus->column_fields['firstname'];
  44          $focus->lastname=$focus->column_fields['lastname'];
  45  }
  46  if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
  47      $focus->id = "";
  48  }
  49  
  50  global $theme;
  51  $theme_path="themes/".$theme."/";
  52  $image_path=$theme_path."images/";
  53  require_once ($theme_path.'layout_utils.php');
  54  
  55  $log->info("Contact detail view");
  56  
  57  $smarty = new vtigerCRM_Smarty;
  58  $smarty->assign("MOD", $mod_strings);
  59  $smarty->assign("APP", $app_strings);
  60  
  61  $smarty->assign("THEME", $theme);
  62  $smarty->assign("IMAGE_PATH", $image_path);
  63  $smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
  64  $smarty->assign("UPDATEINFO",updateInfo($focus->id));
  65  
  66  if(useInternalMailer() == 1) 
  67      $smarty->assign("INT_MAILER","true");
  68  
  69  $smarty->assign("NAME",$focus->lastname.' '.$focus->firstname);
  70  
  71  $log->info("Detail Block Informations successfully retrieved.");
  72  $smarty->assign("BLOCKS", getBlocks($currentModule,"detail_view",'',$focus->column_fields));
  73  $smarty->assign("CUSTOMFIELD", $cust_fld);
  74  $smarty->assign("SINGLE_MOD", 'Contact');
  75  $smarty->assign("REDIR_MOD","contacts");
  76  
  77  $smarty->assign("ID", $_REQUEST['record']);
  78  if(isPermitted("Contacts","EditView",$_REQUEST['record']) == 'yes')
  79      $smarty->assign("EDIT_DUPLICATE","permitted");
  80  
  81  if(isPermitted("Contacts","Delete",$_REQUEST['record']) == 'yes')
  82      $smarty->assign("DELETE","permitted");
  83  if(isPermitted("Emails","EditView",'') == 'yes')
  84  {
  85      //Added to pass the parents list as hidden for Emails -- 09-11-2005
  86      $parent_email = getEmailParentsList('Contacts',$_REQUEST['record']);
  87      $smarty->assign("HIDDEN_PARENTS_LIST",$parent_email);
  88      $smarty->assign("SENDMAILBUTTON","permitted");
  89  }
  90  
  91  if(isPermitted("Contacts","Merge",'') == 'yes')
  92  {
  93      $smarty->assign("MERGEBUTTON","permitted");
  94      require_once ('include/utils/UserInfoUtil.php');
  95      $wordTemplateResult = fetchWordTemplateList("Contacts");
  96      $tempCount = $adb->num_rows($wordTemplateResult);
  97      $tempVal = $adb->fetch_array($wordTemplateResult);
  98      for($templateCount=0;$templateCount<$tempCount;$templateCount++)
  99      {
 100          $optionString[$tempVal["templateid"]]=$tempVal["filename"];
 101          $tempVal = $adb->fetch_array($wordTemplateResult);
 102      }
 103      $smarty->assign("WORDTEMPLATEOPTIONS",$app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']);
 104          $smarty->assign("TOPTIONS",$optionString);
 105  }
 106  
 107  //Security check for related list
 108  $category = getParentTab();
 109  $smarty->assign("CATEGORY",$category);
 110  
 111  $check_button = Button_Check($module);
 112  $smarty->assign("CHECK", $check_button);
 113  
 114  $tabid = getTabid("Contacts");
 115  $validationData = getDBValidationData($focus->tab_name,$tabid);
 116  $data = split_validationdataArray($validationData);
 117  
 118  $smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']);
 119  $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
 120  $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
 121  
 122  $smarty->assign("MODULE",$currentModule);
 123  $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record]));
 124  
 125  if($singlepane_view == 'true')
 126  {
 127      $related_array = getRelatedLists($currentModule,$focus);
 128      $smarty->assign("RELATEDLISTS", $related_array);
 129  }
 130  
 131  $smarty->assign("SinglePane_View", $singlepane_view);
 132  
 133  $smarty->display("DetailView.tpl");
 134  ?>
 135  


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