Commit graph

1964 commits

Author SHA1 Message Date
Peter Goodhall
7ba915e29c Add public QSO map to station diary
Add interactive QSO map support for public station diary entries. Controller: add stationdiary::get_qso_map_data() to return JSON map data for a given entry/date range/logbook with station location. Models: Note::get_public_entry_user_id() to resolve the entry owner; Logbook_model: get_qsos_for_public_map() to query QSOs for the map, set a default stn_loc fallback, and skip markers with invalid 0,0 coordinates. View: public_index.php includes Leaflet CSS/JS, a Show/Hide QSO Map toggle, map container per entry, client-side map initialization and marker/popups loaded via POST to the new endpoint. These changes ensure public diary entries can display QSO locations and the station marker while avoiding bogus markers and limiting results to the correct user/logbook context.
2026-03-09 13:50:34 +00:00
Peter Goodhall
d0c4dcd66a Optimize uploaded images: resize/compress to 1080
Update image processing for uploads to improve optimization: set quality to 70%, change master_dim to auto, and target a max dimension of 1080x1080. Add logic to only resize when an image exceeds 1080px on any side while still reprocessing (calling resize) for compression even when dimensions are within limits. Minor formatting/cleanup of image library initialization.
2026-03-09 13:35:07 +00:00
Peter Goodhall
a4d284a0c0 Add reactions to station diary entries
Introduce a reactions feature for public station diary entries. Adds a migration to create station_diary_reactions with indexes and a unique (diary_id, visitor_hash) constraint; bumps migration version to 257 and registers a new route for /entry/:id/react. Controller: implements visitor token/hash creation, a react() endpoint to accept POSTed reactions (like, love, fire), increments/updates reactions, invalidates cache and returns totals and visitor reaction. Model: new methods to get totals, fetch visitor reaction and save/update reactions. View: UI, styles and client-side JS for reaction buttons, counts, and copy/share enhancements; integrates totals and visitor state into the single-entry view.
2026-03-09 13:29:14 +00:00
Peter Goodhall
da4c4201ca Support public QSO datetime format & sharing
Add handling for public QSO datetime formatting and single-entry sharing. Introduce get_public_qso_datetime_format() in Stationdiary controller (defaults and appends time if missing) and pass qso_datetime_format, is_single_entry and current_entry_permalink to the public view. Update Note model to select and return user_date_format from auth table so user preferences flow through. Update public_index view to use the public QSO datetime format for QSO rows and add social share buttons (Facebook, X, Bluesky) when viewing a single entry.
2026-03-09 11:00:21 +00:00
Peter Goodhall
0b07e5ac18 Add public diary entry view and routing
Add support for viewing individual public Station Diary entries. Adds a new route for /station-diary/:callsign/entry/:id, a Stationdiary::entry controller method with caching (per-call sign + entry + cache version, 86400s TTL), and a Note model method get_public_station_diary_entry() that loads images and optional QSO summaries/lists. Update public_index view to link entry titles to their permalink and include entry IDs in article IDs, and update RSS feed to use the entry permalink/guid. Also include small CSS tweaks for entry title links.
2026-03-09 10:57:38 +00:00
Peter Goodhall
07c3527cb6 Render diary images & improve diary cache
Load and render station diary images inline and separately, and make cache handling more robust. Notes controller: load diary_images for print view and invalidate public diary cache when an image caption is updated. Stationdiary controller: include a render-version token in the public diary cache key to force re-renders when markup changes. Note model: make touch_public_diary_cache_version more resilient (unique value, fallback to file_put_contents and cache clean), add invalidate_public_diary_cache_for_note helper, and enhance process_image_shortcodes to handle encoded brackets, tolerant shortcode spacing, modifiers (alignment and size) with deterministic styling, and return used image ids. Views: update station_diary_print and note view to process shortcodes, remove empty paragraph artifacts, show inline images via shortcodes, and display remaining images with captions and improved print CSS.
2026-03-08 15:11:33 +00:00
Peter Goodhall
f8dffa8776 Add image shortcodes and caption editing
Support inline diary images via shortcodes and improve notes UI. Introduces a Note::process_image_shortcodes() method (ID/caption lookup and modifiers like left/right/center/small/medium/large), and updates station diary rendering to process shortcodes and avoid duplicate image output. Adds an AJAX endpoint notes/update_image_caption with ownership checks to save image captions, plus client-side JS to edit/save captions from the note edit view. Refactors notes add/edit views: reorganized form into sections/accordion, Quill editor min-height, image upload tips, improved buttons and layout, and QSO summary layout tweaks.
2026-03-08 14:36:56 +00:00
Peter Goodhall
50c24aede1 Add public station diary & QSO filters
Introduce Public Station Diary feature and QSO filtering support.

