From 325ada1b5477798b2ad0ba5ec2cb8e25c0fa141e Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Mon, 15 Dec 2025 19:36:56 +0100 Subject: [PATCH] Fixed continent return result --- application/controllers/Logbookadvanced.php | 7 +++++-- .../views/logbookadvanced/showUpdateResult.php | 11 +++++++++++ assets/js/sections/logbookadvanced.js | 17 +++-------------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 3f72bb67b..a26716e68 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -833,8 +833,11 @@ class Logbookadvanced extends CI_Controller { $this->load->model('logbookadvanced_model'); $result = $this->logbookadvanced_model->check_missing_continent(); - header("Content-Type: application/json"); - print json_encode($result); + $data['result'] = $result; + + $data['type'] = 'continent'; + + $this->load->view('logbookadvanced/showUpdateResult', $data); } public function fixStateProgress() { diff --git a/application/views/logbookadvanced/showUpdateResult.php b/application/views/logbookadvanced/showUpdateResult.php index a52c5c87c..55b247dd0 100644 --- a/application/views/logbookadvanced/showUpdateResult.php +++ b/application/views/logbookadvanced/showUpdateResult.php @@ -7,6 +7,9 @@ switch ($type) { case 'state': showStateUpdateResult($result, $country); break; + case 'continent': + showContinentUpdateResult($result); + break; default: // Invalid type break; @@ -103,3 +106,11 @@ function showStateUpdateResult($result, $country) { } } } + +function showContinentUpdateResult($result) { + if ($result == 0) { + echo ''; + } else { + echo ''; + } +} diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index a54056722..d90ff7dc4 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -2370,23 +2370,12 @@ function saveOptions() { if (dialogItself != '') { dialogItself.close(); } - BootstrapDialog.alert({ - title: lang_gen_advanced_logbook_success, - message: lang_gen_advanced_logbook_continents_updated + ' ' + response + ' ' + lang_gen_advanced_logbook_records_updated, - type: BootstrapDialog.TYPE_SUCCESS - }); + $('.result').html(response); $('#closeButton').prop("disabled", false); }, - error: function () { + error: function(xhr, status, error) { $('#updateContinentButton').prop("disabled", false).removeClass("running"); - if (dialogItself != '') { - dialogItself.close(); - } - BootstrapDialog.alert({ - title: lang_gen_advanced_logbook_error, - message: lang_gen_advanced_logbook_problem_fixing_continents, - type: BootstrapDialog.TYPE_DANGER - }); + $('.result').html(error); $('#closeButton').prop("disabled", false); } });