[Vtigercrm-commits] [vtiger-commits] r4336 - in /vtigercrm/trunk: Smarty/templates/Settings.tpl Smarty/templates/SettingsMenu.tpl modules/Settings/SettingsSubMenu.php modules/Users/DefaultFieldPermissions.php modules/Users/EditDefOrgFieldLevelAccess.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon Mar 20 09:06:42 EST 2006


Author: saraj
Date: Mon Mar 20 07:06:31 2006
New Revision: 4336

Log:
new UI for field access has been integrated

Modified:
    vtigercrm/trunk/Smarty/templates/Settings.tpl
    vtigercrm/trunk/Smarty/templates/SettingsMenu.tpl
    vtigercrm/trunk/modules/Settings/SettingsSubMenu.php
    vtigercrm/trunk/modules/Users/DefaultFieldPermissions.php
    vtigercrm/trunk/modules/Users/EditDefOrgFieldLevelAccess.php

Modified: vtigercrm/trunk/Smarty/templates/Settings.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/Settings.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/Settings.tpl Mon Mar 20 07:06:31 2006
@@ -39,8 +39,8 @@
 <a href="index.php?module=Users&action=OrgSharingDetailView&parenttab=Settings" alt="{$MOD.LBL_SETTING_DEFAULT_SHARING_ACCESS}" title="{$MOD.LBL_SETTING_DEFAULT_SHARING_ACCESS}">{$MOD.LBL_DEFAULT_ORGANIZATION_SHARING_ACCESS}</a>
 </td>
 
-<td><a href="index.php?module=Settings&action=SettingsSubMenu&type=Organization&parenttab=Settings"><img src="{$IMAGE_PATH}user_mgmt.gif" alt="{$MOD.LBL_SETTING_DEFAULT_ORGANIZATION_FIELDS}" title="{$MOD.LBL_SETTING_DEFAULT_ORGANIZATION_FIELDS}" border="0"/></a><br>						
-<a href="index.php?module=Settings&action=SettingsSubMenu&type=Organization&parenttab=Settings" alt="{$MOD.LBL_SETTING_DEFAULT_ORGANIZATION_FIELDS}" title="{$MOD.LBL_SETTING_DEFAULT_ORGANIZATION_FIELDS}">{$MOD.LBL_DEFAULT_ORGANIZATION_FIELDS}</a></td>
+<td><a href="index.php?module=Users&action=DefaultFieldPermissions&parenttab=Settings"><img src="{$IMAGE_PATH}user_mgmt.gif" alt="{$MOD.LBL_SETTING_DEFAULT_ORGANIZATION_FIELDS}" title="{$MOD.LBL_SETTING_DEFAULT_ORGANIZATION_FIELDS}" border="0"/></a><br>						
+<a href="index.php?module=Users&action=DefaultFieldPermissions&parenttab=Settings" alt="{$MOD.LBL_SETTING_DEFAULT_ORGANIZATION_FIELDS}" title="{$MOD.LBL_SETTING_DEFAULT_ORGANIZATION_FIELDS}">{$MOD.LBL_DEFAULT_ORGANIZATION_FIELDS}</a></td>
 
 <td><a href="index.php?module=Users&action=Announcements&parenttab=Settings"><img src="{$IMAGE_PATH}user_mgmt.gif" alt="{$MOD.LBL_SETTING_ANNOUNCEMENT}" title="{$MOD.LBL_SETTING_ANNOUNCEMENT}" border="0" /></a><br>
 <a href="index.php?module=Users&action=Announcements&parenttab=Settings" alt="{$MOD.LBL_SETTING_ANNOUNCEMENT}" title="{$MOD.LBL_SETTING_ANNOUNCEMENT}">{$MOD.LBL_ANNOUNCEMENT}</a></td>

Modified: vtigercrm/trunk/Smarty/templates/SettingsMenu.tpl
==============================================================================
--- vtigercrm/trunk/Smarty/templates/SettingsMenu.tpl (original)
+++ vtigercrm/trunk/Smarty/templates/SettingsMenu.tpl Mon Mar 20 07:06:31 2006
@@ -22,7 +22,7 @@
 	<a href="index.php?module=Users&action=ListProfiles&parenttab=Settings" class="lftSubMnu">{$MOD.LBL_PROFILES}</a>	
 	<a href="index.php?module=Users&action=listgroups&parenttab=Settings" class="lftSubMnu">{$MOD.USERGROUPLIST}</a>
 	<a href="index.php?module=Users&action=OrgSharingDetailView&parenttab=Settings" class="lftSubMnu">{$MOD.LBL_DEFAULT_ORGANIZATION_SHARING_ACCESS}</a>
