From fdbbae1c28c75ebba1a2f575f9b25fa65c30d0e1 Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 14 Sep 2025 09:18:11 +0200 Subject: [PATCH 1/5] [QSL Queue] Fix the "Add QSO" feature --- application/views/qslprint/qsolist.php | 2 ++ assets/js/sections/qslprint.js | 47 +++++++++++++++----------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/application/views/qslprint/qsolist.php b/application/views/qslprint/qsolist.php index 6ce2fb7e7..0ff604081 100644 --- a/application/views/qslprint/qsolist.php +++ b/application/views/qslprint/qsolist.php @@ -8,6 +8,7 @@ if ($qsos->result() != NULL) { '. __("Time") .' ' . __("Mode") . ' ' . __("Band") . ' + ' . __("Frequency") . ' ' . __("RST (S)") . ' ' . __("RST (R)") . ' ' . __("Station") . ' @@ -41,6 +42,7 @@ if ($qsos->result() != NULL) { echo ''; $timestamp = strtotime($qsl->COL_TIME_ON); echo date('H:i', $timestamp); echo ''; echo ''; echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; echo ''; echo ''; if($qsl->COL_SAT_NAME != null) { echo $qsl->COL_SAT_NAME; } else { echo strtolower($qsl->COL_BAND ?? ""); }; echo ''; + echo '' . $this->frequency->qrg_conversion($qsl->COL_FREQ_RX ?? $qsl->COL_FREQ) . ''; echo '' . $qsl->COL_RST_SENT . ''; echo '' . $qsl->COL_RST_RCVD . ''; echo '' . $qsl->station_callsign . ''; diff --git a/assets/js/sections/qslprint.js b/assets/js/sections/qslprint.js index 0020062e2..d3d08cd2f 100644 --- a/assets/js/sections/qslprint.js +++ b/assets/js/sections/qslprint.js @@ -70,9 +70,11 @@ function addQsoToPrintQueue(id) { if (qsoDialogInstance) { qsoDialogInstance.close(); } - var callSign = $("#qsolist_"+id).find("td:eq(0)").text(); - var formattedCallSign = callSign.replace(/0/g, "Ø").toUpperCase(); - var line = ''; + let callSign = $("#qsolist_"+id).find("td:eq(0)").text(); + let formattedCallSign = callSign.replace(/0/g, "Ø").toUpperCase(); + let line = ''; + let freq_or_band = $('#frequency_or_band').val(); + line += '
'; line += ''; line += ''; @@ -94,13 +96,20 @@ function addQsoToPrintQueue(id) { line += ''+$("#qsolist_"+id).find("td:eq(1)").text()+''; line += ''+$("#qsolist_"+id).find("td:eq(2)").text()+''; line += ''+$("#qsolist_"+id).find("td:eq(3)").text()+''; - line += ''+$("#qsolist_"+id).find("td:eq(4)").text()+''; - line += ''+$("#qsolist_"+id).find("td:eq(5)").text()+''; + if (freq_or_band === 'band') { + line += ''+$("#qsolist_"+id).find("td:eq(4)").text()+''; + } else if (freq_or_band === 'frequency') { + line += ''+$("#qsolist_"+id).find("td:eq(5)").text()+''; + } else { + line += ''+$("#qsolist_"+id).find("td:eq(4)").text()+''; + line += ''+$("#qsolist_"+id).find("td:eq(5)").text()+''; + } line += ''+$("#qsolist_"+id).find("td:eq(6)").text()+''; - line += ''+$("#qsolist_"+id).find("td:eq(9)").text()+''; - line += ''+$("#qsolist_"+id).find("td:eq(7)").text()+''; - line += ''+$("#qsolist_"+id).find("td:eq(8)").text()+''; + line += ''+$("#qsolist_"+id).find("td:eq(7)").text()+''; line += ''+$("#qsolist_"+id).find("td:eq(10)").text()+''; + line += ''+$("#qsolist_"+id).find("td:eq(8)").text()+''; + line += ''+$("#qsolist_"+id).find("td:eq(9)").text()+''; + line += ''+$("#qsolist_"+id).find("td:eq(11)").text()+''; line += ''+prev_qsl_html+''; line += ''; line += ''; @@ -334,12 +343,12 @@ function exportSelectedQsos() { } function markMethod(){ - + //grab the dropdown const select = document.getElementById('markqslmethod'); //grab the selected method - const methodkey = select.value; + const methodkey = select.value; const method = select.options[select.selectedIndex].text; //perform function @@ -350,22 +359,22 @@ function markMethodQSOs(method) { //unmark any QSO that is already marked for cleanup purposes unmarkallQSOs(); - + //grab the table const table = document.getElementById('qslprint_table'); //loop through each row except the header Array.from(table.tBodies[0].rows).forEach(row => { - + //get the send-method column const sendMethodCell = row.querySelector('td.send-method'); //check if it contains the right method (or skip check if method is empty) if (sendMethodCell && (method === "" || sendMethodCell.textContent.trim() === method)) { - + //find the checkbox in the first cell const checkbox = row.querySelector('td:first-child input[type="checkbox"]'); - + //check that box if (checkbox) { checkbox.checked = true; @@ -375,16 +384,16 @@ function markMethodQSOs(method) { } function unmarkallQSOs(){ - + //grab the table const table = document.getElementById('qslprint_table'); //loop through each row except the header Array.from(table.tBodies[0].rows).forEach(row => { - + //find the checkbox in the first cell const checkbox = row.querySelector('td:first-child input[type="checkbox"]'); - + //check that box if (checkbox) { checkbox.checked = false; @@ -393,7 +402,7 @@ function unmarkallQSOs(){ } function switchbandandfrequencydisplay(mode){ - + //switch state according to selected value. Default case = band switch(mode) { case 'band': @@ -426,4 +435,4 @@ function switchbandandfrequencydisplay(mode){ document.getElementById('frequency_or_band').addEventListener('change', function (event) { //switch display options switchbandandfrequencydisplay(event.target.value); -}); \ No newline at end of file +}); From 5b74cf4c37c01d38e19db2a8028053ac5e0a3247 Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 14 Sep 2025 14:16:18 +0200 Subject: [PATCH 2/5] Fixed the js the correct way --- assets/js/sections/qslprint.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/assets/js/sections/qslprint.js b/assets/js/sections/qslprint.js index d3d08cd2f..0d7b5caee 100644 --- a/assets/js/sections/qslprint.js +++ b/assets/js/sections/qslprint.js @@ -97,12 +97,15 @@ function addQsoToPrintQueue(id) { line += ''+$("#qsolist_"+id).find("td:eq(2)").text()+''; line += ''+$("#qsolist_"+id).find("td:eq(3)").text()+''; if (freq_or_band === 'band') { - line += ''+$("#qsolist_"+id).find("td:eq(4)").text()+''; + line += ''+$("#qsolist_"+id).find("td:eq(4)").text()+''; + line += ''+$("#qsolist_"+id).find("td:eq(5)").text()+''; + } else if (freq_or_band === 'frequency') { - line += ''+$("#qsolist_"+id).find("td:eq(5)").text()+''; + line += ''+$("#qsolist_"+id).find("td:eq(4)").text()+''; + line += ''+$("#qsolist_"+id).find("td:eq(5)").text()+''; } else { - line += ''+$("#qsolist_"+id).find("td:eq(4)").text()+''; - line += ''+$("#qsolist_"+id).find("td:eq(5)").text()+''; + line += ''+$("#qsolist_"+id).find("td:eq(4)").text()+''; + line += ''+$("#qsolist_"+id).find("td:eq(5)").text()+''; } line += ''+$("#qsolist_"+id).find("td:eq(6)").text()+''; line += ''+$("#qsolist_"+id).find("td:eq(7)").text()+''; From b4f71272e0bca82a401a3ab903fbec1f39215f7c Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 15 Sep 2025 08:38:23 +0200 Subject: [PATCH 3/5] Show (TX) freq (and RX freq if set) --- application/views/qslprint/qsolist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/qslprint/qsolist.php b/application/views/qslprint/qsolist.php index 0ff604081..8a940c563 100644 --- a/application/views/qslprint/qsolist.php +++ b/application/views/qslprint/qsolist.php @@ -42,7 +42,7 @@ if ($qsos->result() != NULL) { echo ''; $timestamp = strtotime($qsl->COL_TIME_ON); echo date('H:i', $timestamp); echo ''; echo ''; echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; echo ''; echo ''; if($qsl->COL_SAT_NAME != null) { echo $qsl->COL_SAT_NAME; } else { echo strtolower($qsl->COL_BAND ?? ""); }; echo ''; - echo '' . $this->frequency->qrg_conversion($qsl->COL_FREQ_RX ?? $qsl->COL_FREQ) . ''; + echo '' . $this->frequency->qrg_conversion($qsl->COL_FREQ ?? '') . ($qsl->COL_FREQ_RX ? ' / '.$this->frequency->qrg_conversion($qsl->COL_FREQ_RX ?? '') : '') .''; echo '' . $qsl->COL_RST_SENT . ''; echo '' . $qsl->COL_RST_RCVD . ''; echo '' . $qsl->station_callsign . ''; From 55fddf9c08d271105bd46a33bf21d738a946f6eb Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 15 Sep 2025 08:48:55 +0200 Subject: [PATCH 4/5] Display bands and freqs for SAT QSOs correctly --- application/models/Qslprint_model.php | 2 +- application/views/qslprint/qslprint.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/models/Qslprint_model.php b/application/models/Qslprint_model.php index 83ee7552c..3d2face9b 100644 --- a/application/models/Qslprint_model.php +++ b/application/models/Qslprint_model.php @@ -70,7 +70,7 @@ class Qslprint_model extends CI_Model { function get_qsos_for_print($station_id = 'All') { $binding=[]; $binding[]=$this->session->userdata('user_id'); - $sql="SELECT count(distinct oldlog.col_primary_key) as previous_qsl, log.COL_QSL_SENT, log.COL_PRIMARY_KEY, log.COL_DXCC, log.COL_CALL, log.COL_SAT_NAME, log.COL_SAT_MODE, log.COL_BAND_RX, COALESCE(log.COL_FREQ_RX, log.COL_FREQ) as frequency, log.COL_TIME_ON, log.COL_MODE, log.COL_RST_SENT, log.COL_RST_RCVD, log.COL_QSL_VIA, log.COL_QSL_SENT_VIA, log.COL_SUBMODE, log.COL_BAND, sp.station_id, sp.station_callsign, sp.station_profile_name, o.qsoid + $sql="SELECT count(distinct oldlog.col_primary_key) as previous_qsl, log.COL_QSL_SENT, log.COL_PRIMARY_KEY, log.COL_DXCC, log.COL_CALL, log.COL_SAT_NAME, log.COL_SAT_MODE, log.COL_BAND_RX, log.COL_FREQ as frequency, log.COL_FREQ_RX as frequency_rx, log.COL_TIME_ON, log.COL_MODE, log.COL_RST_SENT, log.COL_RST_RCVD, log.COL_QSL_VIA, log.COL_QSL_SENT_VIA, log.COL_SUBMODE, log.COL_BAND, sp.station_id, sp.station_callsign, sp.station_profile_name, o.qsoid FROM ".$this->config->item('table_name')." log INNER JOIN station_profile sp ON sp.`station_id` = log.`station_id` LEFT OUTER JOIN oqrs o ON o.`qsoid` = log.`COL_PRIMARY_KEY` diff --git a/application/views/qslprint/qslprint.php b/application/views/qslprint/qslprint.php index 291bc7145..f8d449bf2 100644 --- a/application/views/qslprint/qslprint.php +++ b/application/views/qslprint/qslprint.php @@ -54,8 +54,8 @@ if ($qsos->result() != NULL) { echo ''; $timestamp = strtotime($qsl->COL_TIME_ON); echo date($custom_date_format, $timestamp); echo ''; echo ''; $timestamp = strtotime($qsl->COL_TIME_ON); echo date('H:i', $timestamp); echo ''; echo ''; echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; echo ''; - echo ''; if($qsl->COL_SAT_NAME != null) { echo $qsl->COL_SAT_NAME; } else { echo strtolower($qsl->COL_BAND); }; echo ''; - echo ''; if($qsl->COL_SAT_NAME != null) { echo $qsl->COL_SAT_NAME; } else { echo $ci->frequency->qrg_conversion($qsl->frequency); }; echo ''; + echo ''; if($qsl->COL_SAT_NAME != null) { echo __("SAT") . ' ' . $qsl->COL_SAT_NAME . ' '. strtolower($qsl->COL_BAND) . '/' . strtolower($qsl->COL_BAND_RX); } else { echo strtolower($qsl->COL_BAND); }; echo ''; + echo ''; if($qsl->COL_SAT_NAME != null) { echo __("SAT") . ' ' . $qsl->COL_SAT_NAME . ' ' . $ci->frequency->qrg_conversion($qsl->frequency) . '/' . $ci->frequency->qrg_conversion($qsl->frequency_rx); } else { echo $ci->frequency->qrg_conversion($qsl->frequency); }; echo ''; echo '' . $qsl->COL_RST_SENT . ''; echo '' . $qsl->COL_RST_RCVD . ''; echo '' . $qsl->COL_QSL_VIA . ''; From 85663d12d7f37edf0ff54501b6e946a96e0ed79e Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 15 Sep 2025 09:08:00 +0200 Subject: [PATCH 5/5] Fix add QSO function --- application/views/qslprint/qsolist.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/qslprint/qsolist.php b/application/views/qslprint/qsolist.php index 8a940c563..4e3386abd 100644 --- a/application/views/qslprint/qsolist.php +++ b/application/views/qslprint/qsolist.php @@ -41,8 +41,8 @@ if ($qsos->result() != NULL) { echo ''; $timestamp = strtotime($qsl->COL_TIME_ON); echo date($custom_date_format, $timestamp); echo ''; echo ''; $timestamp = strtotime($qsl->COL_TIME_ON); echo date('H:i', $timestamp); echo ''; echo ''; echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; echo ''; - echo ''; if($qsl->COL_SAT_NAME != null) { echo $qsl->COL_SAT_NAME; } else { echo strtolower($qsl->COL_BAND ?? ""); }; echo ''; - echo '' . $this->frequency->qrg_conversion($qsl->COL_FREQ ?? '') . ($qsl->COL_FREQ_RX ? ' / '.$this->frequency->qrg_conversion($qsl->COL_FREQ_RX ?? '') : '') .''; + echo ''; if($qsl->COL_SAT_NAME != null) { echo __("SAT") . ' ' . $qsl->COL_SAT_NAME . ' '. strtolower($qsl->COL_BAND) . '/' . strtolower($qsl->COL_BAND_RX); } else { echo strtolower($qsl->COL_BAND); }; echo ''; + echo ''; if($qsl->COL_SAT_NAME != null) { echo __("SAT") . ' ' . $qsl->COL_SAT_NAME . ' ' . $this->frequency->qrg_conversion($qsl->COL_FREQ) . '/' . $this->frequency->qrg_conversion($qsl->COL_FREQ_RX); } else { echo $this->frequency->qrg_conversion($qsl->COL_FREQ); }; echo ''; echo '' . $qsl->COL_RST_SENT . ''; echo '' . $qsl->COL_RST_RCVD . ''; echo '' . $qsl->station_callsign . '';