[ Index ] |
|
Code source de vtiger CRM 5.0.2 |
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 global $adb; 18 global $theme; 19 $theme_path="themes/".$theme."/"; 20 $image_path=$theme_path."images/"; 21 $smarty = new vtigerCRM_Smarty; 22 $Err_msg; 23 $parentGroupArray=Array(); 24 if(isset($_REQUEST['groupId']) && $_REQUEST['groupId'] != '') 25 { 26 $mode = 'edit'; 27 $groupId=$_REQUEST['groupId']; 28 $groupInfo=getGroupInfo($groupId); 29 require_once ('include/utils/GetParentGroups.php'); 30 $parGroups = new GetParentGroups(); 31 $parGroups->parent_groups[]=$groupId; 32 $parGroups->getAllParentGroups($groupId); 33 $parentGroupArray=$parGroups->parent_groups; 34 35 36 } 37 else 38 { 39 $mode = 'create'; 40 if(isset($_REQUEST['error']) && ($_REQUEST['error']=='true')) 41 { 42 $Err_msg = "<center><font color='red'><b>".$mod_strings['LBL_GROUP_NAME_ERROR']."</b></font></center>"; 43 $groupInfo[] = $_REQUEST['groupname']; 44 $groupInfo[] = $_REQUEST['desc']; 45 } 46 } 47 48 49 //Constructing the Role Array 50 $roleDetails=getAllRoleDetails(); 51 $i=0; 52 $roleIdStr=""; 53 $roleNameStr=""; 54 $userIdStr=""; 55 $userNameStr=""; 56 $grpIdStr=""; 57 $grpNameStr=""; 58 59 foreach($roleDetails as $roleId=>$roleInfo) 60 { 61 if($i !=0) 62 { 63 if($i !=1) 64 { 65 $roleIdStr .= ", "; 66 $roleNameStr .= ", "; 67 } 68 69 $roleName=$roleInfo[0]; 70 $roleIdStr .= "'".$roleId."'"; 71 $roleNameStr .= "'".$roleName."'"; 72 } 73 74 $i++; 75 } 76 77 //Constructing the User Array 78 $l=0; 79 $userDetails=getAllUserName(); 80 foreach($userDetails as $userId=>$userInfo) 81 { 82 if($l !=0) 83 { 84 $userIdStr .= ", "; 85 $userNameStr .= ", "; 86 } 87 88 $userIdStr .= "'".$userId."'"; 89 $userNameStr .= "'".$userInfo."'"; 90 91 $l++; 92 } 93 94 //Constructing the Group Array 95 $m=0; 96 $grpDetails=getAllGroupName(); 97 foreach($grpDetails as $grpId=>$grpName) 98 { 99 if(! in_array($grpId,$parentGroupArray)) 100 { 101 if($m !=0) 102 { 103 $grpIdStr .= ", "; 104 $grpNameStr .= ", "; 105 } 106 107 $grpIdStr .= "'".$grpId."'"; 108 $grpNameStr .= "'".$grpName."'"; 109 110 $m++; 111 } 112 } 113 if($mode == 'edit') 114 { 115 $member=array(); 116 $groupMemberArr=$groupInfo[2]; 117 foreach($groupMemberArr as $memberType=>$memberValue) 118 { 119 foreach($memberValue as $memberId) 120 { 121 if($memberType == 'groups') 122 { 123 $memberName=fetchGroupName($memberId); 124 $memberDisplay="Group::"; 125 } 126 elseif($memberType == 'roles') 127 { 128 $memberName=getRoleName($memberId); 129 $memberDisplay="Roles::"; 130 } 131 elseif($memberType == 'rs') 132 { 133 $memberName=getRoleName($memberId); 134 $memberDisplay="RoleAndSubordinates::"; 135 } 136 elseif($memberType == 'users') 137 { 138 $memberName=getUserName($memberId); 139 $memberDisplay="User::"; 140 } 141 $member[]=$memberType.'::'.$memberId; 142 $member[]=$memberDisplay.$memberName; 143 } 144 } 145 $smarty->assign("MEMBER", array_chunk($member,2)); 146 } 147 $smarty->assign("MOD", return_module_language($current_language,'Settings')); 148 $smarty->assign("IMAGE_PATH",$image_path); 149 $smarty->assign("APP", $app_strings); 150 $smarty->assign("CMOD", $mod_strings); 151 152 //for javascript 153 $smarty->assign("ROLEIDSTR",$roleIdStr); 154 $smarty->assign("ROLENAMESTR",$roleNameStr); 155 $smarty->assign("USERIDSTR",$userIdStr); 156 $smarty->assign("USERNAMESTR",$userNameStr); 157 $smarty->assign("GROUPIDSTR",$grpIdStr); 158 $smarty->assign("GROUPNAMESTR",$grpNameStr); 159 160 $smarty->assign("RETURN_ACTION",$_REQUEST['returnaction']); 161 $smarty->assign("GROUPID",$groupId); 162 $smarty->assign("MODE",$mode); 163 164 165 166 //echo $Err_msg; 167 168 $smarty->assign("GROUPNAME",$groupInfo[0]); 169 170 171 $smarty->assign("DESCRIPTION",$groupInfo[1]); 172 173 174 $smarty->display("GroupEditView.tpl"); 175 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 10:22:19 2007 | par Balluche grâce à PHPXref 0.7 |