From 587a39ab837fb145663a710f00fbb092a7dc0f53 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 26 Apr 2023 22:39:09 +0200 Subject: [PATCH] Show badge and hints about deleted DXCCs --- application/language/english/general_words_lang.php | 1 + application/language/german/general_words_lang.php | 1 + application/language/swedish/general_words_lang.php | 1 + application/models/Logbook_model.php | 2 ++ application/models/LotwCert.php | 2 +- application/models/Stations.php | 4 ++-- application/views/dashboard/index.php | 2 +- application/views/dxatlas/index.php | 2 +- application/views/kml/index.php | 2 +- application/views/logbooks/edit.php | 2 +- application/views/lookup/index.php | 2 +- application/views/lotw_views/index.php | 2 +- application/views/qso/edit_ajax.php | 6 +++++- application/views/qso/index.php | 6 +++++- application/views/station_profile/create.php | 3 ++- application/views/station_profile/edit.php | 3 ++- application/views/station_profile/index.php | 2 +- application/views/timeplotter/index.php | 6 +++--- application/views/view_log/partial/log_ajax.php | 2 +- application/views/view_log/qso.php | 6 +++--- 20 files changed, 36 insertions(+), 21 deletions(-) diff --git a/application/language/english/general_words_lang.php b/application/language/english/general_words_lang.php index 92aad195..1d716961 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_deleted_dxcc'] = 'deleted DXCC'; $lang['gen_hamradio_continent'] = 'Continent'; $lang['gen_hamradio_usa_state'] = 'USA State'; $lang['gen_hamradio_county_reference'] = 'USA County'; diff --git a/application/language/german/general_words_lang.php b/application/language/german/general_words_lang.php index 98e1138f..98168fa9 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_deleted_dxcc'] = 'gelöschtes DXCC'; $lang['gen_hamradio_continent'] = 'Kontinent'; $lang['gen_hamradio_usa_state'] = 'USA-Staat'; $lang['gen_hamradio_county_reference'] = 'USA County'; diff --git a/application/language/swedish/general_words_lang.php b/application/language/swedish/general_words_lang.php index e8e76ce4..252532f6 100644 --- a/application/language/swedish/general_words_lang.php +++ b/application/language/swedish/general_words_lang.php @@ -94,6 +94,7 @@ $lang['gen_hamradio_logbook'] = 'Loggbok'; $lang['gen_hamradio_cq_zone'] = 'CQ Zone'; $lang['gen_hamradio_dxcc'] = 'DXCC'; +$lang['gen_hamradio_deleted_dxcc'] = 'struket DXCC'; $lang['gen_hamradio_usa_state'] = 'USA State'; $lang['gen_hamradio_county_reference'] = 'USA County'; $lang['gen_hamradio_iota_reference'] = 'IOTA Reference'; diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index aef9ca61..f8c8c02d 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1275,9 +1275,11 @@ class Logbook_model extends CI_Model { return array(); } + $this->db->select($this->config->item('table_name').'.*, station_profile.*, dxcc_entities.*'); $this->db->from($this->config->item('table_name')); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); + $this->db->join('dxcc_entities', $this->config->item('table_name').'.col_dxcc = dxcc_entities.adif', 'left'); $this->db->where_in('station_profile.station_id', $logbooks_locations_array); $this->db->order_by(''.$this->config->item('table_name').'.COL_TIME_ON', "desc"); $this->db->order_by(''.$this->config->item('table_name').'.COL_PRIMARY_KEY', "desc"); diff --git a/application/models/LotwCert.php b/application/models/LotwCert.php index 2fbd8f5f..228ea6d1 100644 --- a/application/models/LotwCert.php +++ b/application/models/LotwCert.php @@ -12,7 +12,7 @@ class LotwCert extends CI_Model { */ function lotw_certs($user_id) { - $this->db->select('lotw_certs.lotw_cert_id as lotw_cert_id, lotw_certs.callsign as callsign, dxcc_entities.name as cert_dxcc, lotw_certs.qso_start_date as qso_start_date, lotw_certs.qso_end_date as qso_end_date, lotw_certs.date_created as date_created, lotw_certs.date_expires as date_expires, lotw_certs.last_upload as last_upload'); + $this->db->select('lotw_certs.lotw_cert_id as lotw_cert_id, lotw_certs.callsign as callsign, dxcc_entities.name as cert_dxcc, dxcc_entities.end as cert_dxcc_end, lotw_certs.qso_start_date as qso_start_date, lotw_certs.qso_end_date as qso_end_date, lotw_certs.date_created as date_created, lotw_certs.date_expires as date_expires, lotw_certs.last_upload as last_upload'); $this->db->where('user_id', $user_id); $this->db->join('dxcc_entities','lotw_certs.cert_dxcc_id = dxcc_entities.adif','left'); $this->db->order_by('cert_dxcc', 'ASC'); diff --git a/application/models/Stations.php b/application/models/Stations.php index 7eb47cfe..7ec18842 100644 --- a/application/models/Stations.php +++ b/application/models/Stations.php @@ -4,7 +4,7 @@ class Stations extends CI_Model { function all_with_count() { - $this->db->select('station_profile.*, dxcc_entities.name as station_country, count('.$this->config->item('table_name').'.station_id) as qso_total'); + $this->db->select('station_profile.*, dxcc_entities.name as station_country, dxcc_entities.end as dxcc_end, count('.$this->config->item('table_name').'.station_id) as qso_total'); $this->db->from('station_profile'); $this->db->join($this->config->item('table_name'),'station_profile.station_id = '.$this->config->item('table_name').'.station_id','left'); $this->db->join('dxcc_entities','station_profile.station_dxcc = dxcc_entities.adif','left'); @@ -24,7 +24,7 @@ class Stations extends CI_Model { } function all_of_user() { - $this->db->select('station_profile.*, dxcc_entities.name as station_country'); + $this->db->select('station_profile.*, dxcc_entities.name as station_country, dxcc_entities.end as dxcc_end'); $this->db->where('user_id', $this->session->userdata('user_id')); $this->db->join('dxcc_entities','station_profile.station_dxcc = dxcc_entities.adif','left'); return $this->db->get('station_profile'); diff --git a/application/views/dashboard/index.php b/application/views/dashboard/index.php index f4426314..12bf9a4a 100644 --- a/application/views/dashboard/index.php +++ b/application/views/dashboard/index.php @@ -23,7 +23,7 @@ function echo_table_col($row, $name) { case 'Mode': echo ''; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE . ''; break; case 'RSTS': echo '' . $row->COL_RST_SENT; if ($row->COL_STX) { echo 'COL_CONTEST_ID:"n/a").'" class="badge badge-light">'; printf("%03d", $row->COL_STX); echo '';} if ($row->COL_STX_STRING) { echo 'COL_CONTEST_ID:"n/a").'" class="badge badge-light">' . $row->COL_STX_STRING . '';} echo ''; break; case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo 'COL_CONTEST_ID:"n/a").'" class="badge badge-light">'; printf("%03d", $row->COL_SRX); echo '';} if ($row->COL_SRX_STRING) { echo 'COL_CONTEST_ID:"n/a").'" class="badge badge-light">' . $row->COL_SRX_STRING . '';} echo ''; break; - case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY))) . ''; break; + case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY))); if ($row->end != NULL) echo ' '.$ci->lang->line('gen_hamradio_deleted_dxcc').'' . ''; break; case 'IOTA': echo '' . ($row->COL_IOTA) . ''; break; case 'SOTA': echo '' . ($row->COL_SOTA_REF) . ''; break; case 'WWFF': echo '' . ($row->COL_WWFF_REF) . ''; break; diff --git a/application/views/dxatlas/index.php b/application/views/dxatlas/index.php index 90935408..5038f9c2 100644 --- a/application/views/dxatlas/index.php +++ b/application/views/dxatlas/index.php @@ -62,7 +62,7 @@ foreach($dxcc as $d){ echo ''; } diff --git a/application/views/kml/index.php b/application/views/kml/index.php index 512d55c4..82b04e92 100644 --- a/application/views/kml/index.php +++ b/application/views/kml/index.php @@ -35,7 +35,7 @@ foreach($dxcc as $d){ echo ''; } diff --git a/application/views/logbooks/edit.php b/application/views/logbooks/edit.php index 97ea7999..1380b800 100644 --- a/application/views/logbooks/edit.php +++ b/application/views/logbooks/edit.php @@ -95,7 +95,7 @@ diff --git a/application/views/lookup/index.php b/application/views/lookup/index.php index fc839476..e09e8d15 100644 --- a/application/views/lookup/index.php +++ b/application/views/lookup/index.php @@ -16,7 +16,7 @@ foreach($dxcc as $d){ echo ''; } diff --git a/application/views/lotw_views/index.php b/application/views/lotw_views/index.php index 9bed8842..093fc766 100644 --- a/application/views/lotw_views/index.php +++ b/application/views/lotw_views/index.php @@ -44,7 +44,7 @@ result() as $row) { ?> callsign; ?> - cert_dxcc == '' ? '- NONE -' : ucfirst($row->cert_dxcc); ?> + cert_dxcc == '' ? '- NONE -' : ucfirst($row->cert_dxcc); if ($row->cert_dxcc_end != NULL) { echo ' '.$this->lang->line('gen_hamradio_deleted_dxcc').''; } ?> qso_start_date)) { $valid_qso_start = strtotime( $row->qso_start_date ); diff --git a/application/views/qso/edit_ajax.php b/application/views/qso/edit_ajax.php index a72584f2..ab82ebde 100644 --- a/application/views/qso/edit_ajax.php +++ b/application/views/qso/edit_ajax.php @@ -227,7 +227,11 @@ if ($qso->COL_DXCC == $d->adif) { echo " selected=\"selected\""; } - echo '>' . $d->prefix . ' - ' . $d->name . ''; + echo '>' . $d->prefix . ' - ' . ucwords(strtolower(($d->name))); + if ($d->Enddate != null) { + echo ' ('.$this->lang->line('gen_hamradio_deleted_dxcc').')'; + } + echo ''; } ?> diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 65132bd9..291ea49d 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -216,7 +216,11 @@ adif . '>' . $d->prefix . ' - ' . ucwords(strtolower(($d->name))) . ''; + echo ''; } ?> diff --git a/application/views/station_profile/create.php b/application/views/station_profile/create.php index cf1a9982..ad2fe1ff 100644 --- a/application/views/station_profile/create.php +++ b/application/views/station_profile/create.php @@ -46,7 +46,8 @@ diff --git a/application/views/station_profile/edit.php b/application/views/station_profile/edit.php index 0eae08c1..fa2468c2 100644 --- a/application/views/station_profile/edit.php +++ b/application/views/station_profile/edit.php @@ -65,7 +65,8 @@ diff --git a/application/views/station_profile/index.php b/application/views/station_profile/index.php index c16427e0..fcf7f3b6 100644 --- a/application/views/station_profile/index.php +++ b/application/views/station_profile/index.php @@ -59,7 +59,7 @@ station_profile_name;?>
station_callsign;?> - station_country == '' ? '- NONE -' : $row->station_country;?> + station_country == '' ? '- NONE -' : $row->station_country; if ($row->dxcc_end != NULL) { echo ' '.$this->lang->line('gen_hamradio_deleted_dxcc').''; } ?> station_gridsquare;?> station_active != 1) { ?> diff --git a/application/views/timeplotter/index.php b/application/views/timeplotter/index.php index 7fb28766..6e9cf2c1 100644 --- a/application/views/timeplotter/index.php +++ b/application/views/timeplotter/index.php @@ -21,9 +21,9 @@ num_rows() > 0) { foreach ($dxcc_list->result() as $dxcc) { - echo ''; } @@ -57,4 +57,4 @@
- \ No newline at end of file + diff --git a/application/views/view_log/partial/log_ajax.php b/application/views/view_log/partial/log_ajax.php index 9d5af8e0..e8807782 100644 --- a/application/views/view_log/partial/log_ajax.php +++ b/application/views/view_log/partial/log_ajax.php @@ -23,7 +23,7 @@ function echo_table_col($row, $name) { case 'Mode': echo ''; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE . ''; break; case 'RSTS': echo '' . $row->COL_RST_SENT; if ($row->COL_STX) { echo 'COL_CONTEST_ID:"n/a").'" class="badge badge-light">'; printf("%03d", $row->COL_STX); echo '';} if ($row->COL_STX_STRING) { echo 'COL_CONTEST_ID:"n/a").'" class="badge badge-light">' . $row->COL_STX_STRING . '';} echo ''; break; case 'RSTR': echo '' . $row->COL_RST_RCVD; if ($row->COL_SRX) { echo 'COL_CONTEST_ID:"n/a").'" class="badge badge-light">'; printf("%03d", $row->COL_SRX); echo '';} if ($row->COL_SRX_STRING) { echo 'COL_CONTEST_ID:"n/a").'" class="badge badge-light">' . $row->COL_SRX_STRING . '';} echo ''; break; - case 'Country': echo '' . ucwords(strtolower(($row->COL_COUNTRY))) . ''; break; + case 'Country': echo '' . ucwords(strtolower(($row->name))); if ($row->end != null) echo ' '.$ci->lang->line('gen_hamradio_deleted_dxcc').'' . ''; break; case 'IOTA': echo '' . ($row->COL_IOTA) . ''; break; case 'SOTA': echo '' . ($row->COL_SOTA_REF) . ''; break; case 'WWFF': echo '' . ($row->COL_WWFF_REF) . ''; break; diff --git a/application/views/view_log/qso.php b/application/views/view_log/qso.php index a837941d..13105df2 100644 --- a/application/views/view_log/qso.php +++ b/application/views/view_log/qso.php @@ -187,10 +187,10 @@ COL_SAT_MODE; ?> - COL_COUNTRY != null) { ?> + name != null) { ?> lang->line('general_word_country'); ?> - COL_COUNTRY)), "- (/"); ?> + name)), "- (/"); if ($row->end != null) { echo ' '.$this->lang->line('gen_hamradio_deleted_dxcc').''; } ?> @@ -411,7 +411,7 @@ station_country) { ?> Station Country - station_country)), "- (/"); ?> + station_country)), "- (/"); if ($row->end != null) echo ' '.$this->lang->line('gen_hamradio_deleted_dxcc').''; ?>