From 432467021003e45c40391d0d0963619e6ba5deef Mon Sep 17 00:00:00 2001 From: Christoph Kottke Date: Thu, 30 Mar 2023 11:38:28 +0200 Subject: [PATCH 01/30] update sample config --- application/config/config.sample.php | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/application/config/config.sample.php b/application/config/config.sample.php index 07ec0576..e925b1f3 100644 --- a/application/config/config.sample.php +++ b/application/config/config.sample.php @@ -8,7 +8,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); |-------------------------------------------------------------------------- | | 'app_name' Name of the App 'Cloudlog' -| 'app_version' Set by the dev team. +| 'app_version' Set by the dev team. | 'directory' directory where cloudlog is installed eg "logger" | 'callbook' Selects which Callbook lookup to use defaults "hamqth" but supports "qrz" */ @@ -16,9 +16,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $config['app_name'] = "Cloudlog"; $config['app_version'] = "2.4.2"; $config['directory'] = "logbook"; - $config['callbook'] = "hamqth"; // Options are hamqth or qrz - $config['datadir'] = null; // default to install directory /* @@ -27,8 +25,8 @@ $config['datadir'] = null; // default to install directory |-------------------------------------------------------------------------- | | 'table_name' SQL table where log can be found -| 'locator' Default locator used to calculate bearings/distance -| 'display_freq' Show or Hide frequnecy info +| 'locator' Default locator used to calculate bearings/distance +| 'display_freq' Show or Hide frequnecy info */ $config['table_name'] = "TABLE_HRD_CONTACTS_V01"; @@ -42,11 +40,12 @@ $config['display_freq'] = true; | | 'qrz_username' QRZ.com user login | 'qrz_password' QRZ.com user password +| 'use_fullname' Get full names from QRZ, may not be GDPR compliant */ $config['qrz_username'] = ""; $config['qrz_password'] = ""; - +$config['use_fullname'] = false; /* |-------------------------------------------------------------------------- @@ -59,7 +58,6 @@ $config['qrz_password'] = ""; $config['hamqth_username'] = ""; $config['hamqth_password'] = ""; - /* |-------------------------------------------------------------------------- | Authentication @@ -67,7 +65,7 @@ $config['hamqth_password'] = ""; | | 'use_auth' False turns all authentication off, best used when setting up | 'auth_table' MySQL Database Table defaults "users" -| 'auth_mode' Minimum user level required 0 = anonymous, 1 = viewer, +| 'auth_mode' Minimum user level required 0 = anonymous, 1 = viewer, | 2 = editor, 3 = api user, 99 = owner | 'auth_level[]' Defines level titles */ @@ -568,6 +566,7 @@ $config['compress_output'] = FALSE; */ $config['time_reference'] = 'UTC'; date_default_timezone_set($config['time_reference']); + /* |-------------------------------------------------------------------------- | Rewrite PHP Short Tags From 397a60d08384eafbaaedbc903dae6449114c4be2 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Fri, 26 May 2023 10:38:31 +0200 Subject: [PATCH 02/30] [LoTW] Added table with users. Query to find unconfirmed QSOs and L marking in advanced logbook --- application/config/migration.php | 2 +- application/controllers/Logbook.php | 36 +++++++++++++ application/controllers/Search.php | 12 +++++ application/controllers/Update.php | 44 ++++++++++++++-- application/migrations/123_add_lotw_users.php | 41 +++++++++++++++ application/models/Logbookadvanced_model.php | 1 + application/views/interface_assets/footer.php | 23 +++++++++ application/views/search/cqzones.php | 4 +- application/views/search/duplicates.php | 4 +- application/views/search/filter.php | 4 +- application/views/search/lotw_unconfirmed.php | 50 +++++++++++++++++++ .../views/search/lotw_unconfirmed_result.php | 43 ++++++++++++++++ application/views/search/main.php | 3 ++ assets/js/sections/logbookadvanced.js | 4 +- src/QSLManager/QSO.php | 7 +++ 15 files changed, 269 insertions(+), 9 deletions(-) create mode 100644 application/migrations/123_add_lotw_users.php create mode 100644 application/views/search/lotw_unconfirmed.php create mode 100644 application/views/search/lotw_unconfirmed_result.php diff --git a/application/config/migration.php b/application/config/migration.php index 372fbaf2..c4ac8962 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 122; +$config['migration_version'] = 123; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 548ecafd..66ae7b81 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -814,6 +814,42 @@ class Logbook extends CI_Controller { } + function search_lotw_unconfirmed($station_id) { + $station_id = $this->security->xss_clean($station_id); + + $this->load->model('user_model'); + + if(!$this->user_model->authorize($this->config->item('auth_mode'))) { return; } + + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + + if (!$logbooks_locations_array) { + return null; + } + + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = 'select COL_CALL, COL_MODE, COL_SUBMODE, station_callsign, COL_SAT_NAME, COL_BAND, COL_TIME_ON, lotw_users.lastupload from ' . $this->config->item('table_name') . + ' join station_profile on ' . $this->config->item('table_name') . '.station_id = station_profile.station_id + join lotw_users on ' . $this->config->item('table_name') . '.col_call = lotw_users.callsign + where ' . $this->config->item('table_name') .'.station_id in ('. $location_list . ')'; + + if ($station_id != 'All') { + $sql .= ' and station_profile.station_id = ' . $station_id; + } + + $sql .= " and COL_LOTW_QSL_RCVD <> 'Y' and " . $this->config->item('table_name') . ".COL_TIME_ON < lotw_users.lastupload"; + + $query = $this->db->query($sql); + + $data['qsos'] = $query; + + $this->load->view('search/lotw_unconfirmed_result.php', $data); + + } + function search_incorrect_cq_zones($station_id) { $station_id = $this->security->xss_clean($station_id); diff --git a/application/controllers/Search.php b/application/controllers/Search.php index af43c511..f503d059 100644 --- a/application/controllers/Search.php +++ b/application/controllers/Search.php @@ -80,6 +80,18 @@ class Search extends CI_Controller { $this->load->view('interface_assets/footer'); } + // Searches for unconfirmed Lotw QSOs where QSO partner has uploaded to LoTW after the QSO date + public function lotw_unconfirmed() { + $this->load->model('stations'); + + $data['station_profile'] = $this->stations->all_of_user(); + $data['page_title'] = "QSOs unconfirmed on LoTW, but the callsign has uploaded to LoTW after QSO date"; + + $this->load->view('interface_assets/header', $data); + $this->load->view('search/lotw_unconfirmed'); + $this->load->view('interface_assets/footer'); + } + function json_result() { if(isset($_POST['search'])) { $result = $this->fetchQueryResult($_POST['search'], false); diff --git a/application/controllers/Update.php b/application/controllers/Update.php index 81c3f509..d6cd88c3 100644 --- a/application/controllers/Update.php +++ b/application/controllers/Update.php @@ -287,9 +287,6 @@ class Update extends CI_Controller { } public function download_lotw_users() { - - - $contents = file_get_contents('https://lotw.arrl.org/lotw-user-activity.csv', true); if($contents === FALSE) { @@ -306,6 +303,47 @@ class Update extends CI_Controller { } + public function lotw_users() { + $mtime = microtime(); + $mtime = explode(" ",$mtime); + $mtime = $mtime[1] + $mtime[0]; + $starttime = $mtime; + + $file = 'https://lotw.arrl.org/lotw-user-activity.csv'; + + $handle = fopen($file, "r"); + if ($handle === FALSE) { + echo "Something went wrong with fetching the LoTW uses file"; + return; + } + $this->db->empty_table("lotw_users"); + $i = 0; + $data = fgetcsv($handle,1000,","); + do { + if ($data[0]) { + $lotwdata[$i]['callsign'] = $data[0]; + $lotwdata[$i]['lastupload'] = $data[1] . ' ' . $data[2]; + if (($i % 2000) == 0) { + $this->db->insert_batch('lotw_users', $lotwdata); + unset($lotwdata); + // echo 'Record ' . $i . '
'; + } + $i++; + } + } while ($data = fgetcsv($handle,1000,",")); + fclose($handle); + + $this->db->insert_batch('lotw_users', $lotwdata); + + $mtime = microtime(); + $mtime = explode(" ",$mtime); + $mtime = $mtime[1] + $mtime[0]; + $endtime = $mtime; + $totaltime = ($endtime - $starttime); + echo "This page was created in ".$totaltime." seconds
"; + echo "Records inserted: " . $i . "
"; + } + public function lotw_check() { $f = fopen('./updates/lotw_users.csv', "r"); $result = false; diff --git a/application/migrations/123_add_lotw_users.php b/application/migrations/123_add_lotw_users.php new file mode 100644 index 00000000..84709a76 --- /dev/null +++ b/application/migrations/123_add_lotw_users.php @@ -0,0 +1,41 @@ +db->table_exists('lotw_users')) { + $this->dbforge->add_field(array( + 'id' => array( + 'type' => 'INT', + 'constraint' => 20, + 'unsigned' => TRUE, + 'auto_increment' => TRUE, + 'unique' => TRUE + ), + 'callsign' => array( + 'type' => 'VARCHAR', + 'constraint' => 32, + 'unsigned' => TRUE, + ), + 'lastupload' => array( + 'type' => 'timestamp', + 'unsigned' => TRUE, + ) + )); + + $this->dbforge->add_key('id', TRUE); + + $this->dbforge->create_table('lotw_users'); + + $this->db->query("ALTER TABLE lotw_users ADD INDEX `callsign` (`callsign`)"); + } + + } + + public function down() + { + $this->dbforge->drop_table('lotw_users'); + } +} diff --git a/application/models/Logbookadvanced_model.php b/application/models/Logbookadvanced_model.php index 437f4f7a..f0571352 100644 --- a/application/models/Logbookadvanced_model.php +++ b/application/models/Logbookadvanced_model.php @@ -100,6 +100,7 @@ class Logbookadvanced_model extends CI_Model { FROM " . $this->config->item('table_name') . " qsos INNER JOIN station_profile ON qsos.station_id=station_profile.station_id LEFT OUTER JOIN dxcc_entities ON qsos.col_dxcc=dxcc_entities.adif + LEFT OUTER JOIN lotw_users ON qsos.col_call=lotw_users.callsign WHERE station_profile.user_id = ? $where ORDER BY qsos.COL_TIME_ON desc, qsos.COL_PRIMARY_KEY desc diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 4430a9c0..4e7741e2 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -816,6 +816,29 @@ function findduplicates(){ }); } +function findlotwunconfirmed(){ + event.preventDefault(); + $('#partial_view').load(base_url+"index.php/logbook/search_lotw_unconfirmed/"+$("#station_id").val(), function() { + $('.qsolist').DataTable({ + "pageLength": 25, + responsive: false, + ordering: false, + "scrollY": "500px", + "scrollCollapse": true, + "paging": false, + "scrollX": true, + dom: 'Bfrtip', + buttons: [ + 'csv' + ] + }); + // change color of csv-button if dark mode is chosen + if (isDarkModeTheme()) { + $(".buttons-csv").css("color", "white"); + } + }); +} + function findincorrectcqzones() { event.preventDefault(); $('#partial_view').load(base_url+"index.php/logbook/search_incorrect_cq_zones/"+$("#station_id").val(), function() { diff --git a/application/views/search/cqzones.php b/application/views/search/cqzones.php index 309d074a..ca90566a 100644 --- a/application/views/search/cqzones.php +++ b/application/views/search/cqzones.php @@ -17,9 +17,11 @@ - + diff --git a/application/views/search/duplicates.php b/application/views/search/duplicates.php index b5580ab0..714d61da 100644 --- a/application/views/search/duplicates.php +++ b/application/views/search/duplicates.php @@ -17,9 +17,11 @@ - + diff --git a/application/views/search/filter.php b/application/views/search/filter.php index cd963d06..e1a69fe2 100644 --- a/application/views/search/filter.php +++ b/application/views/search/filter.php @@ -25,9 +25,11 @@ - + diff --git a/application/views/search/lotw_unconfirmed.php b/application/views/search/lotw_unconfirmed.php new file mode 100644 index 00000000..dbeea970 --- /dev/null +++ b/application/views/search/lotw_unconfirmed.php @@ -0,0 +1,50 @@ + diff --git a/application/views/search/lotw_unconfirmed_result.php b/application/views/search/lotw_unconfirmed_result.php new file mode 100644 index 00000000..ee28cd3d --- /dev/null +++ b/application/views/search/lotw_unconfirmed_result.php @@ -0,0 +1,43 @@ +result() != NULL) { + echo ' + + + + + + + + + + '; + + // Get Date format + if($this->session->userdata('user_date_format')) { + // If Logged in and session exists + $custom_date_format = $this->session->userdata('user_date_format'); + } else { + // Get Default date format from /config/cloudlog.php + $custom_date_format = $this->config->item('qso_date_format'); + } + + $i = 0; + foreach ($qsos->result() as $qso) { + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } + + echo '
'.lang('gen_hamradio_callsign').'Date / time' . lang('gen_hamradio_mode') . '' . lang('gen_hamradio_band') . 'Last LoTW upload' . lang('gen_hamradio_station') . '
' . $qso->COL_CALL . '
' . $qso->COL_TIME_ON . ''; echo $qso->COL_SUBMODE==null?$qso->COL_MODE:$qso->COL_SUBMODE; echo ''; if($qso->COL_SAT_NAME != null) { echo $qso->COL_SAT_NAME; } else { echo strtolower($qso->COL_BAND); }; echo '' . $qso->lastupload . '' . $qso->station_callsign . '
'; + ?> + + ×No duplicate QSO\'s were found.'; +} +?> \ No newline at end of file diff --git a/application/views/search/main.php b/application/views/search/main.php index fac5395c..47e2161d 100644 --- a/application/views/search/main.php +++ b/application/views/search/main.php @@ -19,6 +19,9 @@ + diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 910148ee..4040c594 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -26,7 +26,7 @@ function updateRow(qso) { let c = 1; cells.eq(c++).text(qso.qsoDateTime); cells.eq(c++).text(qso.de); - cells.eq(c++).html(''+qso.dx+''); + cells.eq(c++).html(''+qso.dx+'' + (qso.callsign == '' ? '' : ' L')); cells.eq(c++).text(qso.mode); cells.eq(c++).text(qso.rstS); cells.eq(c++).text(qso.rstR); @@ -81,7 +81,7 @@ function loadQSOTable(rows) { data.push('
'); data.push(qso.qsoDateTime); data.push(qso.de); - data.push(''+qso.dx+''); + data.push(''+qso.dx+'' + (qso.callsign == '' ? '' : ' L')); data.push(qso.mode); data.push(qso.rstS); data.push(qso.rstR); diff --git a/src/QSLManager/QSO.php b/src/QSLManager/QSO.php index 64b87501..7edf070b 100644 --- a/src/QSLManager/QSO.php +++ b/src/QSLManager/QSO.php @@ -59,6 +59,9 @@ class QSO private string $qsl; private string $lotw; private string $eqsl; + /** Lotw callsign info **/ + private string $callsign; + private string $lastupload; /** * @param array $data Does no validation, it's assumed to be a row from the database in array format @@ -191,6 +194,8 @@ class QSO } else { $this->end = null; } + $this->callsign = ($data['callsign'] === null) ? '' :$data['callsign']; + $this->lastupload = ($data['lastupload'] === null) ? '' :$data['lastupload']; } /** @@ -769,6 +774,8 @@ class QSO 'cqzone' => $this->getCqzone(), 'iota' => $this->getIOTA(), 'end' => $this->end === null ? null : $this->end->format("Y-m-d"), + 'callsign' => $this->callsign, + 'lastupload' => $this->lastupload, ]; } From 4a60b691541d3349d437e2e5ea9b944a43dc0d80 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 26 May 2023 15:22:31 +0200 Subject: [PATCH 03/30] Use datetime for db column and fix typos --- application/migrations/123_add_lotw_users.php | 5 +++-- application/views/adif/import.php | 2 +- application/views/search/cqzones.php | 2 +- application/views/search/duplicates.php | 2 +- application/views/search/filter.php | 2 +- application/views/search/lotw_unconfirmed.php | 2 +- application/views/search/lotw_unconfirmed_result.php | 4 ++-- application/views/search/main.php | 2 +- 8 files changed, 11 insertions(+), 10 deletions(-) diff --git a/application/migrations/123_add_lotw_users.php b/application/migrations/123_add_lotw_users.php index 84709a76..9afa6a39 100644 --- a/application/migrations/123_add_lotw_users.php +++ b/application/migrations/123_add_lotw_users.php @@ -20,8 +20,7 @@ class Migration_add_lotw_users extends CI_Migration 'unsigned' => TRUE, ), 'lastupload' => array( - 'type' => 'timestamp', - 'unsigned' => TRUE, + 'type' => 'datetime', ) )); @@ -36,6 +35,8 @@ class Migration_add_lotw_users extends CI_Migration public function down() { + if ($this->db->table_exists('lotw_users')) { $this->dbforge->drop_table('lotw_users'); + } } } diff --git a/application/views/adif/import.php b/application/views/adif/import.php index 779bd48d..c2c36fac 100644 --- a/application/views/adif/import.php +++ b/application/views/adif/import.php @@ -148,7 +148,7 @@
Export Satellite-Only QSOs

Export All Satellite QSOs

-

Export All Satellite QSOs Confirmed on LoTW

+

Export All Satellite QSOs Confirmed on LoTW

diff --git a/application/views/search/cqzones.php b/application/views/search/cqzones.php index ca90566a..9a5867ab 100644 --- a/application/views/search/cqzones.php +++ b/application/views/search/cqzones.php @@ -21,7 +21,7 @@ Incorrect CQ Zones diff --git a/application/views/search/duplicates.php b/application/views/search/duplicates.php index 714d61da..22bcde5b 100644 --- a/application/views/search/duplicates.php +++ b/application/views/search/duplicates.php @@ -21,7 +21,7 @@ Incorrect CQ Zones diff --git a/application/views/search/filter.php b/application/views/search/filter.php index e1a69fe2..a3174a2c 100644 --- a/application/views/search/filter.php +++ b/application/views/search/filter.php @@ -29,7 +29,7 @@ Incorrect CQ Zones diff --git a/application/views/search/lotw_unconfirmed.php b/application/views/search/lotw_unconfirmed.php index dbeea970..2fa3f0e4 100644 --- a/application/views/search/lotw_unconfirmed.php +++ b/application/views/search/lotw_unconfirmed.php @@ -21,7 +21,7 @@ Incorrect CQ Zones diff --git a/application/views/search/lotw_unconfirmed_result.php b/application/views/search/lotw_unconfirmed_result.php index ee28cd3d..4767684c 100644 --- a/application/views/search/lotw_unconfirmed_result.php +++ b/application/views/search/lotw_unconfirmed_result.php @@ -38,6 +38,6 @@ if ($qsos->result() != NULL) { ×No duplicate QSO\'s were found.'; + echo '
×No QSOs with outstanding LoTW upload were found.
'; } -?> \ No newline at end of file +?> diff --git a/application/views/search/main.php b/application/views/search/main.php index 47e2161d..78d36a6c 100644 --- a/application/views/search/main.php +++ b/application/views/search/main.php @@ -21,7 +21,7 @@ Incorrect CQ Zones From 93c5937da451e0c559896637b676301d182a9b8e Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 27 May 2023 10:06:30 +0200 Subject: [PATCH 04/30] [QSO Display] Added Lotw info in popup --- application/language/english/lotw_lang.php | 3 +++ application/language/german/lotw_lang.php | 3 +++ application/models/Logbook_model.php | 4 ++-- application/views/view_log/qso.php | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/application/language/english/lotw_lang.php b/application/language/english/lotw_lang.php index dd062ab7..26f942b0 100644 --- a/application/language/english/lotw_lang.php +++ b/application/language/english/lotw_lang.php @@ -57,3 +57,6 @@ $lang['lotw_confirmed'] = 'This QSO is confirmed on LoTW'; // LoTW Expiry $lang['lotw_cert_expiring'] = 'At least one of your LoTW certificates is about to expire!'; $lang['lotw_cert_expired'] = 'At least one of your LoTW certificates is expired!'; + +// Lotw User +$lang['lotw_user'] = 'This station uses LoTW. The last upload was'; diff --git a/application/language/german/lotw_lang.php b/application/language/german/lotw_lang.php index 2a2a7f58..2e01e3b0 100644 --- a/application/language/german/lotw_lang.php +++ b/application/language/german/lotw_lang.php @@ -57,3 +57,6 @@ $lang['lotw_confirmed'] = 'Dieses QSO wurde via LoTW bestätigt am'; // LoTW Expiry $lang['lotw_cert_expiring'] = 'Mindestens eines deiner LoTW Zertifikate läuft bald ab!'; $lang['lotw_cert_expired'] = 'Mindestens eines deiner LoTW Zertifikate ist abgelaufen!'; + +// Lotw User +$lang['lotw_user'] = 'Diese Station nutzt LoTW. Der letzte Upload war am'; \ No newline at end of file diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index bfed414a..bc794378 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1295,13 +1295,13 @@ class Logbook_model extends CI_Model { } function get_qso($id) { - $this->db->select($this->config->item('table_name').'.*, station_profile.*, dxcc_entities.*, dxcc_entities_2.name as station_country, dxcc_entities_2.end as station_end'); - $this->db->select($this->config->item('table_name').'.*, station_profile.*, dxcc_entities.*, coalesce(dxcc_entities_2.name, "- NONE -") as station_country, dxcc_entities_2.end as station_end, eQSL_images.image_file as eqsl_image_file'); + $this->db->select($this->config->item('table_name').'.*, station_profile.*, dxcc_entities.*, coalesce(dxcc_entities_2.name, "- NONE -") as station_country, dxcc_entities_2.end as station_end, eQSL_images.image_file as eqsl_image_file, lotw_users.callsign as lotwuser, lotw_users.lastupload'); $this->db->from($this->config->item('table_name')); $this->db->join('dxcc_entities', $this->config->item('table_name').'.col_dxcc = dxcc_entities.adif', 'left'); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id', 'left'); $this->db->join('dxcc_entities as dxcc_entities_2', 'station_profile.station_dxcc = dxcc_entities_2.adif', 'left outer'); $this->db->join('eQSL_images', $this->config->item('table_name').'.COL_PRIMARY_KEY = eQSL_images.qso_id', 'left outer'); + $this->db->join('lotw_users', $this->config->item('table_name').'.COL_CALL = lotw_users.callsign', 'left outer'); $this->db->where('COL_PRIMARY_KEY', $id); return $this->db->get(); diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index 3a255063..e7475cbf 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -353,6 +353,9 @@ + lotwuser != null) { ?> +

lastupload); echo date($custom_date_format, $timestamp); $timestamp = strtotime($row->lastupload); echo " at ".date('H:i', $timestamp);?> UTC.

+ COL_LOTW_QSL_RCVD == "Y") { ?>

From 6787c62caa469e36bddf5d053c2413a32fea8c42 Mon Sep 17 00:00:00 2001 From: phl0 Date: Sat, 27 May 2023 14:52:55 +0200 Subject: [PATCH 05/30] Make contest table use padding for SRX and STX --- assets/js/sections/contesting.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/assets/js/sections/contesting.js b/assets/js/sections/contesting.js index 6d37d09f..c2b0b2d9 100644 --- a/assets/js/sections/contesting.js +++ b/assets/js/sections/contesting.js @@ -528,7 +528,21 @@ function restoreContestSession(data) { "scrollCollapse": true, "paging": false, "scrollX": true, - order: [0, 'desc'] + order: [0, 'desc'], + "columnDefs": [ + { + "render": function ( data, type, row ) { + return pad(row[8],3); + }, + "targets" : 8 + }, + { + "render": function ( data, type, row ) { + return pad(row[9],3); + }, + "targets" : 9 + } + ] }); } } @@ -538,3 +552,8 @@ function restoreContestSession(data) { $("#exch_serial_s").val("1"); } } + +function pad (str, max) { + str = str.toString(); + return str.length < max ? pad("0" + str, max) : str; +} From 0a64fae50f12081ecfe44b66e05d9da9ee94896d Mon Sep 17 00:00:00 2001 From: phl0 Date: Sat, 27 May 2023 15:29:20 +0200 Subject: [PATCH 06/30] Add some space before search box --- application/views/contesting/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/views/contesting/index.php b/application/views/contesting/index.php index 8fd63e2f..f4f3ea14 100644 --- a/application/views/contesting/index.php +++ b/application/views/contesting/index.php @@ -180,6 +180,7 @@
+

From 56899375e5db1f3f5398a698e14e60330f3a41a7 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 27 May 2023 18:04:09 +0200 Subject: [PATCH 07/30] [Advanced Logbook] Added formatting of date/time and country name --- src/QSLManager/QSO.php | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/QSLManager/QSO.php b/src/QSLManager/QSO.php index 7edf070b..9558ff8b 100644 --- a/src/QSLManager/QSO.php +++ b/src/QSLManager/QSO.php @@ -10,7 +10,7 @@ use DomainException; class QSO { private string $qsoID; - private DateTime $qsoDateTime; + private string $qsoDateTime; private string $de; private string $dx; private string $mode; @@ -123,7 +123,16 @@ class QSO $this->qsoID = $data['COL_PRIMARY_KEY']; - $this->qsoDateTime = DateTime::createFromFormat("Y-m-d H:i:s", $data['COL_TIME_ON'], new DateTimeZone("UTC")); + $CI =& get_instance(); + // Get Date format + if($CI->session->userdata('user_date_format')) { + // If Logged in and session exists + $custom_date_format = $CI->session->userdata('user_date_format'); + } else { + // Get Default date format from /config/cloudlog.php + $custom_date_format = $CI->config->item('qso_date_format'); + } + $this->qsoDateTime = date($custom_date_format . " H:i", strtotime($data['COL_TIME_ON'])); $this->de = $data['COL_STATION_CALLSIGN']; $this->dx = $data['COL_CALL']; @@ -170,16 +179,6 @@ class QSO $this->QSLSent = ($data['COL_QSL_SENT'] === null) ? '' : $data['COL_QSL_SENT']; $this->QSLSentVia = ($data['COL_QSL_SENT_VIA'] === null) ? '' : $data['COL_QSL_SENT_VIA']; $this->QSLVia = ($data['COL_QSL_VIA'] === null) ? '' : $data['COL_QSL_VIA']; - - $CI =& get_instance(); - // Get Date format - if($CI->session->userdata('user_date_format')) { - // If Logged in and session exists - $custom_date_format = $CI->session->userdata('user_date_format'); - } else { - // Get Default date format from /config/cloudlog.php - $custom_date_format = $CI->config->item('qso_date_format'); - } $this->qsl = $this->getQslString($data, $custom_date_format); $this->lotw = $this->getLotwString($data, $custom_date_format); @@ -187,7 +186,7 @@ class QSO $this->cqzone = ($data['COL_CQZ'] === null) ? '' : $data['COL_CQZ']; $this->state = ($data['COL_STATE'] === null) ? '' :$data['COL_STATE']; - $this->dxcc = ($data['name'] === null) ? '- NONE -' :$data['name']; + $this->dxcc = ($data['name'] === null) ? '- NONE -' : ucwords(strtolower($data['name']), "- (/"); $this->iota = ($data['COL_IOTA'] === null) ? '' :$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')); @@ -413,7 +412,7 @@ class QSO /** * @return DateTime */ - public function getQsoDateTime(): DateTime + public function getQsoDateTime(): string { return $this->qsoDateTime; } @@ -754,7 +753,7 @@ class QSO { return [ 'qsoID' => $this->qsoID, - 'qsoDateTime' => $this->qsoDateTime->format("Y-m-d H:i"), + 'qsoDateTime' => $this->qsoDateTime, 'de' => $this->de, 'dx' => $this->dx, 'mode' => $this->getFormattedMode(), From 8616cea9edaedd268d6b893641b5b459de1d6fa9 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 27 May 2023 18:14:29 +0200 Subject: [PATCH 08/30] [LoTW mouse over] Formatted date --- src/QSLManager/QSO.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/QSLManager/QSO.php b/src/QSLManager/QSO.php index 9558ff8b..a64bd402 100644 --- a/src/QSLManager/QSO.php +++ b/src/QSLManager/QSO.php @@ -194,7 +194,8 @@ class QSO $this->end = null; } $this->callsign = ($data['callsign'] === null) ? '' :$data['callsign']; - $this->lastupload = ($data['lastupload'] === null) ? '' :$data['lastupload']; + $this->lastupload = ($data['lastupload'] === null) ? '' : date($custom_date_format . " H:i", strtotime($data['lastupload'])); + } /** From fc9358933ac937165d21ab7bbe94214dbbf3a308 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 27 May 2023 19:05:11 +0200 Subject: [PATCH 09/30] [Advanced Logbook] Fixed sorting for custom date format --- application/controllers/Logbookadvanced.php | 26 ++++++++++++++++++++- application/views/logbookadvanced/index.php | 9 +++++++ assets/js/sections/logbookadvanced.js | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php index 6f054479..19daff37 100644 --- a/application/controllers/Logbookadvanced.php +++ b/application/controllers/Logbookadvanced.php @@ -49,11 +49,35 @@ class Logbookadvanced extends CI_Controller { $pageData['sats'] = $this->bands->get_worked_sats(); $pageData['bands'] = $this->bands->get_worked_bands(); - + + $CI =& get_instance(); + // Get Date format + if($CI->session->userdata('user_date_format')) { + // If Logged in and session exists + $pageData['custom_date_format'] = $CI->session->userdata('user_date_format'); + } else { + // Get Default date format from /config/cloudlog.php + $pageData['custom_date_format'] = $CI->config->item('qso_date_format'); + } + + switch ($pageData['custom_date_format']) { + case "d/m/y": $pageData['custom_date_format'] = 'DD/MM/YY'; break; + case "d/m/Y": $pageData['custom_date_format'] = 'DD/MM/YYYY'; break; + case "m/d/y": $pageData['custom_date_format'] = 'MM/DD/YY'; break; + case "m/d/Y": $pageData['custom_date_format'] = 'MM/DD/YYYY'; break; + case "d.m.Y": $pageData['custom_date_format'] = 'DD.MM.YYYY'; break; + case "y/m/d": $pageData['custom_date_format'] = 'YY/MM/DD'; break; + case "Y-m-d": $pageData['custom_date_format'] = 'YYYY-MM-DD'; break; + case "M d, Y": $pageData['custom_date_format'] = 'MMM DD, YYYY'; break; + case "M d, y": $pageData['custom_date_format'] = 'MMM DD, YY'; break; + default: $pageData['custom_date_format'] = 'DD/MM/YYYY'; + } + $footerData = []; $footerData['scripts'] = [ 'assets/js/moment.min.js', 'assets/js/tempusdominus-bootstrap-4.min.js', + 'assets/js/datetime-moment.js', 'assets/js/sections/logbookadvanced.js?' . filemtime(realpath(__DIR__ . "/../../assets/js/sections/logbookadvanced.js")) ]; diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php index 42c0438c..ed417d8b 100644 --- a/application/views/logbookadvanced/index.php +++ b/application/views/logbookadvanced/index.php @@ -1,3 +1,12 @@ + +
session->flashdata('message')) { ?> diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 4040c594..58cb8482 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -58,6 +58,7 @@ function loadQSOTable(rows) { }); uninitialized.each(function() { + $.fn.dataTable.moment(custom_date_format + ' HH:mm'); $(this).DataTable({ searching: false, responsive: false, @@ -66,7 +67,6 @@ function loadQSOTable(rows) { "scrollCollapse": true, "paging": false, "scrollX": true, - "order": [ 1, 'desc' ], }); }); From c5c7e79955724ba9656ff18b4cd4d634057d2f5e Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sat, 27 May 2023 22:09:44 +0100 Subject: [PATCH 10/30] [LoTW] use Ajax for manual sync When you click the LoTW manual sync button it now loads the contents into the page using ajax get request using htmx. --- application/views/lotw_views/index.php | 6 +++++- assets/css/general.css | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/application/views/lotw_views/index.php b/application/views/lotw_views/index.php index 447a498d..fcdca862 100644 --- a/application/views/lotw_views/index.php +++ b/application/views/lotw_views/index.php @@ -122,7 +122,11 @@
-

+ + +
diff --git a/assets/css/general.css b/assets/css/general.css index 24536bfc..344c7a04 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -436,4 +436,8 @@ div#station_logbooks_linked_table_paginate { .w-qsl{ max-height: calc(100vh - 270px); overflow-y: auto; +} + +#lotw_manual_results { + padding-top: 10px; } \ No newline at end of file From 8354bf609ff21b17319e149895c77e9cd87bfff8 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sat, 27 May 2023 22:12:12 +0100 Subject: [PATCH 11/30] [LoTW] Makes the cert table fill the card box rather than have a border --- application/views/lotw_views/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/lotw_views/index.php b/application/views/lotw_views/index.php index fcdca862..0ce0a3d5 100644 --- a/application/views/lotw_views/index.php +++ b/application/views/lotw_views/index.php @@ -9,7 +9,7 @@ -
+
'; - echo ''; + echo ''; echo ''; From e8c62a26cf99e737463e7f35498f175d3085526c Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sun, 28 May 2023 15:02:15 +0100 Subject: [PATCH 13/30] [Dashboard] Update radio frequency display every 5 seconds --- application/controllers/Dashboard.php | 7 ++++++ .../views/components/radio_display_table.php | 23 +++++++++++++++++++ application/views/dashboard/index.php | 23 +------------------ 3 files changed, 31 insertions(+), 22 deletions(-) create mode 100644 application/views/components/radio_display_table.php diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index 8a497343..afc0132d 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -114,6 +114,13 @@ class Dashboard extends CI_Controller { } + function radio_display_component() { + $this->load->model('cat'); + + $data['radio_status'] = $this->cat->recent_status(); + $this->load->view('components/radio_display_table', $data); + } + function map() { $this->load->model('logbook_model'); diff --git a/application/views/components/radio_display_table.php b/application/views/components/radio_display_table.php new file mode 100644 index 00000000..e27c5154 --- /dev/null +++ b/application/views/components/radio_display_table.php @@ -0,0 +1,23 @@ +num_rows()) { ?> + +
' . $qsl->COL_CALL . '' . $qsl->COL_CALL . ''; echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; echo '
+ + + + + result_array() as $row) { ?> + + + + + + +
Radio Status
+ + + + frequency->hz_to_mhz($row['frequency']); ?> () + +
+ + \ No newline at end of file diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 1f2cc0ef..432431fd 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -160,29 +160,8 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {

- num_rows()) { ?> - - - - - - result_array() as $row) { ?> - - - - - - -
Radio Status
- - - - frequency->hz_to_mhz($row['frequency']); ?> () - -
- - +
From 82ab5ac29d40954733eca032b817c26792b0e6b2 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sun, 28 May 2023 15:05:16 +0100 Subject: [PATCH 14/30] [Dashboard] Load the radio table on page load --- application/views/dashboard/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 432431fd..2da9c8c6 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -161,7 +161,7 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
-
+
From 857f8b2485fc78d6593643a6a6f14088f2b64372 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sun, 28 May 2023 15:06:28 +0100 Subject: [PATCH 15/30] Update index.php --- application/views/dashboard/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 2da9c8c6..6edf205d 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -161,7 +161,7 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
-
+
From 33edeb7d726f8470f9c5088e67a63d73b6188df2 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sun, 28 May 2023 15:13:39 +0100 Subject: [PATCH 16/30] Show radio info updated every 5mins on public display --- application/controllers/Visitor.php | 9 +++++++-- application/views/dashboard/index.php | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/application/controllers/Visitor.php b/application/controllers/Visitor.php index 567f7f0d..ee1ea435 100644 --- a/application/controllers/Visitor.php +++ b/application/controllers/Visitor.php @@ -74,8 +74,6 @@ class Visitor extends CI_Controller { $this->load->model('cat'); - $data['radio_status'] = $this->cat->recent_status(); - // Store info $data['todays_qsos'] = $this->logbook_model->todays_qsos($logbooks_locations_array); $data['total_qsos'] = $this->logbook_model->total_qsos($logbooks_locations_array); @@ -442,4 +440,11 @@ class Visitor extends CI_Controller { return false; } } + + function radio_display_component() { + $this->load->model('cat'); + + $data['radio_status'] = $this->cat->recent_status(); + $this->load->view('components/radio_display_table', $data); + } } diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 6edf205d..8850b8be 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -161,7 +161,7 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
-
+
From a51edb48732e28597374d721a411b474ad1169c5 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sun, 28 May 2023 15:15:41 +0100 Subject: [PATCH 17/30] Update Visitor.php --- application/controllers/Visitor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Visitor.php b/application/controllers/Visitor.php index ee1ea435..9fe6645c 100644 --- a/application/controllers/Visitor.php +++ b/application/controllers/Visitor.php @@ -441,7 +441,7 @@ class Visitor extends CI_Controller { } } - function radio_display_component() { + public function radio_display_component() { $this->load->model('cat'); $data['radio_status'] = $this->cat->recent_status(); From 8aa45acc04baeece0d22ec5818f6c678ceee03f0 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sun, 28 May 2023 15:21:13 +0100 Subject: [PATCH 18/30] fixed bugs --- application/controllers/Visitor.php | 21 +++++++++++++-------- application/views/visitor/index.php | 23 +---------------------- 2 files changed, 14 insertions(+), 30 deletions(-) diff --git a/application/controllers/Visitor.php b/application/controllers/Visitor.php index 9fe6645c..c7dd7f1d 100644 --- a/application/controllers/Visitor.php +++ b/application/controllers/Visitor.php @@ -11,9 +11,12 @@ class Visitor extends CI_Controller { if($method == "config") { $this->$method(); } - elseif($method == "map") { + elseif($method == "map") { $this->map($method); } + elseif($method == "radio_display_component") { + $this->radio_display_component($method); + } elseif($method == "satellites") { $this->satellites($method); } @@ -74,6 +77,8 @@ class Visitor extends CI_Controller { $this->load->model('cat'); + $data['radio_status'] = $this->cat->recent_status(); + // Store info $data['todays_qsos'] = $this->logbook_model->todays_qsos($logbooks_locations_array); $data['total_qsos'] = $this->logbook_model->total_qsos($logbooks_locations_array); @@ -124,6 +129,13 @@ class Visitor extends CI_Controller { } } + public function radio_display_component() { + $this->load->model('cat'); + + $data['radio_status'] = $this->cat->recent_status(); + $this->load->view('components/radio_display_table', $data); + } + public function map() { $this->load->model('logbook_model'); @@ -440,11 +452,4 @@ class Visitor extends CI_Controller { return false; } } - - public function radio_display_component() { - $this->load->model('cat'); - - $data['radio_status'] = $this->cat->recent_status(); - $this->load->view('components/radio_display_table', $data); - } } diff --git a/application/views/visitor/index.php b/application/views/visitor/index.php index d316ed6d..3194abcb 100644 --- a/application/views/visitor/index.php +++ b/application/views/visitor/index.php @@ -116,29 +116,8 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
- num_rows()) { ?> +
-
- - - - - result_array() as $row) { ?> - - - - - - -
Radio Status
- - - - frequency->hz_to_mhz($row['frequency']); ?> () - -
- - From d39f0cd8b4601fe2ed88d979162e22bc39062af3 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Mon, 29 May 2023 15:36:38 +0100 Subject: [PATCH 19/30] removed as it doesn't appear to be used --- application/controllers/User_Logbooks.php | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 application/controllers/User_Logbooks.php diff --git a/application/controllers/User_Logbooks.php b/application/controllers/User_Logbooks.php deleted file mode 100644 index 08d5c6a8..00000000 --- a/application/controllers/User_Logbooks.php +++ /dev/null @@ -1,21 +0,0 @@ -load->helper(array('form', 'url')); - - $this->load->model('user_model'); - if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } - } - - public function index() - { - echo 'Functions to come'; - } - -} From 562a093795744274adba6bcdd050e9852cdb465f Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Mon, 29 May 2023 17:36:23 +0100 Subject: [PATCH 20/30] Update config.php --- install/config/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/config/config.php b/install/config/config.php index 7b163a3b..70f1741f 100644 --- a/install/config/config.php +++ b/install/config/config.php @@ -14,7 +14,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ $config['app_name'] = "Cloudlog"; -$config['app_version'] = "2.4.2"; +$config['app_version'] = "2.4.3"; $config['directory'] = "%directory%"; $config['callbook'] = "hamqth"; // Options are hamqth or qrz From 95b9ca27f5856b2db862b87fbd1e87857aef2358 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Mon, 29 May 2023 17:36:46 +0100 Subject: [PATCH 21/30] Update config.sample.php --- application/config/config.sample.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/config/config.sample.php b/application/config/config.sample.php index 07ec0576..deb0e901 100644 --- a/application/config/config.sample.php +++ b/application/config/config.sample.php @@ -14,7 +14,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); */ $config['app_name'] = "Cloudlog"; -$config['app_version'] = "2.4.2"; +$config['app_version'] = "2.4.3"; $config['directory'] = "logbook"; $config['callbook'] = "hamqth"; // Options are hamqth or qrz From f87997f2233d57fd40bd7aa5b7fb94bca7471675 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Tue, 30 May 2023 21:03:39 +0200 Subject: [PATCH 22/30] [Adif backup] Fetches all locations for user instead of from active logbook --- application/models/Adif_data.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/application/models/Adif_data.php b/application/models/Adif_data.php index c01a6103..3c7641df 100644 --- a/application/models/Adif_data.php +++ b/application/models/Adif_data.php @@ -10,8 +10,7 @@ class adif_data extends CI_Model { if (strpos($this->api_model->access($api_key), 'r') !== false) { $this->api_model->update_last_used($api_key); $user_id = $this->api_model->key_userid($api_key); - $active_station_logbook = $CI->logbooks_model->find_active_station_logbook_from_userid($user_id); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($active_station_logbook); + $logbooks_locations_array = $this->list_station_locations($user_id); } } else { $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -27,6 +26,22 @@ class adif_data extends CI_Model { return $query; } + function list_station_locations($user_id) { + $this->db->where('user_id', $user_id); + $query = $this->db->get('station_profile'); + + if ($query->num_rows() == 0) { + return array(); + } + + $locations_array = array(); + foreach ($query->result() as $row) { + array_push($locations_array, $row->station_id); + } + + return $locations_array; + } + function export_printrequested($station_id = NULL) { $this->load->model('stations'); $active_station_id = $this->stations->find_active(); From b5172fc710b0a8ff3afdffb778ee064c0e161143 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 31 May 2023 20:06:27 +0200 Subject: [PATCH 23/30] Pull CQ and ITU zone data from LoTW confirmation --- application/controllers/Lotw.php | 14 +++++++++++++- application/models/Logbook_model.php | 10 +++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 01cb8f7d..a8726557 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -538,7 +538,19 @@ class Lotw extends CI_Controller { $cnty = ""; } - $lotw_status = $this->logbook_model->lotw_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd'], $state, $qsl_gridsquare, $iota, $cnty); + if (isset($record['cqz'])) { + $cqz = $record['cqz']; + } else { + $cqz = ""; + } + + if (isset($record['ituz'])) { + $ituz = $record['ituz']; + } else { + $ituz = ""; + } + + $lotw_status = $this->logbook_model->lotw_update($time_on, $record['call'], $record['band'], $qsl_date, $record['qsl_rcvd'], $state, $qsl_gridsquare, $iota, $cnty, $cqz, $ituz); } diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index bc794378..db8771de 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2484,7 +2484,7 @@ class Logbook_model extends CI_Model { } } - function lotw_update($datetime, $callsign, $band, $qsl_date, $qsl_status, $state, $qsl_gridsquare, $iota, $cnty) { + function lotw_update($datetime, $callsign, $band, $qsl_date, $qsl_status, $state, $qsl_gridsquare, $iota, $cnty, $cqz, $ituz) { $data = array( 'COL_LOTW_QSLRDATE' => $qsl_date, @@ -2502,6 +2502,14 @@ class Logbook_model extends CI_Model { $data['COL_CNTY'] = $cnty; } + if($cqz != "") { + $data['COL_CQZ'] = $cqz; + } + + if($ituz != "") { + $data['COL_ITUZ'] = $ituz; + } + $this->db->where('date_format(COL_TIME_ON, \'%Y-%m-%d %H:%i\') = "'.$datetime.'"'); $this->db->where('COL_CALL', $callsign); $this->db->where('COL_BAND', $band); From fdf900e555fc778935719ef3370e6c6366f8f95c Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 31 May 2023 20:45:52 +0200 Subject: [PATCH 24/30] Sort eQSL cards in desc order --- application/views/interface_assets/footer.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 4e7741e2..132908ae 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -2755,6 +2755,8 @@ function viewEqsl(picture, callsign) { "scrollCollapse": true, "paging": false, "scrollX": true, + "ordering": true, + "order": [ 2, 'desc' ], }); From c7cc4aa44b459d5bb761f79bee2dfc5a56b64d31 Mon Sep 17 00:00:00 2001 From: Luca <61653175+iu2frl@users.noreply.github.com> Date: Thu, 1 Jun 2023 14:02:45 +0200 Subject: [PATCH 25/30] Create push-docker-hub.yml --- .github/workflows/push-docker-hub.yml | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/push-docker-hub.yml diff --git a/.github/workflows/push-docker-hub.yml b/.github/workflows/push-docker-hub.yml new file mode 100644 index 00000000..1c7bb2ff --- /dev/null +++ b/.github/workflows/push-docker-hub.yml @@ -0,0 +1,37 @@ +name: Push Docker image to the Hub + +on: + push: + # Pattern matched against refs/tags + tags: + - '*' # Push events to every tag not containing + + workflow_dispatch: + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: actions-ecosystem/action-get-latest-tag@v1 + id: get-latest-tag + - name: Print latest tag + run: echo ${{ steps.get-latest-tag.outputs.tag }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: ./ + file: ./docker/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ secrets.DOCKERHUB_IMAGENAME }}:${{ steps.get-latest-tag.outputs.tag }},${{ secrets.DOCKERHUB_IMAGENAME }}:latest From 5e5f89c9ad6d1f5ae38a60c24ea7926a7d2261af Mon Sep 17 00:00:00 2001 From: Luca <61653175+iu2frl@users.noreply.github.com> Date: Thu, 1 Jun 2023 14:06:29 +0200 Subject: [PATCH 26/30] Create docker-compose.yml --- docker/docker-compose.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 docker/docker-compose.yml diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 00000000..8e757217 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,18 @@ +version: ‘3.4’ + +services: + cloudlog: + image: cloudlog + container_name: cloudlog + volumes: + - cloudlog-config:/var/www/html/application/config + - cloudlog-backup:/var/www/html/application/backup + - cloudlog-uploads:/var/www/html/application/uploads + ports: + - 8086:80 + restart: unless-stopped + +volumes: + cloudlog-config: + cloudlog-backup: + cloudlog-uploads: From b6505dd8e96bde95c6ae67c518237b74e7c147db Mon Sep 17 00:00:00 2001 From: Luca <61653175+iu2frl@users.noreply.github.com> Date: Thu, 1 Jun 2023 14:06:45 +0200 Subject: [PATCH 27/30] Add files via upload --- docker/Dockerfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 docker/Dockerfile diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..1b422749 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,33 @@ +FROM php:7.4-apache +RUN touch /usr/local/etc/php/conf.d/uploads.ini \ +&& echo “file_uploads = On” >> /usr/local/etc/php/conf.d/uploads.ini \ +&& echo “memory_limit = 64M” >> /usr/local/etc/php/conf.d/uploads.ini \ +&& echo “upload_max_filesize = 64M” >> /usr/local/etc/php/conf.d/uploads.ini \ +&& echo “post_max_size = 64M” >> /usr/local/etc/php/conf.d/uploads.ini \ +&& echo “max_execution_time = 60” >> /usr/local/etc/php/conf.d/uploads.ini +RUN apt-get update \ +&& apt-get install -y git curl libxml2-dev libonig-dev +RUN docker-php-ext-install mysqli +#RUN docker-php-ext-install curl +RUN docker-php-ext-install mbstring +RUN docker-php-ext-install xml +#RUN docker-php-ext-install openssl +WORKDIR /var/www/html +COPY ./ /var/www/html/ +RUN ls && rm -rf /var/www/html/docker/ \ +&& chown -R root:www-data ./application/config/ \ +&& chown -R root:www-data ./application/logs/ \ +&& chown -R root:www-data ./assets/qslcard/ \ +&& chown -R root:www-data ./backup/ \ +&& chown -R root:www-data ./updates/ \ +&& chown -R root:www-data ./uploads/ \ +&& chown -R root:www-data ./images/eqsl_card_images/ \ +&& chown -R root:www-data ./assets/json/ \ +&& chmod -R g+rw ./application/config/ \ +&& chmod -R g+rw ./application/logs/ \ +&& chmod -R g+rw ./assets/qslcard/ \ +&& chmod -R g+rw ./backup/ \ +&& chmod -R g+rw ./updates/ \ +&& chmod -R g+rw ./uploads/ \ +&& chmod -R g+rw ./images/eqsl_card_images/ \ +&& chmod -R g+rw ./assets/json/ From d8ed655e5f3e5af8bea0efed28cef09113f5e6e2 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 1 Jun 2023 17:08:53 +0200 Subject: [PATCH 28/30] Fix SOTA var --- application/views/view_log/qso.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index e7475cbf..d4691e3b 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -391,7 +391,7 @@ $hashtags .= " #IOTA ".$row->COL_IOTA; } if($row->COL_SOTA_REF != null) { - $hashtags .= " #SOTA ".$row->COL_SOTA_EF; + $hashtags .= " #SOTA ".$row->COL_SOTA_REF; } if($row->COL_POTA_REF != null) { $hashtags .= " #POTA ".$row->COL_POTA_REF; From d09b9282fb6fe2c667bfe0eba1240e02a2e7d9a0 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 2 Jun 2023 17:09:02 +0200 Subject: [PATCH 29/30] Fix QSL marking functions --- application/views/search/search_result_ajax.php | 4 ++-- application/views/view_log/partial/log_ajax.php | 4 ++-- assets/js/sections/common.js | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/application/views/search/search_result_ajax.php b/application/views/search/search_result_ajax.php index 60a25ddd..cc358d13 100644 --- a/application/views/search/search_result_ajax.php +++ b/application/views/search/search_result_ajax.php @@ -113,7 +113,7 @@ $ci =& get_instance(); $custom_date_format = $this->config->item('qso_date_format'); } ?> - COL_PRIMARY_KEY .'">'; ?> + COL_PRIMARY_KEY .'">'; ?> config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?> @@ -207,7 +207,7 @@ $ci =& get_instance(); if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?> '; + echo ''; ?> + echo ''; ?> config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?> @@ -109,7 +109,7 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) { echo_table_col($row, $this->session->userdata('user_column5')); if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?> -
COL_TIME_ON); echo date($custom_date_format, $timestamp); ?> COL_TIME_ON); echo date('H:i', $timestamp); ?>'; echo 'COL_QSL_SENT != "N") { if ($row->COL_QSLSDATE != null) { diff --git a/application/views/view_log/partial/log_ajax.php b/application/views/view_log/partial/log_ajax.php index 944fccdf..ab48725a 100644 --- a/application/views/view_log/partial/log_ajax.php +++ b/application/views/view_log/partial/log_ajax.php @@ -92,7 +92,7 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) { // Get Default date format from /config/cloudlog.php $custom_date_format = $this->config->item('qso_date_format'); } - echo '
COL_TIME_ON); echo date($custom_date_format, $timestamp); ?> COL_TIME_ON); echo date('H:i', $timestamp); ?> + COL_QSL_SENT != "N") { switch ($row->COL_QSL_SENT) { case "Y": diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index 92caf191..1f9e764d 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -7,7 +7,7 @@ function qsl_rcvd(id, method) { }, success: function(data) { if (data.message == 'OK') { - $("#qso_" + id).find("td:eq(8)").find("span:eq(1)").attr('class', 'qsl-green'); // Paints arrow green + $("#qsl_" + id).find("span:eq(1)").attr('class', 'qsl-green'); // Paints arrow green $(".qsl_rcvd_" + id).remove(); // removes choice from menu } else { @@ -26,7 +26,7 @@ function qsl_sent(id, method) { }, success: function(data) { if (data.message == 'OK') { - $("#qso_" + id).find("td:eq(8)").find("span:eq(0)").attr('class', 'qsl-green'); // Paints arrow green + $("#qsl_" + id).find("span:eq(0)").attr('class', 'qsl-green'); // Paints arrow green $(".qsl_sent_" + id).remove(); // removes choice from menu } else { @@ -47,7 +47,7 @@ function qsl_requested(id, method) { }, success: function(data) { if (data.message == 'OK') { - $("#qso_" + id).find("td:eq(8)").find("span:eq(0)").attr('class', 'qsl-yellow'); // Paints arrow green + $("#qsl_" + id).find("span:eq(0)").attr('class', 'qsl-yellow'); // Paints arrow yellow } else { $(".bootstrap-dialog-message").append('
×You are not allowed to update QSL status!
'); @@ -67,7 +67,7 @@ function qsl_ignore(id, method) { }, success: function(data) { if (data.message == 'OK') { - $("#qso_" + id).find("td:eq(8)").find("span:eq(0)").attr('class', 'qsl-grey'); // Paints arrow grey + $("#qsl_" + id).find("span:eq(0)").attr('class', 'qsl-grey'); // Paints arrow grey } else { $(".bootstrap-dialog-message").append('
×You are not allowed to update QSL status!
'); From defe2321b26e76f536ec0618aa0ccc8bfc3a757f Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 5 Jun 2023 15:59:17 +0200 Subject: [PATCH 30/30] Correct eQSL images folder name --- application/controllers/Eqsl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Eqsl.php b/application/controllers/Eqsl.php index 05d70fbf..d329d2dc 100644 --- a/application/controllers/Eqsl.php +++ b/application/controllers/Eqsl.php @@ -12,7 +12,7 @@ class eqsl extends CI_Controller { public function index() { $this->lang->load('qslcard'); - $folder_name = "assets/qslcard"; + $folder_name = "images/eqsl_card_images"; $data['storage_used'] = $this->sizeFormat($this->folderSize($folder_name)); // Render Page