[Vtigercrm-commits] [vtiger-commits] r5808 - in /vtigercrm/branches/5.0_postgresql_integration/modules: Accounts/ListViewTop.php Activities/OpenListView.php CustomView/CustomView.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue May 9 21:55:22 EDT 2006
Author: allanbush
Date: Tue May 9 19:55:12 2006
New Revision: 5808
Log:
Home tab loads without query errors after a freash install. Refs #752.
Modified:
vtigercrm/branches/5.0_postgresql_integration/modules/Accounts/ListViewTop.php
vtigercrm/branches/5.0_postgresql_integration/modules/Activities/OpenListView.php
vtigercrm/branches/5.0_postgresql_integration/modules/CustomView/CustomView.php
Modified: vtigercrm/branches/5.0_postgresql_integration/modules/Accounts/ListViewTop.php
==============================================================================
--- vtigercrm/branches/5.0_postgresql_integration/modules/Accounts/ListViewTop.php (original)
+++ vtigercrm/branches/5.0_postgresql_integration/modules/Accounts/ListViewTop.php Tue May 9 19:55:12 2006
@@ -33,7 +33,7 @@
global $current_user;
$current_module_strings = return_module_language($current_language, "Accounts");
- $list_query = 'select account.accountid, account.accountname, account.tickersymbol, sum(potential.amount) as amount from potential inner join crmentity on (potential.potentialid=crmentity.crmid) inner join account on (potential.accountid=account.accountid) where crmentity.deleted=0 AND crmentity.smownerid="'.$current_user->id.'" and potential.sales_stage <> "'.$app_strings['LBL_CLOSE_WON'].'" and potential.sales_stage <> "'.$app_strings['LBL_CLOSE_LOST'].'" group by account.accountname order by 3 desc;';
+ $list_query = "select account.accountid, account.accountname, account.tickersymbol, sum(potential.amount) as amount from potential inner join crmentity on (potential.potentialid=crmentity.crmid) inner join account on (potential.accountid=account.accountid) where crmentity.deleted=0 AND crmentity.smownerid='".$current_user->id."' and potential.sales_stage <> '".$app_strings['LBL_CLOSE_WON']."' and potential.sales_stage <> '".$app_strings['LBL_CLOSE_LOST']."' group by account.accountid, account.accountname, account.tickersymbol order by amount desc;";
$list_result=$adb->query($list_query);
$open_accounts_list = array();
$noofrows = min($adb->num_rows($list_result),7);
Modified: vtigercrm/branches/5.0_postgresql_integration/modules/Activities/OpenListView.php
==============================================================================
--- vtigercrm/branches/5.0_postgresql_integration/modules/Activities/OpenListView.php (original)
+++ vtigercrm/branches/5.0_postgresql_integration/modules/Activities/OpenListView.php Tue May 9 19:55:12 2006
@@ -77,11 +77,11 @@
if($activity_view != 'OverDue')
{
- $list_query = " select crmentity.crmid,crmentity.smownerid,crmentity.setype, activity.*, contactdetails.lastname, contactdetails.firstname, contactdetails.contactid, account.accountid, account.accountname, recurringevents.recurringtype,recurringevents.recurringdate from activity inner join crmentity on crmentity.crmid=activity.activityid left join cntactivityrel on cntactivityrel.activityid= activity.activityid left join contactdetails on contactdetails.contactid= cntactivityrel.contactid left join seactivityrel on seactivityrel.activityid = activity.activityid left outer join account on account.accountid = contactdetails.accountid left outer join recurringevents on recurringevents.activityid=activity.activityid inner join salesmanactivityrel on salesmanactivityrel.activityid=activity.activityid WHERE crmentity.deleted=0 and (activity.activitytype = 'Meeting' or activity.activitytype='Call' or activity.activitytype='Task') AND ( activity.status is NULL || activity.status != 'Completed' ) and ( activity.status is NULL || activity.status != 'Deferred') and ( activity.eventstatus is NULL || activity.eventstatus != 'Held') and (activity.eventstatus is NULL || activity.eventstatus != 'Not Held' ) AND (((date_start >= '$today' AND date_start < '$later') OR (date_start < '$today')) OR (recurringevents.recurringdate between '$today' and '$later') ) AND crmentity.smownerid !=0 AND salesmanactivityrel.smid ='$current_user->id'";
+ $list_query = " select crmentity.crmid,crmentity.smownerid,crmentity.setype, activity.*, contactdetails.lastname, contactdetails.firstname, contactdetails.contactid, account.accountid, account.accountname, recurringevents.recurringtype,recurringevents.recurringdate from activity inner join crmentity on crmentity.crmid=activity.activityid left join cntactivityrel on cntactivityrel.activityid= activity.activityid left join contactdetails on contactdetails.contactid= cntactivityrel.contactid left join seactivityrel on seactivityrel.activityid = activity.activityid left outer join account on account.accountid = contactdetails.accountid left outer join recurringevents on recurringevents.activityid=activity.activityid inner join salesmanactivityrel on salesmanactivityrel.activityid=activity.activityid WHERE crmentity.deleted=0 and (activity.activitytype = 'Meeting' or activity.activitytype='Call' or activity.activitytype='Task') AND ( activity.status is NULL OR activity.status != 'Completed' ) and ( activity.status is NULL OR activity.status != 'Deferred') and ( activity.eventstatus is NULL OR activity.eventstatus != 'Held') and (activity.eventstatus is NULL OR activity.eventstatus != 'Not Held' ) AND (((date_start >= '$today' AND date_start < '$later') OR (date_start < '$today')) OR (recurringevents.recurringdate between '$today' and '$later') ) AND crmentity.smownerid !=0 AND salesmanactivityrel.smid ='$current_user->id'";
}
else
{
- $list_query = " select crmentity.crmid,crmentity.smownerid,crmentity.setype, activity.*, contactdetails.lastname, contactdetails.firstname, contactdetails.contactid, account.accountid, account.accountname, recurringevents.recurringtype,recurringevents.recurringdate from activity inner join crmentity on crmentity.crmid=activity.activityid left join cntactivityrel on cntactivityrel.activityid= activity.activityid left join contactdetails on contactdetails.contactid= cntactivityrel.contactid left join seactivityrel on seactivityrel.activityid = activity.activityid left outer join account on account.accountid = contactdetails.accountid left outer join recurringevents on recurringevents.activityid=activity.activityid inner join salesmanactivityrel on salesmanactivityrel.activityid=activity.activityid WHERE crmentity.deleted=0 and (activity.activitytype = 'Meeting' or activity.activitytype='Call' or activity.activitytype='Task') AND ( activity.status is NULL || activity.status != 'Completed' ) and ( activity.status is NULL || activity.status != 'Deferred') and ( activity.eventstatus is NULL || activity.eventstatus != 'Held') and (activity.eventstatus is NULL || activity.eventstatus != 'Not Held' ) AND (due_date < '$today') OR (recurringevents.recurringdate < '$today') AND crmentity.smownerid !=0 AND salesmanactivityrel.smid ='$current_user->id'";
+ $list_query = " select crmentity.crmid,crmentity.smownerid,crmentity.setype, activity.*, contactdetails.lastname, contactdetails.firstname, contactdetails.contactid, account.accountid, account.accountname, recurringevents.recurringtype,recurringevents.recurringdate from activity inner join crmentity on crmentity.crmid=activity.activityid left join cntactivityrel on cntactivityrel.activityid= activity.activityid left join contactdetails on contactdetails.contactid= cntactivityrel.contactid left join seactivityrel on seactivityrel.activityid = activity.activityid left outer join account on account.accountid = contactdetails.accountid left outer join recurringevents on recurringevents.activityid=activity.activityid inner join salesmanactivityrel on salesmanactivityrel.activityid=activity.activityid WHERE crmentity.deleted=0 and (activity.activitytype = 'Meeting' or activity.activitytype='Call' or activity.activitytype='Task') AND ( activity.status is NULL OR activity.status != 'Completed' ) and ( activity.status is NULL OR activity.status != 'Deferred') and ( activity.eventstatus is NULL OR activity.eventstatus != 'Held') and (activity.eventstatus is NULL OR activity.eventstatus != 'Not Held' ) AND (due_date < '$today') OR (recurringevents.recurringdate < '$today') AND crmentity.smownerid !=0 AND salesmanactivityrel.smid ='$current_user->id'";
}
$list_result = $adb->limitQuery($list_query,0,5);
$open_activity_list = array();
Modified: vtigercrm/branches/5.0_postgresql_integration/modules/CustomView/CustomView.php
==============================================================================
--- vtigercrm/branches/5.0_postgresql_integration/modules/CustomView/CustomView.php (original)
+++ vtigercrm/branches/5.0_postgresql_integration/modules/CustomView/CustomView.php Tue May 9 19:55:12 2006
@@ -1203,7 +1203,7 @@
{
$listviewquery = substr($listquery, strpos($listquery,'from'),strlen($listquery));
- $query = "select count(*) count ".$listviewquery;
+ $query = "select count(*) AS count ".$listviewquery;
$stdfiltersql = $this->getCVStdFilterSQL($viewid);
$advfiltersql = $this->getCVAdvFilterSQL($viewid);
More information about the vtigercrm-commits
mailing list