[Vtigercrm-commits] [vtiger-commits] r7427 - in /vtigercrm/trunk: Smarty/templates/CreateProfile.tpl Smarty/templates/EditProfile.tpl Smarty/templates/ProfileDetailView.tpl modules/Users/CreateProfile.php modules/Users/profilePrivileges.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Jun 22 07:55:31 EDT 2006


Author: saraj
Date: Thu Jun 22 05:55:20 2006
New Revision: 7427

Log:
new UI integrated for profiles

Modified:
    vtigercrm/trunk/Smarty/templates/CreateProfile.tpl
    vtigercrm/trunk/Smarty/templates/EditProfile.tpl
    vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl
    vtigercrm/trunk/modules/Users/CreateProfile.php
    vtigercrm/trunk/modules/Users/profilePrivileges.php

Modified: vtigercrm/trunk/Smarty/templates/CreateProfile.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/CreateProfile.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/CreateProfile.tpl Thu Jun 22 05:55:20 2006
@@ -9,73 +9,169 @@
   *
  ********************************************************************************/
 -->*}
-<script language="JavaScript" type="text/javascript" src="include/js/menu.js"></script>
-<style type="text/css">@import url(themes/blue/style.css);</style>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-		<tr>
-		{include file='SettingsMenu.tpl'}
-				<td width="75%" valign="top">
-						<form action="index.php" method="post" name="profileform" id="form">
-						<input type="hidden" name="module" value="Users">
-						<input type="hidden" name="mode" value="{$MODE}">
-						<input type="hidden" name="action" value="CreateProfile1">
-						<input type="hidden" name="parenttab" value="Settings">
-						<input type="hidden" name="parent_profile" value="{$PARENT_PROFILE}">
-						<input type="hidden" name="radio_button" value="{$RADIO_BUTTON}">
-						<input type="hidden" name="profile_name" value="{$PROFILE_NAME}">
-						<table width="95%" border="0" cellpadding="0" cellspacing="0"  align="center">
-							<tr>
-										<td class="showPanelBg" valign="top" width="100%" colspan="3" style="padding-left:20px; "><br />
-													<span class="lvtHeaderText">
-															<b><a href="index.php?module=Settings&action=index&parenttab=Settings">{$MOD.LBL_SETTINGS} </a> > {$MOD.LBL_USER_MANAGEMENT} > {$MOD.LBL_PROFILES}</b></span>
-																<hr noshade="noshade" size="1" />
-										</td>
-							</tr>
-							<tr>
-										<td  valign="top" class="leadTable">
-													<table width="100%" border="0" cellpadding="5" cellspacing="0">
-														<tr>
-																<td width="5%" style="border-bottom:1px dashed #CCCCCC;">
-																		<img src="{$IMAGE_PATH}profile.gif" align="absmiddle">
-																</td>
-																<td style="border-bottom:1px dashed #CCCCCC;"> 
-																		<span class="genHeaderGrayBig">{$CMOD.LBL_BASIC_PROFILE_DETAILS}</span><br>
-																		<span	class="genHeaderSmall">{$CMOD.LBL_STEP_1_3}</span>
-
-																</td>
-														</tr>
-													</table>
-													<table width="95%" border="0" cellpadding="5" cellspacing="0" align="center">
-															<tr><td colspan="2">&nbsp;</td></tr>
-															<tr>
-																	<td align="right" width="25%" style="padding-right:10px;">
-																			<b style="color:#FF0000;font-size:16px;">{$APP.LBL_REQUIRED_SYMBOL}</b>&nbsp;<b>{$CMOD.LBL_NEW_PROFILE_NAME} : </b></td>
-																	<td width="75%" align="left" style="padding-left:10px;">
-																			<input type="text" name="profile_name" id="pobox" value="{$PROFILENAME}" class="txtBox" /></td>
-															</tr>
-															<tr><td colspan="2">&nbsp;</td></tr>
-															<tr>
-																	<td align="right" style="padding-right:10px;" valign="top"><b>{$CMOD.LBL_DESCRIPTION} : </b></td>
-																	<td align="left" style="padding-left:10px;"><textarea name="profile_description" class="txtBox">{$PROFILEDESC}</textarea></td>
-															</tr>
-															<tr><td colspan="2" style="border-bottom:1px dashed #CCCCCC;" height="75">&nbsp;</td></tr>
-															<tr>
-																	<td colspan="2" align="right">
-																					<input type="button" value=" &lsaquo; {$APP.LBL_BACK} " name="back" class="classBtnDisable" disabled />&nbsp;&nbsp;
-																					<input type="button" value=" {$APP.LNK_LIST_NEXT} &rsaquo; " class="classBtn" name="Next" onClick="rolevalidate();"/>&nbsp;&nbsp;
-																					<input type="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " title="{$APP.LBL_CANCEL_BUTTON_TITLE}" name="Cancel" onClick="window.history.back()"; class="classBtn"/>
-																	</td>
-															</tr>
-															
-												</table>
-										</td>
-									</tr>
-				</table></form>
-		</td>
-	</tr>
+
+<script language="JAVASCRIPT" type="text/javascript" src="include/js/smoothscroll.js"></script>
+
+<br>
+<table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
+<tbody><tr>
+        <td valign="top"><img src="{$IMAGE_PATH}showPanelTopLeft.gif"></td>
+        <td class="showPanelBg" style="padding: 10px;" valign="top" width="100%">
+	<br>
+	<div align=center>
+				{include file='SetMenu.tpl'}
+				<form action="index.php" method="post" name="profileform" id="form">
+                                <input type="hidden" name="module" value="Users">
+                                <input type="hidden" name="mode" value="{$MODE}">
+                                <input type="hidden" name="action" value="profilePrivileges">
+                                <input type="hidden" name="parenttab" value="Settings">
+                                <input type="hidden" name="parent_profile" value="{$PARENT_PROFILE}">
+                                <input type="hidden" name="radio_button" value="{$RADIO_BUTTON}">
+	
+				<!-- DISPLAY -->
+				<table border=0 cellspacing=0 cellpadding=5 width=100% class="settingsSelUITopLine">
+				<tr>
+					<td width=50 rowspan=2 valign=top><img src="{$IMAGE_PATH}ico-profile.gif" alt="{$MOD.LBL_PROFILES}" width="48" height="48" border=0 title="{$MOD.LBL_PROFILES}"></td>
+					<td class=heading2 valign=bottom><b> <a href="index.php?module=Settings&action=index&parenttab=Settings">{$MOD.LBL_SETTINGS}</a> > <a href="index.php?module=Users&action=ListProfiles&parenttab=Settings">{$CMOD.LBL_PROFILE_PRIVILEGES}</a></b></td>
+				</tr>
+				<tr>
+					<td valign=top class="small">{$MOD.LBL_PROFILE_DESCRIPTION}</td>
+				</tr>
+				</table>
+				
+				
+				<table border=0 cellspacing=0 cellpadding=10 width=100% >
+				<tr>
+					<td valign="top">
+					<table border="0" cellpadding="0" cellspacing="0" width="100%">
+		                      	<tbody><tr>
+                			     <td>
+						<table border="0" cellpadding="0" cellspacing="0" width="100%">
+			                        <tbody><tr class="small">
+		                              <td><img src="{$IMAGE_PATH}prvPrfTopLeft.gif"></td>
+               			               <td class="prvPrfTopBg" width="100%"></td>
+		                              <td><img src="{$IMAGE_PATH}prvPrfTopRight.gif"></td>
+
+                	            </tr>
+                          </tbody></table>
+                            <table class="prvPrfOutline" border="0" cellpadding="0" cellspacing="0" width="100%">
+                              <tbody>
+				<tr>
+                                              <td><!-- Module name heading -->
+                                                  <table class="small" border="0" cellpadding="2" cellspacing="0">
+                                                    <tbody><tr>
+                                                      <td valign="top"><img src="{$IMAGE_PATH}prvPrfHdrArrow.gif"> </td>
+                                                      <td class="prvPrfBigText"><b> {$CMOD.LBL_STEP_1_2} : {$CMOD.LBL_WELCOME_PROFILE_CREATE} </b><br>
+                                                          <font class="small"> {$CMOD.LBL_SELECT_CHOICE_NEW_PROFILE} </font> </td>
+
+                                                      <td class="small" style="padding-left: 10px;" align="right"></td>
+                                                    </tr>
+                                                </tbody></table></td>
+                                              <td align="right" valign="bottom">&nbsp;											  </td>
+                                            </tr>
+				<tr>
+                                <td><!-- tabs -->
+					<table width="95%" border="0" cellpadding="5" cellspacing="0" align="center">
+					<tr><td colspan="2">&nbsp;</td></tr>
+					<tr>
+						<td align="right" width="25%" style="padding-right:10px;">
+						<b style="color:#FF0000;font-size:16px;">{$APP.LBL_REQUIRED_SYMBOL}</b>&nbsp;<b>{$CMOD.LBL_NEW_PROFILE_NAME} : </b></td>
+						<td width="75%" align="left" style="padding-left:10px;">
+						<input type="text" name="profile_name" id="pobox" value="{$PROFILENAME}" class="txtBox" /></td>
+					</tr>
+					<tr><td colspan="2">&nbsp;</td></tr>
+					<tr>
+						<td align="right" style="padding-right:10px;" valign="top"><b>{$CMOD.LBL_DESCRIPTION} : </b></td>
+						<td align="left" style="padding-left:10px;"><textarea name="profile_description" class="txtBox">{$PROFILEDESC}</textarea></td>
+					</tr>
+					<tr><td colspan="2" style="border-bottom:1px dashed #CCCCCC;" height="75">&nbsp;</td></tr>
+					<tr>
+						<td align="right" width="10%" style="padding-right:10px;">
+						{if  $RADIO_BUTTON neq 'newprofile'}
+						<input name="radiobutton" checked type="radio" value="baseprofile" />
+						{else}
+						<input name="radiobutton" type="radio"  value="baseprofile" />
+						{/if}
+						</td>
+						<td width="90%" align="left" style="padding-left:10px;">{$CMOD.LBL_BASE_PROFILE_MESG}</td>
+					</tr>
+					<tr>
+						<td align="right"  style="padding-right:10px;">&nbsp;</td>
+						<td align="left" style="padding-left:10px;">{$CMOD.LBL_BASE_PROFILE}
+						<select name="parentprofile" class="importBox">
+							{foreach item=combo from=$PROFILE_LISTS}
+							{if $PARENT_PROFILE eq $combo.1}
+								<option  selected value="{$combo.1}">{$combo.0}</option>
+							{else}
+								<option value="{$combo.1}">{$combo.0}</option>	
+							{/if}
+							{/foreach}
+						</select>
+						</td>
+					</tr>
+					<tr><td colspan="2">&nbsp;</td></tr>
+					<tr><td align="center" colspan="2"><b>(&nbsp;{$CMOD.LBL_OR}&nbsp;)</b></td></tr>
+					<tr><td colspan="2">&nbsp;</td></tr>
+					<tr>
+						<td align="right" style="padding-right:10px;">
+						{if  $RADIO_BUTTON eq 'newprofile'}
+						<input name="radiobutton" checked type="radio" value="newprofile" />
+						{else}
+						<input name="radiobutton" type="radio" value="newprofile" />
+						{/if}
+						</td>
+						<td  align="left" style="padding-left:10px;">{$CMOD.LBL_BASE_PROFILE_MESG_ADV}</td>
+					</tr>
+					<tr><td colspan="2" style="border-bottom:1px dashed #CCCCCC;" height="75">&nbsp;</td></tr>
+					<tr>
+						<td colspan="2" align="right">
+						<input type="button" value=" {$APP.LNK_LIST_NEXT} &rsaquo; " name="Next" class="crmButton small" onClick="rolevalidate();"/>&nbsp;&nbsp;
+						<input type="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " title="{$APP.LBL_CANCEL_BUTTON_TITLE}" name="Cancel" onClick="window.history.back();" class="crmButton small cancel"/>
+						</td>
+					</tr>
+					</table>
+
+                                </td></tr>  	  
+                            	<table class="small" border="0" cellpadding="0" cellspacing="0" width="100%">
+                              	<tbody><tr>
+                                <td><img src="{$IMAGE_PATH}prvPrfBottomLeft.gif"></td>
+                                <td class="prvPrfBottomBg" width="100%"></td>
+                                <td><img src="{$IMAGE_PATH}prvPrfBottomRight.gif"></td>
+                              </tr>
+                          </tbody></table></td>
+                      </tr>
+                    </tbody></table>
+
+					<p>&nbsp;</p>
+					<table border="0" cellpadding="5" cellspacing="0" width="100%">
+					<tbody><tr><td class="small" align="right" nowrap="nowrap"><a href="#top">Scroll to Top</a></td></tr>
+					</tbody></table>
+				
+				
+					
+					
+					
+					
+					
+				</td>
+				</table>
+
+
+
+				</td>
+				</tr>
+				</table>
+				</td>
+				</tr>
+				</table>
+
+				</div>
+				</td>
+				<td valign="top"><img src="{$IMAGE_PATH}showPanelTopRight.gif"></td>
+				</form>
+   </tr>
+</tbody>
 </table>
