From ee8b84441a0cec38796c1d91b0a4ed332d7dd6f3 Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 19 Sep 2022 08:58:21 +0200 Subject: [PATCH] Add "-(/" as separators to ucwords to display DXCCs (more) correctly --- application/models/Logbook_model.php | 10 +++++----- application/views/view_log/qso.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 39575ed8..83a15304 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -49,7 +49,7 @@ class Logbook_model extends CI_Model { if($this->input->post('country') == "") { $dxcc = $this->check_dxcc_table(strtoupper(trim($this->input->post('callsign'))), $datetime); - $country = ucwords(strtolower($dxcc[1])); + $country = ucwords(strtolower($dxcc[1]), "- (/"); } else { $country = $this->input->post('country'); } @@ -559,7 +559,7 @@ class Logbook_model extends CI_Model { $entity = $this->get_entity($this->input->post('dxcc_id')); $stationId = $this->input->post('station_profile'); - $country = ucwords(strtolower($entity['name'])); + $country = ucwords(strtolower($entity['name']), "- (/"); // be sure that station belongs to user $CI =& get_instance(); @@ -2234,7 +2234,7 @@ class Logbook_model extends CI_Model { // Store or find country name // dxcc has higher priority to be consistent with qso create and edit if (isset($dxcc[1])) { - $country = ucwords(strtolower($dxcc[1])); + $country = ucwords(strtolower($dxcc[1]), "- (/"); } else if (isset($record['country'])) { $country = $record['country']; } @@ -2891,10 +2891,10 @@ class Logbook_model extends CI_Model { if ($d[0] != 'Not Found'){ $sql = sprintf("update %s set COL_COUNTRY = '%s', COL_DXCC='%s' where COL_PRIMARY_KEY=%d", - $this->config->item('table_name'), addslashes(ucwords(strtolower($d[1]))), $d[0], $row['COL_PRIMARY_KEY']); + $this->config->item('table_name'), addslashes(ucwords(strtolower($d[1]), "- (/")), $d[0], $row['COL_PRIMARY_KEY']); $this->db->query($sql); //print($sql."\n"); - printf("Updating %s to %s and %s\n
", $row['COL_PRIMARY_KEY'], ucwords(strtolower($d[1])), $d[0]); + printf("Updating %s to %s and %s\n
", $row['COL_PRIMARY_KEY'], ucwords(strtolower($d[1]), "- (/"), $d[0]); $count++; } } diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index 3d32a119..44a4e92c 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -184,7 +184,7 @@ COL_COUNTRY != null) { ?> lang->line('general_word_country'); ?> - COL_COUNTRY))); ?> + COL_COUNTRY)), "- (/"); ?> @@ -349,7 +349,7 @@ station_country) { ?> Station Country - station_country))); ?> + station_country)), "- (/"); ?>