diff --git a/application/controllers/Qso.php b/application/controllers/Qso.php index f54c6d04..eec495ce 100755 --- a/application/controllers/Qso.php +++ b/application/controllers/Qso.php @@ -48,6 +48,11 @@ class QSO extends CI_Controller { $this->form_validation->set_rules('callsign', 'Callsign', 'required'); $this->form_validation->set_rules('locator', 'Locator', 'callback_check_locator'); + // [eQSL default msg] GET user options (option_type='eqsl_default_qslmsg'; option_name='key_station_id'; option_key=station_id) // + $this->load->model('user_options_model'); + $options_object = $this->user_options_model->get_options('eqsl_default_qslmsg',array('option_name'=>'key_station_id','option_key'=>$data['active_station_profile']))->result(); + $data['qslmsg'] = (isset($options_object[0]->option_value))?$options_object[0]->option_value:''; + if ($this->form_validation->run() == FALSE) { $data['page_title'] = "Add QSO"; diff --git a/application/controllers/Station.php b/application/controllers/Station.php index f4e1d912..f0600ec1 100644 --- a/application/controllers/Station.php +++ b/application/controllers/Station.php @@ -55,8 +55,14 @@ class Station extends CI_Controller { } else { - $this->stations->add(); - + if (($station_id = $this->stations->add()) !== false) { + // [eQSL default msg] ADD to user options (option_type='eqsl_default_qslmsg'; option_name='key_station_id'; option_key=station_id; option_value=value) // + $eqsl_default_qslmsg = xss_clean($this->input->post('eqsl_default_qslmsg', true)); + if (!empty(trim($eqsl_default_qslmsg))) { + $this->load->model('user_options_model'); + $this->user_options_model->set_option('eqsl_default_qslmsg','key_station_id',array($station_id=>$eqsl_default_qslmsg)); + } + } redirect('station'); } } @@ -68,11 +74,25 @@ class Station extends CI_Controller { $data['page_title'] = lang('station_location_edit') . $data['my_station_profile']->station_profile_name; if ($this->form_validation->run() == FALSE) { + // [eQSL default msg] GET from user options (option_type='eqsl_default_qslmsg'; option_name='key_station_id'; option_key=station_id) // + $this->load->model('user_options_model'); + $options_object = $this->user_options_model->get_options('eqsl_default_qslmsg',array('option_name'=>'key_station_id','option_key'=>$id))->result(); + $data['eqsl_default_qslmsg'] = (isset($options_object[0]->option_value))?$options_object[0]->option_value:''; + $this->load->view('interface_assets/header', $data); $this->load->view('station_profile/edit'); $this->load->view('interface_assets/footer'); } else { - $this->stations->edit(); + if ($this->stations->edit() !== false) { + // [eQSL default msg] ADD to user options (option_type='eqsl_default_qslmsg'; option_name='key_station_id'; option_key=station_id; option_value=value) // + $eqsl_default_qslmsg = xss_clean($this->input->post('eqsl_default_qslmsg', true)); + $this->load->model('user_options_model'); + if (!empty(trim($eqsl_default_qslmsg))) { + $this->user_options_model->set_option('eqsl_default_qslmsg','key_station_id',array($id=>$eqsl_default_qslmsg)); + } else { + $this->user_options_model->del_option('eqsl_default_qslmsg','key_station_id',array('option_key'=>$id)); + } + } $data['notice'] = lang('station_location') . $this->security->xss_clean($this->input->post('station_profile_name', true)) . " Updated"; @@ -163,6 +183,9 @@ class Station extends CI_Controller { $this->load->model('stations'); if ($this->stations->check_station_is_accessible($id)) { $this->stations->delete($id); + // [eQSL default msg] DELETE user options // + $this->load->model('user_options_model'); + $this->user_options_model->del_option('eqsl_default_qslmsg','key_station_id',array('option_key'=>$id)); } redirect('station'); } @@ -208,4 +231,18 @@ class Station extends CI_Controller { echo json_encode($json); } + // [eQSL default msg] Function return options from this station (but can be general use) // + public function get_options() { + $return_json = array(); + $option_type = $this->input->post('option_type'); + $option_name = $this->input->post('option_name'); + $option_key = $this->input->post('option_key'); + if (!empty($option_type) && !empty($option_name) && ($option_key>0)) { + $this->load->model('user_options_model'); + $options_object = $this->user_options_model->get_options($option_type,array('option_name'=>$option_name,'option_key'=>$option_key))->result(); + $return_json[$option_type] = (isset($options_object[0]->option_value))?$options_object[0]->option_value:''; + } + header('Content-Type: application/json'); + echo json_encode($return_json); + } } diff --git a/application/language/bulgarian/qso_lang.php b/application/language/bulgarian/qso_lang.php index fd9c5198..f568468e 100644 --- a/application/language/bulgarian/qso_lang.php +++ b/application/language/bulgarian/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'Например: Q03'; $lang['qso_notes_helptext'] = 'Съдържанието на бележката се използва само в Cloudlog и не се експортира в други услуги.'; $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services like eqsl.cc.'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Нулирай'; diff --git a/application/language/bulgarian/station_lang.php b/application/language/bulgarian/station_lang.php index 7d4576d5..44ad31fd 100644 --- a/application/language/bulgarian/station_lang.php +++ b/application/language/bulgarian/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).." $lang['station_location_signature_info'] = "Signature Information"; $lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $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'; diff --git a/application/language/chinese_simplified/qso_lang.php b/application/language/chinese_simplified/qso_lang.php index e09e5533..48df32d4 100644 --- a/application/language/chinese_simplified/qso_lang.php +++ b/application/language/chinese_simplified/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = '例如: Q03'; $lang['qso_notes_helptext'] = '仅在 Cloudlog 使用而不上传到其他的服务的笔记。'; $lang['qsl_notes_helptext'] = '此笔记内容被导出到QSL服务,如 eqsl.cc。'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = '重置'; diff --git a/application/language/chinese_simplified/station_lang.php b/application/language/chinese_simplified/station_lang.php index 7d4576d5..44ad31fd 100644 --- a/application/language/chinese_simplified/station_lang.php +++ b/application/language/chinese_simplified/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).." $lang['station_location_signature_info'] = "Signature Information"; $lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $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'; diff --git a/application/language/czech/qso_lang.php b/application/language/czech/qso_lang.php index 37a69017..83a90af0 100644 --- a/application/language/czech/qso_lang.php +++ b/application/language/czech/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'Příklad: Q03'; $lang['qso_notes_helptext'] = 'Obsah je užíván pouze Cloudlogu a není exportován do dalších služeb.'; $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services like eqsl.cc.'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Vymazat'; diff --git a/application/language/czech/station_lang.php b/application/language/czech/station_lang.php index 7d4576d5..44ad31fd 100644 --- a/application/language/czech/station_lang.php +++ b/application/language/czech/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).." $lang['station_location_signature_info'] = "Signature Information"; $lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $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'; diff --git a/application/language/dutch/qso_lang.php b/application/language/dutch/qso_lang.php index a01117d8..0c9703ad 100644 --- a/application/language/dutch/qso_lang.php +++ b/application/language/dutch/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'Bijvoorbeeld: Q03'; $lang['qso_notes_helptext'] = 'Notities worden alleen in Cloudlog gebruikt en worden niet geexporteerd naar andere diensten.'; $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services like eqsl.cc.'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Wis QSO'; diff --git a/application/language/dutch/station_lang.php b/application/language/dutch/station_lang.php index 7d4576d5..44ad31fd 100644 --- a/application/language/dutch/station_lang.php +++ b/application/language/dutch/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).." $lang['station_location_signature_info'] = "Signature Information"; $lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $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'; diff --git a/application/language/english/qso_lang.php b/application/language/english/qso_lang.php index 337b7f20..958090cb 100644 --- a/application/language/english/qso_lang.php +++ b/application/language/english/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'For example: Q03'; $lang['qso_notes_helptext'] = 'Note content is used within Cloudlog only and is not exported to other services.'; $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services like eqsl.cc.'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Reset'; diff --git a/application/language/english/station_lang.php b/application/language/english/station_lang.php index 130bf8e5..e6ab3188 100644 --- a/application/language/english/station_lang.php +++ b/application/language/english/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).." $lang['station_location_signature_info'] = "Signature Information"; $lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $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'; diff --git a/application/language/finnish/qso_lang.php b/application/language/finnish/qso_lang.php index 7a657f9a..033d52f4 100644 --- a/application/language/finnish/qso_lang.php +++ b/application/language/finnish/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'Esimerkiksi: Q03'; $lang['qso_notes_helptext'] = 'Muistio tallentuu vain logiin, tähän yhteydeen, eikä siirry eteenpäin muihin palveluihin.'; $lang['qsl_notes_helptext'] = 'Tämä viestisi siirtyy myös QSL-palveluihin, kuten eqsl.cc.'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Tyhjennä'; diff --git a/application/language/finnish/station_lang.php b/application/language/finnish/station_lang.php index 7d4576d5..44ad31fd 100644 --- a/application/language/finnish/station_lang.php +++ b/application/language/finnish/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).." $lang['station_location_signature_info'] = "Signature Information"; $lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $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'; diff --git a/application/language/french/qso_lang.php b/application/language/french/qso_lang.php index 6a49e46f..b7478a43 100644 --- a/application/language/french/qso_lang.php +++ b/application/language/french/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'Par exemple: Q03'; $lang['qso_notes_helptext'] = 'A noter : le contenu est utilisé par Cloudlog uniquement et n\'est pas exporté vers d\'autre services'; $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services like eqsl.cc.'; +$lang['qso_eqsl_qslmsg_helptext'] = "Récupérer le message par défaut pour ce lieu de station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Réinitialiser'; diff --git a/application/language/french/station_lang.php b/application/language/french/station_lang.php index 80678096..abb6e217 100644 --- a/application/language/french/station_lang.php +++ b/application/language/french/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).." $lang['station_location_signature_info'] = "Signature Information"; $lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; +$lang['station_location_eqsl_defaultqslmsg'] = "Message (QSLMSG) par défaut"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "Vous pouvez définir un message par défaut qui sera renseigné et envoyé pour chaque QSO pour ce lieu station. Taille max:"; $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'; diff --git a/application/language/german/qso_lang.php b/application/language/german/qso_lang.php index df257a0d..b4defe32 100644 --- a/application/language/german/qso_lang.php +++ b/application/language/german/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'Zum Beispiel: Q03'; $lang['qso_notes_helptext'] = 'Notizeninhalt wird nur innerhalb von Cloudlog genutzt und nicht an andere Dienste weitergegeben.'; $lang['qsl_notes_helptext'] = 'Dieser Notizeninhalt wird an QSL Services wie eqsl.cc exportiert.'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Zurücksetzen'; diff --git a/application/language/german/station_lang.php b/application/language/german/station_lang.php index 3293a979..4705aea4 100644 --- a/application/language/german/station_lang.php +++ b/application/language/german/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Signatur/Referenz der Station ( $lang['station_location_signature_info'] = "Signatur Information"; $lang['station_location_signature_info_hint'] = "Signatur/Referenz Information der Station (z.B. DA/NW-357)."; $lang['station_location_eqsl_hint'] = "Der 'QTH Nickname' wie er in deinem eQSL Profil konfiguriert ist."; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $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'; diff --git a/application/language/greek/qso_lang.php b/application/language/greek/qso_lang.php index f038d30b..bc262cd3 100644 --- a/application/language/greek/qso_lang.php +++ b/application/language/greek/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'Για παράδειγμα: Q03'; $lang['qso_notes_helptext'] = 'Το περιεχόμενο σημείωσης χρησιμοποιείται μόνο στο Cloudlog και δεν εξάγεται σε άλλες υπηρεσίες.'; $lang['qsl_notes_helptext'] = 'Αυτό το περιεχόμενο σημείωσης εξάγεται σε υπηρεσίες QSL όπως το eqsl.cc.'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Επαναφορά'; diff --git a/application/language/greek/station_lang.php b/application/language/greek/station_lang.php index 7d4576d5..44ad31fd 100644 --- a/application/language/greek/station_lang.php +++ b/application/language/greek/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).." $lang['station_location_signature_info'] = "Signature Information"; $lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $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'; diff --git a/application/language/italian/qso_lang.php b/application/language/italian/qso_lang.php index 3ae7c3bb..322d6267 100644 --- a/application/language/italian/qso_lang.php +++ b/application/language/italian/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'Per esempio: Q03'; $lang['qso_notes_helptext'] = 'Il contenuto della nota viene utilizzato solo all interno di Cloudlog e non viene esportato in altri servizi.'; $lang['qsl_notes_helptext'] = 'Il contenuto di questa nota è esportato a servizi QSL come eqsl.cc.'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Reset'; diff --git a/application/language/italian/station_lang.php b/application/language/italian/station_lang.php index 7d4576d5..44ad31fd 100644 --- a/application/language/italian/station_lang.php +++ b/application/language/italian/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).." $lang['station_location_signature_info'] = "Signature Information"; $lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $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'; diff --git a/application/language/polish/qso_lang.php b/application/language/polish/qso_lang.php index 11b6da4f..60bc76e4 100644 --- a/application/language/polish/qso_lang.php +++ b/application/language/polish/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'Na przykład: Q03'; $lang['qso_notes_helptext'] = 'Notatka jest widoczna tylko w Cloudlog, nie jest wysyłana z potwierdzeniami.'; $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services like eqsl.cc.'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Resetuj'; diff --git a/application/language/polish/station_lang.php b/application/language/polish/station_lang.php index 7d4576d5..44ad31fd 100644 --- a/application/language/polish/station_lang.php +++ b/application/language/polish/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).." $lang['station_location_signature_info'] = "Signature Information"; $lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $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'; diff --git a/application/language/russian/qso_lang.php b/application/language/russian/qso_lang.php index f7337c4a..4d018a7d 100644 --- a/application/language/russian/qso_lang.php +++ b/application/language/russian/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'Например: Q03'; $lang['qso_notes_helptext'] = 'Содержание заметки используется только Cloudlog и не экспортируется на другие сервисы.'; $lang['qsl_notes_helptext'] = 'СОдержимое этой заметки экспортируется в QSL сервисы, к примеру, eqsl.cc и т.п.'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Сброс'; diff --git a/application/language/russian/station_lang.php b/application/language/russian/station_lang.php index ae4ecc21..7e8cdf46 100644 --- a/application/language/russian/station_lang.php +++ b/application/language/russian/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Подпись станции ( $lang['station_location_signature_info'] = "Информация о подписи"; $lang['station_location_signature_info_hint'] = "Информация о подписис станции (т.е. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'Название профиля, который сконфигурирован в eQSL для данного QTH'; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $lang['station_location_qrz_subscription'] = 'Требуется подписка'; $lang['station_location_qrz_hint'] = "Ваш ключ API находится на странице настроек журнала QRZ.com"; $lang['station_location_qrz_realtime_upload'] = 'Загрузка в журнал QRZ.com в реальном времени'; diff --git a/application/language/spanish/qso_lang.php b/application/language/spanish/qso_lang.php index d4087461..336fce28 100644 --- a/application/language/spanish/qso_lang.php +++ b/application/language/spanish/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'Por ejemplo: Q03'; $lang['qso_notes_helptext'] = 'El contenido es usado solo dentro de Cloudlog y no es exportado a otros servicios.'; $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services like eqsl.cc.'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Resetear'; diff --git a/application/language/spanish/station_lang.php b/application/language/spanish/station_lang.php index 7d4576d5..44ad31fd 100644 --- a/application/language/spanish/station_lang.php +++ b/application/language/spanish/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).." $lang['station_location_signature_info'] = "Signature Information"; $lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $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'; diff --git a/application/language/swedish/qso_lang.php b/application/language/swedish/qso_lang.php index 80b0dd0b..b2880e9e 100644 --- a/application/language/swedish/qso_lang.php +++ b/application/language/swedish/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'Exempel: Q03'; $lang['qso_notes_helptext'] = 'Detta innehåll används bara inom Cloudlog och kommer inte att exporteras.'; $lang['qsl_notes_helptext'] = 'Detta innehåll exporteras till QSL-services som eqsl etc.'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Reset'; @@ -71,7 +73,7 @@ $lang['qso_simplefle_error_stationcall'] = "Station Call is not selected"; $lang['qso_simplefle_error_operator'] = "'Operator' Field is empty"; $lang['qso_simplefle_warning_reset'] = "Warning! Do you really want to reset everything?"; $lang['qso_simplefle_warning_missing_band_mode'] = "Warning! You can't log the QSO List, because some QSO don't have band and/or mode defined!"; -$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; +$lang['qso_simplefle_warning_missing_time'] = "Warning! You can't log the QSO List, because some QSO don't have a time defined!"; $lang['qso_simplefle_warning_example_data'] = "Attention! The Data Field containes example data. First Clear Logging Session!"; $lang['qso_simplefle_confirm_save_to_log'] = "Are you sure that you want to add these QSO to the Log and clear the session?"; $lang['qso_simplefle_success_save_to_log_header'] = "QSO Logged!"; diff --git a/application/language/swedish/station_lang.php b/application/language/swedish/station_lang.php index 7d4576d5..44ad31fd 100644 --- a/application/language/swedish/station_lang.php +++ b/application/language/swedish/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).." $lang['station_location_signature_info'] = "Signature Information"; $lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $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'; diff --git a/application/language/turkish/qso_lang.php b/application/language/turkish/qso_lang.php index 3e9516d7..b009f5a6 100644 --- a/application/language/turkish/qso_lang.php +++ b/application/language/turkish/qso_lang.php @@ -26,6 +26,8 @@ $lang['qso_dok_helptext'] = 'Örnek: Q03'; $lang['qso_notes_helptext'] = 'Not içeriği yalnızca Cloudlog içinde kullanılır ve diğer servislere aktarılmaz'; $lang['qsl_notes_helptext'] = 'Bu not içeriği eqsl.cc gibi QSL servislere aktarılır'; +$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station."; + // Button Text on /qso Display $lang['qso_btn_reset_qso'] = 'Baştan başla'; diff --git a/application/language/turkish/station_lang.php b/application/language/turkish/station_lang.php index 7d4576d5..44ad31fd 100644 --- a/application/language/turkish/station_lang.php +++ b/application/language/turkish/station_lang.php @@ -94,6 +94,8 @@ $lang['station_location_signature_name_hint'] = "Station Signature (e.g. GMA).." $lang['station_location_signature_info'] = "Signature Information"; $lang['station_location_signature_info_hint'] = "Station Signature Info (e.g. DA/NW-357)."; $lang['station_location_eqsl_hint'] = 'The QTH Nickname which is configured in your eQSL Profile'; +$lang['station_location_eqsl_defaultqslmsg'] = "Default QSLMSG"; +$lang['station_location_eqsl_defaultqslmsg_hint'] = "You can define a default message that will be populated and sent for each QSO for this station location. Max length:"; $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'; diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 5bb57c37..c7ee44fa 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -260,6 +260,13 @@ class Logbook_model extends CI_Model { $station = $this->check_station($station_id); $data['station_id'] = $station_id; + // [eQSL default msg] add info to QSO for Contest or SFLE // + if (empty($data['COL_QSLMSG']) && (($this->input->post('isSFLE')==true) || (!empty($data['COL_CONTEST_ID'])))) { + $this->load->model('user_options_model'); + $options_object = $this->user_options_model->get_options('eqsl_default_qslmsg',array('option_name'=>'key_station_id','option_key'=>$station_id))->result(); + $data['COL_QSLMSG'] = (isset($options_object[0]->option_value))?$options_object[0]->option_value:''; + } + if (strpos(trim($station['station_gridsquare']), ',') !== false) { $data['COL_MY_VUCC_GRIDS'] = strtoupper(trim($station['station_gridsquare'])); } else { diff --git a/application/models/Stations.php b/application/models/Stations.php index 6a51e018..49674824 100644 --- a/application/models/Stations.php +++ b/application/models/Stations.php @@ -114,8 +114,13 @@ class Stations extends CI_Model { 'webadifrealtime' => xss_clean($this->input->post('webadifrealtime', true)), ); - // Insert Records - $this->db->insert('station_profile', $data); + // Insert Records & return insert id // + if ($this->db->insert('station_profile', $data)===true) { + $station_user_list = $this->all_of_user()->result(); + if ((count($station_user_list)>0) && (isset($station_user_list[intval(count($station_user_list)-1)]->station_id))) { + return $station_user_list[intval(count($station_user_list)-1)]->station_id; + } + } } function edit() { diff --git a/application/models/User_options_model.php b/application/models/User_options_model.php index 9a383338..71253ecd 100644 --- a/application/models/User_options_model.php +++ b/application/models/User_options_model.php @@ -16,16 +16,32 @@ class User_options_model extends CI_Model { } } - public function get_options($option_type) { + public function get_options($option_type, $option_array=null) { $uid=$this->session->userdata('user_id'); - $sql='select option_name,option_key,option_value from user_options where user_id=? and option_type=?'; - return $this->db->query($sql, array($uid, $option_type)); + $sql_more = ""; + $array_sql_value = array($uid, $option_type); + if (is_array($option_array)) { + foreach ($option_array as $key => $value) { + $sql_more .= ' and '.$key.'=?'; + $array_sql_value[] = $value; + } + } + $sql='select option_name,option_key,option_value from user_options where user_id=? and option_type=?'.$sql_more; + return $this->db->query($sql, $array_sql_value); } - public function del_option($option_type, $option_name) { + public function del_option($option_type, $option_name, $option_array=null) { $uid=$this->session->userdata('user_id'); - $sql='delete from user_options where user_id=? and option_type=? and option_name=?'; - return $this->db->query($sql, array($uid, $option_type,$option_name)); + $sql_more = ""; + $array_sql_value = array($uid, $option_type, $option_name); + if (is_array($option_array)) { + foreach ($option_array as $key => $value) { + $sql_more .= ' and '.$key.'=?'; + $array_sql_value[] = $value; + } + } + $sql='delete from user_options where user_id=? and option_type=? and option_name=?'.$sql_more; + return $this->db->query($sql, $array_sql_value); } } diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index a32a71a4..9c8c5fcb 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -1238,7 +1238,11 @@ $(document).on('keypress',function(e) { $('#transmit_power').val(''); }, }); + // [eQSL default msg] change value on change station profle // + qso_set_eqsl_qslmsg(stationProfile,false,'.qso_panel'); }); + // [eQSL default msg] change value on clic // + $('.qso_panel .qso_eqsl_qslmsg_update').off('click').on('click',function() { qso_set_eqsl_qslmsg($('.qso_panel #stationProfile').val(),true,'.qso_panel'); }); session->userdata('user_qth_lookup') == 1) { ?> $('#qth').focusout(function() { diff --git a/application/views/qso/edit_ajax.php b/application/views/qso/edit_ajax.php index 1236be47..3efde2b1 100644 --- a/application/views/qso/edit_ajax.php +++ b/application/views/qso/edit_ajax.php @@ -511,13 +511,14 @@
- +
- + +
diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 3a581113..b6cbed4b 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -532,8 +532,9 @@
- - + + +
diff --git a/application/views/station_profile/create.php b/application/views/station_profile/create.php index 4418fa0a..bcd2ff0b 100644 --- a/application/views/station_profile/create.php +++ b/application/views/station_profile/create.php @@ -249,6 +249,12 @@ +
+ + + 240. +
+
eqslqthnickname; } ?>">
+
+ + + + 240. +
diff --git a/assets/css/general.css b/assets/css/general.css index faa7beab..18577b8b 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -624,3 +624,8 @@ table.dataTable tfoot td { .orange { color: var(--orange); } + +.qso_eqsl_qslmsg_update { + cursor: pointer; + margin-left: 10px; +} \ No newline at end of file diff --git a/assets/js/sections/common.js b/assets/js/sections/common.js index 2072e293..123cb4a0 100644 --- a/assets/js/sections/common.js +++ b/assets/js/sections/common.js @@ -294,6 +294,9 @@ function qso_edit(id) { }); } }); + // [eQSL default msg] change value (for qso edit page) // + $('.modal-content #stationProfile').change(function() { qso_set_eqsl_qslmsg($('.modal-content #stationProfile').val(),false,'.modal-content'); }); + $('.modal-content .qso_eqsl_qslmsg_update').off('click').on('click',function() { qso_set_eqsl_qslmsg($('.modal-content #stationProfile').val(),true,'.modal-content'); }); }, }); } @@ -543,3 +546,22 @@ function displayQsl(id) { } }); } + + +// [eQSL default msg] function to load default qslmsg to qslmsg field on qso add/edit // +function qso_set_eqsl_qslmsg(station_id, force_diff_to_origin=false, object='') { + $.ajax({ + url: base_url+'index.php/station/get_options', + type: 'post', data: {'option_type':'eqsl_default_qslmsg','option_name':'key_station_id','option_key':station_id }, + success: function(res) { + if (typeof res.eqsl_default_qslmsg !== "undefined") { + object = (object!='')?(object+' '):''; + if ((force_diff_to_origin) || ($(object+'#qslmsg').val()==$(object+'#qslmsg_hide').html())) { + $(object+'#qslmsg').val(res.eqsl_default_qslmsg); + $(object+'#qslmsg_hide').html(res.eqsl_default_qslmsg); + } + } + }, + error: function() { }, + }); +} \ No newline at end of file diff --git a/assets/js/sections/simplefle.js b/assets/js/sections/simplefle.js index 534e4977..12f090bf 100644 --- a/assets/js/sections/simplefle.js +++ b/assets/js/sections/simplefle.js @@ -760,6 +760,7 @@ $(".js-save-to-log").click(function () { iota_ref: iota_ref, pota_ref: pota_ref, wwff_ref: wwff_ref, + isSFLE: true }, success: function (result) {}, });