|
|
@@ -18,6 +18,7 @@
|
|
|
* @var array $project_table_data
|
|
|
* @var Location[] $locations_missing_region
|
|
|
* @var Location[] $locations_missing_area_manager
|
|
|
+ * @var Location[] $locations_missing_brand
|
|
|
*
|
|
|
* @var array $total_data
|
|
|
* @var array $region_data
|
|
|
@@ -190,57 +191,47 @@ let projectData = <?=json_encode($project_table_data)?>;
|
|
|
|
|
|
<?php
|
|
|
if($user->canSeeMissingData()) {
|
|
|
- if($locations_missing_region) {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @param string $field
|
|
|
+ * @param Location[] $locations
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ $render_locations_missing_data = static function(string $field, array $locations): void {
|
|
|
?>
|
|
|
<div class="alert alert-warning limit-height-1 d-print-none">
|
|
|
- There are some locations that are missing "region" information:
|
|
|
+ There are some locations that are missing "<?=htmlspecialchars($field)?>" information:
|
|
|
<ul class="mb-0">
|
|
|
- <?php
|
|
|
- foreach($locations_missing_region as $location) {
|
|
|
- $url = (Core::$user->canAdmin()) ? "/account/locations/$location->id/edit" : "#";
|
|
|
- ?>
|
|
|
- <li>
|
|
|
- <a href="<?=htmlspecialchars($url)?>"><?=htmlspecialchars($location->name)?></a>
|
|
|
- <?php
|
|
|
- if($location->internal_id) {
|
|
|
- ?>
|
|
|
- <small class="text-info">(Internal ID: <?=htmlspecialchars($location->internal_id)?>)</small>
|
|
|
- <?php
|
|
|
- }
|
|
|
- ?>
|
|
|
- </li>
|
|
|
<?php
|
|
|
- }
|
|
|
- ?>
|
|
|
+ foreach($locations as $location) {
|
|
|
+ $url = (Core::$user->canAdmin()) ? "/account/locations/$location->id/edit" : "#";
|
|
|
+ ?>
|
|
|
+ <li>
|
|
|
+ <a href="<?=htmlspecialchars($url)?>"><?=htmlspecialchars($location->name)?></a>
|
|
|
+ <?php
|
|
|
+ if($location->internal_id) {
|
|
|
+ ?>
|
|
|
+ <small class="text-info">(Internal ID: <?=htmlspecialchars($location->internal_id)?>)</small>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </li>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
</ul>
|
|
|
</div>
|
|
|
<?php
|
|
|
+ };
|
|
|
+
|
|
|
+ if($locations_missing_region) {
|
|
|
+ $render_locations_missing_data("region", $locations_missing_region);
|
|
|
}
|
|
|
if($locations_missing_area_manager) {
|
|
|
- ?>
|
|
|
- <div class="alert alert-warning limit-height-1 d-print-none">
|
|
|
- There are some locations that are missing "area manager" information:
|
|
|
- <ul class="mb-0">
|
|
|
- <?php
|
|
|
- foreach($locations_missing_area_manager as $location) {
|
|
|
- $url = (Core::$user->canAdmin()) ? "/account/locations/$location->id/edit" : "#";
|
|
|
- ?>
|
|
|
- <li>
|
|
|
- <a href="<?=htmlspecialchars($url)?>"><?=htmlspecialchars($location->name)?></a>
|
|
|
- <?php
|
|
|
- if($location->internal_id) {
|
|
|
- ?>
|
|
|
- <small class="text-info">(Internal ID: <?=htmlspecialchars($location->internal_id)?>)</small>
|
|
|
- <?php
|
|
|
- }
|
|
|
- ?>
|
|
|
- </li>
|
|
|
- <?php
|
|
|
- }
|
|
|
- ?>
|
|
|
- </ul>
|
|
|
- </div>
|
|
|
- <?php
|
|
|
+ $render_locations_missing_data("area manager", $locations_missing_area_manager);
|
|
|
+ }
|
|
|
+ if($locations_missing_brand) {
|
|
|
+ $render_locations_missing_data("brand", $locations_missing_brand);
|
|
|
}
|
|
|
}
|
|
|
|