-
-	{include file='SettingsSubMenu.tpl'}
 <script>
 function rolevalidate()
 {ldelim}
@@ -97,7 +193,7 @@
 		'index.php',
 		{ldelim}queue: {ldelim}position: 'end', scope: 'command'{rdelim},
 			method: 'post',
-			postBody: 'module=Users&action=UsersAjax&file=CreateProfile1&ajax=true&dup_check=true&profile_name='+profilename,
+			postBody: 'module=Users&action=UsersAjax&file=CreateProfile&ajax=true&dup_check=true&profile_name='+profilename,
 			onComplete: function(response) {ldelim}
 					if(response.responseText == 'SUCESS')
 						document.profileform.submit();

Modified: vtigercrm/trunk/Smarty/templates/EditProfile.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/EditProfile.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/EditProfile.tpl Thu Jun 22 05:55:20 2006
@@ -9,509 +9,429 @@
   *
  ********************************************************************************/
 -->*}
-<script language="JavaScript" type="text/javascript" src="include/js/menu.js"></script>
-<style type="text/css">@import url(themes/blue/style.css);</style>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-		<tr>
-				{include file='SettingsMenu.tpl'}
-				<td width="75%" valign="top">
-						<table width="100%" border="0" cellpadding="0" cellspacing="0" height="100%">
-								<tr>
-										<td class="showPanelBg" valign="top" width="100%" colspan="3" style="padding-left:20px; "><br />
-												<span class="lvtHeaderText"><b>
-														<a href="index.php?module=Settings&action=index&parenttab=Settings">{$MOD.LBL_SETTINGS} </a> 
-														> {$MOD.LBL_USER_MANAGEMENT} > {$MOD.LBL_PROFILES}</b></span>
-														<hr noshade="noshade" size="1" />
-										</td>
-								</tr>
-								<tr>
-									{if $MODE neq "edit"}
-										<td  valign="top" class="leadTable" >
-												<table width="95%" border="0" cellpadding="5" cellspacing="0" align="center">
-												
-														<tr>
-															<td width="5%" style="border-bottom:1px dashed #CCCCCC;">
-																	<img src="{$IMAGE_PATH}profile.gif" align="absmiddle">
-															</td>
-															<td style="border-bottom:1px dashed #CCCCCC;"> 
-																	<span class="genHeaderGrayBig">{$CMOD.LBL_PROFILE_PRIVILEGES}</span><br>
-																	<span	class="genHeaderSmall">{$CMOD.LBL_STEP_3_3}</span>
-															</td>
-													</tr>
-													{else}
-															<td  valign="top" >
-												<table width="75%" border="0" cellpadding="5" cellspacing="0" align="center">
-												
-														<tr>
-															<td width="5%" style="border-bottom:1px dashed #CCCCCC;">
-																	<img src="{$IMAGE_PATH}profile.gif" align="absmiddle">
-															</td>
-															<td style="border-bottom:1px dashed #CCCCCC;"> 
-																	<span class="genHeaderGrayBig">{$CMOD.LBL_PROFILE_PRIVILEGES}</span><br>
-																	<span	class="genHeaderSmall">{$PROFILE_NAME}</span>
-															</td>
-													</tr>
-													{/if}
-																	<tr>
-																			<td colspan="2">
-																					<table border="0" cellspacing="0" cellpadding="0" width="100%">
-																							<tr>
-																								<td>
-																										<table border="0" cellspacing="0" cellpadding="0" width="100%">
-																												<tr class="small">
-																														<td><img src="{$IMAGE_PATH}prvPrfTopLeft.gif" /></td>
-																														<td class="prvPrfTopBg" width="100%" ></td>
-																														<td><img src="{$IMAGE_PATH}prvPrfTopRight.gif" /></td>
-																												</tr>
-																										</table>
-																										<form action="index.php" method="post" name="new" id="form">
-																										<input type="hidden" name="module" value="Users">		
-																										<input type="hidden" name="parenttab" value="Settings">
-																										<input type="hidden" name="action" value="{$ACTION}">		
-																										<input type="hidden" name="mode" value="{$MODE}">	
-																										<input type="hidden" name="profileid" value="{$PROFILEID}">
-																										<input type="hidden" name="profile_name" value="{$PROFILE_NAME}">
-																										<input type="hidden" name="profile_description" value="{$PROFILE_DESCRIPTION}">
-																										<input type="hidden" name="parent_profile" value="{$PARENTPROFILEID}">
-																										<input type="hidden" name="radio_button" value="{$RADIOBUTTON}">	
-																										<input type="hidden" name="return_action" value="{$RETURN_ACTION}">	
-																										<table border="0" cellspacing="0" cellpadding=	"0" width="100%" class="prvPrfOutline">
-																												<tr>
-																														<td>
-<!-- tabs -->
-																																<table border="0" cellspacing="0" cellpadding="5" width="100%" class="small">
-																																		<tr>
-																																				
-																																				<td width="20%" id="prvPrfTab1" class="prvPrfUnSelectedTab" align="center" style="height:31px;" onClick="toggleshowhide('global_privileges','prvPrfTab1');">{$CMOD.LBL_GLOBAL_PRIVILEGES}</td>
-																																				<td width="20%" id="prvPrfTab2" class="prvPrfUnSelectedTab" align="center" onClick="toggleshowhide('tab_privileges','prvPrfTab2');">{$CMOD.LBL_TAB_PRIVILEGES}</td>
-																																				<td width="20%" id="prvPrfTab3" class="prvPrfUnSelectedTab" align="center" onClick="toggleshowhide('standard_privileges','prvPrfTab3');">{$CMOD.LBL_STANDARD_PRIVILEGES}</td>
-																																				<td width="20%" id="prvPrfTab4" class="prvPrfUnSelectedTab" align="center" onClick="toggleshowhide('field_privileges','prvPrfTab4');">{$CMOD.LBL_FIELD_PRIVILEGES}</td>
-																																				<td width="20%" id="prvPrfTab5" class="prvPrfUnSelectedTab" align="center" onClick="toggleshowhide('utility_privileges','prvPrfTab5');">{$CMOD.LBL_UTILITIES}</td>
-																																		</tr>
-																																</table>
-																																<div id="global_privileges" style="display:none;">
-	<!-- Headers -->
-																																	<table border="0" cellspacing="0" cellpadding="5" width="100%" class="prvPrfBgImgGlobal">
-																																		<tr>
-																																				<td>
-																																						<table border="0" cellspacing="0" cellpadding="5" width="100%" class="small">
-																																							<tr>
-																																									<td><!-- Module name heading -->
-																																											<table border="0" cellspacing="0" cellpadding="2" class="small">
-																																													<tr>
-																																															<td valign="top"><img src="{$IMAGE_PATH}prvPrfHdrArrow.gif"/> </td>
-																																															<td class="prvPrfBigText"><b> {$CMOD.LBL_GLOBAL_PRIVILEGES} {$CMOD.LBL_FOR} "{$PROFILE_NAME}"</b> <br />
-																																																	<font class="small">{$CMOD.LBL_GLOBAL_MESG_OPTION} </font> </td>
-																																															<td class="small" style="padding-left:10px" align="right"></td>
-																																													</tr>
-																																											</table>
-																																									 </td>
-																																									<td align="right" valign="bottom">&nbsp;</td>
-																																							</tr>
-																																						</table>
-<!-- privilege lists -->
-																																						<table border="0" cellspacing="0" cellpadding="0" width="100%" >
-																																								<tr>
-																																										<td align="center" style="height:10px"><img src="{$IMAGE_PATH}prvPrfLine.gif" style="width:100%;height:1px" /></td>
-																																								</tr>
-																																						</table>
-																																						<table border="0" cellspacing="0" cellpadding="10" width="100%">
-																																							<tr>
-																																									<td >
-																																											<table border="0" cellspacing="0" cellpadding="5" width="90%" class="small" align="center">
-																																												<tr>
-																																													<td class="prvPrfTexture" style="width:20px">&nbsp;</td>
-																																													<td width="97%" valign="top">
-																																															<table border="0" cellspacing="0" cellpadding="2" width="100%" class="small">
-																																																	<tr id="gva">
-																																																			<td valign="top">{$GLOBAL_PRIV.0}</td>
-																																																					<td ><b>{$CMOD.LBL_VIEW_ALL}</b> </td>
-																																																	</tr>
-																																																	<tr >
-																																																			<td valign="top"></td>
-<td width="100%" >{$CMOD.LBL_ALLOW} "{$PROFILE_NAME}" {$CMOD.LBL_MESG_VIEW}</td>
-</tr>
-<tr>
-<td>&nbsp;</td>
-</tr>
-<tr>
-<td valign="top">{$GLOBAL_PRIV.1}</td>
-<td ><b>{$CMOD.LBL_EDIT_ALL}</b> </td>
-</tr>
-<tr>
-<td valign="top"></td>
-<td > {$CMOD.LBL_ALLOW} "{$PROFILE_NAME}" {$CMOD.LBL_MESG_EDIT}</td>
-</tr>
-</table>
-</td>
-</tr>	
-</table></td>
-</tr>
-</table></td>
-</tr>
-</table>
-</div>
-
-<div id="standard_privileges" style="display:none;">
-<table border=0 cellspacing=0 cellpadding=5 width=100% >
-<tr>
-<td>
-<table border=0 cellspacing=0 cellpadding=5 width=100% class=small>
-<tr>
-<td>
-<!-- Module name heading -->
-<table border=0 cellspacing=0 cellpadding=2 class=small>
-<tr>
-<td valign=top >
-<img src="{$IMAGE_PATH}prvPrfHdrArrow.gif">
-</td>
-<td class="prvPrfBigText">
-<b> {$CMOD.LBL_STANDARD_PRIVILEGES} {$CMOD.LBL_FOR} "{$PROFILE_NAME}"</b> <br>
-<font class=small>{$CMOD.LBL_STD_MESG_OPTION} </font> 
-</td>
-</tr>
-</table>
-</td>
-<td align=right valign=bottom>&nbsp;
-
-</td>
-</tr>
-</table>
-<!-- privilege lists -->
-<table border=0 cellspacing=0 cellpadding=0 width=100% >
-<tr>
-<td align=center style="height:10px"><img src="{$IMAGE_PATH}prvPrfLine.gif" style="width:100%;height:1px"></td>
-</tr>
-</table>
-<table border=0 cellspacing=0 cellpadding=10 width=100%>
-<tr>
-<td >
-<table border=0 cellspacing=0 cellpadding=5 width=90% class=small align=center >
-<tr>
-<td class="prvPrfTexture" style="width:20px">&nbsp;</td>
-<td width=97% valign=top onMouseOver="this.className='prvPrfHoverOn'" onMouseOut="this.className='prvPrfHoverOff'" >
-<table border=0 cellspacing=0 cellpadding=5 width=100% class=small>
-
-	<tr>
-	<td><b>{$CMOD.LBL_ENTITY}</b></td>
-	<td><b>{$CMOD.LBL_CREATE_EDIT}</b></td>
-	<td><b>{$CMOD.LBL_DELETE}</b></td>
-	<td><b>{$CMOD.LBL_VIEW}</b></td>
-	</tr>
-{foreach item=value from=$STANDARD_PRIV}
-<tr>
-<td>{$APP[$value.0]}</td>
-<td>{$value.1}</td>
-<td>{$value.2}</td>
-<td>{$value.3}</td>
-</tr>
-{/foreach}
-
-</table>
-</td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-</div>
-
-<div id="tab_privileges" style="display:none;">
-<table border=0 cellspacing=0 cellpadding=5 width=100% >
-<tr>
-<td>
-<table border=0 cellspacing=0 cellpadding=5 width=100% class=small>
-<tr>
-<td>
-<!-- Module name heading -->
-<table border=0 cellspacing=0 cellpadding=2 class=small>
-<tr>
-<td valign=top >
-<img src="{$IMAGE_PATH}prvPrfHdrArrow.gif">
-</td>
-<td class="prvPrfBigText">
-<b> {$CMOD.LBL_TAB_PRIVILEGES} {$CMOD.LBL_FOR} "{$PROFILE_NAME}"</b> <br>
-<font class=small>{$CMOD.LBL_TAB_MESG_OPTION}  </font> 
-</td>
-</tr>
-</table>
-</td>
-<td align=right valign=bottom>
-</td>
-</tr>
-</table>
-<!-- privilege lists -->
-<table border=0 cellspacing=0 cellpadding=0 width=100% >
-<tr>
-<td align=center style="height:10px"><img src="{$IMAGE_PATH}prvPrfLine.gif" style="width:100%;height:1px"></td>
-</tr>
-</table>
-<table border=0 cellspacing=0 cellpadding=10 width=100%>
-<tr>
-<td >
-<!-- Home tab -->
-<table border=0 cellspacing=0 cellpadding=5 width=90% class=small align=center >
-<tr>
-<td class="prvPrfTexture" style="width:20px">&nbsp;</td>
-<td width=97% valign=top onMouseOver="this.className='prvPrfHoverOn'" onMouseOut="this.className='prvPrfHoverOff'" >
-<table border=0 cellspacing=0 cellpadding=5 width=100% class=small>
-
-
-{foreach item=value from=$TAB_PRIV}
-<tr>
-{foreach item=element from=$value}
-<td width=35%>{$APP[$element.0]}</td>
-<td width=15%>{$element.1}</td>
-{/foreach}
-</tr>
-{/foreach}
-
-</table>
-</td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-</td>
-</tr>
-
-</table>
-</div>
-
-
-<div id="utility_privileges" style="display:none;">
-<table border=0 cellspacing=0 cellpadding=5 width=100% >
-<tr>
-<td>
-<table border=0 cellspacing=0 cellpadding=5 width=100% class=small>
-<tr>
-<td>
-<!-- Module name heading -->
-<table border=0 cellspacing=0 cellpadding=2 class=small>
-<tr>
-<td valign=top >
-<img src="{$IMAGE_PATH}prvPrfHdrArrow.gif">
-</td>
-<td class="prvPrfBigText">
-<b> {$CMOD.LBL_UTILITY_PRIVILEGES} {$CMOD.LBL_FOR} "{$PROFILE_NAME}"</b> <br>
-<font class=small>{$CMOD.LBL_UTILITY_MESG_OPTION} </font> 
-</td>
-</tr>
-</table>
-</td>
-<td align=right valign=bottom>&nbsp;
-
-</td>
-</tr>
-</table>
-<!-- privilege lists -->
-<table border=0 cellspacing=0 cellpadding=0 width=100% >
-<tr>
-<td align=center style="height:10px"><img src="{$IMAGE_PATH}prvPrfLine.gif" style="width:100%;height:1px"></td>
-</tr>
-</table>
-<table border=0 cellspacing=0 cellpadding=10 width=100%>
-<tr>
-<td >
-<!-- Home tab -->
-<table border="0" cellspacing="0" cellpadding="5" width="90%" class="small" align="center" >
-
-{foreach key=module item=value from=$UTILITIES_PRIV}
-<tr>
-<td colspan="4" style="border-bottom:1px solid #efefef"><b>{$APP.$module}</b></td>
-</tr>
-<tr>
-<td class="prvPrfTexture" style="width:20px">&nbsp;</td>
-<td width="97%" valign="top" onmouseover="this.className='prvPrfHoverOn'" onmouseout="this.className='prvPrfHoverOff'" >
-<table border="0" cellspacing="0" cellpadding="5" width="100%" class="small">
-{foreach item=element from=$value}
-<tr>
-<td width=25%>{$APP[$element.0.0]}</td>
-<td width=25%>{$element.0.1}</td>
-<td width=25%>{$APP[$element.1.0]}</td>
-<td width=25%>{$element.1.1}</td>
-{/foreach}
-</tr>
-</table>
-</td>
-</tr>
-
-{/foreach}
-</table>
-</td>
-</tr>
-</table>
-</td>
-</tr>
-
-</table>
-
-</div>
-
-
-<div id="field_privileges" style="display:none;">
-
-<table border="0" cellspacing="0" cellpadding="5" width="100%" >
-<tr>
-<td><table border="0" cellspacing="0" cellpadding="5" width="100%" class="small">
-<tr>
-<td><!-- Module name heading -->
-<table border="0" cellspacing="0" cellpadding="2" class="small">
-<tr>
-<td valign="top" ><img src="{$IMAGE_PATH}prvPrfHdrArrow.gif" /> </td>
-
-<td class="prvPrfBigText"><b> {$CMOD.LBL_FIELD_PRIVILEGES} {$CMOD.LBL_FOR} "{$PROFILE_NAME}"</b> <br />
-<font class="small">{$CMOD.LBL_FIELD_MESG_OPTION} </font> </td>
-</tr>
-</table></td>
-<td align="right" valign="bottom">
-</td>
-</tr>
-</table>
-<!-- privilege lists -->
-<table border="0" cellspacing="0" cellpadding="0" width="100%" >
-<tr>
-<td align="center" style="height:10px"><img src="{$IMAGE_PATH}prvPrfLine.gif" style="width:100%;height:1px" /></td>
-</tr>
-
-</table>
-<table border="0" cellspacing="0" cellpadding="10" width="100%">
-<tr>
-<td >
-<table border="0" cellspacing="0" cellpadding="5" width="100%" class="small">
-<tr>
-<td>
-<select id="module_list" name="module_list" onchange="showmoduleperm(this)">
-{foreach key=module item=label from=$PRI_FIELD_LIST}
-<option value="{$label}">{$APP.$label}</option>
-{/foreach}
-</td>
-<td width=50%>&nbsp;</td>
-</tr>
-<tr>
-<td colspan=2>
-
-{foreach key=module item=value from=$FIELD_PRIVILEGES}
-<div id="field_{$module}" style="display:none;">
-<table border="0" cellspacing="0" cellpadding="5" width="100%" class="small">
-{foreach item=row_value from=$value}
-<tr>
-{foreach item=element from=$row_value}
-<td>{$element.0}</td>
-<td>{$element.1}</td>
-{/foreach}
-</tr>
-{/foreach}
-</table>
-</div>
-{/foreach}
-
-</td>
-</tr>
-</table></td>
-</tr>
-</table></td>
-</tr>
-</table>
-</div>
-
-																														</td>
-																												</tr>
-																										</table>
-																										<table border="0" cellspacing="0" cellpadding="0" width="100%" class="small">
-																												<tr>
-																														<td><img src="{$IMAGE_PATH}prvPrfBottomLeft.gif" /></td>
-																														<td class="prvPrfBottomBg" width="100%"></td>
-																														<td><img src="{$IMAGE_PATH}prvPrfBottomRight.gif" /></td>
-																												</tr>
-																										</table>	
-																									</td>
-																								</tr>
-																						</table>
-																				</td>
-																			</tr>	
-																			<tr><td colspan="2" style="border-bottom:1px dashed #CCCCCC;">&nbsp;</td></tr>
-																			<tr>
-																				<td colspan="2" align="center">
-
-																					<input type="hidden" id="selected_tab" name="selected_tab" value="{$SELECTED_TAB}">		
-																					<input type="hidden" id="selected_module" name="selected_module" value="{$SELECTED_MODULE}">		
-																					{if $MODE neq "edit"}
-																					<input type="submit" value=" &lsaquo; {$APP.LBL_BACK} " name="back" onclick="this.form.action.value='CreateProfile1'" class="classBtn" />&nbsp;&nbsp;
-																					{/if}
-																					{if $ACTION eq 'SaveProfile'}
-																					<input type="submit" value=" {$CMOD.LBL_FINISH_BUTTON} " name="save" class="classBtn"/>&nbsp;&nbsp;
-																					{else}
-																					<input type="submit" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " name="save" class="classBtn"/>&nbsp;&nbsp;
-																					{/if}
-																					<input type="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " name="Cancel" class="classBtn"onClick="window.history.back();" />
-																			</td>
-																	</tr>
-																	
-															</table></from>			
-														</td>
-												<td width="1%" style="border-right:1px dotted #CCCCCC;">&nbsp;</td>
-										</tr>
-								</table>
+{literal}
+<style>
+.showTable{
+	display:inline-table;
+}
+.hideTable{
+	display:none;
+}
+</style>
+{/literal}
+<script language="JAVASCRIPT" type="text/javascript" src="include/js/smoothscroll.js"></script>
+
+<br>
+<table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
+<tbody><tr>
+        <td valign="top"><img src="{$IMAGE_PATH}showPanelTopLeft.gif"></td>
+        <td class="showPanelBg" style="padding: 10px;" valign="top" width="100%">
+        <br>
+	<div align=center>
+			{include file='SetMenu.tpl'}
+				<!-- DISPLAY -->
+				<form action="index.php" method="post" name="profileform" id="form">
+				<input type="hidden" name="module" value="Users">		
+				<input type="hidden" name="parenttab" value="Settings">
+				<input type="hidden" name="action" value="{$ACTION}">		
+				<input type="hidden" name="mode" value="{$MODE}">	
+				<input type="hidden" name="profileid" value="{$PROFILEID}">
+				<input type="hidden" name="profile_name" value="{$PROFILE_NAME}">
+				<input type="hidden" name="profile_description" value="{$PROFILE_DESCRIPTION}">
+				<input type="hidden" name="parent_profile" value="{$PARENTPROFILEID}">
+				<input type="hidden" name="radio_button" value="{$RADIOBUTTON}">	
+				<input type="hidden" name="return_action" value="{$RETURN_ACTION}">	
+
+				<table class="settingsSelUITopLine" border="0" cellpadding="5" cellspacing="0" width="100%">
+				<tbody><tr>
+					<td rowspan="2" valign="top" width="50"><img src="{$IMAGE_PATH}ico-profile.gif" alt="{$MOD.LBL_PROFILES}" title="{$MOD.LBL_PROFILES}" border="0" height="48" width="48"></td>
+					<td class="heading2" valign="bottom"><b><a href="index.php?module=Settings&action=index&parenttab=Settings">{$MOD.LBL_SETTINGS}</a> > <a href="index.php?module=Users&action=ListProfiles&parenttab=Settings">{$CMOD.LBL_PROFILE_PRIVILEGES}</a> &gt; {$CMOD.LBL_VIEWING} &quot;{$PROFILE_NAME}&quot;</b></td>
+				</tr>
+				<tr>
+					<td class="small" valign="top">{$CMOD.LBL_PROFILE_MESG} &quot;{$PROFILE_NAME}&quot; </td>
+				</tr>
+				</tbody></table>
+				
+				
+				<table border="0" cellpadding="10" cellspacing="0" width="100%">
+				<tbody><tr>
+				<td valign="top">
+					<table border="0" cellpadding="0" cellspacing="0" width="100%">
+                      <tbody><tr>
+                        <td><table border="0" cellpadding="0" cellspacing="0" width="100%">
+                            <tbody><tr class="small">
+                              <td><img src="{$IMAGE_PATH}prvPrfTopLeft.gif"></td>
+                              <td class="prvPrfTopBg" width="100%"></td>
+                              <td><img src="{$IMAGE_PATH}prvPrfTopRight.gif"></td>
+                            </tr>
+                          </tbody></table>
+                            <table class="prvPrfOutline" border="0" cellpadding="0" cellspacing="0" width="100%">
+                              <tbody><tr>
+                                <td><!-- tabs -->
+                                    
+                                    <!-- Headers -->
+                                    <table border="0" cellpadding="5" cellspacing="0" width="100%">
+                                      <tbody><tr>
+                                        <td><table class="small" border="0" cellpadding="5" cellspacing="0" width="100%">
+                                            <tbody><tr>
+                                              <td><!-- Module name heading -->
+                                                  <table class="small" border="0" cellpadding="2" cellspacing="0">
+                                                    <tbody><tr>
+                                                      <td valign="top"><img src="{$IMAGE_PATH}prvPrfHdrArrow.gif"> </td>
+                                                      <td class="prvPrfBigText"><b> {if $MODE eq 'create'}{$CMOD.LBL_STEP_2_2} : {/if}{$CMOD.LBL_DEFINE_PRIV_FOR} &lt;{$PROFILE_NAME}&gt; </b><br>
+                                                      <font class="small">{$CMOD.LBL_USE_OPTION_TO_SET_PRIV}</font> </td>
+                                                      <td class="small" style="padding-left: 10px;" align="right"></td>
+                                                    </tr>
+                                                </tbody></table></td>
+                                              <td align="right" valign="bottom">&nbsp;											 	{if $ACTION eq 'SaveProfile'}
+                                                <input type="submit" value=" {$CMOD.LBL_FINISH_BUTTON} " name="save" class="crmButton create small"/>&nbsp;&nbsp;
+                                                {else}
+                                                        <input type="submit" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " name="save" class="crmButton small save"/>&nbsp;&nbsp;
+                                                {/if}
+                                                <input type="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " name="Cancel" class="crmButton cancel small"onClick="window.history.back();" /> 
 						</td>