- Add migrations: 255 adds public_station_diary_enabled option (default enabled), 256 adds qso_date_start, qso_date_end, qso_satellite_only columns to notes.
- Bump migration version to 256.
- Add controller actions (Options::public_diary, public_diary_save) and new options view to manage the public diary setting; add sidebar link.
- Extend Note model to persist QSO filter fields and provide new methods to fetch QSO lists/summaries for date ranges and satellite-only filtering; wire filter usage into summary generation.
- Update notes add/edit views to include QSO Summary Filters (date range + satellite-only).
- Add translations for the new options keys across multiple language files.
- Update public station diary listing view styling/path and minor content cleanup; other views updated to support feature.
- Remove obsolete cache files (.htaccess, index.html).

These changes enable admins to toggle a public station diary and let note authors control which QSOs are included in summaries via date ranges and SAT-only filtering.
2026-03-08 13:34:31 +00:00
Peter Goodhall
babcdf87d1 Add RSS feed_url and update fonts/styles
Controller: pass a 'feed_url' value into the RSS view (site_url for the feed). RSS view: compute the current request URL (respecting HTTPS) and use it for the atom:link self href. Public view: load Google Fonts (Merriweather & Lora), add preconnect hints, switch typography to the new fonts, increase line-height and adjust font-weights/sizes for headings and body to improve readability.
2026-03-08 12:07:51 +00:00
Peter Goodhall
5d034d0963 Add public Station Diary with images & RSS
Introduce public Station Diary functionality: add global config flag, routes, controller, model changes, views and DB migrations. New migrations (252-254) add is_public/include_qso_summary, diary_images table and logbook_id on notes. Notes model updated to handle public flags, diary images, qso summaries, caching (per-user cache version), and helper methods for listing/counting public diary entries. New Stationdiary controller serves paginated public pages and RSS feed with caching. Notes controller updated to handle image uploads, attach images to diary entries, and provide an AJAX endpoint to delete images. Views updated to support public visibility options, logbook selector, image upload UI and Quill editor assets; routes and migration version bumped accordingly. Includes file upload example added to uploads/diary.
2026-03-08 11:42:41 +00:00
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
680612ca01 Add Station Diary print view & action
Add a Station Diary print feature: controller Notes.php now sets a has_diary_entries flag for the main notes view and adds a station_diary() action that loads Station Diary entries and renders a print-friendly view. The notes main view conditionally shows a "Station Diary" button that opens the print page in a new tab. A new view notes/station_diary_print.php provides a print-optimized layout, entry listing with date/time handling, total entries summary, a print button, and a friendly fallback when no entries are found.
2026-02-12 22:30:08 +00:00
Peter Goodhall
a4ec01a8ea Add Station Diary modal and quick_add endpoint
Introduce a Station Diary UI and backend endpoint to allow quick note creation via HTMX. Added Notes::quick_add in the controller with form validation, note creation, success/error responses and a small JS form reset. Updated view_log/index to show a Station Diary button (when user_show_notes=1) and include the modal form that posts to notes/quick_add and renders messages into the modal.
2026-02-12 22:08:55 +00:00
Peter Goodhall
41a8849d7e Cache dashboard stats and add DB indexes
Add per-user/logbook file caching for dashboard statistics (15min TTL) and update Dashboard controller to use cached qso, countries, VUCC and QSL queries. Introduce clear_dashboard_cache() in Logbook_model and call it on QSO create/update/delete to invalidate affected users' cache entries. Add migration (249) to create composite indexes (idx_dxcc_stats, idx_vucc_gridsquare, idx_vucc_grids) to improve dashboard query performance, and bump migration_version to 249. Also include generated cache files under application/cache for current stats.
2026-02-11 13:18:52 +00:00
Peter Goodhall
d4a7e4cfac Batch eQSL updates and add indexes
Add batch processing for eQSL imports/exports and introduce performance indexes. Bump migration_version to 248 and add Migration_add_eqsl_performance_indexes to create idx_eqsl_qslrdate and idx_eqsl_confirmation_match indexes to speed up eQSL queries and batch matching. Modify Eqsl controller to collect successful uploads and perform a single batch mark-as-sent update. Update EqslImporter to queue confirmations and run a single batch update at the end. Implement eqsl_update_batch() and eqsl_mark_sent_batch() in Eqslmethods_model to perform efficient batch DB operations and logging, reducing per-record queries for large eQSL operations.
2026-02-11 11:32:25 +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
f01599e6a5 Add indexes and batch processing for uploads
Improve query performance and memory usage by adding a migration to create several indexes and converting various upload/reporting flows to batched processing. Changes include:

