mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
fixed a bug in simplefle and added cache clearing
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user