diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php
index a6f3bf7d..b64c8e0d 100644
--- a/application/controllers/Lotw.php
+++ b/application/controllers/Lotw.php
@@ -746,9 +746,9 @@ class Lotw extends CI_Controller {
$lotw_url .= "&qso_qslsince=";
$lotw_url .= "$lotw_last_qsl_date";
- // Only pull back entries that belong to this callsign
- $lotw_call = $this->session->userdata('user_callsign');
- $lotw_url .= "&qso_owncall=$lotw_call";
+ if ($this->input->post('callsign') != '0') {
+ $lotw_url .= "&qso_owncall=".$this->input->post('callsign');
+ }
file_put_contents($file, file_get_contents($lotw_url));
@@ -761,9 +761,11 @@ class Lotw extends CI_Controller {
{
$data['error'] = $this->upload->display_errors();
+ $this->load->model('Stations');
+ $data['callsigns'] = $this->Stations->callsigns_of_user($this->session->userdata('user_id'));
$this->load->view('interface_assets/header', $data);
- $this->load->view('lotw/import');
+ $this->load->view('lotw/import', $data);
$this->load->view('interface_assets/footer');
}
else
diff --git a/application/language/english/lotw_lang.php b/application/language/english/lotw_lang.php
index 3ed3245d..788274b1 100644
--- a/application/language/english/lotw_lang.php
+++ b/application/language/english/lotw_lang.php
@@ -34,6 +34,7 @@ $lang['lotw_upload_exported_adif_file_from_lotw'] = 'Upload the Exported ADIF fi
$lang['lotw_upload_type_must_be_adi'] = 'Log files must have the file type .adi';
$lang['lotw_pull_lotw_data_for_me'] = 'Pull LoTW data for me';
+$lang['lotw_select_callsign'] = 'Select callsign to pull LoTW confirmations for';
$lang['lotw_report_download_overview_helptext'] = 'Cloudlog will use the LoTW username and password stored in your user profile to download a report from LoTW for you. The report Cloudlog downloads will have all confirmations since chosen date, or since your last LoTW confirmation (fetched from your log), up until now.';
diff --git a/application/models/Stations.php b/application/models/Stations.php
index 054921cf..03b89aa7 100644
--- a/application/models/Stations.php
+++ b/application/models/Stations.php
@@ -24,7 +24,7 @@ class Stations extends CI_Model {
}
function all_of_user($userid = null) {
- if ($userid == null) {
+ if ($userid == null) {
$userid=$this->session->userdata('user_id'); // Fallback to session-uid, if userid is omitted
}
$this->db->select('station_profile.*, dxcc_entities.name as station_country, dxcc_entities.end as dxcc_end');
@@ -33,6 +33,15 @@ class Stations extends CI_Model {
return $this->db->get('station_profile');
}
+ function callsigns_of_user($userid = null) {
+ if ($userid == null) {
+ $userid=$this->session->userdata('user_id'); // Fallback to session-uid, if userid is omitted
+ }
+ $this->db->select('distinct(station_profile.station_callsign) as callsign');
+ $this->db->where('user_id', $userid);
+ return $this->db->get('station_profile');
+ }
+
function profile($id) {
// Clean ID
$clean_id = $this->security->xss_clean($id);
diff --git a/application/views/lotw/import.php b/application/views/lotw/import.php
index b27e32cb..8b370340 100644
--- a/application/views/lotw/import.php
+++ b/application/views/lotw/import.php
@@ -36,6 +36,21 @@
+