diff --git a/ChangeLog b/ChangeLog
index cbca688c6c0..ffff5a7a6e0 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 0b182c7645f..49a84a28d22 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 '
'."\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.'
';
+ // 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 '
'."\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 bd1bd8693ce..a59b5b7cdf4 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 e49f86bce60..ab59c7689a4 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 eba9a7cc86d..88da3fd4894 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-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
+.cal_other_month { opacity: 0.6; background: #EAEAEA; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_past_month { opacity: 0.6; background: #EEEEEE; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_current_month { background: #FFFFFF; border-left: solid 1px #E0E0E0; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_today { background: #FFFFFF; border: solid 2px #6C7C7B; padding-: 2px; padding-: 1px; padding-top: 0px; padding-bottom: 0px; }
diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php
index 779d0cf5423..3e695b63e2a 100644
--- a/htdocs/user/fiche.php
+++ b/htdocs/user/fiche.php
@@ -875,7 +875,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
print '| '.$langs->trans("Signature").' | ';
print '';
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 ' |
';
@@ -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