Clublog for LBA

This commit is contained in:
int2001
2024-07-02 17:46:06 +00:00
parent a9dd2032b7
commit d2b378e614
6 changed files with 117 additions and 0 deletions

View File

@@ -133,6 +133,8 @@ class Logbookadvanced extends CI_Controller {
'lotwReceived' => xss_clean($this->input->post('lotwReceived')),
'eqslSent' => xss_clean($this->input->post('eqslSent')),
'eqslReceived' => xss_clean($this->input->post('eqslReceived')),
'clublogSent' => xss_clean($this->input->post('clublogSent')),
'clublogReceived' => xss_clean($this->input->post('clublogReceived')),
'qslvia' => xss_clean($this->input->post('qslvia')),
'sota' => xss_clean($this->input->post('sota')),
'pota' => xss_clean($this->input->post('pota')),
@@ -300,6 +302,8 @@ class Logbookadvanced extends CI_Controller {
'lotwReceived' => '',
'eqslSent' => '',
'eqslReceived' => '',
'clublogSent' => '',
'clublogReceived' => '',
'qslvia' => '',
'sota' => '',
'pota' => '',
@@ -342,6 +346,8 @@ class Logbookadvanced extends CI_Controller {
'lotwReceived' => xss_clean($this->input->post('lotwReceived')),
'eqslSent' => xss_clean($this->input->post('eqslSent')),
'eqslReceived' => xss_clean($this->input->post('eqslReceived')),
'clublogSent' => xss_clean($this->input->post('clublogSent')),
'clublogReceived' => xss_clean($this->input->post('clublogReceived')),
'qslvia' => xss_clean($this->input->post('qslvia')),
'sota' => xss_clean($this->input->post('sota')),
'pota' => xss_clean($this->input->post('pota')),
@@ -491,6 +497,7 @@ class Logbookadvanced extends CI_Controller {
$json_string['qsl']['show'] = $this->input->post('qsl');
$json_string['lotw']['show'] = $this->input->post('lotw');
$json_string['eqsl']['show'] = $this->input->post('eqsl');
$json_string['clublog']['show'] = $this->input->post('clublog');
$json_string['qslmsg']['show'] = $this->input->post('qslmsg');
$json_string['dxcc']['show'] = $this->input->post('dxcc');
$json_string['state']['show'] = $this->input->post('state');

View File

@@ -120,6 +120,24 @@ class Logbookadvanced_model extends CI_Model {
$binding[] = $searchCriteria['lotwReceived'];
}
if ($searchCriteria['clublogSent'] !== '') {
$condition = "COL_CLUBLOG_QSO_UPLOAD_STATUS = ?";
if ($searchCriteria['clublogSent'] == 'N') {
$condition = '('.$condition;
$condition .= " OR COL_CLUBLOG_QSL_UPLOAD_STATUS IS NULL OR COL_CLUBLOG_QSO_UPLOAD_STATUS = '')";
}
$conditions[] = $condition;
$binding[] = $searchCriteria['clublogSent'];
}
if ($searchCriteria['clublogReceived'] !== '') {
$condition = "COL_CLUBLOG_QSO_DOWNLOAD_STATUS = ?";
if ($searchCriteria['clublogReceived'] == 'N') {
$condition = '('.$condition;
$condition .= " OR COL_CLUBLOG_QSO_DOWNLOAD_STATUS IS NULL OR COL_CLUBLOG_QSO_DOWNLOAD_STATUS = '')";
}
$conditions[] = $condition;
$binding[] = $searchCriteria['clublogReceived'];
}
if ($searchCriteria['eqslSent'] !== '') {
$condition = "COL_EQSL_QSL_SENT = ?";
if ($searchCriteria['eqslSent'] == 'N') {

View File

@@ -27,6 +27,7 @@
\"qsl\":{\"show\":\"true\"},
\"lotw\":{\"show\":\"true\"},
\"eqsl\":{\"show\":\"true\"},
\"clublog\":{\"show\":\"true\"},
\"qslmsg\":{\"show\":\"true\"},
\"dxcc\":{\"show\":\"true\"},
\"state\":{\"show\":\"true\"},
@@ -86,6 +87,10 @@
if (!isset($current_opts->wwff)) {
echo "\nvar o_template = { wwff: {show: 'true'}};";
echo "\nuser_options={...user_options, ...o_template};";
}
if (!isset($current_opts->clublog)) {
echo "\nvar o_template = { clublog: {show: 'true'}};";
echo "\nuser_options={...user_options, ...o_template};";
}
if (!isset($current_opts->sig)) {
echo "\nvar o_template = { sig: {show: 'true'}};";
@@ -345,6 +350,28 @@ $options = json_decode($options);
<option value="V"><?= __("Verified"); ?></option>
</select>
</div>
<div class="mb-3 col-lg-2 col-md-2 col-sm-3 col-xl">
<label for="clublogSent"><?= __("Clublog sent"); ?></label>
<select id="clublogSent" name="clublogSent" class="form-select form-select-sm">
<option value=""><?= __("All"); ?></option>
<option value="Y"><?= __("Yes"); ?></option>
<option value="N"><?= __("No"); ?></option>
<option value="R"><?= __("Requested"); ?></option>
<option value="Q"><?= __("Queued"); ?></option>
<option value="I"><?= __("Invalid (Ignore)"); ?></option>
</select>
</div>
<div class="mb-3 col-lg-2 col-md-2 col-sm-3 col-xl">
<label for="clublogReceived"><?= __("Clublog received"); ?></label>
<select id="clublogReceived" name="clublogReceived" class="form-select form-select-sm">
<option value=""><?= __("All"); ?></option>
<option value="Y"><?= __("Yes"); ?></option>
<option value="N"><?= __("No"); ?></option>
<option value="R"><?= __("Requested"); ?></option>
<option value="I"><?= __("Invalid (Ignore)"); ?></option>
<option value="V"><?= __("Verified"); ?></option>
</select>
</div>
<div class="mb-3 col-lg-2 col-md-2 col-sm-3 col-xl">
<label for="eqslSent"><?= __("eQSL sent"); ?></label>
<select id="eqslSent" name="eqslSent" class="form-select form-select-sm">
@@ -535,6 +562,12 @@ $options = json_decode($options);
<?php if (($options->qsl->show ?? "true") == "true") {
echo '<th>' . __("QSL") . '</th>';
} ?>
<?php if (($options->clublog->show ?? "true") == "true") {
echo '<th class="clublogconfirmation">Clublog</th>';
} ?>
<?php if ($this->session->userdata('user_lotw_name') != "" && ($options->lotw->show ?? "true") == "true") {
echo '<th class="lotwconfirmation">LoTW</th>';
} ?>
<?php if ($this->session->userdata('user_eqsl_name') != "" && ($options->eqsl->show ?? "true") == "true") {
echo '<th class="eqslconfirmation">eQSL</th>';
} ?>

View File

@@ -70,6 +70,10 @@
<td><?= __("eQSL"); ?></td>
<td><div class="form-check"><input class="form-check-input" name="eqsl" type="checkbox" <?php if (($options->eqsl->show ?? "true") == "true") { echo 'checked'; } ?>></div></td>
</tr>
<tr>
<td><?= __("Clublog"); ?></td>
<td><div class="form-check"><input class="form-check-input" name="clublog" type="checkbox" <?php if (($options->clublog->show ?? "true") == "true") { echo 'checked'; } ?>></div></td>
</tr>
<tr>
<td><?= __("QSL Msg"); ?></td>
<td><div class="form-check"><input class="form-check-input" name="qslmsg" type="checkbox" <?php if (($options->qslmsg->show ?? "true") == "true") { echo 'checked'; } ?>></div></td>

View File

@@ -61,6 +61,9 @@ function updateRow(qso) {
if (user_options.qsl.show == "true"){
cells.eq(c++).html(qso.qsl);
}
if (user_options.clublog.show == "true"){
cells.eq(c++).html(qso.clublog);
}
if ($(".eqslconfirmation")[0] && user_options.eqsl.show == "true"){
cells.eq(c++).html(qso.eqsl);
}
@@ -184,6 +187,9 @@ function loadQSOTable(rows) {
if (user_options.qslvia.show == "true"){
data.push(qso.qslVia);
}
if (user_options.clublog.show == "true"){
data.push(qso.clublog);
}
if (user_options.qsl.show == "true"){
data.push(qso.qsl);
}
@@ -352,6 +358,8 @@ $(document).ready(function () {
ituzone: this.ituzone.value,
lotwSent: this.lotwSent.value,
lotwReceived: this.lotwReceived.value,
clublogSent: this.clublogSent.value,
clublogReceived: this.clublogReceived.value,
eqslSent: this.eqslSent.value,
eqslReceived: this.eqslReceived.value,
qslvia: $('[name="qslvia"]').val(),
@@ -1019,6 +1027,7 @@ function saveOptions() {
name: $('input[name="name"]').is(':checked') ? true : false,
qslvia: $('input[name="qslvia"]').is(':checked') ? true : false,
qsl: $('input[name="qsl"]').is(':checked') ? true : false,
clublog: $('input[name="clublog"]').is(':checked') ? true : false,
lotw: $('input[name="lotw"]').is(':checked') ? true : false,
eqsl: $('input[name="eqsl"]').is(':checked') ? true : false,
qslmsg: $('input[name="qslmsg"]').is(':checked') ? true : false,

View File

@@ -62,6 +62,7 @@ class QSO
private string $qsl;
private string $lotw;
private string $eqsl;
private string $clublog;
/** Lotw callsign info **/
private string $callsign;
private string $lastupload;
@@ -196,6 +197,7 @@ class QSO
$this->qsl = $this->getQslString($data, $custom_date_format);
$this->lotw = $this->getLotwString($data, $custom_date_format);
$this->eqsl = $this->getEqslString($data, $custom_date_format);
$this->clublog = $this->getClublogString($data, $custom_date_format);
$this->cqzone = ($data['COL_CQZ'] === null) ? '' : $this->geCqLink($data['COL_CQZ']);
$this->ituzone = $data['COL_ITUZ'] ?? '';
@@ -392,6 +394,41 @@ class QSO
/**
* @return string
*/
function getClublogString($data, $custom_date_format): string {
$CI =& get_instance();
$clublogstring = '<span ';
if ($data['COL_CLUBLOG_QSO_UPLOAD_STATUS'] == "Y") {
$clublogstring .= "title=\"".__("Clublog")." ".__("Sent");
if ($data['COL_CLUBLOG_QSO_UPLOAD_DATE'] != null) {
$timestamp = strtotime($data['COL_CLUBLOG_QSO_UPLOAD_DATE']);
$clublogstring .= " ".($timestamp!=''?date($custom_date_format, $timestamp):'');
}
$clublogstring .= "\" data-bs-toggle=\"tooltip\"";
}
$clublogstring .= ' class="clublog-' . (($data['COL_CLUBLOG_QSO_UPLOAD_STATUS'] =='Y') ? 'green':'red') . '">&#9650;</span><span ';
if ($data['COL_CLUBLOG_QSO_DOWNLOAD_STATUS'] == "Y") {
$clublogstring .= "title=\"".__("Clublog")." ".__("Received");
if ($data['COL_CLUBLOG_QSO_DOWNLOAD_DATE'] != null) {
$timestamp = strtotime($data['COL_CLUBLOG_QSO_DOWNLOAD_DATE']);
$clublogstring .= " ".($timestamp!=''?date($custom_date_format, $timestamp):'');
}
$clublogstring .= "\" data-bs-toggle=\"tooltip\"";
}
$clublogstring .= ' class="clublog-' . (($data['COL_CLUBLOG_QSO_DOWNLOAD_STATUS']=='Y') ? 'green':'red') . '">&#9660;</span>';
$clublogstring .= '</span>';
return $clublogstring;
}
function getEqslString($data, $custom_date_format): string
{
$CI =& get_instance();
@@ -752,6 +789,14 @@ class QSO
return $this->lotw;
}
/**
* @return string
*/
public function getclublog(): string
{
return $this->clublog;
}
/**
* @return string
*/
@@ -814,6 +859,7 @@ class QSO
'qsl' => $this->getqsl(),
'lotw' => $this->getlotw(),
'eqsl' => $this->geteqsl(),
'clublog' => $this->getclublog(),
'qslMessage' => $this->getQSLMsg(),
'name' => $this->getName(),
'dxcc' => $this->getDXCC(),