diff --git a/class/Factory/CSV.php b/class/Factory/CSV.php index f734e37..e7d5662 100644 --- a/class/Factory/CSV.php +++ b/class/Factory/CSV.php @@ -12,6 +12,10 @@ namespace volunteer\Factory; +if (!defined('VOL_USE_PREFERRED_ON_REPORT')) { + define('VOL_USE_PREFERRED_ON_REPORT', true); +} + class CSV { @@ -25,8 +29,12 @@ public static function buildRows(array $list, string $type) $reason = $reasons[$listRow['reasonId']]['title']; } if ($type === 'sponsor') { - $csvrow['firstName'] = $listRow['firstName']; - $csvrow['preferredName'] = $listRow['preferredName'] ?? ''; + if (VOL_USE_PREFERRED_ON_REPORT) { + $csvrow['firstName'] = $listRow['preferredName'] ?? $listRow['firstName']; + } else { + $csvrow['firstName'] = $listRow['firstName']; + $csvrow['preferredName'] = $listRow['preferredName'] ?? ''; + } $csvrow['lastName'] = $listRow['lastName']; $csvrow['bannerId'] = $listRow['bannerId']; } else { diff --git a/config/defines.dist.php b/config/defines.dist.php index 06a796e..8907902 100644 --- a/config/defines.dist.php +++ b/config/defines.dist.php @@ -26,3 +26,4 @@ define('VOL_SHIB_LOGOUT_TAG', ''); define('VOL_SHIB_USERNAME_TAG', ''); // name of SERVER variable containing the username define('VOL_CONTACT_EMAIL', ''); +define('VOL_USE_PREFERRED_ON_REPORT', true);