- Add migration 245 to create indexes: idx_mode, idx_sat_name, idx_continent, idx_qsl_stats (composite), idx_hrdlog_upload, idx_qrz_upload to speed common queries.
- Bump migration version to 245 in config.
- Hrdlog and Qrz controllers: switch to fetching QSOs in LIMIT/OFFSET batches, process updates in chunks, add logging for batch progress, and use break 2 to stop outer loops on invalid API keys to avoid continuing work.
- Logbook_model:
  - get_hrdlog_qsos and get_qrz_qsos now accept limit/offset and use ORDER BY/LIMIT/OFFSET for batching.
  - Replaced a subquery with a JOIN for grid-based filtering to improve performance.
  - get_modes rewritten to use query builder (distinct/select/order_by).
  - Bulk DXCC updates use update_batch instead of per-row queries.
  - calls_without_station_id limited to 500 results to avoid UI hangs.

Overall goal: prevent memory exhaustion with large datasets and improve database query performance.
2026-02-11 10:59:24 +00:00
Peter Goodhall
c556a42892 Add advanced filtering and stats to WWFF awards page
Enhanced the WWFF awards page with band, mode, and QSL type filters, quick preset buttons, and a summary section showing worked/confirmed parks and milestone progress. Updated the controller to handle filter input and summary data, and extended the model with methods for filtered queries and statistics.
2026-01-21 17:36:18 +00:00
Peter Goodhall
0e7a2ccd39 Add CSV export for SIG QSOs
Introduced a new controller method sigexportcsv() to export SIG QSO data as a CSV file. Added a corresponding button in the SIG QSO list view to allow users to download the CSV export.
2026-01-21 17:19:48 +00:00
Peter Goodhall
2d9c4182d2 Add SIG award filters and translations
Introduces filtering by band, mode, and confirmation status to the SIG awards section in Awards.php, including a filter summary helper. Updates all supported language files to add translations for the new SIG award filters, table headers, and related UI elements.
2026-01-21 17:15:01 +00:00
Peter Goodhall
2a2f62ccbc Add filtering and localization to WAB award view
Introduces band, mode, and confirmed-only filters to the Worked All Britain (WAB) award view and details AJAX endpoint. Updates the controller, model, and view logic to support filtering, and adds new localized strings for WAB award UI elements in multiple languages. Also ensures the correct script is loaded for the WAB section and improves the Bands model to check for field existence before filtering by award.
2026-01-21 16:54:24 +00:00
Peter Goodhall
65a7170bbc Add Docker environment detection to debug page
Introduces logic in the Debug controller to detect if the application is running inside a Docker container and displays the result on the debug view. This helps developers quickly identify the runtime environment for troubleshooting and configuration purposes.
2026-01-15 15:40:34 +00:00
Peter Goodhall
3fdeee9dc6 Add ZIP extension check to backup page
The backup controller now checks if the PHP ZIP extension is installed and passes this information to the view. The backup page displays a warning if the extension is missing, guiding users to install it for backup and restore functionality.
2026-01-15 15:26:15 +00:00
Peter Goodhall
3d32a36036 Stream JSON export for large user backups
Refactored the backup export process to stream JSON data directly to a file handle, significantly reducing memory usage for large datasets. QSOs and logbooks are now written in chunks, and memory is freed periodically. Increased max execution time and adjusted memory limit to optimize for streaming. This improves reliability and scalability for users with large logbooks.
2026-01-15 10:35:50 +00:00
Peter Goodhall
897ba50c0e Add UI for manual data file updates in maintenance
Introduces a new section in the maintenance page allowing manual updates of reference data files (Clublog SCP, LoTW Users, DOK, SOTA, WWFF, POTA) via AJAX buttons with loading indicators. Adds corresponding UI-friendly controller methods with authorization checks and improves the WWFF update logic to process CSV files line by line for better memory efficiency.
2026-01-14 14:55:07 +00:00
Peter Goodhall
8b819d2177 Refactor and enhance SOTA awards support
Replaces the old SOTA model with a new Sota_model, adds CSV-based summit metadata caching, and introduces new controller endpoints and view components for SOTA table, stats, and map fragments. The SOTA award page now supports filtering, improved statistics, and interactive mapping using summit coordinates. Updates .gitignore to include the new SOTA CSV, and refactors SOTA data refresh logic for reliability and maintainability.
2026-01-13 13:35:11 +00:00
Peter Goodhall
2f917c8bcf Add advanced POTA awards dashboard with filtering and map
Introduces a new POTA awards dashboard with HTMX-powered filtering, statistics, progress bars, and a Leaflet map of worked parks. Adds new controller endpoints, model methods for filtered queries and park metadata, and modular view components for table, stats, progress, and map. Updates language files for new stats labels and enhances the update process to cache the full POTA parks CSV for richer features.
2026-01-10 15:08:22 +00:00
Peter Goodhall
ae97ef5152 Add created_at to notes and enable date filtering
Introduces a migration to add a created_at timestamp to the notes table. Updates the Note model and Notes controller to support filtering notes by creation date, and enhances the notes view to include date filter fields and display the created date for each note. Migration version is incremented to 242.
2026-01-09 16:13:57 +00:00
Peter Goodhall
5c5bdf2f2f Add categories and management to notes feature
Introduces note categories with support for filtering, assigning, and managing categories. Adds category selection and creation to add/edit forms, category filtering to the notes list, and modals for deleting/merging categories and confirming note deletion. Updates controller and model logic to handle categories, and improves UI for notes management.
2026-01-09 13:17:56 +00:00
Peter Goodhall
e6aeee53a1 Add reusable User-Agent helper for QRZ API requests
Introduced a useragent_helper with a function to generate a compliant User-Agent string for Cloudlog, and updated QRZ API calls in Qrz controller and Logbook_model to use this helper. This ensures consistent and QRZ-compliant User-Agent headers for all outgoing requests.
2026-01-09 10:52:37 +00:00
Peter Goodhall
f4d4fac839 Optimize continent QSOs query in Awards controller
Refactored get_continent_qsos to use a single SQL query for fetching DXCC entities and their worked/confirmed status, replacing multiple per-entity queries. This improves performance and simplifies the code.
2026-01-07 10:50:49 +00:00
Peter Goodhall
1e7eb7d429 Enhance country count filtering in statistics
Updated get_total_countries to filter by active station's locations and apply additional validation filters for country and DXCC fields, aligning logic with Dashboard validation.
2026-01-06 22:37:36 +00:00
Peter Goodhall
d597e2e83b Add DXCC statistics and continent breakdown
Introduces DXCC statistics and continent breakdown features to the awards page, including new controller endpoints for DXCC QSOs, QSOs by status, and continent QSOs. Updates the DXCC model to provide continent and milestone statistics, and enhances the awards view with summary cards, continent progress, table search, sorting, and modal dialogs for QSO details.
2026-01-06 22:34:05 +00:00
Peter Goodhall
e572821b96 Add Personal Propagation Advisor feature
Introduces the Personal Propagation Advisor, allowing users to analyze their own QSO data to determine the best times, bands, and modes for working specific DXCC entities. Adds a new controller, model methods, view, JavaScript, and language strings in multiple languages. Updates navigation and footer to support the new feature.
2026-01-05 22:14:00 +00:00
Peter Goodhall
b368cba876 Enforce write permissions for QSO modifications
Replaced checks for QSO accessibility with stricter write permission checks across controllers and models. Added a new check_qso_is_writable method to Logbook_model to ensure only authorized users can modify or delete QSOs, including shared logbook scenarios. Updated QSO, Qsl_model, and Sstv_model to use the new permission logic for all write operations.
2025-12-23 11:06:19 +00:00
Peter Goodhall
d9e0fe0900 Improve QSO access checks and error handling
Enhanced the QSO access logic to allow access if the QSO belongs to the user or is part of a user's active logbook, including shared permissions. Added a guard in the controller to prevent accessing missing or inaccessible QSOs, redirecting with a notice if access is denied.
2025-12-20 22:03:12 +00:00
Peter Goodhall
3d77c3d4a0 Revert "Handle missing or inaccessible QSO in logbook view"
This reverts commit 3c2d8461cb.
2025-12-20 21:56:30 +00:00
Peter Goodhall
1583590ecf Improve logbook ownership checks and permissions
Updated Logbooks controller to use profile_clean for station lookup and added a notice for missing stations. Enhanced Setup_model to count logbooks a user owns or has permissions for, ensuring accurate logbook statistics for users with shared access.

