mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge pull request #3102 from AndreasK79/lba_qso_edit_reload
This commit is contained in:
@@ -954,4 +954,26 @@ class Logbookadvanced extends CI_Controller {
|
|||||||
print json_encode($data);
|
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>
|
<script>
|
||||||
var reload_after_qso_safe = false;
|
let reload_qso_line = false;
|
||||||
|
let reload_after_qso_safe = false;
|
||||||
<?php if (
|
<?php if (
|
||||||
$this->uri->segment(1) != "search" &&
|
$this->uri->segment(1) != "search" &&
|
||||||
$this->uri->segment(2) != "filter" &&
|
$this->uri->segment(2) != "filter" &&
|
||||||
$this->uri->segment(1) != "qso" &&
|
$this->uri->segment(1) != "qso" &&
|
||||||
$this->uri->segment(1) != "logbookadvanced") { ?>
|
$this->uri->segment(1) != "logbookadvanced") { ?>
|
||||||
reload_after_qso_safe = true;
|
reload_after_qso_safe = true;
|
||||||
|
<?php }
|
||||||
|
if ($this->uri->segment(1) == "logbookadvanced") { ?>
|
||||||
|
reload_qso_line = true;
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -643,8 +643,8 @@ function qso_edit(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function qso_save() {
|
function qso_save() {
|
||||||
var myform = $("#qsoform")[0];
|
let myform = $("#qsoform")[0];
|
||||||
var fd = new FormData(myform);
|
let fd = new FormData(myform);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: base_url + 'index.php/qso/qso_save_ajax',
|
url: base_url + 'index.php/qso/qso_save_ajax',
|
||||||
data: fd,
|
data: fd,
|
||||||
@@ -659,6 +659,10 @@ function qso_save() {
|
|||||||
if (reload_after_qso_safe == true) {
|
if (reload_after_qso_safe == true) {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
|
if (reload_qso_line == true) {
|
||||||
|
let qsoId = document.querySelector('input[name="id"]').value;
|
||||||
|
getQsos(qsoId);
|
||||||
|
}
|
||||||
} else {
|
} 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>');
|
$("#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');
|
$(".modal-body").animate({ scrollTop: 0 }, 'fast');
|
||||||
|
|||||||
@@ -3206,3 +3206,16 @@ function saveOptions() {
|
|||||||
window.map.setView([30, 0], 1.5);
|
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