From 274ecf85cb2d107369aad8cbee597dc33b76cc2f Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sat, 19 Feb 2022 19:46:07 +0100 Subject: [PATCH] [QRB Link] Added globe link to dashboard, logbook and qso. Spawns QRB window. --- application/views/dashboard/index.php | 10 +++++++++- application/views/interface_assets/footer.php | 13 ++++++++----- application/views/qrbcalc/index.php | 6 +++--- application/views/view_log/partial/log_ajax.php | 10 +++++++++- application/views/view_log/qso.php | 4 ++-- 5 files changed, 31 insertions(+), 12 deletions(-) diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index 600c74f6..66e518f3 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -22,12 +22,20 @@ function echo_table_col($row, $name) { case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY))) . ''; break; case 'IOTA': echo '' . ($row->COL_IOTA) . ''; break; case 'SOTA': echo '' . ($row->COL_SOTA_REF) . ''; break; - case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE . ''; break; + case 'Grid': echo ''; echoQrbCalcLink($row->COL_VUCC_GRIDS, $row->COL_GRIDSQUARE); echo ''; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); } echo ''; break; case 'State': echo '' . ($row->COL_STATE) . ''; break; case 'Operator': echo '' . ($row->COL_OPERATOR) . ''; break; } } + +function echoQrbCalcLink($grid, $vucc) { + if (strlen($grid) != 0) { + echo $grid . ' '; + } else if (strlen($vucc) != 0) { + echo $vucc .' '; + } +} ?>
config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) { ?> diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 66559514..e69ce821 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -430,7 +430,7 @@ document.onkeyup = function(e) { } }; -function spawnQrbCalculator() { +function spawnQrbCalculator(locator2) { $.ajax({ url: base_url + 'index.php/qrbcalc', type: 'post', @@ -442,7 +442,10 @@ function spawnQrbCalculator() { nl2br: false, message: html, onshown: function(dialog) { - + if (locator2 !== undefined) { + $("#qrbcalc_locator2").val(locator2); + calculateQrb(); + } }, buttons: [{ label: 'Close', @@ -455,9 +458,9 @@ function spawnQrbCalculator() { }); } -function calculateQrb(form) { - let locator1 = form.locator1.value; - let locator2 = form.locator2.value; +function calculateQrb() { + let locator1 = $("#qrbcalc_locator1").val(); + let locator2 = $("#qrbcalc_locator2").val(); $(".qrbalert").remove(); diff --git a/application/views/qrbcalc/index.php b/application/views/qrbcalc/index.php index 27ae895e..70c699b4 100644 --- a/application/views/qrbcalc/index.php +++ b/application/views/qrbcalc/index.php @@ -2,14 +2,14 @@
Locator 1
- " aria-label="locator1"> + " aria-label="locator1">
Locator 2
- +
@@ -17,7 +17,7 @@
- +
diff --git a/application/views/view_log/partial/log_ajax.php b/application/views/view_log/partial/log_ajax.php index 4933884b..4c2ac2bd 100644 --- a/application/views/view_log/partial/log_ajax.php +++ b/application/views/view_log/partial/log_ajax.php @@ -23,12 +23,20 @@ function echo_table_col($row, $name) { case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY))) . ''; break; case 'IOTA': echo '' . ($row->COL_IOTA) . ''; break; case 'SOTA': echo '' . ($row->COL_SOTA_REF) . ''; break; - case 'Grid': echo ''; echo strlen($row->COL_GRIDSQUARE)==0?$row->COL_VUCC_GRIDS:$row->COL_GRIDSQUARE . ''; break; + case 'Grid': echo ''; echoQrbCalcLink($row->COL_VUCC_GRIDS, $row->COL_GRIDSQUARE); echo ''; break; case 'Band': echo ''; if($row->COL_SAT_NAME != null) { echo $row->COL_SAT_NAME; } else { echo strtolower($row->COL_BAND); } echo ''; break; case 'State': echo '' . ($row->COL_STATE) . ''; break; case 'Operator':echo '' . ($row->COL_OPERATOR) . ''; break; } } + +function echoQrbCalcLink($grid, $vucc) { + if (strlen($grid) != 0) { + echo $grid . ' '; + } else if (strlen($vucc) != 0) { + echo $vucc .' '; + } +} ?> diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index f54127a8..3334540b 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -97,7 +97,7 @@ COL_GRIDSQUARE != null) { ?> Gridsquare: - COL_GRIDSQUARE; ?> + COL_GRIDSQUARE; ?> @@ -133,7 +133,7 @@ COL_VUCC_GRIDS != null) { ?> Gridsquare (Multi): - COL_VUCC_GRIDS; ?> + COL_VUCC_GRIDS; ?>