[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Accounts/ -> 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/Accounts/DetailView.php,v 1.37 2005/04/18 10:37:49 samk 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/Accounts/Accounts.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  global $mod_strings;
  31  global $app_strings;
  32  global $app_list_strings;
  33  global $log, $currentModule, $singlepane_view;
  34  
  35  $focus = new Accounts();
  36  if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {
  37      $focus->retrieve_entity_info($_REQUEST['record'],"Accounts");
  38      $focus->id = $_REQUEST['record'];    
  39      $focus->name=$focus->column_fields['accountname'];
  40  $log->debug("id is  ".$focus->id);
  41  $log->debug("name is ".$focus->name);
  42  }
  43  
  44  if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
  45      $focus->id = "";
  46  } 
  47  
  48  global $theme;
  49  $theme_path="themes/".$theme."/";
  50  $image_path=$theme_path."images/";
  51  require_once ($theme_path.'layout_utils.php');
  52  
  53  $log->info("Account detail view");
  54  $smarty = new vtigerCRM_Smarty;
  55  $smarty->assign("MOD", $mod_strings);
  56  $smarty->assign("APP", $app_strings);
  57  
  58  $smarty->assign("THEME", $theme);
  59  $smarty->assign("IMAGE_PATH", $image_path);
  60  $smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
  61   
  62  if (isset($focus->name)) $smarty->assign("NAME", $focus->name);
  63  else $smarty->assign("NAME", "");
  64  $smarty->assign("BLOCKS", getBlocks("Accounts","detail_view",'',$focus->column_fields));
  65  $smarty->assign("UPDATEINFO",updateInfo($focus->id));
  66  
  67  $smarty->assign("CUSTOMFIELD", $cust_fld);
  68  $smarty->assign("ID", $_REQUEST['record']);
  69  $smarty->assign("SINGLE_MOD",'Account');
  70  $category = getParentTab();
  71  $smarty->assign("CATEGORY",$category);
  72  
  73  if(useInternalMailer() == 1)
  74          $smarty->assign("INT_MAILER","true");
  75  
  76  
  77  if(isPermitted("Accounts","EditView",$_REQUEST['record']) == 'yes')
  78      $smarty->assign("EDIT_DUPLICATE","permitted");
  79  
  80  if(isPermitted("Accounts","Delete",$_REQUEST['record']) == 'yes')
  81      $smarty->assign("DELETE","permitted");
  82  
  83  if(isPermitted("Accounts","Merge",'') == 'yes')
  84  {
  85      $smarty->assign("MERGEBUTTON","permitted");
  86      require_once ('include/utils/UserInfoUtil.php');
  87      $wordTemplateResult = fetchWordTemplateList("Accounts");
  88      $tempCount = $adb->num_rows($wordTemplateResult);
  89      $tempVal = $adb->fetch_array($wordTemplateResult);
  90      for($templateCount=0;$templateCount<$tempCount;$templateCount++)
  91      {
  92          $optionString[$tempVal["templateid"]]=$tempVal["filename"];
  93          $tempVal = $adb->fetch_array($wordTemplateResult);
  94      }
  95      $smarty->assign("WORDTEMPLATEOPTIONS",$app_strings['LBL_SELECT_TEMPLATE_TO_MAIL_MERGE']);
  96          $smarty->assign("TOPTIONS",$optionString);
  97  }
  98  
  99  $tabid = getTabid("Accounts");
 100  $validationData = getDBValidationData($focus->tab_name,$tabid);
 101  $data = split_validationdataArray($validationData);
 102  
 103  $smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']);
 104  $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
 105  $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
 106        
 107  
 108  $check_button = Button_Check($module);
 109  $smarty->assign("CHECK", $check_button);
 110  
 111  $smarty->assign("MODULE",$currentModule);
 112  $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record]));
 113  
 114  if($singlepane_view == 'true')
 115  {
 116      $related_array = getRelatedLists($currentModule,$focus);
 117      $smarty->assign("RELATEDLISTS", $related_array);
 118  }
 119  $smarty->assign("SinglePane_View", $singlepane_view);
 120  
 121  $smarty->display("DetailView.tpl");
 122  ?>


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