diff --git a/ChangeLog b/ChangeLog index cbca688c6c0eee103ba5725bd69261e62254c337..ffff5a7a6e0eeb88d1f4ebac9e7246d01b2fa9d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.4 compared to 3.3.2 ***** For users: +- New: Event into calendar use different colors for different users. - New: Support revenue stamp onto invoices. - New: Add a tab "consumption" on thirdparties to list products bought/sells. - New: Some performance enhancements. diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 0b182c7645ffb70e4c0d0740a1b2fa6c74929d1b..49a84a28d227710984e379f06a1b5508d83f0b06 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -942,7 +942,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa global $user, $conf, $langs; global $filter, $filtera, $filtert, $filterd, $status; global $theme_datacolor; - global $cachethirdparties, $cachecontacts; + global $cachethirdparties, $cachecontacts, $colorindexused; print '<div id="dayevent_'.sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day).'" class="dayevent">'."\n"; $curtime = dol_mktime(0, 0, 0, $month, $day, $year); @@ -972,6 +972,9 @@ 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); + //print $nextindextouse; + foreach ($eventarray as $daykey => $notused) { $annee = date('Y',$daykey); @@ -989,10 +992,12 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $color=-1; $cssclass=''; $colorindex=-1; if ((! empty($event->author->id) && $event->author->id == $user->id) || (! empty($event->usertodo->id) && $event->usertodo->id == $user->id) - || (! empty($event->userdone->id) && $event->userdone->id == $user->id)) { - $nummytasks++; $colorindex=1; $cssclass='family_mytasks'; + || (! empty($event->userdone->id) && $event->userdone->id == $user->id)) + { + $nummytasks++; $cssclass='family_mytasks'; } - else if ($event->type_code == 'ICALEVENT') { + else if ($event->type_code == 'ICALEVENT') + { $numical++; if (! empty($event->icalname)) { if (! isset($numicals[dol_string_nospecial($event->icalname)])) { @@ -1004,8 +1009,25 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $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 { $numother++; $colorindex=2; $cssclass='family_other'; } - if ($color == -1) $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. + { + // Define color index if not yet defined + $idusertouse=($event->usertodo->id?$event->usertodo->id:0); + if (isset($colorindexused[$idusertouse])) + { + $colorindex=$colorindexused[$idusertouse]; // Color already assigned to this user + } + else + { + $colorindex=$nextindextouse; + $colorindexused[$idusertouse]=$colorindex; + if (! empty($theme_datacolor[$nextindextouse+1])) $nextindextouse++; // Prepare to use next color + } + //print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'<br>'; + // 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 @@ -1182,6 +1204,13 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa print '</div>'."\n"; } +/** + * Change color with a delta + * + * @param string $color Color + * @param int $minus Delta + * @return string New color + */ function dol_color_minus($color, $minus) { $newcolor=$color; diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index bd1bd8693ce054fe8dc5b82f3d8e9df0fa1e616d..a59b5b7cdf4b77efca5aaa0bea3538cf662f4617 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -204,11 +204,13 @@ CREATE TABLE llx_cronjob ALTER TABLE llx_societe MODIFY COLUMN zip varchar(25); -ALTER TABLE llx_user ADD COLUMN address varchar(255); -ALTER TABLE llx_user ADD COLUMN zip varchar(25); -ALTER TABLE llx_user ADD COLUMN town varchar(50); -ALTER TABLE llx_user ADD COLUMN fk_state integer DEFAULT 0; -ALTER TABLE llx_user ADD COLUMN fk_country integer DEFAULT 0; +ALTER TABLE llx_user ADD COLUMN address varchar(255); +ALTER TABLE llx_user ADD COLUMN zip varchar(25); +ALTER TABLE llx_user ADD COLUMN town varchar(50); +ALTER TABLE llx_user ADD COLUMN fk_state integer DEFAULT 0; +ALTER TABLE llx_user ADD COLUMN fk_country integer DEFAULT 0; +ALTER TABLE llx_user ADD COLUMN color varchar(6); + ALTER TABLE llx_product_price ADD COLUMN import_key varchar(14) AFTER price_by_qty; DROP TABLE llx_printer_ipp; diff --git a/htdocs/theme/eldy/graph-color.php b/htdocs/theme/eldy/graph-color.php index e49f86bce60175f57941828430019107767a5a10..ab59c7689a44fff4b4b57927244ad1877fae4f5d 100644 --- a/htdocs/theme/eldy/graph-color.php +++ b/htdocs/theme/eldy/graph-color.php @@ -28,7 +28,7 @@ global $theme_bordercolor, $theme_datacolor, $theme_bgcolor, $theme_bgcoloronglet; $theme_bordercolor = array(235,235,224); -$theme_datacolor = array(array(125,135,150), array(200,160,180), array(190,190,220), array(170,140,190), array(190,190,170)); +$theme_datacolor = array(array(190,190,220), array(200,160,180), array(125,135,150), array(170,140,190), array(190,190,170)); $theme_bgcolor = array(hexdec('F4'),hexdec('F4'),hexdec('F4')); $theme_bgcoloronglet = array(hexdec('DE'),hexdec('E7'),hexdec('EC')); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index eba9a7cc86d2894dc9c0d9244bea647d527326e4..88da3fd489442f2e2b3dab4a94d264f6d34f49e3 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2100,7 +2100,7 @@ table.cal_month { border-spacing: 0px; } .cal_other_month { border-top: 0; border-left: solid 1px #C0C0C0; border-right: 0; border-bottom: solid 1px #C0C0C0; } .cal_current_month_right { border-right: solid 1px #E0E0E0; } .cal_other_month_right { border-right: solid 1px #C0C0C0; } -.cal_other_month { opacity: 0.6; background: #DDDDDD; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; } +.cal_other_month { opacity: 0.6; background: #EAEAEA; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; } .cal_past_month { opacity: 0.6; background: #EEEEEE; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; } .cal_current_month { background: #FFFFFF; border-left: solid 1px #E0E0E0; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; } .cal_today { background: #FFFFFF; border: solid 2px #6C7C7B; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; } diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 779d0cf54234d355e139834b8251bc526ecb7e57..3e695b63e2ac96c8c52b49a026a9e5d875572798 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -875,7 +875,7 @@ if (($action == 'create') || ($action == 'adduserldap')) print '<tr><td valign="top">'.$langs->trans("Signature").'</td>'; print '<td>'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('signature',GETPOST('signature'),'',280,'dolibarr_mailings','In',true,true,empty($conf->global->FCKEDITOR_ENABLE_USERSIGN)?0:1,8,72); + $doleditor=new DolEditor('signature',GETPOST('signature'),'',138,'dolibarr_mailings','In',true,true,empty($conf->global->FCKEDITOR_ENABLE_USERSIGN)?0:1,ROWS_4,90); print $doleditor->Create(1); print '</td></tr>'; @@ -1778,7 +1778,7 @@ else if ($caneditfield) { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor=new DolEditor('signature',$object->signature,'',280,'dolibarr_mailings','In',true,true,empty($conf->global->FCKEDITOR_ENABLE_USERSIGN)?0:1,8,72); + $doleditor=new DolEditor('signature',$object->signature,'',138,'dolibarr_mailings','In',false,true,empty($conf->global->FCKEDITOR_ENABLE_USERSIGN)?0:1,ROWS_4,72); print $doleditor->Create(1); } else