[Vtigercrm-commits] [vtiger-commits] r5368 - /vtigercrm/branches/4.2/modules/HelpDesk/ListTickets.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Apr 25 18:17:52 EDT 2006
Author: allanbush
Date: Tue Apr 25 16:17:49 2006
New Revision: 5368
Log:
Caching of ticket's related to information. Refs #744.
Modified:
vtigercrm/branches/4.2/modules/HelpDesk/ListTickets.php
Modified: vtigercrm/branches/4.2/modules/HelpDesk/ListTickets.php
==============================================================================
--- vtigercrm/branches/4.2/modules/HelpDesk/ListTickets.php (original)
+++ vtigercrm/branches/4.2/modules/HelpDesk/ListTickets.php Tue Apr 25 16:17:49 2006
@@ -148,6 +148,9 @@
function getParentLink($parent_id)
{
+ static $res = array();
+ if(isset($res[$parent_id])) return $res[$parent_id];
+
global $adb;
$sql = "select setype from crmentity where crmid=".$parent_id;
@@ -156,8 +159,9 @@
if($parent_module == 'Contacts')
{
$sql = "select firstname,lastname from contactdetails where contactid=".$parent_id;
- $parentname = $adb->query_result($adb->query($sql),0,'firstname');
- $parentname .= ' '.$adb->query_result($adb->query($sql),0,'lastname');
+ $result = $adb->query($sql);
+ $parentname = $adb->query_result($result,0,'firstname');
+ $parentname .= ' '.$adb->query_result($result,0,'lastname');
$parent_name = '<a href="index.php?action=DetailView&module='.$parent_module.'&record='.$parent_id.'">'.$parentname.'</a>';
}
if($parent_module == 'Accounts')
@@ -167,6 +171,7 @@
$parent_name = '<a href="index.php?action=DetailView&module='.$parent_module.'&record='.$parent_id.'">'.$parentname.'</a>';
}
+ $res[$parent_id] = $parent_name;
return $parent_name;
}
More information about the vtigercrm-commits
mailing list