@@ -150,11 +150,12 @@ public function data($ticketList = 'active')
150150 ->with ('owner.department.ancestor ' )
151151 ->withCount ('allAttachments ' )
152152 ->withCount (['comments ' => function ($ query ) use ($ currentLevel ){
153- $ query ->countable ()->forLevel ($ currentLevel );
153+ $ query ->countable ()->forLevel ($ currentLevel )-> where ( ' type ' , ' != ' , ' note ' ) ;
154154 }])
155155 ->withCount (['recentComments ' => function ($ query ) use ($ currentLevel ){
156- $ query ->countable ()->forLevel ($ currentLevel );
157- }]);
156+ $ query ->countable ()->forLevel ($ currentLevel )->where ('type ' , '!= ' , 'note ' );
157+ }])
158+ ->withCount ('internalNotes ' );
158159
159160 $ collection = $ datatables ->of ($ collection );
160161
@@ -225,8 +226,11 @@ public function renderTicketTable($collection)
225226 $ field .=$ ticket ->recent_comments_count .' ' ;
226227 }
227228 if ($ ticket ->comments_count >0 ){
228- $ field .=' <span class="fa fa-comment tooltip-info comment" title=" ' .trans ('panichd::lang.table-info-comments-total ' , ['num ' =>$ ticket ->comments_count ]).($ ticket ->recent_comments_count >0 ? ' ' .trans ('panichd::lang.table-info-comments-recent ' , ['num ' =>$ ticket ->recent_comments_count ]) : '' ).'"></span> ' ;
229+ $ field .=$ ticket -> comments_count . ' <span class="fa fa-comments tooltip-info comment" title=" ' .trans ('panichd::lang.table-info-comments-total ' , ['num ' =>$ ticket ->comments_count ]).($ ticket ->recent_comments_count >0 ? ' ' .trans ('panichd::lang.table-info-comments-recent ' , ['num ' =>$ ticket ->recent_comments_count ]) : '' ).'"></span> ' ;
229230 }
231+ if ($ this ->member ->currentLevel () >= 2 and $ ticket ->internal_notes_count > 0 ){
232+ $ field .= ' ' . $ ticket ->internal_notes_count . ' <span class="fa fa-pencil-alt tooltip-info comment" title=" ' . trans ('panichd::lang.table-info-notes-total ' , ['num ' => $ ticket ->internal_notes_count ]) . '"></span> ' ;
233+ }
230234
231235 return $ field ;
232236 });
0 commit comments