Merge pull request #1232 from AndreasK79/dok_contest
[Contesting] Added option to copy received exchange into Dok field in database
这个提交包含在:
当前提交
b324aba559
共有 3 个文件被更改,包括 44 次插入 和 53 次删除
|
|
@ -98,6 +98,12 @@ class Logbook_model extends CI_Model {
|
||||||
$clean_county_input = null;
|
$clean_county_input = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->input->post('copyexchangetodok')) {
|
||||||
|
$dark_dok = $this->input->post('exch_recv');
|
||||||
|
} else {
|
||||||
|
$dark_dok = $this->input->post('darc_dok');
|
||||||
|
}
|
||||||
|
|
||||||
// Create array with QSO Data
|
// Create array with QSO Data
|
||||||
$data = array(
|
$data = array(
|
||||||
'COL_TIME_ON' => $datetime,
|
'COL_TIME_ON' => $datetime,
|
||||||
|
|
@ -154,7 +160,7 @@ class Logbook_model extends CI_Model {
|
||||||
'COL_SOTA_REF' => trim($this->input->post('sota_ref')),
|
'COL_SOTA_REF' => trim($this->input->post('sota_ref')),
|
||||||
'COL_SIG' => trim($this->input->post('sig')),
|
'COL_SIG' => trim($this->input->post('sig')),
|
||||||
'COL_SIG_INFO' => trim($this->input->post('sig_info')),
|
'COL_SIG_INFO' => trim($this->input->post('sig_info')),
|
||||||
'COL_DARC_DOK' => trim($this->input->post('darc_dok')),
|
'COL_DARC_DOK' => trim($dark_dok),
|
||||||
'COL_NOTES' => $this->input->post('notes'),
|
'COL_NOTES' => $this->input->post('notes'),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@
|
||||||
<input type="text" class="form-control form-control-sm" name="rst_sent" id="rst_sent" value="59">
|
<input type="text" class="form-control form-control-sm" name="rst_sent" id="rst_sent" value="59">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="display:none" class="form-group col-md-1 serials">
|
<div style="display:none" class="form-group col-md-1 serials">
|
||||||
<label for="exch_serial_s">Serial (S)</label>
|
<label for="exch_serial_s">Serial (S)</label>
|
||||||
<input type="number" class="form-control form-control-sm" name="exch_serial_s" id="exch_serial_s" value="">
|
<input type="number" class="form-control form-control-sm" name="exch_serial_s" id="exch_serial_s" value="">
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -140,7 +140,7 @@
|
||||||
<input type="text" class="form-control form-control-sm" name="rst_recv" id="rst_recv" value="59">
|
<input type="text" class="form-control form-control-sm" name="rst_recv" id="rst_recv" value="59">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="display:none" class="form-group col-md-1 serialr">
|
<div style="display:none" class="form-group col-md-1 serialr">
|
||||||
<label for="exch_serial_r">Serial (R)</label>
|
<label for="exch_serial_r">Serial (R)</label>
|
||||||
<input type="number" class="form-control form-control-sm" name="exch_serial_r" id="exch_serial_r" value="">
|
<input type="number" class="form-control form-control-sm" name="exch_serial_r" id="exch_serial_r" value="">
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -170,6 +170,14 @@
|
||||||
|
|
||||||
<button type="button" class="btn btn-sm btn-light" onclick="reset_log_fields()"><i class="fas fa-sync-alt"></i> <?php echo $this->lang->line('contesting_btn_reset_qso'); ?></button>
|
<button type="button" class="btn btn-sm btn-light" onclick="reset_log_fields()"><i class="fas fa-sync-alt"></i> <?php echo $this->lang->line('contesting_btn_reset_qso'); ?></button>
|
||||||
<button type="button" class="btn btn-sm btn-primary" onclick="logQso();"><i class="fas fa-save"></i> <?php echo $this->lang->line('contesting_btn_save_qso'); ?></button>
|
<button type="button" class="btn btn-sm btn-primary" onclick="logQso();"><i class="fas fa-save"></i> <?php echo $this->lang->line('contesting_btn_save_qso'); ?></button>
|
||||||
|
<div class="form-group row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="form-check-inline">
|
||||||
|
<input class="form-check-input" type="checkbox" name="copyexchangetodok" value="1" id="copyexchangetodok">
|
||||||
|
<label class="form-check-label" for="copyexchangetodok">Copy received exchange to DOK field in the database!</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -213,5 +221,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
//var_dump($_SESSION);
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ function reset_contest_session() {
|
||||||
setExchangetype("None");
|
setExchangetype("None");
|
||||||
$("#contestname").val("Other").change();
|
$("#contestname").val("Other").change();
|
||||||
$(".contest_qso_table_contents").empty();
|
$(".contest_qso_table_contents").empty();
|
||||||
|
$('#copyexchangetodok').prop('checked', false);
|
||||||
|
|
||||||
localStorage.removeItem("contestid");
|
localStorage.removeItem("contestid");
|
||||||
localStorage.removeItem("exchangetype");
|
localStorage.removeItem("exchangetype");
|
||||||
|
|
@ -36,6 +37,7 @@ function reset_contest_session() {
|
||||||
localStorage.removeItem("serialsent");
|
localStorage.removeItem("serialsent");
|
||||||
localStorage.removeItem("gridsquarereceived");
|
localStorage.removeItem("gridsquarereceived");
|
||||||
localStorage.removeItem("gridsquaresent");
|
localStorage.removeItem("gridsquaresent");
|
||||||
|
localStorage.removeItem("copytodok");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Storing the contestid in contest session
|
// Storing the contestid in contest session
|
||||||
|
|
@ -233,72 +235,44 @@ $('#exchangetype').change(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
function setExchangetype(exchangetype) {
|
function setExchangetype(exchangetype) {
|
||||||
if (exchangetype == 'None') {
|
// Perhaps a better approach is to hide everything, then just enable the things you need
|
||||||
$("#exch_serial_s").val("");
|
$(".exchanger").hide();
|
||||||
$(".exchanger").hide();
|
$(".exchanges").hide();
|
||||||
$(".exchanges").hide();
|
$(".serials").hide();
|
||||||
$(".serials").hide();
|
$(".serialr").hide();
|
||||||
$(".serialr").hide();
|
$(".gridsquarer").hide();
|
||||||
$(".gridsquarer").hide();
|
$(".gridsquares").hide();
|
||||||
$(".gridsquares").hide();
|
$("#exch_serial_s").val("");
|
||||||
|
|
||||||
|
var serialsent = localStorage.getItem("serialsent");
|
||||||
|
if (serialsent == null) {
|
||||||
|
serialsent = 1;
|
||||||
}
|
}
|
||||||
else if (exchangetype == 'Exchange') {
|
|
||||||
$("#exch_serial_s").val("");
|
if (exchangetype == 'Exchange') {
|
||||||
$(".exchanger").show();
|
$(".exchanger").show();
|
||||||
$(".exchanges").show();
|
$(".exchanges").show();
|
||||||
$(".serials").hide();
|
|
||||||
$(".serialr").hide();
|
|
||||||
$(".gridsquarer").hide();
|
|
||||||
$(".gridsquares").hide();
|
|
||||||
}
|
}
|
||||||
else if (exchangetype == 'Serial') {
|
else if (exchangetype == 'Serial') {
|
||||||
var serialsent = localStorage.getItem("serialsent");
|
$("#exch_serial_s").val(serialsent);
|
||||||
if (serialsent != null) {
|
|
||||||
$("#exch_serial_s").val(serialsent);
|
|
||||||
} else {
|
|
||||||
$("#exch_serial_s").val(1);
|
|
||||||
}
|
|
||||||
$(".exchanger").hide();
|
|
||||||
$(".exchanges").hide();
|
|
||||||
$(".serials").show();
|
$(".serials").show();
|
||||||
$(".serialr").show();
|
$(".serialr").show();
|
||||||
$(".gridsquarer").hide();
|
|
||||||
$(".gridsquares").hide();
|
|
||||||
}
|
}
|
||||||
else if (exchangetype == 'Serialexchange') {
|
else if (exchangetype == 'Serialexchange') {
|
||||||
var serialsent = localStorage.getItem("serialsent");
|
$("#exch_serial_s").val(serialsent);
|
||||||
if (serialsent != null) {
|
|
||||||
$("#exch_serial_s").val(serialsent);
|
|
||||||
} else {
|
|
||||||
$("#exch_serial_s").val(1);
|
|
||||||
}
|
|
||||||
$(".exchanger").show();
|
$(".exchanger").show();
|
||||||
$(".exchanges").show();
|
$(".exchanges").show();
|
||||||
$(".serials").show();
|
$(".serials").show();
|
||||||
$(".serialr").show();
|
$(".serialr").show();
|
||||||
$(".gridsquarer").hide();
|
|
||||||
$(".gridsquares").hide();
|
|
||||||
}
|
}
|
||||||
else if (exchangetype == 'Serialgridsquare') {
|
else if (exchangetype == 'Serialgridsquare') {
|
||||||
var serialsent = localStorage.getItem("serialsent");
|
$("#exch_serial_s").val(serialsent);
|
||||||
if (serialsent != null) {
|
|
||||||
$("#exch_serial_s").val(serialsent);
|
|
||||||
} else {
|
|
||||||
$("#exch_serial_s").val(1);
|
|
||||||
}
|
|
||||||
$(".exchanger").hide();
|
|
||||||
$(".exchanges").hide();
|
|
||||||
$(".serials").show();
|
$(".serials").show();
|
||||||
$(".serialr").show();
|
$(".serialr").show();
|
||||||
$(".gridsquarer").show();
|
$(".gridsquarer").show();
|
||||||
$(".gridsquares").show();
|
$(".gridsquares").show();
|
||||||
}
|
}
|
||||||
else if (exchangetype == 'Gridsquare') {
|
else if (exchangetype == 'Gridsquare') {
|
||||||
$("#exch_serial_s").val("");
|
|
||||||
$(".exchanger").hide();
|
|
||||||
$(".exchanges").hide();
|
|
||||||
$(".serials").hide();
|
|
||||||
$(".serialr").hide();
|
|
||||||
$(".gridsquarer").show();
|
$(".gridsquarer").show();
|
||||||
$(".gridsquares").show();
|
$(".gridsquares").show();
|
||||||
}
|
}
|
||||||
|
|
@ -374,6 +348,7 @@ function logQso() {
|
||||||
localStorage.setItem("serialsent", $("#exch_serial_s").val());
|
localStorage.setItem("serialsent", $("#exch_serial_s").val());
|
||||||
localStorage.setItem("gridsquarereceived", $("#exch_gridsquare_r").val());
|
localStorage.setItem("gridsquarereceived", $("#exch_gridsquare_r").val());
|
||||||
localStorage.setItem("gridsquaresent", $("#exch_gridsquare_s").val());
|
localStorage.setItem("gridsquaresent", $("#exch_gridsquare_s").val());
|
||||||
|
localStorage.setItem("copytodok", $('#copyexchangetodok').is(":checked"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -381,14 +356,17 @@ function logQso() {
|
||||||
|
|
||||||
// We are restoring the settings in the contest logging form here
|
// We are restoring the settings in the contest logging form here
|
||||||
function restoreContestSession() {
|
function restoreContestSession() {
|
||||||
var contestname = localStorage.getItem("contestid");
|
var dokcopy = localStorage.getItem("copytodok");
|
||||||
|
if (dokcopy != null) {
|
||||||
|
$('#copyexchangetodok').prop('checked', true);
|
||||||
|
}
|
||||||
|
|
||||||
|
var contestname = localStorage.getItem("contestid");
|
||||||
if (contestname != null) {
|
if (contestname != null) {
|
||||||
$("#contestname").val(contestname);
|
$("#contestname").val(contestname);
|
||||||
}
|
}
|
||||||
|
|
||||||
var exchangetype = localStorage.getItem("exchangetype");
|
var exchangetype = localStorage.getItem("exchangetype");
|
||||||
|
|
||||||
if (exchangetype != null) {
|
if (exchangetype != null) {
|
||||||
$("#exchangetype").val(exchangetype);
|
$("#exchangetype").val(exchangetype);
|
||||||
setExchangetype(exchangetype);
|
setExchangetype(exchangetype);
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用