Fix: Selection of users color was not user owner of event.
This commit is contained in:
parent
6a9d825a65
commit
6bbeaee8fe
@ -5,6 +5,7 @@ English Dolibarr ChangeLog
|
|||||||
|
|
||||||
***** ChangeLog for 3.7 compared to 3.6.* *****
|
***** ChangeLog for 3.7 compared to 3.6.* *****
|
||||||
For users:
|
For users:
|
||||||
|
- New: Can set a color on user card (visible into agenda view).
|
||||||
- New: extrafields for projects and tasks are exported to ODT documents.
|
- New: extrafields for projects and tasks are exported to ODT documents.
|
||||||
- New: Add number of active notification into tab title (like we do for notes and documents)
|
- New: Add number of active notification into tab title (like we do for notes and documents)
|
||||||
- New: Can add product into category from category card.
|
- New: Can add product into category from category card.
|
||||||
|
|||||||
@ -66,7 +66,7 @@ class ActionComm extends CommonObject
|
|||||||
var $note; // Description
|
var $note; // Description
|
||||||
|
|
||||||
var $userassigned = array(); // Array of user ids
|
var $userassigned = array(); // Array of user ids
|
||||||
var $userownerid; // Id of user owner
|
var $userownerid; // Id of user owner
|
||||||
var $userdoneid; // Id of user done
|
var $userdoneid; // Id of user done
|
||||||
var $usertodo; // Object user of owner // deprecated
|
var $usertodo; // Object user of owner // deprecated
|
||||||
var $userdone; // Object user that did action // deprecated
|
var $userdone; // Object user that did action // deprecated
|
||||||
|
|||||||
@ -876,6 +876,7 @@ if (count($listofextcals))
|
|||||||
$maxnbofchar=18;
|
$maxnbofchar=18;
|
||||||
$cachethirdparties=array();
|
$cachethirdparties=array();
|
||||||
$cachecontacts=array();
|
$cachecontacts=array();
|
||||||
|
$cacheusers=array();
|
||||||
|
|
||||||
// Define theme_datacolor array
|
// Define theme_datacolor array
|
||||||
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
|
$color_file = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/graph-color.php";
|
||||||
@ -1074,7 +1075,7 @@ $db->close();
|
|||||||
* @param int $year Year
|
* @param int $year Year
|
||||||
* @param int $monthshown Current month shown in calendar view
|
* @param int $monthshown Current month shown in calendar view
|
||||||
* @param string $style Style to use for this day
|
* @param string $style Style to use for this day
|
||||||
* @param array $eventarray Array of events
|
* @param array $eventarray Array of events
|
||||||
* @param int $maxprint Nb of actions to show each day on month view (0 means no limit)
|
* @param int $maxprint Nb of actions to show each day on month view (0 means no limit)
|
||||||
* @param int $maxnbofchar Nb of characters to show for event line
|
* @param int $maxnbofchar Nb of characters to show for event line
|
||||||
* @param string $newparam Parameters on current URL
|
* @param string $newparam Parameters on current URL
|
||||||
@ -1087,7 +1088,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
global $user, $conf, $langs;
|
global $user, $conf, $langs;
|
||||||
global $action, $filter, $filtera, $filtert, $filterd, $status, $actioncode; // Filters used into search form
|
global $action, $filter, $filtera, $filtert, $filterd, $status, $actioncode; // Filters used into search form
|
||||||
global $theme_datacolor;
|
global $theme_datacolor;
|
||||||
global $cachethirdparties, $cachecontacts, $colorindexused;
|
global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused;
|
||||||
|
|
||||||
print '<div id="dayevent_'.sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day).'" class="dayevent">'."\n";
|
print '<div id="dayevent_'.sprintf("%04d",$year).sprintf("%02d",$month).sprintf("%02d",$day).'" class="dayevent">'."\n";
|
||||||
|
|
||||||
@ -1147,10 +1148,16 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
{
|
{
|
||||||
$nummytasks++; $cssclass='family_mytasks';
|
$nummytasks++; $cssclass='family_mytasks';
|
||||||
|
|
||||||
// Must defined rule to choose color of who to use.
|
if (empty($cacheusers[$event->userownerid]))
|
||||||
// event->ownerid will still contains user id of owner
|
{
|
||||||
// event->userassigned will be an array in future.
|
$newuser=new User($db);
|
||||||
$color=$user->color;
|
$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')
|
else if ($event->type_code == 'ICALEVENT')
|
||||||
{
|
{
|
||||||
@ -1171,6 +1178,17 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$numother++; $cssclass='family_other';
|
$numother++; $cssclass='family_other';
|
||||||
|
|
||||||
|
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 ($color == -1) // Color was not forced. Set color according to color index.
|
if ($color == -1) // Color was not forced. Set color according to color index.
|
||||||
{
|
{
|
||||||
|
|||||||
@ -259,7 +259,7 @@ if ($resql)
|
|||||||
print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("DateEnd"),$_SERVER["PHP_SELF"],"a.datep2",$param,'','align="center"',$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("ActionUserAsk"),$_SERVER["PHP_SELF"],"ua.login",$param,"","",$sortfield,$sortorder);
|
//print_liste_field_titre($langs->trans("ActionUserAsk"),$_SERVER["PHP_SELF"],"ua.login",$param,"","",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("ActionsOwnedBy"),$_SERVER["PHP_SELF"],"ut.login",$param,"","",$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("ActionsOwnedBy"),$_SERVER["PHP_SELF"],"ut.login",$param,"","",$sortfield,$sortorder);
|
||||||
//print_liste_field_titre($langs->trans("DoneBy"),$_SERVER["PHP_SELF"],"ud.login",$param,"","",$sortfield,$sortorder);
|
//print_liste_field_titre($langs->trans("DoneBy"),$_SERVER["PHP_SELF"],"ud.login",$param,"","",$sortfield,$sortorder);
|
||||||
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="right"',$sortfield,$sortorder);
|
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="right"',$sortfield,$sortorder);
|
||||||
@ -275,7 +275,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
//print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||||
//print ' ';
|
//print ' ';
|
||||||
@ -348,6 +348,7 @@ if ($resql)
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// User author
|
// User author
|
||||||
|
/*
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
if ($obj->useridauthor)
|
if ($obj->useridauthor)
|
||||||
{
|
{
|
||||||
@ -358,6 +359,7 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
*/
|
||||||
|
|
||||||
// User to do
|
// User to do
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
|
|||||||
@ -1330,10 +1330,9 @@ else
|
|||||||
if (! empty($conf->agenda->enabled))
|
if (! empty($conf->agenda->enabled))
|
||||||
{
|
{
|
||||||
print '<tr><td valign="top">'.$langs->trans("ColorUser").'</td>';
|
print '<tr><td valign="top">'.$langs->trans("ColorUser").'</td>';
|
||||||
print '<td width="50px" bgcolor="'.$object->color.'">';
|
print '<td colspan="2">';
|
||||||
print $object->color;
|
if ($object->color) print '<input type="text" disabled="disabled" style="padding: 0; margin-top: 0; margin-bottom: 0; width: 36px; background-color: #'.$object->color.'" value="'.$object->color.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td> </td>';
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user