diff --git a/application/config/migration.php b/application/config/migration.php index f18b8cfe..ed1cc07a 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE; | */ -$config['migration_version'] = 161; +$config['migration_version'] = 162; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/Hrdlog.php b/application/controllers/Hrdlog.php index eca9ef47..547458da 100644 --- a/application/controllers/Hrdlog.php +++ b/application/controllers/Hrdlog.php @@ -1,4 +1,4 @@ -hrdlog_username; $hrdlog_code = $station->hrdlog_code; - if($this->mass_upload_qsos($station->station_id, $hrdlog_code)) { + if ($this->mass_upload_qsos($station->station_id, $hrdlog_username, $hrdlog_code)) { echo "QSOs have been uploaded to hrdlog.net."; log_message('info', 'QSOs have been uploaded to hrdlog.net.'); - } else{ + } else { echo "No QSOs found for upload."; log_message('info', 'No QSOs found for upload.'); } @@ -48,49 +49,53 @@ class Hrdlog extends CI_Controller { * Function gets all QSOs from given station_id, that are not previously uploaded to hrdlog. * Adif is build for each qso, and then uploaded, one at a time */ - function mass_upload_qsos($station_id, $hrdlog_code) { - $i = 0; - $data['qsos'] = $this->logbook_model->get_hrdlog_qsos($station_id); - $errormessages=array(); + function mass_upload_qsos($station_id, $hrdlog_username, $hrdlog_code) { + $i = 0; + $data['qsos'] = $this->logbook_model->get_hrdlog_qsos($station_id); + $errormessages = array(); - $CI =& get_instance(); - $CI->load->library('AdifHelper'); + $this->load->library('AdifHelper'); - if ($data['qsos']) { - foreach ($data['qsos']->result() as $qso) { - $adif = $CI->adifhelper->getAdifLine($qso); + if ($data['qsos']) { + foreach ($data['qsos']->result() as $qso) { + $adif = $this->adifhelper->getAdifLine($qso); - if ($qso->COL_HRDLOG_QSO_UPLOAD_STATUS == 'M') { - $result = $this->logbook_model->push_qso_to_hrdlog($hrdlog_code, $qso->COL_STATION_CALLSIGN,$adif, true); - } else { - $result = $this->logbook_model->push_qso_to_hrdlog($hrdlog_code, $qso->COL_STATION_CALLSIGN,$adif); - } + if ($qso->COL_HRDLOG_QSO_UPLOAD_STATUS == 'M') { + $result = $this->logbook_model->push_qso_to_hrdlog($hrdlog_username, $hrdlog_code, $adif, true); + } else { + $result = $this->logbook_model->push_qso_to_hrdlog($hrdlog_username, $hrdlog_code, $adif); + } - if ( ($result['status'] == 'OK') || ( ($result['status'] == 'error') || ($result['status'] == 'duplicate')) ){ - $this->markqso($qso->COL_PRIMARY_KEY); - $i++; - } elseif ((substr($result['status'],0,11) == 'auth_error')) { - log_message('error', 'hrdlog upload failed for qso: Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON); - log_message('error', 'hrdlog upload failed with the following message: ' .$result['message']); - log_message('error', 'hrdlog upload stopped for Station_ID: ' .$station_id); - $errormessages[] = $result['message'] . 'Invalid HRDLog-Code, stopped at Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON; - break; /* If key is invalid, immediate stop syncing for more QSOs of this station */ - } else { - log_message('error', 'hrdlog upload failed for qso: Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON); - log_message('error', 'hrdlog upload failed with the following message: ' .$result['message']); - $errormessages[] = $result['message'] . ' Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON; - } - } - $result['status'] = 'OK'; - $result['count'] = $i; - $result['errormessages'] = $errormessages; - return $result; - } else { - $result['status'] = 'Error'; - $result['count'] = $i; - $result['errormessages'] = $errormessages; - return $result; - } + if (($result['status'] == 'OK') || (($result['status'] == 'error') || ($result['status'] == 'duplicate'))) { + $this->markqso($qso->COL_PRIMARY_KEY); + $i++; + $result['status'] = 'OK'; + } elseif ((substr($result['status'], 0, 11) == 'auth_error')) { + log_message('error', 'hrdlog upload failed for qso: Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON); + log_message('error', 'hrdlog upload failed with the following message: ' . $result['message']); + log_message('error', 'hrdlog upload stopped for Station_ID: ' . $station_id); + $errormessages[] = $result['message'] . 'Invalid HRDLog-Code, stopped at Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON; + $result['status'] = 'Error'; + break; /* If key is invalid, immediate stop syncing for more QSOs of this station */ + } else { + log_message('error', 'hrdlog upload failed for qso: Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON); + log_message('error', 'hrdlog upload failed with the following message: ' . $result['message']); + $result['status'] = 'Error'; + $errormessages[] = $result['message'] . ' Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON; + } + } + if ($i == 0) { + $result['status']='Error'; + } + $result['count'] = $i; + $result['errormessages'] = $errormessages; + return $result; + } else { + $result['status'] = 'Error'; + $result['count'] = $i; + $result['errormessages'] = $errormessages; + return $result; + } } /* @@ -108,7 +113,7 @@ class Hrdlog extends CI_Controller { $data['page_title'] = "HRDlog.net Logbook"; - $data['station_profiles'] = $this->stations->all_of_user(); + $data['station_profiles'] = $this->stations->all_of_user(); $data['station_profile'] = $this->stations->stations_with_hrdlog_code(); $this->load->view('interface_assets/header', $data); @@ -126,10 +131,11 @@ class Hrdlog extends CI_Controller { $postData = $this->input->post(); $this->load->model('logbook_model'); - $result = $this->logbook_model->exists_hrdlog_code($postData['station_id']); + $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_code); + $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(); @@ -141,31 +147,31 @@ class Hrdlog extends CI_Controller { echo json_encode($data); } else { $data['status'] = 'Error'; - $data['info'] = 'Error: No QSOs found to upload.'; + $data['info'] = 'No QSOs found to upload.'; $data['errormessages'] = $result['errormessages']; echo json_encode($data); } } - public function mark_hrdlog() { - // Set memory limit to unlimited to allow heavy usage - ini_set('memory_limit', '-1'); + public function mark_hrdlog() { + // 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')); + $station_id = $this->security->xss_clean($this->input->post('station_profile')); - $this->load->model('adif_data'); + $this->load->model('adif_data'); - $data['qsos'] = $this->adif_data->export_custom($this->input->post('from'), $this->input->post('to'), $station_id); + $data['qsos'] = $this->adif_data->export_custom($this->input->post('from'), $this->input->post('to'), $station_id); - $this->load->model('logbook_model'); + $this->load->model('logbook_model'); - foreach ($data['qsos']->result() as $qso) + foreach ($data['qsos']->result() as $qso) { - $this->logbook_model->mark_hrdlog_qsos_sent($qso->COL_PRIMARY_KEY); - } + $this->logbook_model->mark_hrdlog_qsos_sent($qso->COL_PRIMARY_KEY); + } - $this->load->view('interface_assets/header', $data); - $this->load->view('hrdlog/mark_hrdlog', $data); - $this->load->view('interface_assets/footer'); - } + $this->load->view('interface_assets/header', $data); + $this->load->view('hrdlog/mark_hrdlog', $data); + $this->load->view('interface_assets/footer'); + } } diff --git a/application/controllers/Qrz.php b/application/controllers/Qrz.php index 89647626..efc8449e 100644 --- a/application/controllers/Qrz.php +++ b/application/controllers/Qrz.php @@ -74,19 +74,21 @@ class Qrz extends CI_Controller { if ( ($result['status'] == 'OK') || ( ($result['status'] == 'error') && ($result['message'] == 'STATUS=FAIL&REASON=Unable to add QSO to database: duplicate&EXTENDED=')) ){ $this->markqso($qso->COL_PRIMARY_KEY); $i++; + $result['status'] = 'OK'; } elseif ( ($result['status']=='error') && (substr($result['message'],0,11) == 'STATUS=AUTH')) { log_message('error', 'QRZ upload failed for qso: Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON); log_message('error', 'QRZ upload failed with the following message: ' .$result['message']); log_message('error', 'QRZ upload stopped for Station_ID: ' .$station_id); $errormessages[] = $result['message'] . ' Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON; + $result['status'] = 'Error'; break; /* If key is invalid, immediate stop syncing for more QSOs of this station */ } else { log_message('error', 'QRZ upload failed for qso: Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON); log_message('error', 'QRZ upload failed with the following message: ' .$result['message']); $errormessages[] = $result['message'] . ' Call: ' . $qso->COL_CALL . ' Band: ' . $qso->COL_BAND . ' Mode: ' . $qso->COL_MODE . ' Time: ' . $qso->COL_TIME_ON; + $result['status'] = 'Error'; } } - $result['status'] = 'OK'; $result['count'] = $i; $result['errormessages'] = $errormessages; return $result; diff --git a/application/language/bulgarian/station_lang.php b/application/language/bulgarian/station_lang.php index 172d9af2..e83e8c46 100644 --- a/application/language/bulgarian/station_lang.php +++ b/application/language/bulgarian/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Define a default message th $lang['station_location_qrz_subscription'] = 'Subscription Required'; $lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; +$lang['station_location_hrdlog_code_hint'] = "Create your API Code on HRDLog.net Userprofile page"; $lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; $lang['station_location_oqrs_enabled'] = "OQRS Enabled"; diff --git a/application/language/chinese_simplified/station_lang.php b/application/language/chinese_simplified/station_lang.php index 172d9af2..e83e8c46 100644 --- a/application/language/chinese_simplified/station_lang.php +++ b/application/language/chinese_simplified/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Define a default message th $lang['station_location_qrz_subscription'] = 'Subscription Required'; $lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; +$lang['station_location_hrdlog_code_hint'] = "Create your API Code on HRDLog.net Userprofile page"; $lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; $lang['station_location_oqrs_enabled'] = "OQRS Enabled"; diff --git a/application/language/czech/station_lang.php b/application/language/czech/station_lang.php index 172d9af2..e83e8c46 100644 --- a/application/language/czech/station_lang.php +++ b/application/language/czech/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Define a default message th $lang['station_location_qrz_subscription'] = 'Subscription Required'; $lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; +$lang['station_location_hrdlog_code_hint'] = "Create your API Code on HRDLog.net Userprofile page"; $lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; $lang['station_location_oqrs_enabled'] = "OQRS Enabled"; diff --git a/application/language/dutch/station_lang.php b/application/language/dutch/station_lang.php index 172d9af2..e83e8c46 100644 --- a/application/language/dutch/station_lang.php +++ b/application/language/dutch/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Define a default message th $lang['station_location_qrz_subscription'] = 'Subscription Required'; $lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; +$lang['station_location_hrdlog_code_hint'] = "Create your API Code on HRDLog.net Userprofile page"; $lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; $lang['station_location_oqrs_enabled'] = "OQRS Enabled"; diff --git a/application/language/english/station_lang.php b/application/language/english/station_lang.php index d3206d8a..51a487c7 100644 --- a/application/language/english/station_lang.php +++ b/application/language/english/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Define a default message th $lang['station_location_qrz_subscription'] = 'Subscription Required'; $lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; +$lang['station_location_hrdlog_code_hint'] = "Create your API Code on HRDLog.net Userprofile page"; $lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; $lang['station_location_oqrs_enabled'] = "OQRS Enabled"; diff --git a/application/language/finnish/station_lang.php b/application/language/finnish/station_lang.php index 172d9af2..e83e8c46 100644 --- a/application/language/finnish/station_lang.php +++ b/application/language/finnish/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Define a default message th $lang['station_location_qrz_subscription'] = 'Subscription Required'; $lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; +$lang['station_location_hrdlog_code_hint'] = "Create your API Code on HRDLog.net Userprofile page"; $lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; $lang['station_location_oqrs_enabled'] = "OQRS Enabled"; diff --git a/application/language/french/station_lang.php b/application/language/french/station_lang.php index da43bc0d..eedb61fc 100644 --- a/application/language/french/station_lang.php +++ b/application/language/french/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Vous pouvez définir un mes $lang['station_location_qrz_subscription'] = 'Subscription Required'; $lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; +$lang['station_location_hrdlog_code_hint'] = "Create your API Code on HRDLog.net Userprofile page"; $lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; $lang['station_location_oqrs_enabled'] = "OQRS Enabled"; diff --git a/application/language/german/station_lang.php b/application/language/german/station_lang.php index 597c95bf..6133bdfa 100644 --- a/application/language/german/station_lang.php +++ b/application/language/german/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Definiere eine Standard-Nac $lang['station_location_qrz_subscription'] = 'Abonnement erforderlich'; $lang['station_location_qrz_hint'] = "Finde deinen 'QRZ Logbook API Key' in den QRZ.com Logbuch Einstellungen"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbuch Echtzeit Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Benutzername"; +$lang['station_location_hrdlog_username_hint'] = "Der Benutzername mit dem du bei HRDlog.net registriert bist (normalerweise dein Rufzeichen)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbuch Echtzeit Upload"; -$lang['station_location_hrdlog_hint'] = "Erstelle deinen API Key auf HRDLog.net Benutzerprofil Seite"; +$lang['station_location_hrdlog_code_hint'] = "Erstelle deinen API Key auf HRDLog.net Benutzerprofil Seite"; $lang['station_location_qo100_hint'] = "Erstelle deinen API Key auf deiner QO-100 Dx Club's Profil Seite"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Echtzeit Upload"; $lang['station_location_oqrs_enabled'] = "OQRS aktivieren"; diff --git a/application/language/greek/station_lang.php b/application/language/greek/station_lang.php index 172d9af2..e83e8c46 100644 --- a/application/language/greek/station_lang.php +++ b/application/language/greek/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Define a default message th $lang['station_location_qrz_subscription'] = 'Subscription Required'; $lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; +$lang['station_location_hrdlog_code_hint'] = "Create your API Code on HRDLog.net Userprofile page"; $lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; $lang['station_location_oqrs_enabled'] = "OQRS Enabled"; diff --git a/application/language/italian/station_lang.php b/application/language/italian/station_lang.php index 172d9af2..e83e8c46 100644 --- a/application/language/italian/station_lang.php +++ b/application/language/italian/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Define a default message th $lang['station_location_qrz_subscription'] = 'Subscription Required'; $lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; +$lang['station_location_hrdlog_code_hint'] = "Create your API Code on HRDLog.net Userprofile page"; $lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; $lang['station_location_oqrs_enabled'] = "OQRS Enabled"; diff --git a/application/language/polish/station_lang.php b/application/language/polish/station_lang.php index 172d9af2..e83e8c46 100644 --- a/application/language/polish/station_lang.php +++ b/application/language/polish/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Define a default message th $lang['station_location_qrz_subscription'] = 'Subscription Required'; $lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; +$lang['station_location_hrdlog_code_hint'] = "Create your API Code on HRDLog.net Userprofile page"; $lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; $lang['station_location_oqrs_enabled'] = "OQRS Enabled"; diff --git a/application/language/russian/station_lang.php b/application/language/russian/station_lang.php index 6726851e..92b5cbd7 100644 --- a/application/language/russian/station_lang.php +++ b/application/language/russian/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Define a default message th $lang['station_location_qrz_subscription'] = 'Требуется подписка'; $lang['station_location_qrz_hint'] = "Ваш ключ API находится на странице настроек журнала QRZ.com"; $lang['station_location_qrz_realtime_upload'] = 'Загрузка в журнал QRZ.com в реальном времени'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "Загрузка в журнал HRDLog.net в реальном времени"; -$lang['station_location_hrdlog_hint'] = "Создайте свой код к API наn странице профиля пользователя HRDLog.net"; +$lang['station_location_hrdlog_code_hint'] = "Создайте свой код к API наn странице профиля пользователя HRDLog.net"; $lang['station_location_qo100_hint'] = "Создайте свой ключ API на странице вашего профиля в QO-100 Dx Club"; $lang['station_location_qo100_realtime_upload'] = "Загрузка QO-100 Dx Club в реальном времени"; $lang['station_location_oqrs_enabled'] = "OQRS включен"; diff --git a/application/language/spanish/station_lang.php b/application/language/spanish/station_lang.php index 172d9af2..e83e8c46 100644 --- a/application/language/spanish/station_lang.php +++ b/application/language/spanish/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Define a default message th $lang['station_location_qrz_subscription'] = 'Subscription Required'; $lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; +$lang['station_location_hrdlog_code_hint'] = "Create your API Code on HRDLog.net Userprofile page"; $lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; $lang['station_location_oqrs_enabled'] = "OQRS Enabled"; diff --git a/application/language/swedish/station_lang.php b/application/language/swedish/station_lang.php index 172d9af2..e83e8c46 100644 --- a/application/language/swedish/station_lang.php +++ b/application/language/swedish/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Define a default message th $lang['station_location_qrz_subscription'] = 'Subscription Required'; $lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; +$lang['station_location_hrdlog_code_hint'] = "Create your API Code on HRDLog.net Userprofile page"; $lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; $lang['station_location_oqrs_enabled'] = "OQRS Enabled"; diff --git a/application/language/turkish/station_lang.php b/application/language/turkish/station_lang.php index 172d9af2..e83e8c46 100644 --- a/application/language/turkish/station_lang.php +++ b/application/language/turkish/station_lang.php @@ -99,8 +99,11 @@ $lang['station_location_eqsl_defaultqslmsg_hint'] = "Define a default message th $lang['station_location_qrz_subscription'] = 'Subscription Required'; $lang['station_location_qrz_hint'] = "Find your API key on the QRZ.com Logbook settings page"; $lang['station_location_qrz_realtime_upload'] = 'QRZ.com Logbook Realtime Upload'; +$lang['station_location_hrdlog_username'] = "HRDLog.net Username"; +$lang['station_location_hrdlog_username_hint'] = "The username you are registered with at HRDlog.net (usually your callsign)."; +$lang['station_location_hrdlog_code'] = "HRDLog.net API Key"; $lang['station_location_hrdlog_realtime_upload'] = "HRDLog.net Logbook Realtime Upload"; -$lang['station_location_hrdlog_hint'] = "Create your API Code on HRDLog.net Userprofile page"; +$lang['station_location_hrdlog_code_hint'] = "Create your API Code on HRDLog.net Userprofile page"; $lang['station_location_qo100_hint'] = "Create your API key on your QO-100 Dx Club's profile page"; $lang['station_location_qo100_realtime_upload'] = "QO-100 Dx Club Realtime Upload"; $lang['station_location_oqrs_enabled'] = "OQRS Enabled"; diff --git a/application/migrations/154_create_dxpedition_table.php b/application/migrations/154_create_dxpedition_table.php index a10562ea..b6578c5a 100644 --- a/application/migrations/154_create_dxpedition_table.php +++ b/application/migrations/154_create_dxpedition_table.php @@ -32,7 +32,7 @@ class Migration_create_dxpedition_table extends CI_Migration ), 'callsign' => array( 'type' => 'VARCHAR', - 'constraint' => '255', + 'constraint' => '50', 'null' => FALSE, ), 'country' => array( diff --git a/application/migrations/162_hrdlog_username.php b/application/migrations/162_hrdlog_username.php new file mode 100644 index 00000000..51b71d13 --- /dev/null +++ b/application/migrations/162_hrdlog_username.php @@ -0,0 +1,45 @@ +db->field_exists('hrdlog_username', 'station_profile')) { + $fields = array( + 'hrdlog_username VARCHAR(20) DEFAULT NULL AFTER hrdlog_code', + ); + $this->dbforge->add_column('station_profile', $fields); + } + + // SELECT all rows where hrdlog_code is not empty + $this->db->where("(hrdlog_code IS NOT NULL AND hrdlog_code != '')"); + $query = $this->db->get('station_profile'); + $rows = $query->result(); + + // Iterate through all selected rows + foreach ($rows as $row) { + // Extract the username using the regex pattern + $regex = '/^((\d|[A-Z])+\/)?((\d|[A-Z]){3,})(\/(\d|[A-Z])+)?(\/(\d|[A-Z])+)?$/'; + preg_match($regex, $row->station_callsign, $matches); + $username = $matches[3]; + + // Update the row with the extracted username + $this->db->where('station_id', $row->station_id); + $this->db->update('station_profile', array('hrdlog_username' => $username)); + } + } + + public function down() + { + if ($this->db->field_exists('hrdlog_username', 'station_profile')) { + $this->dbforge->drop_column('station_profile', 'hrdlog_username'); + } + } +} diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 5ea0f871..bf659eea 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -278,7 +278,7 @@ class Logbook_model extends CI_Model { $data['COL_MY_GRIDSQUARE'] = strtoupper(trim($station['station_gridsquare'])); } - if ($this->exists_hrdlog_code($station_id)) { + if ($this->exists_hrdlog_credentials($station_id)) { $data['COL_HRDLOG_QSO_UPLOAD_STATUS'] = 'N'; } @@ -602,15 +602,15 @@ class Logbook_model extends CI_Model { } $result = ''; - $result = $this->exists_hrdlog_code($data['station_id']); + $result = $this->exists_hrdlog_credentials($data['station_id']); // Push qso to hrdlog if code is set, and realtime upload is enabled, and we're not importing an adif-file - if (isset($result->hrdlog_code) && $result->hrdlogrealtime == 1) { + if (isset($result->hrdlog_code) && isset($result->hrdlog_username) && $result->hrdlogrealtime == 1) { $CI =& get_instance(); $CI->load->library('AdifHelper'); $qso = $this->get_qso($last_id,true)->result(); $adif = $CI->adifhelper->getAdifLine($qso[0]); - $result = $this->push_qso_to_hrdlog($result->hrdlog_code, $data['COL_STATION_CALLSIGN'], $adif); + $result = $this->push_qso_to_hrdlog($result->hrdlog_username, $result->hrdlog_code, $adif); if ( ($result['status'] == 'OK') || ( ($result['status'] == 'error') || ($result['status'] == 'duplicate') || ($result['status'] == 'auth_error') )){ $this->mark_hrdlog_qsos_sent($last_id); } @@ -652,10 +652,10 @@ class Logbook_model extends CI_Model { } /* - * Function checks if a HRDLog Code exists in the table with the given station id + * Function checks if a HRDLog Code and Username exists in the table with the given station id */ - function exists_hrdlog_code($station_id) { - $sql = 'select hrdlog_code, hrdlogrealtime from station_profile + function exists_hrdlog_credentials($station_id) { + $sql = 'select hrdlog_username, hrdlog_code, hrdlogrealtime from station_profile where station_id = ?'; $query = $this->db->query($sql,$station_id); @@ -762,7 +762,7 @@ class Logbook_model extends CI_Model { * Function uploads a QSO to HRDLog with the API given. * $adif contains a line with the QSO in the ADIF format. QSO ends with an */ - function push_qso_to_hrdlog($apikey, $station_callsign, $adif, $replaceoption = false) { + function push_qso_to_hrdlog($hrdlog_username, $apikey, $adif, $replaceoption = false) { $url = 'https://robot.hrdlog.net/newentry.aspx'; $post_data['Code'] = $apikey; @@ -772,7 +772,7 @@ class Logbook_model extends CI_Model { } $post_data['ADIFData'] = $adif; - $post_data['Callsign'] = $station_callsign; + $post_data['Callsign'] = $hrdlog_username; $post_encoded=http_build_query($post_data); @@ -797,6 +797,10 @@ class Logbook_model extends CI_Model { $result['status'] = 'auth_error'; $result['message'] = $content; return $result; + } elseif (stristr($content,'Invalid token')) { + $result['status'] = 'auth_error'; + $result['message'] = $content; + return $result; } else { $result['status'] = 'error'; $result['message'] = $content; @@ -1213,7 +1217,7 @@ class Logbook_model extends CI_Model { 'COL_CNTY' => $uscounty ); - if ($this->exists_hrdlog_code($data['station_id'])) { + if ($this->exists_hrdlog_credentials($data['station_id'])) { $data['COL_HRDLOG_QSO_UPLOAD_STATUS'] = 'M'; } @@ -1745,9 +1749,11 @@ class Logbook_model extends CI_Model { * Function returns all the station_id's with HRDLOG Code */ function get_station_id_with_hrdlog_code() { - $sql = 'select station_id, hrdlog_code from station_profile - where coalesce(hrdlog_code, "") <> ""'; - + $sql = 'SELECT station_id, hrdlog_username, hrdlog_code + FROM station_profile + WHERE coalesce(hrdlog_username, "") <> "" + AND coalesce(hrdlog_code, "") <> ""'; + $query = $this->db->query($sql); $result = $query->result(); @@ -2539,6 +2545,8 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = $QSLBreakdown['eQSL_Received'] = 0; $QSLBreakdown['LoTW_Sent'] = 0; $QSLBreakdown['LoTW_Received'] = 0; + $QSLBreakdown['QRZ_Sent'] = 0; + $QSLBreakdown['QRZ_Received'] = 0; $QSLBreakdown['QSL_Sent_today'] = 0; $QSLBreakdown['QSL_Received_today'] = 0; $QSLBreakdown['QSL_Requested_today'] = 0; @@ -2546,6 +2554,8 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = $QSLBreakdown['eQSL_Received_today'] = 0; $QSLBreakdown['LoTW_Sent_today'] = 0; $QSLBreakdown['LoTW_Received_today'] = 0; + $QSLBreakdown['QRZ_Sent_today'] = 0; + $QSLBreakdown['QRZ_Received_today'] = 0; return $QSLBreakdown; } @@ -2557,6 +2567,8 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = $QSLBreakdown['eQSL_Received'] = 0; $QSLBreakdown['LoTW_Sent'] = 0; $QSLBreakdown['LoTW_Received'] = 0; + $QSLBreakdown['QRZ_Sent'] = 0; + $QSLBreakdown['QRZ_Received'] = 0; $QSLBreakdown['QSL_Sent_today'] = 0; $QSLBreakdown['QSL_Received_today'] = 0; $QSLBreakdown['QSL_Requested_today'] = 0; @@ -2564,6 +2576,8 @@ function check_if_callsign_worked_in_logbook($callsign, $StationLocationsArray = $QSLBreakdown['eQSL_Received_today'] = 0; $QSLBreakdown['LoTW_Sent_today'] = 0; $QSLBreakdown['LoTW_Received_today'] = 0; + $QSLBreakdown['QRZ_Sent_today'] = 0; + $QSLBreakdown['QRZ_Received_today'] = 0; return $QSLBreakdown; } diff --git a/application/models/Stations.php b/application/models/Stations.php index 46ae25e3..28bcb691 100644 --- a/application/models/Stations.php +++ b/application/models/Stations.php @@ -101,6 +101,7 @@ class Stations extends CI_Model { 'station_itu' => xss_clean($this->input->post('station_itu', true)), 'state' => $state, 'eqslqthnickname' => xss_clean($this->input->post('eqslnickname', true)), + 'hrdlog_username' => xss_clean($this->input->post('hrdlog_username', true)), 'hrdlog_code' => xss_clean($this->input->post('hrdlog_code', true)), 'hrdlogrealtime' => xss_clean($this->input->post('hrdlogrealtime', true)), 'clublogrealtime' => xss_clean($this->input->post('clublogrealtime', true)), @@ -150,6 +151,7 @@ class Stations extends CI_Model { 'station_itu' => xss_clean($this->input->post('station_itu', true)), 'state' => $state, 'eqslqthnickname' => xss_clean($this->input->post('eqslnickname', true)), + 'hrdlog_username' => xss_clean($this->input->post('hrdlog_username', true)), 'hrdlog_code' => xss_clean($this->input->post('hrdlog_code', true)), 'hrdlogrealtime' => xss_clean($this->input->post('hrdlogrealtime', true)), 'clublogrealtime' => xss_clean($this->input->post('clublogrealtime', true)), @@ -363,58 +365,58 @@ class Stations extends CI_Model { } function stations_with_hrdlog_code() { - $sql = "select station_profile.station_id, station_profile.station_profile_name, station_profile.station_callsign, modc.modcount, notc.notcount, totc.totcount - from station_profile - left outer join ( - select count(*) modcount, station_id - from ". $this->config->item('table_name') . - " where COL_HRDLOG_QSO_UPLOAD_STATUS = 'M' + $sql = "SELECT station_profile.station_id, station_profile.station_profile_name, station_profile.station_callsign, modc.modcount, notc.notcount, totc.totcount + FROM station_profile + LEFT OUTER JOIN ( + SELECT count(*) modcount, station_id + FROM ". $this->config->item('table_name') . + " WHERE COL_HRDLOG_QSO_UPLOAD_STATUS = 'M' group by station_id ) as modc on station_profile.station_id = modc.station_id - left outer join ( - select count(*) notcount, station_id - from " . $this->config->item('table_name') . - " where (coalesce(COL_HRDLOG_QSO_UPLOAD_STATUS, '') = '' + LEFT OUTER JOIN ( + SELECT count(*) notcount, station_id + FROM " . $this->config->item('table_name') . + " WHERE (coalesce(COL_HRDLOG_QSO_UPLOAD_STATUS, '') = '' or COL_HRDLOG_QSO_UPLOAD_STATUS = 'N') group by station_id ) as notc on station_profile.station_id = notc.station_id - left outer join ( - select count(*) totcount, station_id - from " . $this->config->item('table_name') . - " where COL_HRDLOG_QSO_UPLOAD_STATUS = 'Y' + LEFT OUTER JOIN ( + SELECT count(*) totcount, station_id + FROM " . $this->config->item('table_name') . + " WHERE COL_HRDLOG_QSO_UPLOAD_STATUS = 'Y' group by station_id ) as totc on station_profile.station_id = totc.station_id - where coalesce(station_profile.hrdlog_code, '') <> '' - and station_profile.user_id = " . $this->session->userdata('user_id'); + WHERE coalesce(station_profile.hrdlog_code, '') <> '' AND coalesce(station_profile.hrdlog_username, '') <> '' + AND station_profile.user_id = " . $this->session->userdata('user_id'); $query = $this->db->query($sql); return $query; } function stations_with_qrz_api_key() { - $sql = "select station_profile.station_id, station_profile.station_profile_name, station_profile.station_callsign, modc.modcount, notc.notcount, totc.totcount - from station_profile - left outer join ( - select count(*) modcount, station_id - from ". $this->config->item('table_name') . - " where COL_QRZCOM_QSO_UPLOAD_STATUS = 'M' + $sql = "SELECT station_profile.station_id, station_profile.station_profile_name, station_profile.station_callsign, modc.modcount, notc.notcount, totc.totcount + FROM station_profile + LEFT OUTER JOIN ( + SELECT count(*) modcount, station_id + FROM ". $this->config->item('table_name') . + " WHERE COL_QRZCOM_QSO_UPLOAD_STATUS = 'M' group by station_id ) as modc on station_profile.station_id = modc.station_id - left outer join ( - select count(*) notcount, station_id - from " . $this->config->item('table_name') . - " where (coalesce(COL_QRZCOM_QSO_UPLOAD_STATUS, '') = '' + LEFT OUTER JOIN ( + SELECT count(*) notcount, station_id + FROM " . $this->config->item('table_name') . + " WHERE (coalesce(COL_QRZCOM_QSO_UPLOAD_STATUS, '') = '' or COL_QRZCOM_QSO_UPLOAD_STATUS = 'N') group by station_id ) as notc on station_profile.station_id = notc.station_id - left outer join ( - select count(*) totcount, station_id - from " . $this->config->item('table_name') . - " where COL_QRZCOM_QSO_UPLOAD_STATUS = 'Y' + LEFT OUTER JOIN ( + SELECT count(*) totcount, station_id + FROM " . $this->config->item('table_name') . + " WHERE COL_QRZCOM_QSO_UPLOAD_STATUS = 'Y' group by station_id ) as totc on station_profile.station_id = totc.station_id - where coalesce(station_profile.qrzapikey, '') <> '' - and station_profile.user_id = " . $this->session->userdata('user_id'); + WHERE coalesce(station_profile.qrzapikey, '') <> '' + AND station_profile.user_id = " . $this->session->userdata('user_id'); $query = $this->db->query($sql); return $query; diff --git a/application/views/adif/import.php b/application/views/adif/import.php index 9375649b..2de27165 100644 --- a/application/views/adif/import.php +++ b/application/views/adif/import.php @@ -1,4 +1,4 @@ -
+

+

@@ -53,7 +53,7 @@ } else { - echo ''; + echo ''; } ?> diff --git a/application/views/qrz/export.php b/application/views/qrz/export.php index 6d64af5b..4c65be05 100644 --- a/application/views/qrz/export.php +++ b/application/views/qrz/export.php @@ -1,5 +1,5 @@ -
+

diff --git a/application/views/station_profile/create.php b/application/views/station_profile/create.php index 833ab867..8cdcaca0 100644 --- a/application/views/station_profile/create.php +++ b/application/views/station_profile/create.php @@ -265,12 +265,17 @@
-
- - - +
+ + +
-
+
+ + + +
+
hrdlog_username; } ?>"> + +
+
+ hrdlog_code; } ?>"> - +
diff --git a/assets/js/sections/hrdlog.js b/assets/js/sections/hrdlog.js index 9b3ce0e3..bf7779d2 100644 --- a/assets/js/sections/hrdlog.js +++ b/assets/js/sections/hrdlog.js @@ -21,27 +21,30 @@ function ExportHrd(station_id) { $('#notcount'+value.station_id).html(value.notcount); $('#totcount'+value.station_id).html(value.totcount); }); - $(".card-body").append(''); + $(".card-body").append(''); } else { - $(".card-body").append(''); + $(".card-body").append(''); } if (data.errormessages.length > 0) { - $(".card-body").append('' + - '

\n' + - ' \n' + - '

\n' + - '
\n' + - '
\n' + - '
\n' + - '
'); - $.each(data.errormessages, function(index, value) { + $("#hrdlog_export").append( + '
\n' + + '
\n' + + '
\n' + + ' Error Message\n' + + '
\n' + + '
\n' + + '
\n' + + '
\n' + + '
\n' + + '
' + ); + $.each(data.errormessages, function (index, value) { $(".errors").append('
  • ' + value); }); } + } }); } diff --git a/assets/js/sections/qrzlogbook.js b/assets/js/sections/qrzlogbook.js index 84cb9268..c7563046 100644 --- a/assets/js/sections/qrzlogbook.js +++ b/assets/js/sections/qrzlogbook.js @@ -21,24 +21,26 @@ function ExportQrz(station_id) { $('#notcount'+value.station_id).html(value.notcount); $('#totcount'+value.station_id).html(value.totcount); }); - $(".card-body").append(''); + $(".card-body").append(''); } else { - $(".card-body").append(''); + $(".card-body").append(''); } if (data.errormessages.length > 0) { - $(".card-body").append('' + - '

    \n' + - ' \n' + - '

    \n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    '); - $.each(data.errormessages, function(index, value) { + $("#qrz_export").append( + '
    \n' + + '
    \n' + + '
    \n' + + ' Error Message\n' + + '
    \n' + + '
    \n' + + '
    \n' + + '
    \n' + + '
    \n' + + '
    ' + ); + $.each(data.errormessages, function (index, value) { $(".errors").append('
  • ' + value); }); } diff --git a/assets/js/sections/webadif.js b/assets/js/sections/webadif.js index 6203b866..196d5f58 100644 --- a/assets/js/sections/webadif.js +++ b/assets/js/sections/webadif.js @@ -35,21 +35,23 @@ function ExportWebADIF(station_id) { $(".card-body").append(''); } else { - $(".card-body").append(''); + $(".card-body").append(''); } if (data.errormessages.length > 0) { - $(".card-body").append('' + - '

    \n' + - ' \n' + - '

    \n' + - '
    \n' + - '
    \n' + - '
    \n' + - '
    '); - $.each(data.errormessages, function(index, value) { + $("#adif_import").append( + '
    \n' + + '
    \n' + + '
    \n' + + ' Error Message\n' + + '
    \n' + + '
    \n' + + '
    \n' + + '
    \n' + + '
    \n' + + '
    ' + ); + $.each(data.errormessages, function (index, value) { $(".errors").append('
  • ' + value); }); }