From b6eb05a53d2337d45fd0cea44282a279992849d5 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 22 Feb 2024 16:56:21 +0000 Subject: [PATCH] Update footer.php --- application/views/interface_assets/footer.php | 4932 +++++++++-------- 1 file changed, 2523 insertions(+), 2409 deletions(-) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index a0c2d2bd..4b35c3a8 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -1,14 +1,14 @@ uri->segment(1) == "activators") { ?> - + - - + + - - - - + + + + @@ -54,11 +54,11 @@ document.addEventListener('htmx:afterSwap', function(event) { $('[data-bs-toggle="tooltip"]').tooltip(); }); - + session->userdata('user_id') != null) { +if ($this->session->userdata('user_id') != null) { $versionDialog = $this->optionslib->get_option('version_dialog'); if (empty($versionDialog)) { $this->optionslib->update('version_dialog', 'release_notes', 'yes'); @@ -67,23 +67,23 @@ if($this->session->userdata('user_id') != null) { if (empty($versionDialogHeader)) { $this->optionslib->update('version_dialog_header', $this->lang->line('options_version_dialog'), 'yes'); } - if($versionDialog != "disabled") { - $confirmed = $this->user_options_model->get_options('version_dialog', array('option_name'=>'confirmed'))->result(); - $confirmation_value = (isset($confirmed[0]->option_value))?$confirmed[0]->option_value:'false'; + if ($versionDialog != "disabled") { + $confirmed = $this->user_options_model->get_options('version_dialog', array('option_name' => 'confirmed'))->result(); + $confirmation_value = (isset($confirmed[0]->option_value)) ? $confirmed[0]->option_value : 'false'; if ($confirmation_value != 'true') { $this->user_options_model->set_option('version_dialog', 'confirmed', array('boolean' => $confirmation_value)); - ?> + } + } + } + ?> uri->segment(1) == "oqrs") { ?> - + uri->segment(1) == "options") { ?> @@ -94,21 +94,20 @@ if($this->session->userdata('user_id') != null) { type: 'POST', }); }); - -uri->segment(1) == "awards" && ($this->uri->segment(2) == "cq") ) { ?> +uri->segment(1) == "awards" && ($this->uri->segment(2) == "cq")) { ?> - + -uri->segment(1) == "awards" && ($this->uri->segment(2) == "iota") ) { ?> - +uri->segment(1) == "awards" && ($this->uri->segment(2) == "iota")) { ?> + -uri->segment(1) == "awards" && ($this->uri->segment(2) == "dxcc") ) { ?> - +uri->segment(1) == "awards" && ($this->uri->segment(2) == "dxcc")) { ?> + uri->segment(1) == "statistics") { ?> @@ -128,42 +127,43 @@ if($this->session->userdata('user_id') != null) { -uri->segment(1) == "maintenance" ) { ?> - +uri->segment(1) == "maintenance") { ?> + -uri->segment(1) == "adif" ) { ?> - +uri->segment(1) == "adif") { ?> + -uri->segment(1) == "notes" && ($this->uri->segment(2) == "add" || $this->uri->segment(2) == "edit") ) { ?> +uri->segment(1) == "notes" && ($this->uri->segment(2) == "add" || $this->uri->segment(2) == "edit")) { ?> - - + + uri->segment(1) == "logbooks" && $this->uri->segment(2) == "edit") { ?> - + - + uri->segment(1) == "station") { ?> - - + + uri->segment(1) == "logbooks") { ?> - + uri->segment(1) == "debug") { ?> - + $(function() { + $('[data-bs-toggle="tooltip"]').tooltip({ + 'delay': { + show: 500, + hide: 0 + }, + 'placement': 'right' + }); + }); + uri->segment(1) == "api" && $this->uri->segment(2) == "help") { ?> - + $(function() { + $('[data-bs-toggle="tooltip"]').tooltip({ + 'delay': { + show: 500, + hide: 0 + }, + 'placement': 'right' + }); + }); + uri->segment(1) == "search" && $this->uri->segment(2) == "filter") { ?> - + - + function save_edited_query(id) { + $('#description_' + id).attr('contenteditable', 'false'); + $('#edit_' + id).html('Edit'); + $.ajax({ + url: base_url + 'index.php/search/save_edited_query', + type: 'post', + data: { + id: id, + description: $('#description_' + id).html(), + }, + success: function(html) { + $('#edit_' + id).html('Edit'); // Change to edit button + $(".bootstrap-dialog-message").prepend('
The query description has been updated!
'); + $("#querydropdown option[value='" + id + "']").text($('#description_' + id).html()); // Change text in dropdown + }, + error: function() { + $(".bootstrap-dialog-message").prepend('
Something went wrong with the save. Please try again!
'); + }, + }); + } + + function edit_stored_query_dialog() { + $(".alert").remove(); + $.ajax({ + url: base_url + 'index.php/search/get_stored_queries', + type: 'post', + success: function(html) { + BootstrapDialog.show({ + title: 'Stored Queries', + size: BootstrapDialog.SIZE_WIDE, + cssClass: 'queries-dialog', + nl2br: false, + message: html, + buttons: [{ + label: lang_admin_close, + action: function(dialogItself) { + dialogItself.close(); + } + }] + }); + } + }); + } + + $('#btn-get').on('click', function() { + $(".alert").remove(); + var result = $('#builder').queryBuilder('getRules'); + if (!$.isEmptyObject(result)) { + $(".searchbutton").addClass('running'); + $(".searchbutton").prop('disabled', true); + + $.post("", { + search: JSON.stringify(result, null, 2), + temp: "testvar" + }) + .done(function(data) { + $('.exportbutton').html(''); + + $('.card-body.result').empty(); + $(".search-results-box").show(); + + $('.card-body.result').append(data); + $('.table').DataTable({ + "pageLength": 25, + responsive: false, + ordering: false, + "scrollY": "400px", + "scrollCollapse": true, + "paging": false, + "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, + dom: 'Bfrtip', + buttons: [ + 'csv' + ] + }); + // change color of csv-button if dark mode is chosen + if (isDarkModeTheme()) { + $(".buttons-csv").css("color", "white"); + } + $('[data-bs-toggle="tooltip"]').tooltip(); + $(".searchbutton").removeClass('running'); + $(".searchbutton").prop('disabled', false); + $("#btn-save").show(); + $('.table-responsive .dropdown-toggle').off('mouseenter').on('mouseenter', function() { + showQsoActionsMenu($(this).closest('.dropdown')); + }); + }); + } else { + BootstrapDialog.show({ + title: 'Stored Queries', + type: BootstrapDialog.TYPE_WARNING, + size: BootstrapDialog.SIZE_NORMAL, + cssClass: 'queries-dialog', + nl2br: false, + message: 'You need to make a query before you search!', + buttons: [{ + label: lang_admin_close, + action: function(dialogItself) { + dialogItself.close(); + } + }] + }); + } + }); + + $('#btn-set').on('click', function() { + //$('#builder').queryBuilder('setRules', rules_basic); + var result = $('#builder').queryBuilder('getRules'); + if (!$.isEmptyObject(result)) { + rules_basic = result; + } + }); + + //When rules changed : + $('#builder').on('getRules.queryBuilder.filter', function(e) { + //$log.info(e.value); + }); + uri->segment(1) == "map" && $this->uri->segment(2) == "custom") { ?> - - + + -uri->segment(1) == "" || $this->uri->segment(1) == "dashboard" ) { ?> - - +uri->segment(1) == "" || $this->uri->segment(1) == "dashboard") { ?> + + uri->segment(1) == "radio") { ?> - - + }); + }, 2000); + }); + uri->segment(1) == "search") { ?> - + uri->segment(1) == "logbook" && $this->uri->segment(2) != "view") { ?> - - + + uri->segment(1) == "qso") { ?> - -session->userdata('isWinkeyEnabled')) { ?> - -assets/js/sections/qso.js"> + session->userdata('isWinkeyEnabled')) { ?> + + optionslib->get_option('dxcache_url') != ''){ ?> - + if ($this->optionslib->get_option('dxcache_url') != '') { ?> + -load->model('stations'); @@ -1016,803 +1060,823 @@ $($('#callsign')).on('keypress',function(e) { } else { $user_gridsquare = $active_station_info->station_gridsquare; } -?> + ?> - - - - if ( ! manual ) { - $(function($) { - resetTimers(0); + + var qthloc = ""; + if (num >= 2) qthloc += String.fromCharCode(yn[0] + 0x41) + String.fromCharCode(yn[1] + 0x41); + if (num >= 4) qthloc += String.fromCharCode(yn[2] + 0x30) + String.fromCharCode(yn[3] + 0x30); + if (num >= 6) qthloc += String.fromCharCode(yn[4] + 0x41) + String.fromCharCode(yn[5] + 0x41); + if (num >= 8) qthloc += ' ' + String.fromCharCode(yn[6] + 0x30) + String.fromCharCode(yn[7] + 0x30); + if (num >= 10) qthloc += String.fromCharCode(yn[8] + 0x61) + String.fromCharCode(yn[9] + 0x61); + return qthloc; + } + + -uri->segment(1) == "qso" || ($this->uri->segment(1) == "contesting" && $this->uri->segment(2) != "add")) { ?> +uri->segment(1) == "qso" || ($this->uri->segment(1) == "contesting" && $this->uri->segment(2) != "add")) { ?> + // If a radios selected from drop down select radio update. + $('.radios').change(updateFromCAT); + + // If no radio is selected clear data + $(".radios").change(function() { + if ($(".radios option:selected").val() == 0) { + $("#sat_name").val(""); + $("#sat_mode").val(""); + $("#frequency").val(""); + $("#frequency_rx").val(""); + $("#band_rx").val(""); + $("#selectPropagation").val($("#selectPropagation option:first").val()); + $(".radio_timeout_error").remove(); + } + }); + uri->segment(1) == "logbook" && $this->uri->segment(2) == "view") { ?> - + mymap.on('click', onMapClick); + uri->segment(1) == "update") { ?> - + uri->segment(1) == "gridsquares" && !empty($this->uri->segment(2))) { ?> - - + + - + var bands_available = ; + $('#gridsquare_bands').append('') + $.each(bands_available, function(key, value) { + $('#gridsquare_bands') + .append($("") + .attr("value", value) + .text(value)); + }); + + var num = "uri->segment(3); ?>"; + $("#gridsquare_bands option").each(function() { + if ($(this).val() == num) { // EDITED THIS LINE + $(this).attr("selected", "selected"); + } + }); + + $(function() { + // bind change event to select + $('#gridsquare_bands').on('change', function() { + var url = $(this).val(); // get selected value + if (url) { // require a URL + window.location = "" + url + } + return false; + }); + }); + + uri->segment(1) == "activated_grids" && !empty($this->uri->segment(2))) { ?> - + - + map.on('click', onMapClick); + + function onMapClick(event) { + var LatLng = event.latlng; + var lat = LatLng.lat; + var lng = LatLng.lng; + var locator = LatLng2Loc(lat, lng, 10); + var loc_4char = locator.substring(0, 4); + + if (map.getZoom() > 2) { + session->userdata('user_callsign')) { ?> + var band = ''; + var search_type = "uri->segment(2); ?>"; + if (search_type == "satellites") { + band = 'SAT'; + } else { + band = "uri->segment(3); ?>"; + } + $(".modal-body").empty(); + $.ajax({ + url: base_url + 'index.php/activated_grids/qso_details_ajax', + type: 'post', + data: { + 'Searchphrase': loc_4char, + 'Band': band, + 'Mode': 'All', + }, + success: function(html) { + $(".modal-body").html(html); + $(".modal-body table").addClass('table-sm'); + $(".modal-body h5").empty(); + var count = $('.table tr').length; + count = count - 1; + $('#qso_count').text(count); + if (count > 1) { + $('#gt1_qso').text("s"); + } else { + $('#gt1_qso').text(""); + } + + if (count > 0) { + $('#square_number').text(loc_4char); + $('#exampleModal').modal('show'); + $('[data-bs-toggle="tooltip"]').tooltip({ + boundary: 'window' + }); + } + $('.table-responsive .dropdown-toggle').off('mouseenter').on('mouseenter', function() { + showQsoActionsMenu($(this).closest('.dropdown')); + }); + } + }); + + } + }; + + uri->segment(1) == "activated_grids" && $this->uri->segment(2) == "band") { ?> + + var bands_available = ; + $('#gridsquare_bands').append('') + $.each(bands_available, function(key, value) { + $('#gridsquare_bands') + .append($("") + .attr("value", value) + .text(value)); + }); + + var num = "uri->segment(3); ?>"; + $("#gridsquare_bands option").each(function() { + if ($(this).val() == num) { // EDITED THIS LINE + $(this).attr("selected", "selected"); + } + }); + + $(function() { + // bind change event to select + $('#gridsquare_bands').on('change', function() { + var url = $(this).val(); // get selected value + if (url) { // require a URL + window.location = "" + url + } + return false; + }); + }); + + uri->segment(1) == "dayswithqso") { ?> - + uri->segment(1) == "distances") { ?> @@ -1820,188 +1884,83 @@ $(document).ready(function(){ - + - uri->segment(1) == "hrdlog") { ?> - - - uri->segment(1) == "qrz") { ?> - - - uri->segment(1) == "webadif") { ?> - - +uri->segment(1) == "hrdlog") { ?> + + +uri->segment(1) == "qrz") { ?> + + +uri->segment(1) == "webadif") { ?> + + - + } + }); + } + uri->segment(2) == "dxcc") { ?> - - - -uri->segment(2) == "waja") { ?> - - - -uri->segment(2) == "vucc_band") { ?> - - -uri->segment(2) == "iota") { ?> - + + +uri->segment(2) == "waja") { ?> + + + +uri->segment(2) == "vucc_band") { ?> + + + +uri->segment(2) == "iota") { ?> + +uri->segment(1) == "timeline") { ?> + + +uri->segment(1) == "activators") { ?> + + + +uri->segment(1) == "mode") { ?> + + + +uri->segment(1) == "band") { ?> + + + +uri->segment(1) == "accumulated") { ?> + + + + +uri->segment(1) == "timeplotter") { ?> + + + + + + + +uri->segment(1) == "qsl" || $this->uri->segment(1) == "eqsl") { + // 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'); + } + + switch ($custom_date_format) { + case 'd/m/y': + $usethisformat = 'D/MM/YY'; + break; + case 'd/m/Y': + $usethisformat = 'D/MM/YYYY'; + break; + case 'm/d/y': + $usethisformat = 'MM/D/YY'; + break; + case 'm/d/Y': + $usethisformat = 'MM/D/YYYY'; + break; + case 'd.m.Y': + $usethisformat = 'D.MM.YYYY'; + break; + case 'y/m/d': + $usethisformat = 'YY/MM/D'; + break; + case 'Y-m-d': + $usethisformat = 'YYYY-MM-D'; + break; + case 'M d, Y': + $usethisformat = 'MMM D, YYYY'; + break; + case 'M d, y': + $usethisformat = 'MMM D, YY'; + break; + } + +?> + + + + + + + + + + + + +uri->segment(1) == "contesting" && ($this->uri->segment(2) != "add" && $this->uri->segment(2) != "edit")) { ?> + + + + +uri->segment(1) == "station") { ?> + - function qso_save() { - var baseURL= ""; - var myform = document.getElementById("qsoform"); - var fd = new FormData(myform); - $.ajax({ - url: baseURL + 'index.php/qso/qso_save_ajax', - data: fd, - cache: false, - processData: false, - contentType: false, - type: 'POST', - success: function (dataofconfirm) { - $(".edit-dialog").modal('hide'); - $(".qso-dialog").modal('hide'); - uri->segment(1) != "search" && $this->uri->segment(2) != "filter" && $this->uri->segment(1) != "qso" && $this->uri->segment(1) != "logbookadvanced") { ?>location.reload(); - }, - error: function(xhr, status, error) { - console.log(xhr.responseText); - } - }); - } - - uri->segment(1) == "timeline") { ?> - - - uri->segment(1) == "activators") { ?> - - - - uri->segment(1) == "mode") { ?> - - - - uri->segment(1) == "band") { ?> - - - -uri->segment(1) == "accumulated") { ?> - - -uri->segment(1) == "timeplotter") { ?> - - - - - - - -uri->segment(1) == "qsl" || $this->uri->segment(1) == "eqsl") { - // 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'); - } - - switch ($custom_date_format) { - case 'd/m/y': $usethisformat = 'D/MM/YY';break; - case 'd/m/Y': $usethisformat = 'D/MM/YYYY';break; - case 'm/d/y': $usethisformat = 'MM/D/YY';break; - case 'm/d/Y': $usethisformat = 'MM/D/YYYY';break; - case 'd.m.Y': $usethisformat = 'D.MM.YYYY';break; - case 'y/m/d': $usethisformat = 'YY/MM/D';break; - case 'Y-m-d': $usethisformat = 'YYYY-MM-D';break; - case 'M d, Y': $usethisformat = 'MMM D, YYYY';break; - case 'M d, y': $usethisformat = 'MMM D, YY';break; - } - - ?> - - +uri->segment(2) == "counties" || $this->uri->segment(2) == "counties_details") { ?> +uri->segment(2) == "sig_details") { ?> + - + + +uri->segment(1) == "contesting" && $this->uri->segment(2) == "add") { ?> + + + +uri->segment(1) == "themes") { ?> + - - - - -uri->segment(1) == "contesting" && ($this->uri->segment(2) != "add" && $this->uri->segment(2) != "edit")) { ?> - - - - -uri->segment(1) == "station") { ?> - - - - -uri->segment(2) == "counties" || $this->uri->segment(2) == "counties_details") { ?> - - - -uri->segment(2) == "sig_details") { ?> - - - -uri->segment(1) == "contesting" && $this->uri->segment(2) == "add") { ?> - - - -uri->segment(1) == "themes") { ?> - uri->segment(1) == "eqsl") { ?> - + uri->segment(1) == "awards") { - // 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'); - } - - switch ($custom_date_format) { - case 'd/m/y': $usethisformat = 'D/MM/YY';break; - case 'd/m/Y': $usethisformat = 'D/MM/YYYY';break; - case 'm/d/y': $usethisformat = 'MM/D/YY';break; - case 'm/d/Y': $usethisformat = 'MM/D/YYYY';break; - case 'd.m.Y': $usethisformat = 'D.MM.YYYY';break; - case 'y/m/d': $usethisformat = 'YY/MM/D';break; - case 'Y-m-d': $usethisformat = 'YYYY-MM-D';break; - case 'M d, Y': $usethisformat = 'MMM D, YYYY';break; - case 'M d, y': $usethisformat = 'MMM D, YY';break; + // 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'); } - ?> + switch ($custom_date_format) { + case 'd/m/y': + $usethisformat = 'D/MM/YY'; + break; + case 'd/m/Y': + $usethisformat = 'D/MM/YYYY'; + break; + case 'm/d/y': + $usethisformat = 'MM/D/YY'; + break; + case 'm/d/Y': + $usethisformat = 'MM/D/YYYY'; + break; + case 'd.m.Y': + $usethisformat = 'D.MM.YYYY'; + break; + case 'y/m/d': + $usethisformat = 'YY/MM/D'; + break; + case 'Y-m-d': + $usethisformat = 'YYYY-MM-D'; + break; + case 'M d, Y': + $usethisformat = 'MMM D, YYYY'; + break; + case 'M d, y': + $usethisformat = 'MMM D, YY'; + break; + } + +?> uri->segment(2) == "wwff") { ?> @@ -3018,36 +3127,35 @@ function viewEqsl(picture, callsign) { $.fn.dataTable.moment(''); $.fn.dataTable.ext.buttons.clear = { className: 'buttons-clear', - action: function ( e, dt, node, config ) { - dt.search('').draw(); + action: function(e, dt, node, config) { + dt.search('').draw(); } }; $('#wwfftable').DataTable({ "pageLength": 25, responsive: false, ordering: true, - "scrollY": "500px", + "scrollY": "500px", "scrollCollapse": true, - "paging": false, + "paging": false, "scrollX": true, "language": { url: getDataTablesLanguageUrl(), }, - "order": [ 0, 'asc' ], + "order": [0, 'asc'], dom: 'Bfrtip', - buttons: [ - { - extend: 'csv' - }, - { - extend: 'clear', - text: 'Clear' - } + buttons: [{ + extend: 'csv' + }, + { + extend: 'clear', + text: 'Clear' + } ] }); // change color of csv-button if dark mode is chosen if (isDarkModeTheme()) { - $('[class*="buttons"]').css("color", "white"); + $('[class*="buttons"]').css("color", "white"); } uri->segment(2) == "pota") { ?> @@ -3055,71 +3163,69 @@ function viewEqsl(picture, callsign) { $.fn.dataTable.moment(''); $.fn.dataTable.ext.buttons.clear = { className: 'buttons-clear', - action: function ( e, dt, node, config ) { - dt.search('').draw(); + action: function(e, dt, node, config) { + dt.search('').draw(); } }; $('#potatable').DataTable({ "pageLength": 25, responsive: false, ordering: true, - "scrollY": "500px", + "scrollY": "500px", "scrollCollapse": true, - "paging": false, + "paging": false, "scrollX": true, "language": { url: getDataTablesLanguageUrl(), }, - "order": [ 0, 'asc' ], + "order": [0, 'asc'], dom: 'Bfrtip', - buttons: [ - { - extend: 'csv' - }, - { - extend: 'clear', - text: 'Clear' - } + buttons: [{ + extend: 'csv' + }, + { + extend: 'clear', + text: 'Clear' + } ] }); // change color of csv-button if dark mode is chosen if (isDarkModeTheme()) { - $('[class*="buttons"]').css("color", "white"); + $('[class*="buttons"]').css("color", "white"); } uri->segment(2) == "dok") { ?> @@ -3128,33 +3234,40 @@ function viewEqsl(picture, callsign) { uri->segment(1) == "user") { ?> - + - - - + + + + \ No newline at end of file