diff --git a/application/config/config.sample.php b/application/config/config.sample.php index b51a94f3e..967fe5281 100644 --- a/application/config/config.sample.php +++ b/application/config/config.sample.php @@ -691,3 +691,4 @@ $config['userdata'] = 'userdata'; $config['disable_manual_lotw'] = false; $config['disable_manual_eqsl'] = false; $config['disable_manual_hrdlog'] = false; +$config['disable_manual_qrz'] = false; diff --git a/application/controllers/Qrz.php b/application/controllers/Qrz.php index 2f2ff77f7..89af9eb74 100644 --- a/application/controllers/Qrz.php +++ b/application/controllers/Qrz.php @@ -186,36 +186,40 @@ class Qrz extends CI_Controller { * Used for ajax-function when selecting log for upload to qrz */ public function upload_station() { - $this->setOptions(); - $this->load->model('stations'); + if (!($this->config->item('disable_manual_qrz'))) { + $this->setOptions(); + $this->load->model('stations'); - $postData = $this->input->post(); + $postData = $this->input->post(); - $this->load->model('logbook_model'); - $result = $this->logbook_model->exists_qrz_api_key($postData['station_id']); - $qrz_api_key = $result->qrzapikey; - $qrz_enabled = $result->qrzrealtime; - header('Content-type: application/json'); - if ($qrz_enabled>=0) { - $result = $this->mass_upload_qsos($postData['station_id'], $qrz_api_key); - if ($result['status'] == 'OK') { - $stationinfo = $this->stations->stations_with_qrz_api_key(); - $info = $stationinfo->result(); + $this->load->model('logbook_model'); + $result = $this->logbook_model->exists_qrz_api_key($postData['station_id']); + $qrz_api_key = $result->qrzapikey; + $qrz_enabled = $result->qrzrealtime; + header('Content-type: application/json'); + if ($qrz_enabled>=0) { + $result = $this->mass_upload_qsos($postData['station_id'], $qrz_api_key); + if ($result['status'] == 'OK') { + $stationinfo = $this->stations->stations_with_qrz_api_key(); + $info = $stationinfo->result(); - $data['status'] = 'OK'; - $data['info'] = $info; - $data['infomessage'] = $result['count'] . " QSOs are now uploaded to QRZ.com"; - $data['errormessages'] = $result['errormessages']; - echo json_encode($data); + $data['status'] = 'OK'; + $data['info'] = $info; + $data['infomessage'] = $result['count'] . " QSOs are now uploaded to QRZ.com"; + $data['errormessages'] = $result['errormessages']; + echo json_encode($data); + } else { + $data['status'] = 'Error'; + $data['info'] = 'Error: No QSOs found to upload.'; + $data['errormessages'] = $result['errormessages']; + echo json_encode($data); + } } else { - $data['status'] = 'Error'; - $data['info'] = 'Error: No QSOs found to upload.'; - $data['errormessages'] = $result['errormessages']; + $data['status']='QRZ Disabled for station'.$this->security->xss_clean($postData['station_id']); echo json_encode($data); } } else { - $data['status']='QRZ Disabled for station'.$this->security->xss_clean($postData['station_id']); - echo json_encode($data); + redirect('dashboard'); } } diff --git a/application/views/qrz/export.php b/application/views/qrz/export.php index 4c65be05c..06fef5246 100644 --- a/application/views/qrz/export.php +++ b/application/views/qrz/export.php @@ -9,9 +9,11 @@ + config->item('disable_manual_qrz'))) { ?> + @@ -22,7 +24,7 @@
-

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

+

Here you can see 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.

Warning This might take a while as QSO uploads are processed sequentially.

@@ -48,7 +50,11 @@ echo '' . $station->modcount . ''; echo '' . $station->notcount . ''; echo '' . $station->totcount . ''; - echo ''; + if (!($this->config->item('disable_manual_qrz'))) { + echo ''; + } else { + echo ' '; + } echo ''; } echo ''; @@ -60,6 +66,7 @@ ?>
+ config->item('disable_manual_qrz'))) { ?>
@@ -74,7 +81,7 @@
- +