Commit graph

138 commits

Author SHA1 Message Date
Peter Goodhall
9047a8d799 Respect profile image preference in QSO panel
Adds a `qso_show_profile_image` JS flag from the user session and updates callbook panel rendering to honor it. The panel now omits the image column when profile images are disabled, keeps the empty-image message only when images are enabled, and applies a single-column layout class for no-image states.
2026-07-17 18:44:42 +01:00
Peter Goodhall
ffa9d5017e Consolidate callbook display into tab interface
Refactored the callsign profile display from a separate hidden card to an integrated tab-based interface. The new callbook tab includes a responsive grid layout with profile image, external links (QRZ and HamQTH), and metadata fields (name, QTH, locator, IOTA). Added proper HTML escaping for security and improved visual organization with Bootstrap 5 styling.
2026-07-11 16:55:34 +01:00
Peter Goodhall
a0f953dfa8 Add CAT cache and satellite lookup helper
Introduce window.cloudlogLastCatData and window.cloudlogLastCatRadioId to cache the last CAT response and radio ID, set on successful CAT poll and cleared on UI reset. Add isSatelliteLookupContext() in qso.js to centralize logic for detecting satellite lookup context using UI fields or the cached CAT data, and replace scattered sat_name checks with this helper. This makes satellite lookups more reliable when CAT populates fields and avoids duplicated logic across handlers.
2026-06-23 11:35:51 +01:00
Peter Goodhall
5f72af8338 Prefer selected radio CAT over sat defaults
Detect a selected radio and avoid reapplying saved satellite defaults when CAT is in use. Adds checks for a non-zero selected radio, skips restoring sat_name/sat_mode when a radio is selected, clears sat fields and their stored catValue, and triggers a radios change to resync CAT state. Also updates reset-on-escape behavior to preserve/clear satellite fields appropriately to prevent stale values from being restored.
2026-05-29 17:42:30 +01:00
Peter Goodhall
ab219e8cb4 Prevent duplicate Escape handling and fix SAT reset
Avoid double-processing of the Escape key by setting a timestamp (window.cloudlogQsoEscHandledAt) when handling the QSO-escape keydown and short-circuiting subsequent handlers within 500ms. Also broaden the SAT field restore logic in resetQsoEntryOnEscape to restore sat_name/sat_mode when preSatMode exists or when the previous propagation mode was SAT (not just when preSatName is present). These changes prevent accidental duplicate resets and ensure SAT fields are correctly restored.
2026-05-28 22:19:53 +01:00
Peter Goodhall
9894c627db Retry radio sync after saving QSO
After reapplying post-save defaults, schedule a second call to syncFromSelectedRadioAfterReset (250ms delay) in addition to the immediate call. This helps ensure the selected radio state is correctly propagated and avoids timing/race issues with UI or async updates after saving a QSO.
2026-05-28 22:16:42 +01:00
Peter Goodhall
9057e13fc2 Sync radio after post-save reset
Call syncFromSelectedRadioAfterReset() after reapplyPostSaveDefaults() in assets/js/sections/qso.js so the radio state is re-synchronized following a QSO save/reset. This prevents stale UI values and ensures fields reflect the currently selected radio after saving.
2026-05-28 22:16:07 +01:00
Peter Goodhall
c610e1e378 Preserve satellite fields & save radio default
Prevent CAT polling from overwriting user-entered satellite fields by introducing lockSatelliteFieldsToUserInput and only updating #sat_name, #sat_mode and propagation when not locked. Clear stale sat fields if CAT returns empty values. Reset the lock on radio changes and when UI is reset, and set the lock dynamically on user input (or when propagation is SAT).

