[Advanced Logbook] Added link to IOTA

pull/2226/head
Andreas 2023-06-27 08:36:50 +02:00
rodzic 3ef655f4b7
commit f13aa83254
2 zmienionych plików z 23 dodań i 7 usunięć

Wyświetl plik

@ -46,7 +46,7 @@ function updateRow(qso) {
cells.eq(c++).text(qso.dxcc);
cells.eq(c++).text(qso.state);
cells.eq(c++).text(qso.cqzone);
cells.eq(c++).text(qso.iota);
cells.eq(c++).html(qso.iota);
$('[data-toggle="tooltip"]').tooltip();
return row;

Wyświetl plik

@ -191,7 +191,7 @@ class QSO
$this->cqzone = ($data['COL_CQZ'] === null) ? '' : $data['COL_CQZ'];
$this->state = ($data['COL_STATE'] === null) ? '' :$data['COL_STATE'];
$this->dxcc = ($data['name'] === null) ? '- NONE -' : ucwords(strtolower($data['name']), "- (/");
$this->iota = ($data['COL_IOTA'] === null) ? '' :$data['COL_IOTA'];
$this->iota = ($data['COL_IOTA'] === null) ? '' : $this->getIotaLink($data['COL_IOTA']);
if (array_key_exists('end', $data)) {
$this->end = ($data['end'] === null) ? null : DateTime::createFromFormat("Y-m-d", $data['end'], new DateTimeZone('UTC'));
} else {
@ -199,10 +199,18 @@ class QSO
}
$this->callsign = ($data['callsign'] === null) ? '' :$data['callsign'];
$this->lastupload = ($data['lastupload'] === null) ? '' : date($custom_date_format . " H:i", strtotime($data['lastupload']));
$this->lotw_hint = $this->getLotwHint($data['lastupload']);
}
/**
* @return string
*/
function getLotwHint($lastupload): string
{
$lotw_hint = '';
if ($data['lastupload'] !== null) {
if ($lastupload !== null) {
$diff = time();
$diff = (time() - strtotime($data['lastupload'])) / 86400;
$diff = (time() - strtotime($lastupload)) / 86400;
if ($diff > 365) {
$lotw_hint = ' lotw_info_red';
} elseif ($diff > 30) {
@ -211,9 +219,9 @@ class QSO
$lotw_hint = ' lotw_info_yellow';
}
}
$this->lotw_hint = $lotw_hint;
return $lotw_hint;
}
/**
* @return string
*/
@ -940,7 +948,7 @@ class QSO
return trim(implode(" ", $label));
}
private function getQrbLink($mygrid, $grid, $vucc)
private function getQrbLink($mygrid, $grid, $vucc) : string
{
if (!empty($grid)) {
return '<a href="javascript:spawnQrbCalculator(\'' . $mygrid . '\',\'' . $grid . '\')"><i class="fas fa-globe"></i></a>';
@ -949,4 +957,12 @@ class QSO
}
return '';
}
private function getIotaLink($iota) : string
{
if ($iota !== '') {
return '<a href="https://www.iota-world.org/iotamaps/?grpref=' .$iota . '" target="_blank">' . $iota . '</a>';
}
return '';
}
}