From cbc425f52487698c67d862c946738fab95326cc6 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 26 Jun 2024 10:12:53 +0200 Subject: [PATCH 1/5] Re-add RDA support to ADIF exports --- application/libraries/AdifHelper.php | 30 +++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index e383a3415..ffe997a52 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -198,14 +198,30 @@ class AdifHelper { $line .= $this->getAdifFieldLine("MY_STATE", $qso->state); - // We fill county only if it has a value and it's USA, Alaska or Hawaii. Other countrys are not supported at the moment due complex adif specs - if ($qso->station_cnty && ($qso->station_dxcc == '291' || $qso->station_dxcc == '006' || $qso->station_dxcc == '110')) { - $county = trim($qso->state) . "," . trim($qso->station_cnty); - } else { - $county = ''; - } + // We fill county only if it has a value and it's USA, Alaska, Hawaii or Russia (European or Asiaric). Other countrys are not supported at the moment due complex adif specs - $line .= $this->getAdifFieldLine("MY_CNTY", $county); + if ($qso->station_cnty) { + switch ($qso->station_dxcc) { + case '291': + case '6': + case '110': + $county = trim($qso->state) . "," . trim($qso->station_cnty); + break; + case '54': + case '15': + case '61': + case '126': + case '151': + $county = trim($qso->station_cnty); + break; + default: + $county = ''; + } + } else { + $county = ''; + } + + $line .= $this->getAdifFieldLine("MY_CNTY", $county); $stationsSig = $qso->station_sig; // If MY_SIG is WWFF or "" and there's a station_wwff set, use data from station_wwff From 2e1a283ca7efe9c63c1d96c5ce48e3fb7afc5fd9 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 26 Jun 2024 10:16:42 +0200 Subject: [PATCH 2/5] Sort DXCCs ... --- application/libraries/AdifHelper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index ffe997a52..8e9412476 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -202,13 +202,13 @@ class AdifHelper { if ($qso->station_cnty) { switch ($qso->station_dxcc) { - case '291': case '6': case '110': + case '291': $county = trim($qso->state) . "," . trim($qso->station_cnty); break; - case '54': case '15': + case '54': case '61': case '126': case '151': From 346f4b7747a19b71d76f6ffe1cdd99334efc7184 Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 28 Jul 2024 18:51:15 +0200 Subject: [PATCH 3/5] Fix typos --- application/libraries/AdifHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index 8e9412476..980988430 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -198,7 +198,7 @@ class AdifHelper { $line .= $this->getAdifFieldLine("MY_STATE", $qso->state); - // We fill county only if it has a value and it's USA, Alaska, Hawaii or Russia (European or Asiaric). Other countrys are not supported at the moment due complex adif specs + // We fill county only if it has a value and it's USA, Alaska, Hawaii or Russia (European or Asiatic). Other countries are not supported at the moment due to complex ADIF specs if ($qso->station_cnty) { switch ($qso->station_dxcc) { From a75a46215c9512ff90e4ccd0869948232ace0fab Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 28 Jul 2024 19:11:54 +0200 Subject: [PATCH 4/5] Export county in general if set --- application/libraries/AdifHelper.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index 980988430..91e44165d 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -198,8 +198,6 @@ class AdifHelper { $line .= $this->getAdifFieldLine("MY_STATE", $qso->state); - // We fill county only if it has a value and it's USA, Alaska, Hawaii or Russia (European or Asiatic). Other countries are not supported at the moment due to complex ADIF specs - if ($qso->station_cnty) { switch ($qso->station_dxcc) { case '6': @@ -207,15 +205,9 @@ class AdifHelper { case '291': $county = trim($qso->state) . "," . trim($qso->station_cnty); break; - case '15': - case '54': - case '61': - case '126': - case '151': + default: $county = trim($qso->station_cnty); break; - default: - $county = ''; } } else { $county = ''; From 50dd34562b0d4f2cbc4940cc2c90d317593315b3 Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 28 Jul 2024 19:14:55 +0200 Subject: [PATCH 5/5] Add reference --- application/libraries/AdifHelper.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index 91e44165d..247c61a9a 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -198,6 +198,7 @@ class AdifHelper { $line .= $this->getAdifFieldLine("MY_STATE", $qso->state); + // See: https://adif.org/314/ADIF_314.htm#Sponsor_Defined_Code_Format if ($qso->station_cnty) { switch ($qso->station_dxcc) { case '6':