Commit graph

168 commits

Author SHA1 Message Date
Peter Goodhall
88e95b0db9 Add HTMX modal upload and cert table refresh
Enable HTMX-driven certificate uploads and partial UI updates for LoTW. Updated Lotw controller to detect HTMX requests in do_cert_upload, return inline success/error alerts for modal uploads, and added cert_table_refresh endpoint to return the cert table partial. Extracted the certificate table into a new view (lotw_views/cert_table.php) and replaced the inline table in index.php with a container that loads that partial. Added a Bootstrap modal view (upload_cert_modal.php) with an HTMX multipart form, drag-and-drop file UI, JS handlers to manage upload state and refresh the certificate list, and modal reset behavior. Minor refactors to flash/success handling to support both full-page and HTMX flows.
2026-02-18 15:51:19 +00:00
Peter Goodhall
f26c112437 Report found vs updated LoTW QSOs
Initialize and increment a $found_count while parsing ADIF records when import_check returns 'Found', then after batch update compute already-confirmed QSOs and expand the LoTW status message to include: Found, Updated, Already confirmed, and Gridsquares updated. Uses max(0, ...) to avoid negative already-confirmed values and updates the log output accordingly.
2026-02-17 15:35:06 +00:00
Peter Goodhall
9338ca4769 Include LoTW status in table HTML
Append the LoTW status div to the $table variable before assigning it to $data['lotw_table'], rather than concatenating it afterward. This ensures the status is part of the table HTML output and avoids the separate post-assignment append.
2026-02-17 15:33:41 +00:00
Peter Goodhall
a94a8759e0 Remove LoTW Status column; add status summary
Remove the per-row "LoTW Status" header and cells from the Lotw table output to avoid repeating the same status for each QSO. Instead, append a single "LoTW Status" summary div after the table using $lotw_status. This simplifies the table layout and centralizes the LoTW status display.
2026-02-17 15:30:53 +00:00
Peter Goodhall
ad81bd81de Support batch updates by primary key
Allow LoTW batch updates to reference QSOs by COL_PRIMARY_KEY for reliable matching. Controller: include 'primary_key' in batch update payloads. Model: collect numeric primary keys, expand WHERE to include COL_PRIMARY_KEY IN (...) alongside the existing datetime/call/band/station match, add early exit/log when no usable keys provided, and build an id-based lookup (qso_map_by_id) to prefer primary-key matches while remaining backward-compatible with the composite key lookup. This reduces ambiguous matches and improves update accuracy.
2026-02-17 15:28:53 +00:00
Peter Goodhall
cfa24d9f1a Add LoTW batch updates and performance indexes
Bump migration version to 247 and add a migration that creates performance indexes for LoTW workflows (idx_lotw_qslrdate, idx_lotw_qsos_to_upload, idx_lotw_confirmation_match) to speed common queries. Refactor Lotw controller to collect records in memory, build rows for rendering, and perform a single batch confirmation update via a new Logbook_model::lotw_update_batch() method instead of many individual updates. Implement lotw_update_batch() to look up matching QSOs, perform update_batch() calls, and separately update gridsquares/distances using the Qra library. Simplify LotwCert::toggle_archive_certificate() to toggle archived state with a single UPDATE and return the resulting status.
2026-02-11 11:14:59 +00:00
Peter Goodhall
3390d80cd2 Add retry logic to LoTW cURL download
Introduces a retry mechanism with exponential backoff for the cURL request in the LoTW controller. This improves reliability by attempting the download up to three times before failing, and logs each retry attempt for better debugging.
2025-10-13 22:07:00 +01:00
Peter Goodhall
8db65e7b6f Improve LoTW download with cURL and better encoding
Replaces file_get_contents with cURL for downloading LoTW data to provide better error handling and logging. Switches to rawurlencode for credentials to prevent encoding issues. Adds debug and error logs for easier troubleshooting and checks HTTP response codes and file write success.
2025-10-13 16:46:53 +01:00
Peter Goodhall
ad80e94bd3 Optimize LoTW upload with batch QSO updates
Replaces individual QSO update queries with a new mark_lotw_sent_batch() method in Logbook_model for improved performance during LoTW uploads. Updates Lotw controller to use batch updates within a transaction, reducing database load and increasing efficiency for large QSO uploads.
2025-10-11 15:17:51 +01:00
Peter Goodhall
76f002b214 Revert "Add debug output and refactor queries for LoTW and logbook"
This reverts commit 4cad75be43.
2025-10-11 00:11:46 +01:00
Peter Goodhall
dbb058f198 Revert "Add error handling and verbose logging to LoTW controller"
This reverts commit 7a7b142ee8.
2025-10-11 00:11:38 +01:00
Peter Goodhall
7a7b142ee8 Add error handling and verbose logging to LoTW controller
Wrapped key operations in try-catch blocks to improve error handling and provide detailed error messages during LoTW certificate, QSO, and report file processing. Added verbose logging throughout the process to aid in debugging and monitoring, including status updates for each station profile and user.
2025-10-11 00:09:11 +01:00
Peter Goodhall
4cad75be43 Add debug output and refactor queries for LoTW and logbook
Added extensive debug output and error handling to LoTW upload and download processes for easier troubleshooting. Refactored SQL queries in Logbook_model and Logbookadvanced_model to simplify and optimize data retrieval, replacing subqueries with more direct joins and query builder usage. Removed migration 217_add_performance_indexes.php.
2025-10-11 00:08:03 +01:00
Peter Goodhall
67a652bce6 Add archive status for LoTW certificates
Introduces an 'archived' boolean column to the lotw_certs table via migration, adds model and controller logic to toggle archive status, and updates the view to display and allow archiving/unarchiving of certificates. This enables users to mark LoTW certificates as archived for better management.
2025-08-22 17:15:51 +01:00
Peter Goodhall
b3eaa6d1cb Normalize submode returns to parent mode
Updated the mapping logic for several digital modes to return the parent mode name instead of the specific submode. This change ensures consistency in mode reporting and simplifies downstream processing.
2025-08-02 13:04:39 +01:00
Peter Goodhall
670d068243 Fix mode mapping for RTTY and CW submodes
Corrects the returned mode for RTTY/ASCI and CW/PCW submodes to consistently return 'RTTY' and 'CW' respectively, ensuring accurate mode representation.
2025-08-02 12:01:38 +01:00
Peter Goodhall
7d47bd08a9 Return 'SSB' for LSB and USB submodes in Lotw
Updated the Lotw controller to return 'SSB' instead of 'LSB' or 'USB' when the submode is LSB or USB. This change ensures consistent handling of SSB submodes.
2025-08-02 11:57:56 +01:00
Peter Goodhall
c3c1f1e325 Add migration to set TEVEL2-3 QSL sent status to N
Added migration 202 to update COL_LOTW_QSL_SENT to 'N' for TEVEL2-3 satellite records. Updated migration version in config and added TEVEL2-3 to the satellite name mapping in Lotw controller.
2025-07-30 10:26:16 +01:00
Peter Goodhall
f951018ed1 Expand mode and submode mapping in Lotw controller
Added comprehensive handling for various digital modes and submodes in the Lotw controller, including detailed mappings for JT65, JT4, JT9, QRA64, ISCAT, OLIVIA, OPERA, ROS, HELL, DOMINO, CHIP, PAC, PAX, TOR, THRB, SSB, RTTY, CW, CLO, and V4. This improves the accuracy of mode translation and ensures better compatibility with a wider range of digital communication formats.
2025-07-29 16:01:57 +01:00
Peter Goodhall
23f1017433 Fix LOTW upload response string match
Removed extra space in the LOTW upload response string to correctly detect successful uploads.
2025-07-17 16:50:39 +01:00
Peter Goodhall
21df52575f Update AO-123 settings for LoTW 2024-12-07 10:59:40 +00:00
Peter Goodhall
7fdf83cc36 Set MO-122 and SONATE to upload to LoTW 2024-10-24 13:45:15 +01:00
Peter Goodhall
24f59af0d1 Update Lotw.php 2024-05-15 22:36:37 +01:00
Peter Goodhall
16b2e65137 Add extra error 2024-05-15 22:36:07 +01:00
Peter Goodhall
9a87ecfc80 [Lotw] remap NL to NF 2024-05-14 18:10:43 +01:00
phl0
d50ff03215
Remove deprecated way of creating upload files 2024-05-13 16:39:59 +02:00
phl0
a2504882be
Strip full path from upload filename 2024-05-13 16:39:31 +02:00
phl0
2e3d3e33f3
OpenSSL signatures need a newline after base64 string 2024-05-13 16:38:30 +02:00
phl0
8e668a930c
Check file/dir permissions prior to LoTW download 2023-12-10 22:27:20 +01:00
phl0
ece853a289
Fix re-appending to LoTW download URL in loop 2023-11-30 13:15:36 +01:00
phl0
a8be9179c3
Fix some issues in LoTW controller 2023-11-30 12:26:31 +01:00
HB9HIL
ac0e3b7bc3
Merge branch 'dev' into bootstrap_5 2023-11-25 10:50:50 +01:00
phl0
ea27403ea6
Allow to select the callsign to download LoTW cnfms for 2023-11-24 16:15:01 +01:00
phl0
452c0dfdaa
Refactor LoTW imports 2023-11-24 13:49:30 +01:00
Andreas
e5f0eb03e8 Fixed variable typo in LoTW 2023-11-24 13:08:40 +01:00
HB9HIL
df64ba4ec1 datetimepicker to html5 2023-11-19 13:42:56 +01:00
Peter Goodhall
37f267a91f [LoTW] Remap INSPIRE-SAT 7 to INSPR7 for LOTW uploads 2023-11-01 15:57:25 +00:00
phl0
318fc29449
Use LoTW as official abbreviation 2023-07-27 09:16:55 +02:00
Peter Goodhall
9a02e81544
Merge pull request #2280 from int2001/lotw_per_user
Lotw per user / fixes lotw-download
2023-07-13 11:16:01 +01:00
int2001
2fb8c2ae00 removed debug-outputs 2023-07-13 07:57:50 +00:00
int2001
6303d90c1c Fixes abortion of lotw_download loop caused by returns 2023-07-13 07:13:56 +00:00
int2001
007488f7a7 pass user_id (if exists) to lotw_download 2023-07-13 06:29:04 +00:00
int2001
c5aff95975 Sync LotW per User when using GUI, otherwise complete (cron) 2023-07-12 15:56:12 +00:00
phl0
fb7c448b58
Also use VUCC_GRIDS from LoTW cnfm to update QSO record 2023-07-12 17:30:15 +02:00
phl0
7831790026
Handle not found QSO records correctly 2023-07-12 11:15:14 +02:00
phl0
5c59e9eddc
Remove code to auto-create QSOs upon LoTW matches 2023-07-12 10:48:22 +02:00
phl0
4ef2237ba4
Base LoTW matches on time and station_callsign 2023-07-12 10:05:26 +02:00
Peter Goodhall
f070964f3b Update Lotw.php 2023-07-08 14:30:11 +01:00
Peter Goodhall
7b88764d8b Update Lotw.php 2023-07-08 14:28:33 +01:00
int2001
723e575af3 Add HRDLog to Cloudlog 2023-07-07 11:33:15 +00:00