diff --git a/application/controllers/Hrdlog.php b/application/controllers/Hrdlog.php index 0a0b09bda..cfa939b10 100644 --- a/application/controllers/Hrdlog.php +++ b/application/controllers/Hrdlog.php @@ -12,12 +12,11 @@ class Hrdlog extends CI_Controller { * All QSOs not previously uploaded, will then be uploaded, one at a time */ - function __construct() - { + function __construct() { parent::__construct(); - + if (ENVIRONMENT == 'maintenance' && $this->session->userdata('user_id') == '') { - echo "Maintenance Mode is active. Try again later.\n"; + echo "Maintenance Mode is active. Try again later.\n"; redirect('user/login'); } } @@ -139,32 +138,36 @@ class Hrdlog extends CI_Controller { * Used for ajax-function when selecting log for upload to hrdlog */ public function upload_station() { - $this->setOptions(); - $this->load->model('stations'); + if (!($this->config->item('disable_manual_hrdlog'))) { + $this->setOptions(); + $this->load->model('stations'); - $postData = $this->input->post(); + $postData = $this->input->post(); - $this->load->model('logbook_model'); - $result = $this->logbook_model->exists_hrdlog_credentials($postData['station_id']); - $hrdlog_username = $result->hrdlog_username; - $hrdlog_code = $result->hrdlog_code; - header('Content-type: application/json'); - $result = $this->mass_upload_qsos($postData['station_id'], $hrdlog_username, $hrdlog_code); - if ($result['status'] == 'OK') { - $stationinfo = $this->stations->stations_with_hrdlog_code(); - $info = $stationinfo->result(); + $this->load->model('logbook_model'); + $result = $this->logbook_model->exists_hrdlog_credentials($postData['station_id']); + $hrdlog_username = $result->hrdlog_username; + $hrdlog_code = $result->hrdlog_code; + header('Content-type: application/json'); + $result = $this->mass_upload_qsos($postData['station_id'], $hrdlog_username, $hrdlog_code); + if ($result['status'] == 'OK') { + $stationinfo = $this->stations->stations_with_hrdlog_code(); + $info = $stationinfo->result(); - $data['status'] = 'OK'; - $data['info'] = $info; - $data['infomessage'] = $result['count'] . " QSOs are now uploaded to hrdlog"; - $data['errormessages'] = $result['errormessages']; - echo json_encode($data); - } else { - $data['status'] = 'Error'; - $data['info'] = 'No QSOs found to upload.'; - $data['errormessages'] = $result['errormessages']; - echo json_encode($data); - } + $data['status'] = 'OK'; + $data['info'] = $info; + $data['infomessage'] = $result['count'] . " QSOs are now uploaded to hrdlog"; + $data['errormessages'] = $result['errormessages']; + echo json_encode($data); + } else { + $data['status'] = 'Error'; + $data['info'] = 'No QSOs found to upload.'; + $data['errormessages'] = $result['errormessages']; + echo json_encode($data); + } + } else { + redirect('dashboard'); + } } public function mark_hrdlog() { diff --git a/application/views/hrdlog/export.php b/application/views/hrdlog/export.php index 5a73280b2..11e107f12 100644 --- a/application/views/hrdlog/export.php +++ b/application/views/hrdlog/export.php @@ -19,10 +19,10 @@
-

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

+

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

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

The Code can be demanded at http://www.hrdlog.net/EditUser.aspx

-

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

+ config->item('disable_manual_eqsl'))) { echo '

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

'; } ?> result()) { @@ -39,16 +39,20 @@ Actions '; - foreach ($station_profile->result() as $station) { // Fills the table with the data - echo ''; - echo '' . $station->station_profile_name . ''; - echo '' . $station->station_callsign . ''; - echo '' . $station->modcount . ''; - echo '' . $station->notcount . ''; - echo '' . $station->totcount . ''; - echo ''; - echo ''; - } + foreach ($station_profile->result() as $station) { // Fills the table with the data + echo ''; + echo '' . $station->station_profile_name . ''; + echo '' . $station->station_callsign . ''; + echo '' . $station->modcount . ''; + echo '' . $station->notcount . ''; + echo '' . $station->totcount . ''; + if (!($this->config->item('disable_manual_eqsl'))) { + echo ''; + } else { + echo ' '; + } + echo ''; + } echo ''; }