Skip to content

Commit

Permalink
Fix adding link to item from main form; fixes glpi-project#2912
Browse files Browse the repository at this point in the history
  • Loading branch information
trasher committed Oct 6, 2017
1 parent 21916dc commit c521b92
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions inc/ticket.class.php
Expand Up @@ -1607,6 +1607,18 @@ function post_updateItem($history = 1) {
}
}

if (!empty($this->input['items_id'])) {
$item_ticket = new Item_Ticket();
foreach ($this->input['items_id'] as $itemtype => $items) {
foreach ($items as $items_id) {
$item_ticket->add(['items_id' => $items_id,
'itemtype' => $itemtype,
'tickets_id' => $this->fields['id'],
'_disablenotif' => true]);
}
}
}

if (count($this->updates)) {
// Update Ticket Tco
if (in_array("actiontime", $this->updates)
Expand All @@ -1630,18 +1642,6 @@ function post_updateItem($history = 1) {
}
}

if (!empty($this->input['items_id'])) {
$item_ticket = new Item_Ticket();
foreach ($this->input['items_id'] as $itemtype => $items) {
foreach ($items as $items_id) {
$item_ticket->add(['items_id' => $items_id,
'itemtype' => $itemtype,
'tickets_id' => $this->fields['id'],
'_disablenotif' => true]);
}
}
}

// Setting a solution type means the ticket is solved
if ((in_array("solutiontypes_id", $this->updates)
|| in_array("solution", $this->updates))
Expand Down

0 comments on commit c521b92

Please sign in to comment.