Skip to content

Commit

Permalink
fix(targetticket): associate items to tickets
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jun 17, 2021
1 parent 8115349 commit 14a991b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions inc/targetticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ protected function showAssociateSettings($rand) {
],
]);
foreach ($rows as $row) {
$options['items_id'][$row['itemtype']][$row['id']] = $row['id'];
$options['items_id'][$row['itemtype']][$row['id']] = $row['items_id'];
}
Item_Ticket::itemAddForm(new Ticket(), $options);
echo '</div>';
Expand Down Expand Up @@ -1090,8 +1090,9 @@ protected function setTargetAssociatedItem(array $data, PluginFormcreatorFormAns
'NOT' => ['itemtype' => [PluginFormcreatorTargetTicket::class, Ticket::class]],
],
]);
$data['items_id'] = [];
foreach ($rows as $row) {
$data['items_id'] = [$row['itemtype'] => [$row['items_id'] => $row['items_id']]];
$data['items_id'][$row['itemtype']] [$row['items_id']] = $row['items_id'];
}
break;

Expand Down

0 comments on commit 14a991b

Please sign in to comment.