[Vtigercrm-commits] [vtiger-commits] r9881 - in /vtigercrm/branches/5.0.3/modules: Accounts/Accounts.php Contacts/Contacts.php Leads/Leads.php Potentials/Potentials.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Nov 21 07:15:57 EST 2006
Author: richie
Date: Tue Nov 21 05:15:49 2006
New Revision: 9881
Log:
* Modified the export query to get the group assigned records also
Modified:
vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php
vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php
vtigercrm/branches/5.0.3/modules/Leads/Leads.php
vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php
Modified: vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php (original)
+++ vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php Tue Nov 21 05:15:49 2006
@@ -672,7 +672,8 @@
$sql = getPermittedFieldsQuery("Accounts", "detail_view");
$fields_list = getFieldsListFromQuery($sql);
- $query = "SELECT $fields_list FROM ".$this->entity_table."
+ $query = "SELECT $fields_list, vtiger_accountgrouprelation.groupname as 'Assigned To Group'
+ FROM ".$this->entity_table."
INNER JOIN vtiger_account
ON vtiger_crmentity.crmid = vtiger_account.accountid
LEFT JOIN vtiger_accountbillads
@@ -686,14 +687,13 @@
LEFT JOIN vtiger_groups
ON vtiger_groups.groupname = vtiger_accountgrouprelation.groupname
LEFT JOIN vtiger_users
- ON vtiger_crmentity.smownerid = vtiger_users.id
+ ON vtiger_crmentity.smownerid = vtiger_users.id and vtiger_users.status = 'Active'
LEFT JOIN vtiger_account vtiger_account2
ON vtiger_account2.accountid = vtiger_account.parentid
";//vtiger_account2 is added to get the Member of account
- $where_auto = " vtiger_users.status = 'Active'
- AND vtiger_crmentity.deleted = 0 ";
+ $where_auto = " vtiger_crmentity.deleted = 0 ";
if($where != "")
$query .= "WHERE ($where) AND ".$where_auto;
Modified: vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php (original)
+++ vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php Tue Nov 21 05:15:49 2006
@@ -659,10 +659,10 @@
$sql = getPermittedFieldsQuery("Contacts", "detail_view");
$fields_list = getFieldsListFromQuery($sql);
- $query = "SELECT $fields_list
+ $query = "SELECT $fields_list, vtiger_contactgrouprelation.groupname as 'Assigned To Group'
FROM vtiger_contactdetails
inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid
- LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id
+ LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id and vtiger_users.status='Active'
LEFT JOIN vtiger_account on vtiger_contactdetails.accountid=vtiger_account.accountid
left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid
left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid=vtiger_contactdetails.contactid
@@ -674,7 +674,7 @@
ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname
LEFT JOIN vtiger_contactdetails vtiger_contactdetails2
ON vtiger_contactdetails2.contactid = vtiger_contactdetails.reportsto
- where vtiger_crmentity.deleted=0 and vtiger_users.status='Active' ";
+ where vtiger_crmentity.deleted=0";
//vtiger_contactdetails2 is added to get the Reports To of Contact
require('user_privileges/user_privileges_'.$current_user->id.'.php');
Modified: vtigercrm/branches/5.0.3/modules/Leads/Leads.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Leads/Leads.php (original)
+++ vtigercrm/branches/5.0.3/modules/Leads/Leads.php Tue Nov 21 05:15:49 2006
@@ -149,7 +149,8 @@
$sql = getPermittedFieldsQuery("Leads", "detail_view");
$fields_list = getFieldsListFromQuery($sql);
- $query = "SELECT $fields_list FROM ".$this->entity_table."
+ $query = "SELECT $fields_list, vtiger_leadgrouprelation.groupname as 'Assigned To Group'
+ FROM ".$this->entity_table."
INNER JOIN vtiger_leaddetails
ON vtiger_crmentity.crmid=vtiger_leaddetails.leadid
LEFT JOIN vtiger_leadsubdetails
@@ -163,12 +164,11 @@
LEFT JOIN vtiger_groups
ON vtiger_groups.groupname = vtiger_leadgrouprelation.groupname
LEFT JOIN vtiger_users
- ON vtiger_crmentity.smownerid = vtiger_users.id
+ ON vtiger_crmentity.smownerid = vtiger_users.id and vtiger_users.status='Active'
";
- $where_auto = " vtiger_users.status='Active'
- AND vtiger_crmentity.deleted=0 AND vtiger_leaddetails.converted =0";
+ $where_auto = " vtiger_crmentity.deleted=0 AND vtiger_leaddetails.converted =0";
if($where != "")
$query .= "where ($where) AND ".$where_auto;
Modified: vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php (original)
+++ vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php Tue Nov 21 05:15:49 2006
@@ -190,7 +190,8 @@
$sql = getPermittedFieldsQuery("Potentials", "detail_view");
$fields_list = getFieldsListFromQuery($sql);
- $query = "SELECT $fields_list FROM vtiger_potential
+ $query = "SELECT $fields_list, vtiger_potentialgrouprelation.groupname as 'Assigned To Group'
+ FROM vtiger_potential
inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_potential.potentialid
LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id
LEFT JOIN vtiger_account on vtiger_potential.accountid=vtiger_account.accountid
More information about the vtigercrm-commits
mailing list