Merge remote-tracking branch 'upstream/dev' into pr/HB9HIL/1165

This commit is contained in:
HB9HIL
2024-11-18 18:58:41 +01:00
44 changed files with 6443 additions and 5884 deletions

View File

@@ -256,12 +256,6 @@ class adif extends CI_Controller {
$custom_errors=__("Station Profile not valid for User");
}
// Lets clean up static maps cache for this station
if (!$this->load->is_loaded('staticmap_model')) {
$this->load->model('staticmap_model');
}
$this->staticmap_model->remove_static_map_image($this->input->post('station_profile', TRUE));
log_message("Error","ADIF End");
$data['adif_errors'] = $custom_errors;
$data['skip_dupes'] = $this->input->post('skipDuplicate');

View File

@@ -87,11 +87,11 @@ class SimpleFLE extends CI_Controller {
$one_result = $this->logbook_model->import($qso, $qso['station_id']);
// if the returner is not empty we have an error and should log it
if ($result != '' && strpos(json_encode($one_result), 'Duplicate for') == false) {
log_message('error', 'SimpleFLE, save_qsos(); For QSO: ' . $qso['call'] . ' on ' . $qso['qso_date'] . ' Error: ' . json_encode($result));
if (json_encode($result) != '[]' && strpos(json_encode($one_result), __("Duplicate for")) == false) {
log_message('error', 'SimpleFLE, save_qsos(); For QSO: ' . $qso['call'] . ' on ' . $qso['qso_date'] . ' Error: ' . json_encode($one_result));
}
if (strpos(json_encode($one_result), 'Duplicate for') !== false) {
log_message('debug', 'SimpleFLE, save_qsos(); For QSO: ' . $qso['call'] . ' on ' . $qso['qso_date'] . ' Warning: ' . json_encode($result));
if (strpos(json_encode($one_result), __("Duplicate for")) !== false) {
log_message('debug', 'SimpleFLE, save_qsos(); For QSO: ' . $qso['call'] . ' on ' . $qso['qso_date'] . ' Warning: ' . json_encode($one_result));
}
if ($one_result != '') {
@@ -99,6 +99,12 @@ class SimpleFLE extends CI_Controller {
}
}
// Also clean up static map images
if (!$this->load->is_loaded('staticmap_model')) {
$this->load->model('staticmap_model');
}
$this->staticmap_model->remove_static_map_image($qso['station_id']);
if (empty($result)) {
echo "success";
} else {

View File

@@ -60,7 +60,7 @@ class Station extends CI_Controller
if ($this->stations->edit()) {
$data['notice'] = __("Station Location") . $this->security->xss_clean($this->input->post('station_profile_name', true)) . " Updated";
}
// Also clean up static map images first
// Also clean up static map images
if (!$this->load->is_loaded('staticmap_model')) {
$this->load->model('staticmap_model');
}

View File

@@ -50,6 +50,21 @@ class User_Options extends CI_Controller {
public function dismissVersionDialog() {
$this->user_options_model->set_option('version_dialog', 'confirmed', array('boolean' => 'true'));
}
public function get_qrg_units() {
$qrg_units = [];
foreach($this->session->get_userdata() as $key => $value) {
if (strpos($key, 'qrgunit_') === 0) {
$band = str_replace('qrgunit_', '', $key);
$qrg_units[$band] = $value;
}
}
header('Content-Type: application/json');
echo json_encode($qrg_units);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -3705,6 +3705,13 @@ class Logbook_model extends CI_Model {
}
}
}
// if there are any static map images for this station, remove them so they can be regenerated
if (!$this->load->is_loaded('staticmap_model')) {
$this->load->model('staticmap_model');
}
$this->staticmap_model->remove_static_map_image($station_id);
$records = '';
gc_collect_cycles();
if (count($a_qsos) > 0) {
@@ -3982,7 +3989,7 @@ class Logbook_model extends CI_Model {
if (isset($record['tx_pwr'])) {
$tx_pwr = filter_var($record['tx_pwr'], FILTER_VALIDATE_FLOAT);
} else {
$tx_pwr = NULL;
$tx_pwr = $station_profile->station_power ?? NULL;
}
// Sanitise RX Power
@@ -4419,12 +4426,6 @@ class Logbook_model extends CI_Model {
} else {
$this->add_qso($data, $skipexport);
}
// if there are any static map images for this station, remove them so they can be regenerated
if (!$this->load->is_loaded('staticmap_model')) {
$this->load->model('staticmap_model');
}
$this->staticmap_model->remove_static_map_image($station_id);
} else {
$my_error .= "Date/Time: " . ($time_on ?? 'N/A') . " Callsign: " . ($record['call'] ?? 'N/A') . " Band: " . ($band ?? 'N/A') . " ".__("Duplicate for")." ". ($station_profile_call ?? 'N/A') . "<br>";

View File

@@ -579,10 +579,7 @@ class Logbookadvanced_model extends CI_Model {
if ($mode->col_submode == null || $mode->col_submode == "") {
array_push($modes, $mode->col_mode);
} else {
// Make sure we don't add LSB or USB as submodes in the array list
if ($mode->col_mode != "SSB") {
array_push($modes, $mode->col_submode);
}
array_push($modes, $mode->col_submode);
}
}
@@ -628,6 +625,8 @@ class Logbookadvanced_model extends CI_Model {
case "continent": $column = 'COL_CONT'; break;
case "qrzsent": $column = 'COL_QRZCOM_QSO_UPLOAD_STATUS'; break;
case "qrzreceived": $column = 'COL_QRZCOM_QSO_DOWNLOAD_STATUS'; break;
case "eqslsent": $column = 'COL_EQSL_QSL_SENT'; break;
case "eqslreceived": $column = 'COL_EQSL_QSL_RCVD'; break;
case "stationpower": $column = 'COL_TX_PWR'; break;
default: return;
}
@@ -772,6 +771,23 @@ class Logbookadvanced_model extends CI_Model {
$query = $this->db->query($sql, array($value, json_decode($ids, true), $this->session->userdata('user_id')));
} else if ($column == 'COL_EQSL_QSL_SENT') {
$skipqrzupdate = true;
$sql = "UPDATE ".$this->config->item('table_name')." JOIN station_profile ON ". $this->config->item('table_name').".station_id = station_profile.station_id" .
" SET " . $this->config->item('table_name').".COL_EQSL_QSL_SENT = ?, " . $this->config->item('table_name').".COL_EQSL_QSLSDATE = now()" .
" WHERE " . $this->config->item('table_name').".col_primary_key in ? and station_profile.user_id = ?";
$query = $this->db->query($sql, array($value, json_decode($ids, true), $this->session->userdata('user_id')));
} else if ($column == 'COL_EQSL_QSL_RCVD') {
$skipqrzupdate = true;
$sql = "UPDATE ".$this->config->item('table_name')." JOIN station_profile ON ". $this->config->item('table_name').".station_id = station_profile.station_id" .
" SET " . $this->config->item('table_name').".COL_EQSL_QSL_RCVD = ?, " . $this->config->item('table_name').".COL_EQSL_QSLRDATE = now()" .
" WHERE " . $this->config->item('table_name').".col_primary_key in ? and station_profile.user_id = ?";
$query = $this->db->query($sql, array($value, json_decode($ids, true), $this->session->userdata('user_id')));
} else if ($column == 'COL_QSLMSG') {
$sql = "UPDATE ".$this->config->item('table_name')." JOIN station_profile ON ". $this->config->item('table_name').".station_id = station_profile.station_id" .

View File

@@ -94,7 +94,7 @@ $wwff = 0;
<td style="text-align: center; vertical-align: middle;" ><?php echo $band->data;?></td>
<td style="text-align: center; vertical-align: middle;" ><?php echo $band->cw;?></td>
<td style="text-align: center; vertical-align: middle;" class='band_<?php echo $band->bandid ?>'>
<select class="form-select unitselect" name="unit_<?php echo $band->id; ?>">
<select style="min-width: 80px;" class="form-select unitselect" name="unit_<?php echo $band->id; ?>">
<option value="Hz" <?php if ($this->frequency->qrg_unit($band->band) == 'Hz') { echo 'selected';} ?>><?= __("Hz"); ?></option>
<option value="kHz" <?php if ($this->frequency->qrg_unit($band->band) == 'kHz') { echo 'selected';} ?>><?= __("kHz"); ?></option>
<option value="MHz" <?php if ($this->frequency->qrg_unit($band->band) == 'MHz') { echo 'selected';} ?>><?= __("MHz"); ?></option>

View File

@@ -141,7 +141,11 @@
<div class="mb-3 col-md-2">
<label for="frequency"><?= __("Frequency"); ?></label>
<input type="text" class="form-control form-control-sm" id="frequency" name="freq_display" value="<?php echo $this->session->userdata('freq'); ?>" />
<div class="input-group input-group-sm">
<input type="text" class="form-control form-control-sm" id="freq_calculated" name="freq_calculated" value="0" />
<small class="input-group-text btn-included-on-field" id="qrg_unit">...</small>
</div>
<input style="display: none;" type="text" class="form-control form-control-sm" id="frequency" name="freq_display" value="<?php echo $this->session->userdata('freq'); ?>" />
</div>
<div class="mb-3 col-md-2">

View File

@@ -1158,6 +1158,7 @@ $($('#callsign')).on('keypress',function(e) {
<?php } ?>
<?php if ( $this->uri->segment(1) == "qso" || ($this->uri->segment(1) == "contesting" && $this->uri->segment(2) != "add")) { ?>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/qrg_handler.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/moment.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/datetime-moment.js"></script>
@@ -1209,6 +1210,7 @@ $($('#callsign')).on('keypress',function(e) {
$(".radio_login_error" ).remove();
}
cat2UI($('#frequency'),data.frequency,false,true,function(d){
$('#frequency').trigger('change');
if ($("#band").val() != frequencyToBand(d)) {
$("#band").val(frequencyToBand(d)).trigger('change'); // Let's only change if we really have a different band!
}

View File

@@ -27,6 +27,8 @@
<option value="continent"><?= __("Continent"); ?></option>
<option value="qrzsent"><?= __("QRZ Sent"); ?></option>
<option value="qrzreceived"><?= __("QRZ Received"); ?></option>
<option value="eqslsent"><?= __("eQSL Sent"); ?></option>
<option value="eqslreceived"><?= __("eQSL Received"); ?></option>
<option value="stationpower"><?= __("Station power"); ?></option>
</select>
<div>&nbsp;</div>
@@ -149,6 +151,12 @@
<option value="I"><?= __("Invalid"); ?></option>
</select>
<select style="display:none" class="form-select w-auto form-select-sm w-auto" id="editEqsl" name="eqsl">
<option value="Y"><?= __("Yes"); ?></option>
<option value="N"><?= __("No"); ?></option>
<option value="I"><?= __("Invalid"); ?></option>
</select>
<select style="display:none" id="editContinent" name="continent" class="form-select w-auto form-select-sm w-auto">
<option value=""><?= __("None/Empty"); ?></option>
<option value="AF"><?= __("Africa"); ?></option>

View File

@@ -170,7 +170,11 @@
</div>
<div class="mb-3 col">
<label for="frequency"><?= __("Frequency"); ?></label>
<input type="text" tabindex="3" class="form-control form-control-sm" id="frequency" name="freq_display" value="<?php echo $this->session->userdata('freq'); ?>" />
<div class="input-group input-group-sm">
<input type="text" tabindex="3" class="form-control form-control-sm" id="freq_calculated" name="freq_calculated" value="0" />
<small class="input-group-text btn-included-on-field" id="qrg_unit">...</small>
</div>
<input style="display: none;" type="text" class="form-control form-control-sm" id="frequency" name="freq_display" value="<?php echo $this->session->userdata('freq'); ?>" />
</div>
</div>

View File

@@ -37,6 +37,7 @@
var lang_qso_simplefle_success_save_to_log = "<?= __("The QSO were successfully logged in the logbook! Dupes were skipped."); ?>";
var lang_qso_simplefle_error_save_to_log_header = "<?= __("Error"); ?>";
var lang_qso_simplefle_error_save_to_log = "<?= __("An error occurred while saving the QSO to the logbook! Error: "); ?>";
var lang_duplicate_for = "<?= __("Duplicate for"); ?>";
</script>
<h2><?php echo $page_title; ?></h2>
<button type="button" class="btn btn-sm btn-primary me-1" id="simpleFleInfoButton"><?= __("What is that?"); ?></button>

View File

@@ -7,6 +7,10 @@ $(document).ready(async function () {
await restoreContestSession(sessiondata); // wait for restoring until finished
setRst($("#mode").val());
$('#contestname').val($('#contestname_select').val());
// Clear the localStorage for the qrg units
localStorage.clear();
set_qrg();
});
// Always update the contestname
@@ -471,8 +475,9 @@ function highlight(term, base) {
// Only set the frequency when not set by userdata/PHP.
if ($('#frequency').val() == "") {
$.get('qso/band_to_freq/' + $('#band').val() + '/' + $('.mode').val(), function (result) {
$('#frequency').val(result);
$('#frequency').val(result).trigger("change");
$('#frequency_rx').val("");
set_qrg();
});
}
@@ -480,7 +485,7 @@ if ($('#frequency').val() == "") {
$('#mode').change(function () {
if ($('#radio').val() == '0') {
$.get('qso/band_to_freq/' + $('#band').val() + '/' + $('.mode').val(), function (result) {
$('#frequency').val(result);
$('#frequency').val(result).trigger("change");
$('#frequency_rx').val("");
});
}
@@ -491,12 +496,13 @@ $('#mode').change(function () {
/* Calculate Frequency */
/* on band change */
$('#band').change(function () {
if ($('#radio').val() == '0') {
$.get('qso/band_to_freq/' + $(this).val() + '/' + $('.mode').val(), function (result) {
$('#frequency').val(result);
$('#frequency_rx').val("");
});
if ($('#radio').val() == '0') {
$.get('qso/band_to_freq/' + $(this).val() + '/' + $('.mode').val(), function (result) {
$('#frequency').val(result).trigger("change");
$('#frequency_rx').val("");
});
}
set_qrg();
checkIfWorkedBefore();
});
@@ -507,7 +513,7 @@ $('#band').change(function () {
$('#radio').change(function () {
if ($('#radio').val() == '0') {
$.get('qso/band_to_freq/' + $('#band').val() + '/' + $('.mode').val(), function (result) {
$('#frequency').val(result);
$('#frequency').val(result).trigger("change");
$('#frequency_rx').val("");
});
}
@@ -767,7 +773,7 @@ async function restoreContestSession(data) {
$("#frequency").val(settings.freq_display);
} else {
$.get('qso/band_to_freq/' + settings.band + '/' + settings.mode, function (result) {
$('#frequency').val(result);
$('#frequency').val(result).trigger("change");
});
}
}

View File

@@ -187,6 +187,9 @@ function saveBatchEditQsos(id_list) {
if (column == 'qrzsent' || column == 'qrzreceived') {
value = $("#editQrz").val();
}
if (column == 'eqslsent' || column == 'eqslreceived') {
value = $("#editEqsl").val();
}
if (column == 'continent') {
value = $("#editContinent").val();
}
@@ -239,6 +242,7 @@ function changeEditType(type) {
$('#editContinent').hide();
$('#editQrz').hide();
$('#saveButton').prop("disabled", false);
$('#editEqsl').hide();
if (type == "dxcc") {
$('#editDxcc').show();
} else if (type == "iota") {
@@ -273,6 +277,8 @@ function changeEditType(type) {
$('#editLoTW').show();
} else if (type == "qrzsent" || type == "qrzreceived") {
$('#editQrz').show();
} else if (type == "eqslsent" || type == "eqslreceived") {
$('#editEqsl').show();
} else if (type == "continent") {
$('#editContinent').show();
} else if (type == "gridsquare" || type == "sota" || type == "wwff" || type == "operator" || type == "pota" || type == "comment" || type == "qslvia" || type == "contest" || type == "qslmsg" || type == "stationpower") {

View File

@@ -0,0 +1,129 @@
$('#qrg_unit').on('click', function () {
if ($(this).html() == 'Hz') {
$(this).html('kHz');
$("#freq_calculated").val($("#frequency").val() / 1000);
localStorage.setItem('qrgunit_' + $('#band').val(), 'kHz');
} else if ($(this).html() == 'kHz') {
$(this).html('MHz');
$("#freq_calculated").val($("#frequency").val() / 1000000);
localStorage.setItem('qrgunit_' + $('#band').val(), 'MHz');
} else if ($(this).html() == 'MHz') {
$(this).html('GHz');
$("#freq_calculated").val($("#frequency").val() / 1000000000);
localStorage.setItem('qrgunit_' + $('#band').val(), 'GHz');
} else if ($(this).html() == 'GHz') {
$(this).html('Hz');
$("#freq_calculated").val($("#frequency").val());
localStorage.setItem('qrgunit_' + $('#band').val(), 'Hz');
}
});
async function set_qrg() {
let frequency = $('#frequency').val();
let band = $('#band').val();
// check if there are qrgunits in the localStorage
if (!localStorage.getItem('qrgunit_' + band)) {
// console.log('fetching qrg units');
await $.getJSON(base_url + 'index.php/user_options/get_qrg_units', async function (result) {
$.each(result, function(key, value) {
localStorage.setItem('qrgunit_' + key, value);
});
});
}
let qrgunit = localStorage.getItem('qrgunit_' + band);
if (qrgunit != null) {
$('#qrg_unit').html(localStorage.getItem('qrgunit_' + band));
} else {
$('#qrg_unit').html('...');
}
if (qrgunit == 'Hz') {
$("#freq_calculated").val(frequency);
} else if (qrgunit == 'kHz') {
$("#freq_calculated").val(frequency / 1000);
} else if (qrgunit == 'MHz') {
$("#freq_calculated").val(frequency / 1000000);
} else if (qrgunit == 'GHz') {
$("#freq_calculated").val(frequency / 1000000000);
}
}
async function set_new_qrg() {
let new_qrg = $('#freq_calculated').val().trim();
let parsed_qrg = parseFloat(new_qrg);
let unit = $('#qrg_unit').html();
// check if the input contains a unit and parse the qrg
if (/^\d+(\.\d+)?\s*hz$/i.test(new_qrg)) {
unit = 'Hz';
parsed_qrg = parseFloat(new_qrg);
} else if (/^\d+(\.\d+)?\s*khz$/i.test(new_qrg)) {
unit = 'kHz';
parsed_qrg = parseFloat(new_qrg);
} else if (/^\d+(\.\d+)?\s*mhz$/i.test(new_qrg)) {
unit = 'MHz';
parsed_qrg = parseFloat(new_qrg);
} else if (/^\d+(\.\d+)?\s*ghz$/i.test(new_qrg)) {
unit = 'GHz';
parsed_qrg = parseFloat(new_qrg);
}
// update the unit if there was any change
$('#qrg_unit').html(unit);
// calculate the other stuff
let qrg_hz;
switch (unit) {
case 'Hz':
qrg_hz = parsed_qrg;
localStorage.setItem('qrgunit_' + $('#band').val(), 'Hz');
break;
case 'kHz':
qrg_hz = parsed_qrg * 1000;
localStorage.setItem('qrgunit_' + $('#band').val(), 'kHz');
break;
case 'MHz':
qrg_hz = parsed_qrg * 1000000;
localStorage.setItem('qrgunit_' + $('#band').val(), 'MHz');
break;
case 'GHz':
qrg_hz = parsed_qrg * 1000000000;
localStorage.setItem('qrgunit_' + $('#band').val(), 'GHz');
break;
default:
qrg_hz = 0;
console.error('Invalid unit');
}
$('#frequency').val(qrg_hz);
$('#freq_calculated').val(parsed_qrg);
$('#band').val(frequencyToBand(qrg_hz));
}
$('#frequency').on('change', function () {
// console.log('frequency changed');
set_qrg();
});
$('#freq_calculated').on('input', function () {
$(this).val($(this).val().replace(',', '.'));
});
$('#freq_calculated').on('change', function () {
// console.log('freq_calculated changed');
set_new_qrg();
});
$('#freq_calculated').on('keydown', function (e) {
if (e.which === 13) {
e.preventDefault();
set_new_qrg().then(() => {
$("#qso_input").trigger('submit');
});
}
});

View File

@@ -190,7 +190,7 @@ $(document).on("click", "#fav_recall", function (event) {
$('#band_rx').val(favs[this.innerText].band_rx);
$('#band').val(favs[this.innerText].band);
$('#frequency_rx').val(favs[this.innerText].frequency_rx);
$('#frequency').val(favs[this.innerText].frequency);
$('#frequency').val(favs[this.innerText].frequency).trigger("change");
$('#selectPropagation').val(favs[this.innerText].prop_mode);
$('#mode').val(favs[this.innerText].mode).on("change");
});
@@ -273,7 +273,7 @@ bc.onmessage = function (ev) {
}
setTimeout(() => {
if (ev.data.frequency != null) {
$('#frequency').val(ev.data.frequency);
$('#frequency').val(ev.data.frequency).trigger("change");
$("#band").val(frequencyToBand(ev.data.frequency));
}
if (ev.data.frequency_rx != "") {
@@ -365,7 +365,7 @@ $(document).on('change', 'input', function () {
}
$("#band").val(frequencyToBand(val2[0].Uplink_Freq));
$("#band_rx").val(frequencyToBand(val2[0].Downlink_Freq));
$("#frequency").val(val2[0].Uplink_Freq);
$("#frequency").val(val2[0].Uplink_Freq).trigger("change");
$("#frequency_rx").val(val2[0].Downlink_Freq);
$("#selectPropagation").val('SAT');
}
@@ -569,6 +569,8 @@ function reset_fields() {
$("#callsign").on("focusout", function () {
if ($(this).val().length >= 3 && preventLookup == false) {
$("#noticer").fadeOut(1000);
// Temp store the callsign
var temp_callsign = $(this).val();
@@ -592,7 +594,7 @@ $("#callsign").on("focusout", function () {
lookupCall = $.getJSON(base_url + 'index.php/logbook/json/' + find_callsign + '/' + json_band + '/' + json_mode + '/' + $('#stationProfile').val() + '/' + $('#start_date').val(), async function (result) {
// Make sure the typed callsign and json result match
if ($('#callsign').val = result.callsign) {
if ($('#callsign').val().toUpperCase().replace('Ø', '0') == result.callsign) {
// Reset QSO fields
resetDefaultQSOFields();
@@ -814,7 +816,12 @@ $("#callsign").on("focusout", function () {
// Get DXX Summary
getDxccResult(result.dxcc.adif, convert_case(result.dxcc.entity));
}
}
// else {
// console.log("Callsigns do not match, skipping lookup");
// console.log("Typed Callsign: " + $('#callsign').val());
// console.log("Returned Callsign: " + result.callsign);
// }
});
} else {
// Reset QSO fields
@@ -858,7 +865,7 @@ $('#start_date').on('change', function () {
$('.mode').on('change', function () {
if ($('#radio').val() == 0) {
$.get(base_url + 'index.php/qso/band_to_freq/' + $('#band').val() + '/' + $('.mode').val(), function (result) {
$('#frequency').val(result);
$('#frequency').val(result).trigger("change");
});
}
$('#frequency_rx').val("");
@@ -869,7 +876,7 @@ $('.mode').on('change', function () {
$('#band').on('change', function () {
if ($('#radio').val() == 0) {
$.get(base_url + 'index.php/qso/band_to_freq/' + $(this).val() + '/' + $('.mode').val(), function (result) {
$('#frequency').val(result);
$('#frequency').val(result).trigger("change");
});
}
$('#frequency_rx').val("");
@@ -877,6 +884,7 @@ $('#band').on('change', function () {
$("#selectPropagation").val("");
$("#sat_name").val("");
$("#sat_mode").val("");
set_qrg();
});
/* On Key up Calculate Bearing and Distance */
@@ -1209,6 +1217,10 @@ $(document).ready(function () {
set_timers();
updateStateDropdown('#dxcc_id', '#stateInputLabel', '#location_us_county', '#stationCntyInputQso');
// Clear the localStorage for the qrg units
localStorage.clear();
set_qrg();
$("#locator").popover({ placement: 'top', title: 'Gridsquare Formatting', content: "Enter multiple (4-digit) grids separated with commas. For example: IO77,IO78" })
.focus(function () {
$('#locator').popover('show');
@@ -1426,8 +1438,9 @@ $(document).ready(function () {
// Only set the frequency when not set by userdata/PHP.
if ($('#frequency').val() == "") {
$.get(base_url + 'index.php/qso/band_to_freq/' + $('#band').val() + '/' + $('.mode').val(), function (result) {
$('#frequency').val(result);
$('#frequency').val(result).trigger("change");
$('#frequency_rx').val("");
set_qrg();
});
}

View File

@@ -912,7 +912,7 @@ $(".js-save-to-log").click(function () {
btnOKClass: "btn-info",
callback: function (result) {
if (result) {
var wait_dialog = BootstrapDialog.show({
const wait_dialog = BootstrapDialog.show({
title: lang_general_word_please_wait,
message: '<div class="text-center"><i class="fas fa-spinner fa-spin fa-3x"></i></div>',
closable: false,
@@ -977,8 +977,7 @@ $(".js-save-to-log").click(function () {
type: "post",
data: { qsos: JSON.stringify(qsos) },
success: function (result) {
wait_dialog.close();
if (result == 'success' || result.includes("Duplicate for")) {
if (result == 'success' || result.includes(lang_duplicate_for)) {
BootstrapDialog.alert({
title: lang_qso_simplefle_success_save_to_log_header,
message: lang_qso_simplefle_success_save_to_log,
@@ -986,27 +985,32 @@ $(".js-save-to-log").click(function () {
btnOKLabel: lang_general_word_ok,
btnOKClass: "btn-info",
callback: function (result) {
wait_dialog.close();
clearSession();
}
});
} else {
wait_dialog.close();
BootstrapDialog.alert({
title: lang_general_word_error,
message: lang_qso_simplefle_error_save_to_log + "<br><br><code><pre>" + JSON.stringify(result) + "</pre></code>",
size: BootstrapDialog.SIZE_WIDE,
type: BootstrapDialog.TYPE_DANGER,
callback: function (result) {
wait_dialog.close();
}
});
console.error(result);
}
},
error: function (result) {
wait_dialog.close();
BootstrapDialog.alert({
title: lang_general_word_error,
message: lang_qso_simplefle_error_save_to_log + "<br><br><code><pre>" + JSON.stringify(result) + "</pre></code>",
size: BootstrapDialog.SIZE_WIDE,
type: BootstrapDialog.TYPE_DANGER,
callback: function (result) {
wait_dialog.close();
}
});
console.error(result);
},

File diff suppressed because it is too large Load Diff