mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 02:14:13 +00:00
[Advanced Logbook] Reload qso line in the table after qso edit
This commit is contained in:
@@ -954,4 +954,26 @@ class Logbookadvanced extends CI_Controller {
|
||||
print json_encode($data);
|
||||
}
|
||||
|
||||
function getQsos() {
|
||||
if(!clubaccess_check(9)) return;
|
||||
|
||||
$qsoID[] = $this->input->post('id', true);
|
||||
|
||||
$this->load->model('logbookadvanced_model');
|
||||
$qso = $this->logbookadvanced_model->getQsosForAdif(json_encode($qsoID), $this->session->userdata('user_id'))->row_array();
|
||||
|
||||
$qsoObj = new QSO($qso); // Redirection via Object to clean/convert QSO (get rid of cols)
|
||||
$cleaned_qso = $qsoObj->toArray(); // And back to Array for the JSON
|
||||
|
||||
$flag = $this->dxccflag->get($qsoObj->getDXCCId());
|
||||
if ($flag != null) {
|
||||
$cleaned_qso['flag'] = ' ' . $flag;
|
||||
} else {
|
||||
$cleaned_qso['flag'] = '';
|
||||
}
|
||||
|
||||
header("Content-Type: application/json");
|
||||
echo json_encode($cleaned_qso);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2154,13 +2154,17 @@ $('#sats').change(function(){
|
||||
|
||||
|
||||
<script>
|
||||
var reload_after_qso_safe = false;
|
||||
let reload_qso_line = false;
|
||||
let reload_after_qso_safe = false;
|
||||
<?php if (
|
||||
$this->uri->segment(1) != "search" &&
|
||||
$this->uri->segment(2) != "filter" &&
|
||||
$this->uri->segment(1) != "qso" &&
|
||||
$this->uri->segment(1) != "logbookadvanced") { ?>
|
||||
reload_after_qso_safe = true;
|
||||
<?php }
|
||||
if ($this->uri->segment(1) == "logbookadvanced") { ?>
|
||||
reload_qso_line = true;
|
||||
<?php } ?>
|
||||
</script>
|
||||
|
||||
|
||||
@@ -643,8 +643,8 @@ function qso_edit(id) {
|
||||
}
|
||||
|
||||
function qso_save() {
|
||||
var myform = $("#qsoform")[0];
|
||||
var fd = new FormData(myform);
|
||||
let myform = $("#qsoform")[0];
|
||||
let fd = new FormData(myform);
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/qso/qso_save_ajax',
|
||||
data: fd,
|
||||
@@ -659,6 +659,10 @@ function qso_save() {
|
||||
if (reload_after_qso_safe == true) {
|
||||
location.reload();
|
||||
}
|
||||
if (reload_qso_line == true) {
|
||||
let qsoId = document.querySelector('input[name="id"]').value;
|
||||
getQsos(qsoId);
|
||||
}
|
||||
} else {
|
||||
$("#error-messages-qso-edit").html('<div class="alert alert-danger alert-dismissible fade show" role="alert">'+dataofconfirm.detail+'<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></div>');
|
||||
$(".modal-body").animate({ scrollTop: 0 }, 'fast');
|
||||
|
||||
@@ -3198,3 +3198,16 @@ function saveOptions() {
|
||||
window.map.setView([30, 0], 1.5);
|
||||
}
|
||||
}
|
||||
|
||||
function getQsos(id) {
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/logbookadvanced/getQsos',
|
||||
type: 'post',
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
success: function (data) {
|
||||
updateRow(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user