[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Users/ -> 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/Users/EditView.php,v 1.16 2005/04/19 14:44:02 ray 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/Users/Users.php');
  26  require_once ('include/utils/UserInfoUtil.php');
  27  require_once ('modules/Users/Forms.php');
  28  require_once ('include/database/PearDatabase.php');
  29  require_once ('modules/Calendar/OpenListView.php');
  30  require_once ('modules/Leads/ListViewTop.php');
  31  
  32  global $app_strings;
  33  global $app_list_strings;
  34  global $mod_strings;
  35  global $currentModule;
  36  
  37  
  38  $smarty=new vtigerCRM_Smarty;
  39  $focus = new Users();
  40  
  41  if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {
  42      $smarty->assign("ID",$_REQUEST['record']);
  43      $mode='edit';
  44      if (!is_admin($current_user) && $_REQUEST['record'] != $current_user->id) die ("Unauthorized access to user administration.");
  45      $focus->retrieve_entity_info($_REQUEST['record'],'Users');
  46      $smarty->assign("USERNAME",$focus->last_name.' '.$focus->first_name);
  47  }else
  48  {
  49      $mode='create';
  50  }
  51  
  52  if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
  53      $focus->id = "";
  54      $focus->user_name = "";
  55      $mode='create';
  56  
  57      //When duplicating the user the password fields should be empty
  58      $focus->column_fields['user_password']='';
  59      $focus->column_fields['confirm_password']='';
  60  }
  61  
  62  global $theme;
  63  $theme_path="themes/".$theme."/";
  64  $image_path=$theme_path."images/";
  65  require_once ($theme_path.'layout_utils.php');
  66  
  67  $log->info("User edit view");
  68  
  69  
  70  $smarty->assign("JAVASCRIPT", get_validate_record_js());
  71  $smarty->assign("UMOD", $mod_strings);
  72  global $current_language;
  73  $smod_strings = return_module_language($current_language,'Settings');
  74  $smarty->assign("MOD", $smod_strings);
  75  $smarty->assign("CURRENT_USERID", $current_user->id);
  76  $smarty->assign("APP", $app_strings);
  77  
  78  if (isset($_REQUEST['error_string'])) $smarty->assign("ERROR_STRING", "<font class='error'>Error: ".$_REQUEST['error_string']."</font>");
  79  if (isset($_REQUEST['return_module']))
  80  {
  81          $smarty->assign("RETURN_MODULE", $_REQUEST['return_module']);
  82          $RETURN_MODULE=$_REQUEST['return_module'];
  83  }
  84  if (isset($_REQUEST['return_action']))
  85  {
  86          $smarty->assign("RETURN_ACTION", $_REQUEST['return_action']);
  87          $RETURN_ACTION = $_REQUEST['return_action'];
  88  }
  89  if ($_REQUEST['isDuplicate'] != 'true' && isset($_REQUEST['return_id']))
  90  {
  91          $smarty->assign("RETURN_ID", $_REQUEST['return_id']);
  92          $RETURN_ID = $_REQUEST['return_id'];
  93  }
  94  
  95  $smarty->assign("IMAGE_PATH", $image_path);$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
  96  $focus->mode = $mode;
  97  $disp_view = getView($focus->mode);
  98  $smarty->assign("BLOCKS",getBlocks($currentModule,$disp_view,$mode,$focus->column_fields));    
  99  $smarty->assign("MODULE", 'Settings');
 100  $smarty->assign("MODE",$focus->mode);
 101  if ($_REQUEST['Edit'] == ' Edit ')
 102  {
 103      $smarty->assign("READONLY", "readonly");
 104      $smarty->assign("USERNAME_READONLY", "readonly");
 105      
 106  }    
 107  if(isset($_REQUEST['record']) && $_REQUEST['isDuplicate'] != 'true')
 108  {
 109      $smarty->assign("USERNAME_READONLY", "readonly");
 110  }
 111  
 112  $smarty->assign("HOMEORDER",$focus->getHomeOrder($focus->id));
 113  
 114  
 115  
 116  $smarty->assign('PARENTTAB',$_REQUEST['parenttab']);
 117  
 118  $smarty->display('UserEditView.tpl');
 119  
 120  ?>


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