On peruser agenda view, use different color if event is busy or not for

user.
This commit is contained in:
Laurent Destailleur 2014-09-08 10:24:16 +02:00
parent 9720ab1ea5
commit b63cfccf49
10 changed files with 77 additions and 61 deletions

View File

@ -937,7 +937,7 @@ if ($id > 0)
else print dol_print_date($object->datep,'day');
if ($object->percentage == 0 && $object->datep && $object->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late"));
print '</td>';
print '<td rowspan="4" align="center" valign="middle" width="180">'."\n";
print '<td rowspan="5" align="center" valign="middle" width="180">'."\n";
print '<form name="listactionsfiltermonth" action="'.DOL_URL_ROOT.'/comm/action/index.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_month">';
@ -965,6 +965,15 @@ if ($id > 0)
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewday" value="'.$langs->trans("ViewDay").'">';
print '</form>'."\n";
print '<form name="listactionsfilterperuser" action="'.DOL_URL_ROOT.'/comm/action/peruser.php" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="show_peruser">';
print '<input type="hidden" name="year" value="'.dol_print_date($object->datep,'%Y').'">';
print '<input type="hidden" name="month" value="'.dol_print_date($object->datep,'%m').'">';
print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
//print '<input type="hidden" name="day" value="'.dol_print_date($object->datep,'%d').'">';
print img_picto($langs->trans("ViewCal"),'object_calendarperuser','class="hideonsmartphone"').' <input type="submit" style="min-width: 120px" class="button" name="viewperuser" value="'.$langs->trans("ViewPerUser").'">';
print '</form>'."\n";
print '</td>';
print '</tr>';
@ -984,7 +993,7 @@ if ($id > 0)
print '<tr><td>'.$langs->trans("Location").'</td><td colspan="2">'.$object->location.'</td></tr>';
// Assigned to
print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">';
print '<tr><td width="30%" class="nowrap">'.$langs->trans("ActionAffectedTo").'</td><td>';
if ($object->usertodo->id > 0) print $object->usertodo->getNomUrl(1);
print '</td></tr>';

View File

@ -63,15 +63,15 @@ $limit = $conf->liste_limit;
$offset = $limit * $page ;
if (! $sortorder)
{
$sortorder="ASC";
if ($status == 'todo') $sortorder="ASC";
if ($status == 'done') $sortorder="DESC";
$sortorder="DESC";
if ($status == 'todo') $sortorder="DESC";
//if ($status == 'done') $sortorder="DESC";
}
if (! $sortfield)
{
$sortfield="a.percent";
$sortfield="a.datep";
if ($status == 'todo') $sortfield="a.datep";
if ($status == 'done') $sortfield="a.datep2";
//if ($status == 'done') $sortfield="a.datep2";
}
// Security check

View File

@ -399,7 +399,8 @@ if ($resql)
$event->datep=$db->jdate($obj->datep); // datep and datef are GMT date
$event->datef=$db->jdate($obj->datep2);
$event->type_code=$obj->code;
$event->libelle=$obj->label;
$event->libelle=$obj->label; // deprecated
$event->label=$obj->label;
$event->percentage=$obj->percent;
$event->author->id=$obj->fk_user_author; // user id of creator
$event->usertodo->id=$obj->fk_user_action; // user id of owner
@ -657,21 +658,18 @@ jQuery(document).ready(function() {
{
/* alert(\'no event\'); */
url = "'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&affectedto="+userid+"&datep="+year+month+day+hour+min+"00"
alert(url);
window.location.href = url;
}
else if (ids.indexOf(",") > -1) /* There is several events */
{
/* alert(\'several events\'); */
url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid
alert(url);
window.location.href = url;
}
else /* One event */
{
/* alert(\'one event\'); */
url = "'.DOL_URL_ROOT.'/comm/action/list.php?action=view&id="+ids
alert(url);
url = "'.DOL_URL_ROOT.'/comm/action/fiche.php?action=view&id="+ids
window.location.href = url;
}
});
@ -787,23 +785,33 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$color = ''; //init
if (empty($event->fulldayevent))
{
$a = dol_mktime((int) $h,0,0,$month,$day,$year);
$b = dol_mktime((int) $h,30,0,$month,$day,$year);
$c = dol_mktime((int) $h+1,0,0,$month,$day,$year);
$a = dol_mktime((int) $h,0,0,$month,$day,$year,false,false);
$b = dol_mktime((int) $h,30,0,$month,$day,$year,false,false);
$c = dol_mktime((int) $h+1,0,0,$month,$day,$year,false,false);
if ($event->date_start_in_calendar < $b && $event->date_end_in_calendar > $a)
$dateendtouse=$event->date_end_in_calendar;
if ($dateendtouse==$event->date_start_in_calendar) $dateendtouse++;
if ($event->date_start_in_calendar < $b && $dateendtouse > $a)
{
$cases1[$h][$event->id]++;
$busy=$event->transparency;
$cases1[$h][$event->id]['busy']=$busy;
$cases1[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour').' - '.dol_print_date($event->date_end_in_calendar,'dayhour').' - '.$event->label;
}
if ($event->date_start_in_calendar < $c && $event->date_end_in_calendar > $b)
if ($event->date_start_in_calendar < $c && $dateendtouse > $b)
{
$cases2[$h][$event->id]++;
$busy=$event->transparency;
$cases2[$h][$event->id]['busy']=$busy;
$cases2[$h][$event->id]['string']=dol_print_date($event->date_start_in_calendar,'dayhour').' - '.dol_print_date($event->date_end_in_calendar,'dayhour').' - '.$event->label;
}
}
else
{
$cases1[$h][$event->id]=1;
$cases2[$h][$event->id]=1;
$busy=$event->transparency;
$cases1[$h][$event->id]['busy']=$busy;
$cases2[$h][$event->id]['busy']=$busy;
$cases1[$h][$event->id]['string']=$event->label;
$cases2[$h][$event->id]['string']=$event->label;
break;
}
}
@ -819,34 +827,24 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
$style1='';$style2='';
$string1='&nbsp;';$string2='&nbsp;';
$title1='';$title2='';
if (isset($cases1[$h]))
if (isset($cases1[$h]) && $cases1[$h] != '')
{
if ($cases1[$h] != '')
$title1=count($cases1[$h]).' '.(count($cases1[$h])==1?$langs->trans("Event"):$langs->trans("Events"));
$string1='&nbsp;';
$style1='peruser_notbusy';
foreach($cases1[$h] as $id => $ev)
{
$title1=count($cases1[$h]).' '.$langs->trans("Events");
/*$title = $h;
$title .= 'h';
if ((int) $cases1[$h] != $cases1[$h])
$title .= '30';
else
$title .= '00';*/
$string1='&nbsp;';
$style1='peruser_busy';
$url='<a href="" title="'.$title1.'">';
if ($ev['busy']) $style1='peruser_busy';
}
}
if (isset($cases2[$h]))
if (isset($cases2[$h]) && $cases2[$h] != '')
{
if ($cases2[$h] != '')
$title2=count($cases2[$h]).' '.(count($cases2[$h])==1?$langs->trans("Event"):$langs->trans("Events"));
$string2='&nbsp;';
$style2='peruser_notbusy';
foreach($cases2[$h] as $id => $ev)
{
/*$title = $h;
$title .= 'h';
if ((int) $cases2[$h] != $cases2[$h]) $title .= '30';
else $title .= '00';*/
$title2=count($cases1[$h]).' '.$langs->trans("Events");
$string2='&nbsp;';
$style2='peruser_busy';
$url='<a href="" title="'.$title2.'">';
if ($ev['busy']) $style2='peruser_busy';
}
}
@ -856,20 +854,22 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, &
if (count($cases1[$h]) == 1) // 1 seul evenement
{
$ids=array_keys($cases1[$h]);
$id=$ids[0];
$output = array_slice($cases1[$h], 0, 1);
if ($output[0]['string']) $title1.=' - '.$output[0]['string'];
}
if (count($cases2[$h]) == 1) // 1 seul evenement
{
$ids=array_keys($cases2[$h]);
$id=$ids[0];
$output = array_slice($cases2[$h], 0, 1);
if ($output[0]['string']) $title2.=' - '.$output[0]['string'];
}
$ids1=join(',',array_keys($cases1[$h]));
$ids2=join(',',array_keys($cases2[$h]));
//var_dump($cases1[$h]);
print '<table class="nobordernopadding" width="100%">';
print '<tr><td class="'.$style1.' onclickopenref'.($title1?' cursorpointer':'').'" ref="ref_'.$username->id.'_'.sprintf("%04d",$year).'_'.sprintf("%02d",$month).'_'.sprintf("%02d",$day).'_'.sprintf("%02d",$h).'_00_'.($ids1?$ids1:'none').'"'.($title1?' title="'.$title1.'"':'').'>';
print '<tr><td class="'.($style1?$style1.' ':'').'onclickopenref'.($title1?' cursorpointer':'').'" ref="ref_'.$username->id.'_'.sprintf("%04d",$year).'_'.sprintf("%02d",$month).'_'.sprintf("%02d",$day).'_'.sprintf("%02d",$h).'_00_'.($ids1?$ids1:'none').'"'.($title1?' title="'.$title1.'"':'').'>';
print $string1;
print '</td><td class="'.$style2.' onclickopenref'.($title1?' cursorpointer':'').'" ref="ref_'.$username->id.'_'.sprintf("%04d",$year).'_'.sprintf("%02d",$month).'_'.sprintf("%02d",$day).'_'.sprintf("%02d",$h).'_30_'.($ids2?$ids2:'none').'"'.($title2?' title="'.$title2.'"':'').'>';
print '</td><td class="'.($style2?$style2.' ':'').'onclickopenref'.($title1?' cursorpointer':'').'" ref="ref_'.$username->id.'_'.sprintf("%04d",$year).'_'.sprintf("%02d",$month).'_'.sprintf("%02d",$day).'_'.sprintf("%02d",$h).'_30_'.($ids2?$ids2:'none').'"'.($title2?' title="'.$title2.'"':'').'>';
print $string2;
print '</td></tr>';
print '</table>';

View File

@ -7,9 +7,10 @@ Agendas= Agendas
Calendar= Calendar
Calendars= Calendars
LocalAgenda=Local calendar
AffectedTo= Assigned to
DoneBy= Done by
Events= Events
AffectedTo=Assigned to
DoneBy=Done by
Event=Event
Events=Events
EventsNb=Number of events
MyEvents=My events
OtherEvents=Other events
@ -17,11 +18,11 @@ ListOfActions=List of events
Location=Location
EventOnFullDay=Event on all day(s)
SearchAnAction= Search an event/task
MenuToDoActions= All incomplete events
MenuDoneActions= All terminated events
MenuToDoMyActions= My incomplete events
MenuDoneMyActions= My terminated events
ListOfEvents= List of Dolibarr events
MenuToDoActions=All incomplete events
MenuDoneActions=All terminated events
MenuToDoMyActions=My incomplete events
MenuDoneMyActions=My terminated events
ListOfEvents=List of Dolibarr events
ActionsAskedBy=Events reported by
ActionsToDoBy=Events assigned to
ActionsDoneBy=Events done by
@ -33,7 +34,7 @@ ViewList=List view
ViewCal=Month view
ViewDay=Day view
ViewWeek=Week view
ViewPerUser=Per user
ViewPerUser=Per user view
ViewWithPredefinedFilters= View with predefined filters
AutoActions= Automatic filling
AgendaAutoActionDesc= Define here events for which you want Dolibarr to create automatically an event in agenda. If nothing is checked (by default), only manual actions will be included in agenda.

View File

@ -33,7 +33,7 @@ ViewList=Vue liste
ViewCal=Vue mois
ViewDay=Vue jour
ViewWeek=Vue semaine
ViewPerUser=Par utilisateur
ViewPerUser=Vue par utilisateur
ViewWithPredefinedFilters= Vues avec filtres prédéfinis
AutoActions= Alimentation automatique
AgendaAutoActionDesc= Définissez dans cet onglet les événements pour lesquels Dolibarr créera automatiquement une action dans l'agenda. Si aucune case n'est cochée (par défaut), seules les actions manuelles seront incluses dans l'agenda.

View File

@ -1698,19 +1698,18 @@ table.cal_month { border-spacing: 0px; }
.cal_other_month_peruserleft { border-top: 0; border-left: solid 3px #6C7C7B !important; border-right: 0; }
.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: #EAEAEA; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_past_month { opacity: 0.6; background: #EEEEEE; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_current_month { background: #FFFFFF; border-left: solid 1px #E0E0E0; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_current_month_peruserleft { background: #FFFFFF; border-left: solid 3px #6C7C7B; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_today_peruser { background: #FFFFFF; border-right: solid 1px #6C7C7B; border-top: solid 1px #A0A0A0; border-bottom: solid 1px #A0A0A0; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_today_peruser_peruserleft { background: #FFFFFF; border-left: solid 3px #6C7C7B; border-top: solid 1px #A0A0A0; border-right: solid 1px #6C7C7B; border-bottom: solid 1px #A0A0A0; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_today {
background:#ffffff;
border:solid 2px #bbbbbb;
}
.peruser_busy { background: #CC8888; }
.peruser_notbusy { background: #EEDDDD; }
div.dayevent table.nobordernopadding tr td {padding:1px;}

View File

@ -1858,6 +1858,8 @@ li.cal_event { border: none; list-style-type: none; }
.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; }
.cal_event a:hover { color: #111111; font-size: 11px; font-weight: normal !important; }
.cal_peruser { padding: 0px; }
.peruser_busy { background: #CC8888; }
.peruser_notbusy { background: #EEDDDD; }
/* ============================================================================== */

View File

@ -1961,6 +1961,8 @@ li.cal_event { border: none; list-style-type: none; }
.cal_event a:visited { color: #111111; font-size: 11px; font-weight: normal !important; }
.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; }
.cal_event a:hover { color: #111111; font-size: 11px; font-weight: normal !important; }
.peruser_busy { background: #CC8888; }
.peruser_notbusy { background: #EEDDDD; }
/* ============================================================================== */

View File

@ -1986,6 +1986,8 @@ li.cal_event { border: none; list-style-type: none; }
.cal_event a:visited {font-size: 11px; font-weight: bold !important; }
.cal_event a:active {font-size: 11px; font-weight: bold !important; }
.cal_event a:hover {font-size: 11px; font-weight: bold !important; }
.peruser_busy { background: #CC8888; }
.peruser_notbusy { background: #EEDDDD; }
/* ============================================================================== */

View File

@ -2329,7 +2329,8 @@ table.cal_month { border-spacing: 0px; }
.cal_today_peruser_peruserleft { background: #FFFFFF; border-left: solid 3px #6C7C7B; border-top: solid 1px #A0A0A0; border-right: solid 1px #6C7C7B; border-bottom: solid 1px #A0A0A0; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 1px; padding-top: 0px; padding-bottom: 0px; }
.cal_past { }
.cal_peruser { padding: 0px; }
.peruser_busy { background: #FF8888; }
.peruser_busy { background: #CC8888; }
.peruser_notbusy { background: #EEDDDD; }
table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px; -webkit-border-radius: 6px; border-radius: 6px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);
moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 2px rgba(0, 0, 0, 0.25);