From 601b03cd4c26ef24bc1aba45b548e9cb1b97faf9 Mon Sep 17 00:00:00 2001 From: Yuluoxk <59152137+Lingluoluo@users.noreply.github.com> Date: Tue, 10 Jan 2023 12:50:51 +0800 Subject: [PATCH 01/31] Update translation for Chinese simplified --- .../chinese_simplified/general_words_lang.php | 16 ++++++++++++++++ .../language/chinese_simplified/lotw_lang.php | 2 ++ .../language/chinese_simplified/qslcard_lang.php | 5 +++++ .../language/chinese_simplified/qso_lang.php | 4 ++++ 4 files changed, 27 insertions(+) diff --git a/application/language/chinese_simplified/general_words_lang.php b/application/language/chinese_simplified/general_words_lang.php index 33889c41..17343511 100644 --- a/application/language/chinese_simplified/general_words_lang.php +++ b/application/language/chinese_simplified/general_words_lang.php @@ -38,16 +38,24 @@ $lang['general_word_method'] = '方法'; $lang['general_word_sent'] = '已发送'; $lang['general_word_received'] = '已收到'; $lang['general_word_requested'] = '已请求'; +$lang['general_word_queued'] = '已排队'; +$lang['general_word_invalid_ignore'] = '无效(忽略)'; $lang['general_word_qslcard'] = 'QSL 卡片'; $lang['general_word_qslcard_management'] = 'QSL 管理'; $lang['general_word_qslcards'] = 'QSL 卡片'; $lang['general_word_qslcard_direct'] = '直邮'; $lang['general_word_qslcard_bureau'] = '卡片局'; +$lang['general_word_qslcard_electronic'] = '电子'; +$lang['general_word_qslcard_manager'] = '管理员'; $lang['general_word_qslcard_via'] = '通过'; +$lang['general_word_eqslcards'] = 'eQSL 卡片'; +$lang['general_word_lotw'] = 'Logbook of the World'; $lang['general_edit_qso'] = '编辑 QSO'; $lang['general_mark_qsl_rx_bureau'] = '标记 已收到的QSL (卡片局)'; $lang['general_mark_qsl_rx_direct'] = '标记 已收到的QSL (直邮)'; +$lang['general_mark_qsl_tx_bureau'] = '标记 已发送的QSL (卡片局)'; +$lang['general_mark_qsl_tx_direct'] = '标记 已发送的QSL (直邮)'; $lang['general_delete_qso'] = '删除 QSO'; @@ -91,11 +99,15 @@ $lang['gen_hamradio_county_reference'] = '县(美国)'; $lang['gen_hamradio_iota_reference'] = 'IOTA 参考'; $lang['gen_hamradio_sota_reference'] = 'SOTA 参考'; $lang['gen_hamradio_wwff_reference'] = 'WWFF 参考'; +$lang['gen_hamradio_pota_reference'] = 'POTA 参考'; $lang['gen_hamradio_dok'] = 'DOK'; $lang['gen_hamradio_state'] = '州'; $lang['gen_hamradio_iota'] = 'IOTA'; $lang['gen_hamradio_sota'] = 'SOTA'; +$lang['gen_hamradio_wwff'] = 'WWFF'; +$lang['gen_hamradio_pota'] = 'POTA'; $lang['gen_hamradio_gridsquare'] = '网格'; +$lang['gen_hamradio_operator'] = '操作员'; $lang['gen_hamradio_sig'] = 'Sig'; $lang['gen_hamradio_sig_info'] = 'Sig 属性'; @@ -109,3 +121,7 @@ $lang['dashboard_countries_breakdown'] = 'DXCC 实体分解'; $lang['gen_from_date'] = '起始日期'; $lang['gen_this_qso_was_confirmed_on'] = '该 QSO 确认于'; + +$lang['error_no_logbook_found'] = '没有找到日志本。 您需要在台站日志下添加一个日志本! 在这里添加:'; + +$lang['copy_to_clipboard'] = '复制到剪贴板'; diff --git a/application/language/chinese_simplified/lotw_lang.php b/application/language/chinese_simplified/lotw_lang.php index c6f2dc83..30153d06 100644 --- a/application/language/chinese_simplified/lotw_lang.php +++ b/application/language/chinese_simplified/lotw_lang.php @@ -16,6 +16,8 @@ $lang['lotw_no_certs_uploaded'] = '你需要上传 LoTW p12 证书以使用该 $lang['lotw_date_created'] = '创建日期'; $lang['lotw_date_expires'] = '过期日期'; +$lang['lotw_qso_start_date'] = 'QSO 起始日期'; +$lang['lotw_qso_end_date'] = 'QSO 结束日期'; $lang['lotw_status'] = '状态'; $lang['lotw_options'] = '选项'; $lang['lotw_valid'] = '有效'; diff --git a/application/language/chinese_simplified/qslcard_lang.php b/application/language/chinese_simplified/qslcard_lang.php index 9b3d26f6..6521b619 100644 --- a/application/language/chinese_simplified/qslcard_lang.php +++ b/application/language/chinese_simplified/qslcard_lang.php @@ -7,10 +7,15 @@ $lang['qslcard_string_your_are_using'] = '你已经用了'; $lang['qslcard_string_disk_space'] = '的磁盘空间保存 QSL 卡片资源'; $lang['qslcard_info'] = 'QSL 信息'; +$lang['qslcard_sent'] = 'QSL 卡片已经发出'; $lang['qslcard_sent_bureau'] = 'QSL 卡片已由卡片局发出'; $lang['qslcard_sent_direct'] = 'QSL 卡片已直邮发出'; +$lang['qslcard_sent_electronic'] = 'QSL 卡片已经发送电子版'; +$lang['qslcard_sent_manager'] = 'QSL 卡片已经由卡片管理员发出'; $lang['qslcard_rcvd_bureau'] = 'QSL 卡片已由卡片局接收'; $lang['qslcard_rcvd_direct'] = 'QSL 卡片已直邮接收'; +$lang['qslcard_rcvd_electronic'] = 'QSL 卡片已经接收电子版'; +$lang['qslcard_rcvd_manager'] = 'QSL 卡片已经由卡片管理员接收'; $lang['qslcard_upload_front'] = '上传 QSL 卡片正面图像'; $lang['qslcard_upload_back'] = '上传 QSL 卡片背面图像'; diff --git a/application/language/chinese_simplified/qso_lang.php b/application/language/chinese_simplified/qso_lang.php index eb225d19..b1e1c041 100644 --- a/application/language/chinese_simplified/qso_lang.php +++ b/application/language/chinese_simplified/qso_lang.php @@ -6,11 +6,14 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $lang['qso_title_qso_map'] = 'QSO 地图'; $lang['qso_title_suggestions'] = '建议'; $lang['qso_title_previous_contacts'] = '先前通联'; +$lang['qso_title_image'] = '操作员照片'; // Input Help Text on the /QSO Display $lang['qso_transmit_power_helptext'] = '以瓦特为单位设置功率值。在输入中仅填写数值。'; $lang['qso_sota_ref_helptext'] = '例如: GM/NS-001.'; +$lang['qso_wwff_ref_helptext'] = '例如: DLFF-0069.'; +$lang['qso_pota_ref_helptext'] = '例如: PA-0150.'; $lang['qso_sig_helptext'] = '例如: GMA'; $lang['qso_sig_info_helptext'] = '例如: DA/NW-357'; @@ -18,6 +21,7 @@ $lang['qso_sig_info_helptext'] = '例如: DA/NW-357'; $lang['qso_dok_helptext'] = '例如: Q03'; $lang['qso_notes_helptext'] = '仅在 Cloudlog 使用而不上传到其他的服务的笔记。'; +$lang['qsl_notes_helptext'] = '此笔记内容被导出到QSL服务,如 eqsl.cc。'; // Button Text on /qso Display From fb2e49fdca57f47f8019c5a75d912747045fdba6 Mon Sep 17 00:00:00 2001 From: Yuluoxk <59152137+Lingluoluo@users.noreply.github.com> Date: Tue, 10 Jan 2023 12:54:49 +0800 Subject: [PATCH 02/31] Update translation for Chinese simplified --- system/language/chinese_simplified/db_lang.php | 10 +++++----- .../chinese_simplified/form_validation_lang.php | 2 ++ .../language/chinese_simplified/imglib_lang.php | 2 ++ .../chinese_simplified/migration_lang.php | 2 +- .../chinese_simplified/profiler_lang.php | 4 ++-- .../language/chinese_simplified/upload_lang.php | 16 ++++++++-------- 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/system/language/chinese_simplified/db_lang.php b/system/language/chinese_simplified/db_lang.php index e8471420..4f400fde 100644 --- a/system/language/chinese_simplified/db_lang.php +++ b/system/language/chinese_simplified/db_lang.php @@ -9,7 +9,7 @@ */ defined('BASEPATH') OR exit('No direct script access allowed'); -$lang['db_invalid_connection_str'] = '无法根据提交的连接字符串确定数据库设置。 '; +$lang['db_invalid_connection_str'] = '无法根据提交的连接字符串确定数据库设置。'; $lang['db_unable_to_connect'] = '无法使用提供的设置连接到数据库服务器。'; $lang['db_unable_to_select'] = '无法选择指定的数据库: %s'; $lang['db_unable_to_create'] = '无法创建指定的数据库:%s'; @@ -24,12 +24,12 @@ $lang['db_field_param_missing'] = '获取字段需要指定表名。'; $lang['db_unsupported_function'] = '功能不被您当前使用的数据库支持。'; $lang['db_transaction_failure'] = '事务失败:执行回滚。'; $lang['db_unable_to_drop'] = '无法删除指定的数据库。'; -$lang['db_unsupported_feature'] = '特性不被您当前使用的数据库支持。 '; -$lang['db_unsupported_compression'] = '您选择的文件压缩格式不被服务器支持。 '; +$lang['db_unsupported_feature'] = '特性不被您当前使用的数据库支持。'; +$lang['db_unsupported_compression'] = '您选择的文件压缩格式不被服务器支持。'; $lang['db_filepath_error'] = '提交的文件路径无法写入。 '; $lang['db_invalid_cache_path'] = '提交的缓存路径无效或无法写入。'; -$lang['db_table_name_required'] = '操作需要指定表名。 '; -$lang['db_column_name_required'] = '操作需要指定列名。 '; +$lang['db_table_name_required'] = '操作需要指定表名。'; +$lang['db_column_name_required'] = '操作需要指定列名。 '; $lang['db_column_definition_required'] = '操作需要指定列定义。'; $lang['db_unable_to_set_charset'] = '无法设置字符集: %s'; $lang['db_error_heading'] = '数据库发生错误。'; diff --git a/system/language/chinese_simplified/form_validation_lang.php b/system/language/chinese_simplified/form_validation_lang.php index 1ace165e..fac86a2d 100644 --- a/system/language/chinese_simplified/form_validation_lang.php +++ b/system/language/chinese_simplified/form_validation_lang.php @@ -15,6 +15,8 @@ $lang['form_validation_valid_email'] = '{field} 字段必须是一个有效的 E $lang['form_validation_valid_emails'] = '{field} 字段包含的 E-mail 地址必须全部有效。'; $lang['form_validation_valid_url'] = '{field} 字段必须是一个有效的 URL。'; $lang['form_validation_valid_ip'] = '{field} 字段必须包含一个有效的 IP 地址。'; +$lang['form_validation_valid_mac'] = ' {field} 字段必须包含一个有效的 MAC 地址。'; +$lang['form_validation_valid_base64'] = ' {field} 字段必须包含一个有效的 base64 字符串。'; $lang['form_validation_min_length'] = '{field} 字段最少需要有 {param} 字的长度。'; $lang['form_validation_max_length'] = '{field} 字段不能超过 {param} 字的长度。'; $lang['form_validation_exact_length'] = '{field} 字段必须是 {param} 字的长度。'; diff --git a/system/language/chinese_simplified/imglib_lang.php b/system/language/chinese_simplified/imglib_lang.php index 267ea77b..dc73aefb 100644 --- a/system/language/chinese_simplified/imglib_lang.php +++ b/system/language/chinese_simplified/imglib_lang.php @@ -16,6 +16,7 @@ $lang['imglib_unsupported_imagecreate'] = '你的服务器不支持 GD 函数, $lang['imglib_gif_not_supported'] = 'GIF 格式由于版权问题一般不提供,如果可能请使用 JPG 格式或 PNG 格式。'; $lang['imglib_jpg_not_supported'] = 'JPG 格式不被支持。'; $lang['imglib_png_not_supported'] = 'PNG 格式不被支持。'; +$lang['imglib_webp_not_supported'] = 'WEBP 格式不被支持。'; $lang['imglib_jpg_or_png_required'] = '设置中指定的图像缩放方法只能用于 JPG 格式或 PNG 格式。'; $lang['imglib_copy_error'] = '替换文件时发生错误。你的文件目录必须是可写的。'; $lang['imglib_rotate_unsupported'] = '服务器不支持图像旋转。'; @@ -23,6 +24,7 @@ $lang['imglib_libpath_invalid'] = '图形库路径错误。在设置中必须指 $lang['imglib_image_process_failed'] = '图像处理错误。 请验证服务器支持指定的处理方法,并且图形库路径正确。'; $lang['imglib_rotation_angle_required'] = '必须指定旋转角度。'; $lang['imglib_invalid_path'] = '图像路径错误。'; +$lang['imglib_invalid_image'] = '提供的图片不被支持。'; $lang['imglib_copy_failed'] = '图像复制错误。'; $lang['imglib_missing_font'] = '无法找到使用的字体。'; $lang['imglib_save_failed'] = '图像无法保存,请确定图像或目录可写。'; diff --git a/system/language/chinese_simplified/migration_lang.php b/system/language/chinese_simplified/migration_lang.php index 05e6b747..2fdc9934 100644 --- a/system/language/chinese_simplified/migration_lang.php +++ b/system/language/chinese_simplified/migration_lang.php @@ -9,7 +9,7 @@ */ defined('BASEPATH') OR exit('No direct script access allowed'); -$lang['migration_none_found'] = '不需迁移。 '; +$lang['migration_none_found'] = '不需迁移。'; $lang['migration_not_found'] = '无法根据版本号找到迁移方法: %s。'; $lang['migration_sequence_gap'] = '版本迁移存在鸿沟:%s。'; $lang['migration_multiple_version'] = '多个迁移对应同一版本号:%s。'; diff --git a/system/language/chinese_simplified/profiler_lang.php b/system/language/chinese_simplified/profiler_lang.php index 171a21a4..6c08a6c3 100644 --- a/system/language/chinese_simplified/profiler_lang.php +++ b/system/language/chinese_simplified/profiler_lang.php @@ -20,8 +20,8 @@ $lang['profiler_memory_usage'] = '内存使用'; $lang['profiler_config'] = '设置值'; $lang['profiler_session_data'] = 'SESSION 数据'; $lang['profiler_headers'] = 'HTTP 头'; -$lang['profiler_no_db'] = '当前没有已经载入的数据库驱动。 '; -$lang['profiler_no_queries'] = '运行,无查询。 '; +$lang['profiler_no_db'] = '当前没有已经载入的数据库驱动。'; +$lang['profiler_no_queries'] = '运行,无查询。'; $lang['profiler_no_post'] = 'POST 数据不存在。'; $lang['profiler_no_get'] = 'GET 数据不存在。'; $lang['profiler_no_uri'] = 'URI 数据不存在。'; diff --git a/system/language/chinese_simplified/upload_lang.php b/system/language/chinese_simplified/upload_lang.php index 573b04e1..6fb4231f 100644 --- a/system/language/chinese_simplified/upload_lang.php +++ b/system/language/chinese_simplified/upload_lang.php @@ -9,18 +9,18 @@ */ defined('BASEPATH') OR exit('No direct script access allowed'); -$lang['upload_userfile_not_set'] = '无法找到用户文件。 '; +$lang['upload_userfile_not_set'] = '无法找到用户文件。'; $lang['upload_file_exceeds_limit'] = '上传文件的大小超过 PHP 设置中指定的最大大小。'; $lang['upload_file_exceeds_form_limit'] = '上传文件的大小超过表单中指定的最大大小。'; -$lang['upload_file_partial'] = '文件仅上传了一部分。 .'; -$lang['upload_no_temp_directory'] = '无法找到临时文件夹。 .'; -$lang['upload_unable_to_write_file'] = '无法写入文件。 Yeesssssss.'; -$lang['upload_stopped_by_extension'] = '文件上传被扩展停止。 '; -$lang['upload_no_file_selected'] = '没有选择要上传的文件。 '; -$lang['upload_invalid_filetype'] = '禁止上传的文件类型. '; +$lang['upload_file_partial'] = '文件仅上传了一部分。'; +$lang['upload_no_temp_directory'] = '无法找到临时文件夹。'; +$lang['upload_unable_to_write_file'] = '无法写入文件。'; +$lang['upload_stopped_by_extension'] = '文件上传被扩展停止。'; +$lang['upload_no_file_selected'] = '没有选择要上传的文件。'; +$lang['upload_invalid_filetype'] = '禁止上传的文件类型。'; $lang['upload_invalid_filesize'] = '文件大小超过限制。'; $lang['upload_invalid_dimensions'] = '不允许的图像尺寸。'; -$lang['upload_destination_error'] = '移动上传的文件至最终保存路径时发生错误。 '; +$lang['upload_destination_error'] = '移动上传的文件至最终保存路径时发生错误。'; $lang['upload_no_filepath'] = '上传路径无效。'; $lang['upload_no_file_types'] = '指定允许的文件类型。'; $lang['upload_bad_filename'] = '提交的文件名已经存在。'; From 98bbf63a87dfb02cfd9c164db602b6021cf0c2ee Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Thu, 12 Jan 2023 13:50:44 +0000 Subject: [PATCH 03/31] [Widgets] Fixes #1915 removes link from Callsign field --- application/views/widgets/qsos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/widgets/qsos.php b/application/views/widgets/qsos.php index a31f72d6..7bb4b02f 100644 --- a/application/views/widgets/qsos.php +++ b/application/views/widgets/qsos.php @@ -39,7 +39,7 @@ '; ?> COL_TIME_ON); echo date($custom_date_format, $timestamp); ?> COL_TIME_ON); echo date('H:i', $timestamp); ?> - COL_PRIMARY_KEY; ?>">COL_CALL)); ?> + COL_CALL)); ?> COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; ?> COL_RST_SENT; ?> COL_STX_STRING) { ?>(COL_STX_STRING;?>) COL_RST_RCVD; ?> COL_SRX_STRING) { ?>(COL_SRX_STRING;?>) From 9078d25397c8971b67325cf3308e30198066f069 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Fri, 13 Jan 2023 11:36:39 +0100 Subject: [PATCH 04/31] [Activated gridsquare] Fixed col_freq not found in qso_details --- application/models/Logbook_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 9a07bdae..3e72f899 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -318,7 +318,7 @@ class Logbook_model extends CI_Model { $CI->load->model('logbooks_model'); $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); - $sql = 'SELECT COL_SOTA_REF, COL_OPERATOR, COL_IOTA, COL_VUCC_GRIDS, COL_STATE, COL_GRIDSQUARE, COL_PRIMARY_KEY, COL_CALL, COL_TIME_ON, COL_BAND, COL_SAT_NAME, COL_MODE, COL_SUBMODE, COL_RST_SENT, '; + $sql = 'SELECT COL_FREQ, COL_SOTA_REF, COL_OPERATOR, COL_IOTA, COL_VUCC_GRIDS, COL_STATE, COL_GRIDSQUARE, COL_PRIMARY_KEY, COL_CALL, COL_TIME_ON, COL_BAND, COL_SAT_NAME, COL_MODE, COL_SUBMODE, COL_RST_SENT, '; $sql .= 'COL_RST_RCVD, COL_STX, COL_SRX, COL_STX_STRING, COL_SRX_STRING, COL_COUNTRY, COL_QSL_SENT, COL_QSL_SENT_VIA, '; $sql .= 'COL_QSLSDATE, COL_QSL_RCVD, COL_QSL_RCVD_VIA, COL_QSLRDATE, COL_EQSL_QSL_SENT, COL_EQSL_QSLSDATE, COL_EQSL_QSLRDATE, '; $sql .= 'COL_EQSL_QSL_RCVD, COL_LOTW_QSL_SENT, COL_LOTW_QSLSDATE, COL_LOTW_QSL_RCVD, COL_LOTW_QSLRDATE, COL_CONTEST_ID, station_gridsquare '; From ad889e7ee89a74cf70d57a22a023d4ff154506c4 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Mon, 16 Jan 2023 08:47:57 +0100 Subject: [PATCH 05/31] [DXCC id] Fixed /R identification (Rover) --- application/models/Logbook_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 3e72f899..64fc6562 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2960,7 +2960,7 @@ class Logbook_model extends CI_Model { $c = ''; $lidadditions = '/^QRP|^LGT/'; - $csadditions = '/^P$|^M{1,2}$|^AM$|^A$/'; + $csadditions = '/^P$|^R$|^M{1,2}$|^AM$|^A$/'; # First check if the call is in the proper format, A/B/C where A and C # are optional (prefix of guest country and P, MM, AM etc) and B is the From f3a002542370cc6ce1ababf8776ea1298cd0d201 Mon Sep 17 00:00:00 2001 From: phl0 Date: Mon, 16 Jan 2023 17:08:27 +0100 Subject: [PATCH 06/31] Rework DOK stats and add some eye candy Squashed commit of the following: commit 91b55288edee8cdae93570212e0e94c3cc2e66ff Author: phl0 Date: Mon Jan 16 14:59:52 2023 +0100 Add link to DD3AH map commit 11149f8202bb118d635b952512de4f4456c1789a Author: phl0 Date: Mon Jan 16 14:29:37 2023 +0100 Add datatable commit fc768b32bc256c12668bb1c095184e56edbb2d25 Author: phl0 Date: Mon Jan 16 14:06:38 2023 +0100 Remove old code commit b8dfe8566fdc8b20a105b7120faeff4a054b4166 Author: phl0 Date: Sun Jan 15 23:13:09 2023 +0100 Filter summary for DOK/SDOK and remove empty lines commit 5d081a2f7dacd0da8761b7e06a253a6e4050b6c4 Author: phl0 Date: Sun Jan 15 22:55:46 2023 +0100 Remove not worked for now commit 00e9354a5f0be9d40ca3b16e29dbf1728b7d2875 Author: phl0 Date: Sun Jan 15 22:53:17 2023 +0100 Include SAT QSOs in totals commit c1dd7e131ee750b647d4ba802c5aa7af742bdea3 Author: phl0 Date: Sun Jan 15 17:16:30 2023 +0100 Use worked DOKs from DB instead of list from file commit 5e60dc51b5b6ea12bf0109847967c80b0f31e79a Author: phl0 Date: Fri Jan 13 14:59:27 2023 +0100 Use QSL only for confirmed QSOs commit 26c03d9a62492bcbfdfdfb5ec1b6d72e61134bce Author: phl0 Date: Mon Jan 9 16:40:37 2023 +0100 Add filter to QSO details popup commit 20b704aa853c806b0739ac9bd3d4a6082987fb9c Author: phl0 Date: Mon Jan 9 15:25:35 2023 +0100 Forgot to delete replaced part of code commit 574a1ebd17625f508ac40cb87b927efdc9d9f998 Author: phl0 Date: Mon Jan 9 15:20:21 2023 +0100 Hide NM as just a marker for no DOK at all commit 2b5c2ad8e149c370e036fdfc2f978f411bc11ea7 Author: phl0 Date: Thu Jan 5 22:49:03 2023 +0100 Remove debug statement commit 39406b96a3ec8f98ec8548156b83016d68cb6897 Author: phl0 Date: Thu Jan 5 22:48:06 2023 +0100 Add option for eQSL commit 2de47e79f232a8505e951366c557b136c6b6d28d Author: phl0 Date: Thu Jan 5 15:27:10 2023 +0100 Rework DOK stats --- application/controllers/Awards.php | 74 ++++- application/models/Dok.php | 295 +++++++++++++----- application/models/Logbook_model.php | 20 +- application/views/awards/dok/index.php | 215 ++++++++++--- application/views/interface_assets/footer.php | 37 ++- 5 files changed, 522 insertions(+), 119 deletions(-) diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 709e0b01..183212f9 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -31,17 +31,63 @@ class Awards extends CI_Controller { public function dok () { + + $CI =& get_instance(); + $CI->load->model('logbooks_model'); + $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); + $this->load->model('dok'); $this->load->model('bands'); + $this->load->model('modes'); if($this->input->method() === 'post') { $postdata['doks'] = $this->input->post('doks'); } else { $postdata['doks'] = 'both'; } - $data['doks'] = $this->dok->show_stats($postdata); - $data['worked_bands'] = $this->bands->get_worked_bands_dok(); // Used in the view for band select + $data['worked_bands'] = $this->bands->get_worked_bands('dok'); + $data['modes'] = $this->modes->active(); + + if ($this->input->post('band') != NULL) { + if ($this->input->post('band') == 'All') { + $bands = $data['worked_bands']; + } else { + $bands[] = $this->input->post('band'); + } + } else { + $bands = $data['worked_bands']; + } + + $data['bands'] = $bands; + + if($this->input->method() === 'post') { + $postdata['qsl'] = $this->input->post('qsl'); + $postdata['lotw'] = $this->input->post('lotw'); + $postdata['eqsl'] = $this->input->post('eqsl'); + $postdata['worked'] = $this->input->post('worked'); + $postdata['confirmed'] = $this->input->post('confirmed'); + $postdata['band'] = $this->input->post('band'); + $postdata['mode'] = $this->input->post('mode'); + } else { + $postdata['qsl'] = 1; + $postdata['lotw'] = 1; + $postdata['eqsl'] = 0; + $postdata['worked'] = 1; + $postdata['confirmed'] = 1; + $postdata['band'] = 'All'; + $postdata['mode'] = 'All'; + } + + if ($logbooks_locations_array) { + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + $data['dok_array'] = $this->dok->get_dok_array($bands, $postdata, $location_list); + $data['dok_summary'] = $this->dok->get_dok_summary($bands, $postdata, $location_list); + } else { + $location_list = null; + $data['dok_array'] = null; + $data['dok_summary'] = null; + } // Render Page $data['page_title'] = "Awards - DOK"; @@ -66,9 +112,6 @@ class Awards extends CI_Controller { $arguments["order"] = ''; $arguments["join_station_profile"] = true; - // print_r($arguments); - // return; - // Load the API and Logbook models $this->load->model('api_model'); $this->load->model('logbook_model'); @@ -81,7 +124,7 @@ class Awards extends CI_Controller { // Render Page $data['page_title'] = "Log View - DOK"; - $data['filter'] = str_replace("(and)", ", ", $q);//implode(", ", array_keys($a)); + $data['filter'] = str_replace("(and)", ", ", $q); $this->load->view('awards/details', $data); } @@ -206,8 +249,9 @@ class Awards extends CI_Controller { $band = str_replace('"', "", $this->input->post("Band")); $mode = str_replace('"', "", $this->input->post("Mode")); $type = $this->input->post('Type'); + $qsl = $this->input->post('QSL'); - $data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type); + $data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type, $qsl); // This is done because we have two different ways to get dxcc info in Cloudlog. Once is using the name (in awards), and the other one is using the ADIF DXCC. // We replace the values to make it look a bit nicer @@ -217,9 +261,23 @@ class Awards extends CI_Controller { $searchphrase = $dxccname['name']; } + $qsltype = []; + if (strpos($qsl, "Q") !== false) { + $qsltype[] = "QSL"; + } + if (strpos($qsl, "L") !== false) { + $qsltype[] = "LotW"; + } + if (strpos($qsl, "E") !== false) { + $qsltype[] = "eQSL"; + } + // Render Page $data['page_title'] = "Log View - " . $type; $data['filter'] = $type . " " . $searchphrase . " and band ".$band . " and mode ".$mode; + if (!empty($qsltype)) { + $data['filter'] .= " and ".implode('/', $qsltype); + } $this->load->view('awards/details', $data); } @@ -733,4 +791,4 @@ class Awards extends CI_Controller { } } } -} \ No newline at end of file +} diff --git a/application/models/Dok.php b/application/models/Dok.php index 0700791e..bc04302f 100644 --- a/application/models/Dok.php +++ b/application/models/Dok.php @@ -2,93 +2,248 @@ class DOK extends CI_Model { - function show_stats($postdata) { - $CI =& get_instance(); - $CI->load->model('logbooks_model'); - $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); +function get_dok_array($bands, $postdata, $location_list) { + $doks = array(); - if (!$logbooks_locations_array) { - return null; + $list = $this->getDoksFromDB($location_list); + foreach ($this->getSdoksFromDB($location_list) as $sdok) { + $list[] = $sdok; + } + foreach ($list as $dok) { + $doks[$dok->COL_DARC_DOK]['count'] = 0; } - $this->load->model('bands'); + $qsl = ""; + if ($postdata['confirmed'] != NULL) { + if ($postdata['qsl'] != NULL ) { + $qsl .= "Q"; + } + if ($postdata['lotw'] != NULL ) { + $qsl .= "L"; + } + if ($postdata['eqsl'] != NULL ) { + $qsl .= "E"; + } + } - $location_list = "'".implode("','",$logbooks_locations_array)."'"; - $sql = "select upper(COL_DARC_DOK) as COL_DARC_DOK, COL_MODE, lcase(COL_BAND) as COL_BAND, count(COL_DARC_DOK) as cnt from ".$this->config->item('table_name')." WHERE station_id in (" . $location_list . ") AND COL_DARC_DOK IS NOT NULL AND COL_DARC_DOK != '' AND COL_DXCC = 230"; + foreach ($bands as $band) { + foreach ($list as $dok) { + $bandDok[$dok->COL_DARC_DOK][$band] = '-'; + } + + if ($postdata['worked'] != NULL) { + $dokBand = $this->getDokWorked($location_list, $band, $postdata); + foreach ($dokBand as $line) { + if (array_key_exists($line->COL_DARC_DOK, $bandDok)) { /* For now ignore DOKs which are logged but not existing in the official lists any more */ + $bandDok[$line->COL_DARC_DOK][$band] = ''; + $doks[$line->COL_DARC_DOK]['count']++; + } + } + } + + if ($postdata['confirmed'] != NULL) { + $dokBand = $this->getDokConfirmed($location_list, $band, $postdata); + foreach ($dokBand as $line) { + if (array_key_exists($line->COL_DARC_DOK, $bandDok)) { /* For now ignore DOKs which are logged but not existing in the official lists any more */ + $bandDok[$line->COL_DARC_DOK][$band] = ''; + $doks[$line->COL_DARC_DOK]['count']++; + } + } + } + + // We want to remove the worked DOKs in the list, since we do not want to display them + if ($postdata['worked'] == NULL) { + $dokBand = $this->getDokWorked($location_list, $postdata['band'], $postdata); + foreach ($dokBand as $line) { + unset($bandDok[$line->COL_DARC_DOK]); + } + } + + // We want to remove the worked DOKs in the list, since we do not want to display them + if ($postdata['confirmed'] == NULL) { + $dokBand = $this->getDokConfirmed($location_list, $postdata['band'], $postdata); + foreach ($dokBand as $line) { + unset($bandDok[$line->COL_DARC_DOK]); + } + } + } + + foreach ($list as $dok) { + if($doks[$dok->COL_DARC_DOK]['count'] == 0) { + unset($bandDok[$dok->COL_DARC_DOK]); + } + } + + // We want to hide NM as marking not having a DOK at all + unset($bandDok['NM']); + + if (isset($bandDok)) { + return $bandDok; + } else { + return 0; + } + + } + + function getDokWorked($location_list, $band, $postdata) { + $sql = "SELECT DISTINCT COL_DARC_DOK FROM " . $this->config->item('table_name') . " thcv + WHERE station_id IN (" . $location_list . ") AND COL_DARC_DOK <> '' AND COL_DARC_DOK <> 'NM'"; + + if ($postdata['mode'] != 'All') { + $sql .= " AND (COL_MODE = '" . $postdata['mode'] . "' OR COL_SUBMODE = '" . $postdata['mode'] . "')"; + } + $sql .= $this->addDokTypeToQuery($postdata['doks']); + $sql .= $this->addBandToQuery($band); + $sql .= " AND NOT EXISTS (SELECT 1 from " . $this->config->item('table_name') . + " WHERE station_id in (" . $location_list . + ") AND COL_DARC_DOK = thcv.COL_DARC_DOK AND COL_DARC_DOK <> '' AND COL_DARC_DOK <> 'NM' "; + $sql .= $this->addDokTypeToQuery($postdata['doks']); + $sql .= $this->addBandToQuery($band); + $sql .= $this->addQslToQuery($postdata); + $sql .= ")"; + $query = $this->db->query($sql); + + return $query->result(); + + } + + function getDokConfirmed($location_list, $band, $postdata) { + $sql = "SELECT DISTINCT COL_DARC_DOK FROM " . $this->config->item('table_name') . " thcv + WHERE station_id IN (" . $location_list . ") AND COL_DARC_DOK <> '' AND COL_DARC_DOK <> '' AND COL_DARC_DOK <> 'NM'"; + if ($postdata['mode'] != 'All') { + $sql .= " AND (COL_MODE = '" . $postdata['mode'] . "' or COL_SUBMODE = '" . $postdata['mode'] . "')"; + } + $sql .= $this->addDokTypeToQuery($postdata['doks']); + $sql .= $this->addBandToQuery($band); + $sql .= $this->addQslToQuery($postdata); + $query = $this->db->query($sql); + return $query->result(); + } + + function addQslToQuery($postdata) { + $sql = ''; + $qsl = array(); + if ($postdata['lotw'] != NULL || $postdata['qsl'] != NULL || $postdata['eqsl'] != NULL) { + $sql .= 'and ('; + if ($postdata['qsl'] != NULL) { + array_push($qsl, "col_qsl_rcvd = 'Y'"); + } + if ($postdata['lotw'] != NULL) { + array_push($qsl, "col_lotw_qsl_rcvd = 'Y'"); + } + if ($postdata['eqsl'] != NULL) { + array_push($qsl, "col_eqsl_qsl_rcvd = 'Y'"); + } + $sql .= implode(' or ', $qsl); + $sql .= ')'; + } + return $sql; + } + + function addBandToQuery($band) { + $sql = ''; + if ($band != 'All') { + if ($band == 'SAT') { + $sql .= " AND COL_PROP_MODE ='" . $band . "'"; + } else { + $sql .= " AND COL_PROP_MODE !='SAT'"; + $sql .= " AND col_BAND ='" . $band . "'"; + } + } + return $sql; + } + + function addDokTypeToQuery($doks) { + $sql = ''; + if ($doks == 'dok') { + $sql .= " AND COL_DARC_DOK REGEXP '^[A-Z][0-9]{2}$'"; + } else if ($doks == 'sdok') { + $sql .= " AND COL_DARC_DOK NOT REGEXP '^[A-Z][0-9]{2}$'"; + } + return $sql; + } + + function get_dok_summary($bands, $postdata, $location_list) { + foreach ($bands as $band) { + $worked = $this->getSummaryByBand($band, $postdata, $location_list); + $confirmed = $this->getSummaryByBandConfirmed($band, $postdata, $location_list); + $dokSummary['worked'][$band] = $worked[0]->count; + $dokSummary['confirmed'][$band] = $confirmed[0]->count; + } + + + $workedTotal = $this->getSummaryByBand($postdata['band'], $postdata, $location_list); + $confirmedTotal = $this->getSummaryByBandConfirmed($postdata['band'], $postdata, $location_list); + + $dokSummary['worked']['Total'] = $workedTotal[0]->count; + $dokSummary['confirmed']['Total'] = $confirmedTotal[0]->count; + + return $dokSummary; + } + + function getSummaryByBand($band, $postdata, $location_list) { + $sql = "SELECT count(distinct thcv.COL_DARC_DOK) AS count FROM " . $this->config->item('table_name') . " thcv"; + $sql .= " WHERE station_id IN (" . $location_list . ') AND COL_DARC_DOK != "" AND COL_DARC_DOK <> "NM"'; + if ($band == 'SAT') { + $sql .= " AND thcv.COL_PROP_MODE ='" . $band . "'"; + } else if ($band == 'All') { + $this->load->model('bands'); + $bandslots = $this->bands->get_worked_bands('dok'); + $bandslots_list = "'".implode("','",$bandslots)."'"; + $sql .= " AND thcv.COL_BAND in (" . $bandslots_list . ")"; + } else { + $sql .= " AND thcv.COL_PROP_MODE !='SAT'"; + $sql .= " AND thcv.COL_BAND ='" . $band . "'"; + } if ($postdata['doks'] == 'dok') { $sql .= " AND COL_DARC_DOK REGEXP '^[A-Z][0-9]{2}$'"; } else if ($postdata['doks'] == 'sdok') { $sql .= " AND COL_DARC_DOK NOT REGEXP '^[A-Z][0-9]{2}$'"; } - $sql .= " group by COL_DARC_DOK, COL_MODE, COL_BAND"; - $sql .= " order by COL_DARC_DOK asc"; - - $data = $this->db->query($sql); - - $results = array(); - $last_dok = ""; - foreach($data->result() as $row){ - if ($last_dok != $row->COL_DARC_DOK){ - // new row - $results[$row->COL_DARC_DOK] = $this->bands->bandslots; - $last_dok = $row->COL_DARC_DOK; - } - - // update stats - if (!isset($results[$row->COL_DARC_DOK])) - $results[$row->COL_DARC_DOK] = []; - - if (!isset($results[$row->COL_DARC_DOK][$row->COL_BAND])) - $results[$row->COL_DARC_DOK][$row->COL_BAND] = 0; - - $results[$row->COL_DARC_DOK][$row->COL_BAND] += $row->cnt; - } - - return $results; + $query = $this->db->query($sql); + return $query->result(); } - /** - * Function: mostactive - * Information: Returns the most active band - **/ - function info($callsign) - { - $exceptions = $this->db->query(' - SELECT * - FROM `dxcc_exceptions` - WHERE `prefix` = \''.$callsign.'\' - LIMIT 1 - '); - - if ($exceptions->num_rows() > 0) - { - return $exceptions; + function getSummaryByBandConfirmed($band, $postdata, $location_list){ + $sql = "SELECT count(distinct thcv.COL_DARC_DOK) AS count FROM " . $this->config->item('table_name') . " thcv"; + $sql .= " WHERE station_id IN (" . $location_list . ') AND COL_DARC_DOK != "" AND COL_DARC_DOK <> "NM"'; + if ($band == 'SAT') { + $sql .= " AND thcv.COL_PROP_MODE ='" . $band . "'"; + } else if ($band == 'All') { + $this->load->model('bands'); + $bandslots = $this->bands->get_worked_bands('dok'); + $bandslots_list = "'".implode("','",$bandslots)."'"; + $sql .= " AND thcv.COL_BAND in (" . $bandslots_list . ")"; } else { - - $query = $this->db->query(' - SELECT * - FROM dxcc_entities - WHERE prefix = SUBSTRING( \''.$callsign.'\', 1, LENGTH( prefix ) ) - ORDER BY LENGTH( prefix ) DESC - LIMIT 1 - '); - - return $query; + $sql .= " AND thcv.COL_PROP_MODE !='SAT'"; + $sql .= " AND thcv.COL_BAND ='" . $band . "'"; } + if ($postdata['doks'] == 'dok') { + $sql .= " AND COL_DARC_DOK REGEXP '^[A-Z][0-9]{2}$'"; + } else if ($postdata['doks'] == 'sdok') { + $sql .= " AND COL_DARC_DOK NOT REGEXP '^[A-Z][0-9]{2}$'"; + } + $sql .= $this->addQslToQuery($postdata); + $query = $this->db->query($sql); + return $query->result(); } - function search(){ - print_r($this->input->get()); - return; - } - - function empty_table($table) { - $this->db->empty_table($table); + function getDoksFromDB($location_list) { + $sql = 'SELECT DISTINCT `COL_DARC_DOK` FROM '.$this->config->item('table_name'); + $sql .= " WHERE station_id IN (" . $location_list . ') AND COL_DARC_DOK != "" AND COL_DARC_DOK <> "NM"'; + $sql .= " AND COL_DARC_DOK REGEXP '^[A-Z][0-9]{2}$'"; + $sql .= " ORDER BY COL_DARC_DOK ASC"; + $query = $this->db->query($sql); + return $query->result(); } - function list() { - $this->db->order_by('name', 'ASC'); - return $this->db->get('dxcc_entities'); + function getSdoksFromDB($location_list) { + $sql = 'SELECT DISTINCT `COL_DARC_DOK` FROM '.$this->config->item('table_name'); + $sql .= " WHERE station_id IN (" . $location_list . ') AND COL_DARC_DOK != "" AND COL_DARC_DOK <> "NM"'; + $sql .= " AND COL_DARC_DOK NOT REGEXP '^[A-Z][0-9]{2}$'"; + $sql .= " ORDER BY COL_DARC_DOK ASC"; + $query = $this->db->query($sql); + return $query->result(); } } ?> diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 64fc6562..fca8dda8 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -257,7 +257,7 @@ class Logbook_model extends CI_Model { /* * Used to fetch QSOs from the logbook in the awards */ - public function qso_details($searchphrase, $band, $mode, $type){ + public function qso_details($searchphrase, $band, $mode, $type, $qsl){ $CI =& get_instance(); $CI->load->model('logbooks_model'); $logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook')); @@ -292,6 +292,9 @@ class Logbook_model extends CI_Model { case 'POTA': $this->db->where('COL_POTA_REF', $searchphrase); break; + case 'DOK': + $this->db->where('COL_DARC_DOK', $searchphrase); + break; } $this->db->where_in($this->config->item('table_name').'.station_id', $logbooks_locations_array); @@ -305,6 +308,21 @@ class Logbook_model extends CI_Model { } } + if (!empty($qsl)) { + $qslfilter = array(); + if (strpos($qsl, "Q") !== false) { + $qslfilter[] = 'COL_QSL_RCVD = "Y"'; + } + if (strpos($qsl, "L") !== false) { + $qslfilter[] = 'COL_LOTW_QSL_RCVD = "Y"'; + } + if (strpos($qsl, "E") !== false) { + $qslfilter[] = 'COL_EQSL_QSL_RCVD = "Y"'; + } + $sql = "(".implode(' OR ', $qslfilter).")"; + $this->db->where($sql); + } + if ($mode != 'All') { $this->db->where("(COL_MODE='" . $mode . "' OR COL_SUBMODE='" . $mode ."')"); } diff --git a/application/views/awards/dok/index.php b/application/views/awards/dok/index.php index aed9a0aa..a4fe94d3 100644 --- a/application/views/awards/dok/index.php +++ b/application/views/awards/dok/index.php @@ -1,11 +1,40 @@ +
-

