Merge remote-tracking branch 'upstream/dev' into active_development

This commit is contained in:
HB9HIL
2024-01-04 21:21:26 +01:00
21 changed files with 241 additions and 67 deletions

View File

@@ -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."<br />Date/Time: ".$row->COL_TIME_ON."<br />";
@@ -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 {

View File

@@ -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)){
}
}
?>
<script>
<?php
echo "var lang_datatables_language = '" . lang("datatables_language") . "';"
?>
</script>
</body>
</html>

View File

@@ -484,8 +484,3 @@ $options = json_decode($options);
</tbody>
</table>
</div>
<script>
<?php
echo 'var lang_datatables_language = "' . lang('datatables_language') . '";';
?>
</script>

View File

@@ -171,6 +171,9 @@
"scrollCollapse": true,
"paging": true,
"scrollX": true,
"language": {
url: getDataTablesLanguageUrl(),
},
"order": [ 0, 'desc' ],
dom: 'Bfrtip',
buttons: [
@@ -206,6 +209,10 @@
}
</script>
<?php } ?>
<script>
<?php
echo "var lang_datatables_language = '" . lang("datatables_language") . "';"
?>
</script>
</body>
</html>

View File

@@ -119,6 +119,9 @@ function accumulatePlot(form) {
"scrollCollapse": true,
"paging": false,
"scrollX": true,
"language": {
url: getDataTablesLanguageUrl(),
},
dom: 'Bfrtip',
buttons: [
'csv'

View File

@@ -23,7 +23,10 @@ $(function() {
$(td).attr( "title", "Click to prepare logging" );
}
}
]
],
"language": {
url: getDataTablesLanguageUrl(),
}
});
return table;
}

View File

@@ -33,7 +33,10 @@ $('.bandtable').DataTable({
"scrollY": "500px",
"scrollCollapse": true,
"paging": false,
"scrollX": true
"scrollX": true,
"language": {
url: getDataTablesLanguageUrl(),
}
});
function createBandDialog() {

View File

@@ -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";
}

View File

@@ -515,51 +515,53 @@ async function refresh_qso_table(data) {
mode = this.col_submode;
}
$(".qsotable tbody").prepend('<tr>' +
'<td>' + this.col_time_on + '</td>' +
'<td>' + this.col_call + '</td>' +
'<td>' + this.col_band + '</td>' +
'<td>' + mode + '</td>' +
'<td>' + this.col_rst_sent + '</td>' +
'<td>' + this.col_rst_rcvd + '</td>' +
'<td>' + this.col_stx_string + '</td>' +
'<td>' + this.col_srx_string + '</td>' +
'<td>' + this.col_stx + '</td>' +
'<td>' + this.col_srx + '</td>' +
'<td>' + this.col_gridsquare + '</td>' +
'<td>' + this.col_vucc_grids + '</td>' +
'</tr>');
});
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('<tr>' +
'<td>' + this.col_time_on + '</td>' +
'<td>' + this.col_call + '</td>' +
'<td>' + this.col_band + '</td>' +
'<td>' + mode + '</td>' +
'<td>' + this.col_rst_sent + '</td>' +
'<td>' + this.col_rst_rcvd + '</td>' +
'<td>' + this.col_stx_string + '</td>' +
'<td>' + this.col_srx_string + '</td>' +
'<td>' + this.col_stx + '</td>' +
'<td>' + this.col_srx + '</td>' +
'<td>' + this.col_gridsquare + '</td>' +
'<td>' + this.col_vucc_grids + '</td>' +
'</tr>');
});
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) {

View File

@@ -6,6 +6,9 @@ $('.contesttable').DataTable({
"scrollCollapse": true,
"paging": false,
"scrollX": true,
"language": {
url: getDataTablesLanguageUrl(),
},
dom: 'Bfrtip',
buttons: [
{

View File

@@ -159,6 +159,9 @@ function getDistanceQsos(distance) {
"scrollCollapse": true,
"paging": false,
"scrollX": true,
"language": {
url: getDataTablesLanguageUrl(),
},
dom: 'Bfrtip',
buttons: [
'csv'

View File

@@ -117,6 +117,9 @@ function spawnGridsquareModal(loc_4char) {
"scrollCollapse": true,
"paging": false,
"scrollX": true,
"language": {
url: getDataTablesLanguageUrl(),
},
dom: 'Bfrtip',
buttons: [
'csv'

View File

@@ -159,6 +159,9 @@ function spawnGridsquareModal(loc_4char) {
"scrollCollapse": true,
"paging": false,
"scrollX": true,
"language": {
url: getDataTablesLanguageUrl(),
},
dom: 'Bfrtip',
buttons: [
'csv'

View File

@@ -123,6 +123,9 @@ function spawnGridsquareModal(loc_4char) {
"scrollCollapse": true,
"paging": false,
"scrollX": true,
"language": {
url: getDataTablesLanguageUrl(),
},
dom: 'Bfrtip',
buttons: [
'csv'

View File

@@ -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]

View File

@@ -6,6 +6,9 @@ $('.modetable').DataTable({
"scrollCollapse": true,
"paging": false,
"scrollX": true,
"language": {
url: getDataTablesLanguageUrl(),
},
initComplete: function () {
this.api()
.columns('.select-filter')

View File

@@ -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',
});

View File

@@ -85,7 +85,10 @@ $(".station_id").change(function(){
$('#qslprint_table').DataTable({
"stateSave": true,
paging: false
paging: false,
"language": {
url: getDataTablesLanguageUrl(),
}
});
function showOqrs(id) {

View File

@@ -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();

View File

@@ -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(),
}
});
} );

View File

@@ -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,