diff --git a/application/controllers/Api.php b/application/controllers/Api.php index 2eaf99a7..a69bd561 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -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() diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 736fc077..1bb0432c 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -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')), diff --git a/application/controllers/Qrz.php b/application/controllers/Qrz.php index 13d35421..68eb29db 100644 --- a/application/controllers/Qrz.php +++ b/application/controllers/Qrz.php @@ -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']); diff --git a/application/controllers/Update.php b/application/controllers/Update.php index 59c914de..cd56804c 100644 --- a/application/controllers/Update.php +++ b/application/controllers/Update.php @@ -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; } diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index e612c5ff..400b2197 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -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); } } diff --git a/application/models/Logbookadvanced_model.php b/application/models/Logbookadvanced_model.php index cc361181..8fb7f61d 100644 --- a/application/models/Logbookadvanced_model.php +++ b/application/models/Logbookadvanced_model.php @@ -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'] . '%'; diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php index 671ba95c..894e2483 100644 --- a/application/views/logbookadvanced/index.php +++ b/application/views/logbookadvanced/index.php @@ -144,6 +144,18 @@ +
+ + +
@@ -216,28 +228,41 @@
+
+ With selected : + + + + + + + + + + + + + + +
+
+
- With selected : - - - - - - - - - - - - - - - + Quick search with selected : + + + + + + + +
+ diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 16c76ea3..30882199 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -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; diff --git a/install/index.php b/install/index.php index 55d2ecdf..cc0e5d8b 100644 --- a/install/index.php +++ b/install/index.php @@ -131,8 +131,8 @@ if($_POST) {
Configuration Settings - " class="input_text" name="directory" /> - " class="input_text" name="websiteurl" /> + " class="input_text" name="directory" /> + " class="input_text" name="websiteurl" />
diff --git a/src/QSLManager/QSO.php b/src/QSLManager/QSO.php index 0e96988a..a8652461 100644 --- a/src/QSLManager/QSO.php +++ b/src/QSLManager/QSO.php @@ -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[] = '' . $this->dxVUCCGridsquares . ' ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare); } else if ($this->dxGridsquare !== '') { - $refs[] = $this->dxGridsquare . ' ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare); + $refs[] = '' . $this->dxGridsquare . ' ' .$this->getQrbLink($this->stationGridsquare, $this->dxVUCCGridsquares, $this->dxGridsquare); } if ($this->dxSOTAReference !== '') { $refs[] = "SOTA:" . $this->dxSOTAReference;