[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Leads/ -> 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  require_once ('Smarty_setup.php');
  16  require_once ('data/Tracker.php');
  17  require_once ('modules/Leads/Leads.php');
  18  require_once ('include/database/PearDatabase.php');
  19  require_once ('include/CustomFieldUtil.php');
  20  require_once ('include/ComboUtil.php');
  21  require_once ('include/utils/utils.php');
  22  require_once ('include/FormValidationUtil.php');
  23  
  24  global $mod_strings,$app_strings,$theme,$currentModule;
  25  
  26  $focus = new Leads();
  27  $smarty = new vtigerCRM_Smarty;
  28  
  29  if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {
  30      $focus->id = $_REQUEST['record'];
  31      $focus->mode = 'edit';     
  32      $focus->retrieve_entity_info($_REQUEST['record'],"Leads");        
  33      $focus->firstname=$focus->column_fields['firstname'];
  34      $focus->lastname=$focus->column_fields['lastname'];
  35  }
  36  if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
  37      $focus->id = "";
  38          $focus->mode = '';     
  39  }
  40  
  41  $disp_view = getView($focus->mode);
  42  if($disp_view == 'edit_view')
  43      $smarty->assign("BLOCKS",getBlocks($currentModule,$disp_view,$mode,$focus->column_fields));    
  44  else
  45  {
  46      $smarty->assign("BASBLOCKS",getBlocks($currentModule,$disp_view,$mode,$focus->column_fields,'BAS'));
  47      $smarty->assign("ADVBLOCKS",getBlocks($currentModule,$disp_view,$mode,$focus->column_fields,'ADV'));
  48  }
  49  $smarty->assign("OP_MODE",$disp_view);
  50  
  51  
  52  $theme_path="themes/".$theme."/";
  53  $image_path=$theme_path."images/";
  54  //retreiving the combo values array
  55  
  56  $smarty->assign("MOD", $mod_strings);
  57  $smarty->assign("APP", $app_strings);
  58   
  59  $category = getParentTab();
  60  $smarty->assign("CATEGORY",$category);
  61  
  62  $smarty->assign("NAME",$focus->lastname.' '.$focus->firstname);
  63  
  64  if(isset($cust_fld))
  65  {
  66      $smarty->assign("CUSTOMFIELD", $cust_fld);
  67  }
  68  if($focus->mode == 'edit')
  69  {
  70      $smarty->assign("UPDATEINFO",updateInfo($focus->id));
  71      $smarty->assign("MODE", $focus->mode);
  72  }        
  73  
  74  if(isset($_REQUEST['campaignid']))
  75  $smarty->assign("campaignid",$_REQUEST['campaignid']);
  76  if (isset($_REQUEST['return_module'])) 
  77  $smarty->assign("RETURN_MODULE", $_REQUEST['return_module']);
  78  else 
  79  $smarty->assign("RETURN_MODULE","Leads");
  80  if (isset($_REQUEST['return_action'])) 
  81  $smarty->assign("RETURN_ACTION", $_REQUEST['return_action']);
  82  else 
  83  $smarty->assign("RETURN_ACTION","index");
  84  if (isset($_REQUEST['return_id'])) 
  85  $smarty->assign("RETURN_ID", $_REQUEST['return_id']);
  86  if (isset($_REQUEST['return_viewname'])) 
  87  $smarty->assign("RETURN_VIEWNAME", $_REQUEST['return_viewname']);
  88  $smarty->assign("THEME", $theme);
  89  $smarty->assign("IMAGE_PATH", $image_path);$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id());
  90  $smarty->assign("ID", $focus->id);
  91  $smarty->assign("MODULE",$currentModule);
  92  $smarty->assign("SINGLE_MOD",'Lead');
  93  
  94  
  95  $smarty->assign("HEADER", get_module_title("Leads", "{MOD.LBL_LEAD}  ".$focus->firstname." ".$focus->lastname, true));
  96  //create the html select code here and assign it
  97  $smarty->assign("CALENDAR_LANG", $app_strings['LBL_JSCALENDAR_LANG']);
  98  $smarty->assign("CALENDAR_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
  99  
 100  
 101   $tabid = getTabid("Leads");
 102   $validationData = getDBValidationData($focus->tab_name,$tabid);
 103   $data = split_validationdataArray($validationData);
 104  
 105   $smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']);
 106   $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
 107   $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
 108  
 109  $check_button = Button_Check($module);
 110  $smarty->assign("CHECK", $check_button);
 111  
 112  if($focus->mode == 'edit')
 113  $smarty->display("salesEditView.tpl");
 114  else
 115  $smarty->display("CreateView.tpl");
 116  
 117  
 118  ?>


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