Added contest column

This commit is contained in:
Andreas Kristiansen
2024-05-20 11:22:11 +02:00
parent bf63d42e05
commit 90e9016ea7
5 changed files with 27 additions and 2 deletions

View File

@@ -509,6 +509,7 @@ class Logbookadvanced extends CI_Controller {
$json_string['operator']['show'] = $this->input->post('operator');
$json_string['comment']['show'] = $this->input->post('comment');
$json_string['propagation']['show'] = $this->input->post('propagation');
$json_string['contest']['show'] = $this->input->post('contest');
$obj['column_settings']= json_encode($json_string);

View File

@@ -37,7 +37,8 @@
\"pota\":{\"show\":\"true\"},
\"operator\":{\"show\":\"true\"},
\"comment\":{\"show\":\"true\"},
\"propagation\":{\"show\":\"true\"}
\"propagation\":{\"show\":\"true\"},
\"contest\":{\"show\":\"true\"}
}";
}
$current_opts = json_decode($options);
@@ -62,6 +63,11 @@
echo "\nvar o_template = { propagation: {show: 'true'}};";
echo "\nuser_options={...user_options, ...o_template};";
}
if (!isset($current_opts->contest)) {
echo "\nvar o_template = { contest: {show: 'true'}};";
echo "\nuser_options={...user_options, ...o_template};";
}
foreach ($mapoptions as $mo) {
if ($mo != null) {
@@ -542,6 +548,9 @@ $options = json_decode($options);
} ?>
<?php if (($options->propagation->show ?? "true") == "true") {
echo '<th>' . lang('filter_general_propagation') . '</th>';
} ?>
<?php if (($options->contest->show ?? "true") == "true") {
echo '<th>Contest</th>';
} ?>
</tr>
</thead>

View File

@@ -118,6 +118,10 @@
<td><?php echo lang('filter_general_propagation'); ?></td>
<td><div class="form-check"><input class="form-check-input" name="propagation" type="checkbox" <?php if (($options->propagation->show ?? "true") == "true") { echo 'checked'; } ?>></div></td>
</tr>
<tr>
<td>Contest</td>
<td><div class="form-check"><input class="form-check-input" name="contest" type="checkbox" <?php if (($options->contest->show ?? "true") == "true") { echo 'checked'; } ?>></div></td>
</tr>
</tbody>
</table>
</div>

View File

@@ -100,6 +100,9 @@ function updateRow(qso) {
if ( (user_options.propagation) && (user_options.propagation.show == "true")){
cells.eq(c++).html(qso.propagation);
}
if ( (user_options.contest) && (user_options.contest.show == "true")){
cells.eq(c++).html(qso.contest);
}
$('[data-bs-toggle="tooltip"]').tooltip();
return row;
@@ -211,6 +214,9 @@ function loadQSOTable(rows) {
if (user_options.propagation.show == "true"){
data.push(qso.propagation);
}
if (user_options.contest.show == "true"){
data.push(qso.contest);
}
let createdRow = table.row.add(data).index();
table.rows(createdRow).nodes().to$().data('qsoID', qso.qsoID);
@@ -915,6 +921,7 @@ function saveOptions() {
operator: $('input[name="operator"]').is(':checked') ? true : false,
comment: $('input[name="comment"]').is(':checked') ? true : false,
propagation: $('input[name="propagation"]').is(':checked') ? true : false,
contest: $('input[name="contest"]').is(':checked') ? true : false,
gridsquare_layer: $('input[name="gridsquareoverlay"]').is(':checked') ? true : false,
path_lines: $('input[name="pathlines"]').is(':checked') ? true : false,
cqzone_layer: $('input[name="cqzones"]').is(':checked') ? true : false,

View File

@@ -69,6 +69,7 @@ class QSO
private string $lotw_hint;
private string $operator;
private string $comment;
private string $contest;
/** Orbit type **/
private string $orbit;
@@ -202,7 +203,7 @@ class QSO
$this->cqzone = ($data['COL_CQZ'] === null) ? '' : $this->geCqLink($data['COL_CQZ']);
$this->ituzone = $data['COL_ITUZ'] ?? '';
$this->state = ($data['COL_STATE'] === null) ? '' :$data['COL_STATE'];
$this->dxcc = (($data['name'] ?? null) === null) ? '- NONE -' : '<a href="javascript:spawnLookupModal('.$data['COL_DXCC'].',\'dxcc\');">'.ucwords(strtolower($data['name']), "- (/").'</a>';
$this->dxcc = (($data['dxccname'] ?? null) === null) ? '- NONE -' : '<a href="javascript:spawnLookupModal('.$data['COL_DXCC'].',\'dxcc\');">'.ucwords(strtolower($data['dxccname']), "- (/").'</a>';
$this->iota = ($data['COL_IOTA'] === null) ? '' : $this->getIotaLink($data['COL_IOTA']);
if (array_key_exists('end', $data)) {
$this->end = ($data['end'] === null) ? null : DateTime::createFromFormat("Y-m-d", $data['end'], new DateTimeZone('UTC'));
@@ -217,6 +218,8 @@ class QSO
$this->comment = $data['COL_COMMENT'] ?? '';
$this->orbit = $data['orbit'] ?? '';
$this->contest = $data['contestname'] ?? '';
}
/**
@@ -841,6 +844,7 @@ class QSO
'comment' => $this->comment,
'orbit' => $this->orbit,
'propagation' => $this->getPropagationMode(),
'contest' => $this->contest
];
}