Automation Fix

This commit is contained in:
GamerClassN7
2021-02-24 17:20:49 +01:00
parent c6f57a3661
commit 9d9304d30e
3 changed files with 17 additions and 7 deletions

View File

@@ -17,14 +17,14 @@ class AutomationManager{
return Db::command ('UPDATE automation SET executed = 0 WHERE automation_id=?', array ($automationId));
}
public static function create ($name, $onDays, $doCode, $ifCode, $automationId = "") {
$userId = UserManager::getUserData('user_id');
public static function create ($name, $onDays, $doCode, $ifCode, $userId = 1, $automationId = "") {
$userId = UserManager::getUserData('user_id', $userId);
$scene = array (
'name' => $name,
'owner_id' => $userId,
'on_days' => $onDays,
'if_something' => $ifCode,
'do_something' => $doCode,
'conditions' => $ifCode,
'tasks' => $doCode,
);
try {
if ($automationId == "") {