diff --git a/src/CartToFamily.php b/src/CartToFamily.php
index 43b39c369d..d0d36f2fc2 100644
--- a/src/CartToFamily.php
+++ b/src/CartToFamily.php
@@ -16,6 +16,7 @@
require 'Include/Functions.php';
use ChurchCRM\Authentication\AuthenticationManager;
+use ChurchCRM\dto\SystemConfig;
use ChurchCRM\dto\SystemURLs;
use ChurchCRM\model\ChurchCRM\PersonQuery;
use ChurchCRM\Utils\InputUtils;
@@ -50,8 +51,9 @@
$sCity = SelectWhichInfo(InputUtils::legacyFilterInput($_POST['City']), $per_City);
$sZip = SelectWhichInfo(InputUtils::legacyFilterInput($_POST['Zip']), $per_Zip);
$sCountry = SelectWhichInfo(InputUtils::legacyFilterInput($_POST['Country']), $per_Country);
+ $sDefaultCountry = SystemConfig::getValue('sDefaultCountry');
- if ($sCountry == 'United States' || $sCountry == 'Canada') {
+ if ($sCountry == $sDefaultCountry) {
$sState = InputUtils::legacyFilterInput($_POST['State']);
} else {
$sState = InputUtils::legacyFilterInput($_POST['StateTextbox']);
@@ -288,7 +290,7 @@
OR
-
= gettext('(Use the textbox for countries other than US and Canada)') ?>
diff --git a/src/PersonEditor.php b/src/PersonEditor.php
index 61d2d3c19b..bf31eba82e 100644
--- a/src/PersonEditor.php
+++ b/src/PersonEditor.php
@@ -150,8 +150,9 @@
}
$sCountryTest = SelectWhichInfo($sCountry, $fam_Country, false);
+ $sDefaultCountry = SystemConfig::getValue('sDefaultCountry');
$sState = '';
- if ($sCountryTest == 'United States' || $sCountryTest == 'Canada') {
+ if ($sCountryTest == $sDefaultCountry) {
if (array_key_exists('State', $_POST)) {
$sState = InputUtils::legacyFilterInput($_POST['State']);
}
@@ -903,7 +904,7 @@ class="form-control">
"
size="20" maxlength="30" class="form-control">
diff --git a/src/Reports/CanvassReports.php b/src/Reports/CanvassReports.php
index 87318b4c56..9d7038a9eb 100644
--- a/src/Reports/CanvassReports.php
+++ b/src/Reports/CanvassReports.php
@@ -158,6 +158,7 @@ function CanvassBriefingSheets(string $iFYID): void
$memberClassX = $memberAgeX + 20;
$memberCellX = $memberClassX + 20;
$memberEmailX = $memberCellX + 25;
+ $sDefaultCountry = SystemConfig::getValue('sDefaultCountry');
while ($aFamily = mysqli_fetch_array($rsFamilies)) {
$curY = $topY;
@@ -185,7 +186,7 @@ function CanvassBriefingSheets(string $iFYID): void
}
$pdf->writeAt(SystemConfig::getValue('leftX'), $curY, $aFamily['fam_City'] . ', ' . $aFamily['fam_State'] . ' ' . $aFamily['fam_Zip']);
$curY += 5;
- if ($aFamily['fam_Country'] != '' && $aFamily['fam_Country'] != 'United States' && $aFamily['fam_Country'] != 'USA') {
+ if ($aFamily['fam_Country'] != '' && $aFamily['fam_Country'] != $sDefaultCountry) {
$pdf->writeAt(SystemConfig::getValue('leftX'), $curY, $aFamily['fam_Country']);
$curY += 5;
}
diff --git a/src/Reports/ConfirmLabels.php b/src/Reports/ConfirmLabels.php
index e9a7cc0217..029ed4a122 100644
--- a/src/Reports/ConfirmLabels.php
+++ b/src/Reports/ConfirmLabels.php
@@ -50,7 +50,7 @@
}
$labelText .= sprintf("\n%s, %s %s", $family->getCity(), $family->getState(), $family->getZip());
- if ($family->getCountry() != '' && $family->getCountry() != 'USA' && $family->getCountry() != 'United States') {
+ if ($family->getCountry() != '' && $family->getCountry() != $sDefaultCountry) {
$labelText .= "\n" . $family->getCountry();
}
diff --git a/src/Reports/NewsLetterLabels.php b/src/Reports/NewsLetterLabels.php
index c0818161bb..db10f2bca0 100644
--- a/src/Reports/NewsLetterLabels.php
+++ b/src/Reports/NewsLetterLabels.php
@@ -52,7 +52,7 @@
}
$labelText .= sprintf("\n%s, %s %s", $family->getCity(), $family->getState(), $family->getZip());
- if ($family->getCountry() != '' && $family->getCountry() != 'US' && $family->getCountry() != 'USA' && $family->getCountry() != 'United States') {
+ if ($family->getCountry() != '' && $family->getCountry() != $sDefaultCountry) {
$labelText .= "\n" . $family->getCountry();
}
diff --git a/src/Reports/TaxReport.php b/src/Reports/TaxReport.php
index 324ca40f3c..9885fad0d9 100644
--- a/src/Reports/TaxReport.php
+++ b/src/Reports/TaxReport.php
@@ -253,7 +253,8 @@ public function finishPage($curY, $fam_ID, $fam_Name, $fam_Address1, $fam_Addres
}
$this->writeAt(SystemConfig::getValue('leftX'), $curY, $fam_City . ', ' . $fam_State . ' ' . $fam_Zip);
$curY += SystemConfig::getValue('incrementY');
- if ($fam_Country != '' && $fam_Country != 'USA' && $fam_Country != 'United States') {
+ $sDefaultCountry = SystemConfig::getValue('sDefaultCountry');
+ if ($fam_Country != '' && $fam_Country != $sDefaultCountry) {
$this->writeAt(SystemConfig::getValue('leftX'), $curY, $fam_Country);
$curY += SystemConfig::getValue('incrementY');
}
@@ -267,7 +268,7 @@ public function finishPage($curY, $fam_ID, $fam_Name, $fam_Address1, $fam_Addres
}
$this->writeAt(SystemConfig::getValue('leftX') + 5, $curY, SystemConfig::getValue('sChurchCity') . ', ' . SystemConfig::getValue('sChurchState') . ' ' . SystemConfig::getValue('sChurchZip'));
$curY += SystemConfig::getValue('incrementY');
- if ($fam_Country != '' && $fam_Country != 'USA' && $fam_Country != 'United States') {
+ if ($fam_Country != '' && $fam_Country != $sDefaultCountry) {
$this->writeAt(SystemConfig::getValue('leftX') + 5, $curY, $fam_Country);
$curY += SystemConfig::getValue('incrementY');
}
|