Просмотр исходного кода

Add "View PDF" button for customers in test list

Alan Lam 1 год назад
Родитель
Сommit
57385bee5d
1 измененных файлов с 16 добавлено и 15 удалено
  1. 16 15
      views/test_list.php

+ 16 - 15
views/test_list.php

@@ -373,13 +373,7 @@ foreach($projects as $project) {
 							?>
 							?>
 							<th>Result</th>
 							<th>Result</th>
 							<th>Retest</th>
 							<th>Retest</th>
-							<?php
-							if($is_staff) {
-								?>
-								<th>Actions</th>
-								<?php
-							}
-							?>
+							<th>Actions</th>
 						</tr>
 						</tr>
 						</thead>
 						</thead>
 						<tbody>
 						<tbody>
@@ -547,10 +541,10 @@ foreach($projects as $project) {
 									}
 									}
 									?>
 									?>
 								</td>
 								</td>
-								<?php
-								if($is_staff) {
-									?>
-									<td class="text-right align-middle">
+								<td class="text-right align-middle">
+									<?php
+									if($is_staff) {
+										?>
 										<div class="dropdown">
 										<div class="dropdown">
 											<button class="btn btn-sm btn-secondary dropdown-toggle" type="button" id="test-dropdown-<?=$test->id?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
 											<button class="btn btn-sm btn-secondary dropdown-toggle" type="button" id="test-dropdown-<?=$test->id?>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
 												Actions
 												Actions
@@ -571,10 +565,17 @@ foreach($projects as $project) {
 												?>
 												?>
 											</div>
 											</div>
 										</div>
 										</div>
-									</td>
-									<?php
-								}
-								?>
+										<?php
+									}
+									else if($test->hasPDF()) {
+										?>
+										<a class="btn btn-primary" href="<?=htmlspecialchars($test->getPDFUrl())?>" target="_blank">
+											View PDF
+										</a>
+										<?php
+									}
+									?>
+								</td>
 							</tr>
 							</tr>
 							<?php
 							<?php
 						}
 						}