From a8e439188761a14970e6922adff1fccfd5de7c72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 28 Jun 2014 18:04:32 +0200 Subject: [PATCH] Prepare calendars to be able to show calendars with selection on several users. --- htdocs/comm/action/fiche.php | 2 +- htdocs/comm/action/index.php | 23 ++++++---- htdocs/comm/action/listactions.php | 2 +- htdocs/core/lib/agenda.lib.php | 70 ++++++++++++++++++++---------- htdocs/langs/en_US/agenda.lang | 1 + htdocs/theme/eldy/style.css.php | 2 +- 6 files changed, 64 insertions(+), 36 deletions(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index a965d51ae74..0cf366080b9 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -532,7 +532,7 @@ if ($action == 'create') // Busy print ''.$langs->trans("Busy").''; - print 'transparency?' checked="checked"':'').'>'; + print ''; print ''; // Realised by diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index cfe6c3c210d..d5434ac86bf 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -296,7 +296,7 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param); $head = calendars_prepare_head($paramnoaction); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); -print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$listofextcals,$actioncode); +print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,$listofextcals,$actioncode,1); dol_fiche_end(); $link=''; @@ -327,7 +327,7 @@ $sql.= ' a.datea,'; $sql.= ' a.datea2,'; $sql.= ' a.percent,'; $sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,'; -$sql.= ' a.priority, a.fulldayevent, a.location,'; +$sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,'; $sql.= ' a.fk_soc, a.fk_contact,'; $sql.= ' ca.code'; $sql.= ' FROM ('.MAIN_DB_PREFIX.'c_actioncomm as ca,'; @@ -409,6 +409,7 @@ if ($resql) $event->priority=$obj->priority; $event->fulldayevent=$obj->fulldayevent; $event->location=$obj->location; + $event->transparency=$obj->transparency; $event->societe->id=$obj->fk_soc; $event->contact->id=$obj->fk_contact; @@ -1033,7 +1034,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array(); $ymd=sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day); - $nextindextouse=count($colorindexused); + $nextindextouse=count($colorindexused); // At first run this is 0, so fist user has 0, next 1, ... //print $nextindextouse; foreach ($eventarray as $daykey => $notused) @@ -1074,7 +1075,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $color=$event->icalcolor; $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other'); } - else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; } + else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); } else { $numother++; $cssclass='family_other'; } if ($color == -1) // Color was not forced. Set color according to color index. { @@ -1086,21 +1087,25 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } else { - $colorindex=$nextindextouse; - $colorindexused[$idusertouse]=$colorindex; + $colorindex=$nextindextouse; + $colorindexused[$idusertouse]=$colorindex; if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color } //print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'
'; // Define color $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); - } + } $cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd; // Show rect of event print '
'; print '