|
|
@@ -78,11 +78,13 @@ $data = [];
|
|
|
$region_data = [];
|
|
|
$area_manager_data = [];
|
|
|
$brand_data = [];
|
|
|
+$operations_manager_data = [];
|
|
|
|
|
|
$total_data = new stdClass;
|
|
|
|
|
|
$locations_missing_region = [];
|
|
|
$locations_missing_area_manager = [];
|
|
|
+$locations_missing_operations_manager = [];
|
|
|
$locations_missing_brand = [];
|
|
|
|
|
|
$charts = [];
|
|
|
@@ -244,6 +246,7 @@ if($submit) {
|
|
|
$regions = array_filter(array_column($locations, "region"));
|
|
|
$area_managers = array_filter(array_column($locations, "area_manager"));
|
|
|
$brands = array_filter(array_column($locations, "brand"));
|
|
|
+ $operations_managers = array_filter(array_column($locations, "operations_manager_name"));
|
|
|
|
|
|
uksort($regions, "strnatcasecmp");
|
|
|
uksort($area_managers, "strnatcasecmp");
|
|
|
@@ -261,14 +264,20 @@ if($submit) {
|
|
|
$brand_data[$brand] = [];
|
|
|
}
|
|
|
|
|
|
+ foreach($operations_managers as $operations_manager) {
|
|
|
+ $operations_manager_data[$operations_manager] = [];
|
|
|
+ }
|
|
|
+
|
|
|
$has_regions = !empty($region_data);
|
|
|
$has_area_managers = !empty($area_manager_data);
|
|
|
$has_brands = !empty($brand_data);
|
|
|
+ $has_operation_managers = !empty($operations_manager_data);
|
|
|
|
|
|
foreach($locations as $location) {
|
|
|
if($has_regions && !$location->region) $locations_missing_region[] = $location;
|
|
|
if($has_area_managers && !$location->area_manager) $locations_missing_area_manager[] = $location;
|
|
|
if($has_brands && !$location->brand) $locations_missing_brand[] = $location;
|
|
|
+ if($has_operation_managers && !$location->operations_manager_name) $locations_missing_operations_manager[] = $location;
|
|
|
}
|
|
|
|
|
|
// Check if date range is same year
|
|
|
@@ -346,6 +355,12 @@ if($submit) {
|
|
|
$b[$key]->label = $label;
|
|
|
}
|
|
|
unset($b);
|
|
|
+
|
|
|
+ foreach($operations_manager_data as &$om) {
|
|
|
+ $om[$key] = clone $empty_data;
|
|
|
+ $om[$key]->label = $label;
|
|
|
+ }
|
|
|
+ unset($om);
|
|
|
}
|
|
|
|
|
|
$max_unix = 0;
|
|
|
@@ -368,6 +383,7 @@ if($submit) {
|
|
|
foreach($tests as $test) {
|
|
|
|
|
|
$tester = $test->getTester();
|
|
|
+ /** @var Location $location */
|
|
|
$location = $test->getLocation();
|
|
|
$venue_types = $location->getVenueTypes();
|
|
|
$project = $test->getProject();
|
|
|
@@ -392,6 +408,7 @@ if($submit) {
|
|
|
$region = $location->region;
|
|
|
$area_manager = $location->area_manager;
|
|
|
$brand = $location->brand;
|
|
|
+ $operations_manager = $location->operations_manager_name;
|
|
|
|
|
|
$dts = $project->dts_report ?: $test->dts_start;
|
|
|
|
|
|
@@ -434,6 +451,9 @@ if($submit) {
|
|
|
if($brand) {
|
|
|
$brand_data[$brand][$key]->testCount++;
|
|
|
}
|
|
|
+ if($operations_manager) {
|
|
|
+ $operations_manager_data[$operations_manager][$key]->testCount++;
|
|
|
+ }
|
|
|
|
|
|
if($tester->gender === "M") {
|
|
|
$data[$key]->maleTesterCount++;
|
|
|
@@ -460,6 +480,7 @@ if($submit) {
|
|
|
$generator->setRegionData($region_data);
|
|
|
$generator->setBrandData($brand_data);
|
|
|
$generator->setAreaManagerData($area_manager_data);
|
|
|
+ $generator->setOperationsManagerData($operations_manager_data);
|
|
|
$generator->setTemplate($template);
|
|
|
|
|
|
// Build charts hook
|
|
|
@@ -486,5 +507,5 @@ if($submit) {
|
|
|
}
|
|
|
|
|
|
View::includeOnce("header", compact("page_title"));
|
|
|
-View::include("reports", compact("customer", "date_range", "date_start", "date_end", "date_resolution", "all_projects", "project_table_data", "exclude_project_ids", "location_ids", "retests", "charts", "data", "total_data", "locations_missing_region", "locations_missing_area_manager", "locations_missing_brand", "region_data", "area_manager_data", "brand_data", "key_labels", "has_pass_fail"));
|
|
|
+View::include("reports", compact("customer", "date_range", "date_start", "date_end", "date_resolution", "all_projects", "project_table_data", "exclude_project_ids", "location_ids", "retests", "charts", "data", "total_data", "locations_missing_region", "locations_missing_area_manager", "locations_missing_operations_manager", "locations_missing_brand", "region_data", "area_manager_data", "brand_data", "operations_manager_data", "key_labels", "has_pass_fail"));
|
|
|
View::includeOnce("footer");
|