[Vtigercrm-commits] [vtiger-commits] r11101 - in /vtigercrm/branches/5.0.3: include/RelatedListView.php modules/Accounts/Accounts.php modules/HelpDesk/HelpDesk.php modules/Leads/Leads.php modules/Potentials/Potentials.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon May 28 12:06:28 EDT 2007
Author: richie
Date: Mon May 28 10:06:20 2007
New Revision: 11101
Log:
fix for relatedlist navigation. --minnie
Modified:
vtigercrm/branches/5.0.3/include/RelatedListView.php
vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php
vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.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/include/RelatedListView.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/RelatedListView.php (original)
+++ vtigercrm/branches/5.0.3/include/RelatedListView.php Mon May 28 10:06:20 2007
@@ -142,7 +142,7 @@
$query_order_by = "case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end ";
}
$query .= ' ORDER BY '.$query_order_by.' '.$sorder;
-
+
$url_qry .="&order_by=".$order_by."&sorder=".$sorder;
//Added for PHP version less than 5
if (!function_exists("stripos"))
@@ -156,7 +156,10 @@
//Retreiving the no of rows
$count_query = "select count(*) as count ".substr($query, stripos($query,'from'),strlen($query));
$count_result = $adb->query(substr($count_query, stripos($count_query,'select'),stripos($count_query,'ORDER BY')));
- $noofrows = $adb->query_result($count_result,0,"count");
+ if($relatedmodule == "Calendar" && $module != "Contacts")
+ $noofrows = $adb->num_rows($count_result);
+ else
+ $noofrows = $adb->query_result($count_result,0,"count");
//Setting Listview session object while sorting/pagination
if(isset($_REQUEST['relmodule']) && $_REQUEST['relmodule']!='' && $_REQUEST['relmodule'] == $relatedmodule)
@@ -168,7 +171,6 @@
}
}
$start = $_SESSION['rlvs'][$module][$relatedmodule]['start'];
-
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
$start_rec = $navigation_array['start'];
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 Mon May 28 10:06:20 2007
@@ -272,7 +272,8 @@
ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname
WHERE vtiger_seactivityrel.crmid = ".$id."
AND ((vtiger_activity.activitytype='Task' and vtiger_activity.status not in ('Completed','Deferred'))
- OR (vtiger_activity.activitytype in ('Meeting','Call') and vtiger_activity.eventstatus not in ('','Held')))";
+ OR (vtiger_activity.activitytype in ('Meeting','Call') and vtiger_activity.eventstatus not in ('','Held')))
+ GROUP BY vtiger_activity.activityid ";
$log->debug("Exiting get_activities method ...");
return GetRelatedList('Accounts','Calendar',$focus,$query,$button,$returnset);
Modified: vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.php (original)
+++ vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.php Mon May 28 10:06:20 2007
@@ -220,7 +220,7 @@
else
$returnset = '&return_module=HelpDesk&return_action=CallRelatedList&return_id='.$id;
- $query = "SELECT case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name,vtiger_activity.*, vtiger_cntactivityrel.*, vtiger_contactdetails.lastname, vtiger_crmentity.crmid, vtiger_recurringevents.recurringtype, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid = vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held')";
+ $query = "SELECT case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name,vtiger_activity.*, vtiger_cntactivityrel.*, vtiger_contactdetails.lastname, vtiger_crmentity.crmid, vtiger_recurringevents.recurringtype, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid = vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') group by vtiger_activity.activityid ";
$log->debug("Exiting get_activities method ...");
return GetRelatedList('HelpDesk','Calendar',$focus,$query,$button,$returnset);
}
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 Mon May 28 10:06:20 2007
@@ -220,7 +220,7 @@
// First, get the list of IDs.
- $query = "SELECT vtiger_activity.*,vtiger_seactivityrel.*, vtiger_contactdetails.lastname, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime,case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name,vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid = vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and ((vtiger_activity.activitytype='Task' and vtiger_activity.status not in ('Completed','Deferred')) or (vtiger_activity.activitytype in ('Meeting','Call') and vtiger_activity.eventstatus not in ('','Held')))";
+ $query = "SELECT vtiger_activity.*,vtiger_seactivityrel.*, vtiger_contactdetails.lastname, vtiger_contactdetails.contactid, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime,case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name,vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid = vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and ((vtiger_activity.activitytype='Task' and vtiger_activity.status not in ('Completed','Deferred')) or (vtiger_activity.activitytype in ('Meeting','Call') and vtiger_activity.eventstatus not in ('','Held'))) group by vtiger_activity.activityid";
$log->debug("Exiting get_activities method ...");
return GetRelatedList('Leads','Calendar',$focus,$query,$button,$returnset);
}
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 Mon May 28 10:06:20 2007
@@ -288,7 +288,7 @@
else
$returnset = '&return_module=Potentials&return_action=CallRelatedList&return_id='.$id;
- $query = "SELECT vtiger_activity.*,vtiger_seactivityrel.*, vtiger_contactdetails.lastname, vtiger_cntactivityrel.*, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name, vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid = vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid inner join vtiger_potential on vtiger_potential.potentialid=vtiger_seactivityrel.crmid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid where vtiger_seactivityrel.crmid=".$id." and vtiger_crmentity.deleted=0 and ((vtiger_activity.activitytype='Task' and vtiger_activity.status not in ('Completed','Deferred')) or (vtiger_activity.activitytype in ('Meeting','Call') and vtiger_activity.eventstatus not in ('','Held')))";
+ $query = "SELECT vtiger_activity.*,vtiger_seactivityrel.*, vtiger_contactdetails.lastname, vtiger_cntactivityrel.*, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, case when (vtiger_users.user_name not like '') then vtiger_users.user_name else vtiger_groups.groupname end as user_name, vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid = vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid inner join vtiger_potential on vtiger_potential.potentialid=vtiger_seactivityrel.crmid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid where vtiger_seactivityrel.crmid=".$id." and vtiger_crmentity.deleted=0 and ((vtiger_activity.activitytype='Task' and vtiger_activity.status not in ('Completed','Deferred')) or (vtiger_activity.activitytype in ('Meeting','Call') and vtiger_activity.eventstatus not in ('','Held'))) group by vtiger_activity.activityid ";
$log->debug("Exiting get_activities method ...");
return GetRelatedList('Potentials','Calendar',$focus,$query,$button,$returnset);
More information about the vtigercrm-commits
mailing list