[Advanced Logbook] Added county column

This commit is contained in:
Andreas Kristiansen
2025-06-07 07:08:42 +02:00
parent c31bbabb33
commit 1ab72ad95d
3 changed files with 19 additions and 2 deletions

View File

@@ -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);
} ?>
<?php if (($options->state->show ?? "true") == "true") {
echo '<th>' . __("State") . '</th>';
} ?>
<?php if (($options->county->show ?? "true") == "true") {
echo '<th>' . __("County") . '</th>';
} ?>
<?php if (($options->cqzone->show ?? "true") == "true") {
echo '<th>' . __("CQ Zone") . '</th>';

View File

@@ -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);
}

View File

@@ -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 = '<a href="javascript:spawnLookupModal('.$data['COL_DXCC'].',\'dxcc\');">'.$data['dxccname'].'</a>';
} 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
];
}