mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
[Advanced Logbook] Added continent link
This commit is contained in:
@@ -2,8 +2,6 @@ var callBookProcessingDialog = null;
|
||||
var inCallbookProcessing = false;
|
||||
var inCallbookItemProcessing = false;
|
||||
|
||||
// Array of valid continent codes
|
||||
const validContinents = ['AF', 'EU', 'AS', 'SA', 'NA', 'OC', 'AN'];
|
||||
|
||||
$('#band').change(function () {
|
||||
var band = $("#band option:selected").text();
|
||||
@@ -321,15 +319,7 @@ function loadQSOTable(rows) {
|
||||
data.push(qso.deRefs);
|
||||
}
|
||||
if (user_options.continent.show == "true"){
|
||||
if (qso.continent === '') {
|
||||
data.push(qso.continent);
|
||||
} else if (!validContinents.includes(qso.continent.toUpperCase())) {
|
||||
// Check if qso.continent is not in the list of valid continents
|
||||
data.push('<span class="bg-danger">Invalid continent</span> ' + qso.continent);
|
||||
} else {
|
||||
// Continent is valid
|
||||
data.push(qso.continent);
|
||||
}
|
||||
data.push(qso.continent);
|
||||
}
|
||||
if (user_options.distance.show == "true"){
|
||||
data.push(qso.distance);
|
||||
|
||||
@@ -288,6 +288,21 @@ class QSO
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
function getContinentLink(): string
|
||||
{
|
||||
if ($this->continent == '') return '';
|
||||
|
||||
$validContinents = ['AF', 'EU', 'AS', 'SA', 'NA', 'OC', 'AN'];
|
||||
|
||||
if (in_array($this->continent, $validContinents, true)) {
|
||||
return '<a href="javascript:spawnLookupModal(\''.strtolower($this->continent).'\',\'continent\');">'.$this->continent.'</a>';
|
||||
}
|
||||
return '<span class="bg-danger">Invalid continent</span> ' . $this->continent;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@@ -1223,7 +1238,7 @@ class QSO
|
||||
'dok' => $this->getFormattedDok(),
|
||||
'wwff' => $this->getFormattedWwff(),
|
||||
'sig' => $this->getFormattedSig(),
|
||||
'continent' => $this->continent,
|
||||
'continent' => $this->getContinentLink(),
|
||||
'profilename' => $this->profilename,
|
||||
'stationpower' => empty($this->stationpower) ? null : $this->stationpower.' W',
|
||||
'distance' => $this->getFormattedDistance(),
|
||||
|
||||
Reference in New Issue
Block a user