summaryrefslogtreecommitdiffstats
path: root/modules-available/rebootcontrol/inc/scheduler.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/rebootcontrol/inc/scheduler.inc.php')
-rw-r--r--modules-available/rebootcontrol/inc/scheduler.inc.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/modules-available/rebootcontrol/inc/scheduler.inc.php b/modules-available/rebootcontrol/inc/scheduler.inc.php
index 839d7d81..0776885d 100644
--- a/modules-available/rebootcontrol/inc/scheduler.inc.php
+++ b/modules-available/rebootcontrol/inc/scheduler.inc.php
@@ -8,45 +8,45 @@ class Scheduler
self::deleteSchedule($locationid, $action);
return false;
}
- $nextwake = self::calcNextwake($action, $openingTimes);
+ $nextexec = self::calcNextexec($action, $openingTimes);
$json_options = json_encode($options);
- self::upsert($locationid, $action, $nextwake, $json_options);
+ self::upsert($locationid, $action, $nextexec, $json_options);
return true;
}
public static function deleteSchedule($locationid, $action) {
- Database::exec("DELETE FROM `scheduler`
+ Database::exec("DELETE FROM `reboot_scheduler`
WHERE locationid = :lid AND action = :act", array(
'lid' => $locationid,
'act' => $action
));
}
- private static function calcNextwake($action, $openingTimes) {
- //TODO: Calculate nextWake based on openingTimes. Needs action to know if openTimes or closingTimes are used.
+ private static function calcNextexec($action, $openingTimes) {
+ //TODO: Calculate nextExec based on openingTimes. Needs action to know if openTimes or closingTimes are used.
return 0;
}
- private static function upsert($locationid, $action, $nextwake, $options) {
+ private static function upsert($locationid, $action, $nextexec, $options) {
$schedule = Database::queryFirst("SELECT locationid, action
- FROM `scheduler`
+ FROM `reboot_scheduler`
WHERE locationid = :lid AND action = :act", array(
'lid' => $locationid,
'act' => $action
));
if ($schedule === false) {
- Database::exec("INSERT INTO `scheduler` (locationid, action, nextwake, options)
+ Database::exec("INSERT INTO `reboot_scheduler` (locationid, action, nextexecution, options)
VALUES (:lid, :act, :next, :opt)", array(
'lid' => $locationid,
'act' => $action,
- 'next' => $nextwake,
+ 'next' => $nextexec,
'opt' => $options
));
} else {
- Database::exec("UPDATE `scheduler`
- SET nextwake = :next, options = :opt
+ Database::exec("UPDATE `reboot_scheduler`
+ SET nextexecution = :next, options = :opt
WHERE locationid = :lid AND action = :act", array(
- 'next' => $nextwake,
+ 'next' => $nextexec,
'opt' => $options,
'lid' => $locationid,
'act' => $action