File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -5594,8 +5594,14 @@ public function addFiles(array $input, $options = [])
55945594 $ doc ->update ($ input2 );
55955595 }
55965596 } else {
5597- if (($ input ['_job ' ] ?? $ this ) instanceof Ticket) {
5598- $ ticket_id = $ input ['_job ' ]->getID () ?? $ this ->getID ();
5597+
5598+ if ($ this ->getType () == 'Ticket ' || (isset ($ input ['_job ' ]) && $ input ['_job ' ] instanceof Ticket)) {
5599+ //TRANS: Default document to files attached to tickets : %d is the ticket id
5600+ if (isset ($ input ['_job ' ]) && $ input ['_job ' ] instanceof Ticket) {
5601+ $ ticket_id = $ input ['_job ' ]->getID ();
5602+ } else {
5603+ $ ticket_id = $ this ->getID ();
5604+ }
55995605 $ input2 ["name " ] = addslashes (sprintf (__ ('Document Ticket %d ' ), $ ticket_id ));
56005606 $ input2 ["tickets_id " ] = $ ticket_id ;
56015607 $ input2 ['itemtype ' ] = Ticket::class;
You can’t perform that action at this time.
0 commit comments