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 = ""; var lang_qso_simplefle_error_save_to_log_header = ""; var lang_qso_simplefle_error_save_to_log = ""; + var lang_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: '
', 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 + "

" + 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); },