Skip to content

Commit

Permalink
Fix last event that has not yet ended (montage_class.php)
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorA100 authored Oct 10, 2024
1 parent 0cb5c61 commit d224128
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions web/skins/classic/views/class/montage_class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1039,14 +1039,17 @@ public static function buildQueryString($filter, array $monitorsId=[], $startDat
//The last event that has not yet ended.
if ($startDateTime == $endDateTime) {
// We receive an event that should be played at a specific moment.
$where .= " OR (E.StartDateTime <='".$startDateTime."' AND EndDateTime >='".$startDateTime."')";
//$where .= " OR (E.StartDateTime <='".$startDateTime."' AND EndDateTime >='".$startDateTime."')";
$where .= " OR (E.StartDateTime <='".$startDateTime."' AND E.EndDateTime IS NULL)";
$limit .= ' LIMIT 1';
$order .= ' ORDER BY E.StartDateTime DESC, E.MonitorId ASC';
} else {
// Display on the TimeLine scale
$where .= " OR (E.StartDateTime >='".$startDateTime."' AND E.EndDateTime IS NULL)";
//Sorting by E.StartDateTime is necessary for the correct thinning of events when forming the Timeline
$order .= ' ORDER BY E.StartDateTime ASC, E.MonitorId ASC';
}
$where .= ")";
//Sorting by E.StartDateTime is necessary for the correct thinning of events when forming the Timeline
$order .= ' ORDER BY E.StartDateTime ASC, E.MonitorId ASC';
} else if ($actionRange == 'first') {
//Temporarily not used
if ($oneMonitors) {
Expand Down

0 comments on commit d224128

Please sign in to comment.