diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php index 35f5d0814..5c93760d1 100644 --- a/application/views/logbookadvanced/index.php +++ b/application/views/logbookadvanced/index.php @@ -63,7 +63,8 @@ \"distance\":{\"show\":\"true\"}, \"region\":{\"show\":\"true\"}, \"antennaazimuth\":{\"show\":\"true\"}, - \"antennaelevation\":{\"show\":\"true\"} + \"antennaelevation\":{\"show\":\"true\"}, + \"county\":{\"show\":\"true\"}, }"; } $current_opts = json_decode($options); @@ -156,6 +157,10 @@ echo "\nvar o_template = { antennaelevation: {show: 'true'}};"; echo "\nuser_options={...user_options, ...o_template};"; } + if (!isset($current_opts->county)) { + echo "\nvar o_template = { county: {show: 'true'}};"; + echo "\nuser_options={...user_options, ...o_template};"; + } foreach ($mapoptions as $mo) { @@ -713,6 +718,9 @@ $options = json_decode($options); } ?> state->show ?? "true") == "true") { echo '' . __("State") . ''; + } ?> + county->show ?? "true") == "true") { + echo '' . __("County") . ''; } ?> cqzone->show ?? "true") == "true") { echo '' . __("CQ Zone") . ''; diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 1808af4d1..dd60eb026 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -86,6 +86,9 @@ function updateRow(qso) { if ((user_options.state.show ?? 'true') == "true"){ cells.eq(c++).html(qso.state); } + if ((user_options.county.show ?? 'true') == "true"){ + cells.eq(c++).html(qso.county); + } if ((user_options.cqzone.show ?? 'true') == "true"){ cells.eq(c++).html(qso.cqzone); } @@ -280,6 +283,9 @@ function loadQSOTable(rows) { if ((user_options.state.show ?? 'true') == "true"){ data.push(qso.state); } + if ((user_options.county.show ?? 'true') == "true"){ + data.push(qso.county); + } if ((user_options.cqzone.show ?? 'true') == "true"){ data.push(qso.cqzone); } diff --git a/src/QSLManager/QSO.php b/src/QSLManager/QSO.php index 4ff7644ed..6556d1325 100644 --- a/src/QSLManager/QSO.php +++ b/src/QSLManager/QSO.php @@ -45,6 +45,7 @@ class QSO private string $iota; private string $continent; private string $region; + private string $county; /** @var string[] */ private string $deVUCCGridsquares; private string $dxGridsquare; @@ -249,6 +250,7 @@ class QSO $this->cqzone = $data['COL_CQZ'] === null ? '' : $this->getCqLink($data['COL_CQZ']); $this->ituzone = $data['COL_ITUZ'] === null ? '' : $this->getItuLink($data['COL_ITUZ']); $this->state = ($data['COL_STATE'] === null) ? '' :$data['COL_STATE']; + $this->county = ($data['COL_CNTY'] === null) ? '' :$data['COL_CNTY']; if ($data['adif'] == '0') { $this->dxcc = ''.$data['dxccname'].''; } else { @@ -1244,7 +1246,8 @@ class QSO 'distance' => $this->getFormattedDistance(), 'region' => $this->region, 'antennaelevation' => $this->antennaelevation == null ? null : $this->antennaelevation.'°', - 'antennaazimuth' => $this->antennaazimuth == null ? null : $this->antennaazimuth.'°' + 'antennaazimuth' => $this->antennaazimuth == null ? null : $this->antennaazimuth.'°', + 'county' => $this->county ]; }