Hi,
I have modified vTiger Calendar Module in order to display completed task with green background on Calendar View. It seems working but I'd like to share my work with someone else for having a comment on what I did.
I know it works only for weekview but I think it should be the same things even for the other views.
Thanks in advance
Filo
MODIFIED FILES
CalendarLayout.php
themes\softed\style.css
CalendarLayout.php
Function getweekEventLayer
....
Line 1182
$visibility_query=$adb->pquery('SELECT visibility from vtiger_activity where activityid=?',array($id));
$visibility = $adb->query_result($visibility_query,0,'visibility');
$user_query = $adb->pquery("SELECT vtiger_crmentity.smownerid,vtiger_users.user_name from vtiger_crmentity,vtiger_users where crmid=? and vtiger_crmentity.smownerid=vtiger_users.id", array($id));
$userid = $adb->query_result($user_query,0,"smownerid");
$assigned_role_query=$adb->pquery("select roleid from vtiger_user2role where userid=?",array($userid));
$assigned_role_id = $adb->query_result($assigned_role_query,0,"roleid");
$role_list = $adb->pquery("SELECT * from vtiger_role WHERE parentrole LIKE '". formatForSqlLike($current_user->column_fields) . formatForSqlLike($assigned_role_id) ."'",array());
$is_shared = $adb->pquery("SELECT * from vtiger_sharedcalendar where userid=? and sharedid=?",array($userid,$current_user->id));
if(($current_user->column_fields!='on' && $adb->num_rows($role_list)==0 && (($adb->num_rows($is_shared)==0 && ($visibility=='Public' || $visibility=='Private')) || $visibility=='Private')) && $current_user->column_fields!=$user)
{
/* Filippo 20100401 - Inizio */
/* Codice Vecchio */
/*$eventlayer .= '<div id="event_'.$cal->day_slice[$slice]->start_time->hour.'_'.$i.'" class="event" style="height:'.$height.'px;">';*/
/*Codice Nuovo */
If ($eventstatus == "Held")
{
$eventlayer .= '<div id="event_'.$cal->day_slice[$slice]->start_time->hour.'_'.$i.'" class="event_held" style="height:'.$height.'px;">';
}
else
{
$eventlayer .= '<div id="event_'.$cal->day_slice[$slice]->start_time->hour.'_'.$i.'" class="event" style="height:'.$height.'px;">';
}
}
/* Filippo 20100401 - Fine */
else
{
/* Filippo 20100401 - Inizio */
/* Codice Vecchio */
/*$eventlayer .= '<div id="event_'.$cal->day_slice[$slice]->start_time->hour.'_'.$i.'" class="event" style="height:'.$height.'px;" '.$javacript_str.'>';*/
If ($eventstatus == "Held")
{
$eventlayer .= '<div id="event_'.$cal->day_slice[$slice]->start_time->hour.'_'.$i.'" class="event_held" style="height:'.$height.'px;" '.$javacript_str.'>';
}
else
{
$eventlayer .= '<div id="event_'.$cal->day_slice[$slice]->start_time->hour.'_'.$i.'" class="event" style="height:'.$height.'px;" '.$javacript_str.'>';
}
/* Filippo 20100401 - Fine */
}
$eventlayer .='<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr>
<td width="10%" align="center"><img src="'.$image.'" align="middle" border="0"></td>
<td width="90%"><b>'.$start_hour.' - '.$end_hour.'</b></td>
</tr>
<tr>
<td align="center">'.$recurring.'</td>';
style.css
added
/* Filippo Inizio */
.event_held{
background-color:#008000;
border:2px solid #dddddd;
text-align:left;
width:100%;
position:relative;
left:0px;
top:0px;
vertical-align:middle;
padding:1px;
}
/* Filippo Fine */ <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe> <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>
Comments
different colours for held (green) , planed (dark yellow) and not held (light red)
is it possible to integrate this in the weekly, monthly and daily view?
best regards
vincent
bye
of course, you must define an event_not_held style too.
and you can copy this to daily/weekly/monthly views too, just keep your eyes on the eventlayer row which is not the same everywhere so modify the class parameter only.
in the monthly view add this line before the first if: