[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Vendors/ -> EditView.php (source)

   1  <?php
   2  /*********************************************************************************
   3  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
   4   * ("License"); You may not use this file except in compliance with the License
   5   * The Original Code is:  vtiger CRM Open Source
   6   * The Initial Developer of the Original Code is vtiger.
   7   * Portions created by vtiger are Copyright (C) vtiger.
   8   * All Rights Reserved.
   9  *
  10   ********************************************************************************/
  11  require_once ('Smarty_setup.php');
  12  require_once ('include/database/PearDatabase.php');
  13  require_once ('include/utils/utils.php');
  14  require_once ('modules/Vendors/Vendors.php');
  15  require_once ('include/FormValidationUtil.php');
  16  
  17  global $app_strings,$mod_strings,$theme,$currentModule;
  18  
  19  $focus = new Vendors();
  20  $smarty = new vtigerCRM_Smarty();
  21  
  22  if(isset($_REQUEST['record']) && $_REQUEST['record'] != '') 
  23  {
  24      $focus->id = $_REQUEST['record'];
  25      $focus->mode = 'edit';     
  26      $focus->retrieve_entity_info($_REQUEST['record'],"Vendors");
  27      $focus->name = $focus->column_fields['vendorname'];
  28  }
  29  if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') 
  30  {
  31      $focus->id = "";
  32          $focus->mode = '';     
  33  } 
  34  
  35  $theme_path="themes/".$theme."/";
  36  $image_path=$theme_path."images/";
  37  require_once ($theme_path.'layout_utils.php');
  38  
  39  $disp_view = getView($focus->mode);
  40  if($disp_view == 'edit_view')
  41      $smarty->assign("BLOCKS",getBlocks($currentModule,$disp_view,$mode,$focus->column_fields));
  42  else    
  43  {
  44      $bas_block = getBlocks($currentModule,$disp_view,$mode,$focus->column_fields,'BAS');
  45      $adv_block = getBlocks($currentModule,$disp_view,$mode,$focus->column_fields,'ADV');
  46  
  47      $blocks['basicTab'] = $bas_block;
  48      if(is_array($adv_block ))
  49          $blocks['moreTab'] = $adv_block;
  50  
  51      $smarty->assign("BLOCKS",$blocks);
  52      $smarty->assign("BLOCKS_COUNT",count($blocks));
  53  }
  54  $smarty->assign("OP_MODE",$disp_view);
  55  
  56  $smarty->assign("MODULE",$currentModule);
  57  $smarty->assign("SINGLE_MOD",'Vendor');
  58  
  59  $smarty->assign("MOD", $mod_strings);
  60  $smarty->assign("APP", $app_strings);
  61  
  62  $smarty->assign("ID", $focus->id);
  63  if(isset($focus->name))
  64          $smarty->assign("NAME", $focus->name);
  65  
  66  if(isset($cust_fld))
  67  {
  68          $smarty->assign("CUSTOMFIELD", $cust_fld);
  69  }
  70  
  71  $smarty->assign("CALENDAR_LANG", $app_strings['LBL_JSCALENDAR_LANG']);
  72  $smarty->assign("CALENDAR_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT']));
  73  if($focus->mode == 'edit')
  74  {
  75      $smarty->assign("UPDATEINFO",updateInfo($focus->id));
  76          $smarty->assign("MODE", $focus->mode);
  77  }
  78  
  79  if(isset($_REQUEST['return_module'])) $smarty->assign("RETURN_MODULE", $_REQUEST['return_module']);
  80  if(isset($_REQUEST['return_action'])) $smarty->assign("RETURN_ACTION", $_REQUEST['return_action']);
  81  if(isset($_REQUEST['return_id'])) $smarty->assign("RETURN_ID", $_REQUEST['return_id']);
  82  if(isset($_REQUEST['return_viewname'])) $smarty->assign("RETURN_VIEWNAME", $_REQUEST['return_viewname']);
  83  $smarty->assign("THEME", $theme);
  84  $smarty->assign("IMAGE_PATH", $image_path);$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
  85  
  86  $tabid = getTabid("Vendors");
  87  $validationData = getDBValidationData($focus->tab_name,$tabid);
  88  $data = split_validationdataArray($validationData);
  89  $category = getParentTab();
  90  $smarty->assign("CATEGORY",$category);
  91  $smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']);
  92  $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
  93  $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
  94  
  95  
  96  $check_button = Button_Check($module);
  97  $smarty->assign("CHECK", $check_button);
  98  
  99  if($focus->mode == 'edit')
 100      $smarty->display('Inventory/InventoryEditView.tpl');
 101  else
 102      $smarty->display('Inventory/InventoryCreateView.tpl');
 103  
 104  ?>


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