';
@@ -960,12 +943,12 @@ if ($id > 0)
print '| ';
$events=array();
$events[]=array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php',1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled'));
- print $form->select_company($object->thirdparty->id,'socid','',1,1,0,$events);
+ print $form->select_company($object->socid,'socid','',1,1,0,$events);
print ' | ';
// Contact
print ''.$langs->trans("Contact").' | ';
- $form->select_contacts($object->thirdparty->id, $object->contact->id,'contactid',1);
+ $form->select_contacts($object->socid, $object->contactid,'contactid',1);
print ' | ';
}
@@ -979,10 +962,10 @@ if ($id > 0)
$langs->load("project");
print '| '.$langs->trans("Project").' | ';
- $numprojet=$formproject->select_projects($object->thirdparty->id,$object->fk_project,'projectid');
+ $numprojet=$formproject->select_projects($object->socid,$object->fk_project,'projectid');
if ($numprojet==0)
{
- print ' '.$langs->trans("AddProject").'';
+ print ' '.$langs->trans("AddProject").'';
}
print ' |
';
}
@@ -1056,99 +1039,65 @@ if ($id > 0)
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) $rowspan++;
// Date start
- print '| '.$langs->trans("DateActionStart").' | ';
+ print ' |
| '.$langs->trans("DateActionStart").' | ';
if (! $object->fulldayevent) print dol_print_date($object->datep,'dayhour');
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 ' | ';
- print ''."\n";
- print ''."\n";
- print ''."\n";
- print ''."\n";
- print ''."\n";
- print ' | ';
print '
';
// Date end
- print '| '.$langs->trans("DateActionEnd").' | ';
+ print ' |
| '.$langs->trans("DateActionEnd").' | ';
if (! $object->fulldayevent) print dol_print_date($object->datef,'dayhour');
else print dol_print_date($object->datef,'day');
if ($object->percentage > 0 && $object->percentage < 100 && $object->datef && $object->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late"));
print ' |
';
// Status
- print '| '.$langs->trans("Status").' / '.$langs->trans("Percentage").' | ';
+ print ' |
| '.$langs->trans("Status").' / '.$langs->trans("Percentage").' | ';
print $object->getLibStatut(4);
print ' |
';
// Location
if (empty($conf->global->AGENDA_DISABLE_LOCATION))
{
- print '| '.$langs->trans("Location").' | '.$object->location.' |
';
+ print '| '.$langs->trans("Location").' | '.$object->location.' |
';
}
// Assigned to
- //if ($object->usertodo->id > 0) print $object->usertodo->getNomUrl(1);
- print '| '.$langs->trans("ActionAffectedTo").' | ';
+ print ' |
| '.$langs->trans("ActionAffectedTo").' | ';
$listofuserid=array();
if (empty($donotclearsession))
{
- if (is_object($object->usertodo)) $listofuserid[$object->usertodo->id]=array('id'=>$object->usertodo->id,'transparency'=>$object->transparency); // Owner first
- $listofuserid=array_merge($listofuserid,$object->userassigned);
+ if (is_object($object->usertodo)) $listofuserid[$object->userownerid]=array('id'=>$object->userownerid,'transparency'=>$object->transparency); // Owner first
+ if (! empty($object->userassigned)) // Now concat assigned users
+ {
+ // Restore array with key with same value than param 'id'
+ $tmplist1=$object->userassigned; $tmplist2=array();
+ foreach($tmplist1 as $key => $val)
+ {
+ if ($val['id'] && $val['id'] != $object->userownerid) $listofuserid[$val['id']]=$val;
+ }
+ }
$_SESSION['assignedtouser']=dol_json_encode($listofuserid);
- //var_dump($_SESSION['assignedtouser']);
}
print $form->select_dolusers_forevent('view','assignedtouser',1);
- print ' |
';
-
- print '
';
// Third party - Contact
if ($conf->societe->enabled)
@@ -1164,12 +1113,12 @@ if ($id > 0)
print '';
print '| '.$langs->trans("Contact").' | ';
print '';
- if ($object->contact->id > 0)
+ if ($object->contactid > 0)
{
print $object->contact->getNomUrl(1);
- if ($object->contact->id && $object->type_code == 'AC_TEL')
+ if ($object->contactid && $object->type_code == 'AC_TEL')
{
- if ($object->contact->fetch($object->contact->id))
+ if ($object->contact->fetch($object->contactid))
{
print " ".dol_print_phone($object->contact->phone_pro);
}
@@ -1250,7 +1199,7 @@ if ($id > 0)
if ($action != 'edit')
{
if ($user->rights->agenda->allactions->create ||
- (($object->author->id == $user->id || $object->usertodo->id == $user->id) && $user->rights->agenda->myactions->create))
+ (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
{
print '';
}
@@ -1260,7 +1209,7 @@ if ($id > 0)
}
if ($user->rights->agenda->allactions->delete ||
- (($object->author->id == $user->id || $object->usertodo->id == $user->id) && $user->rights->agenda->myactions->delete))
+ (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete))
{
print '';
}
@@ -1272,6 +1221,47 @@ if ($id > 0)
}
print '';
+
+
+ // Link to agenda views
+ print '';
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''."\n";
+ print ' ';
}
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index fa7130ec018..fc75488ee3d 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -39,9 +39,10 @@ class ActionComm extends CommonObject
var $id;
- var $type_id; // id into parent table llx_c_actioncomm (will be deprecated into future, link should not be required)
- var $type_code; // code into parent table llx_c_actioncomm (will be deprecated into future, link should not be required). With defautl setup, should be AC_OTH_AUTO or AC_OTH
- var $type; // label into parent table llx_c_actioncomm (will be deprecated into future, link should not be required)
+ var $type_id; // Id into parent table llx_c_actioncomm (used only if option to use type is set)
+ var $type_code; // Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH.
+ var $type; // Label into parent table llx_c_actioncomm (used only if option to use type is set)
+ var $type_color; // Color into parent table llx_c_actioncomm (used only if option to use type is set)
var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
var $label;
@@ -56,7 +57,7 @@ class ActionComm extends CommonObject
var $datef; // Date action end (datep2)
var $durationp = -1; // -1=Unkown duration // deprecated
var $fulldayevent = 0; // 1=Event on full day
- var $punctual = 1; // Milestone
+ var $punctual = 1; // Milestone // TODO Not sure we need this. Milestone is already event with end date = start date
var $percentage; // Percentage
var $location; // Location
@@ -66,7 +67,8 @@ class ActionComm extends CommonObject
var $userassigned = array(); // Array of user ids
var $userownerid; // Id of user owner
- var $usertodo; // Object user of owner // deprecated
+ var $userdoneid; // Id of user done
+ var $usertodo; // Object user of owner // deprecated
var $userdone; // Object user that did action // deprecated
var $socid;
@@ -310,7 +312,7 @@ class ActionComm extends CommonObject
$sql.= " a.fk_user_action, a.fk_user_done,";
$sql.= " a.fk_contact, a.percent as percentage,";
$sql.= " a.fk_element, a.elementtype,";
- $sql.= " a.priority, a.fulldayevent, a.location, a.transparency,";
+ $sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
$sql.= " c.id as type_id, c.code as type_code, c.libelle,";
$sql.= " s.nom as socname,";
$sql.= " u.firstname, u.lastname as lastname";
@@ -352,25 +354,29 @@ class ActionComm extends CommonObject
$this->note = $obj->note;
$this->percentage = $obj->percentage;
- $this->author->id = $obj->fk_user_author;
- $this->author->firstname = $obj->firstname;
- $this->author->lastname = $obj->lastname;
- $this->usermod->id = $obj->fk_user_mod;
+ $this->authorid = $obj->fk_user_author;
+ $this->usermodid = $obj->fk_user_mod;
+ $this->author->id = $obj->fk_user_author; // deprecated
+ $this->author->firstname = $obj->firstname; // deprecated
+ $this->author->lastname = $obj->lastname; // deprecated
+ $this->usermod->id = $obj->fk_user_mod; // deprecated
$this->userownerid = $obj->fk_user_action;
+ $this->userdoneid = $obj->fk_user_done;
$this->usertodo->id = $obj->fk_user_action; // deprecated
- //$this->userdone->id = $obj->fk_user_done;
+ $this->userdone->id = $obj->fk_user_done; // deprecated
$this->priority = $obj->priority;
$this->fulldayevent = $obj->fulldayevent;
$this->location = $obj->location;
$this->transparency = $obj->transparency;
+ $this->punctual = $obj->punctual;
$this->socid = $obj->fk_soc; // To have fetch_thirdparty method working
- $this->contactid = $obj->fk_contact;
+ $this->contactid = $obj->fk_contact; // To have fetch_contact method working
$this->fk_project = $obj->fk_project; // To have fetch_project method working
- $this->societe->id = $obj->fk_soc; // For backward compatibility
- $this->contact->id = $obj->fk_contact; // For backward compatibility
+ $this->societe->id = $obj->fk_soc; // deprecated
+ $this->contact->id = $obj->fk_contact; // deprecated
$this->fk_element = $obj->fk_element;
$this->elementtype = $obj->elementtype;
@@ -961,7 +967,7 @@ class ActionComm extends CommonObject
$sql.= " a.fk_user_action, a.fk_user_done,";
$sql.= " a.fk_contact, a.percent as percentage,";
$sql.= " a.fk_element, a.elementtype,";
- $sql.= " a.priority, a.fulldayevent, a.location,";
+ $sql.= " a.priority, a.fulldayevent, a.location, a.punctual, a.transparency,";
$sql.= " u.firstname, u.lastname,";
$sql.= " s.nom as socname,";
$sql.= " c.id as type_id, c.code as type_code, c.libelle";
@@ -1041,6 +1047,7 @@ class ActionComm extends CommonObject
$event['fulldayevent']=$obj->fulldayevent;
$event['location']=$obj->location;
$event['transparency']=(($obj->transparency > 0)?'OPAQUE':'TRANSPARENT'); // OPAQUE (busy) or TRANSPARENT (not busy)
+ $event['punctual']=$obj->punctual;
$event['category']=$obj->libelle; // libelle type action
// Define $urlwithroot
$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root));
@@ -1146,7 +1153,7 @@ class ActionComm extends CommonObject
$this->punctual=0;
$this->percentage=0;
$this->location='Location';
- $this->transparency=0;
+ $this->transparency=1; // 1 means opaque
$this->priority=1;
$this->note = 'Note';
}
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index 8f3d82f5f9b..a1c03a7f15e 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -218,9 +218,9 @@ if (empty($action) || $action=='show_month')
$tmpday = -date("w",dol_mktime(0,0,0,$month,1,$year))+2;
$tmpday+=((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1)-1);
if ($tmpday >= 1) $tmpday -= 7;
- // Define firstdaytoshow and lastdaytoshow
+ // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
$firstdaytoshow=dol_mktime(0,0,0,$prev_month,$max_day_in_prev_month+$tmpday,$prev_year);
- $next_day=7-($max_day_in_month+1-$tmpday)%7;
+ $next_day=7 - ($max_day_in_month+1-$tmpday) % 7;
if ($next_day < 6) $next_day+=7;
$lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year);
}
@@ -242,9 +242,9 @@ if ($action=='show_week')
$next_month = $next['month'];
$next_day = $next['day'];
- // Define firstdaytoshow and lastdaytoshow
+ // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year);
- $lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd');
+ $lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd');
$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
@@ -261,7 +261,7 @@ if ($action == 'show_day')
$next_month = $next['month'];
$next_day = $next['day'];
- // Define firstdaytoshow and lastdaytoshow
+ // Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
$firstdaytoshow=dol_mktime(0,0,0,$prev_month,$prev_day,$prev_year);
$lastdaytoshow=dol_mktime(0,0,0,$next_month,$next_day,$next_year);
}
@@ -522,14 +522,14 @@ if ($resql)
// Check values
if ($event->date_end_in_calendar < $firstdaytoshow ||
- $event->date_start_in_calendar > $lastdaytoshow)
+ $event->date_start_in_calendar >= $lastdaytoshow)
{
// This record is out of visible range
}
else
{
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
- if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow;
+ if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow-1);
// Add an entry in actionarray for each day
$daycursor=$event->date_start_in_calendar;
@@ -659,7 +659,7 @@ if (count($listofextcals))
if (isset($icalevent['RRULE']) && is_array($icalevent['RRULE'])) //repeatable event
{
//if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
- //if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow;
+ //if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow-1);
if ($icalevent['DTSTART;VALUE=DATE']) //fullday event
{
$datecurstart=dol_stringtotime($icalevent['DTSTART;VALUE=DATE'],1);
@@ -698,10 +698,10 @@ if (count($listofextcals))
$until=empty($icalevent['RRULE']['UNTIL'])?0:dol_stringtotime($icalevent['RRULE']['UNTIL'],1);
$maxrepeat=empty($icalevent['RRULE']['COUNT'])?0:$icalevent['RRULE']['COUNT'];
if ($until && ($until+($datecurend-$datecurstart)) < $firstdaytoshow) continue; // We discard repeatable event that end before start date to show
- if ($datecurstart > $lastdaytoshow) continue; // We discard repeatable event that start after end date to show
+ if ($datecurstart >= $lastdaytoshow) continue; // We discard repeatable event that start after end date to show
$numofevent=0;
- while (($datecurstart <= $lastdaytoshow) && (empty($maxrepeat) || ($numofevent < $maxrepeat)))
+ while (($datecurstart < $lastdaytoshow) && (empty($maxrepeat) || ($numofevent < $maxrepeat)))
{
if ($datecurend >= $firstdaytoshow) // We add event
{
@@ -833,7 +833,7 @@ if (count($listofextcals))
}
// Add event into $eventarray if date range are ok.
- if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar > $lastdaytoshow)
+ if ($event->date_end_in_calendar < $firstdaytoshow || $event->date_start_in_calendar >= $lastdaytoshow)
{
//print 'x'.$datestart.'-'.$dateend;exit;
//print 'x'.$datestart.'-'.$dateend;exit;
@@ -843,7 +843,7 @@ if (count($listofextcals))
else
{
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
- if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow;
+ if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow - 1);
// Add an entry in actionarray for each day
$daycursor=$event->date_start_in_calendar;
@@ -1140,7 +1140,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$ponct=($event->date_start_in_calendar == $event->date_end_in_calendar);
- // Define $color and $cssclass of event
+ // Define $color (Hex string like '0088FF') and $cssclass of event
$color=-1; $cssclass=''; $colorindex=-1;
if (in_array($user->id, $keysofuserassigned))
{
@@ -1163,8 +1163,14 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$color=$event->icalcolor;
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable');
}
- else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); }
- else { $numother++; $cssclass='family_other'; }
+ else if ($event->type_code == 'BIRTHDAY')
+ {
+ $numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]);
+ }
+ else
+ {
+ $numother++; $cssclass='family_other';
+ }
if ($color == -1) // Color was not forced. Set color according to color index.
{
// Define color index if not yet defined
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index d66765b139b..ad3bfddd2ef 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -96,7 +96,7 @@ if ($dateselect > 0)
$tmp=empty($conf->global->MAIN_DEFAULT_WORKING_HOURS)?'9-18':$conf->global->MAIN_DEFAULT_WORKING_HOURS;
$tmparray=explode('-',$tmp);
-$begin_h = GETPOST('begin_h')?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9);
+$begin_h = GETPOST('begin_h')!=''?GETPOST('begin_h','int'):($tmparray[0] != '' ? $tmparray[0] : 9);
$end_h = GETPOST('end_h')?GETPOST('end_h'):($tmparray[1] != '' ? $tmparray[1] : 18);
if ($begin_h < 0 || $begin_h > 23) $begin_h = 9;
if ($end_h < 1 || $end_h > 24) $end_h = 18;
@@ -108,7 +108,7 @@ $begin_d = GETPOST('begin_d')?GETPOST('begin_d','int'):($tmparray[0] != '' ? $tm
$end_d = GETPOST('end_d')?GETPOST('end_d'):($tmparray[1] != '' ? $tmparray[1] : 5);
if ($begin_d < 1 || $begin_d > 7) $begin_d = 1;
if ($end_d < 1 || $end_d > 7) $end_d = 7;
-if ($end_d <= $begin_d) $end_d = $begin_d + 1;
+if ($end_d < $begin_d) $end_d = $begin_d + 1;
if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
@@ -179,17 +179,11 @@ $next_year = $next['year'];
$next_month = $next['month'];
$next_day = $next['day'];
-// Define firstdaytoshow and lastdaytoshow
-$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year);
-$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd');
-
$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
$tmpday = $first_day;
//print 'xx'.$prev_year.'-'.$prev_month.'-'.$prev_day;
//print 'xx'.$next_year.'-'.$next_month.'-'.$next_day;
-//print dol_print_date($firstdaytoshow,'day');
-//print dol_print_date($lastdaytoshow,'day');
$title=$langs->trans("DoneAndToDoActions");
if ($status == 'done') $title=$langs->trans("DoneActions");
@@ -225,9 +219,11 @@ $next_year = $next['year'];
$next_month = $next['month'];
$next_day = $next['day'];
-// Define firstdaytoshow and lastdaytoshow
+// Define firstdaytoshow and lastdaytoshow (warning: lastdaytoshow is last second to show + 1)
$firstdaytoshow=dol_mktime(0,0,0,$first_month,$first_day,$first_year);
-$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 6, 'd');
+$lastdaytoshow=dol_time_plus_duree($firstdaytoshow, 7, 'd');
+//print dol_print_date($firstdaytoshow,'dayhour');
+//print dol_print_date($lastdaytoshow,'dayhour');
$max_day_in_month = date("t",dol_mktime(0,0,0,$month,1,$year));
@@ -325,7 +321,7 @@ $sql.= ' a.percent,';
$sql.= ' a.fk_user_author,a.fk_user_action,a.fk_user_done,';
$sql.= ' a.transparency, a.priority, a.fulldayevent, a.location,';
$sql.= ' a.fk_soc, a.fk_contact,';
-$sql.= ' ca.code';
+$sql.= ' ca.code, ca.color';
$sql.= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
if ($usergroup > 0) $sql.= ", ".MAIN_DB_PREFIX."usergroup_user as ugu";
@@ -400,6 +396,7 @@ 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->type_color=$obj->color;
//$event->libelle=$obj->label; // deprecated
$event->label=$obj->label;
$event->percentage=$obj->percent;
@@ -440,14 +437,14 @@ if ($resql)
// Check values
if ($event->date_end_in_calendar < $firstdaytoshow ||
- $event->date_start_in_calendar > $lastdaytoshow)
+ $event->date_start_in_calendar >= $lastdaytoshow)
{
// This record is out of visible range
}
else
{
if ($event->date_start_in_calendar < $firstdaytoshow) $event->date_start_in_calendar=$firstdaytoshow;
- if ($event->date_end_in_calendar > $lastdaytoshow) $event->date_end_in_calendar=$lastdaytoshow;
+ if ($event->date_end_in_calendar >= $lastdaytoshow) $event->date_end_in_calendar=($lastdaytoshow - 1);
// Add an entry in actionarray for each day
$daycursor=$event->date_start_in_calendar;
@@ -459,7 +456,7 @@ if ($resql)
$loop=true; $j=0;
$daykey=dol_mktime(0,0,0,$mois,$jour,$annee);
do
- {
+ {
//if ($event->id==408) print 'daykey='.$daykey.' '.$event->datep.' '.$event->datef.' ';
$eventarray[$daykey][]=$event;
@@ -482,7 +479,6 @@ else
dol_print_error($db);
}
-
$maxnbofchar=18;
$cachethirdparties=array();
$cachecontacts=array();
@@ -606,6 +602,7 @@ else
$colorsbytype=array();
// Loop on each user to show calendar
+$todayarray=dol_getdate($now,'fast');
$sav = $tmpday;
$showheader = true;
foreach ($usernames as $username)
@@ -634,11 +631,10 @@ foreach ($usernames as $username)
$style='cal_current_month';
if ($iter_day == 6) $style.=' cal_other_month';
$today=0;
- $todayarray=dol_getdate($now,'fast');
- if ($todayarray['mday']==$tmpday && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1;
+ if ($todayarray['mday']==$tmpday && $todayarray['mon']==$tmpmonth && $todayarray['year']==$tmpyear) $today=1;
if ($today) $style='cal_today_peruser';
- show_day_events2($username, $tmpday, $month, $year, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype);
+ show_day_events2($username, $tmpday, $tmpmonth, $tmpyear, $monthshown, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, $showheader, $colorsbytype);
$i++;
}
@@ -648,7 +644,6 @@ foreach ($usernames as $username)
echo " |
\n";
-
// Add js code to manage click on a box
print '