-				</tr>
+                                            </tr>
+                                          </tbody></table>
+                                            <!-- privilege lists -->
+                                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
+                                              <tbody><tr>
+                                                <td style="height: 10px;" align="center"><img src="{$IMAGE_PATH}prvPrfLine.gif" style="width: 100%; height: 1px;"></td>
+                                              </tr>
+                                            </tbody></table>
+                                            <table border="0" cellpadding="10" cellspacing="0" width="100%">
+                                              <tbody><tr>
+                                                <td>
+						<table border="0" cellpadding="5" cellspacing="0" width="100%">
+  						<tbody>
+							<tr>
+    							<td class="cellLabel big"> {$CMOD.LBL_SUPER_USER_PRIV} </td>
+						       </tr>
+						</tbody>
+						</table>
+						<table class="small" align="center" border="0" cellpadding="5" cellspacing="0" width="90%">
+                                                <tbody><tr>
+                                                    <td class="prvPrfTexture" style="width: 20px;">&nbsp;</td>
+                                                    <td valign="top" width="97%"><table class="small" border="0" cellpadding="2" cellspacing="0" width="100%">
+                                                      <tbody>
+				                         <tr id="gva">
+                                                          <td valign="top">{$GLOBAL_PRIV.0}</td>
+                                                          <td ><b>{$CMOD.LBL_VIEW_ALL}</b> </td>
+                                                        </tr>
+                                                        <tr>
+                                                          <td valign="top"></td>
+                                                          <td width="100%" >{$CMOD.LBL_ALLOW} "{$PROFILE_NAME}" {$CMOD.LBL_MESG_VIEW}</td>
+                                                        </tr>
+                                                        <tr>
+                                                          <td>&nbsp;</td>
+                                                        </tr>
+							<tr>
+							<td valign="top">{$GLOBAL_PRIV.1}</td>
+							<td ><b>{$CMOD.LBL_EDIT_ALL}</b> </td>
+							</tr>
+                                                        <tr>
+                                                          <td valign="top"></td>
+                                                          <td > {$CMOD.LBL_ALLOW} "{$PROFILE_NAME}" {$CMOD.LBL_MESG_EDIT}</td>
+                                                        </tr>
+
+                                                      </tbody></table>
+						</td>
+                                                  </tr>
+                                                </tbody></table>
+<br>
+
+			<table border="0" cellpadding="5" cellspacing="0" width="100%">
+			  <tbody><tr>
+			    <td class="cellLabel big"> {$CMOD.LBL_SET_PRIV_FOR_EACH_MODULE} </td>
+			  </tr>
+			</tbody></table>
+			<table class="small" align="center" border="0" cellpadding="5" cellspacing="0" width="90%">
+			  <tbody><tr>
+			    <td class="prvPrfTexture" style="width: 20px;">&nbsp;</td>
+			    <td valign="top" width="97%">
+				<table class="small listTable" border="0" cellpadding="5" cellspacing="0" width="100%">
+			        <tbody>
+				<tr id="gva">
+			          <td colspan="2" rowspan="2" class="small colHeader"><strong> {$CMOD.LBL_TAB_MESG_OPTION} </strong><strong></strong></td>
+			          <td colspan="3" class="small colHeader"><div align="center"><strong>{$CMOD.LBL_EDIT_PERMISSIONS}</strong></div></td>
+			          <td rowspan="2" class="small colHeader" nowrap="nowrap">{$CMOD.LBL_FIELDS_AND_TOOLS_SETTINGS}</td>
+			        </tr>
+			        <tr id="gva">
+			          <td class="small colHeader"><div align="center"><strong>
+		                Create/Edit
+			          </strong></div></td>
+			          <td class="small colHeader"> <div align="center"><strong>View </strong></div></td>
+			          <td class="small colHeader"> <div align="center"><strong>Delete</strong></div></td>
+			        </tr>
+					
+				<!-- module loops-->
+			        {foreach key=tabid item=elements from=$TAB_PRIV}	
+			        <tr>
+                                        {assign var=modulename value=$TAB_PRIV[$tabid][0]}
+			          <td class="small cellLabel" width="3%"><div align="right">
+					{$TAB_PRIV[$tabid][1]}
+			          </div></td>
+			          <td class="small cellLabel" width="40%"><p>{$APP[$modulename]}</p></td>
+			          <td class="small cellText" width="15%"><div align="center">
+					{$STANDARD_PRIV[$tabid][1]}
+			          </div></td>
+			          <td class="small cellText" width="15%"><div align="center">
+					{$STANDARD_PRIV[$tabid][3]}
+			          </div></td>
+			          <td class="small cellText" width="15%"><div align="center">
+					{$STANDARD_PRIV[$tabid][2]}
+        			  </div></td>
+			          <td class="small cellText" width="22%"><div align="center">
+				{if $FIELD_PRIVILEGES[$tabid] neq NULL}
+				<img src="{$IMAGE_PATH}showDown.gif" id="img_{$tabid}" alt="{$CMOD.LBL_SHOW_FIELDS}" onclick="fnToggleVIew('{$tabid}_view')" border="0" height="16" width="40" style="display:block;">
+				{/if}
+				</div></td>
+				  </tr>
+		                  <tr class="hideTable" id="{$tabid}_view" className="hideTable">
+				          <td colspan="6" class="small settingsSelectedUI">
+						<table class="small" border="0" cellpadding="2" cellspacing="0" width="100%">
+			        	    	<tbody>
+						<tr id="gva">
+				                	<td class="small colHeader" colspan="6" valign="top">{$CMOD.LBL_FIELDS_SELECT_DESELECT}</td>
+					        </tr>
+						{foreach item=row_values from=$FIELD_PRIVILEGES[$tabid]}
+				            	<tr id="gva">
+						      {foreach item=element from=$row_values}
+					              <td valign="top">{$element.1}</td>
+					              <td>{$element.0}</td>
+						      {/foreach}
+				                </tr>
+						{/foreach}
+					        <tr id="gva">
+					              <td colspan="6" class="small colHeader" valign="top">{$CMOD.LBL_TOOLS_TO_BE_SHOWN}</td>
+						</tr>
+							{foreach item=util_value from=$UTILITIES_PRIV[$tabid]}
+							<tr id="gva">
+							{foreach item=util_elements from=$util_value}
+					              		<td valign="top">{$util_elements.1}</td>
+						                <td>{$APP[$util_elements.0]}</td>
+							{/foreach}
+				                	</tr>
+							{/foreach}
+					        </tbody>
+						</table>
+					</td>
+			          </tr>
+				  {/foreach}	
+			    	  </tbody>
+				  </table>
+			  </td>
+			  </tr>
+                          </tbody>
 			</table>
 		</td>
