From 82fbbb84f98446c6deab1d0d4855893476d8fb6e Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 13 Dec 2025 20:45:37 +0100 Subject: [PATCH] Continent update is fixed --- application/models/Logbookadvanced_model.php | 8 ++- .../views/logbookadvanced/checkresult.php | 11 +++- .../views/logbookadvanced/dbtoolsdialog.php | 2 +- application/views/logbookadvanced/index.php | 2 - assets/js/sections/logbookadvanced.js | 58 ++++++++++--------- 5 files changed, 46 insertions(+), 35 deletions(-) diff --git a/application/models/Logbookadvanced_model.php b/application/models/Logbookadvanced_model.php index 56a22f707..99a63b834 100644 --- a/application/models/Logbookadvanced_model.php +++ b/application/models/Logbookadvanced_model.php @@ -1397,7 +1397,8 @@ class Logbookadvanced_model extends CI_Model { JOIN dxcc_entities ON " . $this->config->item('table_name') . ".col_dxcc = dxcc_entities.adif JOIN station_profile on " . $this->config->item('table_name') . ".station_id = station_profile.station_id SET col_cont = dxcc_entities.cont - WHERE COALESCE(" . $this->config->item('table_name') . ".col_cont, '') = '' and station_profile.user_id = ?"; + WHERE (COALESCE(" . $this->config->item('table_name') . ".col_cont, '') = '' or " . $this->config->item('table_name') . ".col_cont not in ('AF', 'AN', 'AS', 'EU', 'NA', 'OC', 'SA')) + and station_profile.user_id = ?"; $query = $this->db->query($sql, array($this->session->userdata('user_id'))); $result = $this->db->affected_rows(); @@ -1480,7 +1481,10 @@ class Logbookadvanced_model extends CI_Model { $sql = "select count(*) as count from " . $this->config->item('table_name') . " join station_profile on " . $this->config->item('table_name') . ".station_id = station_profile.station_id where user_id = ? - and (coalesce(col_cont, '') = '' or col_cont not in ('AF', 'AN', 'AS', 'EU', 'NA', 'OC', 'SA'))"; + and (coalesce(col_cont, '') = '' or col_cont not in ('AF', 'AN', 'AS', 'EU', 'NA', 'OC', 'SA')) + and col_dxcc is not null + and col_dxcc != '' + and col_dxcc != 0"; $bindings[] = [$this->session->userdata('user_id')]; diff --git a/application/views/logbookadvanced/checkresult.php b/application/views/logbookadvanced/checkresult.php index d3c8087a0..faf15a39b 100644 --- a/application/views/logbookadvanced/checkresult.php +++ b/application/views/logbookadvanced/checkresult.php @@ -28,7 +28,7 @@ function check_missing_distance($result) { ?>

-
+
@@ -39,8 +39,13 @@ function check_qsos_missing_continent($result) { ?>
Continent Check Results
QSOs to update found: count; ?>
-
-

+

- -
diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 627d850d3..66a2ac981 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -1275,33 +1275,6 @@ $(document).ready(function () { }); }); - function runContinentFix(dialogItself) { - $('#updateContinentButton').prop("disabled", true).addClass("running"); - $('#closeButton').prop("disabled", true); - $.ajax({ - url: base_url + 'index.php/logbookadvanced/fixContinent', - type: 'POST', - success: function (response) { - $('#updateContinentButton').prop("disabled", false).removeClass("running"); - 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 - }); - }, - error: function () { - $('#updateContinentButton').prop("disabled", false).removeClass("running"); - dialogItself.close(); - BootstrapDialog.alert({ - title: lang_gen_advanced_logbook_error, - message: lang_gen_advanced_logbook_problem_fixing_continents, - type: BootstrapDialog.TYPE_DANGER - }); - } - }); - } - $('#updateDistances').click(function (event) { $.ajax({ url: base_url + 'index.php/logbookadvanced/distanceDialog', @@ -2396,3 +2369,34 @@ function saveOptions() { } }); } + + function runContinentFix(dialogItself) { + $('#updateContinentButton').prop("disabled", true).addClass("running"); + $('#closeButton').prop("disabled", true); + $.ajax({ + url: base_url + 'index.php/logbookadvanced/fixContinent', + type: 'POST', + success: function (response) { + $('#updateContinentButton').prop("disabled", false).removeClass("running"); + 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 + }); + }, + error: function () { + $('#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 + }); + } + }); + }