[Vtigercrm-commits] [vtiger-commits] r10652 - /vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu Apr 12 06:52:20 EDT 2007
Author: saraj
Date: Thu Apr 12 04:52:15 2007
New Revision: 10652
Log:
* Fixed the issue with emails listview for non admin users (in Relatedlist also), Fixed #3270
Modified:
vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
Modified: vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php (original)
+++ vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php Thu Apr 12 04:52:15 2007
@@ -86,18 +86,26 @@
$field=Array();
if($is_admin==false)
{
- $profileList = getCurrentUserProfileList();
- $query = "SELECT DISTINCT vtiger_field.fieldname
- FROM vtiger_field
- INNER JOIN vtiger_profile2field
- ON vtiger_profile2field.fieldid = vtiger_field.fieldid
- INNER JOIN vtiger_def_org_field
- ON vtiger_def_org_field.fieldid = vtiger_field.fieldid
- WHERE vtiger_field.tabid = ".$tabid."
- AND vtiger_profile2field.visible = 0
- AND vtiger_def_org_field.visible = 0
- AND vtiger_profile2field.profileid IN ".$profileList."
- AND vtiger_field.fieldname IN ".$field_list;
+ if($module == 'Emails')
+ {
+ $query = "SELECT fieldname FROM vtiger_field WHERE tabid = $tabid";
+ }
+ else
+ {
+ $profileList = getCurrentUserProfileList();
+ $query = "SELECT DISTINCT vtiger_field.fieldname
+ FROM vtiger_field
+ INNER JOIN vtiger_profile2field
+ ON vtiger_profile2field.fieldid = vtiger_field.fieldid
+ INNER JOIN vtiger_def_org_field
+ ON vtiger_def_org_field.fieldid = vtiger_field.fieldid
+ WHERE vtiger_field.tabid = ".$tabid."
+ AND vtiger_profile2field.visible = 0
+ AND vtiger_def_org_field.visible = 0
+ AND vtiger_profile2field.profileid IN ".$profileList."
+ AND vtiger_field.fieldname IN ".$field_list;
+ }
+
$result = $adb->query($query);
for($k=0;$k < $adb->num_rows($result);$k++)
{
@@ -256,18 +264,26 @@
$field=Array();
if($is_admin==false && $module != 'Users')
{
- $profileList = getCurrentUserProfileList();
- $query = "SELECT DISTINCT vtiger_field.fieldname
- FROM vtiger_field
- INNER JOIN vtiger_profile2field
- ON vtiger_profile2field.fieldid = vtiger_field.fieldid
- INNER JOIN vtiger_def_org_field
- ON vtiger_def_org_field.fieldid = vtiger_field.fieldid
- WHERE vtiger_field.tabid = ".$tabid."
- AND vtiger_profile2field.visible=0
- AND vtiger_def_org_field.visible=0
- AND vtiger_profile2field.profileid IN ".$profileList."
- AND vtiger_field.fieldname IN ".$field_list;
+ if($module == 'Emails')
+ {
+ $query = "SELECT fieldname FROM vtiger_field WHERE tabid = $tabid";
+ }
+ else
+ {
+ $profileList = getCurrentUserProfileList();
+ $query = "SELECT DISTINCT vtiger_field.fieldname
+ FROM vtiger_field
+ INNER JOIN vtiger_profile2field
+ ON vtiger_profile2field.fieldid = vtiger_field.fieldid
+ INNER JOIN vtiger_def_org_field
+ ON vtiger_def_org_field.fieldid = vtiger_field.fieldid
+ WHERE vtiger_field.tabid = ".$tabid."
+ AND vtiger_profile2field.visible=0
+ AND vtiger_def_org_field.visible=0
+ AND vtiger_profile2field.profileid IN ".$profileList."
+ AND vtiger_field.fieldname IN ".$field_list;
+ }
+
$result = $adb->query($query);
for($k=0;$k < $adb->num_rows($result);$k++)
{
@@ -486,22 +502,32 @@
$field=Array();
if($is_admin==false)
{
- $profileList = getCurrentUserProfileList();
- $query = "SELECT DISTINCT vtiger_field.fieldname
- FROM vtiger_field
- INNER JOIN vtiger_profile2field
- ON vtiger_profile2field.fieldid = vtiger_field.fieldid
- INNER JOIN vtiger_def_org_field
- ON vtiger_def_org_field.fieldid = vtiger_field.fieldid";
- if($module == "Calendar")
- $query .=" WHERE vtiger_field.tabid in (9,16)";
- else
- $query .=" WHERE vtiger_field.tabid =".$tabid;
- $query .=" AND vtiger_profile2field.visible = 0
- AND vtiger_profile2field.visible = 0
- AND vtiger_def_org_field.visible = 0
- AND vtiger_profile2field.profileid IN ".$profileList."
- AND vtiger_field.fieldname IN ".$field_list;
+ if($module == 'Emails')
+ {
+ $query = "SELECT fieldname FROM vtiger_field WHERE tabid = $tabid";
+ }
+ else
+ {
+ $profileList = getCurrentUserProfileList();
+ $query = "SELECT DISTINCT vtiger_field.fieldname
+ FROM vtiger_field
+ INNER JOIN vtiger_profile2field
+ ON vtiger_profile2field.fieldid = vtiger_field.fieldid
+ INNER JOIN vtiger_def_org_field
+ ON vtiger_def_org_field.fieldid = vtiger_field.fieldid";
+
+ if($module == "Calendar")
+ $query .=" WHERE vtiger_field.tabid in (9,16)";
+ else
+ $query .=" WHERE vtiger_field.tabid =".$tabid;
+
+ $query .=" AND vtiger_profile2field.visible = 0
+ AND vtiger_profile2field.visible = 0
+ AND vtiger_def_org_field.visible = 0
+ AND vtiger_profile2field.profileid IN ".$profileList."
+ AND vtiger_field.fieldname IN ".$field_list;
+ }
+
$result = $adb->query($query);
for($k=0;$k < $adb->num_rows($result);$k++)
{
@@ -835,18 +861,26 @@
$field=Array();
if($is_admin==false && $module != 'Users')
{
- $profileList = getCurrentUserProfileList();
- $query = "SELECT DISTINCT vtiger_field.fieldname
- FROM vtiger_field
- INNER JOIN vtiger_profile2field
- ON vtiger_profile2field.fieldid = vtiger_field.fieldid
- INNER JOIN vtiger_def_org_field
- ON vtiger_def_org_field.fieldid = vtiger_field.fieldid
- WHERE vtiger_field.tabid = ".$tabid."
- AND vtiger_profile2field.visible = 0
- AND vtiger_def_org_field.visible = 0
- AND vtiger_profile2field.profileid IN ".$profileList."
- AND vtiger_field.fieldname IN ".$field_list;
+ if($module == 'Emails')
+ {
+ $query = "SELECT fieldname FROM vtiger_field WHERE tabid = $tabid";
+ }
+ else
+ {
+ $profileList = getCurrentUserProfileList();
+ $query = "SELECT DISTINCT vtiger_field.fieldname
+ FROM vtiger_field
+ INNER JOIN vtiger_profile2field
+ ON vtiger_profile2field.fieldid = vtiger_field.fieldid
+ INNER JOIN vtiger_def_org_field
+ ON vtiger_def_org_field.fieldid = vtiger_field.fieldid
+ WHERE vtiger_field.tabid = ".$tabid."
+ AND vtiger_profile2field.visible = 0
+ AND vtiger_def_org_field.visible = 0
+ AND vtiger_profile2field.profileid IN ".$profileList."
+ AND vtiger_field.fieldname IN ".$field_list;
+ }
+
$result = $adb->query($query);
for($k=0;$k < $adb->num_rows($result);$k++)
More information about the vtigercrm-commits
mailing list