+                </tr>
+		<tr>
+		<td style="border-top: 2px dotted rgb(204, 204, 204);" align="right">
+		<!-- wizard buttons -->
+		<table border="0" cellpadding="2" cellspacing="0">
+		<tbody>
+			<tr><td>
+				{if $ACTION eq 'SaveProfile'}
+					<input type="submit" value=" {$CMOD.LBL_FINISH_BUTTON} " name="save" class="crmButton create small"/>&nbsp;&nbsp;
+				{else}
+					<input type="submit" value=" {$APP.LBL_SAVE_BUTTON_LABEL} " name="save" class="crmButton small save"/>&nbsp;&nbsp;
+				{/if}
+				</td><td>
+					<input type="button" value=" {$APP.LBL_CANCEL_BUTTON_LABEL} " name="Cancel" class="crmButton cancel small"onClick="window.history.back();" /></td>
+
+				<td>&nbsp;</td>
+			</tr>
+		</tbody>
+		</table>
+		</td>
+		</tr>
+          </tbody>
+	  </table>
+	</td>
+        </tr>
+        </tbody>
+	</table>
+      </td>
+      </tr>
+      </tbody></table>
+      <table class="small" border="0" cellpadding="0" cellspacing="0" width="100%">
+           <tbody><tr>
+                <td><img src="{$IMAGE_PATH}prvPrfBottomLeft.gif"></td>
+                <td class="prvPrfBottomBg" width="100%"></td>
+                <td><img src="{$IMAGE_PATH}prvPrfBottomRight.gif"></td>
+                </tr>
+            </tbody>
+      </table></td>
+      </tr>
+      </tbody></table>
+	<p>&nbsp;</p>
+	<table border="0" cellpadding="5" cellspacing="0" width="100%">
+	<tbody><tr><td class="small" align="right" nowrap="nowrap"><a href="#top">{$MOD.LBL_SCROLL}</a></td></tr>
+	</tbody></table>
+					
+	</td>
 	</tr>
+	</tbody></table>
+	</form>	
+	<!-- End of Display -->
+	</td>
+	</tr>
+	</table>
+	</td>
+	</tr>
+	</table>
+	</div>
+
+	</td>
+	<td valign="top"><img src="{$IMAGE_PATH}showPanelTopRight.gif"></td>
+	</tr>
+</tbody>
 </table>
-	{include file='SettingsSubMenu.tpl'}
-
 <script language="javascript" type="text/javascript">
