Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
fix(taskStatus): task status feedback handling
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry authored and DIOHz0r committed May 10, 2018
1 parent da13007 commit 02c5128
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions inc/mqtthandler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,10 @@ protected function updateTaskStatus($topic, $message) {
}

// Get the current status of the task for the agent
$taskStatus = new PluginFlyvemdmTaskStatus();
$request = [
'AND' => [
PluginFlyvemdmAgent::getForeignKeyField() => $agentId,
PluginFlyvemdmAgent::getForeignKeyField() => $agent->getID(),
PluginFlyvemdmTask::getForeignKeyField() => $taskId
]
];
Expand All @@ -335,7 +336,7 @@ protected function updateTaskStatus($topic, $message) {
// Update the task
$policyFactory = new PluginFlyvemdmPolicyFactory();
$policy = $policyFactory->createFromDBByID($task->getField('plugin_flyvemdm_policies_id'));
$taskStatus->updateStatus($policy, $status);
$taskStatus->updateStatus($policy, $feedback['status']);

$this->updateLastContact($topic, '!');
}
Expand Down
1 change: 1 addition & 0 deletions inc/task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ public function post_addItem() {

public function post_updateItem($history = 1) {
$this->publishPolicy($this->notifiable);
$this->deleteTaskStatuses();
$this->createTaskStatuses($this->notifiable);
}

Expand Down

0 comments on commit 02c5128

Please sign in to comment.