diff --git a/application/controllers/Logbookadvanced.php b/application/controllers/Logbookadvanced.php
index e2a297964..3a581ccab 100644
--- a/application/controllers/Logbookadvanced.php
+++ b/application/controllers/Logbookadvanced.php
@@ -801,4 +801,10 @@ class Logbookadvanced extends CI_Controller {
header("Content-Type: application/json");
print json_encode($q);
}
+
+ public function fixContinent() {
+ $this->load->model('logbookadvanced_model');
+ $result = $this->logbookadvanced_model->check_missing_continent();
+ return $result;
+ }
}
diff --git a/application/controllers/Update.php b/application/controllers/Update.php
index f1a24d501..24b80c296 100644
--- a/application/controllers/Update.php
+++ b/application/controllers/Update.php
@@ -338,17 +338,6 @@ class Update extends CI_Controller {
$this->logbook_model->check_missing_dxcc_id($all);
}
- public function check_missing_continent() {
- $this->load->model('user_model');
- if (!$this->user_model->authorize(99)) {
- $this->session->set_flashdata('error', __("You're not allowed to do that!"));
- redirect('dashboard');
- }
-
- $this->load->model('logbook_model');
- $this->logbook_model->check_missing_continent();
- }
-
public function check_missing_grid($all = false){
$this->load->model('user_model');
if (!$this->user_model->authorize(99)) {
diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php
index bfc2d53dc..d8e925ee3 100644
--- a/application/models/Logbook_model.php
+++ b/application/models/Logbook_model.php
@@ -5619,16 +5619,6 @@ 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/models/Logbookadvanced_model.php b/application/models/Logbookadvanced_model.php
index d19399d1f..26af202ed 100644
--- a/application/models/Logbookadvanced_model.php
+++ b/application/models/Logbookadvanced_model.php
@@ -1240,4 +1240,20 @@ class Logbookadvanced_model extends CI_Model {
$query = $this->db->query($sql, array(json_decode($ids, true), $this->session->userdata('user_id')));
}
+
+ 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
+ JOIN station_profile on " . $this->config->item('table_name') . ".station_id = station_profile.station_id
+ SET col_cont = dxcc_entities.cont
+ WHERE COALESCE(" . $this->config->item('table_name') . ".col_cont, '') = '' and station_profile.user_id = ?";
+
+ $query = $this->db->query($sql, array($this->session->userdata('user_id')));
+ $result = $this->db->affected_rows();
+ $this->db->trans_complete();
+
+ return $result;
+ }
}
diff --git a/application/views/logbookadvanced/index.php b/application/views/logbookadvanced/index.php
index 49c21ed42..577b3688e 100644
--- a/application/views/logbookadvanced/index.php
+++ b/application/views/logbookadvanced/index.php
@@ -31,6 +31,8 @@
let lang_gen_advanced_logbook_select_only_one_row_quickfilter = '= __("Only 1 row can be selected for Quickfilter!"); ?>';
let lang_gen_advanced_logbook_select_at_least_one_row_quickfilter = '= __("You need to select a row to use the Quickfilters!"); ?>';
let lang_gen_advanced_logbook_select_at_least_one_row_qslcard = '= __("You need to select a least 1 row to display a QSL card!"); ?>';
+ let lang_gen_advanced_logbook_continents_updated = '= __("Continents updated successfully!"); ?>';
+ let lang_gen_advanced_logbook_problem_fixing_continents = '= __("There was a problem fixing Continents."); ?>';
let lang_gen_advanced_logbook_error = '= __("ERROR"); ?>';
let lang_gen_advanced_logbook_success = '= __("SUCCESS"); ?>';
let lang_gen_advanced_logbook_info = '= __("INFO"); ?>';
@@ -38,6 +40,7 @@
let lang_gen_advanced_logbook_qsl_card = '= __("QSL Card"); ?>';
let lang_gen_advanced_logbook_close = '= __("Close"); ?>';
let lang_gen_advanced_logbook_save = '= __("Save"); ?>';
+ let lang_gen_advanced_logbook_update_now = '= __("Update now"); ?>';
let lang_gen_advanced_logbook_options = '= __("'Options for the Advanced Logbook'"); ?>';
let lang_gen_advanced_logbook_label_print_error = '= __("Something went wrong with label print. Go to labels and check if you have defined a label, and that it is set for print!"); ?>';
let lang_gen_advanced_logbook_select_at_least_one_row = '= __("You need to select a least 1 row!"); ?>';
diff --git a/application/views/update/index.php b/application/views/update/index.php
index c726b3c36..76befdc69 100644
--- a/application/views/update/index.php
+++ b/application/views/update/index.php
@@ -34,39 +34,24 @@
and update existing metadata as well, in case it has changed."); ?>
= __("WARNING"); ?>: = __("This affects ALL QSOs of ANY user on this instance. The function is deprectated and will be removed in a future version of Wavelog. As replacement use the Logbook-Advanced!"); ?>
- = __("This function can be used to update QSO continent information for all QSOs in Wavelog missing that information."); ?>
-
= __("WARNING"); ?>: = __("This affects ALL QSOs of ANY user on this instance. The function is deprectated and will be removed in a future version of Wavelog. As replacement use the Logbook-Advanced!"); ?>
-