diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 78466e292..7b834e05d 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1774,11 +1774,11 @@ class Logbook_model extends CI_Model { * Function returns all the station_id's with HRDLOG Code */ function get_station_id_with_hrdlog_code() { - $sql = 'SELECT station_id, hrdlog_username, hrdlog_code + $sql = 'SELECT station_id, hrdlog_username, hrdlog_code FROM station_profile - WHERE coalesce(hrdlog_username, "") <> "" + WHERE coalesce(hrdlog_username, "") <> "" AND coalesce(hrdlog_code, "") <> ""'; - + $query = $this->db->query($sql); $result = $query->result(); @@ -4384,7 +4384,27 @@ function lotw_last_qsl_date($user_id) { } } - public function loadCallBook($callsign, $use_fullname=false) + // This should be in a helper? copied from Logbook controller + function get_plaincall($callsign) { + $split_callsign=explode('/',$callsign); + if (count($split_callsign)==1) { // case F0ABC --> return cel 0 // + $lookupcall = $split_callsign[0]; + } else if (count($split_callsign)==3) { // case EA/F0ABC/P --> return cel 1 // + $lookupcall = $split_callsign[1]; + } else { // case F0ABC/P --> return cel 0 OR case EA/FOABC --> retunr 1 (normaly not exist) // + if (in_array(strtoupper($split_callsign[1]), array('P','M','MM','QRP','0','1','2','3','4','5','6','7','8','9'))) { + $lookupcall = $split_callsign[0]; + } else if (strlen($split_callsign[1])>3) { // Last Element longer than 3 chars? Take that as call + $lookupcall = $split_callsign[1]; + } else { // Last Element up to 3 Chars? Take first element as Call + $lookupcall = $split_callsign[0]; + } + } + return $lookupcall; + } + + + public function loadCallBook($callsign, $use_fullname=false) { $callbook = null; try { @@ -4405,6 +4425,10 @@ function lotw_last_qsl_date($user_id) { $qrz_session_key = $this->qrz->session($this->config->item('qrz_username'), $this->config->item('qrz_password')); $this->session->set_userdata('qrz_session_key', $qrz_session_key); $callbook = $this->qrz->search($callsign, $this->session->userdata('qrz_session_key'), $use_fullname); + // if we still got nothing, and it's a compound callsign, then try a search for the base call + if (($callbook['callsign'] ?? '') == '' && strpos($callsign,"/")!==false){ + $callbook = $this->qrz->search($this->get_plaincall($callsign), $this->session->userdata('qrz_session_key'), $use_fullname); + } } } @@ -4566,10 +4590,10 @@ function lotw_last_qsl_date($user_id) { $this->load->library('qra'); $json["markers"] = array(); - + foreach ($qsos_result as $row) { $plot = array('lat'=>0, 'lng'=>0, 'html'=>'', 'label'=>'', 'confirmed'=>'N'); - + $plot['label'] = $row->COL_CALL; $plot['html'] = "Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
"; @@ -4591,10 +4615,10 @@ function lotw_last_qsl_date($user_id) { if (count($grids) == 2) { $grid1 = $this->qra->qra2latlong(trim($grids[0])); $grid2 = $this->qra->qra2latlong(trim($grids[1])); - + $coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]); $coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]); - + $stn_loc = $this->qra->get_midpoint($coords); } if (count($grids) == 4) { @@ -4602,12 +4626,12 @@ function lotw_last_qsl_date($user_id) { $grid2 = $this->qra->qra2latlong(trim($grids[1])); $grid3 = $this->qra->qra2latlong(trim($grids[2])); $grid4 = $this->qra->qra2latlong(trim($grids[3])); - + $coords[]=array('lat' => $grid1[0],'lng'=> $grid1[1]); $coords[]=array('lat' => $grid2[0],'lng'=> $grid2[1]); $coords[]=array('lat' => $grid3[0],'lng'=> $grid3[1]); $coords[]=array('lat' => $grid4[0],'lng'=> $grid4[1]); - + $stn_loc = $this->qra->get_midpoint($coords); } } else { diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 76f0054b5..e75edab7a 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -394,6 +394,9 @@ $(function () { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -519,6 +522,9 @@ $(function () { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -837,6 +843,9 @@ function findduplicates(){ "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -860,6 +869,9 @@ function findlotwunconfirmed(){ "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -883,6 +895,9 @@ function findincorrectcqzones() { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -1881,6 +1896,9 @@ $(document).ready(function(){ "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -1892,6 +1910,9 @@ $(document).ready(function(){ searching: false, ordering: false, "paging": false, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -1915,6 +1936,9 @@ $(document).ready(function(){ "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -1926,6 +1950,9 @@ $(document).ready(function(){ searching: false, ordering: false, "paging": false, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -1949,6 +1976,9 @@ $(document).ready(function(){ "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -1973,6 +2003,9 @@ $(document).ready(function(){ "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -1984,6 +2017,9 @@ $(document).ready(function(){ searching: false, ordering: false, "paging": false, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -2008,6 +2044,9 @@ $(document).ready(function(){ "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -2019,6 +2058,9 @@ $(document).ready(function(){ searching: false, ordering: false, "paging": false, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -2042,6 +2084,9 @@ $(document).ready(function(){ "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -2053,6 +2098,9 @@ $(document).ready(function(){ searching: false, ordering: false, "paging": false, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -2135,6 +2183,9 @@ $(document).ready(function(){ "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -2191,6 +2242,9 @@ $(document).ready(function(){ "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -2317,6 +2371,9 @@ $(document).ready(function(){ "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, "order": [ 2, 'desc' ], dom: 'Bfrtip', buttons: [ @@ -2472,6 +2529,9 @@ function viewEqsl(picture, callsign) { "scrollCollapse": true, "paging": true, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -2520,6 +2580,9 @@ function viewEqsl(picture, callsign) { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -2769,6 +2832,9 @@ function viewEqsl(picture, callsign) { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -2819,6 +2885,9 @@ function viewEqsl(picture, callsign) { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' @@ -2913,6 +2982,9 @@ function viewEqsl(picture, callsign) { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, "ordering": true, "order": [ 0, 'desc' ], }); @@ -2961,6 +3033,9 @@ function viewEqsl(picture, callsign) { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, "order": [ 0, 'asc' ], dom: 'Bfrtip', buttons: [ @@ -2995,6 +3070,9 @@ function viewEqsl(picture, callsign) { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, "order": [ 0, 'asc' ], dom: 'Bfrtip', buttons: [ @@ -3028,6 +3106,9 @@ function viewEqsl(picture, callsign) { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ { @@ -3059,6 +3140,10 @@ if (isset($scripts) && is_array($scripts)){ } } ?> - + diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php index c4d72c7d3..c2a3bd0b5 100644 --- a/application/views/logbookadvanced/index.php +++ b/application/views/logbookadvanced/index.php @@ -484,8 +484,3 @@ $options = json_decode($options); - diff --git a/application/views/visitor/layout/footer.php b/application/views/visitor/layout/footer.php index b20d1831b..74ab0e3e6 100644 --- a/application/views/visitor/layout/footer.php +++ b/application/views/visitor/layout/footer.php @@ -171,6 +171,9 @@ "scrollCollapse": true, "paging": true, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, "order": [ 0, 'desc' ], dom: 'Bfrtip', buttons: [ @@ -206,6 +209,10 @@ } - + diff --git a/assets/js/sections/accumulatedstatistics.js b/assets/js/sections/accumulatedstatistics.js index bde44b2dc..12c464aed 100644 --- a/assets/js/sections/accumulatedstatistics.js +++ b/assets/js/sections/accumulatedstatistics.js @@ -119,6 +119,9 @@ function accumulatePlot(form) { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' diff --git a/assets/js/sections/bandmap_list.js b/assets/js/sections/bandmap_list.js index 1fac4c007..c09a138a9 100644 --- a/assets/js/sections/bandmap_list.js +++ b/assets/js/sections/bandmap_list.js @@ -23,7 +23,10 @@ $(function() { $(td).attr( "title", "Click to prepare logging" ); } } - ] + ], + "language": { + url: getDataTablesLanguageUrl(), + } }); return table; } diff --git a/assets/js/sections/bands.js b/assets/js/sections/bands.js index 7153d576b..707146ac1 100644 --- a/assets/js/sections/bands.js +++ b/assets/js/sections/bands.js @@ -33,7 +33,10 @@ $('.bandtable').DataTable({ "scrollY": "500px", "scrollCollapse": true, "paging": false, - "scrollX": true + "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + } }); function createBandDialog() { diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index 1f5c93f7e..7761361a0 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -632,3 +632,7 @@ if ($('.table-responsive .dropdown-toggle').length>0) { showQsoActionsMenu($(this).closest('.dropdown')); }); } + +function getDataTablesLanguageUrl() { + return "../assets/json/datatables_languages/" + lang_datatables_language + ".json"; +} diff --git a/assets/js/sections/contesting.js b/assets/js/sections/contesting.js index c851e070e..a80c7851d 100644 --- a/assets/js/sections/contesting.js +++ b/assets/js/sections/contesting.js @@ -515,51 +515,53 @@ async function refresh_qso_table(data) { mode = this.col_submode; } - $(".qsotable tbody").prepend('' + - '' + this.col_time_on + '' + - '' + this.col_call + '' + - '' + this.col_band + '' + - '' + mode + '' + - '' + this.col_rst_sent + '' + - '' + this.col_rst_rcvd + '' + - '' + this.col_stx_string + '' + - '' + this.col_srx_string + '' + - '' + this.col_stx + '' + - '' + this.col_srx + '' + - '' + this.col_gridsquare + '' + - '' + this.col_vucc_grids + '' + - ''); - }); - if (!$.fn.DataTable.isDataTable('.qsotable')) { - $.fn.dataTable.moment('DD-MM-YYYY HH:mm:ss'); - $('.qsotable').DataTable({ - "stateSave": true, - "pageLength": 25, - responsive: false, - "scrollY": "400px", - "scrollCollapse": true, - "paging": false, - "scrollX": true, - order: [0, 'desc'], - "columnDefs": [ - { - "render": function ( data, type, row ) { - return pad(row[8],3); - }, - "targets" : 8 + $(".qsotable tbody").prepend('' + + '' + this.col_time_on + '' + + '' + this.col_call + '' + + '' + this.col_band + '' + + '' + mode + '' + + '' + this.col_rst_sent + '' + + '' + this.col_rst_rcvd + '' + + '' + this.col_stx_string + '' + + '' + this.col_srx_string + '' + + '' + this.col_stx + '' + + '' + this.col_srx + '' + + '' + this.col_gridsquare + '' + + '' + this.col_vucc_grids + '' + + ''); + }); + if (!$.fn.DataTable.isDataTable('.qsotable')) { + $.fn.dataTable.moment('DD-MM-YYYY HH:mm:ss'); + $('.qsotable').DataTable({ + "stateSave": true, + "pageLength": 25, + responsive: false, + "scrollY": "400px", + "scrollCollapse": true, + "paging": false, + "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, + order: [0, 'desc'], + "columnDefs": [ + { + "render": function ( data, type, row ) { + return pad(row[8],3); }, - { - "render": function ( data, type, row ) { - return pad(row[9],3); - }, - "targets" : 9 - } - ] - }); - } + "targets" : 8 + }, + { + "render": function ( data, type, row ) { + return pad(row[9],3); + }, + "targets" : 9 + } + ] + }); } - }); - } + } + }); } function pad (str, max) { diff --git a/assets/js/sections/contestingnames.js b/assets/js/sections/contestingnames.js index ffdfa7f9b..777965c3e 100644 --- a/assets/js/sections/contestingnames.js +++ b/assets/js/sections/contestingnames.js @@ -6,6 +6,9 @@ $('.contesttable').DataTable({ "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ { diff --git a/assets/js/sections/distances.js b/assets/js/sections/distances.js index 32c218c90..56cf1e031 100644 --- a/assets/js/sections/distances.js +++ b/assets/js/sections/distances.js @@ -159,6 +159,9 @@ function getDistanceQsos(distance) { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' diff --git a/assets/js/sections/ffma.js b/assets/js/sections/ffma.js index 27ac82457..0bfbe813d 100644 --- a/assets/js/sections/ffma.js +++ b/assets/js/sections/ffma.js @@ -117,6 +117,9 @@ function spawnGridsquareModal(loc_4char) { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' diff --git a/assets/js/sections/gridmap.js b/assets/js/sections/gridmap.js index b9ea60ec0..3335d4440 100644 --- a/assets/js/sections/gridmap.js +++ b/assets/js/sections/gridmap.js @@ -159,6 +159,9 @@ function spawnGridsquareModal(loc_4char) { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' diff --git a/assets/js/sections/gridmaster.js b/assets/js/sections/gridmaster.js index 0d4a74b2e..b1a15bbf9 100644 --- a/assets/js/sections/gridmaster.js +++ b/assets/js/sections/gridmaster.js @@ -123,6 +123,9 @@ function spawnGridsquareModal(loc_4char) { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, dom: 'Bfrtip', buttons: [ 'csv' diff --git a/assets/js/sections/logbookadvanced.js b/assets/js/sections/logbookadvanced.js index 424921459..984440024 100644 --- a/assets/js/sections/logbookadvanced.js +++ b/assets/js/sections/logbookadvanced.js @@ -108,7 +108,7 @@ function loadQSOTable(rows) { "paging": false, "scrollX": true, "language": { - url: "../json/datatables_languages/" + lang_datatables_language + ".json", + url: getDataTablesLanguageUrl(), }, // colReorder: { // order: [0, 2,1,3,4,5,6,7,8,9,10,12,13,14,15,16,17,18] diff --git a/assets/js/sections/mode.js b/assets/js/sections/mode.js index 001874b8b..9925fdc69 100644 --- a/assets/js/sections/mode.js +++ b/assets/js/sections/mode.js @@ -6,6 +6,9 @@ $('.modetable').DataTable({ "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, initComplete: function () { this.api() .columns('.select-filter') diff --git a/assets/js/sections/oqrs.js b/assets/js/sections/oqrs.js index 23a85d36c..d49d2bacf 100644 --- a/assets/js/sections/oqrs.js +++ b/assets/js/sections/oqrs.js @@ -70,6 +70,9 @@ function searchOqrsGrouped() { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + } }); // Get the input field @@ -205,6 +208,9 @@ function requestOqrs() { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + } }); // Get the input field var input = document.getElementById("emailInput"); @@ -385,6 +391,9 @@ function loadOqrsTable(rows) { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, "order": [ 0, 'asc' ], 'white-space': 'nowrap', }); diff --git a/assets/js/sections/qslprint.js b/assets/js/sections/qslprint.js index 269555109..a08167fa4 100644 --- a/assets/js/sections/qslprint.js +++ b/assets/js/sections/qslprint.js @@ -85,7 +85,10 @@ $(".station_id").change(function(){ $('#qslprint_table').DataTable({ "stateSave": true, - paging: false + paging: false, + "language": { + url: getDataTablesLanguageUrl(), + } }); function showOqrs(id) { diff --git a/assets/js/sections/station_locations.js b/assets/js/sections/station_locations.js index 8504357ba..f71637257 100644 --- a/assets/js/sections/station_locations.js +++ b/assets/js/sections/station_locations.js @@ -3,7 +3,10 @@ $(document).ready( function () { // Use Jquery to hide div ca_state $('#station_locations_table').DataTable({ - "stateSave": true + "stateSave": true, + "language": { + url: getDataTablesLanguageUrl(), + } }); $("#canada_state").hide(); diff --git a/assets/js/sections/station_logbooks.js b/assets/js/sections/station_logbooks.js index 54c7e4a87..c721b0920 100644 --- a/assets/js/sections/station_logbooks.js +++ b/assets/js/sections/station_logbooks.js @@ -1,12 +1,18 @@ $(document).ready( function () { $('#station_logbooks_table').DataTable({ - "stateSave": true + "stateSave": true, + "language": { + url: getDataTablesLanguageUrl(), + } }); } ); $(document).ready( function () { $('#station_logbooks_linked_table').DataTable({ "stateSave": true, - "paging": true + "paging": true, + "language": { + url: getDataTablesLanguageUrl(), + } }); } ); diff --git a/assets/js/sections/statistics.js b/assets/js/sections/statistics.js index db45e990e..3a650f8d5 100644 --- a/assets/js/sections/statistics.js +++ b/assets/js/sections/statistics.js @@ -153,6 +153,9 @@ function totalQsosPerYear() { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, bFilter: false, bInfo: false }); @@ -421,6 +424,9 @@ function totalBandQsos() { "scrollCollapse": true, "paging": false, "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, bFilter: false, bInfo: false, }); @@ -557,6 +563,9 @@ function totalSatQsos() { ordering: false, "scrollY": "330px", "scrollX": true, + "language": { + url: getDataTablesLanguageUrl(), + }, "ScrollCollapse": true, "paging": false, bFilter: false,