Also persist the selected radio as a post-save default: include radio in postSaveDefaults, restore it in reapplyPostSaveDefaults (update selects and localStorage), and trigger sat_name input after restore so the locking logic reacts to restored satellite fields.
2026-05-27 22:04:14 +01:00
Peter Goodhall
c02e0d7a1f Persist qso start_date in post-save defaults
Capture the QSO start_date when a record is saved and include it in postSaveDefaults so it can be reapplied. Added retrieval of start_date from #qso_input on save and updated reapplyPostSaveDefaults to set the start_date input when provided, preserving the user's selected start date after save.
2026-05-25 14:16:26 +01:00
Peter Goodhall
244d4c235e Use innerHTML swap for #qso-last-table
Change htmx.ajax swap option from 'outerHTML' to 'innerHTML' when updating the #qso-last-table. This ensures only the container's contents are replaced (preserving the container element and any bindings/listeners) and avoids DOM reattachment issues.
2026-04-13 14:49:25 +01:00
Peter Goodhall
16e47ac92b Preserve DXCC badge when resetting QSO fields
Add an optional preserveDxccState parameter to resetDefaultQSOFields to keep DXCC-related UI state (country, callsign_info text/title/class, dxcc_id, CQ zone, ITU zone) when requested, preventing badge/country flicker. Update the callsign focusout flow to use this option. Also remove unnecessary .trigger('change') calls on dxcc_id assignments to avoid redundant change events and adjust field clearing/restoration order accordingly.
2026-04-13 14:12:16 +01:00
Peter Goodhall
9913eb08a2 Improve callsign lookup, caching & recent details
Add a cached DXCC lookup and a jsondxcc endpoint to speed up country resolution and reduce DB load (file-cache with 1h TTL). Introduce cached_dxcc_lookup(), build_confirmation_where(), and callsign_status() in the Logbook controller; refactor confirmed_grid_before() and worked_grid_before() to accept logbook relationships and confirmation prefs to avoid redundant queries. Use a new Logbook_model::get_recent_callsign_details() to populate recent name/gridsquare/qth/iota/qsl/state/county values in a single query. Update JS to better manage lookup state, invalidate in-flight requests, and perform a debounced quick DXCC lookup to improve UX. Tweak previous-contacts pagination to a compact sliding window and remove a redundant UI note.
2026-04-13 13:57:03 +01:00
Peter Goodhall
c7b0a75055 Pause auto-refresh during callsign lookup
Prevent the logbook auto-refresh from overwriting callsign lookup results by introducing a previousContactsLookupMode flag and pauseAutoRefresh()/resumeAutoRefresh() helpers that remove/restore the htmx hx-trigger on the qso list element. Clear and hide partial_view on reset and resume auto-refresh there. Show an explicit "no past QSOs" info message when a callsign is found but has no previous QSOs, and ensure the previous-contacts panel state is set deterministically. Also harden CAT radioID checking to treat undefined and falsy values as invalid. Changes touch qso.js and the footer view.
2026-04-13 13:36:45 +01:00
Peter Goodhall
9e18606812 Safely handle partial lookup and toggle panel
Treat lookup.partial defensively (ensure it's a string) before injecting into #partial_view, and determine whether to show previous-contacts panel based on trimmed content instead of always enabling it. Clear #partial_view when hiding the panel to avoid stale content, and simplify the htmx init check to rely on the presence of content rather than visibility. These changes prevent accidental HTML insertion and make panel toggling deterministic.
2026-04-10 22:12:59 +01:00
Peter Goodhall
12f20780dc Hide empty partial view and load DXX summary
Hide the #partial_view container by default and only reveal the previous-contacts panel when it contains non-empty HTML. Invoke getDxccResult after injecting the partial result so the DXX summary is fetched and displayed. Add handling to reset QSO fields and switch back to the Previous Contacts tab when the callsign is cleared, and remove duplicated/unused code in the callsign focusout handler. This prevents showing an empty lookup panel and cleans up the logic around loading lookup details.
2026-04-10 14:00:55 +01:00
Peter Goodhall
79084da3cd Show QSP tab and clear additional fields
After saving a QSO, switch to the QSP tab if present (using bootstrap.Tab.show()). Enhance reset_fields() to clear wwff and pota info (HTML and title) and safely clear the sota_ref Selectize control (if initialized) instead of using .val(""), preventing leftover values/tooltips and avoiding errors when Selectize isn't present.
2026-04-10 11:23:54 +01:00
Peter Goodhall
fc6e0a7a8b Manage previous contacts panel visibility
Add setPreviousContactsPanelState(showLookupDetails) to centralize show/hide logic for #qso-last-table, its trailing <small>, and #partial_view. Replace inline show/hide calls with this helper, update resetToPreviousContactsTab to use it, and add an htmx:afterSwap listener to reapply the visibility state after HTMX updates the previous contacts markup. This ensures the lookup details and default previous-contacts table remain consistent across dynamic updates.
2026-04-08 16:06:03 +01:00
Peter Goodhall
766a940003 Suppress reset handler for programmatic resets
Add a suppressNextResetHandler flag to avoid running the reset event handler when the QSO form is reset programmatically (set the flag before calling qsoFormElement.reset()). Introduce clearCatTrackedFieldState() to remove stored 'catValue' data from frequency/satellite/mode/power fields and call it from reset_fields(). Also initialize suppressNextResetHandler and short-circuit the '#qso_input' reset handler when the flag is set to prevent unintended UI side effects.
2026-04-07 16:12:10 +01:00
Peter Goodhall
b96b205b64 Improve CAT sync and prevent stale updates
Add request/version tracking to CAT JSON handling to avoid applying stale responses when radio selection changes. Introduce catRequestCounter, lastProcessedCatRequest and catSelectionContextVersion, compare request IDs and context version before updating UI, and increment context version on radio selection change. Also add a syncFromSelectedRadioAfterReset helper in qso.js (with a throttled user notice) and call it after form reset and on escape-based reset so the form prefers live CAT values from the selected radio.
2026-04-07 14:45:22 +01:00
Peter Goodhall
fdba5ab166 Preserve band/mode/satellite on form reset
Before resetting the QSO form, capture the user's current operating context (band, mode, satellite name/mode, propagation). After qsoForm.reset() and the built-in reset handlers run, reapply those captured values (with a 150ms timeout) so the UI doesn't revert to server-session defaults or the previous QSO values. Also call setRst(mode) if available to update RST for the restored mode.
2026-04-07 14:36:05 +01:00
Peter Goodhall
8716e6caae Clear satellite fields when not SAT and on reset
Ensure satellite fields are cleared whenever propagation mode is not 'SAT' and when the QSO form is reset. In Qso.php, sat_name and sat_mode are set to empty strings if prop_mode != 'SAT' (added in two handling points). In assets/js/sections/qso.js, added clearSatelliteFields() to clear sat_name, sat_mode, satellite_modes_list and related state, call it from reset_fields(), and invoke the form reset flow to ensure no stale satellite data remains after resetting or changing propagation mode.
2026-04-06 14:37:56 +01:00
Peter Goodhall
5edc233960 Reapply mode and satellite fields after QSO save
When a QSO is saved, preserve the selected mode, satellite name, and satellite mode so the user doesn't have to reselect them for the next entry. Capture savedMode, savedSatName, and savedSatMode into postSaveDefaults and call a new reapplyPostSaveDefaults() after reset_fields(). Added reapplyPostSaveDefaults() to restore band, mode, sat_name, sat_mode and call setRst() if available.
2026-04-05 17:53:22 +01:00
Peter Goodhall
85d5ad6958 Reapply default RST on reset_fields
When resetting QSO fields, reapply the default RST for the current mode. The change calls setRst($('.mode').val()) if the setRst function exists, ensuring mode-specific defaults (e.g., CW => 599) are restored after a form reset to avoid stale RST values.
2026-04-05 17:51:03 +01:00
Peter Goodhall
b8b87e5d50 Escape QSO notice values and include band
Add escapeNoticeValue to sanitize user-provided strings (&, <, >, ", ') to prevent XSS in notice messages. Use a new savedBand variable and update saveMessage assembly to include both callsign and band when available, with fallbacks for when only one is present. Changes are in assets/js/sections/qso.js.
2026-04-05 17:38:46 +01:00
Peter Goodhall
5d7135124d Add AJAX QSO save endpoint and client handler
Introduce an AJAX-based QSO save flow: add QSO::ajax_saveqso() in the controller to validate input, set session/cookies, create the QSO and return JSON success/error payloads. Update the QSO view to include a data-ajax-save-url on the form and add a notice-alerts container location. Enhance the qso.js client: add isSubmitting guard, showQsoNotice helper, intercept form submit to POST serialized form data to the AJAX endpoint, handle success (reset form, show notice, refresh recent QSOs via htmx), display validation/server errors, and restore UI state when complete. These changes avoid full page reloads on save and provide inline validation feedback.
2026-04-05 17:36:52 +01:00
Peter Goodhall
0f62a7178a Add client-side QRA utils and use in QSO
Introduce a frontend QRA utilities module and switch QSO locator/bearing/distance logic to run client-side. Added assets/js/qra-utils.js (ported from the PHP Qra library), injected measurement_base and station_gridsquares into the QSO view, and updated application/controllers/Qso.php to provide the measurement_base for the frontend. Footer now loads qra-utils.js before qso.js. Modified assets/js/sections/qso.js to debounce locator input, place map markers from local grid→lat/lng math, and compute bearing/distance via QraUtils (removes several AJAX calls to server endpoints). This reduces server round-trips and keeps frontend behavior consistent with the PHP implementation.
2026-03-29 13:57:36 +01:00
Peter Goodhall
3ca2478553 Use DOMContentLoaded and guard selectize
Replace jQuery $(function() {}) with document.addEventListener('DOMContentLoaded') in the QSO view and harden selectize usage in assets/js/sections/qso.js. Add existence checks (for elements and selectize instances) before accessing .selectize to avoid null/undefined dereferences, and consolidate selectize clearing logic. These changes improve robustness when selectize or jQuery readiness assumptions aren't met and prevent runtime errors.
2026-03-27 21:40:23 +00:00
Peter Goodhall
70f5c81b29 Respect hidden DOK field and guard Selectize
Always render the DOK field wrapper but mark it with data-user-hidden when the field is disabled for the user, and make toggleDokField skip showing the field in that case. Add defensive checks around Selectize accesses in assets/js/sections/qso.js (ensure $select[0] exists and dok_selectize is non-null before calling methods) to avoid JS errors when the DOK input is absent or not initialized. Changes touch application/views/qso/index.php and assets/js/sections/qso.js to prevent runtime errors and correctly honor user-hidden DOK configuration.
2026-03-27 19:34:24 +00:00
Peter Goodhall
ca541cae72 Fix indentation for dxcc_id assignment
Adjust indentation in assets/js/sections/qso.js so the $('#dxcc_id').val(...) line is properly nested within the surrounding block. This is a whitespace/readability fix only and introduces no functional change.
2026-03-27 18:20:04 +00:00
Peter Goodhall
0e631c2de1 Trigger DXCC change handlers on programmatic updates
Call toggleDokField()/toggleUsaFields() on jQuery ready and ensure programmatic updates to #dxcc_id fire change handlers. Replaced the previous DOMContentLoaded init with a jQuery $(function()) call to initialise the toggle state, added .trigger('change') where #dxcc_id is set programmatically, and invoke the toggle functions from the dxcc change handler to keep UI fields in sync.
2026-03-27 18:18:17 +00:00
Peter Goodhall
d847e4819e Add pagination and DXCC tab to previous QSOs
Implement server-side pagination for previous contacts and add a DXCC Summary tab. Controller Qso now uses last_custom_paginated and exposes total_rows/total_pages/current_page/limit. Logbook_model gained last_custom_paginated and last_custom_count to support paged queries. The previous_contacts view was updated with HTMX pagination controls and wrapping for a scrollable table; qso/index was refactored to a tabbed UI (Previous Contacts / DXCC Summary). Lookup result display was improved: responsive table, sticky header, consolidation of LSB/USB into SSB and filtering out empty modes. JS and CSS updates load DXCC HTML into the new tab, hide legacy dxccsummary elements, and add form reset / Escape handling to return focus to the previous contacts tab.
2026-03-26 22:26:47 +00:00
Peter Goodhall
a049d33b3a Prevent duplicate callhistory fields
Add normalization helpers and update callhistory renderers to avoid showing redundant membership numbers or names when they are contained in or equal to other fields. Introduces normalizeCallhistoryText and qsoCallhistoryNormalizeText, converts values to strings, trims and lowercases them for comparisons, and only appends #exch1 or name when they would be distinct from the organization label or each other. Applies the change to assets/js/sections/contesting.js and assets/js/sections/qso.js to clean up callhistory display logic.
2026-03-24 22:54:15 +00:00
Peter Goodhall
894d9af38f Add Call History upload and lookup feature
Introduce a new Call History feature: adds Callhistory controller, Callhistory_model, migration (create callhistory_files table) and view for uploading/managing call history files. Implements CSV/TXT upload handling, storage per-user, activation/priority controls, checksum, and server-side lookup that scans active files for matching callsigns. Integrates UI: header menu link, contesting and QSO views show call history results inline, and JavaScript to perform lookups and render results with copy-to-SIG functionality. Also updates .gitignore to exclude uploaded callhistory directory and bumps migration_version to 261.
2026-03-24 22:36:54 +00:00
Peter Goodhall
2537f66d8f Support multi POTA refs in QSO entry and ADIF export 2026-03-24 14:20:17 +00:00
Peter Goodhall
73341d7c05 Add createOnBlur and selectOnTab to selectize
Enable createOnBlur and selectOnTab on selectize instances for SOTA, WWFF and POTA reference fields in both the QSO form and the QSO edit dialog (assets/js/sections/qso.js and assets/js/sections/common.js). This improves UX by allowing new entries to be created on blur and enabling selection with the Tab key.
2026-03-24 14:14:00 +00:00
Peter Goodhall
b6b596d3c1 Handle callsign correction with selective overwrite approval
Keep callsign lookup retriggered on correction while preventing silent data loss.

Add a Bootstrap modal that lists conflicting fields and allows keep existing, replace selected, or replace all.

Fix stale lookup race handling with request IDs and correct callsign comparison guard to avoid assignment bug.

Make callsign-change resets non-destructive for user-entered fields while still refreshing DXCC/metadata and past-QSO context.
2026-03-23 23:06:17 +00:00
Peter Goodhall
7a96e728fa Prevent double form submission in QSO section
Introduces a submission state flag to prevent double submissions of the QSO form, disables the submit button during processing, and restores its state if the page visibility changes or fields are reset. Also adds handling to prevent Enter key from causing duplicate submissions.
2025-08-18 14:41:38 +01:00
Hugo Silva
82515f0b9b On QSO logging, don't refresh callsign data if it's not changed 2024-01-14 22:50:47 +00:00
int2001
4bd3bc3beb
Added Space 2023-12-29 07:35:58 +00:00
HB9HIL
72e9bc1294 previous contacts 2023-12-29 08:26:15 +01:00
int2001
d067587639
show times worked b4 / JS-Part 2023-12-29 06:42:15 +00:00
HB9HIL
d678de8107 changed the trash icon in fav dropdown 2023-12-28 18:48:56 +01:00
Andreas Kristiansen
5e8075196b
Merge pull request #2772 from abarrau/ans-fix-qso-time-end
[QSO] Fix TimeOff on qso post
2023-12-06 18:08:37 +01:00
phl0
02ccbc8db2
Only reset timers in live QSO mode 2023-12-06 10:23:53 +01:00
abarrau
b3e9832291 add language for text error 2023-12-04 21:56:04 +01:00
abarrau
ee33736e83 time off change day if time off in 00:xx 2023-12-04 21:32:16 +01:00
abarrau
4139b3cb4c qso time off tested befor submit 2023-12-04 21:06:00 +01:00
Peter Goodhall
64e8c28a17 [QSO] Fixed Badge colours not functioning correctly 2023-11-26 15:01:34 +00:00
int2001
7bbdef5201
some more tooltip-fixes 2023-11-26 08:54:29 +00:00
HB9HIL
0e68b0641d fix_reset_time 2023-11-14 23:25:06 +01:00