Don't use grid from callbook if probably wrong upon logging

This commit is contained in:
phl0
2025-09-04 16:12:02 +02:00
parent c159b2fd2a
commit 8ba04716e8
2 changed files with 6 additions and 3 deletions

View File

@@ -159,6 +159,7 @@ class Logbook extends CI_Controller {
$return['callsign_name'] = $this->nval($callbook['name'] ?? '', $this->logbook_model->call_name($callsign));
$return['callsign_qra'] = $this->nval($callbook['gridsquare'] ?? '', $this->logbook_model->call_qra($callsign));
$return['callsign_geoloc'] = $callbook['geoloc'] ?? '';
$return['callsign_distance'] = $this->distance($return['callsign_qra'], $station_id);
$return['callsign_qth'] = $this->nval($callbook['city'] ?? '', $this->logbook_model->call_qth($callsign));
$return['callsign_iota'] = $this->nval($callbook['iota'] ?? '', $this->logbook_model->call_iota($callsign));

View File

@@ -1128,14 +1128,16 @@ $("#callsign").on("focusout", function () {
/* Find Locator if the field is empty */
if ($('#locator').val() == "") {
$('#locator').val(result.callsign_qra);
$('#locator_info').html(result.bearing);
if (result.callsign_geoloc != 'grid') {
$('#locator').val(result.callsign_qra);
$('#locator_info').html(result.bearing);
}
if (result.callsign_distance != "" && result.callsign_distance != 0) {
document.getElementById("distance").value = result.callsign_distance;
}
if (result.callsign_qra != "") {
if (result.callsign_qra != "" && result.callsign_geoloc != 'grid') {
if (result.confirmed) {
$('#locator').addClass("confirmedGrid");
$('#locator').attr('title', 'Grid was already worked and confirmed in the past');