-	<a href="index.php?module=Settings&action=SettingsSubMenu&type=Organization&parenttab=Settings" class="lftSubMnu" onmouseover="fnvsh(this,'subMnuFldAccess')" onmouseout="fninvsh('subMnuFldAccess')">{$MOD.LBL_DEFAULT_ORGANIZATION_FIELDS}</a>
+	<a href="index.php?module=Users&action=DefaultFieldPermissions&parenttab=Settings" class="lftSubMnu">{$MOD.LBL_DEFAULT_ORGANIZATION_FIELDS}</a>
 	<a href="index.php?module=Users&action=Announcements&parenttab=Settings" class="lftSubMnu" class="lftSubMnu">{$MOD.LBL_ANNOUNCEMENT}</a>
 </div></div>
 

Modified: vtigercrm/trunk/modules/Settings/SettingsSubMenu.php
==============================================================================
--- vtigercrm/trunk/modules/Settings/SettingsSubMenu.php (original)
+++ vtigercrm/trunk/modules/Settings/SettingsSubMenu.php Mon Mar 20 07:06:31 2006
@@ -21,11 +21,8 @@
 $smarty = new vtigerCRM_Smarty;
 $smarty->assign("MOD", $mod_strings);
 $smarty->assign("IMAGE_PATH", $image_path);
-if($_REQUEST['type']=='Organization')
-	$smarty->display("Organizationindex.tpl");
-elseif($_REQUEST['type']=='FieldAccess')
-	$smarty->display("FieldAccessindex.tpl");
-elseif($_REQUEST['type']=='CustomField')
+
+if($_REQUEST['type']=='CustomField')
 	$smarty->display("CustomFieldindex.tpl");
 elseif($_REQUEST['type']=='PickList')
 	$smarty->display("PickListindex.tpl");

Modified: vtigercrm/trunk/modules/Users/DefaultFieldPermissions.php
==============================================================================
--- vtigercrm/trunk/modules/Users/DefaultFieldPermissions.php (original)
+++ vtigercrm/trunk/modules/Users/DefaultFieldPermissions.php Mon Mar 20 07:06:31 2006
@@ -12,7 +12,6 @@
 
 
 require_once('include/database/PearDatabase.php');
-require_once('XTemplate/xtpl.php');
 require_once('themes/'.$theme.'/layout_utils.php');
 require_once('include/utils/UserInfoUtil.php');
 require_once('include/utils/utils.php');
@@ -21,9 +20,9 @@
 global $app_strings;
 global $app_list_strings;
 
-echo '<form action="index.php" method="post" name="new" id="form">';
-echo get_module_title("Users", $_REQUEST['fld_module'].': '.$mod_strings['LBL_FIELD_LEVEL_ACCESS'], true);
-echo '<BR>';
+$smarty = new vtigerCRM_Smarty;
+
+//echo get_module_title("Users", $_REQUEST['fld_module'].': '.$mod_strings['LBL_FIELD_LEVEL_ACCESS'], true);
 
 global $adb;
 global $theme;
@@ -33,59 +32,26 @@
 $image_path=$theme_path."images/";
 require_once($theme_path.'layout_utils.php');
 
