@@ -168,39 +168,6 @@ class="snipe-table table table-striped inventory"
168168 @endif
169169 </td >
170170 </tr >
171- @if ($settings -> show_assigned_assets )
172- @php
173- $assignedCounter = 1 ;
174- @endphp
175- @foreach ($asset -> assignedAssets as $asset )
176- <tr >
177- <td >{{ $counter } } .{{ $assignedCounter } } </td >
178- <td >
179- @if ($asset -> getImageUrl () )
180- <img src =" {{ $asset -> getImageUrl () } }" class =" thumbnail" style =" max-height : 50px ;" >
181- @endif
182- </td >
183- <td >{{ $asset -> asset_tag } } </td >
184- <td >{{ $asset -> name } } </td >
185- <td >{{ (($asset -> model ) && ($asset -> model -> category )) ? $asset -> model -> category -> name : trans (' general.invalid_category' ) } } </td >
186- <td >{{ ($asset -> model ) ? $asset -> model -> name : trans (' general.invalid_model' ) } } </td >
187- <td >{{ ($asset -> defaultLoc ) ? $asset -> defaultLoc -> name : ' ' } } </td >
188- <td >{{ ($asset -> location ) ? $asset -> location -> name : ' ' } } </td >
189- <td >{{ $asset -> serial } } </td >
190- <td >
191- {{ Helper:: getFormattedDateObject ($asset -> last_checkout , ' datetime' , false ) } }
192- </td >
193- <td >
194- @if ($asset -> getLatestSignedAcceptance ($show_user ) )
195- <img style =" width :auto ;height :100px ;" src =" {{ asset (' /' ) } } display-sig/{{ $asset -> getLatestSignedAcceptance ($show_user )-> accept_signature } }" >
196- @endif
197- </td >
198- </tr >
199- @php
200- $assignedCounter ++
201- @endphp
202- @endforeach
203- @endif
204171 @php
205172 $counter ++
206173 @endphp
@@ -240,7 +207,7 @@ class="snipe-table table table-striped inventory"
240207 $lcounter = 1 ;
241208 @endphp
242209
243- @foreach ($show_user -> licenses as $license )
210+ @foreach ($show_user -> directLicenses as $license )
244211 @php
245212 if (($license -> category ) && ($license -> category -> getEula ())) $eulas [] = $license -> category -> getEula ()
246213 @endphp
@@ -398,7 +365,95 @@ class="snipe-table table table-striped inventory"
398365 @endforeach
399366 </table >
400367 @endif
368+ @if ($indirectItemsCount > 0 && $settings -> show_assigned_assets )
369+ <div id =" indirect-assignments-toolbar" >
370+ <h4 >{{ $indirectItemsCount . ' ' . trans (' mail.assigned_to_assets' ) } } </h4 >
371+ </div >
372+ <table
373+ class =" snipe-table table table-striped inventory"
374+ id =" indirect-assignments"
375+ data-pagination =" false"
376+ data-toolbar =" #indirect-assignments-toolbar"
377+ data-id-table =" indirect-assignments"
378+ data-search =" false"
379+ data-side-pagination =" client"
380+ data-sortable =" true"
381+ data-sort-order =" desc"
382+ data-sort-name =" name"
383+ data-show-columns =" true"
384+ data-cookie-id-table =" indirect-assignments" >
385+ <thead >
386+ @php
387+ $indirectAssignmentsCounter = 1 ;
388+ @endphp
389+ <tr >
390+ <th style =" width : 20px ;" data-sortable =" false" data-switchable =" false" >#</th >
391+ <th style =" width : 40% ;" data-sortable =" true" data-switchable =" false" >{{ trans (' mail.assigned_to' ) } } </th >
392+ <th style =" width : 50% ;" data-sortable =" true" >{{ trans (' general.category' ) } } </th >
393+ <th style =" width : 10% ;" data-sortable =" true" >{{ trans (' mail.item' ) } } </th >
394+ <th style =" width : 10% ;" data-sortable =" true" >{{ trans (' general.quantity' ) } } </th >
395+ </tr >
396+ </thead >
401397
398+ @foreach ($show_user -> assets as $asset )
399+ @foreach ($asset -> assignedAssets as $indirectAsset )
400+ <tr >
401+ <td >{{ $indirectAssignmentsCounter } } </td >
402+ <td >{{ $asset -> display_name ?? ' ' } } </td >
403+ <td >{{ (($indirectAsset -> model ) && ($indirectAsset -> model -> category )) ? $indirectAsset -> model -> category -> name : trans (' general.invalid_category' ) } } </td >
404+ <td >{{ $indirectAsset -> display_name ?? ' ' } } </td >
405+ <td >1</td >
406+
407+ </tr >
408+ @php
409+ $indirectAssignmentsCounter ++
410+ @endphp
411+ @endforeach
412+ @foreach ($asset -> licenses as $indirectLicense )
413+ @if ($indirectLicense )
414+ <tr >
415+ <td >{{ $indirectAssignmentsCounter } } </td >
416+ <td >{{ $asset -> display_name ?? ' ' } } </td >
417+ <td >{{ $indirectLicense -> category ?-> name ?? ' ' } } </td >
418+ <td >{{ $indirectLicense -> name ?? ' ' } } </td >
419+ <td >1</td >
420+ </tr >
421+ @endif
422+ @php
423+ $indirectAssignmentsCounter ++
424+ @endphp
425+ @endforeach
426+ @foreach ($asset -> components as $component )
427+ @if ($component )
428+ <tr >
429+ <td >{{ $indirectAssignmentsCounter } } </td >
430+ <td >{{ $asset -> display_name ?? ' ' } } </td >
431+ <td >{{ $component -> category ?-> name ?? ' ' } } </td >
432+ <td >{{ $component -> name ?? ' ' } } </td >
433+ <td >{{ $component -> pivot -> assigned_qty } } </td >
434+ </tr >
435+ @endif
436+ @php
437+ $indirectAssignmentsCounter ++
438+ @endphp
439+ @endforeach
440+ @foreach ($asset -> assignedAccessories as $indirectAccessory )
441+ @if ($indirectAccessory )
442+ <tr >
443+ <td >{{ $indirectAssignmentsCounter } } </td >
444+ <td >{{ $asset -> display_name ?? ' ' } } </td >
445+ <td >{{ $indirectAccessory -> accessory -> category ?-> name ?? ' ' } } </td >
446+ <td >{{ $indirectAccessory -> accessory -> name ?? ' ' } } </td >
447+ <td >1</td >
448+ </tr >
449+ @endif
450+ @php
451+ $indirectAssignmentsCounter ++
452+ @endphp
453+ @endforeach
454+ @endforeach
455+ </table >
456+ @endif
402457 @php
403458 if (! empty ($eulas )) $eulas = array_unique ($eulas );
404459 @endphp
0 commit comments