File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -5596,9 +5596,14 @@ public function addFiles(array $input, $options = [])
55965596 } else {
55975597 if ($ this ->getType () == 'Ticket ' || (isset ($ input ['_job ' ]) && $ input ['_job ' ] instanceof Ticket)) {
55985598 //TRANS: Default document to files attached to tickets : %d is the ticket id
5599- $ input2 ["name " ] = addslashes (sprintf (__ ('Document Ticket %d ' ), $ this ->getID ()));
5600- $ input2 ["tickets_id " ] = $ this ->getID ();
5601- $ input2 ['itemtype ' ] = Ticket::class;
5599+ if (isset ($ input ['_job ' ]) && $ input ['_job ' ] instanceof Ticket) {
5600+ $ ticket_id = $ input ['_job ' ]->getID ();
5601+ } else {
5602+ $ ticket_id = $ this ->getID ();
5603+ }
5604+ $ input2 ["name " ] = addslashes (sprintf (__ ('Document Ticket %d ' ), $ ticket_id ));
5605+ $ input2 ["tickets_id " ] = $ ticket_id ;
5606+ $ input2 ['itemtype ' ] = Ticket::class;
56025607 }
56035608
56045609 if (isset ($ input ['_tag ' ][$ key ])) {
You can’t perform that action at this time.
0 commit comments