Skip to content

Commit

Permalink
use trigger_value tag when triggered by user
Browse files Browse the repository at this point in the history
  • Loading branch information
BadWolf42 committed Aug 15, 2024
1 parent 12f375b commit 5700e50
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 1 addition & 0 deletions core/ajax/scenario.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
throw new Exception(__('Impossible de lancer le scénario car il est désactivé. Veuillez l\'activer', __FILE__));
}
$scenario->addTag('trigger','user');
$scenario->addTag('trigger_value',$_SESSION['user']->getLogin());
$scenario->addTag('message',$GLOBALS['JEEDOM_SCLOG_TEXT']['startManual']['txt']);
$scenario->launch(0);
break;
Expand Down
2 changes: 0 additions & 2 deletions core/class/scenario.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,6 @@ public function launch($_forceSyncMode = false) {
return false;
}
$this->setCache(array('startingTime' => strtotime('now'), 'state' => 'starting'));
$this->setCache('lastExecutionUser', (isset($_SESSION) && isset($_SESSION['user']) && $_SESSION['user'] != null) ? $_SESSION['user']->getLogin() : 'none');
if ($this->getConfiguration('syncmode') == 1 || $_forceSyncMode) {
$this->setLog($GLOBALS['JEEDOM_SCLOG_TEXT']['launchScenarioSync']['txt']);
return $this->execute();
Expand Down Expand Up @@ -939,7 +938,6 @@ public function execute($instance_id = '') {
$timeline->setOptions(array('trigger' => ($this->getTag('trigger') == 'schedule') ? 'programmation' : $this->getTag('trigger')));
$timeline->save();
}
$_triggerValue = $this->getCache('lastExecutionUser', 'none');
}
if ($this->getState() == 'in progress' && $this->getConfiguration('allowMultiInstance', 0) == 0) {
return;
Expand Down

0 comments on commit 5700e50

Please sign in to comment.