Fix truncation of event conente in agenda view

This commit is contained in:
Laurent Destailleur 2016-06-06 15:13:55 +02:00
parent 47308d27c3
commit 0e06f116a2

View File

@ -937,7 +937,7 @@ if (! empty($hookmanager->resArray['eventarray'])) $eventarray=array_merge($even
$maxnbofchar=18; $maxnbofchar=0;
$cachethirdparties=array(); $cachethirdparties=array();
$cachecontacts=array(); $cachecontacts=array();
$cacheusers=array(); $cacheusers=array();
@ -1316,7 +1316,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
//if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));'; //if (! empty($event->transparency)) print 'background: #'.$color.'; background: -webkit-gradient(linear, left top, left bottom, from(#'.$color.'), to(#'.dol_color_minus($color,1).'));';
//else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;'; //else print 'background-color: transparent !important; background: none; border: 1px solid #bbb;';
print ' -moz-border-radius:4px;" width="100%"><tr>'; print ' -moz-border-radius:4px;" width="100%"><tr>';
print '<td class="'.($nowrapontd?'nowrap ':'').'cal_event'.($event->type_code == 'BIRTHDAY'?' cal_event_birthday':'').'">'; print '<td class="tdoverflow centpercent '.($nowrapontd?'nowrap ':'').'cal_event'.($event->type_code == 'BIRTHDAY'?' cal_event_birthday':'').'">';
if ($event->type_code == 'BIRTHDAY') // It's a birthday if ($event->type_code == 'BIRTHDAY') // It's a birthday
{ {
print $event->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact'); print $event->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact');
@ -1397,8 +1397,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($event->type_code == 'ICALEVENT') print '<br>('.dol_trunc($event->icalname,$maxnbofchar).')'; if ($event->type_code == 'ICALEVENT') print '<br>('.dol_trunc($event->icalname,$maxnbofchar).')';
// If action related to company / contact // If action related to company / contact
$linerelatedto='';$length=16; $linerelatedto='';
if (! empty($event->societe->id) && ! empty($event->contact->id)) $length=round($length/2);
if (! empty($event->societe->id) && $event->societe->id > 0) if (! empty($event->societe->id) && $event->societe->id > 0)
{ {
if (! isset($cachethirdparties[$event->societe->id]) || ! is_object($cachethirdparties[$event->societe->id])) if (! isset($cachethirdparties[$event->societe->id]) || ! is_object($cachethirdparties[$event->societe->id]))
@ -1408,7 +1407,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$cachethirdparties[$event->societe->id]=$thirdparty; $cachethirdparties[$event->societe->id]=$thirdparty;
} }
else $thirdparty=$cachethirdparties[$event->societe->id]; else $thirdparty=$cachethirdparties[$event->societe->id];
if (! empty($thirdparty->id)) $linerelatedto.=$thirdparty->getNomUrl(1,'',$length); if (! empty($thirdparty->id)) $linerelatedto.=$thirdparty->getNomUrl(1,'',0);
} }
if (! empty($event->contact->id) && $event->contact->id > 0) if (! empty($event->contact->id) && $event->contact->id > 0)
{ {
@ -1420,7 +1419,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
} }
else $contact=$cachecontacts[$event->contact->id]; else $contact=$cachecontacts[$event->contact->id];
if ($linerelatedto) $linerelatedto.=' / '; if ($linerelatedto) $linerelatedto.=' / ';
if (! empty($contact->id)) $linerelatedto.=$contact->getNomUrl(1,'',$length); if (! empty($contact->id)) $linerelatedto.=$contact->getNomUrl(1,'',0);
} }
if ($linerelatedto) print '<br>'.$linerelatedto; if ($linerelatedto) print '<br>'.$linerelatedto;
} }