-var Selected_div= '{$SELECTED_TAB}';
-divarray = new Array('global_privileges','tab_privileges','standard_privileges','field_privileges','utility_privileges'); 	
-tabarray = new Array('prvPrfTab1','prvPrfTab2','prvPrfTab3','prvPrfTab4','prvPrfTab5'); 	
-var defaultmodule = '{$SELECTED_MODULE}';
-function set_default()
-{ldelim}
-	show (Selected_div);
-	show (defaultmodule);
-	for(i = 0; i < divarray.length ;i++)
-	{ldelim}
-		if(divarray[i] == Selected_div)
-			break;	
-	{rdelim}
-	document.getElementById(tabarray[i]).className="prvPrfSelectedTab";
-	module_combo = document.getElementById('module_list');
-	module_combo_selected = defaultmodule.replace(/field_/gi,'')
-	for(i = 0; i < module_combo.length ;i++)
-	{ldelim}
-		if(module_combo.options[i].value == module_combo_selected)
-		{ldelim}	
-			module_combo.options[i].selected = true;	
-			break;	
-		{rdelim}	
-	{rdelim}
-{rdelim}
-set_default();
-function toggleshowhide(currentselecteddiv,currentselectedtab)
-{ldelim}
-	for(i = 0; i < divarray.length ;i++)
-	{ldelim}
-		if(Selected_div == divarray[i])
-			break;	
-	{rdelim}	
-	hide (Selected_div);
-	document.getElementById(tabarray[i]).className="prvPrfUnSelectedTab";
-	show (currentselecteddiv);
-	document.getElementById(currentselectedtab).className="prvPrfSelectedTab";
-	Selected_div = currentselecteddiv;
-	document.getElementById('selected_tab').value =	Selected_div; 	
-{rdelim}	
-function showmoduleperm(selectmodule_view)
-{ldelim}
-	hide(defaultmodule);
-	defaultmodule='field_'+selectmodule_view.options[selectmodule_view.options.selectedIndex].value;
-	show(defaultmodule);
-	document.getElementById('selected_module').value = defaultmodule;	
-{rdelim}	
-	
+{literal}
+var Imagid_array = new Array('img_2','img_4','img_6','img_7','img_8','img_9','img_10','img_13','img_14','img_18','img_19','img_20','img_21','img_22','img_23','img_26')
+function fnToggleVIew(obj){
+	var tagStyle = document.getElementById(obj).className;
+	if(tagStyle == 'hideTable' ){
+		document.getElementById(obj).className = 'showTable';
+	}
+	else
+		document.getElementById(obj).className = 'hideTable';
+}
+function invokeview_all()
+{
+	if($('view_all_chk').checked == true)
+	{
+		for(var i = 0;i < document.profileform.elements.length;i++)
+		{
+			if(document.profileform.elements[i].type == 'checkbox')
+			{
+				if(document.profileform.elements[i].id.indexOf('tab_chk_com_') != -1 || document.profileform.elements[i].id.indexOf('tab_chk_4') != -1 || document.profileform.elements[i].id.indexOf('_field_') != -1)
+					document.profileform.elements[i].checked = true; 
+			}
+		}	
+		showAllImages();
+	}
+}
+function showAllImages()
+{
+	for(var j=0;j < Imagid_array.length;j++)
+	{
+		$(Imagid_array[j]).style.display = 'block';	
+	}
+}
+function invokeedit_all()
+{
+	if($('edit_all_chk').checked == true)
+	{
+		$('view_all_chk').checked = true;
+		for(var i = 0;i < document.profileform.elements.length;i++)
+		{
+			if(document.profileform.elements[i].type == 'checkbox')
+			{
+				if(document.profileform.elements[i].id.indexOf('tab_chk_com_') != -1 || document.profileform.elements[i].id.indexOf('tab_chk_4') != -1 || document.profileform.elements[i].id.indexOf('tab_chk_1') != -1 || document.profileform.elements[i].id.indexOf('_field_') != -1)
+					document.profileform.elements[i].checked = true; 
+			}
+		}	
+		showAllImages();
+	}
+
+}
+function unselect_edit_all()
+{
+	$('edit_all_chk').checked = false;
+}
+function unselect_view_all()
+{
+	$('view_all_chk').checked = false;
+}
+function unSelectView(id)
+{
+	var createid = 'tab_chk_1_'+id;	
+	var deleteid = 'tab_chk_2_'+id;
+	if($('tab_chk_4_'+id).checked == false)
+	{
+		unselect_view_all();
+		unselect_edit_all();
+		$(createid).checked = false;
+		$(deleteid).checked = false;
+	}else
+	{
+		var imageid = 'img_'+id;
+		var viewid = 'tab_chk_4_'+id;	
+		$(imageid).style.display = 'block';
+		$('tab_chk_com_'+id).checked = true; 
+	}
+}
+function unSelectCreate(id)
+{
+	var viewid = 'tab_chk_4_'+id;	
+	if($('tab_chk_1_'+id).checked == false)
+	{
+		unselect_edit_all();
+	}else
+	{
+		var imageid = 'img_'+id;
+		var viewid = 'tab_chk_4_'+id;	
+		$(imageid).style.display = 'block';
+		$('tab_chk_com_'+id).checked = true;
+		$(viewid).checked = true;
+	}
+}
+function unSelectDelete(id)
+{	
+	var contid = id+'_view';
+	if($('tab_chk_2_'+id).checked == false)
+	{
+	}else
+	{
+		var imageid = 'img_'+id;
+		var viewid = 'tab_chk_4_'+id;	
+		$(imageid).style.display = 'block';
+		$('tab_chk_com_'+id).checked = true;
+		$(viewid).checked = true;
+	}
+
+}
+function hideTab(id)
+{
+	var createid = 'tab_chk_1_'+id;	
+	var viewid = 'tab_chk_4_'+id;	
+	var deleteid = 'tab_chk_2_'+id;
+	var imageid = 'img_'+id;
+	var contid = id+'_view';
+	if($('tab_chk_com_'+id).checked == false)
+	{
+		unselect_view_all();
+		unselect_edit_all();
+		$(imageid).style.display = 'none';
+		$(contid).className = 'hideTable';
+		$(createid).checked = false;
+		$(deleteid).checked = false;
+		$(viewid).checked = false;
+	}else
+	{
+		$(imageid).style.display = 'block';
+		$(createid).checked = true;
+		$(deleteid).checked = true;
+		$(viewid).checked = true;
+		var fieldid = id +'_field_';
+		for(var i = 0;i < document.profileform.elements.length;i++)
+                {
+                        if(document.profileform.elements[i].type == 'checkbox' && document.profileform.elements[i].id.indexOf(fieldid) != -1)
+                        {
+                                        document.profileform.elements[i].checked = true;
+                        }
+                }
+	}
+}
+function selectUnselect(oCheckbox)
+{
+	if(oCheckbox.checked == false)
+	{
+		unselect_view_all();
+		unselect_edit_all();
+	}
+}
+{/literal}
 </script>

Modified: vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/ProfileDetailView.tpl Thu Jun 22 05:55:20 2006
@@ -9,7 +9,16 @@
   *
  ********************************************************************************/
 -->*}
-
+{literal}
+<style>
+.showTable{
+	display:inline-table;
+}
+.hideTable{
+	display:none;
+}
+</style>
+{/literal}
 <script language="JAVASCRIPT" type="text/javascript" src="include/js/smoothscroll.js"></script>
 
 <br>
@@ -17,35 +26,9 @@
 <tbody><tr>
         <td valign="top"><img src="{$IMAGE_PATH}showPanelTopLeft.gif"></td>
         <td class="showPanelBg" style="padding: 10px;" valign="top" width="100%">
-<br>
+        <br>
 	<div align=center>
-		{include file="SetMenu.tpl"}	
-				<!-- DISPLAY -->
-				<table border=0 cellspacing=0 cellpadding=5 width=100% class="settingsSelUITopLine">
-				<tr>
-					<td width=50 rowspan=2 valign=top><img src="{$IMAGE_PATH}ico-profile.gif" alt="{$MOD.LBL_PROFILES}" width="48" height="48" border=0 title="{$MOD.LBL_PROFILES}"></td>
-					<td class=heading2 valign=bottom><b><a href="index.php?module=Settings&action=index&
-parenttab=Settings">{$MOD.LBL_SETTINGS}</a> > <a href="index.php?module=Users&action=ListProfiles&parenttab=Settings">{$CMOD.LBL_PROFILE_PRIVILEGES}</a> &gt; {$CMOD.LBL_VIEWING} &quot;{$PROFILE_NAME}&quot; </b></td>
-				</tr>
-				<tr>
-					<td valign=top class="small">{$CMOD.LBL_PROFILE_MESG} &quot;{$PROFILE_NAME}&quot;</td>
-				</tr>
-				</table>
-				
-				
-				<table border=0 cellspacing=0 cellpadding=10 width=100% >
-				<tr>
-				<td valign=top>
-					<table border="0" cellspacing="0" cellpadding="0" width="100%">
-                      <tr>
-                        <td><table border="0" cellspacing="0" cellpadding="0" width="100%">
-                            <tr class="small">
-                              <td><img src="{$IMAGE_PATH}prvPrfTopLeft.gif"></td>
-
-                              <td class="prvPrfTopBg" width="100%" ></td>
-                              <td><img src="{$IMAGE_PATH}prvPrfTopRight.gif"></td>
-                            </tr>
-                          </table>
+			{include file='SetMenu.tpl'}
 				<form action="index.php" method="post" name="new" id="form">
 			        <input type="hidden" name="module" value="Users">
 			        <input type="hidden" name="action" value="profilePrivileges">
@@ -53,53 +36,74 @@
 			        <input type="hidden" name="return_action" value="profilePrivileges">
 			        <input type="hidden" name="mode" value="edit">
 			        <input type="hidden" name="profileid" value="{$PROFILEID}">
-	
-                            <table border="0" cellspacing="0" cellpadding="0" width="100%" class="prvPrfOutline">
-                              <tr>
+				<!-- DISPLAY -->
+				<table class="settingsSelUITopLine" border="0" cellpadding="5" cellspacing="0" width="100%">
+				<tbody><tr>
+					<td rowspan="2" valign="top" width="50"><img src="{$IMAGE_PATH}ico-profile.gif" alt="{$MOD.LBL_PROFILES}" title="{$MOD.LBL_PROFILES}" border="0" height="48" width="48"></td>
+					<td class="heading2" valign="bottom"><b><a href="index.php?module=Settings&action=index&parenttab=Settings">{$MOD.LBL_SETTINGS}</a> > <a href="index.php?module=Users&action=ListProfiles&parenttab=Settings">{$CMOD.LBL_PROFILE_PRIVILEGES}</a> &gt; {$CMOD.LBL_VIEWING} &quot;{$PROFILE_NAME}&quot;</b></td>
+				</tr>
+				<tr>
+					<td class="small" valign="top">{$CMOD.LBL_PROFILE_MESG} &quot;{$PROFILE_NAME}&quot; </td>
+				</tr>
+				</tbody></table>
+				
+				
+				<table border="0" cellpadding="10" cellspacing="0" width="100%">
+				<tbody><tr>
+				<td valign="top">
+					<table border="0" cellpadding="0" cellspacing="0" width="100%">
+                      <tbody><tr>
+                        <td><table border="0" cellpadding="0" cellspacing="0" width="100%">
+                            <tbody><tr class="small">
+                              <td><img src="{$IMAGE_PATH}prvPrfTopLeft.gif"></td>
+                              <td class="prvPrfTopBg" width="100%"></td>
+                              <td><img src="{$IMAGE_PATH}prvPrfTopRight.gif"></td>
+                            </tr>
+                          </tbody></table>
+                            <table class="prvPrfOutline" border="0" cellpadding="0" cellspacing="0" width="100%">
+                              <tbody><tr>
                                 <td><!-- tabs -->
-                                    <table border="0" cellspacing="0" cellpadding="5" width="100%" class="small">
-                                      <tr>
-                                        <td width="20%" id="prvPrfTab1" class="prvPrfSelectedTab" align="center" style="height:31px;" onClick="toggleshowhide('global_privileges','prvPrfTab1');"><a href="#">{$CMOD.LBL_GLOBAL_PRIVILEGES}</a></td>
-                                        <td width="20%" id="prvPrfTab2" class="prvPrfUnSelectedTab" align="center" onClick="toggleshowhide('tab_privileges','prvPrfTab2');"><a href="#">{$CMOD.LBL_TAB_PRIVILEGES}</a></td>
-                                        <td width="20%" id="prvPrfTab3" class="prvPrfUnSelectedTab" align="center" onClick="toggleshowhide('standard_privileges','prvPrfTab3');"><a href="#">{$CMOD.LBL_STANDARD_PRIVILEGES}</a></td>
-                                        <td width="20%" id="prvPrfTab4" class="prvPrfUnSelectedTab" align="center" onClick="toggleshowhide('field_privileges','prvPrfTab4');"><a href="#">{$CMOD.LBL_FIELD_PRIVILEGES}</a></td>
-                                        <td width="20%" id="prvPrfTab5" class="prvPrfUnSelectedTab" align="center" onClick="toggleshowhide('utility_privileges','prvPrfTab5');" ><a href="#">{$CMOD.LBL_UTILITIES}</a></td>
-                                      </tr>
-                                    </table>
-				   <div id="global_privileges" style="display:none;">
+                                    
                                     <!-- Headers -->
-                                    <table border="0" cellspacing="0" cellpadding="5" width="100%" class="prvPrfBgImgGlobal">
-                                      <tr>
-                                        <td><table border="0" cellspacing="0" cellpadding="5" width="100%" class="small">
-                                            <tr>
+                                    <table border="0" cellpadding="5" cellspacing="0" width="100%">
+                                      <tbody><tr>
+                                        <td><table class="small" border="0" cellpadding="5" cellspacing="0" width="100%">
+                                            <tbody><tr>
                                               <td><!-- Module name heading -->
-                                                  <table border="0" cellspacing="0" cellpadding="2" class="small">
-                                                    <tr>
-                                                      <td valign="top" ><img src="{$IMAGE_PATH}prvPrfHdrArrow.gif" /> </td>
-                                                      <td class="prvPrfBigText"><b> {$CMOD.LBL_GLOBAL_PRIVILEGES} {$CMOD.LBL_FOR} "{$PROFILE_NAME}"</b> <br />
-                                                          <font class="small">{$CMOD.LBL_GLOBAL_MESG_OPTION}</font></td>
-                                                      <td class="small" style="padding-left:10px" align="right"></td>
+                                                  <table class="small" border="0" cellpadding="2" cellspacing="0">
+                                                    <tbody><tr>
+                                                      <td valign="top"><img src="{$IMAGE_PATH}prvPrfHdrArrow.gif"> </td>
+                                                      <td class="prvPrfBigText"><b> {$CMOD.LBL_DEFINE_PRIV_FOR} &lt;{$PROFILE_NAME}&gt; </b><br>
+                                                      <font class="small">{$CMOD.LBL_USE_OPTION_TO_SET_PRIV}</font> </td>
+                                                      <td class="small" style="padding-left: 10px;" align="right"></td>
+
                                                     </tr>
-                                                </table></td>
-                                              <td align="right" valign="bottom">
-						<input type="hidden" id="selected_tab" name="selected_tab" value="{$SELECTED_TAB}">
-					        <input type="hidden" id="selected_module" name="selected_module" value="{$SELECTED_MODULE}">
-						<input type="submit" value="{$APP.LBL_EDIT_BUTTON_LABEL}" class="crmButton small edit" name="edit"></td>
+                                                </tbody></table></td>
+                                              <td align="right" valign="bottom">&nbsp;<input type="submit" value="{$APP.LBL_EDIT_BUTTON_LABEL}" class="crmButton small edit" name="edit">											  </td>
                                             </tr>
-                                          </table>
+                                          </tbody></table>
                                             <!-- privilege lists -->
