[Vtigercrm-commits] [vtiger-commits] r6162 - in /vtigercrm/trunk/modules/Users: DeleteRole.php RoleDeleteStep1.php RolePopup.php listroles.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu May 18 15:38:07 EDT 2006
Author: don
Date: Thu May 18 13:38:00 2006
New Revision: 6162
Log:
Role Popup in Delete done
Modified:
vtigercrm/trunk/modules/Users/DeleteRole.php
vtigercrm/trunk/modules/Users/RoleDeleteStep1.php
vtigercrm/trunk/modules/Users/RolePopup.php
vtigercrm/trunk/modules/Users/listroles.php
Modified: vtigercrm/trunk/modules/Users/DeleteRole.php
==============================================================================
--- vtigercrm/trunk/modules/Users/DeleteRole.php (original)
+++ vtigercrm/trunk/modules/Users/DeleteRole.php Thu May 18 13:38:00 2006
@@ -11,7 +11,7 @@
global $adb;
$del_id = $_REQUEST['delete_role_id'];
-$tran_id = $_REQUEST['transfer_role_id'];
+$tran_id = $_REQUEST['user_role'];
deleteRole($del_id,$tran_id);
Modified: vtigercrm/trunk/modules/Users/RoleDeleteStep1.php
==============================================================================
--- vtigercrm/trunk/modules/Users/RoleDeleteStep1.php (original)
+++ vtigercrm/trunk/modules/Users/RoleDeleteStep1.php Thu May 18 13:38:00 2006
@@ -14,53 +14,26 @@
require_once('include/database/PearDatabase.php');
require_once('include/utils/utils.php');
require_once('include/utils/UserInfoUtil.php');
+require_once('Smarty_setup.php');
$delete_role_id = $_REQUEST['roleid'];
$delete_role_name = getRoleName($delete_role_id);
+global $app_strings;
+global $app_list_strings;
+global $mod_strings;
+$smarty=new vtigerCRM_Smarty;
+$smarty->assign("APP", $app_strings);
+$smarty->assign("MOD", return_module_language($current_language,'Settings'));
+$smarty->assign("CMOD", $mod_strings);
+global $theme;
+$theme_path="themes/".$theme."/";
+$image_path=$theme_path."images/";
+$smarty->assign("IMAGE_PATH",$image_path);
-$output ='<div id="DeleteLay">
-<form name="newProfileForm" action="index.php">
-<input type="hidden" name="module" value="Users">
-<input type="hidden" name="action" value="DeleteRole">
-<input type="hidden" name="delete_role_id" value="'.$delete_role_id.'">
-<table width="100%" border="0" cellpadding="3" cellspacing="0">
-<tr>
- <td class="genHeaderSmall" align="left" style="border-bottom:1px solid #CCCCCC;" width="50%">Delete Role</td>
- <td style="border-bottom:1px solid #CCCCCC;"> </td>
- <td align="right" style="border-bottom:1px solid #CCCCCC;" width="40%"><a href="#" onClick="document.getElementById(\'DeleteLay\').style.display=\'none\'";>Close</a></td>
-</tr>
-<tr>
- <td colspan="3"> </td>
-</tr>
-<tr>
- <td width="50%"><b>Role to be Deteted</b></td>
- <td width="2%"><b>:</b></td>
- <td width="48%"><b>'.$delete_role_name.'</b></td>
-</tr>
-<tr>
- <td style="text-align:left;"><b>Transfer Users to Role</b></td>
- <td ><b>:</b></td>
- <td align="left">';
-
-$output.='<select class="select" name="transfer_role_id">';
- $allRoleDetails=getAllRoleDetails();
- foreach($allRoleDetails as $roleId=>$roleInfoArr)
- {
- if($delete_role_id != $roleId)
- {
- $output.='<option value="'.$roleId.'">'.$roleInfoArr[0].'</option>';
- }
- }
-$output.='</select>';
-$output.='</td>
-</tr>
-<tr><td colspan="3" style="border-bottom:1px dashed #CCCCCC;"> </td></tr>
-<tr>
- <td colspan="3" align="center"><input type="submit" name="Delete" value="'.$app_strings["LBL_SAVE_BUTTON_LABEL"].'" class="small">
- </td>
-</tr>
-</table>
-</form></div>';
+$smarty->assign("ROLEID", $delete_role_id);
+$smarty->assign("ROLENAME", $delete_role_name);
+$opt = '<a href="javascript:openPopup(\''.$delete_role_id.'\');"><img src="'.$image_path.'select.gif" border="0" align="absmiddle"></a>';
+$smarty->assign("ROLEPOPUPBUTTON", $opt);
+$smarty->display("DeleteRole.tpl");
-echo $output;
?>
Modified: vtigercrm/trunk/modules/Users/RolePopup.php
==============================================================================
--- vtigercrm/trunk/modules/Users/RolePopup.php (original)
+++ vtigercrm/trunk/modules/Users/RolePopup.php Thu May 18 13:38:00 2006
@@ -82,16 +82,19 @@
$query = "select * from role";
$result = $adb->query($query);
$num_rows=$adb->num_rows($result);
+$mask_roleid='';
+$mask_roleid=$_REQUEST['maskid'];
$roleout ='';
-$roleout .= indent($hrarray,$roleout,$role_det);
-function indent($hrarray,$roleout,$role_det)
+$roleout .= indent($hrarray,$roleout,$role_det,$mask_roleid);
+function indent($hrarray,$roleout,$role_det,$mask_roleid='')
{
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
foreach($hrarray as $roleid => $value)
{
+
//retreiving the role details
$role_det_arr=$role_det[$roleid];
$roleid_arr=$role_det_arr[2];
@@ -109,7 +112,7 @@
else{
$roleout .= '<img src="'.$image_path.'/menu_root.gif" id="img_'.$roleid.'" border="0" alt="Root" title="Root" align="absmiddle">';
}
- if($roledepth ==0){
+ if($roledepth == 0 || $mask_roleid == $roleid){
$roleout .= ' <b class="genHeaderGray">'.$rolename.'</b>';
}
else{
@@ -118,7 +121,7 @@
$roleout .= '</li>';
if(sizeof($value) > 0 )
{
- $roleout = indent($value,$roleout,$role_det);
+ $roleout = indent($value,$roleout,$role_det,$mask_roleid);
}
$roleout .= '</ul>';
Modified: vtigercrm/trunk/modules/Users/listroles.php
==============================================================================
--- vtigercrm/trunk/modules/Users/listroles.php (original)
+++ vtigercrm/trunk/modules/Users/listroles.php Thu May 18 13:38:00 2006
@@ -101,8 +101,6 @@
$result = $adb->query($query);
$num_rows=$adb->num_rows($result);
-
-
$roleout='';
indent($hrarray,$roleout,$role_det);
function indent($hrarray,$roleout,$role_det)
@@ -130,7 +128,7 @@
echo '<td style="width:5px"></td>';
if(! $roledepth == 0)
{
- echo '<td valign=top><span id="'.$roleid.'tools" style="display:block"> <a href="index.php?module=Users&action=createrole&parenttab=Settings&parent='.$roleid.'">Add</a> | <a href="index.php?module=Users&action=createrole&roleid='.$roleid.'&parenttab=Settings&mode=edit">Edit</a> | <a href="#" onclick="DeleteRole(\''.$roleid.'\')">Delete</a> | <a href="index.php?module=Users&action=RoleDetailView&parenttab=Settings&roleid='.$roleid.'">View</a></span></td>';
+ echo '<td valign=top><span id="'.$roleid.'tools" style="display:block"> <a href="index.php?module=Users&action=createrole&parenttab=Settings&parent='.$roleid.'">Add</a> | <a href="index.php?module=Users&action=createrole&roleid='.$roleid.'&parenttab=Settings&mode=edit">Edit</a> | <a href="index.php?module=Users&action=RoleDeleteStep1&roleid='.$roleid.'&parenttab=Settings">Delete</a> | <a href="index.php?module=Users&action=RoleDetailView&parenttab=Settings&roleid='.$roleid.'">View</a></span></td>';
}
else
{
More information about the vtigercrm-commits
mailing list