diff --git a/application/controllers/Simplefle.php b/application/controllers/Simplefle.php index 1d60686b8..261d662eb 100644 --- a/application/controllers/Simplefle.php +++ b/application/controllers/Simplefle.php @@ -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 { diff --git a/application/views/simplefle/index.php b/application/views/simplefle/index.php index 26a832ae9..552a62b63 100644 --- a/application/views/simplefle/index.php +++ b/application/views/simplefle/index.php @@ -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"); ?>";
diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js index eb1999aca..6c9d1f3c4 100644 --- a/assets/js/sections/simplefle.js +++ b/assets/js/sections/simplefle.js @@ -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: '" + JSON.stringify(result) + "
",
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 + "" + JSON.stringify(result) + "
",
size: BootstrapDialog.SIZE_WIDE,
type: BootstrapDialog.TYPE_DANGER,
+ callback: function (result) {
+ wait_dialog.close();
+ }
});
console.error(result);
},