|
175 | 175 | </li> |
176 | 176 | @foreach($agents as $agent) |
177 | 177 | <li class="list-group-item d-flex"> |
178 | | - <?php $agent_text = $agent->name . ' <span class="badge">' . ($agent->agentTickets(false)->count() + |
179 | | - $agent->agentTickets(true)->count()) . '</span>'; ?> |
| 178 | + <?php $agent_text = $agent->name . ' <span class="badge">' . $agent->ticketsAsAgent()->count() . '</span>'; ?> |
180 | 179 | <span class="mr-auto"> |
181 | 180 | @if ($setting->grab('user_route') != 'disabled') |
182 | 181 | <a href="{{ route($setting->grab('user_route'), ['user' => $agent->id]) }}">{!! $agent_text !!}</a> |
|
187 | 186 | <span class="small"> |
188 | 187 | <?php |
189 | 188 | $a_button = [ |
190 | | - 'newest' => $agent->agentTickets(false)->newest()->count() . ' ' . trans('panichd::lang.newest-tickets-adjective'), |
191 | | - 'active' => $agent->agentTickets(false)->active()->count() . ' ' . trans('panichd::lang.active-tickets-adjective'), |
192 | | - 'complete' => $agent->agentTickets(true)->count() . ' ' . trans('panichd::lang.complete-tickets-adjective') |
| 189 | + 'newest' => $agent->ticketsAsAgent()->newest()->count() . ' ' . trans('panichd::lang.newest-tickets-adjective'), |
| 190 | + 'active' => $agent->ticketsAsAgent()->active()->count() . ' ' . trans('panichd::lang.active-tickets-adjective'), |
| 191 | + 'complete' => $agent->ticketsAsAgent()->complete()->count() . ' ' . trans('panichd::lang.complete-tickets-adjective') |
193 | 192 | ]; |
194 | 193 | ?> |
195 | 194 |
|
196 | | - @if ($agent->agentTickets(false)->newest()->count() == 0) |
| 195 | + @if ($agent->ticketsAsAgent()->newest()->count() == 0) |
197 | 196 | {{ $a_button['newest'] }} |
198 | 197 | @else |
199 | 198 | <a href="{{ route($setting->grab('main_route') . '-filteronly', ['filter' => 'agent', 'value' => $agent->id, 'list' => 'newest']) }}" class="btn btn-light btn-xs" title="{{ trans('panichd::admin.index-view-agent-tickets', ['list' =>trans('panichd::lang.newest-tickets-adjective')]) }}"> |
200 | 199 | {{ $a_button['newest'] }} |
201 | 200 | </a> |
202 | 201 | @endif |
203 | 202 | - |
204 | | - @if ($agent->agentTickets(false)->active()->count() == 0) |
| 203 | + @if ($agent->ticketsAsAgent()->active()->count() == 0) |
205 | 204 | {{ $a_button['active'] }} |
206 | 205 | @else |
207 | 206 | <a href="{{ route($setting->grab('main_route') . '-filteronly', ['filter' => 'agent', 'value' => $agent->id, 'list' => 'active']) }}" class="btn btn-light btn-xs" title="{{ trans('panichd::admin.index-view-agent-tickets', ['list' =>trans('panichd::lang.active-tickets-adjective')]) }}"> |
208 | 207 | {{ $a_button['active'] }} |
209 | 208 | </a> |
210 | 209 | @endif |
211 | 210 | - |
212 | | - @if ($agent->agentTickets(true)->count() == 0) |
| 211 | + @if ($agent->ticketsAsAgent()->complete()->count() == 0) |
213 | 212 | {{ $a_button['complete'] }} |
214 | 213 | @else |
215 | 214 | <a href="{{ route($setting->grab('main_route') . '-filteronly', ['filter' => 'agent', 'value' => $agent->id, 'list' => 'complete']) }}" class="btn btn-light btn-xs" title="{{ trans('panichd::admin.index-view-agent-tickets', ['list' =>trans('panichd::lang.complete-tickets-adjective')]) }}"> |
|
0 commit comments