Skip to content

Commit

Permalink
change use
Browse files Browse the repository at this point in the history
  • Loading branch information
cconard96 committed Jun 22, 2023
1 parent 1eb987e commit cdc5eb5
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions inc/ticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -759,20 +759,18 @@ static function cloneAndLink($tickets_id) {

//add actors to the new ticket (without assign)
//users
$res = $DB->insert('glpi_tickets_user', [
new QuerySubQuery([
'SELECT' => [
new QueryExpression("'' AS " . $DB::quoteName('id')),
new QueryExpression($DB::quoteValue($newID) . " AS " . $DB::quoteName('tickets_id')),
'users_id', 'type', 'use_notification', 'alternative_email'
],
'FROM' => 'glpi_tickets_users',
'WHERE' => [
'tickets_id' => $tickets_id,
'type' => ['!=', 2]
]
])
]);
$res = $DB->insert('glpi_tickets_user', new QuerySubQuery([
'SELECT' => [
new QueryExpression("'' AS " . $DB::quoteName('id')),
new QueryExpression($DB::quoteValue($newID) . " AS " . $DB::quoteName('tickets_id')),
'users_id', 'type', 'use_notification', 'alternative_email'
],
'FROM' => 'glpi_tickets_users',
'WHERE' => [
'tickets_id' => $tickets_id,
'type' => ['!=', 2]
]
]));
if (!$res) {
echo "{\"success\":false, \"message\":\"".__("Error : adding actors (user)", "escalade")."\"}";
exit;
Expand Down

0 comments on commit cdc5eb5

Please sign in to comment.