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

Add billing entity column to locations table

Alan Lam 2 лет назад
Родитель
Сommit
9ce41a5916
1 измененных файлов с 20 добавлено и 1 удалено
  1. 20 1
      views/locations_table.php

+ 20 - 1
views/locations_table.php

@@ -12,7 +12,8 @@ namespace App;
 		<col style="width: 1%"/>
 		<col style="width: 20%"/>
 		<col style="width: 20%"/>
-		<col style="width: 50%"/>
+		<col style="width: 20%"/>
+		<col style="width: 30%"/>
 		<col style="width: 10%"/>
 		<col style="width: 1%"/>
 	</colgroup>
@@ -20,6 +21,7 @@ namespace App;
 	<tr>
 		<th><?=htmlspecialchars(__("ID"))?></th>
 		<th><?=htmlspecialchars(__("Customer"))?></th>
+		<th><?=htmlspecialchars(__("Billing Entity"))?></th>
 		<th><?=htmlspecialchars(__("Name"))?></th>
 		<th><?=htmlspecialchars(__("Address"))?></th>
 		<th><?=htmlspecialchars(__("Map"))?></th>
@@ -30,6 +32,7 @@ namespace App;
 	<?php
 	foreach($locations as $location) {
 		$customer = $location->getCustomer();
+		$billing_entity = $location->getBillingEntity();
 		$address = $location->getAddress();
 		?>
 		<tr>
@@ -39,6 +42,22 @@ namespace App;
 					<?=htmlspecialchars($customer->name)?>
 				</a>
 			</td>
+			<td>
+				<?php
+				if($billing_entity) {
+					?>
+					<a href="<?=htmlspecialchars($billing_entity->getUrl())?>">
+						<?=htmlspecialchars($billing_entity->name)?>
+					</a>
+					<?php
+				}
+				else {
+					?>
+					<?=htmlspecialchars(__("Default"))?>
+					<?php
+				}
+				?>
+			</td>
 			<td>
 				<?=htmlspecialchars($location->name)?>
 			</td>