Merge branch 'dev' of github.com:int2001/Cloudlog into dev

这个提交包含在:
int2001 2023-07-05 14:26:47 +00:00
当前提交 c95f4e0ece
共有 10 个文件被更改,包括 140 次插入56 次删除

查看文件

@ -5,38 +5,7 @@ class API extends CI_Controller {
// Do absolutely nothing
function index()
{
}
/*
TODOs
- Search Callsign (Return Json)
- Add QSO return json
*/
function search_callsign($callsign) {
$this->db->select('COL_PRIMARY_KEY, COL_CALL, COL_MODE, COL_SUBMODE, COL_BAND, COL_COUNTRY, COL_FREQ, COL_GRIDSQUARE, COL_RST_RCVD, COL_RST_SENT, COL_SAT_MODE, COL_SAT_NAME');
//$this->db->select("DATE_FORMAT(COL_TIME_ON, '%H:%i') AS time_on", FALSE );
//$this->db->select("DATE_FORMAT(COL_TIME_ON, '%d/%c/%Y') AS date_on", FALSE );
$this->db->like('COL_CALL', $callsign);
$this->db->or_like('COL_GRIDSQUARE', $callsign);
$query = $this->db->get($this->config->item('table_name'));
$results = array();
foreach ($query->result() as $result)
{
$results[] = $result;
}
header('Content-type: application/json');
//$arr = array ('a'=>1,'b'=>2,'c'=>3,'d'=>4,'e'=>5);
echo $_GET['jsoncallback'].'('.json_encode($results).')'; //assign resulting code to $_GET['jsoncallback].
//echo json_encode($results);
echo "nothing to see";
}
function help()

查看文件

@ -104,6 +104,7 @@ class Logbookadvanced extends CI_Controller {
'propmode' => xss_clean($this->input->post('propmode')),
'gridsquare' => xss_clean($this->input->post('gridsquare')),
'state' => xss_clean($this->input->post('state')),
'cqzone' => xss_clean($this->input->post('cqzone')),
'qsoresults' => xss_clean($this->input->post('qsoresults')),
'sats' => xss_clean($this->input->post('sats')),
'lotwSent' => xss_clean($this->input->post('lotwSent')),

查看文件

@ -71,9 +71,15 @@ class Qrz extends CI_Controller {
$result = $this->logbook_model->push_qso_to_qrz($qrz_api_key, $adif);
}
if ($result['status'] == 'OK') {
if ( ($result['status'] == 'OK') || ( ($result['status'] == 'error') && ($result['message'] == 'STATUS=FAIL&REASON=Unable to add QSO to database: duplicate&EXTENDED=')) ){
$this->markqso($qso->COL_PRIMARY_KEY);
$i++;
} elseif ( ($result['status']=='error') && (substr($result['message'],0,11) == 'STATUS=AUTH')) {
log_message('error', 'QRZ upload failed for qso: Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON);
log_message('error', 'QRZ upload failed with the following message: ' .$result['message']);
log_message('error', 'QRZ upload stopped for Station_ID: ' .$station_id);
$errormessages[] = $result['message'] . ' Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON;
break; /* If key is invalid, immediate stop syncing for more QSOs of this station */
} else {
log_message('error', 'QRZ upload failed for qso: Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON);
log_message('error', 'QRZ upload failed with the following message: ' .$result['message']);

查看文件

@ -189,7 +189,7 @@ class Update extends CI_Controller {
gzclose($gz);
if (file_put_contents($this->make_update_path("cty.xml"), $data) === FALSE) {
$this->update_status("FAILED: Could not write to LoTW users file");
$this->update_status("FAILED: Could not write to cty.xml file");
return;
}

查看文件

@ -519,7 +519,7 @@ class Logbook_model extends CI_Model {
$adif = $CI->adifhelper->getAdifLine($qso[0]);
$result = $this->push_qso_to_qrz($result->qrzapikey, $adif);
if ($result['status'] == 'OK') {
if ( ($result['status'] == 'OK') || ( ($result['status'] == 'error') && ($result['message'] == 'STATUS=FAIL&REASON=Unable to add QSO to database: duplicate&EXTENDED=')) ){
$this->mark_qrz_qsos_sent($last_id);
}
}

查看文件

@ -89,6 +89,11 @@ class Logbookadvanced_model extends CI_Model {
$binding[] = $searchCriteria['state'];
}
if ($searchCriteria['cqzone'] !== '') {
$conditions[] = "COL_CQZ = ?";
$binding[] = $searchCriteria['cqzone'];
}
if ($searchCriteria['gridsquare'] !== '') {
$conditions[] = "(COL_GRIDSQUARE like ? or COL_VUCC_GRIDS like ?)";
$binding[] = '%' . $searchCriteria['gridsquare'] . '%';

查看文件

@ -144,6 +144,18 @@
<option value="TR">Tropospheric ducting</option>
</select>
</div>
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
<label class="form-label" for="cqzone">CQ Zone</label>
<select id="cqzone" name="cqzone" class="form-control form-control-sm">
<option value="">All</option>
<?php
for ($i = 1; $i<=40; $i++) {
echo '<option value="'. $i . '">'. $i .'</option>';
}
?>
?>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-lg-2 col-md-2 col-sm-3 col-xl">
@ -232,12 +244,25 @@
<button type="button" class="btn btn-sm btn-info mr-1" id="exportAdif">Create ADIF</button>
<button type="button" class="btn btn-sm btn-info mr-1" id="printLabel">Print Label</button>
<button type="button" class="btn btn-sm btn-danger mr-1" id="deleteQsos">Delete</button>
<span id="infoBox"></span>
</div>
</div>
<div class="quickfilterbody collapse">
<div class="mb-2">
<span class="h6">Quick search with selected :</span>
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchCallsign">Search Callsign</button>
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchDxcc">Search DXCC</button>
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchIota">Search IOTA</button>
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchState">Search State</button>
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchGridsquare">Search Gridsquare</button>
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchCqZone">Search CQ Zone</button>
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchMode">Search Mode</button>
<button type="button" class="btn btn-sm btn-primary mr-1" id="searchBand">Search Band</button>
</div>
</div>
</div>
<div class="form-row pt-2">
<div class="form-group form-inline col-lg d-flex flex-row justify-content-center align-items-center">
<button type="button" class="btn btn-sm btn-primary mr-1" data-toggle="collapse" data-target=".quickfilterbody">Quickfilters</button>
<button type="button" class="btn btn-sm btn-primary mr-1" data-toggle="collapse" data-target=".filterbody">Filters</button>
<button type="button" class="btn btn-sm btn-primary mr-1" data-toggle="collapse" data-target=".actionbody">Actions</button>
<label for="qsoResults" class="mr-2"># Results</label>

查看文件

@ -188,6 +188,7 @@ $(document).ready(function () {
state: this.state.value,
qsoresults: this.qsoResults.value,
sats: this.sats.value,
cqzone: this.cqzone.value,
lotwSent: this.lotwSent.value,
lotwReceived: this.lotwReceived.value,
eqslSent: this.eqslSent.value,
@ -359,6 +360,83 @@ $(document).ready(function () {
handleQslReceived('Y','D', 'receivedDirect');
});
$('#searchGridsquare').click(function (event) {
quickSearch('gridsquare');
});
$('#searchState').click(function (event) {
quickSearch('state');
});
$('#searchIota').click(function (event) {
quickSearch('iota');
});
$('#searchDxcc').click(function (event) {
quickSearch('dxcc');
});
$('#searchCallsign').click(function (event) {
quickSearch('dx');
});
$('#searchCqZone').click(function (event) {
quickSearch('cqzone');
});
$('#searchMode').click(function (event) {
quickSearch('mode');
});
$('#searchBand').click(function (event) {
quickSearch('band');
});
function quickSearch(type) {
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;
if (nElements == 0) {
return;
}
if (nElements > 1) {
BootstrapDialog.alert({
title: 'WARNING',
message: 'Only 1 row can be selected for Quickfilter!',
type: BootstrapDialog.TYPE_WARNING,
closable: false,
draggable: false,
callback: function (result) {
}
});
}
var offset = 0;
if (!$(".eqslconfirmation")[0]){
offset--;
}
if (!$(".lotwconfirmation")[0]){
offset--;
}
elements.each(function() {
var currentRow = $(this).first().closest('tr');
var col1 = '';
switch (type) {
case 'dxcc': var tdoffset = (offset + 16); col1 = currentRow.find("td:eq("+tdoffset+")").html(); col1 = col1.match(/\d/g); col1 = col1.join(""); break;
case 'cqzone': var tdoffset = (offset + 18); col1 = currentRow.find("td:eq("+tdoffset+")").text(); break;
case 'iota': var tdoffset = (offset + 19); col1 = currentRow.find("td:eq("+tdoffset+")").text(); col1 = col1.trim(); break;
case 'state': var tdoffset = (offset + 17); col1 = currentRow.find("td:eq("+tdoffset+")").text(); break;
case 'dx': col1 = currentRow.find("td:eq(3)").text(); col1 = col1.match(/^([^\s]+)/gm); break;
case 'gridsquare': col1 = $(currentRow).find('#dxgrid').text(); col1 = col1.substring(0, 4); break;
case 'mode': col1 = currentRow.find("td:eq(4)").text(); break;
case 'band': col1 = currentRow.find("td:eq(7)").text(); col1 = col1.match(/\S\w*/); break;
}
if (col1.length == 0) return;
$('#searchForm').trigger("reset");
$("#"+type).val(col1);
$('#searchForm').submit();
});
}
$('#printLabel').click(function (event) {
var elements = $('#qsoList tbody input:checked');
var nElements = elements.length;

查看文件

@ -131,8 +131,8 @@ if($_POST) {
<fieldset>
<legend>Configuration Settings</legend>
<label for="directory">Directory</label><input type="text" id="directory" value="<?php echo str_replace("/install/", "", $_SERVER['REQUEST_URI']); ?>" class="input_text" name="directory" />
<label for="websiteurl">Website URL</label><input type="text" id="websiteurl" value="<?php echo $_SERVER['REQUEST_SCHEME']; ?>://<?php echo $_SERVER['HTTP_HOST'].str_replace("/install/", "", $_SERVER['REQUEST_URI']); ?>" class="input_text" name="websiteurl" />
<label for="directory">Directory</label><input type="text" id="directory" value="<?php echo str_replace("index.php", "", str_replace("/install/", "", $_SERVER['REQUEST_URI'])); ?>" class="input_text" name="directory" />
<label for="websiteurl">Website URL</label><input type="text" id="websiteurl" value="<?php echo $_SERVER['REQUEST_SCHEME']; ?>://<?php echo str_replace("index.php", "", $_SERVER['HTTP_HOST'].str_replace("/install/", "", $_SERVER['REQUEST_URI'])); ?>" class="input_text" name="websiteurl" />
<label for="locator">Default Gridsquare</label><input type="text" id="locator" value="IO91JS" class="input_text" name="locator" />
</fieldset>

查看文件

@ -15,7 +15,7 @@ class QSO
private string $dx;
private string $mode;
private string $submode;
private string $band;
private ?string $band;
private string $bandRX;
private string $rstR;
private string $rstS;
@ -841,9 +841,9 @@ class QSO
{
$refs = [];
if ($this->dxVUCCGridsquares !== '') {
$refs[] = $this->dxVUCCGridsquares . ' ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare);
$refs[] = '<span id="dxgrid">' . $this->dxVUCCGridsquares . '</span> ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare);
} else if ($this->dxGridsquare !== '') {
$refs[] = $this->dxGridsquare . ' ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare);
$refs[] = '<span id="dxgrid">' . $this->dxGridsquare . '</span> ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare);
}
if ($this->dxSOTAReference !== '') {
$refs[] = "SOTA:" . $this->dxSOTAReference;