Skip to content

Commit

Permalink
Fix: Bad cache management
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Mar 25, 2011
1 parent 28116d1 commit 4fee097
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions htdocs/comm/action/index.php
Expand Up @@ -392,7 +392,7 @@

$maxlength=16;
$cachethirdparties=array();
$cachecontact=array();
$cachecontacts=array();

// Define theme_datacolor array
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
Expand Down Expand Up @@ -516,7 +516,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$action
global $user, $conf, $langs;
global $filter, $filtera, $filtert, $filterd, $status;
global $theme_datacolor;
global $cachethirdparty, $cachecontact;
global $cachethirdparties, $cachecontacts;

if ($_GET["action"] == 'maxPrint')
{
Expand Down Expand Up @@ -611,16 +611,18 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$action
$thirdparty->fetch($action->societe->id);
$cachethirdparties[$action->societe->id]=$thirdparty;
}
else $thirdparty=$cachethirdparties[$event->societe->id];
$linerelatedto.=$thirdparty->getNomUrl(1,'',$length);
}
if (! empty($action->contact->id))
{
if (empty($cachetcontact[$action->societe->id]))
if (empty($cachecontacts[$action->contact->id]))
{
$contact=new Contact($db);
$contact->fetch($action->contact->id);
$cachethirdparties[$action->contact->id]=$thirdparty;
$cachecontacts[$action->contact->id]=$contact;
}
else $contact=$cachecontacts[$event->contact->id];
if ($linerelatedto) $linerelatedto.=' / ';
$linerelatedto.=$contact->getNomUrl(1,'',$length);
}
Expand Down

0 comments on commit 4fee097

Please sign in to comment.