Fixes #3389
2025-12-20 21:50:21 +00:00
Peter Goodhall
1aeec6e72d Handle missing station_callsign in QRZ import
Added a check and error log for missing station_callsign during QRZ import. This helps identify records with incomplete data and prevents potential issues when processing QSOs.
2025-12-20 11:25:58 +00:00
Peter Goodhall
e78dedc70e Add checks for entity name in DXCC lookup
Wrapped assignments of 'dxcc_name' with checks to ensure the entity is an array and contains a 'name' key. This prevents potential errors if the entity lookup fails or returns unexpected data.
2025-12-20 11:14:31 +00:00
Peter Goodhall
3c2d8461cb Handle missing or inaccessible QSO in logbook view
Adds a check to ensure that if a QSO is not found or not accessible, the user is redirected to the dashboard with a notice. This prevents errors when attempting to access non-existent or unauthorized QSOs.
2025-12-20 11:10:52 +00:00
Peter Goodhall
429d23fef4 Fix undefined index error for DXCC entity name
Added a check to ensure the DXCC entity is an array and contains a 'name' key before assigning 'dxcc_name' to prevent undefined index errors.
2025-12-18 17:39:42 +00:00
Peter Goodhall
c88c2435bf Remove custom date filter from QRZ data download
Simplifies the QRZ data download process by removing the custom date selection logic. Now, all QRZ data is downloaded regardless of the date specified in the request.
2025-12-09 21:38:49 +00:00
Peter Goodhall
2bd503cdcd Add support for managed email configuration
Introduces logic to detect and enforce centrally managed email settings. When managed, email options are displayed as read-only and cannot be changed by users; attempts to save changes are blocked with a notice. The email options view now conditionally renders a read-only summary and test email form if management is enabled.
2025-12-09 16:09:15 +00:00
Peter Goodhall
9fe5b808a5 Deduplicate LoTW users by callsign during import
Changed the import logic to deduplicate LoTW users by callsign, keeping only the latest timestamp for each callsign. Updated batch insertion to process only unique callsigns and improved reporting to show both total records read and unique callsigns inserted.
2025-12-02 22:58:56 +00:00
Peter Goodhall
0848a9b4c0 Add open registration and public signup feature
Introduces open registration settings in the options area, allowing administrators to enable or disable public user signup. Adds a registration options page, updates sidebar navigation, and implements a public signup form and controller logic. Also refines user model to ensure correct data types for user fields and updates language strings for registration. The login page now links to signup when open registration is enabled.
2025-12-02 18:10:37 +00:00