From 613d17642c1757a6b4d1a76fb730fbd5eea4cab0 Mon Sep 17 00:00:00 2001 From: int2001 Date: Thu, 26 Oct 2023 09:10:38 +0000 Subject: [PATCH 01/16] Added "Via" as option for labels --- application/controllers/Labels.php | 33 ++++++++++++++---------- application/views/labels/startatform.php | 6 +++++ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/application/controllers/Labels.php b/application/controllers/Labels.php index 008ec762..cf0b966c 100644 --- a/application/controllers/Labels.php +++ b/application/controllers/Labels.php @@ -134,28 +134,30 @@ class Labels extends CI_Controller { $ids = xss_clean(json_decode($this->input->post('id'))); $offset = xss_clean($this->input->post('startat')); $grid = $this->input->post('grid') === "true" ? 1 : 0; + $via = $this->input->post('via') === "true" ? 1 : 0; $this->load->model('labels_model'); $result = $this->labels_model->export_printrequestedids($ids); - $this->prepareLabel($result, true, $offset, $grid); + $this->prepareLabel($result, true, $offset, $grid, $via); } public function print($station_id) { $clean_id = xss_clean($station_id); $offset = xss_clean($this->input->post('startat')); $grid = xss_clean($this->input->post('grid') ?? 0); + $via = xss_clean($this->input->post('via') ?? 0); $this->load->model('stations'); if ($this->stations->check_station_is_accessible($station_id)) { $this->load->model('labels_model'); $result = $this->labels_model->export_printrequested($clean_id); - $this->prepareLabel($result, false, $offset, $grid); + $this->prepareLabel($result, false, $offset, $grid, $via); } else { redirect('labels'); } } - function prepareLabel($qsos, $jscall = false, $offset = 1, $grid = false) { + function prepareLabel($qsos, $jscall = false, $offset = 1, $grid = false, $via = false) { $this->load->model('labels_model'); $label = $this->labels_model->getDefaultLabel(); @@ -231,9 +233,9 @@ class Labels extends CI_Controller { if ($qsos->num_rows() > 0) { if ($label->qsos == 1) { - $this->makeMultiQsoLabel($qsos->result(), $pdf, 1, $offset, $ptype->orientation, $grid); + $this->makeMultiQsoLabel($qsos->result(), $pdf, 1, $offset, $ptype->orientation, $grid, $via); } else { - $this->makeMultiQsoLabel($qsos->result(), $pdf, $label->qsos, $offset, $ptype->orientation, $grid); + $this->makeMultiQsoLabel($qsos->result(), $pdf, $label->qsos, $offset, $ptype->orientation, $grid, $via); } } else { $this->session->set_flashdata('message', '0 QSOs found for print!'); @@ -242,7 +244,7 @@ class Labels extends CI_Controller { $pdf->Output(); } - function makeMultiQsoLabel($qsos, $pdf, $numberofqsos, $offset, $orientation, $grid) { + function makeMultiQsoLabel($qsos, $pdf, $numberofqsos, $offset, $orientation, $grid, $via) { $text = ''; $current_callsign = ''; $current_sat = ''; @@ -259,7 +261,7 @@ class Labels extends CI_Controller { ( ($qso->COL_BAND_RX !== $current_sat_bandrx) && ($this->pretty_sat_mode($qso->COL_SAT_MODE) !== '')) ) { // ((($qso->COL_SAT_NAME ?? '' !== $current_sat) || ($qso->COL_CALL !== $current_callsign)) && ($qso->COL_SAT_NAME ?? '' !== '') && ($col->COL_BAND_RX ?? '' !== $current_sat_bandrx))) { if (!empty($qso_data)) { - $this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation, $grid); + $this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation, $grid, $via); $qso_data = []; } $current_callsign = $qso->COL_CALL; @@ -274,6 +276,7 @@ class Labels extends CI_Controller { 'mode' => $qso->COL_MODE, 'rst' => $qso->COL_RST_SENT, 'mygrid' => $qso->station_gridsquare, + 'via' => $qso->COL_QSL_VIA, 'sat' => $qso->COL_SAT_NAME, 'sat_mode' => $this->pretty_sat_mode($qso->COL_SAT_MODE ?? ''), 'sat_band_rx' => ($qso->COL_BAND_RX ?? ''), @@ -282,7 +285,7 @@ class Labels extends CI_Controller { ]; } if (!empty($qso_data)) { - $this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation, $grid); + $this->finalizeData($pdf, $current_callsign, $qso_data, $numberofqsos, $orientation, $grid, $via); } } // New begin @@ -290,7 +293,7 @@ class Labels extends CI_Controller { return(strlen($sat_mode ?? '') == 2 ? (strtoupper($sat_mode[0]).'/'.strtoupper($sat_mode[1])) : strtoupper($sat_mode ?? '')); } - function finalizeData($pdf, $current_callsign, &$preliminaryData, $qso_per_label,$orientation, $grid) { + function finalizeData($pdf, $current_callsign, &$preliminaryData, $qso_per_label,$orientation, $grid, $via) { $tableData = []; $count_qso = 0; @@ -310,7 +313,7 @@ class Labels extends CI_Controller { if($count_qso == $qso_per_label){ - $this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation, $grid); + $this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation, $grid, $via); $tableData = []; // reset the data $count_qso = 0; // reset the counter } @@ -318,16 +321,20 @@ class Labels extends CI_Controller { } // generate label for remaining QSOs if($count_qso > 0){ - $this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation, $grid); + $this->generateLabel($pdf, $current_callsign, $tableData,$count_qso,$qso,$orientation, $grid, $via); $preliminaryData = []; // reset the data } } - function generateLabel($pdf, $current_callsign, $tableData,$numofqsos,$qso,$orientation,$grid=true){ + function generateLabel($pdf, $current_callsign, $tableData,$numofqsos,$qso,$orientation,$grid=true, $via=false){ $builder = new \AsciiTable\Builder(); $builder->addRows($tableData); $text = "Confirming QSO".($numofqsos>1 ? 's' : '')." with "; - $text .= $current_callsign."\n"; + $text .= $current_callsign; + if (($via) && ($qso['via'] ?? '' != '')) { + $text.=' via '.substr($qso['via'],0,8); + } + $text .= "\n"; $text .= $builder->renderTable(); if($qso['sat'] != "") { if (($qso['sat_mode'] == '') && ($qso['sat_band_rx'] !== '')) { diff --git a/application/views/labels/startatform.php b/application/views/labels/startatform.php index a9de4d26..8bcf78ce 100644 --- a/application/views/labels/startatform.php +++ b/application/views/labels/startatform.php @@ -5,6 +5,12 @@ +
+ +
+ +
+
From 8e6c4733d96431c09fa9fbd000658da2901857f3 Mon Sep 17 00:00:00 2001 From: int2001 Date: Thu, 26 Oct 2023 09:37:25 +0000 Subject: [PATCH 02/16] Added "QSL via" also to LBA --- application/controllers/Labels.php | 2 +- application/language/bulgarian/filter_lang.php | 1 + application/language/chinese_simplified/filter_lang.php | 1 + application/language/czech/filter_lang.php | 1 + application/language/dutch/filter_lang.php | 1 + application/language/english/filter_lang.php | 1 + application/language/finnish/filter_lang.php | 1 + application/language/french/filter_lang.php | 1 + application/language/german/filter_lang.php | 1 + application/language/greek/filter_lang.php | 1 + application/language/italian/filter_lang.php | 1 + application/language/polish/filter_lang.php | 1 + application/language/russian/filter_lang.php | 1 + application/language/spanish/filter_lang.php | 1 + application/language/swedish/filter_lang.php | 1 + application/language/turkish/filter_lang.php | 1 + application/views/logbookadvanced/startatform.php | 6 ++++++ assets/js/sections/logbookadvanced.js | 2 +- 18 files changed, 23 insertions(+), 2 deletions(-) diff --git a/application/controllers/Labels.php b/application/controllers/Labels.php index cf0b966c..76a514f3 100644 --- a/application/controllers/Labels.php +++ b/application/controllers/Labels.php @@ -332,7 +332,7 @@ class Labels extends CI_Controller { $text = "Confirming QSO".($numofqsos>1 ? 's' : '')." with "; $text .= $current_callsign; if (($via) && ($qso['via'] ?? '' != '')) { - $text.=' via '.substr($qso['via'],0,8); + $text.=' | send via '.substr($qso['via'],0,8); } $text .= "\n"; $text .= $builder->renderTable(); diff --git a/application/language/bulgarian/filter_lang.php b/application/language/bulgarian/filter_lang.php index 58fce8eb..b34f9a4f 100644 --- a/application/language/bulgarian/filter_lang.php +++ b/application/language/bulgarian/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/language/chinese_simplified/filter_lang.php b/application/language/chinese_simplified/filter_lang.php index 58fce8eb..b34f9a4f 100644 --- a/application/language/chinese_simplified/filter_lang.php +++ b/application/language/chinese_simplified/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/language/czech/filter_lang.php b/application/language/czech/filter_lang.php index 58fce8eb..b34f9a4f 100644 --- a/application/language/czech/filter_lang.php +++ b/application/language/czech/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/language/dutch/filter_lang.php b/application/language/dutch/filter_lang.php index 58fce8eb..b34f9a4f 100644 --- a/application/language/dutch/filter_lang.php +++ b/application/language/dutch/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/language/english/filter_lang.php b/application/language/english/filter_lang.php index 73574aa2..280429bd 100644 --- a/application/language/english/filter_lang.php +++ b/application/language/english/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/language/finnish/filter_lang.php b/application/language/finnish/filter_lang.php index 58fce8eb..b34f9a4f 100644 --- a/application/language/finnish/filter_lang.php +++ b/application/language/finnish/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/language/french/filter_lang.php b/application/language/french/filter_lang.php index 0f5c24a8..648e0419 100644 --- a/application/language/french/filter_lang.php +++ b/application/language/french/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/language/german/filter_lang.php b/application/language/german/filter_lang.php index bf614584..02aff861 100644 --- a/application/language/german/filter_lang.php +++ b/application/language/german/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Erhalten (Elektronisch)'; $lang['filter_actions_create_adif'] = 'Erstelle ADIF'; $lang['filter_actions_print_label'] = 'Label drucken'; $lang['filter_actions_start_print_title'] = 'Label Drucken'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Mit Planquadrat?'; $lang['filter_actions_start_print'] = 'Druck starten bei?'; $lang['filter_actions_print'] = 'Drucken'; diff --git a/application/language/greek/filter_lang.php b/application/language/greek/filter_lang.php index 58fce8eb..b34f9a4f 100644 --- a/application/language/greek/filter_lang.php +++ b/application/language/greek/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/language/italian/filter_lang.php b/application/language/italian/filter_lang.php index 58fce8eb..b34f9a4f 100644 --- a/application/language/italian/filter_lang.php +++ b/application/language/italian/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/language/polish/filter_lang.php b/application/language/polish/filter_lang.php index 58fce8eb..b34f9a4f 100644 --- a/application/language/polish/filter_lang.php +++ b/application/language/polish/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/language/russian/filter_lang.php b/application/language/russian/filter_lang.php index 58fce8eb..b34f9a4f 100644 --- a/application/language/russian/filter_lang.php +++ b/application/language/russian/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/language/spanish/filter_lang.php b/application/language/spanish/filter_lang.php index 58fce8eb..b34f9a4f 100644 --- a/application/language/spanish/filter_lang.php +++ b/application/language/spanish/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/language/swedish/filter_lang.php b/application/language/swedish/filter_lang.php index 58fce8eb..b34f9a4f 100644 --- a/application/language/swedish/filter_lang.php +++ b/application/language/swedish/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/language/turkish/filter_lang.php b/application/language/turkish/filter_lang.php index 58fce8eb..b34f9a4f 100644 --- a/application/language/turkish/filter_lang.php +++ b/application/language/turkish/filter_lang.php @@ -115,6 +115,7 @@ $lang['filter_actions_recv_electronic'] = 'Received (Electronic)'; $lang['filter_actions_create_adif'] = 'Create ADIF'; $lang['filter_actions_print_label'] = 'Print Label'; $lang['filter_actions_start_print_title'] = 'Print Labels'; +$lang['filter_actions_print_include_via'] = "Include Via"; $lang['filter_actions_print_include_grid'] = 'Include Grid?'; $lang['filter_actions_start_print'] = 'Start printing at?'; $lang['filter_actions_print'] = 'Print'; diff --git a/application/views/logbookadvanced/startatform.php b/application/views/logbookadvanced/startatform.php index f5672d79..463f00cc 100644 --- a/application/views/logbookadvanced/startatform.php +++ b/application/views/logbookadvanced/startatform.php @@ -5,6 +5,12 @@
+
+ +
+ +
+
diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 1200ccbb..dd9f9f07 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -774,7 +774,7 @@ function printlabel() { data: {'id': JSON.stringify(id_list, null, 2), 'startat': $('#startat').val(), 'grid': $('#gridlabel')[0].checked, - + 'via': $('#via')[0].checked, }, xhr:function(){ var xhr = new XMLHttpRequest(); From 0e46192055dee6981e979eeff5b142c24b01eb5b Mon Sep 17 00:00:00 2001 From: int2001 Date: Thu, 26 Oct 2023 11:29:58 +0000 Subject: [PATCH 03/16] Changed printed text to "via [via]" from " | send via [via]" --- application/controllers/Labels.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Labels.php b/application/controllers/Labels.php index 76a514f3..cf0b966c 100644 --- a/application/controllers/Labels.php +++ b/application/controllers/Labels.php @@ -332,7 +332,7 @@ class Labels extends CI_Controller { $text = "Confirming QSO".($numofqsos>1 ? 's' : '')." with "; $text .= $current_callsign; if (($via) && ($qso['via'] ?? '' != '')) { - $text.=' | send via '.substr($qso['via'],0,8); + $text.=' via '.substr($qso['via'],0,8); } $text .= "\n"; $text .= $builder->renderTable(); From 310736d18f2faf5aec5b57eb4179a056b3afc217 Mon Sep 17 00:00:00 2001 From: phl0 Date: Thu, 26 Oct 2023 23:30:48 +0200 Subject: [PATCH 04/16] Show number of unassigned QSOs in Maintenance --- application/models/Logbook_model.php | 2 +- application/views/maintenance/main.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 90bdad19..6a48fbcc 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -4112,7 +4112,7 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = $this->db->where('station_id =', NULL); $query = $this->db->get($this->config->item('table_name')); if($query->num_rows() >= 1) { - return 1; + return $query->num_rows(); } else { return 0; } diff --git a/application/views/maintenance/main.php b/application/views/maintenance/main.php index fef8627d..1cc03355 100644 --- a/application/views/maintenance/main.php +++ b/application/views/maintenance/main.php @@ -15,7 +15,7 @@
= 1) { ?>

Please reassign those QSOs to an existing station location:

From 14c656e676bcd6e447de37a9c375b69785971dd0 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 27 Oct 2023 08:53:58 +0200 Subject: [PATCH 05/16] Show slashed zero in (e)qsl view --- application/views/eqslcard/index.php | 2 +- application/views/qslcard/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/eqslcard/index.php b/application/views/eqslcard/index.php index aaf7597e..4d258086 100644 --- a/application/views/eqslcard/index.php +++ b/application/views/eqslcard/index.php @@ -34,7 +34,7 @@ foreach ($qslarray->result() as $qsl) { echo ''; - echo '' . $qsl->COL_CALL . ''; + echo '' . str_replace("0","Ø",$qsl->COL_CALL) . ''; echo ''; echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; echo ''; diff --git a/application/views/qslcard/index.php b/application/views/qslcard/index.php index 3d71c88d..38cb3f05 100644 --- a/application/views/qslcard/index.php +++ b/application/views/qslcard/index.php @@ -36,7 +36,7 @@ foreach ($qslarray->result() as $qsl) { echo ''; - echo '' . $qsl->COL_CALL . ''; + echo '' . str_replace("0","Ø",$qsl->COL_CALL) . ''; echo ''; echo $qsl->COL_SUBMODE==null?$qsl->COL_MODE:$qsl->COL_SUBMODE; echo ''; From e6c605094e9402362d0760b71190ebfd87d695e1 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 27 Oct 2023 09:00:31 +0200 Subject: [PATCH 06/16] Also change box header --- application/views/interface_assets/footer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 51aff59d..baaa8d0a 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -2376,7 +2376,7 @@ function viewEqsl(picture, callsign) { if (callsign == null) { title = 'eQSL Card'; } else { - title = 'eQSL Card for ' + callsign; + title = 'eQSL Card for ' + callsign.replace('0', 'Ø'); } BootstrapDialog.show({ From ec348b1ca97f01b194581ce4459b93cf5edc03b4 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 27 Oct 2023 09:01:25 +0200 Subject: [PATCH 07/16] Also for QSL --- application/views/interface_assets/footer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index baaa8d0a..4ad31ff5 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -2314,7 +2314,7 @@ function viewQsl(picture, callsign) { if (callsign == null) { title = 'QSL Card'; } else { - title = 'QSL Card for ' + callsign; + title = 'QSL Card for ' + callsign.replace('0', 'Ø'); } BootstrapDialog.show({ From b284b6f5ece76eaea46fe0acc0eddd0d94823449 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 27 Oct 2023 09:54:48 +0200 Subject: [PATCH 08/16] Only show notes if present --- 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 14820e9d..ce6b69dd 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -484,7 +484,7 @@

- COL_NOTES); ?> + COL_NOTES)) { echo nl2br($row->COL_NOTES); } ?>
Date: Fri, 27 Oct 2023 13:28:53 +0200 Subject: [PATCH 09/16] Show list of unassigned QSOs --- application/controllers/Maintenance.php | 4 +-- application/models/Logbook_model.php | 4 ++- application/views/maintenance/main.php | 35 +++++++++++++++++++++++-- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/application/controllers/Maintenance.php b/application/controllers/Maintenance.php index 0e0deb2f..f6dd25c2 100644 --- a/application/controllers/Maintenance.php +++ b/application/controllers/Maintenance.php @@ -14,8 +14,8 @@ class Maintenance extends CI_Controller { $this->load->model('Stations'); $data['stations']=$this->Stations->all(); $data['page_title'] = "Maintenance"; - $data['is_there_qsos_with_no_station_id'] = $this->Logbook_model->check_for_station_id(); - if ($data['is_there_qsos_with_no_station_id']) { + $data['qsos_with_no_station_id'] = $this->Logbook_model->check_for_station_id(); + if ($data['qsos_with_no_station_id']) { $data['calls_wo_sid']=$this->Logbook_model->calls_without_station_id(); } $this->load->view('interface_assets/header', $data); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 6a48fbcc..643d4b97 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -4109,10 +4109,12 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = } public function check_for_station_id() { + $this->db->select('COL_TIME_ON, COL_CALL, COL_MODE, COL_BAND'); $this->db->where('station_id =', NULL); $query = $this->db->get($this->config->item('table_name')); + log_message('debug','SQL: '.$this->db->last_query()); if($query->num_rows() >= 1) { - return $query->num_rows(); + return $query->result(); } else { return 0; } diff --git a/application/views/maintenance/main.php b/application/views/maintenance/main.php index 1cc03355..c1c6432e 100644 --- a/application/views/maintenance/main.php +++ b/application/views/maintenance/main.php @@ -13,11 +13,42 @@
QSO-DB Maintenance
- = 1) { ?> +
+
+ + + + + + + + + + session->userdata('user_date_format')) { + $custom_date_format = $this->session->userdata('user_date_format'); + } else { + $custom_date_format = 'd.m.Y'; + } + foreach ($qsos_with_no_station_id as $qso) { + echo ''; + $timestamp = strtotime($qso->COL_TIME_ON); + echo ''; + $timestamp = strtotime($qso->COL_TIME_ON); + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + } ?> + + + +
DateTimeCallModeBand
'.date($custom_date_format, $timestamp).''.date('H:i', $timestamp).''.$qso->COL_CALL.''.$qso->COL_MODE.''.$qso->COL_BAND.'
+

Please reassign those QSOs to an existing station location:

From adb8e8d03caab4434d72d63e6fb5fb05426b642d Mon Sep 17 00:00:00 2001 From: phl0 Date: Sat, 28 Oct 2023 16:06:32 +0200 Subject: [PATCH 10/16] Allow for selection of QSOs to be reassigned --- application/controllers/Maintenance.php | 4 +-- application/models/Logbook_model.php | 39 ++++++++++++++----------- application/views/maintenance/main.php | 4 ++- assets/js/sections/maintenance.js | 27 ++++++++++++++++- 4 files changed, 53 insertions(+), 21 deletions(-) diff --git a/application/controllers/Maintenance.php b/application/controllers/Maintenance.php index f6dd25c2..5ac18615 100644 --- a/application/controllers/Maintenance.php +++ b/application/controllers/Maintenance.php @@ -29,6 +29,7 @@ class Maintenance extends CI_Controller { $this->load->model('Logbook_model'); $this->load->model('Stations'); $call = xss_clean(($this->input->post('call'))); + $qsoids = xss_clean(($this->input->post('qsoids'))); $station_profile_id = xss_clean(($this->input->post('station_id'))); // Check if target-station-id exists @@ -39,8 +40,7 @@ class Maintenance extends CI_Controller { if ($station->station_id == $station_profile_id) { $allowed=true; } } if ($allowed) { - log_message("error",$call." to ".$station_profile_id); - $status=$this->Logbook_model->update_all_station_ids($station_profile_id,$call); + $status=$this->Logbook_model->update_station_ids($station_profile_id,$call,$qsoids); } else { $status=false; } diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 643d4b97..98cabe72 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -4109,7 +4109,7 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = } public function check_for_station_id() { - $this->db->select('COL_TIME_ON, COL_CALL, COL_MODE, COL_BAND'); + $this->db->select('COL_PRIMARY_KEY, COL_TIME_ON, COL_CALL, COL_MODE, COL_BAND'); $this->db->where('station_id =', NULL); $query = $this->db->get($this->config->item('table_name')); log_message('debug','SQL: '.$this->db->last_query()); @@ -4167,24 +4167,29 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = } } - public function update_all_station_ids($station_id,$station_callsign) { + public function update_station_ids($station_id,$station_callsign,$qsoids) { - $data = array( - 'station_id' => $station_id, - ); + if (! empty($qsoids)) { + $data = array( + 'station_id' => $station_id, + ); - $this->db->where(array('station_id' => NULL)); - if ($station_callsign == '') { - $this->db->where(array('col_station_callsign' => NULL)); - } else { - $this->db->where('col_station_callsign', $station_callsign); - } - $this->db->update($this->config->item('table_name'), $data); - if ($this->db->affected_rows() > 0) { - return TRUE; - } else { - return FALSE; - } + $this->db->where_in('COL_PRIMARY_KEY', $qsoids); + $this->db->where(array('station_id' => NULL)); + if ($station_callsign == '') { + $this->db->where(array('col_station_callsign' => NULL)); + } else { + $this->db->where('col_station_callsign', $station_callsign); + } + $this->db->update($this->config->item('table_name'), $data); + if ($this->db->affected_rows() > 0) { + return TRUE; + } else { + return FALSE; + } + } else { + return FALSE; + } } public function parse_frequency($frequency) diff --git a/application/views/maintenance/main.php b/application/views/maintenance/main.php index c1c6432e..4a93da3c 100644 --- a/application/views/maintenance/main.php +++ b/application/views/maintenance/main.php @@ -22,6 +22,7 @@ + @@ -35,6 +36,7 @@ } foreach ($qsos_with_no_station_id as $qso) { echo ''; + echo ''; $timestamp = strtotime($qso->COL_TIME_ON); echo ''; $timestamp = strtotime($qso->COL_TIME_ON); @@ -69,7 +71,7 @@ foreach ($stations->result() as $station) { $options.=''; } - echo $options.''; + echo $options.''; } ?>
Date Time Call
'.date($custom_date_format, $timestamp).'
diff --git a/assets/js/sections/maintenance.js b/assets/js/sections/maintenance.js index 69cb91e3..b8bafad8 100644 --- a/assets/js/sections/maintenance.js +++ b/assets/js/sections/maintenance.js @@ -1,8 +1,15 @@ function reassign(call,target_profile_id) { + let qsoids = []; + let elements = document.getElementsByName("cBox[]"); + elements.forEach((item) => { + if (item.checked) { + qsoids.push(item.value); + } + }); $.ajax({ url: base_url + 'index.php/maintenance/reassign', type: 'post', - data: {'call': call, 'station_id': target_profile_id}, + data: {'call': call, 'station_id': target_profile_id, 'qsoids' : qsoids}, success: function (resu) { if (resu.status) { location.reload(); @@ -10,3 +17,21 @@ function reassign(call,target_profile_id) { } }); } + +function toggleAll(source) { + console.log('test'); + if (source.checked) { + let elements = document.getElementsByName("cBox[]"); + elements.forEach((item) => { + item.checked = true; + }) + source.checked = true; + } + if (!source.checked) { + let elements = document.getElementsByName("cBox[]"); + elements.forEach((item) => { + item.checked = false; + }) + source.checked = false; + } +} From 90a05292031ac97833626fe1c73fa1d22f4a37ce Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 29 Oct 2023 02:43:22 +0200 Subject: [PATCH 11/16] Show correct callsign left of dropdown menu --- application/views/maintenance/main.php | 2 +- assets/js/sections/maintenance.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/application/views/maintenance/main.php b/application/views/maintenance/main.php index 4a93da3c..115419ba 100644 --- a/application/views/maintenance/main.php +++ b/application/views/maintenance/main.php @@ -66,7 +66,7 @@ '.$call['COL_STATION_CALLSIGN'].''; $options=''; foreach ($stations->result() as $station) { $options.=''; diff --git a/assets/js/sections/maintenance.js b/assets/js/sections/maintenance.js index b8bafad8..9c66af94 100644 --- a/assets/js/sections/maintenance.js +++ b/assets/js/sections/maintenance.js @@ -35,3 +35,9 @@ function toggleAll(source) { source.checked = false; } } + +function updateCallsign(item) { + let text = item.options[item.selectedIndex].text + let call = text.substr(text.lastIndexOf('(')+1,(text.lastIndexOf(')')-text.lastIndexOf('(')-1)); + document.getElementById("station_call").innerHTML = call; +} From 5c40fa21d73a291489e9f21596dc13f26f74399d Mon Sep 17 00:00:00 2001 From: phl0 Date: Sun, 29 Oct 2023 11:33:04 +0100 Subject: [PATCH 12/16] Fix misaligned thead and tbody --- application/views/maintenance/main.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/maintenance/main.php b/application/views/maintenance/main.php index 115419ba..8c276ced 100644 --- a/application/views/maintenance/main.php +++ b/application/views/maintenance/main.php @@ -29,6 +29,8 @@ Mode Band + + session->userdata('user_date_format')) { $custom_date_format = $this->session->userdata('user_date_format'); } else { @@ -46,8 +48,6 @@ echo ''.$qso->COL_BAND.''; echo ''; } ?> - -
From 70504c50228c73da95b6ba6994380d087ab4a236 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Mon, 30 Oct 2023 12:15:08 +0100 Subject: [PATCH 13/16] [Dashboard] Added some warnings --- application/models/Setup_model.php | 35 +++++++++++++++++++++++++++ application/views/dashboard/index.php | 26 +++++++++++++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 application/models/Setup_model.php diff --git a/application/models/Setup_model.php b/application/models/Setup_model.php new file mode 100644 index 00000000..79f3319e --- /dev/null +++ b/application/models/Setup_model.php @@ -0,0 +1,35 @@ +db->query($sql); + + $result = $query->result(); + + return count($result); + } + + function getLogbookCount() { + $userid = xss_clean($this->session->userdata('user_id')); + $sql = 'select count(*) from station_logbooks where user_id =' . $userid; + $query = $this->db->query($sql); + + $result = $query->result(); + + return count($result); + } + + function getLocationCount() { + $userid = xss_clean($this->session->userdata('user_id')); + $sql = 'select count(*) from station_profile where user_id =' . $userid; + $query = $this->db->query($sql); + + $result = $query->result(); + + return count($result); + } +} + +?> diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 38ad16c9..acb196a9 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -48,7 +48,31 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) { ?>
config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) { ?> - + + + + + + + + + + + + + + + + + optionslib->get_option('dashboard_banner') != "false") { ?> = 1) { ?>