-                                            <table border="0" cellspacing="0" cellpadding="0" width="100%" >
-                                              <tr>
-                                                <td align="center" style="height:10px"><img src="{$IMAGE_PATH}prvPrfLine.gif" style="width:100%;height:1px" /></td>
+                                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
+                                              <tbody><tr>
+                                                <td style="height: 10px;" align="center"><img src="{$IMAGE_PATH}prvPrfLine.gif" style="width: 100%; height: 1px;"></td>
                                               </tr>
-                                            </table>
-                                            <table border="0" cellspacing="0" cellpadding="10" width="100%">
-                                              <tr>
-                                                <td ><table border="0" cellspacing="0" cellpadding="5" width="90%" class="small" align="center">
-                                                  <tr>
-                                                    <td class="prvPrfTexture" style="width:20px">&nbsp;</td>
-                                                    <td width="97%" valign="top"><table border="0" cellspacing="0" cellpadding="2" width="100%" class="small">
-                                                        <tr id="gva">
+                                            </tbody></table>
+                                            <table border="0" cellpadding="10" cellspacing="0" width="100%">
+                                              <tbody><tr>
+                                                <td>
+						<table border="0" cellpadding="5" cellspacing="0" width="100%">
+  						<tbody>
+							<tr>
+    							<td class="cellLabel big"> {$CMOD.LBL_SUPER_USER_PRIV} </td>
+						       </tr>
+						</tbody>
+						</table>
+						<table class="small" align="center" border="0" cellpadding="5" cellspacing="0" width="90%">
+                                                <tbody><tr>
+                                                    <td class="prvPrfTexture" style="width: 20px;">&nbsp;</td>
+                                                    <td valign="top" width="97%"><table class="small" border="0" cellpadding="2" cellspacing="0" width="100%">
+                                                      <tbody>
+				                         <tr id="gva">
                                                           <td valign="top">{$GLOBAL_PRIV.0}</td>
                                                           <td ><b>{$CMOD.LBL_VIEW_ALL}</b> </td>
                                                         </tr>
@@ -118,380 +122,161 @@
                                                           <td valign="top"></td>
                                                           <td > {$CMOD.LBL_ALLOW} "{$PROFILE_NAME}" {$CMOD.LBL_MESG_EDIT}</td>
                                                         </tr>
-                                                      </table>
-                                                     </td>
+
+                                                      </tbody></table>
+						</td>
                                                   </tr>
-                                                </table></td>
-                                              </tr>
-                                          </table></td>
-                                      </tr>
-                                  </table></td>
-                              </tr>
-                            </table>
-			    </div>		
-	
-		<div id="tab_privileges" style="display:none;">
-		<table border=0 cellspacing=0 cellpadding=5 width=100% >
+                                                </tbody></table>
+<br>
+
+			<table border="0" cellpadding="5" cellspacing="0" width="100%">
+			  <tbody><tr>
+			    <td class="cellLabel big"> {$CMOD.LBL_SET_PRIV_FOR_EACH_MODULE} </td>
+			  </tr>
+			</tbody></table>
+			<table class="small" align="center" border="0" cellpadding="5" cellspacing="0" width="90%">
+			  <tbody><tr>
+			    <td class="prvPrfTexture" style="width: 20px;">&nbsp;</td>
+			    <td valign="top" width="97%">
+				<table class="small listTable" border="0" cellpadding="5" cellspacing="0" width="100%">
+			        <tbody>
+				<tr id="gva">
+			          <td colspan="2" rowspan="2" class="small colHeader"><strong> {$CMOD.LBL_TAB_MESG_OPTION} </strong><strong></strong></td>
+			          <td colspan="3" class="small colHeader"><div align="center"><strong> {$CMOD.LBL_EDIT_PERMISSIONS} </strong></div></td>
+			          <td rowspan="2" class="small colHeader" nowrap="nowrap"> {$CMOD.LBL_FIELDS_AND_TOOLS_SETTINGS} </td>
+			        </tr>
+			        <tr id="gva">
+			          <td class="small colHeader"><div align="center"><strong>{$CMOD.LBL_CREATE_EDIT}
+			          </strong></div></td>
+			          <td class="small colHeader"> <div align="center"><strong>{$CMOD.LBL_VIEW} </strong></div></td>
+			          <td class="small colHeader"> <div align="center"><strong>{$CMOD.LBL_DELETE}</strong></div></td>
+			        </tr>
+					
+				<!-- module loops-->
+			        {foreach key=tabid item=elements from=$TAB_PRIV}	
+			        <tr>
+                                        {assign var=modulename value=$TAB_PRIV[$tabid][0]}
+			          <td class="small cellLabel" width="3%"><div align="right">
+					{$TAB_PRIV[$tabid][1]}
+			          </div></td>
+			          <td class="small cellLabel" width="40%"><p>{$APP[$modulename]}</p></td>
+			          <td class="small cellText" width="15%"><div align="center">
+					{$STANDARD_PRIV[$tabid][1]}
+			          </div></td>
+			          <td class="small cellText" width="15%"><div align="center">
+					{$STANDARD_PRIV[$tabid][3]}
+			          </div></td>
+			          <td class="small cellText" width="15%"><div align="center">
+					{$STANDARD_PRIV[$tabid][2]}
+        			  </div></td>
+			          <td class="small cellText" width="22%"><div align="center">
+				{if $FIELD_PRIVILEGES[$tabid] neq NULL}
+				<img src="{$IMAGE_PATH}showDown.gif" alt="{$CMOD.LBL_SHOW_FIELDS}" onclick="fnToggleVIew('{$modulename}_view')" border="0" height="16" width="40">
+				{/if}
+				</div></td>
+				  </tr>
+		                  <tr class="hideTable" id="{$modulename}_view" className="hideTable">
+				          <td colspan="6" class="small settingsSelectedUI">
+						<table class="small" border="0" cellpadding="2" cellspacing="0" width="100%">
+			        	    	<tbody>
+						<tr id="gva">
+				                	<td class="small colHeader" colspan="6" valign="top">{$CMOD.LBL_FIELDS_SELECT_DESELECT}</td>
+					        </tr>
+						{foreach item=row_values from=$FIELD_PRIVILEGES[$tabid]}
+				            	<tr id="gva">
+						      {foreach item=element from=$row_values}
+					              <td valign="top">{$element.1}</td>
+					              <td>{$element.0}</td>
+						      {/foreach}
+				                </tr>
+						{/foreach}
+					        <tr id="gva">
+					              <td colspan="6" class="small colHeader" valign="top">{$CMOD.LBL_TOOLS_TO_BE_SHOWN} </td>
+						</tr>
+							{foreach item=util_value from=$UTILITIES_PRIV[$tabid]}
+							<tr id="gva">
+							{foreach item=util_elements from=$util_value}
+					              		<td valign="top">{$util_elements.1}</td>
+						                <td>{$APP[$util_elements.0]}</td>
+							{/foreach}
+				                	</tr>
+							{/foreach}
+					        </tbody>
+						</table>
+					</td>
+			          </tr>
+				  {/foreach}	
+			    	  </tbody>
+				  </table>
+			  </td>
+			  </tr>
+                          </tbody>
+			</table>
+		</td>
+                </tr>
 		<tr>
-		<td>
-		<table border=0 cellspacing=0 cellpadding=5 width=100% class=small>
-		<tr>
-		<td>
-		<!-- Module name heading -->
-		<table border=0 cellspacing=0 cellpadding=2 class=small>
-		<tr>
-		<td valign=top >
-		<img src="{$IMAGE_PATH}prvPrfHdrArrow.gif"></td>
-		<td class="prvPrfBigText">
-		<b> {$CMOD.LBL_TAB_PRIVILEGES} {$CMOD.LBL_FOR} "{$PROFILE_NAME}"</b> <br>
-		<font class=small>{$CMOD.LBL_TAB_MESG_OPTION} </font> 
-		</td>
-		</tr>
-		</table>
-		</td>
-		<td align=right valign=bottom>
-			<input type="hidden" id="selected_tab" name="selected_tab" value="{$SELECTED_TAB}">
-			<input type="hidden" id="selected_module" name="selected_module" value="{$SELECTED_MODULE}">
-			<input type="submit" value="{$APP.LBL_EDIT_BUTTON_LABEL}" class="crmButton small edit" name="edit">
-		</td>
-		</tr>
-		</table>
-		<!-- privilege lists -->
-		<table border=0 cellspacing=0 cellpadding=0 width=100% >
-		<tr>
-		<td align=center style="height:10px"><img src="{$IMAGE_PATH}prvPrfLine.gif" style="width:100%;height:1px"></td>
-		</tr>
-		</table>
-		<table border=0 cellspacing=0 cellpadding=10 width=100%>
-		<tr>
-		<td >
-		<!-- Home tab -->
-		<table border=0 cellspacing=0 cellpadding=5 width=95% class=small align=center >
-		<tr>
-			<td valign=top width="25%" ><table border=0 cellspacing=0 cellpadding=5 width=100% class=small>
-		
-
-		{foreach item=value from=$TAB_PRIV}
-		<tr>
-		{foreach item=element from=$value}
-		<td class="prvPrfTexture" style="width:20px">&nbsp;</td>
-		<td width=5% id="perm{$element.0}">{$element.1}</td>
-		<td width=30% nowrap onMouseOver="this.className='prvPrfHoverOn',$('perm{$element.0}').className='prvPrfHoverOn'" onMouseOut="this.className='prvPrfHoverOff',$('perm{$element.0}').className='prvPrfHoverOff'">{$APP[$element.0]}</td>
-		{/foreach}
-		</tr>
-		{/foreach}
-	
+		<td style="border-top: 2px dotted rgb(204, 204, 204);" align="right">
+		<!-- wizard buttons -->
+		<table border="0" cellpadding="2" cellspacing="0">
+		<tbody>
+			<tr>
+				<td><input type="submit" value="{$APP.LBL_EDIT_BUTTON_LABEL}" class="crmButton small edit" name="edit"></td>
+				<td>&nbsp;</td>
+			</tr>
+		</tbody>
 		</table>
 		</td>
 		</tr>
