[DBTools] Fix for hanging loop

This commit is contained in:
Andreas Kristiansen
2025-12-31 16:29:43 +01:00
parent aeeefe0a5f
commit ce2c028326
2 changed files with 6 additions and 68 deletions

View File

@@ -755,40 +755,10 @@ class Logbookadvanced extends CI_Controller {
$ids = xss_clean($this->input->post('ids'));
$this->load->model('logbookadvanced_model');
$this->logbookadvanced_model->fixCqZones($ids);
$data = $this->logbookadvanced_model->getQsosForAdif($ids, $this->session->userdata('user_id'));
$results = $data->result('array');
$qsos = [];
foreach ($results as $data) {
$qsos[] = new QSO($data);
}
$q = [];
// Get Date format
if($this->session->userdata('user_date_format')) {
// If Logged in and session exists
$custom_date_format = $this->session->userdata('user_date_format');
} else {
// Get Default date format from /config/wavelog.php
$custom_date_format = $this->config->item('qso_date_format');
}
foreach ($qsos as $qso) {
$singleQso = $qso->toArray();
$flag = $this->dxccflag->get($qso->getDXCCId());
if ($flag != null) {
$singleQso['flag'] = ' '.$flag;
} else {
$singleQso['flag'] = '';
}
$q[]=$singleQso;
}
$result = $this->logbookadvanced_model->fixCqZones($ids);
header("Content-Type: application/json");
print json_encode($q);
print json_encode($result);
}
public function fixItuZones() {
@@ -797,40 +767,10 @@ class Logbookadvanced extends CI_Controller {
$ids = xss_clean($this->input->post('ids'));
$this->load->model('logbookadvanced_model');
$this->logbookadvanced_model->fixItuZones($ids);
$data = $this->logbookadvanced_model->getQsosForAdif($ids, $this->session->userdata('user_id'));
$results = $data->result('array');
$qsos = [];
foreach ($results as $data) {
$qsos[] = new QSO($data);
}
$q = [];
// Get Date format
if($this->session->userdata('user_date_format')) {
// If Logged in and session exists
$custom_date_format = $this->session->userdata('user_date_format');
} else {
// Get Default date format from /config/wavelog.php
$custom_date_format = $this->config->item('qso_date_format');
}
foreach ($qsos as $qso) {
$singleQso = $qso->toArray();
$flag = $this->dxccflag->get($qso->getDXCCId());
if ($flag != null) {
$singleQso['flag'] = ' '.$flag;
} else {
$singleQso['flag'] = '';
}
$q[]=$singleQso;
}
$result = $this->logbookadvanced_model->fixItuZones($ids);
header("Content-Type: application/json");
print json_encode($q);
print json_encode($result);
}
public function fixContinent() {

View File

@@ -2919,9 +2919,8 @@ function saveOptions() {
id_list.forEach(function(id) {
let row = $("#incorrectcqzonetable tbody tr#qsoID-" + id);
table.row(row).remove();
table.draw(false);
});
$('.dxcctablediv').html(data.message);
table.draw(false);
},
error: function(xhr, status, error) {
$('#fixSelectedCqZoneBtn').prop("disabled", false).removeClass("running");
@@ -2969,9 +2968,8 @@ function saveOptions() {
id_list.forEach(function(id) {
let row = $("#incorrectituzonetable tbody tr#qsoID-" + id);
table.row(row).remove();
table.draw(false);
});
$('.dxcctablediv').html(data.message);
table.draw(false);
},
error: function(xhr, status, error) {
$('#fixSelectedItuZoneBtn').prop("disabled", false).removeClass("running");