| @@ -64,8 +64,9 @@ | ||
| 64 | 64 | continue; |
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | + // For the trigger TimeAutomationTriggers, this way we know if we are triggering a scenario or not | |
| 68 | 69 | $scenario->is_scenario = true; |
| 69 | 70 | $scenario->triggers = [$scenario->trigger => 1]; |
| 70 | 71 | $execute = false; |
| 71 | 72 | $options = $this->formatOptions($scenario->trigger_params, 'trigger'); |
| @@ -149,8 +150,9 @@ | ||
| 149 | 150 | $query = new AutomationHelper(); |
| 150 | 151 | $query->where = ['user.id = '.$userId]; |
| 151 | 152 | |
| 152 | 153 | $conditionOptions = $this->formatOptions($step->params['option'], $step->type); |
| 154 | + // Unused variable | |
| 153 | 155 | $number = 0; |
| 154 | 156 | acym_trigger('onAcymProcessCondition_'.$step->params['condition'], [&$query, &$conditionOptions, &$number, &$conditionNotValidCount]); |
| 155 | 157 | $this->scenarioQueueClass->deleteByStepIds([$step->id]); |
| 156 | 158 | |
| @@ -301,8 +303,9 @@ | ||
| 301 | 303 | |
| 302 | 304 | $scenario->is_scenario = true; |
| 303 | 305 | $scenario->triggers = [$scenario->trigger => $options]; |
| 304 | 306 | |
| 307 | + // Get the users matching the trigger | |
| 305 | 308 | acym_trigger('onAcymExecuteTrigger', [&$scenario, &$execute, &$options]); |
| 306 | 309 | |
| 307 | 310 | if ($nextExecution !== $scenario->next_execution) { |
| 308 | 311 | $scenario->trigger_params['next_execution'] = $scenario->next_execution; |
| @@ -336,8 +339,9 @@ | ||
| 336 | 339 | $scenarioHistoryLine = new \stdClass(); |
| 337 | 340 | $scenarioHistoryLine->scenario_process_id = $scenarioProcessId; |
| 338 | 341 | $scenarioHistoryLine->date = acym_date('now', 'Y-m-d H:i:s', false); |
| 339 | 342 | $scenarioHistoryLine->type = $type; |
| 343 | + //TODO maybe add something more specific | |
| 340 | 344 | $scenarioHistoryLine->result = $result; |
| 341 | 345 | |
| 342 | 346 | if (!empty($scenarioStepId)) { |
| 343 | 347 | $scenarioHistoryLine->scenario_step_id = $scenarioStepId; |