Skip to content

Commit 742a7b4

Browse files
committed
refracto
1 parent 5847f96 commit 742a7b4

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/CommonDBTM.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5594,13 +5594,8 @@ public function addFiles(array $input, $options = [])
55945594
$doc->update($input2);
55955595
}
55965596
} else {
5597-
if ($this->getType() == 'Ticket' || (isset($input['_job']) && $input['_job'] instanceof Ticket)) {
5598-
//TRANS: Default document to files attached to tickets : %d is the ticket id
5599-
if (isset($input['_job']) && $input['_job'] instanceof Ticket) {
5600-
$ticket_id = $input['_job']->getID();
5601-
} else {
5602-
$ticket_id = $this->getID();
5603-
}
5597+
if (($input['_job'] ?? $this) instanceof Ticket) {
5598+
$ticket_id = $input['_job']->getID() ?? $this->getID();
56045599
$input2["name"] = addslashes(sprintf(__('Document Ticket %d'), $ticket_id));
56055600
$input2["tickets_id"] = $ticket_id;
56065601
$input2['itemtype'] = Ticket::class;

0 commit comments

Comments
 (0)