[Vtigercrm-developers] [vtiger-commits] r3844 - /vtigercrm/trunk/include/utils/EditViewUtils.php

vtiger-commits at vtiger.fosslabs.com vtiger-commits at vtiger.fosslabs.com
Tue Feb 21 02:13:43 PST 2006


Author: richie
Date: Tue Feb 21 03:13:39 2006
New Revision: 3844

Log:
Segregated the create new & edit view across all modules. Added new paramater "info_type" in the getBlockInformation function.

Modified:
    vtigercrm/trunk/include/utils/EditViewUtils.php

Modified: vtigercrm/trunk/include/utils/EditViewUtils.php
==============================================================================
--- vtigercrm/trunk/include/utils/EditViewUtils.php (original)
+++ vtigercrm/trunk/include/utils/EditViewUtils.php Tue Feb 21 03:13:39 2006
@@ -813,11 +813,9 @@
 	
 	elseif($uitype == 71 || $uitype == 72)
 	{
-		$currencyid=fetchCurrency($current_user->id);
-                $curr_symbol=getCurrencySymbol($currencyid);
-		$rate = getConversionRate($currencyid,$curr_symbol);
-		$editview_label[]=$mod_strings[$fieldlabel].': ('.$curr_symbol.')';
-		$fieldvalue[] = convertFromDollar($value,$rate);
+		$disp_currency = getDisplayCurrency();
+		$editview_label[]=$mod_strings[$fieldlabel].': ('.$disp_currency.')';
+		$fieldvalue[] = $value;
 	}
 	elseif($uitype == 75 || $uitype ==81)
 	{
@@ -1192,7 +1190,7 @@
 
 
 
-function getBlockInformation($module, $block, $mode, $col_fields,$tabid)
+function getBlockInformation($module, $block, $mode, $col_fields,$tabid,$info_type='')
 {
 	//echo '*******************************<br>';
 	//echo '<pre>';print_r($col_fields);echo '</pre>';
@@ -1205,18 +1203,35 @@
 
 	global $current_user;
 	require('user_privileges/user_privileges_'.$current_user->id.'.php');
-	if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0)
-        {
-
-                $sql = "select field.* from field where field.tabid=".$tabid." and field.block=".$block ." and field.displaytype=1 order by sequence";
-        }
-        else
-        {
-                $profileList = getCurrentUserProfileList();
-
-		$sql = "select field.* from field inner join profile2field on profile2field.fieldid=field.fieldid inner join def_org_field on def_org_field.fieldid=field.fieldid  where field.tabid=".$tabid." and field.block=".$block ." and field.displaytype=1 and profile2field.visible=0 and def_org_field.visible=0 and profile2field.profileid in ".$profileList.=" group by field.fieldid order by sequence";
-	}
-	//echo $sql;	
+	
+	if ($info_type != '')
+	{
+		if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0)
+        	{
+
+                	$sql = "select field.* from field where field.tabid=".$tabid." and field.block=".$block ." and field.displaytype=1 and info_type = '".$info_type."' order by sequence";
+        	}
+        	else
+        	{
+                	$profileList = getCurrentUserProfileList();
+
+			$sql = "select field.* from field inner join profile2field on profile2field.fieldid=field.fieldid inner join def_org_field on def_org_field.fieldid=field.fieldid  where field.tabid=".$tabid." and field.block=".$block ." and field.displaytype=1 and info_type = '".$info_type."' and profile2field.visible=0 and def_org_field.visible=0 and profile2field.profileid in ".$profileList.=" group by field.fieldid order by sequence";
+		}
+	}
+	else
+	{
+		if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0)
+        	{
+
+                	$sql = "select field.* from field where field.tabid=".$tabid." and field.block=".$block ." and field.displaytype=1 order by sequence";
+        	}
+        	else
+        	{
+                	$profileList = getCurrentUserProfileList();
+
+			$sql = "select field.* from field inner join profile2field on profile2field.fieldid=field.fieldid inner join def_org_field on def_org_field.fieldid=field.fieldid  where field.tabid=".$tabid." and field.block=".$block ." and field.displaytype=1 and profile2field.visible=0 and def_org_field.visible=0 and profile2field.profileid in ".$profileList.=" group by field.fieldid order by sequence";
+		}
+	}
 
         $result = $adb->query($sql);
 	$noofrows = $adb->num_rows($result);





More information about the vtigercrm-developers mailing list