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;
|
||||
}
|
||||
|
||||
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
|
||||
$data = array(
|
||||
'COL_TIME_ON' => $datetime,
|
||||
|
|
@ -154,7 +160,7 @@ class Logbook_model extends CI_Model {
|
|||
'COL_SOTA_REF' => trim($this->input->post('sota_ref')),
|
||||
'COL_SIG' => trim($this->input->post('sig')),
|
||||
'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'),
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -120,11 +120,11 @@
|
|||
<input type="text" class="form-control form-control-sm" name="rst_sent" id="rst_sent" value="59">
|
||||
</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>
|
||||
<input type="number" class="form-control form-control-sm" name="exch_serial_s" id="exch_serial_s" value="">
|
||||
</div>
|
||||
|
||||
|
||||
<div style="display:none" class="form-group col-md-1 exchanges">
|
||||
<label for="exch_sent"><?php echo $this->lang->line('gen_hamradio_exchange_sent_short'); ?></label>
|
||||
<input type="text" class="form-control form-control-sm" name="exch_sent" id="exch_sent" value="">
|
||||
|
|
@ -140,11 +140,11 @@
|
|||
<input type="text" class="form-control form-control-sm" name="rst_recv" id="rst_recv" value="59">
|
||||
</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>
|
||||
<input type="number" class="form-control form-control-sm" name="exch_serial_r" id="exch_serial_r" value="">
|
||||
</div>
|
||||
|
||||
|
||||
<div style="display:none" class="form-group col-md-1 exchanger">
|
||||
<label for="exch_recv"><?php echo $this->lang->line('gen_hamradio_exchange_recv_short'); ?></label>
|
||||
<input type="text" class="form-control form-control-sm" name="exch_recv" id="exch_recv" value="">
|
||||
|
|
@ -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-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>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -213,5 +221,4 @@
|
|||
</div>
|
||||
</div>
|
||||
<?php
|
||||
//var_dump($_SESSION);
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ function reset_contest_session() {
|
|||
setExchangetype("None");
|
||||
$("#contestname").val("Other").change();
|
||||
$(".contest_qso_table_contents").empty();
|
||||
$('#copyexchangetodok').prop('checked', false);
|
||||
|
||||
localStorage.removeItem("contestid");
|
||||
localStorage.removeItem("exchangetype");
|
||||
|
|
@ -36,6 +37,7 @@ function reset_contest_session() {
|
|||
localStorage.removeItem("serialsent");
|
||||
localStorage.removeItem("gridsquarereceived");
|
||||
localStorage.removeItem("gridsquaresent");
|
||||
localStorage.removeItem("copytodok");
|
||||
}
|
||||
|
||||
// Storing the contestid in contest session
|
||||
|
|
@ -233,72 +235,44 @@ $('#exchangetype').change(function () {
|
|||
});
|
||||
|
||||
function setExchangetype(exchangetype) {
|
||||
if (exchangetype == 'None') {
|
||||
$("#exch_serial_s").val("");
|
||||
$(".exchanger").hide();
|
||||
$(".exchanges").hide();
|
||||
$(".serials").hide();
|
||||
$(".serialr").hide();
|
||||
$(".gridsquarer").hide();
|
||||
$(".gridsquares").hide();
|
||||
// Perhaps a better approach is to hide everything, then just enable the things you need
|
||||
$(".exchanger").hide();
|
||||
$(".exchanges").hide();
|
||||
$(".serials").hide();
|
||||
$(".serialr").hide();
|
||||
$(".gridsquarer").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();
|
||||
$(".exchanges").show();
|
||||
$(".serials").hide();
|
||||
$(".serialr").hide();
|
||||
$(".gridsquarer").hide();
|
||||
$(".gridsquares").hide();
|
||||
}
|
||||
else if (exchangetype == 'Serial') {
|
||||
var serialsent = localStorage.getItem("serialsent");
|
||||
if (serialsent != null) {
|
||||
$("#exch_serial_s").val(serialsent);
|
||||
} else {
|
||||
$("#exch_serial_s").val(1);
|
||||
}
|
||||
$(".exchanger").hide();
|
||||
$(".exchanges").hide();
|
||||
$("#exch_serial_s").val(serialsent);
|
||||
$(".serials").show();
|
||||
$(".serialr").show();
|
||||
$(".gridsquarer").hide();
|
||||
$(".gridsquares").hide();
|
||||
}
|
||||
else if (exchangetype == 'Serialexchange') {
|
||||
var serialsent = localStorage.getItem("serialsent");
|
||||
if (serialsent != null) {
|
||||
$("#exch_serial_s").val(serialsent);
|
||||
} else {
|
||||
$("#exch_serial_s").val(1);
|
||||
}
|
||||
$("#exch_serial_s").val(serialsent);
|
||||
$(".exchanger").show();
|
||||
$(".exchanges").show();
|
||||
$(".serials").show();
|
||||
$(".serialr").show();
|
||||
$(".gridsquarer").hide();
|
||||
$(".gridsquares").hide();
|
||||
}
|
||||
else if (exchangetype == 'Serialgridsquare') {
|
||||
var serialsent = localStorage.getItem("serialsent");
|
||||
if (serialsent != null) {
|
||||
$("#exch_serial_s").val(serialsent);
|
||||
} else {
|
||||
$("#exch_serial_s").val(1);
|
||||
}
|
||||
$(".exchanger").hide();
|
||||
$(".exchanges").hide();
|
||||
$("#exch_serial_s").val(serialsent);
|
||||
$(".serials").show();
|
||||
$(".serialr").show();
|
||||
$(".gridsquarer").show();
|
||||
$(".gridsquares").show();
|
||||
}
|
||||
else if (exchangetype == 'Gridsquare') {
|
||||
$("#exch_serial_s").val("");
|
||||
$(".exchanger").hide();
|
||||
$(".exchanges").hide();
|
||||
$(".serials").hide();
|
||||
$(".serialr").hide();
|
||||
$(".gridsquarer").show();
|
||||
$(".gridsquares").show();
|
||||
}
|
||||
|
|
@ -374,6 +348,7 @@ function logQso() {
|
|||
localStorage.setItem("serialsent", $("#exch_serial_s").val());
|
||||
localStorage.setItem("gridsquarereceived", $("#exch_gridsquare_r").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
|
||||
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) {
|
||||
$("#contestname").val(contestname);
|
||||
}
|
||||
|
||||
var exchangetype = localStorage.getItem("exchangetype");
|
||||
|
||||
if (exchangetype != null) {
|
||||
$("#exchangetype").val(exchangetype);
|
||||
setExchangetype(exchangetype);
|
||||
|
|
|
|||
正在加载…
在新工单中引用