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

Add support for skipping fields

Alan Lam 8 лет назад
Родитель
Сommit
5fc513feec
1 измененных файлов с 8 добавлено и 4 удалено
  1. 8 4
      template_processing/age_verification/project_customer_csv.php

+ 8 - 4
template_processing/age_verification/project_customer_csv.php

@@ -1,14 +1,16 @@
 <?php
 
 $field_names = [
-	"Project Name",
-	"Test Status", "Test Result",
+	"Test Result",
 	"Location Name", "Address", "Region", "Internal ID", "Area Manager",
 
 	"Date",
 ];
 
 foreach($fields as $field) {
+	$customer_export = $field->customerExport ?? true;
+	if(!$customer_export) continue;
+
 	$field_names[] = $field->label;
 }
 
@@ -32,8 +34,6 @@ foreach($tests as $test) {
 	$travel_costs = "";
 
 	$output = [];
-	$output[] = $project->name;
-	$output[] = $test->getStatusText();
 
 	if(!is_null($test->pass)) {
 
@@ -66,6 +66,10 @@ foreach($tests as $test) {
 	$output[] = $test_date;
 
 	foreach($fields as $field) {
+
+		$customer_export = $field->customerExport ?? true;
+		if(!$customer_export) continue;
+
 		$field_name = $field->name;
 		$value = isset($test->$field_name) ? $test->$field_name : ($values[$field->name] ?? "");