Skip to content

Commit

Permalink
QA: Fixing Classic Reports Page
Browse files Browse the repository at this point in the history
* Convert to Filter Table
* Update Row Display Data
* Start to weave in ReportIt Reports
* Before we can enable the ReportIt Reports, I still need to make changes to ReportIt 3.0
  • Loading branch information
TheWitness committed Jan 1, 2025
1 parent 57500ad commit f959625
Show file tree
Hide file tree
Showing 4 changed files with 286 additions and 183 deletions.
27 changes: 16 additions & 11 deletions lib/api_scheduler.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ function api_scheduler_is_time_to_start($schedule, $table = 'automation_networks
db_execute_prepared("UPDATE $table
SET next_start = ?
WHERE id = ?",
array(date('Y-m-d H:i', $target), $schedulework_id));
array(date('Y-m-d H:i', $target), $schedule['id']));

return true;

Expand Down Expand Up @@ -356,7 +356,7 @@ function api_scheduler_is_time_to_start($schedule, $table = 'automation_networks
db_execute_prepared("UPDATE $table
SET next_start = ?
WHERE id = ?",
array(date('Y-m-d H:i', $target), $schedulework_id));
array(date('Y-m-d H:i', $target), $schedule['id']));

return true;
}
Expand All @@ -371,7 +371,7 @@ function api_scheduler_is_time_to_start($schedule, $table = 'automation_networks
db_execute_prepared("UPDATE $table
SET next_start = ?
WHERE id = ?",
array(date('Y-m-d H:i', $next), $schedulework_id));
array(date('Y-m-d H:i', $next), $schedule['id']));

if ($schedule['next_start'] == '0000-00-00 00:00:00') {
if ($now > strtotime($schedule['start_at'])) {
Expand All @@ -394,6 +394,9 @@ function api_scheduler_calculate_next_start($schedule) {
$dates = array();

switch($schedule['sched_type']) {
case SCHEDULE_MANUAL:

break;
case SCHEDULE_MONTHLY:
$months = explode(',', $schedule['month']);
$days = explode(',', $schedule['day_of_month']);
Expand Down Expand Up @@ -583,18 +586,20 @@ function api_scheduler_calculate_next_start($schedule) {
break;
}

asort($dates);
if ($schedule['sched_type'] !== SCHEDULE_MANUAL) {
asort($dates);

$newdates = array();
$newdates = array();

foreach ($dates as $date) {
$ndate = date('Y-m-d', $date) . ' ' . date('H:i:s', strtotime($schedule['start_at']));
$ntime = strtotime($ndate);
foreach ($dates as $date) {
$ndate = date('Y-m-d', $date) . ' ' . date('H:i:s', strtotime($schedule['start_at']));
$ntime = strtotime($ndate);

cacti_log('Start At: ' . $schedule['start_at'] . ', Possible Next Start: ' . $ndate . ' with Timestamp: ' . $ntime, false, POLLER_VERBOSITY_DEBUG);
cacti_log('Start At: ' . $schedule['start_at'] . ', Possible Next Start: ' . $ndate . ' with Timestamp: ' . $ntime, false, 'SCHEDULER', POLLER_VERBOSITY_DEBUG);

if ($ntime > $now) {
return $ntime;
if ($ntime > $now) {
return $ntime;
}
}
}

Expand Down
Loading

0 comments on commit f959625

Please sign in to comment.