Skip to content

Commit 97e6f42

Browse files
committed
Bug: Resend recipients was missing in ticket edition
1 parent e412db1 commit 97e6f42

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

src/Controllers/TicketsController.php

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ public function edit($id, $parameters = null)
683683
$member = $this->member->find(auth()->user()->id);
684684

685685
// Ticket comments
686-
$all_comments = $ticket->comments();
686+
$all_comments = $ticket->comments()->with('notifications');
687687
$comments = clone $all_comments;
688688
$data['comments'] = $comments->forLevel($member->levelInCategory($ticket->category_id))->orderBy('id','desc')->paginate(Setting::grab('paginate_items'));
689689

@@ -703,6 +703,8 @@ public function edit($id, $parameters = null)
703703
'reply' => array_unique($a_reply)
704704
];
705705

706+
$data['a_resend_notifications'] = $this->get_resend_notifications($ticket, $all_comments);
707+
706708
return view('panichd::tickets.createedit', $data);
707709
}
708710

@@ -1300,8 +1302,24 @@ public function show($id)
13001302

13011303
$c_members = $this->members_collection($member, false);
13021304

1305+
$a_resend_notifications = $this->get_resend_notifications($ticket, $all_comments);
1306+
1307+
$data = compact('ticket', 'a_reasons', 'a_tags_selected', 'status_lists', 'complete_status_list', 'agent_lists', 'tag_lists',
1308+
'comments', 'a_notifications', 'c_members', 'a_resend_notifications', 'close_perm', 'reopen_perm');
1309+
$data['menu'] = 'show';
1310+
return view('panichd::tickets.show', $data);
1311+
}
1312+
1313+
/*
1314+
* Get list of resend notifiications for each reply
1315+
*
1316+
* @return Array
1317+
*/
1318+
public function get_resend_notifications($ticket, $all_comments)
1319+
{
13031320
// Recipients for notification resend
13041321
$a_resend_notifications = [];
1322+
13051323
foreach ($all_comments->get() as $comment){
13061324
if ($comment->type == 'reply'){
13071325

@@ -1336,10 +1354,7 @@ public function show($id)
13361354
}
13371355
}
13381356

1339-
$data = compact('ticket', 'a_reasons', 'a_tags_selected', 'status_lists', 'complete_status_list', 'agent_lists', 'tag_lists',
1340-
'comments', 'a_notifications', 'c_members', 'a_resend_notifications', 'close_perm', 'reopen_perm');
1341-
$data['menu'] = 'show';
1342-
return view('panichd::tickets.show', $data);
1357+
return $a_resend_notifications;
13431358
}
13441359

13451360
/*

0 commit comments

Comments
 (0)