-		</table>
-		</td>
-		</tr>
-		</table>
-		</td>
-		</tr>
-
-		</table>
-		</div>
-	
-		<div id="standard_privileges" style="display:none;">
-		<table border=0 cellspacing=0 cellpadding=5 width=100% >
-		<tr>
-		<td>
-		<table border=0 cellspacing=0 cellpadding=5 width=100% class=small>
-		<tr>
-		<td>
-		<!-- Module name heading -->
-		<table border=0 cellspacing=0 cellpadding=2 class=small>
-		<tr>
-		<td valign=top >
-		<img src="{$IMAGE_PATH}prvPrfHdrArrow.gif">
-		</td>
-		<td class="prvPrfBigText">
-		<b> {$CMOD.LBL_STANDARD_PRIVILEGES} {$CMOD.LBL_FOR} "{$PROFILE_NAME}"</b> <br>
-		<font class=small>{$CMOD.LBL_STD_MESG_OPTION} </font> 
-		</td>
-		</tr>
-		</table>
-		</td>
-		<td align=right valign=bottom>
-			<input type="hidden" id="selected_tab" name="selected_tab" value="{$SELECTED_TAB}">
-			<input type="hidden" id="selected_module" name="selected_module" value="{$SELECTED_MODULE}">
-			<input type="submit" value="{$APP.LBL_EDIT_BUTTON_LABEL}" class="crmButton small edit" name="edit">
-		</td>	
-
-		</tr>
-		</table>
-		<!-- privilege lists -->
-		<table border=0 cellspacing=0 cellpadding=0 width=100% >
-		<tr>
-		<td align=center style="height:10px"><img src="{$IMAGE_PATH}prvPrfLine.gif" style="width:100%;height:1px"></td>
-		</tr>
-		</table>
-		<table border=0 cellspacing=0 cellpadding=10 width=100%>
-		<tr>
-		<td >
-		<table border=0 cellspacing=0 cellpadding=5 width=90% class=small align=center >
-		<tr>
-		<td class="prvPrfTexture" style="width:20px">&nbsp;</td>
-		<td width=97% valign=top>
-		<table border=0 cellspacing=0 cellpadding=5 width=100% class=small>
-		
-		<tr onMouseOver="this.className='prvPrfHoverOn'" onMouseOut="this.className='prvPrfHoverOff'">
-		<td><b>{$CMOD.LBL_ENTITY}</b></td>
-		<td><b>{$CMOD.LBL_CREATE_EDIT}</b></td>
-		<td><b>{$CMOD.LBL_DELETE}</b></td>
-		<td><b>{$CMOD.LBL_VIEW}</b></td>
-		</tr>
-		
-		{foreach item=value from=$STANDARD_PRIV}
-		<tr onMouseOver="this.className='prvPrfHoverOn'" onMouseOut="this.className='prvPrfHoverOff'">
-		<td>{$APP[$value.0]}</td>
-		<td>{$value.1}</td>
-		<td>{$value.2}</td>
-		<td>{$value.3}</td>
-		</tr>
-		{/foreach}
-		
-		</table>
-		</td>
-		</tr>
-		</table>
-		</td>
-		</tr>
-		</table>
-		</td>
-		</tr>
-		</table>
-		</div>
-		
-		<div id="field_privileges" style="display:none;">
-		<table border="0" cellspacing="0" cellpadding="5" width="100%" >
-		<tr>
-		<td><table border="0" cellspacing="0" cellpadding="5" width="100%" class="small">
-		<tr>
-		<td><!-- Module name heading -->
-		<table border="0" cellspacing="0" cellpadding="2" class="small">
-		<tr>
-		<td valign="top" ><img src="{$IMAGE_PATH}prvPrfHdrArrow.gif" /> </td>
-
-		<td class="prvPrfBigText"><b> {$CMOD.LBL_FIELD_PRIVILEGES} {$CMOD.LBL_FOR} "{$PROFILE_NAME}"</b> <br />
-		<font class="small">{$CMOD.LBL_FIELD_MESG_OPTION} </font> </td>
-		</tr>
-		</table></td>
-		<td align="right" valign="bottom">
-			<input type="hidden" id="selected_tab" name="selected_tab" value="{$SELECTED_TAB}">
-			<input type="hidden" id="selected_module" name="selected_module" value="{$SELECTED_MODULE}">
-			<input type="submit" value="{$APP.LBL_EDIT_BUTTON_LABEL}" class="crmButton small edit" name="edit">
-		</td>	
-		</tr>
-		</table>
-		<!-- privilege lists -->
-		<table border="0" cellspacing="0" cellpadding="0" width="100%" >
-		<tr>
-		<td align="center" style="height:10px"><img src="{$IMAGE_PATH}prvPrfLine.gif" style="width:100%;height:1px" /></td>
-		</tr>
-
-		</table>
-		<table border="0" cellspacing="0" cellpadding="10" width="100%">
-		<tr>
-		<td >
-		<table border="0" cellspacing="0" cellpadding="5" width="100%" class="small">
-		<tr>
-		<td>
-		<select id="module_list" name="module_list" onchange="showmoduleperm(this)">
-		{foreach key=module item=label from=$PRI_FIELD_LIST}
-			<option value="{$label}">{$APP.$label}</option>
-		{/foreach}
-		</td>
-		<td width=50%>&nbsp;</td>
-		</tr>
-		<tr>
-		<td colspan=2>
-	
-		{foreach key=module item=value from=$FIELD_PRIVILEGES}
-		<div id="field_{$module}" style="display:none;">
-		<table border="0" cellspacing="0" cellpadding="5" width="100%" class="small">
-		{foreach item=row_value from=$value}
-		<tr>
-		{foreach item=element from=$row_value}
-		<td class="prvPrfTexture" style="width:5px">&nbsp;</td>
-		<td id="fldperm{$element.0}">{$element.1}</td>
-		<td onMouseOver="this.className='prvPrfHoverOn',$('fldperm{$element.0}').className='prvPrfHoverOn'" onMouseOut="this.className='prvPrfHoverOff',$('fldperm{$element.0}').className='prvPrfHoverOff' ">{$element.0}</td>
-		{/foreach}
-		</tr>
-		{/foreach}
-		</table>
-		</div>
-		{/foreach}
-		
-		</td>
-		</tr>
-		</table></td>
-		</tr>
-		</table></td>
-		</tr>
-		</table>
-		</div>
-	
-		<div id="utility_privileges" style="display:none;">
-		<table border=0 cellspacing=0 cellpadding=5 width=100% >
-		<tr>
-		<td>
-		<table border=0 cellspacing=0 cellpadding=5 width=100% class=small>
-		<tr>
-		<td>
-		<!-- Module name heading -->
-		<table border=0 cellspacing=0 cellpadding=2 class=small>
-		<tr>
-		<td valign=top >
-		<img src="{$IMAGE_PATH}prvPrfHdrArrow.gif">
-		</td>
-		<td class="prvPrfBigText">
-		<b> {$CMOD.LBL_UTILITY_PRIVILEGES} {$CMOD.LBL_FOR} "{$PROFILE_NAME}"</b> <br>
-		<font class=small>{$CMOD.LBL_UTILITY_MESG_OPTION}  </font> 
-		</td>
-		</tr>
-		</table>
-		</td>
-		<td align=right valign=bottom>
-			<input type="hidden" id="selected_tab" name="selected_tab" value="{$SELECTED_TAB}">
-		        <input type="hidden" id="selected_module" name="selected_module" value="{$SELECTED_MODULE}">
-			<input type="submit" value="{$APP.LBL_EDIT_BUTTON_LABEL}" class="crmButton small edit" name="edit"></td>
-		</tr>
-		</table>
-		<!-- privilege lists -->
-		<table border=0 cellspacing=0 cellpadding=0 width=100% >
-		<tr>
-		<td align=center style="height:10px"><img src="{$IMAGE_PATH}prvPrfLine.gif" style="width:100%;height:1px"></td>
-		</tr>
-		</table>
-		<table border=0 cellspacing=0 cellpadding=10 width=100%>
-		<tr>
-		<td >
-		<!-- Home tab -->
-		<table border="0" cellspacing="0" cellpadding="5" width="90%" class="small" align="center" >
-		
-		{foreach key=module item=value from=$UTILITIES_PRIV}
-		<tr>
-		<td colspan="4" style="border-bottom:1px solid #efefef"><b>{$APP.$module}</b></td>
-		</tr>
-		<tr>
-		<td class="prvPrfTexture" style="width:20px">&nbsp;</td>
-		<td width="97%" valign="top" onmouseover="this.className='prvPrfHoverOn'" onmouseout="this.className='prvPrfHoverOff'" >
-		<table border="0" cellspacing="0" cellpadding="5" width="100%" class="small">
-		{foreach item=element from=$value}
-		<tr>
-		<td width=25%>{$APP[$element.0.0]}</td>
-		<td width=25%>{$element.0.1}</td>
-		<td width=25%>{$APP[$element.1.0]}</td>
-		<td width=25%>{$element.1.1}</td>
-		{/foreach}
-		</tr>
-		</table>
-		</td>
-		</tr>
-		
-		{/foreach}
-		</table>
-		</td>
-		</tr>
-		</table>
-		</td>
-		</tr>
-
-		</table>
-
-		</div>
-
-	
-
-                            <table border="0" cellspacing="0" cellpadding="0" width="100%" class="small">
-                              <tr>
-                                <td><img src="{$IMAGE_PATH}prvPrfBottomLeft.gif" /></td>
-                                <td class="prvPrfBottomBg" width="100%"></td>
-                                <td><img src="{$IMAGE_PATH}prvPrfBottomRight.gif" /></td>
-                              </tr>
-                          </table>
-			
-			</td>
-                      </tr>
-                    </table>
-					<p>&nbsp;</p>
-					<table border=0 cellspacing=0 cellpadding=5 width=100% >
-					<tr><td class="small" nowrap align=right><a href="#top">{$MOD.LBL_SCROLL}</a></td></tr>
-					</table>
-				
+          </tbody>
+	  </table>
+	</td>
+        </tr>
+        </tbody>
+	</table>
+      </td>
+      </tr>
+      </tbody></table>
+      <table class="small" border="0" cellpadding="0" cellspacing="0" width="100%">
+           <tbody><tr>
+                <td><img src="{$IMAGE_PATH}prvPrfBottomLeft.gif"></td>
+                <td class="prvPrfBottomBg" width="100%"></td>
+                <td><img src="{$IMAGE_PATH}prvPrfBottomRight.gif"></td>
+                </tr>
+            </tbody>
+      </table></td>
+      </tr>
+      </tbody></table>
+	<p>&nbsp;</p>
+	<table border="0" cellpadding="5" cellspacing="0" width="100%">
+	<tbody><tr><td class="small" align="right" nowrap="nowrap"><a href="#top">{$MOD.LBL_SCROLL}</a></td></tr>
+	</tbody></table>
 					
-					
-				</td>
-				</tr>
-				</table>
-			
-			
-			
-			</td>
-			</tr>
-			</table>
-		</td>
+	</td>
+	</tr>
+	</tbody></table>
+	</form>	
+	<!-- End of Display -->
+	</td>
 	</tr>
 	</table>
-		
+	</td>
+	</tr>
+	</table>
 	</div>
 
-</td>
-        <td valign="top"><img src="{$IMAGE_PATH}showPanelTopRight.gif"></td>
-   </tr>
+	</td>
+	<td valign="top"><img src="{$IMAGE_PATH}showPanelTopRight.gif"></td>
+	</tr>
 </tbody>
 </table>
-
 <script language="javascript" type="text/javascript">
-var Selected_div= '{$SELECTED_TAB}';
-divarray = new Array('global_privileges','tab_privileges','standard_privileges','field_privileges','utility_privileges'); 	
-tabarray = new Array('prvPrfTab1','prvPrfTab2','prvPrfTab3','prvPrfTab4','prvPrfTab5'); 	
-var defaultmodule = '{$SELECTED_MODULE}';
-function set_default()
-{ldelim}
-	show (Selected_div);
-	show (defaultmodule);
-	for(i = 0; i < divarray.length ;i++)
-	{ldelim}
-		if(divarray[i] == Selected_div)
-			break;	
-	{rdelim}
-	document.getElementById(tabarray[i]).className="prvPrfSelectedTab";
-	module_combo = document.getElementById('module_list');
-	module_combo_selected = defaultmodule.replace(/field_/gi,'')
-	for(i = 0; i < module_combo.length;i++)
-	{ldelim}
-		if(module_combo.options[i].value == module_combo_selected)
-		{ldelim}	
-			module_combo.options[i].selected = true;	
-			break;	
-		{rdelim}	
-	{rdelim}
-{rdelim}
-set_default();
-function toggleshowhide(currentselecteddiv,currentselectedtab)
-{ldelim}
-	for(i = 0; i < divarray.length ;i++)
-	{ldelim}
-		if(Selected_div == divarray[i])
-			break;	
-	{rdelim}	
-	hide (Selected_div);
-	document.getElementById(tabarray[i]).className="prvPrfUnSelectedTab";
-	show (currentselecteddiv);
-	document.getElementById(currentselectedtab).className="prvPrfSelectedTab";
-	Selected_div = currentselecteddiv;
-	document.getElementById('selected_tab').value =	Selected_div; 	
-{rdelim}	
-function showmoduleperm(selectmodule_view)
-{ldelim}
-	hide(defaultmodule);
-	defaultmodule='field_'+selectmodule_view.options[selectmodule_view.options.selectedIndex].value;
-	show(defaultmodule);
-	document.getElementById('selected_module').value = defaultmodule;	
-{rdelim}	
-	
+{literal}
+function fnToggleVIew(obj){
+	var tagStyle = document.getElementById(obj).className;
+	if(tagStyle == 'hideTable')
+		document.getElementById(obj).className = 'showTable';
+	else
+		document.getElementById(obj).className = 'hideTable';
+}
+{/literal}
 </script>

Modified: vtigercrm/trunk/modules/Users/CreateProfile.php
==============================================================================
--- vtigercrm/trunk/modules/Users/CreateProfile.php (original)
+++ vtigercrm/trunk/modules/Users/CreateProfile.php Thu Jun 22 05:55:20 2006
@@ -14,36 +14,57 @@
 require_once('include/database/PearDatabase.php');
 require_once('include/utils/utils.php');
 
+$profilename=$_REQUEST['profile_name'];
+
+if(isset($_REQUEST['dup_check']) && $_REQUEST['dup_check']!='')
+{
+        $query = 'select profilename from vtiger_profile where profilename="'.$profilename.'"';
+        $result = $adb->query($query);
+
+        if($adb->num_rows($result) > 0)
+        {
+                echo 'A Profile in the specified name "'.$profilename.'" already exists';
+                die;
+        }else
+        {
+                echo 'SUCESS';
+                die;
+        }
+
+}
+
+
 global $theme;
 $theme_path="themes/".$theme."/";
 $image_path=$theme_path."images/";
 $smarty = new vtigerCRM_Smarty;
