Fixed DXCC checking for ALL QSOs

This commit is contained in:
Andreas Kristiansen
2025-12-11 21:11:53 +01:00
parent 6f9f0fad87
commit b72d9c9348
4 changed files with 35 additions and 15 deletions

View File

@@ -945,6 +945,6 @@ class Logbookadvanced extends CI_Controller {
$result = $this->logbookadvanced_model->check_missing_dxcc_id($all);
header("Content-Type: application/json");
echo json_encode($result);
echo json_encode(__("The number of QSOs re-checked for DXCC was") .' ' . $result);
}
}

View File

@@ -2,7 +2,7 @@
<div class="row">
<div class="col-md-6">
<h5><?= __("Data Repair Tools") ?>
<button type="button" class="btn btn-sm btn-info me-1 ld-ext-right" id="getDbToolsInfoBtn" onclick="getDbToolsInfo()">
<button type="button" class="btn btn-sm btn-info me-1 ld-ext-right" id="getDbToolsInfoBtn" onclick="getDbToolsInfo()">
<?= __("Info") ?><div class="ld ld-ring ld-spin"></div>
</button>
</h5>
@@ -86,7 +86,7 @@
<p class="mb-1 small alert-danger"><?= __("This will overwrite ALL existing DXCC information!") ?></p>
</div>
<div class="d-flex nowrap">
<button type="button" class="btn btn-sm btn-primary ld-ext-right" id="updateDistancesBtn" onclick="fixMissingDxcc('All')">
<button type="button" class="btn btn-sm btn-primary ld-ext-right" id="updateDxccBtn" onclick="fixMissingDxcc('All')">
<?= __("Run") ?><div class="ld ld-ring ld-spin"></div>
</button>
</div>

View File

@@ -70,6 +70,8 @@
let lang_gen_advanced_logbook_problem_updating_distances = '<?= __("There was a problem updating distances."); ?>';
let lang_gen_advanced_logbook_distances_updated = '<?= __("Distances updated successfully!"); ?>';
let lang_gen_advanced_logbook_confirm_fix_missing_dxcc = '<?= __("Are you sure you want to fix all QSOs with missing DXCC information? This action cannot be undone."); ?>';
let homegrid ='<?php echo strtoupper($homegrid[0]); ?>';
<?php
if (!isset($options)) {

View File

@@ -678,7 +678,7 @@ $(document).ready(function () {
callback: function (result) {
}
});
return false;
return false;
}
if(container != null){
@@ -2297,17 +2297,35 @@ function saveOptions() {
}
function fixMissingDxcc() {
$.ajax({
url: base_url + 'index.php/logbookadvanced/fixMissingDxcc',
data: {
all: 'false'
$('#updateDxccBtn').prop("disabled", true).addClass("running");
BootstrapDialog.confirm({
title: lang_general_word_danger,
message: lang_gen_advanced_logbook_confirm_fix_missing_dxcc,
type: BootstrapDialog.TYPE_DANGER,
closable: true,
draggable: true,
btnOKClass: 'btn-danger',
callback: function(result) {
if(result) {
$.ajax({
url: base_url + 'index.php/logbookadvanced/fixMissingDxcc',
type: 'post',
data: {
all: 'false'
},
success: function(data) {
$('#updateDxccBtn').prop("disabled", false).removeClass("running");
$('.result').html(data);
},
error: function(xhr, status, error) {
$('#updateDxccBtn').prop("disabled", false).removeClass("running");
$('.result').html(error);
}
})
} else {
$('#updateDxccBtn').prop("disabled", false).removeClass("running");
}
},
type: 'POST',
success: function(response) {
alert('dxcc');
},
error: function(xhr, status, error) {
alert('error');
}
});
}