[Contesting] Added selection for copying received exchange over to DOK field in the database.

这个提交包含在:
Andreas 2021-10-16 16:03:54 +02:00
父节点 b63ebc02be
当前提交 d44831d3f5
共有 4 个文件被更改,包括 23 次插入37 次删除

查看文件

@ -22,7 +22,6 @@ class Contesting extends CI_Controller {
$this->load->model('contesting_model');
$data['my_gridsquare'] = $this->stations->find_gridsquare();
$data['my_dok'] = ""; // For now, this is set to blank, but need function to get
$data['radios'] = $this->cat->radios();
$data['modes'] = $this->modes->active();
$data['contestnames'] = $this->contesting_model->getActivecontests();

查看文件

@ -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'),
);

查看文件

@ -13,9 +13,6 @@
<div class="col-auto">
<select class="form-control-sm" id="exchangetype" name="exchangetype">
<option value='None'>None</option>
<option value='Dok'>DOK</option>
<option value='Serialdok'>DOK + Serial</option>
<option value='Dokgridsquare'>DOK + Gridsquare</option>
<option value='Exchange'>Exchange</option>
<option value='Gridsquare'>Gridsquare</option>
<option value='Serial'>Serial</option>
@ -128,11 +125,6 @@
<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 doks">
<label for="exch_dok_s">DOK (S)</label>
<input disabled type="text" class="form-control form-control-sm" name="exch_dok_s" id="exch_dok_s" value="<?php echo $my_dok;?>">
</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="">
@ -152,11 +144,6 @@
<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 dokr">
<label for="exch_dok_r">DOK (R)</label>
<input type="text" class="form-control form-control-sm" name="darc_dok" id="exch_dok_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>
@ -183,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>
@ -226,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
@ -240,8 +242,6 @@ function setExchangetype(exchangetype) {
$(".serialr").hide();
$(".gridsquarer").hide();
$(".gridsquares").hide();
$(".doks").hide();
$(".dokr").hide();
$("#exch_serial_s").val("");
var serialsent = localStorage.getItem("serialsent");
@ -258,23 +258,6 @@ function setExchangetype(exchangetype) {
$(".serials").show();
$(".serialr").show();
}
else if (exchangetype == 'Dok') {
$(".doks").show();
$(".dokr").show();
}
else if (exchangetype == 'Serialdok') {
$("#exch_serial_s").val(serialsent);
$(".serials").show();
$(".serialr").show();
$(".doks").show();
$(".dokr").show();
}
else if (exchangetype == 'Dokgridsquare') {
$(".gridsquarer").show();
$(".gridsquares").show();
$(".doks").show();
$(".dokr").show();
}
else if (exchangetype == 'Serialexchange') {
$("#exch_serial_s").val(serialsent);
$(".exchanger").show();
@ -365,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"));
}
});
}
@ -372,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);