Hello,
As for the label used to be displayed on the events - from our experience various companies expect different things to be displayed there and using the title field gives full flexibility. It may be not as convenient, but this way it's useful to everyone. Displaying simply assigned people or customers wouldn't work for everyone.
Now, as to how to modify the Calendar yet leave the EPESI core untouched:
1. First, you will need a new, custom module. It's just couple of files stored in structure specified here: http://www.epesi.org/index.php?title=Cr ... dule_files
2. Next step is to redirect Meetings calendar handler to your own method:
CRM_CalendarCommon::delete_event_handler('Meetings');
CRM_CalendarCommon::new_event_handler('Meetings', array('YourModuleCommon', 'crm_calendar_handler'));
We can use the same method name, just make sure you changed the "YourModuleCommon" to your module's common class name.
3. Next, we need to create that method in your module's Common file:
public static function crm_calendar_handler($action) {
$args = func_get_args();
array_shift($args);
$ret = null;
switch ($action) {
case 'get_all': $ret = call_user_func_array(array('YourModuleCommon','crm_event_get_all'), $args);
break;
case 'update': $ret = call_user_func_array(array('CRM_MeetingCommon','crm_event_update'), $args);
break;
case 'get': $ret = call_user_func_array(array('YourModuleCommon','crm_event_get'), $args);
break;
case 'delete': $ret = call_user_func_array(array('CRM_MeetingCommon','crm_event_delete'), $args);
break;
case 'new_event_types': $ret = array(array('label'=>__('Meeting'),'icon'=>Base_ThemeCommon::get_template_file('CRM_Meeting','icon.png')));
break;
case 'new_event': $ret = call_user_func_array(array('CRM_MeetingCommon','crm_new_event'), $args);
break;
case 'view_event': $ret = call_user_func_array(array('CRM_MeetingCommon','crm_view_event'), $args);
break;
case 'edit_event': $ret = call_user_func_array(array('CRM_MeetingCommon','crm_edit_event'), $args);
break;
case 'recordset': $ret = 'crm_meeting';
break;
}
return $ret;
}
Please note that only get_all and get methods are being redirected to your module. The crm_event_get_all() method must be copied from Meetings to your module. This is because of crm_event_get() calls it makes - we need to make sure it'll use your method instead.
crm_event_get() is actually easier to do. You don't need to copy the whole mthod, just call:
crm_event_get($id, $day = null) {
$event = CRM_MeetingCommon::crm_event_get($id, $day);
$event['title'] = ...;
return $event;
}
And this should do the trick.
Finally, if you want wider frames, all you need to do is load your own, new css file. In your module create folder called 'theme', and create new file default.css there, with contents:
span#Utils_Calendar__event {
width: 120px;
}
Also add theme installation to your install() procedure of your module:
Base_ThemeCommon::install_default_theme($this->get_type());
Now all that's left is to load the new css, you can do that at the start of your new crm_event_get_all() method:
Base_ThemeCommon::load_css('YourModule','default');
With these steps you can create a new module that when installed, modifies the behavior of EPESI Meetings while leaving the core completely untouched.
Hope this helps!
Arek