From 3d22e3c949207faa16b106d1599397bf091212a1 Mon Sep 17 00:00:00 2001 From: DJ3CE Date: Wed, 27 Mar 2024 11:31:39 +0100 Subject: [PATCH] Implement contesting copy-exchange-to(-nearly)-anything - in contest-session, the (numeric-)id of the selected 'copy' is saved, compatible with the previous DOK-copy. - UI changes - Logbook_model enhancements - Translation additions --- .../language/bulgarian/contesting_lang.php | 6 +++ .../chinese_simplified/contesting_lang.php | 6 +++ .../language/czech/contesting_lang.php | 6 +++ .../language/dutch/contesting_lang.php | 6 +++ .../language/english/contesting_lang.php | 6 +++ .../language/finnish/contesting_lang.php | 6 +++ .../language/french/contesting_lang.php | 6 +++ .../language/german/contesting_lang.php | 6 +++ .../language/greek/contesting_lang.php | 6 +++ .../language/italian/contesting_lang.php | 6 +++ .../language/polish/contesting_lang.php | 6 +++ .../language/russian/contesting_lang.php | 6 +++ .../language/spanish/contesting_lang.php | 6 +++ .../language/swedish/contesting_lang.php | 6 +++ .../language/turkish/contesting_lang.php | 6 +++ application/models/Contesting_model.php | 5 ++ application/models/Logbook_model.php | 52 ++++++++++++++++--- application/views/contesting/index.php | 11 +++- assets/js/sections/contesting.js | 9 ++-- 19 files changed, 154 insertions(+), 13 deletions(-) diff --git a/application/language/bulgarian/contesting_lang.php b/application/language/bulgarian/contesting_lang.php index 35976bd4..1e29be33 100644 --- a/application/language/bulgarian/contesting_lang.php +++ b/application/language/bulgarian/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = 'Предложения за и $lang['contesting_title_contest_logbook'] = 'Дневник на състезанието'; $lang['contesting_copy_exch_to_dok'] = 'Copy received exchange to DOK field in the database!'; +$lang['contesting_copy_exch_to_none'] = 'Copy received exchange to no additional field in the database!'; +$lang['contesting_copy_exch_to_power'] = 'Copy received exchange to RX-Power field in the database!'; +$lang['contesting_copy_exch_to_state'] = 'Copy received exchange to US-State field in the database!'; +$lang['contesting_copy_exch_to_age'] = 'Copy received exchange to Age field in the database!'; +$lang['contesting_copy_exch_to_name'] = 'Copy received exchange to Name field in the database!'; +$lang['contesting_copy_exch_to_locator'] = 'Copy received exchange to Locator field in the database!'; diff --git a/application/language/chinese_simplified/contesting_lang.php b/application/language/chinese_simplified/contesting_lang.php index 33da0602..733e204a 100644 --- a/application/language/chinese_simplified/contesting_lang.php +++ b/application/language/chinese_simplified/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = '呼号建议'; $lang['contesting_title_contest_logbook'] = '竞赛日志簿'; $lang['contesting_copy_exch_to_dok'] = '将收到的交换信息复制到数据库中的 DOK 字段!'; +$lang['contesting_copy_exch_to_none'] = '将收到的交换信息复制到数据库中的 no additional 字段!'; +$lang['contesting_copy_exch_to_power'] = '将收到的交换信息复制到数据库中的 RX-Power 字段!'; +$lang['contesting_copy_exch_to_state'] = '将收到的交换信息复制到数据库中的 US-State 字段!'; +$lang['contesting_copy_exch_to_age'] = '将收到的交换信息复制到数据库中的 Age 字段!'; +$lang['contesting_copy_exch_to_name'] = '将收到的交换信息复制到数据库中的 Name 字段!'; +$lang['contesting_copy_exch_to_locator'] = '将收到的交换信息复制到数据库中的 Locator 字段!'; diff --git a/application/language/czech/contesting_lang.php b/application/language/czech/contesting_lang.php index 3f636050..991e0f56 100644 --- a/application/language/czech/contesting_lang.php +++ b/application/language/czech/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = 'Našeptávač značek'; $lang['contesting_title_contest_logbook'] = 'Závodní deník'; $lang['contesting_copy_exch_to_dok'] = 'Copy received exchange to DOK field in the database!'; +$lang['contesting_copy_exch_to_none'] = 'Copy received exchange to no additional field in the database!'; +$lang['contesting_copy_exch_to_power'] = 'Copy received exchange to RX-Power field in the database!'; +$lang['contesting_copy_exch_to_state'] = 'Copy received exchange to US-State field in the database!'; +$lang['contesting_copy_exch_to_age'] = 'Copy received exchange to Age field in the database!'; +$lang['contesting_copy_exch_to_name'] = 'Copy received exchange to Name field in the database!'; +$lang['contesting_copy_exch_to_locator'] = 'Copy received exchange to Locator field in the database!'; diff --git a/application/language/dutch/contesting_lang.php b/application/language/dutch/contesting_lang.php index d5c6f5f8..f5c7a99e 100644 --- a/application/language/dutch/contesting_lang.php +++ b/application/language/dutch/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = 'Roepnaam suggesties'; $lang['contesting_title_contest_logbook'] = 'Contest Logboek'; $lang['contesting_copy_exch_to_dok'] = 'Copy received exchange to DOK field in the database!'; +$lang['contesting_copy_exch_to_none'] = 'Copy received exchange to no additional field in the database!'; +$lang['contesting_copy_exch_to_power'] = 'Copy received exchange to RX-Power field in the database!'; +$lang['contesting_copy_exch_to_state'] = 'Copy received exchange to US-State field in the database!'; +$lang['contesting_copy_exch_to_age'] = 'Copy received exchange to Age field in the database!'; +$lang['contesting_copy_exch_to_name'] = 'Copy received exchange to Name field in the database!'; +$lang['contesting_copy_exch_to_locator'] = 'Copy received exchange to Locator field in the database!'; diff --git a/application/language/english/contesting_lang.php b/application/language/english/contesting_lang.php index f078f321..b9a9970f 100644 --- a/application/language/english/contesting_lang.php +++ b/application/language/english/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = 'Callsign Suggestions'; $lang['contesting_title_contest_logbook'] = 'Contest Logbook'; $lang['contesting_copy_exch_to_dok'] = 'Copy received exchange to DOK field in the database!'; +$lang['contesting_copy_exch_to_none'] = 'Copy received exchange to no additional field in the database!'; +$lang['contesting_copy_exch_to_power'] = 'Copy received exchange to RX-Power field in the database!'; +$lang['contesting_copy_exch_to_state'] = 'Copy received exchange to US-State field in the database!'; +$lang['contesting_copy_exch_to_age'] = 'Copy received exchange to Age field in the database!'; +$lang['contesting_copy_exch_to_name'] = 'Copy received exchange to Name field in the database!'; +$lang['contesting_copy_exch_to_locator'] = 'Copy received exchange to Locator field in the database!'; diff --git a/application/language/finnish/contesting_lang.php b/application/language/finnish/contesting_lang.php index eb8a3ad8..80f8c061 100644 --- a/application/language/finnish/contesting_lang.php +++ b/application/language/finnish/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = 'Ehdotettu kutsu'; $lang['contesting_title_contest_logbook'] = 'Kilpailussa pidetyt yhteydet'; $lang['contesting_copy_exch_to_dok'] = 'Copy received exchange to DOK field in the database!'; +$lang['contesting_copy_exch_to_none'] = 'Copy received exchange to no additional field in the database!'; +$lang['contesting_copy_exch_to_power'] = 'Copy received exchange to RX-Power field in the database!'; +$lang['contesting_copy_exch_to_state'] = 'Copy received exchange to US-State field in the database!'; +$lang['contesting_copy_exch_to_age'] = 'Copy received exchange to Age field in the database!'; +$lang['contesting_copy_exch_to_name'] = 'Copy received exchange to Name field in the database!'; +$lang['contesting_copy_exch_to_locator'] = 'Copy received exchange to Locator field in the database!'; diff --git a/application/language/french/contesting_lang.php b/application/language/french/contesting_lang.php index a7d0b2c1..445b5233 100644 --- a/application/language/french/contesting_lang.php +++ b/application/language/french/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = "Suggestion d'indicatif"; $lang['contesting_title_contest_logbook'] = "Journal de trafic du concours"; $lang['contesting_copy_exch_to_dok'] = "Copiez l'échange reçu dans le champ DOK de la base de données !"; +$lang['contesting_copy_exch_to_none'] = "Copiez l'échange reçu dans le champ no additional de la base de données !"; +$lang['contesting_copy_exch_to_power'] = "Copiez l'échange reçu dans le champ RX-Power de la base de données !"; +$lang['contesting_copy_exch_to_state'] = "Copiez l'échange reçu dans le champ US-State de la base de données !"; +$lang['contesting_copy_exch_to_age'] = "Copiez l'échange reçu dans le champ Age de la base de données !"; +$lang['contesting_copy_exch_to_name'] = "Copiez l'échange reçu dans le champ Name de la base de données !"; +$lang['contesting_copy_exch_to_locator'] = "Copiez l'échange reçu dans le champ Locator de la base de données !"; diff --git a/application/language/german/contesting_lang.php b/application/language/german/contesting_lang.php index f2151eed..c0c120c0 100644 --- a/application/language/german/contesting_lang.php +++ b/application/language/german/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = 'Rufzeichenvorschläge'; $lang['contesting_title_contest_logbook'] = 'Contest-Logbuch'; $lang['contesting_copy_exch_to_dok'] = 'Kopiere den erhaltenen Exchange in das DOK Feld der Datenbank!'; +$lang['contesting_copy_exch_to_none'] = 'Kopiere den erhaltenen Exchange in kein weiteres Feld der Datenbank!'; +$lang['contesting_copy_exch_to_power'] = 'Kopiere den erhaltenen Exchange in das RX-Power Feld der Datenbank!'; +$lang['contesting_copy_exch_to_state'] = 'Kopiere den erhaltenen Exchange in das US-State Feld der Datenbank!'; +$lang['contesting_copy_exch_to_age'] = 'Kopiere den erhaltenen Exchange in das Lebensalter Feld der Datenbank!'; +$lang['contesting_copy_exch_to_name'] = 'Kopiere den erhaltenen Exchange in das Namens Feld der Datenbank!'; +$lang['contesting_copy_exch_to_locator'] = 'Kopiere den erhaltenen Exchange in das Locator Feld der Datenbank!'; diff --git a/application/language/greek/contesting_lang.php b/application/language/greek/contesting_lang.php index 2350f539..42273483 100644 --- a/application/language/greek/contesting_lang.php +++ b/application/language/greek/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = 'Προτάσεις διακρ $lang['contesting_title_contest_logbook'] = 'Αρχείο διαγωνισμού'; $lang['contesting_copy_exch_to_dok'] = 'Copy received exchange to DOK field in the database!'; +$lang['contesting_copy_exch_to_none'] = 'Copy received exchange to no additional field in the database!'; +$lang['contesting_copy_exch_to_power'] = 'Copy received exchange to RX-Power field in the database!'; +$lang['contesting_copy_exch_to_state'] = 'Copy received exchange to US-State field in the database!'; +$lang['contesting_copy_exch_to_age'] = 'Copy received exchange to Age field in the database!'; +$lang['contesting_copy_exch_to_name'] = 'Copy received exchange to Name field in the database!'; +$lang['contesting_copy_exch_to_locator'] = 'Copy received exchange to Locator field in the database!'; diff --git a/application/language/italian/contesting_lang.php b/application/language/italian/contesting_lang.php index 4821a34c..1f75cfa4 100644 --- a/application/language/italian/contesting_lang.php +++ b/application/language/italian/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = 'Suggerimenti Nominativi'; $lang['contesting_title_contest_logbook'] = 'Log del Contest'; $lang['contesting_copy_exch_to_dok'] = 'Copy received exchange to DOK field in the database!'; +$lang['contesting_copy_exch_to_none'] = 'Copy received exchange to no additional field in the database!'; +$lang['contesting_copy_exch_to_power'] = 'Copy received exchange to RX-Power field in the database!'; +$lang['contesting_copy_exch_to_state'] = 'Copy received exchange to US-State field in the database!'; +$lang['contesting_copy_exch_to_age'] = 'Copy received exchange to Age field in the database!'; +$lang['contesting_copy_exch_to_name'] = 'Copy received exchange to Name field in the database!'; +$lang['contesting_copy_exch_to_locator'] = 'Copy received exchange to Locator field in the database!'; diff --git a/application/language/polish/contesting_lang.php b/application/language/polish/contesting_lang.php index 3b9b940b..f089b32e 100644 --- a/application/language/polish/contesting_lang.php +++ b/application/language/polish/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = 'Podpowiadanie znaków'; $lang['contesting_title_contest_logbook'] = 'Log zawodów'; $lang['contesting_copy_exch_to_dok'] = 'Copy received exchange to DOK field in the database!'; +$lang['contesting_copy_exch_to_none'] = 'Copy received exchange to no additional field in the database!'; +$lang['contesting_copy_exch_to_power'] = 'Copy received exchange to RX-Power field in the database!'; +$lang['contesting_copy_exch_to_state'] = 'Copy received exchange to US-State field in the database!'; +$lang['contesting_copy_exch_to_age'] = 'Copy received exchange to Age field in the database!'; +$lang['contesting_copy_exch_to_name'] = 'Copy received exchange to Name field in the database!'; +$lang['contesting_copy_exch_to_locator'] = 'Copy received exchange to Locator field in the database!'; diff --git a/application/language/russian/contesting_lang.php b/application/language/russian/contesting_lang.php index 416abda6..f6638ae7 100644 --- a/application/language/russian/contesting_lang.php +++ b/application/language/russian/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = 'Предложение поз $lang['contesting_title_contest_logbook'] = 'Журнал контеста'; $lang['contesting_copy_exch_to_dok'] = 'Копировать принятую контроль в поле DOK базы данных!'; +$lang['contesting_copy_exch_to_none'] = 'Копировать принятую контроль в поле no additional базы данных!'; +$lang['contesting_copy_exch_to_power'] = 'Копировать принятую контроль в поле RX-Power базы данных!'; +$lang['contesting_copy_exch_to_state'] = 'Копировать принятую контроль в поле US-State базы данных!'; +$lang['contesting_copy_exch_to_age'] = 'Копировать принятую контроль в поле Age базы данных!'; +$lang['contesting_copy_exch_to_name'] = 'Копировать принятую контроль в поле Name базы данных!'; +$lang['contesting_copy_exch_to_locator'] = 'Копировать принятую контроль в поле Locator базы данных!'; diff --git a/application/language/spanish/contesting_lang.php b/application/language/spanish/contesting_lang.php index a32797b0..e84b3ef0 100644 --- a/application/language/spanish/contesting_lang.php +++ b/application/language/spanish/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = 'Indicativos sugeridos'; $lang['contesting_title_contest_logbook'] = 'Libro de guardia del concurso'; $lang['contesting_copy_exch_to_dok'] = '¡Copiar intercambio recibido al campo DOK de la base de datos!'; +$lang['contesting_copy_exch_to_none'] = '¡Copiar intercambio recibido al campo no additional de la base de datos!'; +$lang['contesting_copy_exch_to_power'] = '¡Copiar intercambio recibido al campo RX-Power de la base de datos!'; +$lang['contesting_copy_exch_to_state'] = '¡Copiar intercambio recibido al campo US-State de la base de datos!'; +$lang['contesting_copy_exch_to_age'] = '¡Copiar intercambio recibido al campo Age de la base de datos!'; +$lang['contesting_copy_exch_to_name'] = '¡Copiar intercambio recibido al campo Name de la base de datos!'; +$lang['contesting_copy_exch_to_locator'] = '¡Copiar intercambio recibido al campo Locator de la base de datos!'; diff --git a/application/language/swedish/contesting_lang.php b/application/language/swedish/contesting_lang.php index 624c1542..7491a84d 100644 --- a/application/language/swedish/contesting_lang.php +++ b/application/language/swedish/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = 'Signal-förslag'; $lang['contesting_title_contest_logbook'] = 'Contest loggbok'; $lang['contesting_copy_exch_to_dok'] = 'Copy received exchange to DOK field in the database!'; +$lang['contesting_copy_exch_to_none'] = 'Copy received exchange to no additional field in the database!'; +$lang['contesting_copy_exch_to_power'] = 'Copy received exchange to RX-Power field in the database!'; +$lang['contesting_copy_exch_to_state'] = 'Copy received exchange to US-State field in the database!'; +$lang['contesting_copy_exch_to_age'] = 'Copy received exchange to Age field in the database!'; +$lang['contesting_copy_exch_to_name'] = 'Copy received exchange to Name field in the database!'; +$lang['contesting_copy_exch_to_locator'] = 'Copy received exchange to Locator field in the database!'; diff --git a/application/language/turkish/contesting_lang.php b/application/language/turkish/contesting_lang.php index 4cec6522..aab3bd34 100644 --- a/application/language/turkish/contesting_lang.php +++ b/application/language/turkish/contesting_lang.php @@ -28,5 +28,11 @@ $lang['contesting_title_callsign_suggestions'] = 'Çağrı Kodu Önerileri'; $lang['contesting_title_contest_logbook'] = 'Yarışma kayıt defteri'; $lang['contesting_copy_exch_to_dok'] = 'Copy received exchange to DOK field in the database!'; +$lang['contesting_copy_exch_to_none'] = 'Copy received exchange to no additional field in the database!'; +$lang['contesting_copy_exch_to_power'] = 'Copy received exchange to RX-Power field in the database!'; +$lang['contesting_copy_exch_to_state'] = 'Copy received exchange to US-State field in the database!'; +$lang['contesting_copy_exch_to_age'] = 'Copy received exchange to Age field in the database!'; +$lang['contesting_copy_exch_to_name'] = 'Copy received exchange to Name field in the database!'; +$lang['contesting_copy_exch_to_locator'] = 'Copy received exchange to Locator field in the database!'; diff --git a/application/models/Contesting_model.php b/application/models/Contesting_model.php index 377edba5..1876ddad 100644 --- a/application/models/Contesting_model.php +++ b/application/models/Contesting_model.php @@ -65,6 +65,7 @@ class Contesting_model extends CI_Model { $sql = "SELECT * from contest_session where station_id = " . $station_id; $data = $this->db->query($sql); + return $data->row(); } @@ -102,6 +103,10 @@ class Contesting_model extends CI_Model { 'station_id' => $station_id, ); + if ($this->input->post('copyexchangeto')) { + $data['copytodok'] = xss_clean($this->input->post('copyexchangeto')); + } + $sql = "SELECT * from contest_session where station_id = " . $station_id; $querydata = $this->db->query($sql); diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index a9c77bb0..02d8fbc2 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -157,6 +157,44 @@ class Logbook_model extends CI_Model $darc_dok = $this->input->post('darc_dok'); } + //$darc_dok = $this->input->post('darc_dok'); + $qso_locator = strtoupper(trim(xss_clean($this->input->post('locator')) ?? '')); + $qso_name = $this->input->post('name'); + $qso_age = null; + $qso_usa_state = $this->input->post('usa_state') == null ? '' : $this->input->post('usa_state'); + $qso_rx_power = null; + + if ($this->input->post('copyexchangeto')) { + switch($this->input->post('copyexchangeto')) { + case 'dok': + $darc_dok = $srx_string; + break; + case 'locator': + $qso_locator = strtoupper(trim(xss_clean($srx_string))); + break; + case 'name': + $qso_name = $srx_string; + break; + case 'age': + $qso_age = $srx_string; + break; + case 'state': + $qso_usa_state = $srx_string; + break; + case 'power': + $qso_rx_power = $srx_string; + break; + // Example for more sophisticated exchanges and their split into the db: + //case 'name/power': + // if (strlen($srx_string) == 0) break; + // $exch_pt = explode(" ",$srx_string); + // $qso_name = $exch_pt[0]; + // if (count($exch_pt)>1) $qso_power = $exch_pt[1]; + // break; + default: + } + } + if ($this->input->post('qsl_sent')) { $qsl_sent = $this->input->post('qsl_sent'); } else { @@ -193,7 +231,7 @@ class Logbook_model extends CI_Model 'COL_SUBMODE' => $submode, 'COL_RST_RCVD' => $this->input->post('rst_rcvd'), 'COL_RST_SENT' => $this->input->post('rst_sent'), - 'COL_NAME' => $this->input->post('name'), + 'COL_NAME' => $qso_name, 'COL_COMMENT' => $this->input->post('comment'), 'COL_SAT_NAME' => $this->input->post('sat_name') == null ? '' : strtoupper($this->input->post('sat_name')), 'COL_SAT_MODE' => $this->input->post('sat_mode') == null ? '' : strtoupper($this->input->post('sat_mode')), @@ -216,7 +254,7 @@ class Logbook_model extends CI_Model 'COL_ANT_AZ' => null, 'COL_ANT_EL' => null, 'COL_A_INDEX' => null, - 'COL_AGE' => null, + 'COL_AGE' => $qso_age, 'COL_TEN_TEN' => null, 'COL_TX_PWR' => $tx_power, 'COL_STX' => $stx, @@ -229,12 +267,12 @@ class Logbook_model extends CI_Model 'COL_MAX_BURSTS' => null, 'COL_K_INDEX' => null, 'COL_SFI' => null, - 'COL_RX_PWR' => null, + 'COL_RX_PWR' => $qso_rx_power, 'COL_LAT' => null, 'COL_LON' => null, 'COL_DXCC' => $dxcc_id, 'COL_CQZ' => $cqz, - 'COL_STATE' => $this->input->post('usa_state') == null ? '' : trim($this->input->post('usa_state')), + 'COL_STATE' => $qso_usa_state, 'COL_CNTY' => $clean_county_input, 'COL_SOTA_REF' => $this->input->post('sota_ref') == null ? '' : trim($this->input->post('sota_ref')), 'COL_WWFF_REF' => $this->input->post('wwff_ref') == null ? '' : trim($this->input->post('wwff_ref')), @@ -302,10 +340,10 @@ class Logbook_model extends CI_Model } // Decide whether its single gridsquare or a multi which makes it vucc_grids - if (strpos(trim(xss_clean($this->input->post('locator')) ?? ''), ',') !== false) { - $data['COL_VUCC_GRIDS'] = strtoupper(preg_replace('/\s+/', '', xss_clean($this->input->post('locator')) ?? '')); + if (strpos($qso_locator, ',') !== false) { + $data['COL_VUCC_GRIDS'] = strtoupper(preg_replace('/\s+/', '', $qso_locator)); } else { - $data['COL_GRIDSQUARE'] = strtoupper(trim(xss_clean($this->input->post('locator')) ?? '')); + $data['COL_GRIDSQUARE'] = $qso_locator; } // if eQSL username set, default SENT & RCVD to 'N' else leave as null diff --git a/application/views/contesting/index.php b/application/views/contesting/index.php index c85e9066..849549f2 100644 --- a/application/views/contesting/index.php +++ b/application/views/contesting/index.php @@ -164,8 +164,15 @@
- - +
diff --git a/assets/js/sections/contesting.js b/assets/js/sections/contesting.js index 1ce2b5eb..b0131157 100644 --- a/assets/js/sections/contesting.js +++ b/assets/js/sections/contesting.js @@ -27,7 +27,7 @@ function reset_contest_session() { setExchangetype("None"); $("#contestname").val("Other").change(); $(".contest_qso_table_contents").empty(); - $('#copyexchangetodok').prop('checked', false); + $('#copyexchangeto').val("None"); $.ajax({ url: base_url + 'index.php/contesting/deleteSession', @@ -39,7 +39,7 @@ function reset_contest_session() { } // Storing the contestid in contest session -$('#contestname').change(function () { +$('#contestname, #copyexchangeto').change(function () { var formdata = new FormData(document.getElementById("qso_input")); setSession(formdata); }); @@ -53,6 +53,7 @@ $('#exchangetype').change(function () { }); function setSession(formdata) { + formdata.set('copyexchangeto',$("#copyexchangeto option:selected").index()); $.ajax({ url: base_url + 'index.php/contesting/setSession', type: 'post', @@ -491,8 +492,8 @@ async function getSession() { async function restoreContestSession(data) { if (data) { - if (data.copytodok == "1") { - $('#copyexchangetodok').prop('checked', true); + if (data.copytodok != "") { + $('#copyexchangeto option')[data.copytodok].selected = true; } if (data.contestid != "") {