diff --git a/application/controllers/Update.php b/application/controllers/Update.php index 243ff104..d90b658d 100644 --- a/application/controllers/Update.php +++ b/application/controllers/Update.php @@ -238,6 +238,11 @@ class Update extends CI_Controller { } + public function check_missing_continent() { + $this->load->model('logbook_model'); + $this->logbook_model->check_missing_continent(); + } + public function check_missing_grid($all = false){ $this->load->model('logbook_model'); $this->logbook_model->check_missing_grid_id($all); diff --git a/application/language/english/general_words_lang.php b/application/language/english/general_words_lang.php index e5dc1512..92aad195 100644 --- a/application/language/english/general_words_lang.php +++ b/application/language/english/general_words_lang.php @@ -94,6 +94,7 @@ $lang['gen_hamradio_logbook'] = 'Logbook'; $lang['gen_hamradio_cq_zone'] = 'CQ Zone'; $lang['gen_hamradio_dxcc'] = 'DXCC'; +$lang['gen_hamradio_continent'] = 'Continent'; $lang['gen_hamradio_usa_state'] = 'USA State'; $lang['gen_hamradio_county_reference'] = 'USA County'; $lang['gen_hamradio_iota_reference'] = 'IOTA Reference'; @@ -125,3 +126,11 @@ $lang['gen_this_qso_was_confirmed_on'] = 'This QSO was confirmed on'; $lang['error_no_logbook_found'] = 'No logbooks were found. You need to define a logbook under Station Logbooks! Do it here:'; $lang['copy_to_clipboard'] = 'Copy to clipboard'; + +$lang['africa'] = 'Africa'; +$lang['antarctica'] = 'Antarctica'; +$lang['asia'] = 'Asia'; +$lang['europe'] = 'Europe'; +$lang['northamerica'] = 'North America'; +$lang['oceania'] = 'Oceania'; +$lang['southamerica'] = 'South America'; diff --git a/application/language/german/general_words_lang.php b/application/language/german/general_words_lang.php index caf948f7..98e1138f 100644 --- a/application/language/german/general_words_lang.php +++ b/application/language/german/general_words_lang.php @@ -94,6 +94,7 @@ $lang['gen_hamradio_logbook'] = 'Logbuch'; $lang['gen_hamradio_cq_zone'] = 'CQ Zone'; $lang['gen_hamradio_dxcc'] = 'DXCC'; +$lang['gen_hamradio_continent'] = 'Kontinent'; $lang['gen_hamradio_usa_state'] = 'USA-Staat'; $lang['gen_hamradio_county_reference'] = 'USA County'; $lang['gen_hamradio_iota_reference'] = 'IOTA Referenznummer'; @@ -124,3 +125,11 @@ $lang['gen_from_date'] = 'Ab Datum'; $lang['gen_this_qso_was_confirmed_on'] = 'Dieses QSO wurde bestätigt am'; $lang['copy_to_clipboard'] = 'In die Zwischenablage kopieren'; + +$lang['africa'] = 'Afrika'; +$lang['antarctica'] = 'Antarktis'; +$lang['asia'] = 'Asien'; +$lang['europe'] = 'Europa'; +$lang['northamerica'] = 'Nord-Amerika'; +$lang['oceania'] = 'Ozeanien'; +$lang['southamerica'] = 'Süd-Amerika'; diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index c0fe2b02..01aa8b2a 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -78,6 +78,19 @@ class Logbook_model extends CI_Model { $dxcc_id = $this->input->post('dxcc_id'); } + if($this->input->post('continent') == "") { + + $dxcc = $this->check_dxcc_table(strtoupper(trim($this->input->post('callsign'))), $datetime); + if (empty($dxcc[3])) { + $continent = null; + } else { + $continent = $dxcc[3]; + } + + } else { + $continent = $this->input->post('continent'); + } + $mode = $this->get_main_mode_if_submode($this->input->post('mode')); if ($mode == null) { $mode = $this->input->post('mode'); @@ -139,6 +152,7 @@ class Logbook_model extends CI_Model { 'COL_SAT_NAME' => strtoupper($this->input->post('sat_name')), 'COL_SAT_MODE' => strtoupper($this->input->post('sat_mode')), 'COL_COUNTRY' => $country, + 'COL_CONT' => $continent, 'COL_QSLSDATE' => $qslsdate, 'COL_QSLRDATE' => $qslrdate, 'COL_QSL_SENT' => $qsl_sent, @@ -785,6 +799,7 @@ class Logbook_model extends CI_Model { 'COL_COMMENT' => $this->input->post('comment'), 'COL_NAME' => $this->input->post('name'), 'COL_COUNTRY' => $country, + 'COL_CONT' => $this->input->post('continent'), 'COL_DXCC'=> $this->input->post('dxcc_id'), 'COL_CQZ' => $this->input->post('cqz'), 'COL_SAT_NAME' => $this->input->post('sat_name'), @@ -2960,6 +2975,7 @@ class Logbook_model extends CI_Model { $row['adif'] = 0; $row['entity'] = 'None'; $row['cqz'] = 0; + $row['cont'] = ''; return array($row['adif'], $row['entity'], $row['cqz']); } else { $call = $result . "AA"; @@ -3288,6 +3304,16 @@ class Logbook_model extends CI_Model { print("$count updated\n"); } + public function check_missing_continent(){ + // get all records with no COL_CONT + $this->db->trans_start(); + $sql = "UPDATE ".$this->config->item('table_name')." JOIN dxcc_entities ON ".$this->config->item('table_name').".col_dxcc = dxcc_entities.adif SET col_cont = dxcc_entities.cont WHERE COALESCE(".$this->config->item('table_name').".col_cont, '') = ''"; + + $query = $this->db->query($sql); + print($this->db->affected_rows()." updated\n"); + $this->db->trans_complete(); + } + public function check_missing_grid_id($all){ // get all records with no COL_GRIDSQUARE $this->db->select("COL_PRIMARY_KEY, COL_CALL, COL_TIME_ON, COL_TIME_OFF"); diff --git a/application/views/qso/edit_ajax.php b/application/views/qso/edit_ajax.php index 00e7cf76..a72584f2 100644 --- a/application/views/qso/edit_ajax.php +++ b/application/views/qso/edit_ajax.php @@ -215,6 +215,8 @@ + +
+
+ + +
diff --git a/application/views/qso/index.php b/application/views/qso/index.php index f86aab8c..65132bd9 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -222,6 +222,19 @@ +
+ + +