-$fld_module = $_REQUEST["fld_module"];
-//Retreiving the fields array
-
-$xtpl=new XTemplate ('modules/Users/DefaultFieldPermissions.html');
-
-$fieldListResult = getDefOrgFieldList($fld_module);
-$noofrows = $adb->num_rows($fieldListResult);
-$standCustFld = getStdOutput($fieldListResult, $noofrows, $mod_strings,$profileid);
+$field_module = Array('Leads','Accounts','Contacts','Potentials','HelpDesk','Products','Notes','Emails','Activities','Events','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice');
+$allfields=Array();
+foreach($field_module as $fld_module)
+{
+	$fieldListResult = getDefOrgFieldList($fld_module);
+	$noofrows = $adb->num_rows($fieldListResult);
+	$allfields[$fld_module] = getStdOutput($fieldListResult, $noofrows, $mod_strings,$profileid);
+}
 
 //Standard PickList Fields
 function getStdOutput($fieldListResult, $noofrows, $mod_strings,$profileid)
 {
+	global $adb;
 	global $image_path;
-	global $adb;
-	global $app_strings;
-	$standCustFld = '';
-	$standCustFld .= '<input type="hidden" name="fld_module" value="'.$_REQUEST['fld_module'].'">';
-	$standCustFld .= '<input type="hidden" name="module" value="Users">';
-	//$standCustFld .= '<input type="hidden" name="profileid" value="'.$profileid.'">';
-	$standCustFld .= '<input type="hidden" name="action" value="EditDefOrgFieldLevelAccess">';
-	$standCustFld .= '<input title="Edit" accessKey="C" class="button" type="submit" name="Edit" value="'.$app_strings['LBL_EDIT_BUTTON'].'">';
-	$standCustFld .= '<BR><BR>';
-	$standCustFld .= '<table border="0" cellpadding="0" cellspacing="0" width="40%"><tr><td>';
-	$standCustFld .=  get_form_header($mod_strings['LBL_FIELD_PERMISSIOM_TABLE_HEADER'], "", false );
-	$standCustFld .= '</td></tr><table>';
-	$standCustFld .= '<table border="0" cellpadding="5" cellspacing="1" class="FormBorder" width="40%">';
-	$standCustFld .=  '<tr class="ModuleListTitle" height=20>';
-	$standCustFld .=   '<td width="50%" nowrap class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;"><b>'.$mod_strings['LBL_FIELD_PERMISSION_FIELD_NAME'].'</b></td>';
-	$standCustFld .=  '<td class="moduleListTitle" style="padding:0px 3px 0px 3px;"><div align="center"><b>'.$mod_strings['LBL_FIELD_PERMISSION_VISIBLE'].'</b></div></td>';
-	$standCustFld .=  '</tr>';
-	
-	$row=1;
+	$standCustFld = Array();		
 	for($i=0; $i<$noofrows; $i++,$row++)
 	{
-		if ($row%2==0)
-		{
-			$trowclass = 'evenListRow';
-		}
-		else
-		{	
-			$trowclass = 'oddListRow';
-		}
-
-		$standCustFld .= '<tr class="'.$trowclass.'">';
+		$uitype = $adb->query_result($fieldListResult,$i,"uitype");
+		$standCustFld []= $adb->query_result($fieldListResult,$i,"fieldlabel");
 		
-		$uitype = $adb->query_result($fieldListResult,$i,"uitype");
-		$mandatory = '';
-		if($uitype == 2 || $uitype == 51 || $uitype == 6 || $uitype == 22)	
-		{
-			//$mandatory = '<font color="red">'.$app_strings['LBL_REQUIRED_SYMBOL'].'</font>';
-		}
-
-		$standCustFld .= '<td height="21" nowrap style="padding:0px 3px 0px 3px;">'.$mandatory.' '.$adb->query_result($fieldListResult,$i,"fieldlabel").'</td>';
 		if($adb->query_result($fieldListResult,$i,"visible") == 0)
 		{
 			$visible = "<img src=".$image_path."/yes.gif>";
@@ -94,18 +60,20 @@
 		{
 			$visible = "<img src=".$image_path."/no.gif>";
 		}	
-		$standCustFld .= '<td height="21" style="padding:0px 3px 0px 3px;"><div align="center">'.$visible.'</div></td>';
+		$standCustFld []= $visible;
 	}
-	$standCustFld .='</table>';
-	//echo $standCustFld;	
+	$standCustFld=array_chunk($standCustFld,2);	
+	$standCustFld=array_chunk($standCustFld,2);	
 	return $standCustFld;
 }
-$xtpl->assign("MOD", $mod_strings);
-$xtpl->assign("STANDARDFIELDS", $standCustFld);
 
-
-$xtpl->parse("main");
-$xtpl->out("main");
-
-
+$smarty->assign("FIELD_INFO",$field_module);
+$smarty->assign("FIELD_LISTS",$allfields);
+$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);
+$smarty->assign("MODE",'view');                    
+                    
+$smarty->display("FieldAccess.tpl");
 ?>

Modified: vtigercrm/trunk/modules/Users/EditDefOrgFieldLevelAccess.php
==============================================================================
--- vtigercrm/trunk/modules/Users/EditDefOrgFieldLevelAccess.php (original)
+++ vtigercrm/trunk/modules/Users/EditDefOrgFieldLevelAccess.php Mon Mar 20 07:06:31 2006
@@ -21,70 +21,38 @@
 global $app_strings;
 global $app_list_strings;
 
-echo '<form action="index.php" method="post" name="new" id="form">';
-echo get_module_title("Users", $_REQUEST['fld_module'].': '.$mod_strings['LBL_FIELD_LEVEL_ACCESS'], true);
-echo '<BR>';
-//echo get_form_header("Standard Fields", "", false );
-
 global $adb;
 global $theme;
 $theme_path="themes/".$theme."/";
 $image_path=$theme_path."images/";
 require_once($theme_path.'layout_utils.php');
 
-$fld_module = $_REQUEST["fld_module"];
-//Retreiving the fields array
 
