diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js
index 76508f5f..c0c84491 100644
--- a/assets/js/sections/common.js
+++ b/assets/js/sections/common.js
@@ -430,4 +430,21 @@ function getLookupResult() {
$(".ld-ext-right").prop('disabled', false);
}
});
+}
+
+// This function executes the call to the backend for fetching dxcc summary and inserted table below qso entry
+function getDxccResult(dxcc) {
+ $.ajax({
+ url: base_url + 'index.php/lookup/search',
+ type: 'post',
+ data: {
+ type: 'dxcc',
+ dxcc: dxcc,
+ },
+ success: function (html) {
+ $('.dxccsummary').remove();
+ $('.qsopane').append('
');
+ $('.dxccsummarybody').append(html);
+ }
+ });
}
\ No newline at end of file
diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js
index 7091aaf7..74d08c8c 100644
--- a/assets/js/sections/qso.js
+++ b/assets/js/sections/qso.js
@@ -406,6 +406,7 @@ $("#callsign").focusout(function() {
if(result.dxcc.entity != undefined) {
$('#country').val(convert_case(result.dxcc.entity));
$('#callsign_info').text(convert_case(result.dxcc.entity));
+ getDxccResult(convert_case(result.dxcc.adif));
if($("#sat_name" ).val() != "") {
//logbook/jsonlookupgrid/io77/SAT/0/0
From 79800f73bc78f19f77f929f40469b3fa7b6a8baa Mon Sep 17 00:00:00 2001
From: Andreas <6977712+AndreasK79@users.noreply.github.com>
Date: Thu, 26 Jan 2023 09:02:44 +0100
Subject: [PATCH 02/48] [QSO Entry] Bugfix for dxcc none.
---
assets/js/sections/qso.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js
index 74d08c8c..c5da4ada 100644
--- a/assets/js/sections/qso.js
+++ b/assets/js/sections/qso.js
@@ -406,7 +406,7 @@ $("#callsign").focusout(function() {
if(result.dxcc.entity != undefined) {
$('#country').val(convert_case(result.dxcc.entity));
$('#callsign_info').text(convert_case(result.dxcc.entity));
- getDxccResult(convert_case(result.dxcc.adif));
+ getDxccResult(result.dxcc.adif);
if($("#sat_name" ).val() != "") {
//logbook/jsonlookupgrid/io77/SAT/0/0
From 7dd9ef13d74605eb3e14f68949e352907768f475 Mon Sep 17 00:00:00 2001
From: Andreas <6977712+AndreasK79@users.noreply.github.com>
Date: Thu, 26 Jan 2023 09:10:56 +0100
Subject: [PATCH 03/48] [QSO Entry] Added removing of summary when resetting
---
assets/js/sections/qso.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js
index c5da4ada..f3f7b8c0 100644
--- a/assets/js/sections/qso.js
+++ b/assets/js/sections/qso.js
@@ -368,6 +368,7 @@ function reset_fields() {
mymap.setView(pos, 12);
mymap.removeLayer(markers);
$('.callsign-suggest').hide();
+ $('.dxccsummary').remove();
}
$("#callsign").focusout(function() {
@@ -788,4 +789,5 @@ function resetDefaultQSOFields() {
$('#input_usa_state').val("");
$('#callsign-image').attr('style', 'display: none;');
$('#callsign-image-content').text("");
+ $('.dxccsummary').remove();
}
From 8ea9c04141539ba374af4662c48bd0ba3c6e82a2 Mon Sep 17 00:00:00 2001
From: Andreas <6977712+AndreasK79@users.noreply.github.com>
Date: Thu, 26 Jan 2023 09:20:45 +0100
Subject: [PATCH 04/48] [QSO Entry] Added dxcc name to card header
---
assets/js/sections/common.js | 4 ++--
assets/js/sections/qso.js | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js
index c0c84491..2edb942f 100644
--- a/assets/js/sections/common.js
+++ b/assets/js/sections/common.js
@@ -433,7 +433,7 @@ function getLookupResult() {
}
// This function executes the call to the backend for fetching dxcc summary and inserted table below qso entry
-function getDxccResult(dxcc) {
+function getDxccResult(dxcc, name) {
$.ajax({
url: base_url + 'index.php/lookup/search',
type: 'post',
@@ -443,7 +443,7 @@ function getDxccResult(dxcc) {
},
success: function (html) {
$('.dxccsummary').remove();
- $('.qsopane').append('
');
+ $('.qsopane').append('
');
$('.dxccsummarybody').append(html);
}
});
diff --git a/assets/js/sections/qso.js b/assets/js/sections/qso.js
index f3f7b8c0..d0f0b706 100644
--- a/assets/js/sections/qso.js
+++ b/assets/js/sections/qso.js
@@ -407,7 +407,7 @@ $("#callsign").focusout(function() {
if(result.dxcc.entity != undefined) {
$('#country').val(convert_case(result.dxcc.entity));
$('#callsign_info').text(convert_case(result.dxcc.entity));
- getDxccResult(result.dxcc.adif);
+ getDxccResult(result.dxcc.adif, convert_case(result.dxcc.entity));
if($("#sat_name" ).val() != "") {
//logbook/jsonlookupgrid/io77/SAT/0/0
From 3dde2cb22152ee6e5feab3fa49249b2ec2b4d2b5 Mon Sep 17 00:00:00 2001
From: Andreas <6977712+AndreasK79@users.noreply.github.com>
Date: Fri, 27 Jan 2023 09:23:42 +0100
Subject: [PATCH 05/48] [QSO Entry] Added collapse on dxcc summary card
---
assets/js/sections/common.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js
index 2edb942f..b0cbdc26 100644
--- a/assets/js/sections/common.js
+++ b/assets/js/sections/common.js
@@ -443,7 +443,7 @@ function getDxccResult(dxcc, name) {
},
success: function (html) {
$('.dxccsummary').remove();
- $('.qsopane').append('
');
+ $('.qsopane').append('
');
$('.dxccsummarybody').append(html);
}
});
From ff9e43fe156ad6c9cf12d70f268ccb5823e9ca57 Mon Sep 17 00:00:00 2001
From: phl0
Date: Fri, 27 Jan 2023 10:29:14 +0100
Subject: [PATCH 06/48] Use active profile for preselection during ADIF
im/export
---
application/views/adif/import.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/application/views/adif/import.php b/application/views/adif/import.php
index 6b42c7fb..779bd48d 100644
--- a/application/views/adif/import.php
+++ b/application/views/adif/import.php
@@ -34,7 +34,7 @@
Select Station Location
result() as $station) { ?>
- Callsign: station_callsign; ?> (station_profile_name; ?>)
+ station_id == $this->stations->find_active()) { echo " selected =\"selected\""; } ?>>Callsign: station_callsign; ?> (station_profile_name; ?>)
ADIF file
@@ -100,7 +100,7 @@
Select Station Location
result() as $station) { ?>
- Callsign: station_callsign; ?> (station_profile_name; ?>)
+ station_id == $this->stations->find_active()) { echo " selected =\"selected\""; } ?>>Callsign: station_callsign; ?> (station_profile_name; ?>)
From date:
From 995e89e444dc45c2e781741b5b7025485198ea36 Mon Sep 17 00:00:00 2001
From: phl0
Date: Fri, 27 Jan 2023 17:24:48 +0100
Subject: [PATCH 07/48] Option tu upload SAT status info to amsat.org/status
---
application/config/migration.php | 2 +-
application/controllers/User.php | 12 +++++++-
application/models/Logbook_model.php | 46 ++++++++++++++++++++++++++++
application/models/User_model.php | 5 ++-
application/views/user/add.php | 22 ++++++++++++-
application/views/user/edit.php | 21 +++++++++++++
6 files changed, 104 insertions(+), 4 deletions(-)
diff --git a/application/config/migration.php b/application/config/migration.php
index da1ea557..679b8daf 100644
--- a/application/config/migration.php
+++ b/application/config/migration.php
@@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE;
| be upgraded / downgraded to.
|
*/
-$config['migration_version'] = 112;
+$config['migration_version'] = 113;
/*
|--------------------------------------------------------------------------
diff --git a/application/controllers/User.php b/application/controllers/User.php
index c323bdb9..fecca221 100644
--- a/application/controllers/User.php
+++ b/application/controllers/User.php
@@ -81,6 +81,7 @@ class User extends CI_Controller {
$data['user_column5'] = $this->input->post('user_column5');
$data['user_show_profile_image'] = $this->input->post('user_show_profile_image');
$data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type');
+ $data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload');
$this->load->view('user/add', $data);
} else {
$this->load->view('user/add', $data);
@@ -111,7 +112,8 @@ class User extends CI_Controller {
$this->input->post('user_column4'),
$this->input->post('user_column5'),
$this->input->post('user_show_profile_image'),
- $this->input->post('user_previous_qsl_type'))) {
+ $this->input->post('user_previous_qsl_type'),
+ $this->input->post('user_amsat_status_upload'))) {
// Check for errors
case EUSERNAMEEXISTS:
$data['username_error'] = 'Username '.$this->input->post('user_name').' already in use!';
@@ -152,6 +154,7 @@ class User extends CI_Controller {
$data['user_column5'] = $this->input->post('user_column5');
$data['user_show_profile_image'] = $this->input->post('user_show_profile_image');
$data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type');
+ $data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload');
$this->load->view('user/add', $data);
$this->load->view('interface_assets/footer');
}
@@ -347,6 +350,12 @@ class User extends CI_Controller {
$data['user_previous_qsl_type'] = $q->user_previous_qsl_type;
}
+ if($this->input->post('user_amsat_status_upload')) {
+ $data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload', false);
+ } else {
+ $data['user_amsat_status_upload'] = $q->user_amsat_status_upload;
+ }
+
if($this->input->post('user_column1')) {
$data['user_column1'] = $this->input->post('user_column1', true);
} else {
@@ -430,6 +439,7 @@ class User extends CI_Controller {
$data['user_column5'] = $this->input->post('user_column5');
$data['user_show_profile_image'] = $this->input->post('user_show_profile_image');
$data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type');
+ $data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload');
$this->load->view('user/edit');
$this->load->view('interface_assets/footer');
}
diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php
index 6c7aa411..acbbc091 100755
--- a/application/models/Logbook_model.php
+++ b/application/models/Logbook_model.php
@@ -478,6 +478,10 @@ class Logbook_model extends CI_Model {
$last_id = $this->db->insert_id();
+ if ($this->session->userdata('user_amsat_status_upload') && $data['COL_PROP_MODE'] == "SAT") {
+ $this->upload_amsat_status($data);
+ }
+
// No point in fetching qrz api key and qrzrealtime setting if we're skipping the export
if (!$skipexport) {
@@ -576,6 +580,48 @@ class Logbook_model extends CI_Model {
return true;
}
+ function upload_amsat_status($data) {
+ $sat_name = '';
+ if ($data['COL_SAT_NAME'] == 'AO-7') {
+ if ($data['COL_BAND'] == '2m' && $data['COL_BAND_RX'] == '10m') {
+ $sat_name = '[A]_AO-7';
+ }
+ if ($data['COL_BAND'] == '70cm' && $data['COL_BAND_RX'] == '2m') {
+ $sat_name = '[B]_AO-7';
+ }
+ } else if ($data['COL_SAT_NAME'] == 'QO-100') {
+ $sat_name = 'QO-100_NB';
+ } else if ($data['COL_SAT_NAME'] == 'AO-92') {
+ if ($data['COL_BAND'] == '70cm' && $data['COL_BAND_RX'] == '2m') {
+ $sat_name = 'AO-92_U/v';
+ }
+ if ($data['COL_BAND'] == '23cm' && $data['COL_BAND_RX'] == '2m') {
+ $sat_name = 'AO-92_L/v';
+ }
+ } else if ($data['COL_SAT_NAME'] == 'AO-95') {
+ if ($data['COL_BAND'] == '70cm' && $data['COL_BAND_RX'] == '2m') {
+ $sat_name = 'AO-95_U/v';
+ }
+ if ($data['COL_BAND'] == '23cm' && $data['COL_BAND_RX'] == '2m') {
+ $sat_name = 'AO-95_L/v';
+ }
+ } else if ($data['COL_SAT_NAME'] == 'PO-101') {
+ if ($data['COL_MODE'] == 'PACKET') {
+ $sat_name = 'PO-101[APRS]';
+ } else {
+ $sat_name = 'PO-101[FM]';
+ }
+ }
+ if ($sat_name != '') {
+ $datearray = date_parse_from_format("Y-m-d H:i:s", $data['COL_TIME_ON']);
+ $url='https://amsat.org/status/submit.php?SatSubmit=yes&Confirm=yes&SatName='.$sat_name.'&SatYear='.$datearray['year'].'&SatMonth='.str_pad($datearray['month'], 2, '0', STR_PAD_LEFT).'&SatDay='.str_pad($datearray['day'], 2, '0', STR_PAD_LEFT).'&SatHour='.str_pad($datearray['hour'], 2, '0', STR_PAD_LEFT).'&SatPeriod='.(intdiv(($datearray['minute']-1), 15)).'&SatCall='.$data['COL_STATION_CALLSIGN'].'&SatReport=Heard&SatGridSquare='.$data['COL_MY_GRIDSQUARE'];
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_exec($ch);
+ }
+ }
+
/* Edit QSO */
function edit() {
$qso = $this->get_qso($this->input->post('id'))->row();
diff --git a/application/models/User_model.php b/application/models/User_model.php
index 801ab136..c4a24fb5 100644
--- a/application/models/User_model.php
+++ b/application/models/User_model.php
@@ -122,7 +122,7 @@ class User_Model extends CI_Model {
function add($username, $password, $email, $type, $firstname, $lastname, $callsign, $locator, $timezone,
$measurement, $user_date_format, $user_stylesheet, $user_qth_lookup, $user_sota_lookup, $user_wwff_lookup,
$user_show_notes, $user_column1, $user_column2, $user_column3, $user_column4, $user_column5,
- $user_show_profile_image, $user_previous_qsl_type) {
+ $user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload) {
// Check that the user isn't already used
if(!$this->exists($username)) {
$data = array(
@@ -149,6 +149,7 @@ class User_Model extends CI_Model {
'user_column5' => xss_clean($user_column5),
'user_show_profile_image' => xss_clean($user_show_profile_image),
'user_previous_qsl_type' => xss_clean($user_previous_qsl_type),
+ 'user_amsat_status_upload' => xss_clean($user_amsat_status_upload),
);
// Check the password is valid
@@ -203,6 +204,7 @@ class User_Model extends CI_Model {
'user_column5' => xss_clean($fields['user_column5']),
'user_show_profile_image' => xss_clean($fields['user_show_profile_image']),
'user_previous_qsl_type' => xss_clean($fields['user_previous_qsl_type']),
+ 'user_amsat_status_upload' => xss_clean($fields['user_amsat_status_upload']),
);
// Check to see if the user is allowed to change user levels
@@ -321,6 +323,7 @@ class User_Model extends CI_Model {
'user_column4' => isset($u->row()->user_column4) ? $u->row()->user_column4: 'Band',
'user_column5' => isset($u->row()->user_column5) ? $u->row()->user_column5: 'Country',
'user_previous_qsl_type' => isset($u->row()->user_previous_qsl_type) ? $u->row()->user_previous_qsl_type: 0,
+ 'user_amsat_status_upload' => isset($u->row()->user_amsat_status_upload) ? $u->row()->user_amsat_status_upload: 0,
'active_station_logbook' => $u->row()->active_station_logbook,
);
diff --git a/application/views/user/add.php b/application/views/user/add.php
index 4451effd..0ae5ce78 100644
--- a/application/views/user/add.php
+++ b/application/views/user/add.php
@@ -479,6 +479,26 @@