Skip to content

Commit

Permalink
Fix presentation assigned count
Browse files Browse the repository at this point in the history
  • Loading branch information
bluecraank committed Feb 26, 2024
1 parent 4624edd commit 5da84d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
20 changes: 8 additions & 12 deletions app/Http/Controllers/PresentationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,14 @@ public function index()

// Loop through groups and devices and see which presentations are unused
foreach($presentations as $presentation) {
foreach($groups as $group) {
if($group->presentation?->id == $presentation->id) {
$countUsed++;
break;
}
}

foreach($devices as $device) {
if($device->presentation?->id == $presentation->id) {
$countUsed++;
break;
}
$devices = $presentation->devices->count();
$groups = $presentation->groups->count();
$schedules = $presentation->schedules->count();

if($devices == 0 && $groups == 0 && $schedules == 0) {
$countUnused++;
} else {
$countUsed++;
}
}

Expand Down
2 changes: 1 addition & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
| any other location as required by the application or its packages.
|
*/
'version' => '1.5.4',
'version' => '1.5.5',

'placeholder_image' => 'https://placehold.co/600x338?text=Assign\nTemplate',

Expand Down

0 comments on commit 5da84d7

Please sign in to comment.