-
-
+

+ +
+
- +
+ +
+
Worked / Confirmed
+
+
+ input->post('worked') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> > + +
+
+ input->post('confirmed') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> > + +
+
+
+ +
+
QSL / LoTW
+
+
+ input->post('qsl') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> > + +
+
+ input->post('lotw') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> > + +
+
+ input->post('eqsl')) echo ' checked="checked"'; ?> > + +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + $value) { + if (preg_match('/^[A-Z][0-9]{2}$/', $dok)) { + $doks[] = $dok; + } + } +?> +
- - + + +
- - - - +
+ +
+
+
+ +
+ +
+ + +
- - $slot\n"; - } - ?> - - - - $val){ - print(""); - foreach($val as $band=>$count){ - if (in_array($band, $worked_bands)) { - if ($count == 0){ - print(""); - }else{ - printf("", str_replace("&", "%26", $dok), $band, $count); - } - } + '; + foreach($bands as $band) { + echo ''; } - print(""); + echo ' + + '; + foreach ($dok_array as $dok => $value) { // Fills the table with the data + echo ' + '; + foreach ($value as $key) { + echo ''; + } + echo ''; + } + echo '
DOKs ()
$dok %dDOK' . $band . '
'. $dok .'' . $key . '
+

Summary

+ + + + '; + + foreach($bands as $band) { + echo ''; + } + echo ' + + + + '; + + foreach ($dok_summary['worked'] as $dxcc) { // Fills the table with the data + echo ''; } - ?> - + echo ' + '; + foreach ($dok_summary['confirmed'] as $dxcc) { // Fills the table with the data + echo ''; + } -
' . $band . 'Total
Total worked' . $dxcc . '
Total confirmed' . $dxcc . '
- + +
'; + + } + else { echo ''; - } ?> + } + ?> + + + diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index df4031da..cd96e0e6 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -2568,7 +2568,7 @@ function deleteQsl(id) { /* * Used to fetch QSOs from the logbook in the awards */ - function displayContacts(searchphrase, band, mode, type) { + function displayContacts(searchphrase, band, mode, type, qsl) { var baseURL = ""; $.ajax({ url: baseURL + 'index.php/awards/qso_details_ajax', @@ -2577,7 +2577,8 @@ function deleteQsl(id) { 'Searchphrase': searchphrase, 'Band': band, 'Mode': mode, - 'Type': type + 'Type': type, + 'QSL' : qsl }, success: function (html) { BootstrapDialog.show({ @@ -3214,6 +3215,38 @@ function deleteQsl(id) { $('[class*="buttons"]').css("color", "white"); } + uri->segment(2) == "dok") { ?> + From c8a85a72c0b5ae601e47d890ce7de63f372d34b8 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Mon, 16 Jan 2023 21:58:34 +0100 Subject: [PATCH 07/31] [DXCC id] Fixed identification for VP2x calls (and probably others) --- application/models/Logbook_model.php | 31 ++++++++-------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 64fc6562..afc3eb22 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1155,7 +1155,7 @@ class Logbook_model extends CI_Model { } else { $logbooks_locations_array = $StationLocationsArray; } - + if ($logbooks_locations_array) { $this->db->where_in($this->config->item('table_name').'.station_id', $logbooks_locations_array); $this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id'); @@ -1163,12 +1163,12 @@ class Logbook_model extends CI_Model { $this->db->order_by("COL_TIME_ON", "desc"); $this->db->limit($num); $query = $this->db->get($this->config->item('table_name')); - + return $query; } else { return null; } - + } /* Get all QSOs with a valid grid for use in the KML export */ @@ -2838,13 +2838,7 @@ class Logbook_model extends CI_Model { $call = "KG4"; } elseif (preg_match('/(^KG4)[A-Z09]{1}/', $call)) { $call = "K"; - } elseif (preg_match_all('/^((\d|[A-Z])+\/)?((\d|[A-Z]){3,})(\/(\d|[A-Z])+)?(\/(\d|[A-Z])+)?$/', $call, $matches)) { - if ($matches[5][0] == '/MM' || $matches[5][0] == '/AM') { - $row['adif'] = 0; - $row['entity'] = 'None'; - $row['cqz'] = 0; - return array($row['adif'], $row['entity'], $row['cqz']); - } else { + } elseif (preg_match('/\w\/\w/', $call)) { $result = $this->wpx($call, 1); # use the wpx prefix instead if ($result == '') { $row['adif'] = 0; @@ -2854,7 +2848,6 @@ class Logbook_model extends CI_Model { } else { $call = $result . "AA"; } - } } $len = strlen($call); @@ -2904,15 +2897,7 @@ class Logbook_model extends CI_Model { $call = "KG4"; } elseif (preg_match('/(^KG4)[A-Z09]{1}/', $call)) { $call = "K"; - } elseif (preg_match_all('/^((\d|[A-Z])+\/)?((\d|[A-Z]){3,})(\/(\d|[A-Z])+)?(\/(\d|[A-Z])+)?$/', $call, $matches)) { - if ($matches[5][0] == '/MM' || $matches[5][0] == '/AM') { - $row['adif'] = 0; - $row['entity'] = 'None'; - $row['cqz'] = 0; - $row['long'] = '0'; - $row['lat'] = '0'; - return $row; - } else { + } elseif (preg_match('/\w\/\w/', $call)) { $result = $this->wpx($call, 1); # use the wpx prefix instead if ($result == '') { $row['adif'] = 0; @@ -2924,7 +2909,6 @@ class Logbook_model extends CI_Model { } else { $call = $result . "AA"; } - } } $len = strlen($call); @@ -2960,7 +2944,8 @@ class Logbook_model extends CI_Model { $c = ''; $lidadditions = '/^QRP|^LGT/'; - $csadditions = '/^P$|^R$|^M{1,2}$|^AM$|^A$/'; + $csadditions = '/^P$|^R$|^A$/'; + $noneadditions = '/^M{1,2}$|^AM$/'; # First check if the call is in the proper format, A/B/C where A and C # are optional (prefix of guest country and P, MM, AM etc) and B is the @@ -3051,6 +3036,8 @@ class Logbook_model extends CI_Model { } elseif (preg_match($csadditions, $c)) { preg_match('/(.+\d)[A-Z]*/', $b, $matches); # Known attachment -> like Case 1.1 $prefix = $matches[1]; + } elseif (preg_match($noneadditions, $c)) { + return ''; } elseif (preg_match('/^\d\d+$/', $c)) { # more than 2 numbers -> ignore preg_match('/(.+\d)[A-Z]* /', $b, $matches); # see above $prefix = $matches[1][0]; From 573c1b48f0ce040b7efd9cee4f2b3eab19cc6c4f Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Tue, 17 Jan 2023 20:54:15 +0100 Subject: [PATCH 08/31] [DXCC id] Fix for /M --- application/models/Logbook_model.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index afc3eb22..111b738b 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2944,8 +2944,8 @@ class Logbook_model extends CI_Model { $c = ''; $lidadditions = '/^QRP|^LGT/'; - $csadditions = '/^P$|^R$|^A$/'; - $noneadditions = '/^M{1,2}$|^AM$/'; + $csadditions = '/^P$|^R$|^A$|^M$/'; + $noneadditions = '/^MM$|^AM$/'; # First check if the call is in the proper format, A/B/C where A and C # are optional (prefix of guest country and P, MM, AM etc) and B is the @@ -3048,6 +3048,8 @@ class Logbook_model extends CI_Model { $prefix = $c . "0"; } } + } elseif (($a) && (preg_match($noneadditions, $c))) { # Case 2.1, X/CALL/X ie TF/DL2NWK/MM - DXCC none + return ''; } elseif ($a) { # $a contains the prefix we want if (preg_match('/\d$/', $a)) { # ends in number -> good prefix From 64261b4d87359a6abfbe3e9f76ff8c5aedb60d72 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Tue, 17 Jan 2023 20:56:16 +0100 Subject: [PATCH 09/31] [PHP 8.1] Another fix for passing null to string --- application/models/Logbook_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 111b738b..372a9972 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2782,7 +2782,7 @@ class Logbook_model extends CI_Model { $data['COL_MY_IOTA'] = strtoupper(trim($row['station_iota'])); $data['COL_MY_SOTA_REF'] = strtoupper(trim($row['station_sota'])); $data['COL_MY_WWFF_REF'] = strtoupper(trim($row['station_wwff'])); - $data['COL_MY_POTA_REF'] = strtoupper(trim($row['station_pota'])); + $data['COL_MY_POTA_REF'] = $row['station_pota'] == null ? '' : strtoupper(trim($row['station_pota'])); $data['COL_STATION_CALLSIGN'] = strtoupper(trim($row['station_callsign'])); $data['COL_MY_DXCC'] = strtoupper(trim($row['station_dxcc'])); From 7e9e23e9b73dab2dbf5719ca99c6ca3fba28e284 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Tue, 17 Jan 2023 20:58:23 +0100 Subject: [PATCH 10/31] [Tweak] Removed one db call to oqrs in menu. Set variable and check on variable instead of two calls. --- application/views/interface_assets/header.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index 22b125ad..03ee041a 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -239,8 +239,10 @@ if ($logbooks_locations_array) { } else { $location_list = null; } + +$oqrs_requests = $CI->oqrs_model->oqrs_requests($location_list); ?> - OQRS Requests oqrs_model->oqrs_requests($location_list) > 0) { echo "".$CI->oqrs_model->oqrs_requests($location_list).""; } ?> + OQRS Requests 0) { echo "".$oqrs_requests.""; } ?> Print Requested QSLs From ab989cbb3f683b0dcdca0bd728c4c3b7b1e1ec56 Mon Sep 17 00:00:00 2001 From: phl0 Date: Tue, 17 Jan 2023 21:55:46 +0100 Subject: [PATCH 11/31] Deal with empty results --- application/models/Dok.php | 4 +++- application/views/awards/dok/index.php | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/application/models/Dok.php b/application/models/Dok.php index bc04302f..24057811 100644 --- a/application/models/Dok.php +++ b/application/models/Dok.php @@ -75,7 +75,9 @@ function get_dok_array($bands, $postdata, $location_list) { } // We want to hide NM as marking not having a DOK at all - unset($bandDok['NM']); + if (isset($bandDok['NM'])) { + unset($bandDok['NM']); + } if (isset($bandDok)) { return $bandDok; diff --git a/application/views/awards/dok/index.php b/application/views/awards/dok/index.php index a4fe94d3..89b427a7 100644 --- a/application/views/awards/dok/index.php +++ b/application/views/awards/dok/index.php @@ -120,9 +120,11 @@ $value) { - if (preg_match('/^[A-Z][0-9]{2}$/', $dok)) { - $doks[] = $dok; + if ($dok_array) { + foreach ($dok_array as $dok => $value) { + if (preg_match('/^[A-Z][0-9]{2}$/', $dok)) { + $doks[] = $dok; + } } } ?> From dc2c5ca4bc24151743e27e36a1c71de15a253130 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:17:08 +0100 Subject: [PATCH 12/31] [DOK view] Removed css. Only needed for leaflet map. --- application/views/awards/dok/index.php | 29 -------------------------- 1 file changed, 29 deletions(-) diff --git a/application/views/awards/dok/index.php b/application/views/awards/dok/index.php index 89b427a7..08064044 100644 --- a/application/views/awards/dok/index.php +++ b/application/views/awards/dok/index.php @@ -1,32 +1,3 @@ - -

From eb3b2f195c54e2966ec1213bed522212b33ae64b Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 18 Jan 2023 09:28:27 +0100 Subject: [PATCH 13/31] Fix empty value error for PHP 8.1 --- application/controllers/Awards.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 183212f9..7488938e 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -245,6 +245,7 @@ class Awards extends CI_Controller { public function qso_details_ajax(){ $this->load->model('logbook_model'); + $qsl = ''; $searchphrase = str_replace('"', "", $this->input->post("Searchphrase")); $band = str_replace('"', "", $this->input->post("Band")); $mode = str_replace('"', "", $this->input->post("Mode")); From fd9424f730d298fb6421248b51fa8f594e42434c Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 18 Jan 2023 09:31:38 +0100 Subject: [PATCH 14/31] Previous fix won't work as value would be overwritten --- application/controllers/Awards.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index 7488938e..e45929d2 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -245,12 +245,11 @@ class Awards extends CI_Controller { public function qso_details_ajax(){ $this->load->model('logbook_model'); - $qsl = ''; $searchphrase = str_replace('"', "", $this->input->post("Searchphrase")); $band = str_replace('"', "", $this->input->post("Band")); $mode = str_replace('"', "", $this->input->post("Mode")); $type = $this->input->post('Type'); - $qsl = $this->input->post('QSL'); + $this->input->post('QSL') == null ? '' : $this->input->post('QSL'); $data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type, $qsl); From 9781b1947e615ac620f35c7081716eff3ee40e99 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Wed, 18 Jan 2023 09:53:47 +0100 Subject: [PATCH 15/31] Fix empty value error for PHP 8.1 --- application/controllers/Awards.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index e45929d2..cd7d9290 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -249,7 +249,7 @@ class Awards extends CI_Controller { $band = str_replace('"', "", $this->input->post("Band")); $mode = str_replace('"', "", $this->input->post("Mode")); $type = $this->input->post('Type'); - $this->input->post('QSL') == null ? '' : $this->input->post('QSL'); + $qsl = $this->input->post('QSL') == null ? '' : $this->input->post('QSL'); $data['results'] = $this->logbook_model->qso_details($searchphrase, $band, $mode, $type, $qsl); From f8d720361525f439acbe136b244343a0d03e0a21 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 18 Jan 2023 13:34:27 +0100 Subject: [PATCH 16/31] Fix SQL query and rename QSL type --- application/models/Dok.php | 2 +- application/views/awards/dok/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/Dok.php b/application/models/Dok.php index 24057811..1ae0cbd9 100644 --- a/application/models/Dok.php +++ b/application/models/Dok.php @@ -126,7 +126,7 @@ function get_dok_array($bands, $postdata, $location_list) { $sql = ''; $qsl = array(); if ($postdata['lotw'] != NULL || $postdata['qsl'] != NULL || $postdata['eqsl'] != NULL) { - $sql .= 'and ('; + $sql .= ' and ('; if ($postdata['qsl'] != NULL) { array_push($qsl, "col_qsl_rcvd = 'Y'"); } diff --git a/application/views/awards/dok/index.php b/application/views/awards/dok/index.php index 08064044..8baabb89 100644 --- a/application/views/awards/dok/index.php +++ b/application/views/awards/dok/index.php @@ -36,7 +36,7 @@
-
QSL / LoTW
+
QSL Type
input->post('qsl') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> > From 75cf2c7c7c0403aafccf7fa288e84d0366429acc Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 18 Jan 2023 13:35:58 +0100 Subject: [PATCH 17/31] Implement eQSL and QSL filter for CQ awards --- application/controllers/Awards.php | 9 ++++-- application/models/Cq.php | 41 +++++++++++++++++++-------- application/views/awards/cq/index.php | 8 ++++-- 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index cd7d9290..ac7ab5ec 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -359,8 +359,9 @@ class Awards extends CI_Controller { $data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view if($this->input->method() === 'post') { - $postdata['lotw'] = $this->input->post('lotw'); $postdata['qsl'] = $this->input->post('qsl'); + $postdata['lotw'] = $this->input->post('lotw'); + $postdata['eqsl'] = $this->input->post('eqsl'); $postdata['worked'] = $this->input->post('worked'); $postdata['confirmed'] = $this->input->post('confirmed'); $postdata['notworked'] = $this->input->post('notworked'); @@ -368,8 +369,9 @@ class Awards extends CI_Controller { $postdata['mode'] = $this->input->post('mode'); } else { // Setting default values at first load of page - $postdata['lotw'] = 1; $postdata['qsl'] = 1; + $postdata['lotw'] = 1; + $postdata['eqsl'] = 0; $postdata['worked'] = 1; $postdata['confirmed'] = 1; $postdata['notworked'] = 1; @@ -639,8 +641,9 @@ class Awards extends CI_Controller { $bands[] = $this->input->post('band'); - $postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1; $postdata['qsl'] = $this->input->post('qsl') == 0 ? NULL: 1; + $postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1; + $postdata['eqsl'] = $this->input->post('eqsl') == 0 ? NULL: 1; $postdata['worked'] = $this->input->post('worked') == 0 ? NULL: 1; $postdata['confirmed'] = $this->input->post('confirmed') == 0 ? NULL: 1; $postdata['notworked'] = $this->input->post('notworked') == 0 ? NULL: 1; diff --git a/application/models/Cq.php b/application/models/Cq.php index 03915fa1..b4fecee5 100644 --- a/application/models/Cq.php +++ b/application/models/Cq.php @@ -24,6 +24,19 @@ class CQ extends CI_Model{ $cqZ[$i]['count'] = 0; // Inits each cq zone's count } + $qsl = ""; + if ($postdata['confirmed'] != NULL) { + if ($postdata['qsl'] != NULL ) { + $qsl .= "Q"; + } + if ($postdata['lotw'] != NULL ) { + $qsl .= "L"; + } + if ($postdata['eqsl'] != NULL ) { + $qsl .= "E"; + } + } + foreach ($bands as $band) { for ($i = 1; $i <= 40; $i++) { $bandCq[$i][$band] = '-'; // Sets all to dash to indicate no result @@ -32,14 +45,14 @@ class CQ extends CI_Model{ if ($postdata['worked'] != NULL) { $cqBand = $this->getCQWorked($location_list, $band, $postdata); foreach ($cqBand as $line) { - $bandCq[$line->col_cqz][$band] = ''; + $bandCq[$line->col_cqz][$band] = ''; $cqZ[$line->col_cqz]['count']++; } } if ($postdata['confirmed'] != NULL) { $cqBand = $this->getCQConfirmed($location_list, $band, $postdata); foreach ($cqBand as $line) { - $bandCq[$line->col_cqz][$band] = ''; + $bandCq[$line->col_cqz][$band] = ''; $cqZ[$line->col_cqz]['count']++; } } @@ -132,16 +145,20 @@ class CQ extends CI_Model{ function addQslToQuery($postdata) { $sql = ''; - if ($postdata['lotw'] != NULL and $postdata['qsl'] == NULL) { - $sql .= " and col_lotw_qsl_rcvd = 'Y'"; - } - - if ($postdata['qsl'] != NULL and $postdata['lotw'] == NULL) { - $sql .= " and col_qsl_rcvd = 'Y'"; - } - - if ($postdata['qsl'] != NULL && $postdata['lotw'] != NULL) { - $sql .= " and (col_qsl_rcvd = 'Y' or col_lotw_qsl_rcvd = 'Y')"; + $qsl = array(); + if ($postdata['lotw'] != NULL || $postdata['qsl'] != NULL || $postdata['eqsl'] != NULL) { + $sql .= ' and ('; + if ($postdata['qsl'] != NULL) { + array_push($qsl, "col_qsl_rcvd = 'Y'"); + } + if ($postdata['lotw'] != NULL) { + array_push($qsl, "col_lotw_qsl_rcvd = 'Y'"); + } + if ($postdata['eqsl'] != NULL) { + array_push($qsl, "col_eqsl_qsl_rcvd = 'Y'"); + } + $sql .= implode(' or ', $qsl); + $sql .= ')'; } return $sql; } diff --git a/application/views/awards/cq/index.php b/application/views/awards/cq/index.php index e5cd4476..23c64037 100644 --- a/application/views/awards/cq/index.php +++ b/application/views/awards/cq/index.php @@ -57,7 +57,7 @@
-
QSL / LoTW
+
QSL Type
input->post('qsl') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> > @@ -67,6 +67,10 @@ input->post('lotw') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
+
+ input->post('eqsl')) echo ' checked="checked"'; ?> > + +
@@ -201,4 +205,4 @@
- \ No newline at end of file + From 90b2e9c7f9ed690c58fab681d8b2fc9f1e10b433 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 18 Jan 2023 13:51:46 +0100 Subject: [PATCH 18/31] Implement eQSL and QSL filter for DXCC awards --- application/controllers/Awards.php | 9 ++++-- application/models/Dxcc.php | 41 +++++++++++++++++-------- application/views/awards/dxcc/index.php | 6 +++- 3 files changed, 40 insertions(+), 16 deletions(-) diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index ac7ab5ec..a9d3da43 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -151,8 +151,9 @@ class Awards extends CI_Controller { $data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view if($this->input->method() === 'post') { - $postdata['lotw'] = $this->input->post('lotw'); $postdata['qsl'] = $this->input->post('qsl'); + $postdata['lotw'] = $this->input->post('lotw'); + $postdata['eqsl'] = $this->input->post('eqsl'); $postdata['worked'] = $this->input->post('worked'); $postdata['confirmed'] = $this->input->post('confirmed'); $postdata['notworked'] = $this->input->post('notworked'); @@ -168,8 +169,9 @@ class Awards extends CI_Controller { $postdata['mode'] = $this->input->post('mode'); } else { // Setting default values at first load of page - $postdata['lotw'] = 1; $postdata['qsl'] = 1; + $postdata['lotw'] = 1; + $postdata['eqsl'] = 0; $postdata['worked'] = 1; $postdata['confirmed'] = 1; $postdata['notworked'] = 1; @@ -691,8 +693,9 @@ class Awards extends CI_Controller { $bands[] = $this->input->post('band'); - $postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1; $postdata['qsl'] = $this->input->post('qsl') == 0 ? NULL: 1; + $postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1; + $postdata['eqsl'] = $this->input->post('eqsl') == 0 ? NULL: 1; $postdata['worked'] = $this->input->post('worked') == 0 ? NULL: 1; $postdata['confirmed'] = $this->input->post('confirmed') == 0 ? NULL: 1; $postdata['notworked'] = $this->input->post('notworked') == 0 ? NULL: 1; diff --git a/application/models/Dxcc.php b/application/models/Dxcc.php index 4548cc94..cfa3b65c 100644 --- a/application/models/Dxcc.php +++ b/application/models/Dxcc.php @@ -69,6 +69,19 @@ class DXCC extends CI_Model { $location_list = "'".implode("','",$logbooks_locations_array)."'"; + $qsl = ""; + if ($postdata['confirmed'] != NULL) { + if ($postdata['qsl'] != NULL ) { + $qsl .= "Q"; + } + if ($postdata['lotw'] != NULL ) { + $qsl .= "L"; + } + if ($postdata['eqsl'] != NULL ) { + $qsl .= "E"; + } + } + foreach ($bands as $band) { // Looping through bands and entities to generate the array needed for display foreach ($dxccArray as $dxcc) { $dxccMatrix[$dxcc->adif]['name'] = ucwords(strtolower($dxcc->name), "- (/"); @@ -82,7 +95,7 @@ class DXCC extends CI_Model { if ($postdata['worked'] != NULL) { $workedDXCC = $this->getDxccBandWorked($location_list, $band, $postdata); foreach ($workedDXCC as $wdxcc) { - $dxccMatrix[$wdxcc->dxcc][$band] = ''; + $dxccMatrix[$wdxcc->dxcc][$band] = ''; } } @@ -90,7 +103,7 @@ class DXCC extends CI_Model { if ($postdata['confirmed'] != NULL) { $confirmedDXCC = $this->getDxccBandConfirmed($location_list, $band, $postdata); foreach ($confirmedDXCC as $cdxcc) { - $dxccMatrix[$cdxcc->dxcc][$band] = ''; + $dxccMatrix[$cdxcc->dxcc][$band] = ''; } } } @@ -315,16 +328,20 @@ class DXCC extends CI_Model { // Made function instead of repeating this several times function addQslToQuery($postdata) { $sql = ''; - if ($postdata['lotw'] != NULL and $postdata['qsl'] == NULL) { - $sql .= " and col_lotw_qsl_rcvd = 'Y'"; - } - - if ($postdata['qsl'] != NULL and $postdata['lotw'] == NULL) { - $sql .= " and col_qsl_rcvd = 'Y'"; - } - - if ($postdata['qsl'] != NULL && $postdata['lotw'] != NULL) { - $sql .= " and (col_qsl_rcvd = 'Y' or col_lotw_qsl_rcvd = 'Y')"; + $qsl = array(); + if ($postdata['lotw'] != NULL || $postdata['qsl'] != NULL || $postdata['eqsl'] != NULL) { + $sql .= ' and ('; + if ($postdata['qsl'] != NULL) { + array_push($qsl, "col_qsl_rcvd = 'Y'"); + } + if ($postdata['lotw'] != NULL) { + array_push($qsl, "col_lotw_qsl_rcvd = 'Y'"); + } + if ($postdata['eqsl'] != NULL) { + array_push($qsl, "col_eqsl_qsl_rcvd = 'Y'"); + } + $sql .= implode(' or ', $qsl); + $sql .= ')'; } return $sql; } diff --git a/application/views/awards/dxcc/index.php b/application/views/awards/dxcc/index.php index e1dd3c47..54aa3dab 100644 --- a/application/views/awards/dxcc/index.php +++ b/application/views/awards/dxcc/index.php @@ -67,7 +67,7 @@
-
QSL / LoTW
+
QSL Type
input->post('qsl') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> > @@ -77,6 +77,10 @@ input->post('lotw') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
+
+ input->post('eqsl')) echo ' checked="checked"'; ?> > + +
From accf4add5205c27744bbb5adfd9d0ae200c346e5 Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 18 Jan 2023 14:08:56 +0100 Subject: [PATCH 19/31] Implement eQSL and QSL filter for WAS awards --- application/controllers/Awards.php | 9 ++++-- application/models/Was.php | 41 ++++++++++++++++++-------- application/views/awards/was/index.php | 6 +++- 3 files changed, 40 insertions(+), 16 deletions(-) diff --git a/application/controllers/Awards.php b/application/controllers/Awards.php index a9d3da43..3e33e787 100644 --- a/application/controllers/Awards.php +++ b/application/controllers/Awards.php @@ -421,8 +421,9 @@ class Awards extends CI_Controller { $data['bands'] = $bands; // Used for displaying selected band(s) in the table in the view if($this->input->method() === 'post') { - $postdata['lotw'] = $this->input->post('lotw'); $postdata['qsl'] = $this->input->post('qsl'); + $postdata['lotw'] = $this->input->post('lotw'); + $postdata['eqsl'] = $this->input->post('eqsl'); $postdata['worked'] = $this->input->post('worked'); $postdata['confirmed'] = $this->input->post('confirmed'); $postdata['notworked'] = $this->input->post('notworked'); @@ -430,8 +431,9 @@ class Awards extends CI_Controller { $postdata['mode'] = $this->input->post('mode'); } else { // Setting default values at first load of page - $postdata['lotw'] = 1; $postdata['qsl'] = 1; + $postdata['lotw'] = 1; + $postdata['eqsl'] = 0; $postdata['worked'] = 1; $postdata['confirmed'] = 1; $postdata['notworked'] = 1; @@ -615,8 +617,9 @@ class Awards extends CI_Controller { $bands[] = $band_type; - $postdata['lotw'] = 1; $postdata['qsl'] = 1; + $postdata['lotw'] = 1; + $postdata['eqsl'] = 0; $postdata['worked'] = 1; $postdata['confirmed'] = 1; $postdata['notworked'] = 1; diff --git a/application/models/Was.php b/application/models/Was.php index fc3d9f28..34686121 100644 --- a/application/models/Was.php +++ b/application/models/Was.php @@ -19,6 +19,19 @@ class was extends CI_Model { $states = array(); // Used for keeping track of which states that are not worked + $qsl = ""; + if ($postdata['confirmed'] != NULL) { + if ($postdata['qsl'] != NULL ) { + $qsl .= "Q"; + } + if ($postdata['lotw'] != NULL ) { + $qsl .= "L"; + } + if ($postdata['eqsl'] != NULL ) { + $qsl .= "E"; + } + } + foreach ($stateArray as $state) { // Generating array for use in the table $states[$state]['count'] = 0; // Inits each state's count } @@ -32,14 +45,14 @@ class was extends CI_Model { if ($postdata['worked'] != NULL) { $wasBand = $this->getWasWorked($location_list, $band, $postdata); foreach ($wasBand as $line) { - $bandWas[$line->col_state][$band] = ''; + $bandWas[$line->col_state][$band] = ''; $states[$line->col_state]['count']++; } } if ($postdata['confirmed'] != NULL) { $wasBand = $this->getWasConfirmed($location_list, $band, $postdata); foreach ($wasBand as $line) { - $bandWas[$line->col_state][$band] = ''; + $bandWas[$line->col_state][$band] = ''; $states[$line->col_state]['count']++; } } @@ -238,16 +251,20 @@ class was extends CI_Model { function addQslToQuery($postdata) { $sql = ''; - if ($postdata['lotw'] != NULL and $postdata['qsl'] == NULL) { - $sql .= " and col_lotw_qsl_rcvd = 'Y'"; - } - - if ($postdata['qsl'] != NULL and $postdata['lotw'] == NULL) { - $sql .= " and col_qsl_rcvd = 'Y'"; - } - - if ($postdata['qsl'] != NULL && $postdata['lotw'] != NULL) { - $sql .= " and (col_qsl_rcvd = 'Y' or col_lotw_qsl_rcvd = 'Y')"; + $qsl = array(); + if ($postdata['lotw'] != NULL || $postdata['qsl'] != NULL || $postdata['eqsl'] != NULL) { + $sql .= ' and ('; + if ($postdata['qsl'] != NULL) { + array_push($qsl, "col_qsl_rcvd = 'Y'"); + } + if ($postdata['lotw'] != NULL) { + array_push($qsl, "col_lotw_qsl_rcvd = 'Y'"); + } + if ($postdata['eqsl'] != NULL) { + array_push($qsl, "col_eqsl_qsl_rcvd = 'Y'"); + } + $sql .= implode(' or ', $qsl); + $sql .= ')'; } return $sql; } diff --git a/application/views/awards/was/index.php b/application/views/awards/was/index.php index 22e8bb99..410d4190 100644 --- a/application/views/awards/was/index.php +++ b/application/views/awards/was/index.php @@ -24,7 +24,7 @@
-
QSL / LoTW
+
QSL Type
input->post('qsl') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> > @@ -34,6 +34,10 @@ input->post('lotw') || $this->input->method() !== 'post') echo ' checked="checked"'; ?> >
+
+ input->post('eqsl')) echo ' checked="checked"'; ?> > + +
From 3a0ab51d841791490196b8d066c7846057e31cda Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Wed, 18 Jan 2023 16:59:37 +0100 Subject: [PATCH 20/31] [Tweak] Query speedup on dashboard --- application/models/Logbook_model.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 1846f9d9..92739def 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -1175,12 +1175,17 @@ class Logbook_model extends CI_Model { } if ($logbooks_locations_array) { - $this->db->where_in($this->config->item('table_name').'.station_id', $logbooks_locations_array); - $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->order_by("COL_TIME_ON", "desc"); - $this->db->limit($num); - $query = $this->db->get($this->config->item('table_name')); + $location_list = "'".implode("','",$logbooks_locations_array)."'"; + + $sql = "SELECT * FROM ( select * from " . $this->config->item('table_name'). " + WHERE station_id IN(". $location_list .") + order by col_time_on desc + limit " . $num . + ") hrd + JOIN station_profile ON station_profile.station_id = hrd.station_id + LEFT JOIN dxcc_entities ON hrd.col_dxcc = dxcc_entities.adif"; + + $query = $this->db->query($sql); return $query; } else { From d81f6d6283d9fa617879cde016f848cae22877c5 Mon Sep 17 00:00:00 2001 From: slayingripper Date: Wed, 18 Jan 2023 19:10:44 +0000 Subject: [PATCH 21/31] Added Greek translation --- application/language/greek/account_lang.php | 10 ++ .../language/greek/contesting_lang.php | 18 +++ .../language/greek/general_words_lang.php | 127 ++++++++++++++++++ application/language/greek/index.html | 10 ++ application/language/greek/lotw_lang.php | 59 ++++++++ application/language/greek/notes_lang.php | 23 ++++ application/language/greek/qslcard_lang.php | 24 ++++ application/language/greek/qso_lang.php | 34 +++++ 8 files changed, 305 insertions(+) create mode 100644 application/language/greek/account_lang.php create mode 100644 application/language/greek/contesting_lang.php create mode 100644 application/language/greek/general_words_lang.php create mode 100644 application/language/greek/index.html create mode 100644 application/language/greek/lotw_lang.php create mode 100644 application/language/greek/notes_lang.php create mode 100644 application/language/greek/qslcard_lang.php create mode 100644 application/language/greek/qso_lang.php diff --git a/application/language/greek/account_lang.php b/application/language/greek/account_lang.php new file mode 100644 index 00000000..dab6641e --- /dev/null +++ b/application/language/greek/account_lang.php @@ -0,0 +1,10 @@ + + + 403 Forbidden + + + +

Απαγορεύεται η πρόσβαση στον κατάλογο.

+ + + \ No newline at end of file diff --git a/application/language/greek/lotw_lang.php b/application/language/greek/lotw_lang.php new file mode 100644 index 00000000..401cf6b0 --- /dev/null +++ b/application/language/greek/lotw_lang.php @@ -0,0 +1,59 @@ +Download Report, για να επισημάνετε τα QSO ως επιβεβαιώθηκε στο LOTW.'; +$lang['lotw_upload_type_must_be_adi'] = 'Τα αρχεία καταγραφής πρέπει να έχουν τον τύπο αρχείου .adi'; + +$lang['lotw_pull_lotw_data_for_me'] = 'Τραβήξτε δεδομένα LoTW για μένα'; +$lang['lotw_import_missing_qsos_text'] = 'Εισαγάγετε QSO που λείπουν στο αρχείο καταγραφής. Η κλήση και το τετράγωνο πλέγματος θα ελεγχθούν για να βρεθεί το σωστό προφίλ για εισαγωγή του QSO. Εάν δεν βρεθεί, το QSO θα παραλειφθεί.'; + +$lang['lotw_report_download_overview_helptext'] = 'Το Cloudlog θα χρησιμοποιήσει το όνομα χρήστη και τον κωδικό πρόσβασης LoTW που είναι αποθηκευμένα στο προφίλ χρήστη σας για να πραγματοποιήσει λήψη μιας αναφοράς από το LoTW για εσάς. Οι λήψεις αναφοράς Cloudlog θα έχουν όλες τις επιβεβαιώσεις από την επιλεγμένη ημερομηνία ή από την τελευταία επιβεβαίωση LoTW (που ελήφθη από το αρχείο καταγραφής σας), μέχρι τώρα.'; + +// Buttons +$lang['lotw_btn_lotw_import'] = 'Εισαγωγή LoTW'; +$lang['lotw_btn_upload_certificate'] = 'Ανέβασμα Πιστοποιητικού'; +$lang['lotw_btn_delete'] = 'Διαγραφή'; +$lang['lotw_btn_manual_sync'] = 'Χειροκίνητος συγχρονισμός'; +$lang['lotw_btn_upload_file'] = 'Ανέβασμα αρχείου'; +$lang['lotw_btn_import_matches'] = 'Εισαγωγή αντιστοιχιών LoTW'; + +// P12 Export Text +$lang['lotw_p12_export_step_one'] = 'Ανοίξτε το TQSL & μεταβείτε στην καρτέλα Πιστοποιητικά διακριτικού κλήσης'; +$lang['lotw_p12_export_step_two'] = 'Κάντε δεξί κλικ στο διακριτικό κλήσης που θέλετε'; +$lang['lotw_p12_export_step_three'] = 'Κάντε κλικ στην επιλογή "Αποθήκευση αρχείου πιστοποιητικού κλήσης" και μην προσθέσετε κωδικό πρόσβασης'; +$lang['lotw_p12_export_step_four'] = 'Ανεβάστε το αρχείο παρακάτω.'; + +$lang['lotw_confirmed'] = 'Αυτό το QSO επιβεβαιώνεται στο LoTW'; + +// LotW Expiry +$lang['lotw_cert_expiring'] = 'Τουλάχιστον ένα από τα πιστοποιητικά LotW πρόκειται να λήξει!'; +$lang['lotw_cert_expired'] = 'Τουλάχιστον ένα από τα πιστοποιητικά LotW σας έχει λήξει!'; diff --git a/application/language/greek/notes_lang.php b/application/language/greek/notes_lang.php new file mode 100644 index 00000000..06587052 --- /dev/null +++ b/application/language/greek/notes_lang.php @@ -0,0 +1,23 @@ + Date: Thu, 19 Jan 2023 20:14:04 +0100 Subject: [PATCH 22/31] Fix syntax error --- application/models/Logbook_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 92739def..7630caa4 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2990,7 +2990,7 @@ class Logbook_model extends CI_Model { $a = substr($a, 0, -1); # Remove the / at the end } if ($c) { - $c = substr($c, 1,); # Remove the / at the beginning + $c = substr($c, 1); # Remove the / at the beginning }; # In some cases when there is no part A but B and C, and C is longer than 2 From d5e36fd282362bf74da7d523731056c722bfa07b Mon Sep 17 00:00:00 2001 From: Andreas Kristiansen <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 22 Jan 2023 12:55:03 +0100 Subject: [PATCH 23/31] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 82fc1d83..31d76758 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Cloudlog +> Important: Only accepting PRs on the "dev" branch. + Cloudlog is a self-hosted PHP application that allows you to log your amateur radio contacts anywhere. All you need is a web browser and active internet connection. Website: [http://www.cloudlog.co.uk](http://www.cloudlog.co.uk) From 2c40e9acad6b738fa5de8bd4d3df03319828b22d Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 22 Jan 2023 14:04:50 +0100 Subject: [PATCH 24/31] [DXCC id] Tweaked for callsign having several digits after / --- application/models/Logbook_model.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 7630caa4..d3d70e44 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -2857,6 +2857,14 @@ class Logbook_model extends CI_Model { } if (preg_match('/(^KG4)[A-Z09]{3}/', $call)) { // KG4/ and KG4 5 char calls are Guantanamo Bay. If 4 or 6 char, it is USA $call = "K"; + } elseif (preg_match('/(^OH\/)|(\/OH[1-9]?$)/', $call)) { # non-Aland prefix! + $call = "OH"; # make callsign OH = finland + } elseif (preg_match('/(^3D2R)|(^3D2.+\/R)/', $call)) { # seems to be from Rotuma + $call = "3D2/R"; # will match with Rotuma + } elseif (preg_match('/^3D2C/', $call)) { # seems to be from Conway Reef + $call = "3D2/C"; # will match with Conway + } elseif (preg_match('/(^LZ\/)|(\/LZ[1-9]?$)/', $call)) { # LZ/ is LZ0 by DXCC but this is VP8h + $call = "LZ"; } elseif (preg_match('/(^KG4)[A-Z09]{2}/', $call)) { $call = "KG4"; } elseif (preg_match('/(^KG4)[A-Z09]{1}/', $call)) { @@ -2916,6 +2924,14 @@ class Logbook_model extends CI_Model { if (preg_match('/(^KG4)[A-Z09]{3}/', $call)) { // KG4/ and KG4 5 char calls are Guantanamo Bay. If 4 or 6 char, it is USA $call = "K"; + } elseif (preg_match('/(^OH\/)|(\/OH[1-9]?$)/', $call)) { # non-Aland prefix! + $call = "OH"; # make callsign OH = finland + } elseif (preg_match('/(^3D2R)|(^3D2.+\/R)/', $call)) { # seems to be from Rotuma + $call = "3D2/R"; # will match with Rotuma + } elseif (preg_match('/^3D2C/', $call)) { # seems to be from Conway Reef + $call = "3D2/C"; # will match with Conway + } elseif (preg_match('/(^LZ\/)|(\/LZ[1-9]?$)/', $call)) { # LZ/ is LZ0 by DXCC but this is VP8h + $call = "LZ"; } elseif (preg_match('/(^KG4)[A-Z09]{2}/', $call)) { $call = "KG4"; } elseif (preg_match('/(^KG4)[A-Z09]{1}/', $call)) { @@ -3041,7 +3057,7 @@ class Logbook_model extends CI_Model { $prefix = substr($b, 0, 2) . "0"; # first two + 0 } } elseif (($a == null) && (isset($c))) { # Case 2, CALL/X - if (preg_match('/^(\d)$/', $c)) { # Case 2.1, number + if (preg_match('/^(\d)/', $c)) { # Case 2.1, number preg_match('/(.+\d)[A-Z]*/', $b, $matches); # regular Prefix in $1 # Here we need to find out how many digits there are in the # prefix, because for example A45XR/0 is A40. If there are 2 From f37da1aab590a688d62890ed96f3161bd73f794a Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Sun, 22 Jan 2023 15:14:00 +0100 Subject: [PATCH 25/31] [ADIF Parser] If EOH didn't exist, $i was never set. Init on declaration instead. --- application/libraries/Adif_parser.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/application/libraries/Adif_parser.php b/application/libraries/Adif_parser.php index 7368f7c5..06f6fc52 100644 --- a/application/libraries/Adif_parser.php +++ b/application/libraries/Adif_parser.php @@ -21,7 +21,7 @@ class ADIF_Parser var $data; //the adif data var $datasplit; // one entry is one QSO in the array var $currentarray = 0; // current place in the array - var $i; //the iterator + var $i = 0; //the iterator var $headers = array(); public function initialize() //this function locates the @@ -29,6 +29,11 @@ class ADIF_Parser $pos = mb_stripos(mb_strtoupper($this->data, "UTF-8"), "", 0, "UTF-8"); + $in_tag = false; + $tag = ""; + $value_length = ""; + $value = ""; + if($pos == false) //did we find the end of headers? { // Just skip if we did not find (optional) headers @@ -36,14 +41,6 @@ class ADIF_Parser goto noheaders; }; - //get headers - - $this->i = 0; - $in_tag = false; - $tag = ""; - $value_length = ""; - $value = ""; - while($this->i < $pos) { //skip comments From 8d97246830c0edd0a3917a896bc8592b3877c674 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Mon, 23 Jan 2023 10:30:32 +0100 Subject: [PATCH 26/31] Fix for "Check QSOs missing DXCC data" checking all QSOs --- application/models/Logbook_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index d3d70e44..d645b821 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -3143,7 +3143,7 @@ class Logbook_model extends CI_Model { $this->db->select("COL_PRIMARY_KEY, COL_CALL, COL_TIME_ON, COL_TIME_OFF"); // check which to update - records with no dxcc or all records - if (! isset($all)){ + if (!$all){ $this->db->where("COL_DXCC is NULL"); } From 8b36a2f8e961a2f7bc87b1d5a71b8c56a39d1822 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Mon, 23 Jan 2023 11:22:12 +0100 Subject: [PATCH 27/31] [PHP8.1] Fix for strftime() is deprecated when re-checking DXCC --- application/models/Logbook_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index d645b821..1a3efe09 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -3155,7 +3155,7 @@ class Logbook_model extends CI_Model { if ($r->num_rows() > 0){ foreach($r->result_array() as $row){ $qso_date = $row['COL_TIME_OFF']=='' ? $row['COL_TIME_ON'] : $row['COL_TIME_ON']; - $qso_date = strftime("%Y-%m-%d", strtotime($qso_date)); + $qso_date = date("Y-m-d", strtotime($qso_date)); // Manual call $d = $this->check_dxcc_table($row['COL_CALL'], $qso_date); From 333997f9a03fb9d423b7f57807b53be3a62544e7 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Mon, 23 Jan 2023 13:37:49 +0100 Subject: [PATCH 28/31] Fixed date to use COL_TIME_OFF if not blank. Thanks @phl0 --- application/models/Logbook_model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 1a3efe09..f188f455 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -3154,7 +3154,7 @@ class Logbook_model extends CI_Model { //query dxcc_prefixes if ($r->num_rows() > 0){ foreach($r->result_array() as $row){ - $qso_date = $row['COL_TIME_OFF']=='' ? $row['COL_TIME_ON'] : $row['COL_TIME_ON']; + $qso_date = $row['COL_TIME_OFF']=='' ? $row['COL_TIME_ON'] : $row['COL_TIME_OFF']; $qso_date = date("Y-m-d", strtotime($qso_date)); // Manual call From 3cdb2a715552852ecfaa8c44e8600fd03a30b32c Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Tue, 24 Jan 2023 10:52:20 +0100 Subject: [PATCH 29/31] Fixed Missing field "Mark QSL Card Requested" after select "Mark QSL Card Received (Bureau)" --- application/views/view_log/partial/log_ajax.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/view_log/partial/log_ajax.php b/application/views/view_log/partial/log_ajax.php index de3b1d64..9d5af8e0 100644 --- a/application/views/view_log/partial/log_ajax.php +++ b/application/views/view_log/partial/log_ajax.php @@ -229,6 +229,8 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) { lang->line('general_mark_qsl_tx_bureau'); ?> lang->line('general_mark_qsl_tx_direct'); ?> + Mark QSL Card Requested + Mark QSL Card Not Required @@ -237,8 +239,6 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) { lang->line('general_mark_qsl_rx_bureau'); ?> lang->line('general_mark_qsl_rx_direct'); ?> - Mark QSL Card Requested - Mark QSL Card Not Required From 054d557c7882996af72f7e081e3a44a1f2982830 Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Tue, 24 Jan 2023 10:52:58 +0100 Subject: [PATCH 30/31] Moved several javascript functions to common.js to clean footer.php a bit --- application/views/interface_assets/footer.php | 443 +----------------- assets/js/sections/common.js | 434 +++++++++++++++++ 2 files changed, 437 insertions(+), 440 deletions(-) create mode 100644 assets/js/sections/common.js diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index cd96e0e6..50222463 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -14,6 +14,8 @@ + + uri->segment(1) == "map" && $this->uri->segment(2) == "custom") { ?> @@ -1981,269 +1806,7 @@ $(document).ready(function(){