[ Index ]
 

Code source de vtiger CRM 5.0.2

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

title

Body

[fermer]

/modules/Users/ -> RoleDetailView.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('themes/'.$theme.'/layout_utils.php');
  16  require_once ('include/utils/UserInfoUtil.php');
  17  require_once ('include/utils/utils.php');
  18  
  19  global $mod_strings;
  20  global $app_strings;
  21  global $app_list_strings;
  22  
  23  
  24  global $theme;
  25  $theme_path="themes/".$theme."/";
  26  $image_path=$theme_path."images/";
  27  require_once ($theme_path.'layout_utils.php');
  28  
  29  $smarty = new vtigerCRM_Smarty;
  30  $roleid= $_REQUEST['roleid'];
  31  
  32  /** gives the role info, role profile info and role user info details in an array  for the specified role id
  33    * @param $roleid -- role id:: Type integer
  34    * @returns $return_data -- array contains role info, role profile info and role user info. This array is used to construct the detail view for the specified role id :: Type varchar
  35    *
  36   */
  37  function getStdOutput($roleid)
  38  {
  39      //Retreiving the related vtiger_profiles
  40      $roleProfileArr=getRoleRelatedProfiles($roleid);
  41      //Retreving the related vtiger_users
  42      $roleUserArr=getRoleUsers($roleid);
  43  
  44      //Constructing the Profile list
  45      $profileinfo = Array();
  46      foreach($roleProfileArr as $profileId=>$profileName)
  47      {
  48          $profileinfo[]=$profileId;
  49          $profileinfo[]=$profileName;
  50          $profileList .= '<a href="index.php?module=Users&action=profilePrivileges&profileid='.$profileId.'">'.$profileName.'</a>';
  51      }
  52      $profileinfo=array_chunk($profileinfo,2);
  53      
  54      //Constructing the Users List
  55      $userinfo = Array();
  56      foreach($roleUserArr as $userId=>$userName)
  57      {
  58          $userinfo[]= $userId;
  59          $userinfo[]= $userName;
  60          $userList .= '<a href="index.php?module=Users&action=DetailView&record='.$userId.'">'.$userName.'</a>';
  61      }
  62      $userinfo=array_chunk($userinfo,2);
  63      
  64      //Check for Current User
  65      global $current_user;
  66      $current_role = fetchUserRole($current_user->id);
  67      $return_data = Array('profileinfo'=>$profileinfo,'userinfo'=>$userinfo);
  68      return $return_data;
  69  }
  70  
  71  if(isset($_REQUEST['roleid']) && $_REQUEST['roleid'] != '')
  72  {    
  73      $roleid= $_REQUEST['roleid'];
  74      $mode = $_REQUEST['mode'];
  75      $roleInfo=getRoleInformation($roleid);
  76      $thisRoleDet=$roleInfo[$roleid];
  77      $rolename = $thisRoleDet[0]; 
  78      $parent = $thisRoleDet[3]; 
  79      //retreiving the vtiger_profileid
  80      $roleRelatedProfiles=getRoleRelatedProfiles($roleid);
  81  
  82  }
  83  $parentname=getRoleName($parent);
  84  //Retreiving the Role Info
  85  $roleInfoArr=getRoleInformation($roleid);
  86  $rolename=$roleInfoArr[$roleid][0];
  87  $smarty->assign("ROLE_NAME",$rolename);
  88  $smarty->assign("ROLEID",$roleid);
  89  $smarty->assign("IMAGE_PATH",$image_path);
  90  $smarty->assign("MOD", return_module_language($current_language,'Settings'));
  91  $smarty->assign("APP", $app_strings);
  92  $smarty->assign("CMOD", $mod_strings);
  93  $smarty->assign("ROLEINFO",getStdOutput($roleid));
  94  $smarty->assign("PARENTNAME",$parentname);            
  95  
  96  
  97  $smarty->display("RoleDetailView.tpl");
  98  
  99  ?>


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