wavelog/application/models/Contesting_import_model.php

244 lines
8 KiB
PHP
Raw Permalink Normal View History

New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
<?php
class Contesting_import_model extends CI_Model {
/**
* Returns historical contest QSO groups not yet linked to any contest session,
* scoped to the current user's stations. Groups by (COL_CONTEST_ID, station_id)
* and splits into separate sessions wherever consecutive QSOs are at least
* 72 hours apart and not within the same ISO calendar week (see
* _segment_qsos). QSOs without a valid COL_TIME_ON are excluded.
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
*
* @return array
*/
function get_legacy_contest_groups() {
$user_id = $this->session->userdata('user_id');
return $this->_fetch_legacy_groups_for_users([$user_id]);
}
/**
* Returns historical contest QSO groups for ALL users of this instance,
* not yet linked to any contest session.
*
* @return array
*/
function get_all_legacy_contest_groups() {
return $this->_fetch_legacy_groups_for_users([]);
}
/**
* Finds a contest entry by ADIF name. Returns 1 ("Other") if none found.
*
* @param string $adif_name
* @return int contest.id
*/
function ensure_contest_exists($adif_name) {
$query = $this->db->query(
"SELECT id FROM contest WHERE adifname = ? LIMIT 1",
[$adif_name]
);
if ($query->num_rows() > 0) {
return (int)$query->row()->id;
}
return 1; // "Other"
}
/**
* Imports a single legacy contest group for the current session user.
*
* @param string $adif_name
* @param int $station_id
* @param int $segment_start Unix timestamp of the segment's first QSO
* @return int Number of QSOs linked, 0 on ownership failure or unknown segment
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
*/
function import_legacy_contest_group($adif_name, $station_id, $segment_start) {
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
$user_id = $this->session->userdata('user_id');
return $this->_do_import_legacy_group($adif_name, $station_id, $segment_start, $user_id);
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
}
/**
* Imports a single legacy contest group for an explicitly specified user.
* Used by the all-users admin import.
*
* @param string $adif_name
* @param int $station_id
* @param int $segment_start Unix timestamp of the segment's first QSO
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
* @param int $user_id
* @return int Number of QSOs linked, 0 on ownership failure or unknown segment
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
*/
function import_legacy_contest_group_as_user($adif_name, $station_id, $segment_start, $user_id) {
return $this->_do_import_legacy_group($adif_name, $station_id, $segment_start, (int)$user_id);
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
}
// -------------------------------------------------------------------------
// Private helpers
// -------------------------------------------------------------------------
private function _fetch_legacy_groups_for_users(array $user_ids) {
$table = $this->config->item('table_name');
$user_filter = empty($user_ids)
? ""
: "AND t.station_id IN (SELECT station_id FROM station_profile WHERE user_id = ?)";
$sql = "SELECT
t.COL_CONTEST_ID AS adif_name,
t.station_id,
t.COL_TIME_ON,
c.id AS contest_table_id,
COALESCE(c.name, t.COL_CONTEST_ID) AS contest_name,
sp.station_callsign,
sp.user_id AS owner_user_id
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
FROM {$table} t
LEFT JOIN contest c ON c.adifname = t.COL_CONTEST_ID
LEFT JOIN station_profile sp ON sp.station_id = t.station_id
LEFT JOIN contest_qsos cq ON cq.qso_id = t.COL_PRIMARY_KEY
WHERE t.COL_CONTEST_ID IS NOT NULL
AND t.COL_CONTEST_ID != ''
AND t.COL_TIME_ON IS NOT NULL
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
AND cq.id IS NULL
{$user_filter}
ORDER BY t.COL_CONTEST_ID, t.station_id, t.COL_TIME_ON";
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
$bindings = empty($user_ids) ? [] : $user_ids;
$qsos = $this->db->query($sql, $bindings)->result_array();
// Group QSOs by (adif_name, station_id), then split each group into
// time segments so that preview rows match the sessions created on import
$grouped = [];
foreach ($qsos as $qso) {
$grouped[$qso['adif_name'] . '|' . $qso['station_id']][] = $qso;
}
$result = [];
foreach ($grouped as $group_qsos) {
foreach ($this->_segment_qsos($group_qsos) as $segment) {
$first = $segment[0];
$last = end($segment);
$result[] = [
'adif_name' => $first['adif_name'],
'station_id' => $first['station_id'],
'segment_start' => strtotime($first['COL_TIME_ON']),
'contest_year' => (int)date('Y', strtotime($first['COL_TIME_ON'])),
'time_start' => $first['COL_TIME_ON'],
'time_end' => $last['COL_TIME_ON'],
'qso_count' => count($segment),
'contest_table_id' => $first['contest_table_id'],
'contest_name' => $first['contest_name'],
'station_callsign' => $first['station_callsign'],
'owner_user_id' => $first['owner_user_id'],
];
}
}
usort($result, function ($a, $b) {
return $b['segment_start'] <=> $a['segment_start'];
});
return $result;
}
/**
* Splits a time-ordered list of QSOs into segments. A new segment starts
* whenever two consecutive QSOs are at least 72h apart unless both QSOs
* fall into the same ISO calendar week (Mon-Sun). This keeps week-long
* activity events with sparse QSOs (e.g. one QSO on Monday, one on Friday)
* in a single session, while weekly series (same weekday every week) always
* cross a week boundary and are still split.
*
* @param array $qsos QSO rows ordered by COL_TIME_ON ascending
* @return array Array of segments, each an array of QSO rows
*/
private function _segment_qsos(array $qsos) {
$segments = [];
$current = [];
$prev_ts = null;
foreach ($qsos as $qso) {
$ts = strtotime($qso['COL_TIME_ON']);
if ($prev_ts !== null && ($ts - $prev_ts) >= 72 * 3600 && date('oW', $ts) !== date('oW', $prev_ts)) {
$segments[] = $current;
$current = [];
}
$current[] = $qso;
$prev_ts = $ts;
}
if (!empty($current)) {
$segments[] = $current;
}
return $segments;
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
}
private function _do_import_legacy_group($adif_name, $station_id, $segment_start, $user_id) {
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
$table = $this->config->item('table_name');
// Verify station belongs to the specified user
$check = $this->db->query(
"SELECT station_id FROM station_profile WHERE station_id = ? AND user_id = ? LIMIT 1",
[$station_id, $user_id]
);
if ($check->num_rows() === 0) {
return 0;
}
$contest_id = $this->ensure_contest_exists($adif_name);
$is_other = ($contest_id === 1 && $adif_name !== 'Other');
// Fetch all unlinked QSOs for this contest/station combination
$all_qsos = $this->db->query(
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
"SELECT t.COL_PRIMARY_KEY, t.COL_TIME_ON
FROM {$table} t
LEFT JOIN contest_qsos cq ON cq.qso_id = t.COL_PRIMARY_KEY
WHERE t.COL_CONTEST_ID = ?
AND t.station_id = ?
AND t.COL_TIME_ON IS NOT NULL
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
AND cq.id IS NULL
ORDER BY t.COL_TIME_ON ASC",
[$adif_name, $station_id]
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
)->result_array();
if (empty($all_qsos)) {
return 0;
}
// Re-derive the segments and pick the one starting at the requested time
$qsos = null;
foreach ($this->_segment_qsos($all_qsos) as $segment) {
if (strtotime($segment[0]['COL_TIME_ON']) === (int)$segment_start) {
$qsos = $segment;
break;
}
}
if ($qsos === null) {
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
return 0;
}
$year = (int)date('Y', strtotime($qsos[0]['COL_TIME_ON']));
New Wavelog Contesting and Basics for Wavelog Worker (#3063) * initial commit for new contesting in Wavelog * implemented cache buster to match logic from upstream dev branch * refactore data-store to idb since this will be much faster with a lot of QSOs (scale for the future) * implementation of other exchange types (wip) * updated migration version * renamed mig * renamed mig * updated mig * ESC Handler to reset form * Add Websocket * stretch maxDuration warning We can stretch the maxDuration warning to 2 seconds to allow for more network latency and processing time. The heartbeat is protected against multiple parallel requests, so we can afford to be more lenient with the duration before showing a warning. This should help reduce false positives in environments with higher latency or slower processing. * worked before warning in qso form While input the logic checks in the qso list if the callisgn already exists on the same band and mode. * translations * fix band buttons * updated migration after release 2.4.2 * Fixing create new contest, add clubstation permission check, add time check to contests * Adding attach QSO to Contest * Remove redundant clubstation checks * Fix function tip * Remove time check when launch contest * Fixing contest attach main logbook, adding detach contest qso * Enable clubstation contest QSO detach attach * add space handler for callsign input * set rst default to 599 for cw, 59 for others * add grid and refactor some ui to make a better fitting here and there * adjust tabindex * add "copy exchange to" feature * fix css for all themes * adif and cbr export * fix bug with wrong operator callsign * add exchange type "exchange+grid" * introduce new logic for exchangetypes and more flexible order selection * fix broken qso list scroll * legacy import feature * more precise wording * feat: inline editing of QSOs by double click in the QSO list * redirect cabrillo to contesting manager * Fix QSO permission check * remove unused cabrillo stuff * remove duplicate function * fix check if worked before on band change tnx to @int2001 * fix flash message for legacy importer * make dropdown searchable and place "other" at the top * add hint about "Other" contest * avoid "flash" of winkeyer settings in qso logging, it shows up if cw is set as mode * winkeyer for the new contesting need proper testing by @AndreasK79 and @phl0 since I don't have a winkeyer myself. I tested with a python simulator... * english comments * proper singular/plural * fix dropdown * preselect active station location * allow editing time aswell * fix fontsize in radio buttons * remove redundant qso count query * cache last updated value for contest qsos to reduce db load * index on user id * cache also qso count * you can now resize windows also on the edges requested by @xyz667 in https://github.com/wavelog/wavelog/pull/3063#issuecomment-4557850867 * fix oversized clock * click to prepare logging for contesting Logic: - if qso windows is open, call is sent to qso form - if contest log is open, call is sent to contest log - if both are open, call is sent to contest log - if none is open, click opens qso form and call is sent to qso form * handle exchange s prefill with data from the last qso and make exchange always uppercase * add dropdown to qso list with option to delete qsos * language fixes * english comments * center text * fix missing dropdown on new qsos * add date presets for contest session creator/editor * basic worker implementation * support multiple workers for clustering * remove unnecessary node column * simple availability check * websocket for contesting * bonus: add vip for visibilty in debug view * use vip if available * worker disabled in debug view if disabled in config * racecondition for winkeyer breaks edit/delete dropdown * racecondition for winkeyer breaks edit/delete dropdown * qso handling for worker in contesting, no high interval heartbeat anymore * clear heartbeat intervall * fix some timing bugs * remove dedicated worker controller as it's not needed * handle whitespace * trigger sync engine after processing QSO sync response and adjust last sync time to avoid spurious resyncs * fix set and setLocal * fix change detection and sync logic * fix the lost of seconds due to edit * fix table rendering * watermark handling for true delta * remove caching as it brings more problems here as benefits * make serial as default exchangetype * Add clarification on cluster setup requirements for worker URLs * add operator to qso list if this is a clubstation * fix bug for editing qsos in clubmode * remove redundant code * integers must be null in database * fix bug in tabindex if 3 exchangefields are configured (serial, exchange, grid) * nice contesting map (draft) * map autofit * add grid overlay * calculate distanz and azimuth * include rotor control via waveloggate (ws only) * implement simple dedicated callbook lookup * simpler and faster lookup * option in contest session to disabled callbook lookup and only calculate dxcc * syntax issue * fix bug in CBR export * catch empty result on contest * remove some leftovers * removed some comments * remove unused stuff * removed old todos/comments * add 4s timeout for ajax transport * you need to be admin for this * translations * add option to delete qso's aswell when deleting a session (opt in) * add quickstart button in manager * removed old todo * fix "grows to bottom" * disable "copy exchange to" if no exchange is set * clear map on qso clear aswell * same for scp * updated documentation link * calculate distanze and azimut also on grid only * better space usage in qso input * callbook db first approach, online lookup can be disabled while being cached for all users when enabled * some input validation * use only one sot for qrgtoband * basic stats component * fix html encoding * render all aswell * ascii * store locally which time frame the user wants * sync settings and warn user if something happend on the backend * dev leftover * show errors if callbook fails or callsign is invalid * easier syntax * Revert "easier syntax" - that was a mistake This reverts commit 80c75dbf1e6c832f8d0616ea56b8b55d96c36418. * fix for callbook lookup * make pathline more visible * better visibility of qsos * add classic coordinates bar to the map * fix bug in stats * stretch max duration to 4s.. just in case * simple sanity check in js to prevent unnecessary callbook lookups * simulate tab after filling the call from scp * fix poll radios with enabled worker * reset po/mo files back to upstream/dev * split contest exports, add back reg1test edi format * keep the menu item but redirect to contesting * better syntax and bugfix * break it down further and fix typo ("constraint") * use monospace font for input fields * fix: in worker driven mode we need to do the heartbeat also on not focused windows otherwise we loose this contact * fix: error handling on invalid times * wavelog Ø * more styling * band lowercase fix * Other is not a very descriptive title for a contest logger window, so we rename it to "Contest" * custom contest name * compare the whole array instead just a few settings --------- Co-authored-by: int2001 <joerg@dj7nt.de> Co-authored-by: HadleySo <71105018+HadleySo@users.noreply.github.com> Co-authored-by: DB4SCW <dev@db4scw.de>
2026-06-14 14:23:00 +02:00
$time_start = date('Y-m-d H:i:s', strtotime($qsos[0]['COL_TIME_ON']) - 3600);
$time_end = date('Y-m-d H:i:s', strtotime(end($qsos)['COL_TIME_ON']) + 3600);
if ($is_other) {
$comment = sprintf(__("Imported from logbook\n(ADIF: %s, Year: %d) [Original: %s]"), $adif_name, $year, $adif_name);
} else {
$comment = sprintf(__("Imported from logbook\n(ADIF: %s, Year: %d)"), $adif_name, $year);
}
$settings = json_encode(['exchangetype' => 'Exchange', 'copyexchangeto' => '', 'exchangefields' => ['exchange']]);
$this->db->query(
"INSERT INTO contest_session (user_id, contest_adif_id, time_start, time_end, station_id, comment, settings)
VALUES (?, ?, ?, ?, ?, ?, ?)",
[$user_id, $contest_id, $time_start, $time_end, $station_id, $comment, $settings]
);
$session_id = (int)$this->db->insert_id();
$linked = 0;
foreach ($qsos as $qso) {
$this->db->query(
"INSERT INTO contest_qsos (contest_session_id, qso_id) VALUES (?, ?)",
[$session_id, $qso['COL_PRIMARY_KEY']]
);
$linked++;
}
return $linked;
}
}