';
- print '';
+ print ' ';
+ print ' ';
//$curtime = dol_mktime (0, 0, 0, $month, $day, $year);
$i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array();
@@ -1242,26 +1250,26 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{
if ($i < $maxprint || $maxprint == 0 || ! empty($conf->global->MAIN_JS_SWITCH_AGENDA))
{
- $keysofuserassigned=array_keys($event->userassigned);
+ $keysofuserassigned=array_keys($event->userassigned);
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
// Define $color (Hex string like '0088FF') and $cssclass of event
$color=-1; $colorindex=-1;
- if (in_array($user->id, $keysofuserassigned))
- {
- $nummytasks++; $cssclass='family_mytasks';
-
- if (empty($cacheusers[$event->userownerid]))
- {
- $newuser=new User($db);
- $newuser->fetch($event->userownerid);
- $cacheusers[$event->userownerid]=$newuser;
- }
- //var_dump($cacheusers[$event->userownerid]->color);
-
- // We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event)
- if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color;
+ if (in_array($user->id, $keysofuserassigned))
+ {
+ $nummytasks++; $cssclass='family_mytasks';
+
+ if (empty($cacheusers[$event->userownerid]))
+ {
+ $newuser=new User($db);
+ $newuser->fetch($event->userownerid);
+ $cacheusers[$event->userownerid]=$newuser;
+ }
+ //var_dump($cacheusers[$event->userownerid]->color);
+
+ // We decide to choose color of owner of event (event->userownerid is user id of owner, event->userassigned contains all users assigned to event)
+ if (! empty($cacheusers[$event->userownerid]->color)) $color=$cacheusers[$event->userownerid]->color;
}
else if ($event->type_code == 'ICALEVENT') // Event come from external ical file
{
@@ -1352,19 +1360,25 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
// Show rect of event
print "\n";
- print ' '."\n";
+ print ' ';
- print ' '; // always 1 li per ul, 1 ul per event
- print '- ';
- print '
transparency)?'':' cal_event_busy').'" style="'.$h;
+ print 'background: #'.$color.';';
+ //print 'background: -webkit-gradient(linear, left top, left bottom, from(#'.dol_color_minus($color, -5).'), to(#'.dol_color_minus($color, -5).'));';
//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;';
- print ' -moz-border-radius:4px;" width="100%">';
- print '| ';
+ //print ' -moz-border-radius:4px;"';
+ //print 'border: 1px solid #ccc" width="100%"';
+ print '">';
+ print ' | ';
+ print '';
+
+ $daterange='';
+
if ($event->type_code == 'BIRTHDAY') // It's a birthday
{
print $event->getNomUrl(1,$maxnbofchar,'cal_event','birthday','contact');
@@ -1380,9 +1394,6 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
// Date
if (empty($event->fulldayevent))
{
- //print '';
- $daterange='';
-
// Show hours (start ... end)
$tmpyearstart = date('Y',$event->date_start_in_calendar);
$tmpmonthstart = date('m',$event->date_start_in_calendar);
@@ -1415,22 +1426,6 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
$daterange.=dol_print_date($event->date_end_in_calendar,'%H:%M'); // Il faudrait utiliser ici tzuser, mais si on ne peut pas car qd on rentre un date dans fiche action, en input la conversion local->gmt se base sur le TZ server et non user
}
- //print $daterange;
- if ($event->type_code != 'ICALEVENT')
- {
- $savlabel=$event->libelle;
- $event->libelle=$daterange;
- //print '';
- print $event->getNomUrl(0);
- //print '';
- $event->libelle=$savlabel;
- }
- else
- {
- print $daterange;
- }
- //print ' ';
- print " ";
}
else
{
@@ -1441,9 +1436,36 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
}
// Show title
- if ($event->type_code == 'ICALEVENT') print dol_trunc($event->libelle,$maxnbofchar);
- else print $event->getNomUrl(0,$maxnbofchar,'cal_event');
+ $titletoshow = $daterange;
+ $titletoshow.=($titletoshow?' ':'').$event->libelle;
+
+ if ($event->type_code == 'ICALEVENT') print $titletoshow;
+ else
+ {
+ $savlabel=$event->libelle;
+ $event->libelle=$titletoshow;
+ print $event->getNomUrl(0,$maxnbofchar,'cal_event','',0,1);
+ $event->libelle=$savlabel;
+ }
+ // Loop on each assigned user
+ $listofusertoshow='';
+ $posuserassigned=0;
+ foreach($event->userassigned as $tmpid => $tmpdata)
+ {
+ if (! $posuserassigned && $titletoshow) $listofusertoshow.=' ';
+ $posuserassigned++;
+ if (empty($cacheusers[$tmpid]))
+ {
+ $newuser=new User($db);
+ $newuser->fetch($tmpid);
+ $cacheusers[$tmpid]=$newuser;
+ }
+
+ $listofusertoshow.=$cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'valigntextbottom');
+ }
+ print $listofusertoshow;
+
if ($event->type_code == 'ICALEVENT') print ' ('.dol_trunc($event->icalname,$maxnbofchar).')';
// If action related to company / contact
@@ -1486,12 +1508,16 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print ' | ';
// Status - Percent
- print '';
- if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') print $event->getLibStatut(3,1);
+ $withstatus=0;
+ if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT')
+ {
+ $withstatus=1;
+ if ($event->percentage >= 0) $withstatus=2;
+ }
+ print ' | ';
+ if ($withstatus) print $event->getLibStatut(3,1);
else print ' ';
print ' | ';
- print ' ';
- print ' ';
print ' '."\n";
$i++;
}
@@ -1533,10 +1559,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print ''."\n";
}
- print ' ';
- print ' |
';
+ print ''; // td tr
- print '