Skip to content

Commit

Permalink
fix(targetticket): determine requester when answer is valdiated
Browse files Browse the repository at this point in the history
close #50 #1545

Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jan 10, 2020
1 parent 5ab3b8f commit 19b8232
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion inc/targetticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,6 @@ public function save(PluginFormcreatorFormAnswer $formanswer) {
$data['content'] = Toolbox::addslashes_deep($data['content']);
$data['content'] = $formanswer->parseTags($data['content'], $this, $richText);

$data['_users_id_recipient'] = $_SESSION['glpiID'];
$data['_tickettemplates_id'] = $this->fields['tickettemplates_id'];

$this->prepareActors($form, $formanswer);
Expand All @@ -633,6 +632,9 @@ public function save(PluginFormcreatorFormAnswer $formanswer) {
}
}

$data['_users_id_recipient'] = $requesters_id;
$data['users_id_lastupdater'] = Session::getLoginUserID();

$data = $this->setTargetEntity($data, $formanswer, $requesters_id);
$data = $this->setTargetDueDate($data, $formanswer);
$data = $this->setTargetUrgency($data, $formanswer);
Expand Down Expand Up @@ -665,6 +667,7 @@ public function save(PluginFormcreatorFormAnswer $formanswer) {
}

// Create the target ticket
$data['_auto_import'] = true;
if (!$ticketID = $ticket->add($data)) {
return null;
}
Expand Down

0 comments on commit 19b8232

Please sign in to comment.