Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
This commit is contained in:
commit
bf7fcce1b2
@ -1006,6 +1006,11 @@ if (! empty($hookmanager->resArray['eventarray'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sort events
|
||||||
|
foreach($eventarray as $keyDate => &$dateeventarray)
|
||||||
|
{
|
||||||
|
usort($dateeventarray, 'sort_events_by_date');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$maxnbofchar=0;
|
$maxnbofchar=0;
|
||||||
@ -1700,3 +1705,22 @@ function dol_color_minus($color, $minus, $minusunit = 16)
|
|||||||
}
|
}
|
||||||
return $newcolor;
|
return $newcolor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort events by date
|
||||||
|
*
|
||||||
|
* @param object $a Event A
|
||||||
|
* @param object $b Event B
|
||||||
|
* @return int < 0 if event A should be before event B, > 0 otherwise, 0 if they have the exact same time slot
|
||||||
|
*/
|
||||||
|
function sort_events_by_date($a, $b)
|
||||||
|
{
|
||||||
|
if($a->datep != $b->datep)
|
||||||
|
{
|
||||||
|
return $a->datep - $b->datep;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If both events have the same start time, longest first
|
||||||
|
return $b->datef - $a->datef;
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user