-$xtpl=new XTemplate ('modules/Users/EditDefOrgFieldLevelAccess.html');
-
-
-$fieldListResult = getDefOrgFieldList($fld_module);
-$noofrows = $adb->num_rows($fieldListResult);
-$standCustFld = getStdOutput($fieldListResult, $noofrows, $mod_strings,$profileid);
-
+$field_module = Array('Leads','Accounts','Contacts','Potentials','HelpDesk','Products','Notes','Emails','Activities','Events','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice');
+$allfields=Array();
+foreach($field_module as $fld_module)
+{
+	$fieldListResult = getDefOrgFieldList($fld_module);
+	$noofrows = $adb->num_rows($fieldListResult);
+	$allfields[$fld_module] = getStdOutput($fieldListResult, $noofrows, $mod_strings,$profileid);
+}
 //Standard PickList Fields
 function getStdOutput($fieldListResult, $noofrows, $mod_strings,$profileid)
 {
 	global $adb;
-	$standCustFld= '';
-	$standCustFld .= '<input type="hidden" name="fld_module" value="'.$_REQUEST['fld_module'].'">';
-	$standCustFld .= '<input type="hidden" name="module" value="Users">';
-	//$standCustFld .= '<input type="hidden" name="profileid" value="'.$profileid.'">';
-	$standCustFld .= '<input type="hidden" name="action" value="UpdateDefaultFieldLevelAccess">';
-	$standCustFld .= '<BR>';
-	$standCustFld .= '<table border="0" cellpadding="0" cellspacing="0" width="40%"><tr><td>';
-	$standCustFld .= get_form_header($mod_strings['LBL_FIELD_PERMISSIOM_TABLE_HEADER'], "", false );
-	$standCustFld .= '</td></tr></table>';
-	$standCustFld .= '<table border="0" cellpadding="5" cellspacing="1" class="FormBorder" width="40%">';
-	$standCustFld .=  '<tr class="ModuleListTitle" height=20>';
-	$standCustFld .=  '<td width="50%" nowrap class="moduleListTitle" height="21" style="padding:0px 3px 0px 3px;"><b>'.$mod_strings['LBL_FIELD_PERMISSION_FIELD_NAME'].'</b></td>';
-	$standCustFld .=  '<td class="moduleListTitle" style="padding:0px 3px 0px 3px;"><div align="center"><b>'.$mod_strings['LBL_FIELD_PERMISSION_VISIBLE'].'</b></div></td>';
-	$standCustFld .=  '</tr>';
-	
-	$row=1;
+	$standCustFld = Array();
 	for($i=0; $i<$noofrows; $i++,$row++)
 	{
-		if ($row%2==0)
-		{
-			$trowclass = 'evenListRow';
-		}
-		else
-		{	
-			$trowclass = 'oddListRow';
-		}
-
-		$standCustFld .= '<tr class="'.$trowclass.'">';
-		
 		$uitype = $adb->query_result($fieldListResult,$i,"uitype");
                 $mandatory = '';
 		$readonly = '';
                 if($uitype == 2 || $uitype == 51 || $uitype == 6 || $uitype == 22 || $uitype == 73 || $uitype == 24 || $uitype == 81 || $uitype == 50 || $uitype == 23 || $uitype == 16)
                 {
                         $mandatory = '<font color="red">*</font>';
-			$readonly = 'disabled';
+						$readonly = 'disabled';
                 }
 
-		$standCustFld .= '<td height="21" style="padding:0px 3px 0px 3px;">'.$mandatory.' '.$adb->query_result($fieldListResult,$i,"fieldlabel").'</td>';
+		$standCustFld []= $mandatory.' '.$adb->query_result($fieldListResult,$i,"fieldlabel");
 		if($adb->query_result($fieldListResult,$i,"visible") == 0)
 		{
 			$visible = "checked";
@@ -93,19 +61,21 @@
 		{
 			$visible = "";
 		}	
-		$standCustFld .= '<td height="21" style="padding:0px 3px 0px 3px;"><div align="center"><input type="checkbox" name="'.$adb->query_result($fieldListResult,$i,"fieldid").'" '.$visible.' '.$readonly.'></div></td></tr>';
+		$standCustFld []= '<input type="checkbox" name="'.$adb->query_result($fieldListResult,$i,"fieldid").'" '.$visible.' '.$readonly.'>';
 		
 	}
-	$standCustFld .= '</table>';
-	$standCustFld .= '<br><div align="center" style="width:40%"><input title="Update" accessKey="C" class="button" type="submit" name="Update" value="'.$mod_strings['LBL_BUTTON_UPDATE'].'"></div>';
-	$standCustFld .= '</form>';
-	//echo $standCustFld;
+	$standCustFld=array_chunk($standCustFld,2);	
+	$standCustFld=array_chunk($standCustFld,2);	
 	return $standCustFld;
 }
-$xtpl->assign("MOD", $mod_strings);
-$xtpl->assign("STANDARDFIELDS", $standCustFld);
-$xtpl->parse("main");
-$xtpl->out("main");
 
+$smarty->assign("FIELD_INFO",$field_module);
+$smarty->assign("FIELD_LISTS",$allfields);
+$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);
+$smarty->assign("MODE",'edit');                    
+$smarty->display("FieldAccess.tpl");
 
 ?>





More information about the vtigercrm-commits mailing list