From 4c663bf5143fa19444972fb8176bc37d42932711 Mon Sep 17 00:00:00 2001 From: int2001 Date: Wed, 5 Jul 2023 17:13:17 +0000 Subject: [PATCH 1/4] Added MODE to matching from LotW/eQSL Confirmations --- application/controllers/Lotw.php | 2 +- application/libraries/EqslImporter.php | 6 +++--- application/models/Eqslmethods_model.php | 6 ++++-- application/models/Logbook_model.php | 3 ++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 14602ef7..0a6ea26c 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -497,7 +497,7 @@ class Lotw extends CI_Controller { $record['qsl_rcvd'] = $config['lotw_rcvd_mark']; } - $status = $this->logbook_model->import_check($time_on, $record['call'], $record['band'],$record['station_callsign']); + $status = $this->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'], $record['station_callsign']); $skipNewQso = $this->input->post('importMissing'); // If import missing was checked if($status[0] == "No Match" && $skipNewQso != NULL) { diff --git a/application/libraries/EqslImporter.php b/application/libraries/EqslImporter.php index c22e0208..087ca036 100644 --- a/application/libraries/EqslImporter.php +++ b/application/libraries/EqslImporter.php @@ -156,14 +156,14 @@ class EqslImporter $record['qsl_sent'] = $config['eqsl_rcvd_mark']; } - $status = $this->CI->logbook_model->import_check($time_on, $record['call'], $record['band'],$station_callsign); + $status = $this->CI->logbook_model->import_check($time_on, $record['call'], $record['band'], $record['mode'],$station_callsign); $qsoid = 0; if ($status[0] == "Found") { $qsoid = $status[1]; - $dupe = $this->CI->eqslmethods_model->eqsl_dupe_check($time_on, $record['call'], $record['band'], $config['eqsl_rcvd_mark'],$station_callsign); + $dupe = $this->CI->eqslmethods_model->eqsl_dupe_check($time_on, $record['call'], $record['band'], $record['mode'],$config['eqsl_rcvd_mark'],$station_callsign); if ($dupe == false) { $updated += 1; - $eqsl_status = $this->CI->eqslmethods_model->eqsl_update($time_on, $record['call'], $record['band'], $config['eqsl_rcvd_mark'],$station_callsign); + $eqsl_status = $this->CI->eqslmethods_model->eqsl_update($time_on, $record['call'], $record['band'], $record['mode'], $config['eqsl_rcvd_mark'],$station_callsign); } else { $dupes += 1; $eqsl_status = "Already received an eQSL for this QSO."; diff --git a/application/models/Eqslmethods_model.php b/application/models/Eqslmethods_model.php index e53ea5c3..5ad652dd 100644 --- a/application/models/Eqslmethods_model.php +++ b/application/models/Eqslmethods_model.php @@ -156,7 +156,7 @@ class Eqslmethods_model extends CI_Model { // Update a QSO with eQSL QSL info // We could also probably use this use this: http://eqsl.cc/qslcard/VerifyQSO.txt // http://www.eqsl.cc/qslcard/ImportADIF.txt - function eqsl_update($datetime, $callsign, $band, $qsl_status,$station_callsign) { + function eqsl_update($datetime, $callsign, $band, $mode, $qsl_status,$station_callsign) { $data = array( 'COL_EQSL_QSLRDATE' => date('Y-m-d H:i:s'), // eQSL doesn't give us a date, so let's use current 'COL_EQSL_QSL_RCVD' => $qsl_status @@ -167,6 +167,7 @@ class Eqslmethods_model extends CI_Model { $this->db->where('COL_CALL', $callsign); $this->db->where('COL_STATION_CALLSIGN', $station_callsign); $this->db->where('COL_BAND', $band); + $this->db->where('COL_MODE', $mode); $this->db->update($this->config->item('table_name'), $data); @@ -174,12 +175,13 @@ class Eqslmethods_model extends CI_Model { } // Determine if we've already received an eQSL for this QSO - function eqsl_dupe_check($datetime, $callsign, $band, $qsl_status,$station_callsign) { + function eqsl_dupe_check($datetime, $callsign, $band, $mode, $qsl_status,$station_callsign) { $this->db->select('COL_EQSL_QSLRDATE'); $this->db->where('COL_TIME_ON >= DATE_ADD(DATE_FORMAT("'.$datetime.'", \'%Y-%m-%d %H:%i\' ), INTERVAL -15 MINUTE )'); $this->db->where('COL_TIME_ON <= DATE_ADD(DATE_FORMAT("'.$datetime.'", \'%Y-%m-%d %H:%i\' ), INTERVAL 15 MINUTE )'); $this->db->where('COL_CALL', $callsign); $this->db->where('COL_BAND', $band); + $this->db->where('COL_MODE', $mode); $this->db->where('COL_STATION_CALLSIGN', $station_callsign); $this->db->where('COL_EQSL_QSL_RCVD', $qsl_status); $this->db->limit(1); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 400b2197..0453a240 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2469,7 +2469,7 @@ class Logbook_model extends CI_Model { } /* Used to check if the qso is already in the database */ - function import_check($datetime, $callsign, $band,$station_callsign) { + function import_check($datetime, $callsign, $band, $mode, $station_callsign) { $this->db->select('COL_PRIMARY_KEY, COL_TIME_ON, COL_CALL, COL_BAND'); $this->db->where('COL_TIME_ON >= DATE_ADD(DATE_FORMAT("'.$datetime.'", \'%Y-%m-%d %H:%i\' ), INTERVAL -15 MINUTE )'); @@ -2477,6 +2477,7 @@ class Logbook_model extends CI_Model { $this->db->where('COL_CALL', $callsign); $this->db->where('COL_STATION_CALLSIGN', $station_callsign); $this->db->where('COL_BAND', $band); + $this->db->where('COL_MODE', $mode); $query = $this->db->get($this->config->item('table_name')); From a47db4a7d42b1970ab3308e138e452f6d7c3b52f Mon Sep 17 00:00:00 2001 From: cats-shadow Date: Thu, 6 Jul 2023 04:45:09 +0300 Subject: [PATCH 2/4] Russian translation update --- .../language/russian/general_words_lang.php | 2 ++ .../language/russian/gridsquares_lang.php | 19 +++++++++++++++---- application/language/russian/menu_lang.php | 2 ++ application/language/russian/options_lang.php | 4 ++++ 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/application/language/russian/general_words_lang.php b/application/language/russian/general_words_lang.php index de976c69..3f636bd9 100644 --- a/application/language/russian/general_words_lang.php +++ b/application/language/russian/general_words_lang.php @@ -59,6 +59,7 @@ $lang['general_mark_qsl_rx_bureau'] = 'Отметить QSL полученной $lang['general_mark_qsl_rx_direct'] = 'Отметить QSL полученной (напрямую)'; $lang['general_mark_qsl_tx_bureau'] = 'Отметить QSL отправленной (через бюро)'; $lang['general_mark_qsl_tx_direct'] = 'Отметить QSL отправленой (напрямую)'; +$lang['general_mark_qsl_rx_electronic'] = 'Отметить QSL полученной (электронно)'; $lang['general_delete_qso'] = 'Удалить QSO'; @@ -111,6 +112,7 @@ $lang['gen_hamradio_iota'] = 'IOTA'; $lang['gen_hamradio_sota'] = 'SOTA'; $lang['gen_hamradio_pota'] = 'POTA'; $lang['gen_hamradio_gridsquare'] = 'Квадрат'; +$lang['gen_hamradio_distance'] = 'Дистанция'; $lang['gen_hamradio_operator'] = 'Оператор'; $lang['gen_hamradio_sig'] = 'Sig'; diff --git a/application/language/russian/gridsquares_lang.php b/application/language/russian/gridsquares_lang.php index e28ddaeb..aac2d4b0 100644 --- a/application/language/russian/gridsquares_lang.php +++ b/application/language/russian/gridsquares_lang.php @@ -2,14 +2,25 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - - -$lang['gridsquares_gridsquare_map'] = 'Выбор диапазона'; +$lang['gridsquares_gridsquare_map'] = 'Карта квадратов'; $lang['gridsquares_confirmed_is_green'] = 'Подтверждённые окрашены зелёным'; -$lang['gridsquares_worked_but_not_confirmed_is_red'] = 'Сработанные, но не подтверждённые — красным'; +$lang['gridsquares_worked_but_not_confirmed_is_red'] = 'Сработанные, но не подтверждённые окрвшены красным'; +$lang['gridsquares_activated_but_not_confirmed_is_red'] = 'Активированные, но не подтверждённые окрашены красным'; $lang['gridsquares_this_map_does_not_include_satellite_internet_or_repeater_qsos'] = 'На этой карте не отображены QSO, проведённые через спутники, интернет или репитеры'; $lang['gridsquares_grid_squares'] = 'квадрат(/-а/-ов)'; $lang['gridsquares_total_count'] = 'Всего'; + +$lang['gridsquares_band'] = 'Диапазон'; +$lang['gridsquares_mode'] = 'Вид излучения'; +$lang['gridsquares_sat'] = 'Спутник'; +$lang['gridsquares_confirmation'] = 'Подтверждение'; + +$lang['gridsquares_button_plot'] = 'Отобразить'; + +$lang['gridsquares_gridsquares'] = 'Квадраты'; +$lang['gridsquares_gridsquares_confirmed'] = 'Подтверждёно квадратов'; +$lang['gridsquares_gridsquares_not_confirmed'] = 'Неподтверждёно квадратов'; +$lang['gridsquares_gridsquares_total_worked'] = 'Всего сработано квадратов'; \ No newline at end of file diff --git a/application/language/russian/menu_lang.php b/application/language/russian/menu_lang.php index efdfce23..2c1170d7 100644 --- a/application/language/russian/menu_lang.php +++ b/application/language/russian/menu_lang.php @@ -21,6 +21,7 @@ $lang['menu_notes'] = 'Заметки'; $lang['menu_analytics'] = 'Аналитика'; $lang['menu_statistics'] = 'Статистика'; $lang['menu_gridsquares'] = 'Квадраты'; +$lang['menu_gridmap'] = 'Карта квадратов'; $lang['menu_activated_gridsquares'] = 'Активированные квадраты'; $lang['menu_gridsquare_activators'] = 'Активаторы квадратов'; $lang['menu_distances_worked'] = 'Сработанные дистанции'; @@ -70,6 +71,7 @@ $lang['menu_sota_csv_export'] = 'Экспорт SOTA CSV'; $lang['menu_cabrillo_export'] = 'Экспорт Cabrillo'; $lang['menu_oqrs_requests'] = 'Запросы OQRS'; $lang['menu_print_requested_qsls'] = 'Распечатать запрошенные QSL'; +$lang['menu_labels'] = 'Наклейки'; $lang['menu_logbook_of_the_world'] = 'Logbook of the World'; $lang['menu_eqsl_import_export'] = 'Импорт / экспорт eQSL'; $lang['menu_qrz_logbook'] = 'QRZ Logbook'; diff --git a/application/language/russian/options_lang.php b/application/language/russian/options_lang.php index dec1cb48..52753e90 100644 --- a/application/language/russian/options_lang.php +++ b/application/language/russian/options_lang.php @@ -32,6 +32,8 @@ $lang['options_radio_timeout_warning_changed_to'] = 'Значение тайма $lang['options_email'] = 'Емэйл'; $lang['options_outgoing_protocol'] = 'Протокол отправки емэйл'; $lang['options_smtp_encryption'] = 'Шифрование SMTP'; +$lang['options_email_address'] = 'Адрес электронной почты'; +$lang['options_email_sender_name'] = 'Имя отправителя'; $lang['options_smtp_host'] = 'SMTP хост'; $lang['options_smtp_port'] = 'SMTP порт'; $lang['options_smtp_username'] = 'SMTP логин'; @@ -40,6 +42,8 @@ $lang['options_crlf'] = 'CRLF'; $lang['options_newline'] = 'Newline'; $lang['options_outgoing_email_protocol_changed_to'] = 'Протокол отправки емэйл изменён на '; $lang['options_smtp_encryption_changed_to'] = 'Шифрование SMTP изменено на '; +$lang['options_email_address_changed_to'] = 'Адрес электронной почты изменён на '; +$lang['options_email_sender_name_changed_to'] = 'Имя отправителя изменено на '; $lang['options_smtp_host_changed_to'] = 'SMTP хост изменён на '; $lang['options_smtp_port_changed_to'] = 'SMTP порт изменён на '; $lang['options_smtp_username_changed_to'] = 'SMTP логин изменён на '; From 613a89b8b47d5d35fe29e012ecfad21b336192b9 Mon Sep 17 00:00:00 2001 From: int2001 Date: Thu, 6 Jul 2023 08:17:20 +0000 Subject: [PATCH 3/4] Adds Mastodon-integration as mentioned in issue #1802 --- application/config/migration.php | 2 +- application/controllers/User.php | 12 ++++++- application/language/english/account_lang.php | 3 ++ application/language/finnish/account_lang.php | 3 ++ application/language/german/account_lang.php | 3 ++ application/language/russian/account_lang.php | 3 ++ application/migrations/126_mastodon_url.php | 31 +++++++++++++++++++ application/models/User_model.php | 5 ++- application/views/user/add.php | 14 +++++++++ application/views/user/edit.php | 15 ++++++++- application/views/view_log/qso.php | 1 + 11 files changed, 88 insertions(+), 4 deletions(-) create mode 100644 application/migrations/126_mastodon_url.php diff --git a/application/config/migration.php b/application/config/migration.php index ceb663f7..b5509fd4 100644 --- a/application/config/migration.php +++ b/application/config/migration.php @@ -21,7 +21,7 @@ $config['migration_enabled'] = TRUE; | be upgraded / downgraded to. | */ -$config['migration_version'] = 125; +$config['migration_version'] = 126; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/User.php b/application/controllers/User.php index 2d89e0ad..f29bb11d 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -84,6 +84,7 @@ class User extends CI_Controller { $data['user_show_profile_image'] = $this->input->post('user_show_profile_image'); $data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type'); $data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload'); + $data['user_mastodon_url'] = $this->input->post('user_mastodon_url'); $this->load->view('user/add', $data); } else { $this->load->view('user/add', $data); @@ -116,7 +117,8 @@ class User extends CI_Controller { $this->input->post('user_column5'), $this->input->post('user_show_profile_image'), $this->input->post('user_previous_qsl_type'), - $this->input->post('user_amsat_status_upload'))) { + $this->input->post('user_amsat_status_upload'), + $this->input->post('user_mastodon_url'))) { // Check for errors case EUSERNAMEEXISTS: $data['username_error'] = 'Username '.$this->input->post('user_name').' already in use!'; @@ -159,6 +161,7 @@ class User extends CI_Controller { $data['user_show_profile_image'] = $this->input->post('user_show_profile_image'); $data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type'); $data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload'); + $data['user_mastodon_url'] = $this->input->post('user_mastodon_url'); $this->load->view('user/add', $data); $this->load->view('interface_assets/footer'); } @@ -366,6 +369,12 @@ class User extends CI_Controller { $data['user_amsat_status_upload'] = $q->user_amsat_status_upload; } + if($this->input->post('user_mastodon_url')) { + $data['user_mastodon_url'] = $this->input->post('user_mastodon_url', false); + } else { + $data['user_mastodon_url'] = $q->user_mastodon_url; + } + if($this->input->post('user_column1')) { $data['user_column1'] = $this->input->post('user_column1', true); } else { @@ -451,6 +460,7 @@ class User extends CI_Controller { $data['user_show_profile_image'] = $this->input->post('user_show_profile_image'); $data['user_previous_qsl_type'] = $this->input->post('user_previous_qsl_type'); $data['user_amsat_status_upload'] = $this->input->post('user_amsat_status_upload'); + $data['user_mastodon_url'] = $this->input->post('user_mastodon_url'); $this->load->view('user/edit'); $this->load->view('interface_assets/footer'); } diff --git a/application/language/english/account_lang.php b/application/language/english/account_lang.php index a5172c94..99a7ac1a 100644 --- a/application/language/english/account_lang.php +++ b/application/language/english/account_lang.php @@ -89,3 +89,6 @@ $lang['account_forgot_your_password'] = 'Forgot your password?'; $lang['account_login_to_cloudlog'] = 'Login to Cloudlog'; $lang['account_login'] = 'Login'; + +$lang['account_mastodon'] = 'Mastodonserver'; +$lang['account_user_mastodon'] = 'URL of Mastodonserver'; diff --git a/application/language/finnish/account_lang.php b/application/language/finnish/account_lang.php index 5adf7910..183fc453 100644 --- a/application/language/finnish/account_lang.php +++ b/application/language/finnish/account_lang.php @@ -89,3 +89,6 @@ $lang['account_forgot_your_password'] = 'Salasana unohtunut?'; $lang['account_login_to_cloudlog'] = 'Kirjaudu Cloudlogiin'; $lang['account_login'] = 'Kirjaudu'; + +$lang['account_mastodon'] = 'Mastodonserver'; +$lang['account_user_mastodon'] = 'URL of Mastodonserver'; diff --git a/application/language/german/account_lang.php b/application/language/german/account_lang.php index d0400d8e..e1fa729d 100644 --- a/application/language/german/account_lang.php +++ b/application/language/german/account_lang.php @@ -89,3 +89,6 @@ $lang['account_forgot_your_password'] = 'Passwort vergessen?'; $lang['account_login_to_cloudlog'] = 'Anmeldung bei Cloudlog'; $lang['account_login'] = 'Anmeldung'; + +$lang['account_mastodon'] = 'Mastodonserver'; +$lang['account_user_mastodon'] = 'URL des Mastodonservers'; diff --git a/application/language/russian/account_lang.php b/application/language/russian/account_lang.php index c4e676a4..b2841b1c 100644 --- a/application/language/russian/account_lang.php +++ b/application/language/russian/account_lang.php @@ -89,3 +89,6 @@ $lang['account_forgot_your_password'] = 'Забыли пароль?'; $lang['account_login_to_cloudlog'] = 'Вход в Cloudlog'; $lang['account_login'] = 'Вход'; + +$lang['account_mastodon'] = 'Mastodonserver'; +$lang['account_user_mastodon'] = 'URL of Mastodonserver'; diff --git a/application/migrations/126_mastodon_url.php b/application/migrations/126_mastodon_url.php new file mode 100644 index 00000000..0e938588 --- /dev/null +++ b/application/migrations/126_mastodon_url.php @@ -0,0 +1,31 @@ +db->field_exists('user_mastodon_url', 'users')) { + $fields = array( + 'user_mastodon_url varchar(32) default NULL', + ); + $this->dbforge->add_column('users', $fields, 'user_column5'); + } + } + + public function down() + { + $this->dbforge->drop_column('users', 'user_mastodon_url'); + } +} + + + diff --git a/application/models/User_model.php b/application/models/User_model.php index d58cf883..8234f9b2 100644 --- a/application/models/User_model.php +++ b/application/models/User_model.php @@ -123,7 +123,7 @@ class User_Model extends CI_Model { function add($username, $password, $email, $type, $firstname, $lastname, $callsign, $locator, $timezone, $measurement, $user_date_format, $user_stylesheet, $user_qth_lookup, $user_sota_lookup, $user_wwff_lookup, $user_pota_lookup, $user_show_notes, $user_column1, $user_column2, $user_column3, $user_column4, $user_column5, - $user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload) { + $user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload, $user_mastodon_url) { // Check that the user isn't already used if(!$this->exists($username)) { $data = array( @@ -152,6 +152,7 @@ class User_Model extends CI_Model { 'user_show_profile_image' => xss_clean($user_show_profile_image), 'user_previous_qsl_type' => xss_clean($user_previous_qsl_type), 'user_amsat_status_upload' => xss_clean($user_amsat_status_upload), + 'user_mastodon_url' => xss_clean($user_mastodon_url), ); // Check the password is valid @@ -208,6 +209,7 @@ class User_Model extends CI_Model { 'user_show_profile_image' => xss_clean($fields['user_show_profile_image']), 'user_previous_qsl_type' => xss_clean($fields['user_previous_qsl_type']), 'user_amsat_status_upload' => xss_clean($fields['user_amsat_status_upload']), + 'user_mastodon_url' => xss_clean($fields['user_mastodon_url']), ); // Check to see if the user is allowed to change user levels @@ -328,6 +330,7 @@ class User_Model extends CI_Model { 'user_column5' => isset($u->row()->user_column5) ? $u->row()->user_column5: 'Country', 'user_previous_qsl_type' => isset($u->row()->user_previous_qsl_type) ? $u->row()->user_previous_qsl_type: 0, 'user_amsat_status_upload' => isset($u->row()->user_amsat_status_upload) ? $u->row()->user_amsat_status_upload: 0, + 'user_mastodon_url' => $u->row()->user_mastodon_url, 'active_station_logbook' => $u->row()->active_station_logbook, ); diff --git a/application/views/user/add.php b/application/views/user/add.php index d3a0492e..0d50db0e 100644 --- a/application/views/user/add.php +++ b/application/views/user/add.php @@ -514,6 +514,20 @@ +
+
+
+ +
+
+
+ + +
Main-URL of your Mastodonserver. f.ex. https://radiosocial.de
+
+
+
+
diff --git a/application/views/user/edit.php b/application/views/user/edit.php index a3110a44..3c44758f 100644 --- a/application/views/user/edit.php +++ b/application/views/user/edit.php @@ -512,7 +512,20 @@ - +
+
+
+ +
+
+
+ + +
Main-URL of your Mastodonserver. f.ex. https://radiosocial.de
+
+
+
+
diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index 18bb3a31..9fee6860 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -407,6 +407,7 @@ ?>
+ session->userdata('user_mastodon_url') != null) { echo '
'; } ?> From 34b35ec4a33c34ed654bc886e4e5c90e90330c51 Mon Sep 17 00:00:00 2001 From: int2001 Date: Thu, 6 Jul 2023 08:22:44 +0000 Subject: [PATCH 4/4] Fixed header of migrationscript. Accidently there was the amsat-feature documented... --- application/migrations/126_mastodon_url.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/application/migrations/126_mastodon_url.php b/application/migrations/126_mastodon_url.php index 0e938588..ec2a5992 100644 --- a/application/migrations/126_mastodon_url.php +++ b/application/migrations/126_mastodon_url.php @@ -3,11 +3,10 @@ defined('BASEPATH') OR exit('No direct script access allowed'); /** - * Class Migration_amsat_status_upload_option + * Class Migration_mastodon_url * - * Creates a boolean column with option to allow for activating uploading - * a status info to https://amsat.org/status - */ + * Creates a varchar column for the Mastodon-URL of the User +*/ class Migration_mastodon_url extends CI_Migration {