[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Accounts/ -> EditView.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/EditView.php,v 1.19 2005/03/24 16:18:38 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/ComboUtil.php');
  28  require_once ('include/utils/utils.php');
  29  require_once ('include/FormValidationUtil.php');
  30  
  31  global $app_strings,$mod_strings,$currentModule,$theme;
  32  $smarty=new vtigerCRM_Smarty;
  33  
  34  $focus = new Accounts();
  35  
  36  if(isset($_REQUEST['record'])) 
  37  {
  38      $focus->id = $_REQUEST['record'];
  39      $focus->mode = 'edit';     
  40      $focus->retrieve_entity_info($_REQUEST['record'],"Accounts");        
  41      $focus->name=$focus->column_fields['accountname']; 
  42  }
  43  if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
  44      $focus->id = "";
  45          $focus->mode = '';     
  46  }
  47  $disp_view = getView($focus->mode);
  48  if($disp_view == 'edit_view')
  49      $smarty->assign("BLOCKS",getBlocks("Accounts",$disp_view,$mode,$focus->column_fields));
  50  else    
  51  {
  52      $smarty->assign("BASBLOCKS",getBlocks("Accounts",$disp_view,$mode,$focus->column_fields,'BAS'));
  53      $smarty->assign("ADVBLOCKS",getBlocks("Accounts",$disp_view,$mode,$focus->column_fields,'ADV'));
  54  }
  55  
  56  $smarty->assign("OP_MODE",$disp_view);
  57   
  58  
  59  $theme_path="themes/".$theme."/";
  60  $image_path=$theme_path."images/";
  61  //retreiving the combo values array
  62  $comboFieldNames = Array('accounttype'=>'account_type_dom'
  63                        ,'industry'=>'industry_dom');
  64  $comboFieldArray = getComboArray($comboFieldNames);
  65  
  66  
  67  require_once ($theme_path.'layout_utils.php');
  68  
  69  $log->info("Account detail view");
  70  
  71  
  72  $smarty->assign("MOD", $mod_strings);
  73  $smarty->assign("APP", $app_strings);
  74  
  75  if (isset($focus->name)) $smarty->assign("NAME", $focus->name);
  76  else $smarty->assign("NAME", "");
  77  if(isset($cust_fld))
  78  {
  79          $smarty->assign("CUSTOMFIELD", $cust_fld);
  80  }
  81  if($focus->mode == 'edit')
  82  {
  83      $smarty->assign("UPDATEINFO",updateInfo($focus->id));
  84          $smarty->assign("MODE", $focus->mode);
  85  }
  86  
  87  if(isset($_REQUEST['return_module'])) $smarty->assign("RETURN_MODULE", $_REQUEST['return_module']);
  88  else $smarty->assign("RETURN_MODULE","Accounts");
  89  if(isset($_REQUEST['return_action'])) $smarty->assign("RETURN_ACTION", $_REQUEST['return_action']);
  90  if(isset($_REQUEST['return_id'])) $smarty->assign("RETURN_ID", $_REQUEST['return_id']);
  91  if(isset($_REQUEST['return_viewname'])) $smarty->assign("RETURN_VIEWNAME", $_REQUEST['return_viewname']);
  92  $category = getParentTab();
  93  $smarty->assign("CATEGORY",$category);
  94  $smarty->assign("THEME", $theme);
  95  $smarty->assign("IMAGE_PATH", $image_path);$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
  96  $smarty->assign("ID", $focus->id);
  97  $smarty->assign("MODULE",$currentModule);
  98  $smarty->assign("SINGLE_MOD",'Account');
  99  
 100  $smarty->assign("CALENDAR_LANG", $app_strings['LBL_JSCALENDAR_LANG']);
 101  $smarty->assign("CALENDAR_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
 102  
 103   $tabid = getTabid("Accounts");
 104   $validationData = getDBValidationData($focus->tab_name,$tabid);
 105   $data = split_validationdataArray($validationData);
 106  
 107   $smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']);
 108   $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
 109   $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
 110  
 111  $check_button = Button_Check($module);
 112  $smarty->assign("CHECK", $check_button);
 113   
 114  if ($focus->mode == 'edit')
 115  $smarty->display('salesEditView.tpl');
 116  else
 117  $smarty->display('CreateView.tpl');
 118  
 119  ?>
 120  


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