From 0377fe1989919810fef8a1d0075cef05b2a8e7e0 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 5 Sep 2021 16:49:53 +0200 Subject: [PATCH 1/2] [QRZ Logbook] Changed view. Moved marking of QSOs uploaded from ADIF Export to QRZ Logbook. --- application/views/adif/import.php | 37 ---------------------- application/views/qrz/export.php | 51 ++++++++++++++++++++++++++++--- 2 files changed, 47 insertions(+), 41 deletions(-) diff --git a/application/views/adif/import.php b/application/views/adif/import.php index 7405abdf..33b97b8e 100644 --- a/application/views/adif/import.php +++ b/application/views/adif/import.php @@ -14,9 +14,6 @@ - @@ -186,40 +183,6 @@ - -
- - -
- -

Warning If a date range is not selected then all QSOs will be marked!

-

From date:

-
-
- -
-
-
-
-
-

To date:

-
-
- -
-
-
-
-
-
- -
-
diff --git a/application/views/qrz/export.php b/application/views/qrz/export.php index 7567429c..693dab4d 100644 --- a/application/views/qrz/export.php +++ b/application/views/qrz/export.php @@ -5,15 +5,24 @@
- Upload Logbook + +
- +
+

Here you can see and upload all QSOs which have not been previously uploaded to a QRZ logbook.

You need to set a QRZ Logbook API key in your station profile. Only station profiles with an API Key set are displayed.

WarningThis might take a while as QSO uploads are processed sequentially.

- + result()) { echo ' @@ -48,5 +57,39 @@ ?>
-
+
+ +
+ +

Warning If a date range is not selected then all QSOs will be marked!

+

From date:

+
+
+ +
+
+
+
+
+

To date:

+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ From f4b29bd6012b4caeacefd1c436dea75117bd40ff Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 5 Sep 2021 17:11:58 +0200 Subject: [PATCH 2/2] [QRZ Logbook] Updated the rest of the code to work with the new placement for the marking of QSOs. --- application/controllers/Adif.php | 20 ------------- application/controllers/Qrz.php | 30 ++++++++++++++++---- application/views/qrz/export.php | 6 ++-- application/views/{adif => qrz}/mark_qrz.php | 0 4 files changed, 28 insertions(+), 28 deletions(-) rename application/views/{adif => qrz}/mark_qrz.php (100%) diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php index 3864f0be..eb789d6d 100644 --- a/application/controllers/Adif.php +++ b/application/controllers/Adif.php @@ -121,26 +121,6 @@ class adif extends CI_Controller { $this->load->view('adif/mark_lotw', $data); } - public function mark_qrz() { - // Set memory limit to unlimited to allow heavy usage - ini_set('memory_limit', '-1'); - - $station_id = $this->security->xss_clean($this->input->post('station_profile')); - - $this->load->model('adif_data'); - - $data['qsos'] = $this->adif_data->export_custom($this->input->post('from'), $this->input->post('to'), $station_id); - - $this->load->model('logbook_model'); - - foreach ($data['qsos']->result() as $qso) - { - $this->logbook_model->mark_qrz_qsos_sent($qso->COL_PRIMARY_KEY); - } - - $this->load->view('adif/mark_qrz', $data); - } - public function export_lotw() { // Set memory limit to unlimited to allow heavy usage diff --git a/application/controllers/Qrz.php b/application/controllers/Qrz.php index 29e1e856..c663d6ff 100644 --- a/application/controllers/Qrz.php +++ b/application/controllers/Qrz.php @@ -108,11 +108,8 @@ class Qrz extends CI_Controller { $data['page_title'] = "QRZ Logbook"; + $data['station_profiles'] = $this->stations->all(); $data['station_profile'] = $this->stations->stations_with_qrz_api_key(); - $active_station_id = $this->stations->find_active(); - $station_profile = $this->stations->profile($active_station_id); - - $data['active_station_info'] = $station_profile->row(); $this->load->view('interface_assets/header', $data); $this->load->view('qrz/export'); @@ -125,6 +122,7 @@ class Qrz extends CI_Controller { public function upload_station() { $this->setOptions(); $this->load->model('stations'); + $postData = $this->input->post(); $this->load->model('logbook_model'); @@ -148,4 +146,26 @@ class Qrz extends CI_Controller { echo json_encode($data); } } -} \ No newline at end of file + + public function mark_qrz() { + // Set memory limit to unlimited to allow heavy usage + ini_set('memory_limit', '-1'); + + $station_id = $this->security->xss_clean($this->input->post('station_profile')); + + $this->load->model('adif_data'); + + $data['qsos'] = $this->adif_data->export_custom($this->input->post('from'), $this->input->post('to'), $station_id); + + $this->load->model('logbook_model'); + + foreach ($data['qsos']->result() as $qso) + { + $this->logbook_model->mark_qrz_qsos_sent($qso->COL_PRIMARY_KEY); + } + + $this->load->view('interface_assets/header', $data); + $this->load->view('qrz/mark_qrz', $data); + $this->load->view('interface_assets/footer'); + } +} diff --git a/application/views/qrz/export.php b/application/views/qrz/export.php index 693dab4d..36ac306c 100644 --- a/application/views/qrz/export.php +++ b/application/views/qrz/export.php @@ -48,7 +48,7 @@ echo ''; echo ''; } - echo ''; + echo ''; } else { @@ -60,9 +60,9 @@
- - result() as $station) { ?> + result() as $station) { ?> diff --git a/application/views/adif/mark_qrz.php b/application/views/qrz/mark_qrz.php similarity index 100% rename from application/views/adif/mark_qrz.php rename to application/views/qrz/mark_qrz.php