From 2555f5ff9037089136a706cfa13288338a301a3c Mon Sep 17 00:00:00 2001 From: cats-shadow Date: Mon, 10 Jun 2024 18:59:03 +0300 Subject: [PATCH 1/4] MY_CNTY and MY_STATE support for ADIF export RDA data --- application/libraries/AdifHelper.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index 3c63280d..c89be923 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -218,8 +218,19 @@ class AdifHelper { $county = trim($qso->station_cnty); } + if ($qso->station_cnty && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15')) { + $county = trim($qso->station_cnty); + } + $line .= $this->getAdifFieldLine("MY_CNTY", $county); + if ($qso->state && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15')) { + $state = trim($qso->state); + $line .= $this->getAdifFieldLine("MY_STATE", $state); + } + + + $line .= $this->getAdifFieldLine("WWFF_REF", $qso->{'COL_WWFF_REF'}); $line .= $this->getAdifFieldLine("MY_WWFF_REF", $qso->station_wwff); @@ -259,7 +270,6 @@ class AdifHelper { MY_NAME MY_POSTAL_CODE MY_RIG - MY_STATE MY_STREET MY_USACA_COUNTIES */ From 6fb6a21898026d5868d36121728366ab34c98125 Mon Sep 17 00:00:00 2001 From: cats-shadow Date: Mon, 10 Jun 2024 19:20:24 +0300 Subject: [PATCH 2/4] Quick fix for rda support. --- application/libraries/AdifHelper.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index c89be923..68386e00 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -212,11 +212,15 @@ class AdifHelper { $line .= $this->getAdifFieldLine("APP_CLOUDLOG_MY_WAB", $qso->station_wab); $line .= $this->getAdifFieldLine("MY_ITU_ZONE", $qso->station_itu); - if($qso->state) { - $county = trim($qso->state) . "," . trim($qso->station_cnty); - } else { - $county = trim($qso->station_cnty); - } + if($qso->state) { + $line .= $this->getAdifFieldLine("MY_STATE", $qso->state); + } + + if($qso->state) { + $county = trim($qso->state) . "," . trim($qso->station_cnty); + } else { + $county = trim($qso->station_cnty); + } if ($qso->station_cnty && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15')) { $county = trim($qso->station_cnty); @@ -224,11 +228,6 @@ class AdifHelper { $line .= $this->getAdifFieldLine("MY_CNTY", $county); - if ($qso->state && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15')) { - $state = trim($qso->state); - $line .= $this->getAdifFieldLine("MY_STATE", $state); - } - $line .= $this->getAdifFieldLine("WWFF_REF", $qso->{'COL_WWFF_REF'}); From 59a71acdd579044bb16f5cc49ee41f541004b05f Mon Sep 17 00:00:00 2001 From: cats-shadow Date: Thu, 13 Jun 2024 17:44:49 +0300 Subject: [PATCH 3/4] Added missing DXCC codes for RDA export --- 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 68386e00..2d035965 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -222,7 +222,7 @@ class AdifHelper { $county = trim($qso->station_cnty); } - if ($qso->station_cnty && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15')) { + if ($qso->station_cnty && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15' || $qso->station_dxcc == '61' || $qso->station_dxcc == '126' || $qso->station_dxcc == '151' )) { $county = trim($qso->station_cnty); } From a39cd9b9c61a2b8d98e3acde3ecde3a0c50d32ea Mon Sep 17 00:00:00 2001 From: cats-shadow Date: Fri, 14 Jun 2024 12:08:26 +0300 Subject: [PATCH 4/4] Replaced if by switch --- application/libraries/AdifHelper.php | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/application/libraries/AdifHelper.php b/application/libraries/AdifHelper.php index 2d035965..54f38142 100644 --- a/application/libraries/AdifHelper.php +++ b/application/libraries/AdifHelper.php @@ -216,15 +216,27 @@ class AdifHelper { $line .= $this->getAdifFieldLine("MY_STATE", $qso->state); } - if($qso->state) { - $county = trim($qso->state) . "," . trim($qso->station_cnty); + 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 = trim($qso->station_cnty); + } } else { - $county = trim($qso->station_cnty); + $county = ''; } - if ($qso->station_cnty && ( $qso->station_dxcc == '54' || $qso->station_dxcc == '15' || $qso->station_dxcc == '61' || $qso->station_dxcc == '126' || $qso->station_dxcc == '151' )) { - $county = trim($qso->station_cnty); - } $line .= $this->getAdifFieldLine("MY_CNTY", $county);