kopia lustrzana https://github.com/magicbug/Cloudlog
Merge pull request #2378 from int2001/contest_multiop
Contest Multi-Op (with same Account and Call)pull/2382/head
commit
b427f78b2d
|
@ -1,8 +1,10 @@
|
|||
// Callsign always has focus on load
|
||||
$("#callsign").focus();
|
||||
|
||||
$(document).ready(function () {
|
||||
getSession().done(restoreContestSession);
|
||||
var sessiondata={};
|
||||
$(document).ready(async function () {
|
||||
sessiondata=await getSession(); // save sessiondata global (we need it later, when adding qso)
|
||||
await restoreContestSession(sessiondata); // wait for restoring until finished
|
||||
setRst($("#mode").val());
|
||||
});
|
||||
|
||||
|
@ -435,8 +437,6 @@ function logQso() {
|
|||
vuccr,
|
||||
]];
|
||||
|
||||
table.rows.add(data).draw();
|
||||
|
||||
var formdata = new FormData(document.getElementById("qso_input"));
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/qso/saveqso',
|
||||
|
@ -445,7 +445,7 @@ function logQso() {
|
|||
processData: false,
|
||||
contentType: false,
|
||||
enctype: 'multipart/form-data',
|
||||
success: function (html) {
|
||||
success: async function (html) {
|
||||
var exchangetype = $("#exchangetype").val();
|
||||
if (exchangetype == "Serial" || exchangetype == 'Serialexchange' || exchangetype == 'Serialgridsquare') {
|
||||
$("#exch_serial_s").val(+$("#exch_serial_s").val() + 1);
|
||||
|
@ -462,6 +462,7 @@ function logQso() {
|
|||
$("#callsign").focus();
|
||||
setSession(formdata);
|
||||
|
||||
await refresh_qso_table(sessiondata);
|
||||
var qTable = $('.qsotable').DataTable();
|
||||
qTable.search('').order([0, 'desc']).draw();
|
||||
|
||||
|
@ -470,14 +471,14 @@ function logQso() {
|
|||
}
|
||||
}
|
||||
|
||||
function getSession() {
|
||||
return $.ajax({
|
||||
async function getSession() {
|
||||
return await $.ajax({
|
||||
url: base_url + 'index.php/contesting/getSession',
|
||||
type: 'post',
|
||||
});
|
||||
}
|
||||
|
||||
function restoreContestSession(data) {
|
||||
async function restoreContestSession(data) {
|
||||
if (data) {
|
||||
if (data.copytodok == "1") {
|
||||
$('#copyexchangetodok').prop('checked', true);
|
||||
|
@ -498,70 +499,74 @@ function restoreContestSession(data) {
|
|||
}
|
||||
|
||||
if (data.qso != "") {
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/contesting/getSessionQsos',
|
||||
type: 'post',
|
||||
data: { 'qso': data.qso, },
|
||||
success: function (html) {
|
||||
var mode = '';
|
||||
|
||||
$.each(html, function () {
|
||||
if (this.col_submode == null || this.col_submode == '') {
|
||||
mode = this.col_mode;
|
||||
} else {
|
||||
mode = this.col_submode;
|
||||
}
|
||||
|
||||
$(".qsotable tbody").prepend('<tr>' +
|
||||
'<td>' + this.col_time_on + '</td>' +
|
||||
'<td>' + this.col_call + '</td>' +
|
||||
'<td>' + this.col_band + '</td>' +
|
||||
'<td>' + mode + '</td>' +
|
||||
'<td>' + this.col_rst_sent + '</td>' +
|
||||
'<td>' + this.col_rst_rcvd + '</td>' +
|
||||
'<td>' + this.col_stx_string + '</td>' +
|
||||
'<td>' + this.col_srx_string + '</td>' +
|
||||
'<td>' + this.col_stx + '</td>' +
|
||||
'<td>' + this.col_srx + '</td>' +
|
||||
'<td>' + this.col_gridsquare + '</td>' +
|
||||
'<td>' + this.col_vucc_grids + '</td>' +
|
||||
'</tr>');
|
||||
});
|
||||
if (!$.fn.DataTable.isDataTable('.qsotable')) {
|
||||
$.fn.dataTable.moment('DD-MM-YYYY HH:mm:ss');
|
||||
$('.qsotable').DataTable({
|
||||
"stateSave": true,
|
||||
"pageLength": 25,
|
||||
responsive: false,
|
||||
"scrollY": "400px",
|
||||
"scrollCollapse": true,
|
||||
"paging": false,
|
||||
"scrollX": true,
|
||||
order: [0, 'desc'],
|
||||
"columnDefs": [
|
||||
{
|
||||
"render": function ( data, type, row ) {
|
||||
return pad(row[8],3);
|
||||
},
|
||||
"targets" : 8
|
||||
},
|
||||
{
|
||||
"render": function ( data, type, row ) {
|
||||
return pad(row[9],3);
|
||||
},
|
||||
"targets" : 9
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
await refresh_qso_table(data);
|
||||
}
|
||||
} else {
|
||||
$("#exch_serial_s").val("1");
|
||||
}
|
||||
}
|
||||
|
||||
async function refresh_qso_table(data) {
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/contesting/getSessionQsos',
|
||||
type: 'post',
|
||||
data: { 'qso': data.qso, },
|
||||
success: function (html) {
|
||||
var mode = '';
|
||||
$(".contest_qso_table_contents").empty();
|
||||
$.each(html, function () {
|
||||
if (this.col_submode == null || this.col_submode == '') {
|
||||
mode = this.col_mode;
|
||||
} else {
|
||||
mode = this.col_submode;
|
||||
}
|
||||
|
||||
$(".qsotable tbody").prepend('<tr>' +
|
||||
'<td>' + this.col_time_on + '</td>' +
|
||||
'<td>' + this.col_call + '</td>' +
|
||||
'<td>' + this.col_band + '</td>' +
|
||||
'<td>' + mode + '</td>' +
|
||||
'<td>' + this.col_rst_sent + '</td>' +
|
||||
'<td>' + this.col_rst_rcvd + '</td>' +
|
||||
'<td>' + this.col_stx_string + '</td>' +
|
||||
'<td>' + this.col_srx_string + '</td>' +
|
||||
'<td>' + this.col_stx + '</td>' +
|
||||
'<td>' + this.col_srx + '</td>' +
|
||||
'<td>' + this.col_gridsquare + '</td>' +
|
||||
'<td>' + this.col_vucc_grids + '</td>' +
|
||||
'</tr>');
|
||||
});
|
||||
if (!$.fn.DataTable.isDataTable('.qsotable')) {
|
||||
$.fn.dataTable.moment('DD-MM-YYYY HH:mm:ss');
|
||||
$('.qsotable').DataTable({
|
||||
"stateSave": true,
|
||||
"pageLength": 25,
|
||||
responsive: false,
|
||||
"scrollY": "400px",
|
||||
"scrollCollapse": true,
|
||||
"paging": false,
|
||||
"scrollX": true,
|
||||
order: [0, 'desc'],
|
||||
"columnDefs": [
|
||||
{
|
||||
"render": function ( data, type, row ) {
|
||||
return pad(row[8],3);
|
||||
},
|
||||
"targets" : 8
|
||||
},
|
||||
{
|
||||
"render": function ( data, type, row ) {
|
||||
return pad(row[9],3);
|
||||
},
|
||||
"targets" : 9
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function pad (str, max) {
|
||||
str = str.toString();
|
||||
return str.length < max ? pad("0" + str, max) : str;
|
||||
|
|
Ładowanie…
Reference in New Issue