|
|
@@ -1,17 +1,19 @@
|
|
|
-<table class="table table-sm table-hover">
|
|
|
+<table class="table table-sm table-sm-text table-hover">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th class="text-right pr-3">ID</th>
|
|
|
<th>Name</th>
|
|
|
- <th>Template</th>
|
|
|
+ <th>Tests</th>
|
|
|
<th>Period</th>
|
|
|
- <th>Year</th>
|
|
|
<th>Report Month</th>
|
|
|
<th></th>
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
<?php
|
|
|
+ $project_ids = array_column($projects, "id");
|
|
|
+ $tests = Test::query(["project_id" => $project_ids]);
|
|
|
+
|
|
|
foreach($projects as $project) {
|
|
|
|
|
|
$year = date("Y", strtotime($project->dts_start));
|
|
|
@@ -30,12 +32,18 @@
|
|
|
|
|
|
$template = $project->getTemplate();
|
|
|
|
|
|
+ $completed_tests = array_filter($tests, function($test) use ($project) {
|
|
|
+ return ($project->id == $test->project_id) && ($test->status == Test::STATUS_COMPLETED);
|
|
|
+ });
|
|
|
+ $completed_test_count = count($completed_tests);
|
|
|
+
|
|
|
?>
|
|
|
<tr>
|
|
|
<td class="text-right pr-3 align-middle">
|
|
|
<?=$project->id?>
|
|
|
</td>
|
|
|
<td class="align-middle">
|
|
|
+ <small><strong><a href="<?=htmlspecialchars($template->getURL())?>"><?=htmlspecialchars($template->name)?></a></strong></small><br />
|
|
|
<a href="/account/projects/<?=$project->id?>"><?=htmlspecialchars($project->name)?></a>
|
|
|
<?php
|
|
|
if($time_of_day_icon) {
|
|
|
@@ -46,20 +54,19 @@
|
|
|
?>
|
|
|
</td>
|
|
|
<td class="align-middle">
|
|
|
- <a href="<?=htmlspecialchars($template->getURL())?>"><?=htmlspecialchars($template->name)?></a>
|
|
|
+ <small><strong>Completed</strong></small><br />
|
|
|
+ <?=$completed_test_count?> / <?=$project->test_count?>
|
|
|
</td>
|
|
|
<td class="align-middle">
|
|
|
+ <small><strong><?=$year?></strong></small><br />
|
|
|
<?=$date_start?> -
|
|
|
<?=$date_deadline?>
|
|
|
</td>
|
|
|
- <td class="align-middle">
|
|
|
- <?=$year?>
|
|
|
- </td>
|
|
|
<td class="align-middle">
|
|
|
<?=$report_month?>
|
|
|
</td>
|
|
|
<td class="text-right align-middle">
|
|
|
- <a class="btn btn-outline-primary" href="/account/projects/<?=$project->id?>/edit">Edit</a>
|
|
|
+ <a class="btn btn-sm btn-outline-primary" href="/account/projects/<?=$project->id?>/edit">Edit</a>
|
|
|
</td>
|
|
|
</tr>
|
|
|
<?php
|