Hi
I used to be able to have more colors for each type of calendar entry (not person but tasks, held, planned, more) in the Calendar (until version 7.5X) by doing the following:
In CalendayDisplay I did (I am leaving out many of my entries, I am just showing two)
public $activity_colors = array(
'Meetings' => array(
'border' => '#1C5FBD',
'body' => '#D2E5FC',
),
'Calls' => array(
'border' => '#DE4040',
'body' => '#FCDCDC',
),
'Tasks' => array(
'border' => '#015900',
'body' => '#B1F5AE',
),
// JOBST Added next several lines for meeting status color
'Planned' => array(
// light blue
'border' => '#CCCCCC',
'body' => '#D8EFFF',
),
'Held' => array(
// slightly darker than above
'border' => '#000000',
'body' => '#CCE6FF',
),
}
The calendar settings
SUITECRM/clientis/index.php?module=Calendar&action=index&parentTab=All
is already permitting to use different colors for:
MEETINGS, CALLS, TASKS, EVENTS and it permit to change BODY, BVORDER and TEXT for eachone of them.
Not sure if this is still relevant to you, but here’s my solution.
I have also found that I have to edit the .JS file directly, as it did not read the updated information from the .php file for some reason (which is how you’re doing it above).
unminify the JS (couldn’t do it using a simple vim macro for some reason. unminify.com however does the trick)
search for backgroundColor to identify where the colors are set (There are 2 locations; We want the one where element.module_name is set) (This is around line 860 in the unminified file)
Add Javascript to suit; for example:
if (element.module_name == “Tasks”) {
if (element.status == “Completed”){
valueToPush[“backgroundColor”] = ‘#0000FF’;
valueToPush[“borderColor”] = ‘#FFFFFF’;
valueToPush[“textColor”] = ‘#000000’;
}else if (element.status == “Booked”){
valueToPush[“backgroundColor”] = ‘#00FF00’;
valueToPush[“borderColor”] = ‘#000000’;
valueToPush[“textColor”] = ‘#000000’;
}else{
valueToPush[“backgroundColor”] = ‘#FF0000’;
valueToPush[“borderColor”] = ‘#FFFFFF’;
valueToPush[“textColor”] = ‘#000000’;
}
}
Obviously, this solution is not upgrade safe. It may also stop working at some point in the future even as a manual process.
I have it working with 7.7.6, and the JS looks the same for 7.8.2, but haven’t tested it yet.
If anyone else has a better setup and/or an upgrade safe solution, i’d love to see it…
Looks good.
If it gets accepted it would deeply add value to the calendar customization since it would allow color management for any number of Task/Meeting based on ‘status’. Could even be considered major enhancement
If anyone else runs into an issue with this, I wasn’t able to get this working using the github changes by jobst, but I followed sergtech suggestion of updating /Modules/Calendar/Cal.js and it works great.