+
 if(isset($_REQUEST['parent_profile']) && $_REQUEST['parent_profile'] != '')
 	$smarty->assign("PARENT_PROFILE",$_REQUEST['parent_profile']);
 if(isset($_REQUEST['radio_button']) && $_REQUEST['radio_button'] != '')
 	$smarty->assign("RADIO_BUTTON",$_REQUEST['radio_button']);
 if(isset($_REQUEST['profile_name']) && $_REQUEST['profile_name'] != '')
 	$smarty->assign("PROFILE_NAME",$_REQUEST['profile_name']);
+if(isset($_REQUEST['profile_description']) && $_REQUEST['profile_description'] != '')
+	$smarty->assign("PROFILE_DESCRIPTION",$_REQUEST['profile_description']);
 if(isset($_REQUEST['mode']) && $_REQUEST['mode'] != '')
 	$smarty->assign("MODE",$_REQUEST['mode']);
-if(isset($_REQUEST['profile_name']) && $_REQUEST['profile_name'] != '')
-	$smarty->assign("PROFILENAME",$_REQUEST['profile_name']);
-if(isset($_REQUEST['profile_description']) && $_REQUEST['profile_description'] != '')	
-	$smarty->assign("PROFILEDESC",$_REQUEST['profile_description']);
-if(isset($_REQUEST['profileid']) && $_REQUEST['profileid'] != '')
-{
-	global $adb;	
-	$sql = "select * from vtiger_profile where profileid=".$_REQUEST['profileid'];
-	$profileResult = $adb->query($sql);
-	$profile_name = $adb->query_result($profileResult,0,"profilename");
-	$profile_description = $adb->query_result($profileResult,0,"description");
-	$smarty->assign("PROFILE_NAME",$profile_name);
-	$smarty->assign("PROFILE_DESCRIPTION",$profile_description);
-}
 
 $smarty->assign("MOD", return_module_language($current_language,'Settings'));
 $smarty->assign("IMAGE_PATH",$image_path);
 $smarty->assign("APP", $app_strings);
 $smarty->assign("CMOD", $mod_strings);
+
+$sql = "select * from vtiger_profile";
+$result = $adb->query($sql);
+$profilelist = array();
+$temprow = $adb->fetch_array($result);
+do
+{
+	$name=$temprow["profilename"];
+	$profileid=$temprow["profileid"];
+	$profilelist[] = array($name,$profileid); 
+}while($temprow = $adb->fetch_array($result));
+$smarty->assign("PROFILE_LISTS", $profilelist);
                     
 $smarty->display("CreateProfile.tpl");

Modified: vtigercrm/trunk/modules/Users/profilePrivileges.php
==============================================================================
--- vtigercrm/trunk/modules/Users/profilePrivileges.php (original)
+++ vtigercrm/trunk/modules/Users/profilePrivileges.php Thu Jun 22 05:55:20 2006
@@ -143,7 +143,7 @@
 		$stand[]=$tab_create_per;
 		$stand[]=$tab_delete_per;
 		$stand[]=$tab_view_per;
-		$privileges_stand[]=$stand;
+		$privileges_stand[$tabid]=$stand;
 	}
 }
 if($mode == 'edit')
@@ -167,7 +167,7 @@
 		$stand[]=$tab_create_per;
 		$stand[]=$tab_delete_per;
 		$stand[]=$tab_view_per;
-		$privileges_stand[]=$stand;
+		$privileges_stand[$tabid]=$stand;
 	}
 }
 if($mode == 'create')
@@ -193,7 +193,7 @@
 			$stand[]=$tab_create_per;
 			$stand[]=$tab_delete_per;
 			$stand[]=$tab_view_per;
-			$privileges_stand[]=$stand;
+			$privileges_stand[$tabid]=$stand;
 		}	
 	}
 	else
@@ -217,7 +217,7 @@
 			$stand[]=$tab_create_per;
 			$stand[]=$tab_delete_per;
 			$stand[]=$tab_view_per;
-			$privileges_stand[]=$stand;
+			$privileges_stand[$tabid]=$stand;
 		}
 	}
 
@@ -238,7 +238,7 @@
 		$tab_allow_per = getDisplayValue($tab_allow_per_id,$tabid,'');	
 		$tab[]=$entity_name;
 		$tab[]=$tab_allow_per;
-		$privileges_tab[]=$tab;
+		$privileges_tab[$tabid]=$tab;
 	}
 }
 if($mode == 'edit')
@@ -253,7 +253,7 @@
 		$tab_allow_per = getDisplayOutput($tab_allow_per_id,$tabid,'');	
 		$tab[]=$entity_name;
 		$tab[]=$tab_allow_per;
-		$privileges_tab[]=$tab;
+		$privileges_tab[$tabid]=$tab;
 	}
 }
 if($mode == 'create')
@@ -270,7 +270,7 @@
 			$tab_allow_per = getDisplayOutput($tab_allow_per_id,$tabid,'');	
 			$tab[]=$entity_name;
 			$tab[]=$tab_allow_per;
-			$privileges_tab[]=$tab;
+			$privileges_tab[$tabid]=$tab;
 		}
 	}
 	else
@@ -285,12 +285,11 @@
 			$tab_allow_per = getDisplayOutput(0,$tabid,'');	
 			$tab[]=$entity_name;
 			$tab[]=$tab_allow_per;
-			$privileges_tab[]=$tab;
-		}
-	}
-
-}
-$privileges_tab = array_chunk($privileges_tab, 4);
+			$privileges_tab[$tabid]=$tab;
+		}
+	}
+
+}
 $smarty->assign("TAB_PRIV",$privileges_tab);			
 
 //utilities privileges
@@ -312,8 +311,8 @@
 			$util[]=$tab_util_per;
 		}
 		$util=array_chunk($util,2);
-		$util=array_chunk($util,2);
-		$privilege_util[$entity_name] = $util;
+		$util=array_chunk($util,3);
+		$privilege_util[$tabid] = $util;
 	}
 }
 elseif($mode == 'edit')
@@ -333,8 +332,8 @@
 			$util[]=$tab_util_per;
 		}
 		$util=array_chunk($util,2);
-		$util=array_chunk($util,2);
-		$privilege_util[$entity_name] = $util;
+		$util=array_chunk($util,3);
+		$privilege_util[$tabid] = $util;
 	}
 }
 elseif($mode == 'create')
@@ -356,8 +355,8 @@
 				$util[]=$tab_util_per;
 			}
 			$util=array_chunk($util,2);
-			$util=array_chunk($util,2);
-			$privilege_util[$entity_name] = $util;
+			$util=array_chunk($util,3);
+			$privilege_util[$tabid] = $util;
 		}
 	}
 	else
@@ -377,8 +376,8 @@
 				$util[]=$tab_util_per;
 			}
 			$util=array_chunk($util,2);
-			$util=array_chunk($util,2);
-			$privilege_util[$entity_name] = $util;
+			$util=array_chunk($util,3);
+			$privilege_util[$tabid] = $util;
 		}
 
 	}
@@ -407,6 +406,7 @@
 	{
 		$field_module=array();
 		$module_name=key($fieldListResult);
+		$module_id = getTabid($module_name);
 		for($j=0; $j<count($fieldListResult[$module_name]); $j++)
 		{
 			$field=array();
@@ -422,7 +422,7 @@
 			$field[]=$visible;
 			$field_module[]=$field;
 		}
-		$privilege_field[$module_name] = array_chunk($field_module,4);
+		$privilege_field[$module_id] = array_chunk($field_module,3);
 		next($fieldListResult);
 	}
 }
@@ -433,6 +433,7 @@
 	{
 		$field_module=array();
 		$module_name=key($fieldListResult);
+		$module_id = getTabid($module_name);
 		for($j=0; $j<count($fieldListResult[$module_name]); $j++)
 		{
 			$fldLabel= $fieldListResult[$module_name][$j][0];
@@ -455,10 +456,10 @@
 				$visible = "";
 			}
 			$field[]=$mandatory.' '.$fldLabel;
-			$field[]='<input type="checkbox" name="'.$fieldListResult[$module_name][$j][4].'" '.$visible.' '.$readonly.'>';
+			$field[]='<input id="'.$module_id.'_field_'.$fieldListResult[$module_name][$j][4].'" onClick="selectUnselect(this);" type="checkbox" name="'.$fieldListResult[$module_name][$j][4].'" '.$visible.' '.$readonly.'>';
 			$field_module[]=$field;
 		}
-		$privilege_field[$module_name] = array_chunk($field_module,4);
+		$privilege_field[$module_id] = array_chunk($field_module,3);
 		next($fieldListResult);
 	}
 }
@@ -471,6 +472,7 @@
 		{
 			$field_module=array();
 			$module_name=key($fieldListResult);
+			$module_id = getTabid($module_name);
 			for($j=0; $j<count($fieldListResult[$module_name]); $j++)
 			{
 				$fldLabel= $fieldListResult[$module_name][$j][0];
@@ -493,10 +495,10 @@
 					$visible = "";
 				}
 				$field[]=$mandatory.' '.$fldLabel;
-				$field[]='<input type="checkbox" name="'.$fieldListResult[$module_name][$j][4].'" '.$visible.' '.$readonly.'>';
+				$field[]='<input type="checkbox" id="'.$module_id.'_field_'.$fieldListResult[$module_name][$j][4].'" onClick="selectUnselect(this);" name="'.$fieldListResult[$module_name][$j][4].'" '.$visible.' '.$readonly.'>';
 				$field_module[]=$field;
 			}
-			$privilege_field[$module_name] = array_chunk($field_module,4);
+			$privilege_field[$module_id] = array_chunk($field_module,3);
 			next($fieldListResult);
 		}
 	}
@@ -507,6 +509,7 @@
 		{
 			$field_module=array();
 			$module_name=key($fieldListResult);
+			$module_id = getTabid($module_name);
 			for($j=0; $j<count($fieldListResult[$module_name]); $j++)
 			{
 				$fldLabel= $fieldListResult[$module_name][$j][0];
@@ -522,10 +525,10 @@
 				}	
 				$visible = "checked";
 				$field[]=$mandatory.' '.$fldLabel;
-				$field[]='<input type="checkbox" name="'.$fieldListResult[$module_name][$j][4].'" '.$visible.' '.$readonly.'>';
+				$field[]='<input type="checkbox" id="'.$module_id.'_field_'.$fieldListResult[$module_name][$j][4].'"  onClick="selectUnselect(this);" name="'.$fieldListResult[$module_name][$j][4].'" '.$visible.' '.$readonly.'>';
 				$field_module[]=$field;
 			}
-			$privilege_field[$module_name] = array_chunk($field_module,4);
+			$privilege_field[$module_id] = array_chunk($field_module,3);
 			next($fieldListResult);
 		}	
 	}
@@ -581,11 +584,11 @@
 	}
 	elseif($id == 0)
 	{
-		$value = '<input type="checkbox" name="'.$name.'" checked>';
+		$value = '<input type="checkbox" id="'.$name.'_chk" onClick="invoke'.$name.'();" name="'.$name.'" checked>';
 	}
 	elseif($id == 1)
 	{
-		$value = '<input type="checkbox" name="'.$name.'">';
+		$value = '<input type="checkbox" id="'.$name.'_chk" onClick="invoke'.$name.'();" name="'.$name.'">';
 	}
 	return $value;
 
@@ -620,11 +623,25 @@
 	if($actionid == '')
 	{
 		$name = $tabid.'_tab';
+		$ckbox_id = 'tab_chk_com_'.$tabid; 
+		$jsfn = 'hideTab('.$tabid.')';
 	}
 	else
 	{
 		$temp_name = getActionname($actionid);
 		$name = $tabid.'_'.$temp_name;
+		$ckbox_id = 'tab_chk_'.$actionid.'_'.$tabid; 
+		if($actionid == 1)	
+			$jsfn = 'unSelectCreate('.$tabid.')'; 
+		elseif($actionid == 4)	
+			$jsfn = 'unSelectView('.$tabid.')';
+		elseif($actionid == 2)	
+			$jsfn = 'unSelectDelete('.$tabid.')';
+		else
+		{
+			$ckbox_id = $tabid.'_field_util_'.$actionid; 
+			$jsfn = 'javascript:';
+		}	
 	}
 
 
@@ -635,11 +652,11 @@
 	}
 	elseif($id == 0)
 	{
-		$value = '<input type="checkbox" name="'.$name.'" checked>';
+		$value = '<input type="checkbox" onClick="'.$jsfn.';" id="'.$ckbox_id.'" name="'.$name.'" checked>';
 	}
 	elseif($id == 1)
 	{
-		$value = '<input type="checkbox" name="'.$name.'">';
+		$value = '<input type="checkbox" onClick="'.$jsfn.';" id="'.$ckbox_id.'" name="'.$name.'">';
 	}
 	return $value;
 





More information about the vtigercrm-commits mailing list