Merge pull request #1608 from phl0/addSeparatorsToUcwords

Add "-(/" as separators to ucwords to display DXCCs (more) correctly
pull/1609/head
Andreas Kristiansen 2022-09-19 19:07:25 +02:00 zatwierdzone przez GitHub
commit 66a54078e6
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -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();
@ -2235,7 +2235,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'];
}
@ -2892,10 +2892,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<br/>", $row['COL_PRIMARY_KEY'], ucwords(strtolower($d[1])), $d[0]);
printf("Updating %s to %s and %s\n<br/>", $row['COL_PRIMARY_KEY'], ucwords(strtolower($d[1]), "- (/"), $d[0]);
$count++;
}
}

Wyświetl plik

@ -184,7 +184,7 @@
<?php if($row->COL_COUNTRY != null) { ?>
<tr>
<td><?php echo $this->lang->line('general_word_country'); ?></td>
<td><?php echo ucwords(strtolower(($row->COL_COUNTRY))); ?></td>
<td><?php echo ucwords(strtolower(($row->COL_COUNTRY)), "- (/"); ?></td>
</tr>
<?php } ?>
@ -349,7 +349,7 @@
<?php if($row->station_country) { ?>
<tr>
<td>Station Country</td>
<td><?php echo ucwords(strtolower(($row->station_country))); ?></td>
<td><?php echo ucwords(strtolower(($row->station_country)), "- (/"); ?></td>
</tr>
<?php } ?>