[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Users/ -> createrole.php (source)

   1  <?php
   2  
   3  /*********************************************************************************
   4  ** The contents of this file are subject to the vtiger CRM Public License Version 1.0
   5   * ("License"); You may not use this file except in compliance with the License
   6   * The Original Code is:  vtiger CRM Open Source
   7   * The Initial Developer of the Original Code is vtiger.
   8   * Portions created by vtiger are Copyright (C) vtiger.
   9   * All Rights Reserved.
  10  *
  11   ********************************************************************************/
  12  
  13  
  14  require_once ('include/database/PearDatabase.php');
  15  require_once ('include/utils/utils.php');
  16  
  17  
  18  global $adb;
  19  global $theme;
  20  $theme_path="themes/".$theme."/";
  21  $image_path=$theme_path."images/";
  22  $smarty = new vtigerCRM_Smarty;
  23  $profDetails=getAllProfileInfo();
  24  if(isset($_REQUEST['roleid']) && $_REQUEST['roleid'] != '')
  25  {    
  26      $roleid= $_REQUEST['roleid'];
  27      $mode = $_REQUEST['mode'];
  28      $roleInfo=getRoleInformation($roleid);
  29      $thisRoleDet=$roleInfo[$roleid];
  30      $rolename = $thisRoleDet[0]; 
  31      $parent = $thisRoleDet[3]; 
  32      //retreiving the vtiger_profileid
  33      $roleRelatedProfiles=getRoleRelatedProfiles($roleid);
  34  
  35  }
  36  elseif(isset($_REQUEST['parent']) && $_REQUEST['parent'] != '')
  37  {
  38      $mode = 'create';
  39      $parent=$_REQUEST['parent'];
  40  }
  41  $smarty->assign("MOD", return_module_language($current_language,'Settings'));
  42  $smarty->assign("IMAGE_PATH",$image_path);
  43  $smarty->assign("APP", $app_strings);
  44  $smarty->assign("CMOD", $mod_strings);
  45  
  46  $parentname=getRoleName($parent);
  47  $smarty->assign("RETURN_ACTION",$_REQUEST['returnaction']);            
  48  $smarty->assign("ROLEID",$roleid);            
  49  $smarty->assign("MODE",$mode);            
  50  $smarty->assign("PARENT",$parent);            
  51  $smarty->assign("PARENTNAME",$parentname);            
  52  $smarty->assign("ROLENAME",$rolename);            
  53  
  54  $profile_entries=array();
  55  foreach($profDetails as $profId=>$profName)
  56  {
  57      $profile_entries[]=$profId;
  58      $profile_entries[]=$profName;
  59  }
  60  $profile_entries=array_chunk($profile_entries,2);
  61  $smarty->assign("PROFILELISTS",$profile_entries);
  62  
  63  if($mode == 'edit')
  64  {
  65      $selected_profiles = array();
  66      foreach($roleRelatedProfiles as $relProfId => $relProfName)
  67      {
  68          $selected_profiles[]=$relProfId;
  69          $selected_profiles[]=$relProfName;
  70      }
  71      $selected_profiles=array_chunk($selected_profiles,2);
  72      $smarty->assign("SELPROFILELISTS",$selected_profiles);
  73  }
  74  
  75  $smarty->display("RoleEditView.tpl");
  76  ?>


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