Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post-Contest-Logging: Fixes and focus to time-field #3028

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions application/models/Contesting_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function getSessionQsos($qso) {

$contestid = $qsoarray[2];
$date = DateTime::createFromFormat('d-m-Y H:i:s', $qsoarray[0]);
if ($date == false) $date = DateTime::createFromFormat('d-m-Y H:i', $qsoarray[0]);
$date = $date->format('Y-m-d H:i:s');

$sql = "SELECT date_format(col_time_on, '%d-%m-%Y %H:%i:%s') as col_time_on, col_call, col_band, col_mode,
Expand Down Expand Up @@ -246,6 +247,7 @@ function checkIfWorkedBefore($call, $band, $mode, $contest) {
$qsoarray = explode(',', $contest_session->qso);

$date = DateTime::createFromFormat('d-m-Y H:i:s', $qsoarray[0]);
if ($date == false) $date = DateTime::createFromFormat('d-m-Y H:i', $qsoarray[0]);
$date = $date->format('Y-m-d H:i:s');

$this->db->select('timediff(UTC_TIMESTAMP(),col_time_off) b4, COL_TIME_OFF');
Expand Down
23 changes: 13 additions & 10 deletions assets/js/sections/contesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,10 @@ if (!manual) {
}

// We don't want spaces to be written in callsign
$(function () {
$('#callsign').on('keypress', function (e) {
if (e.which == 32) {
return false;
}
});
});

// We don't want spaces to be written in exchange
// We don't want spaces to be written in time :)
$(function () {
$('#exch_rcvd').on('keypress', function (e) {
$('#callsign, #exch_rcvd, #start_time').on('keypress', function (e) {
if (e.which == 32) {
return false;
}
Expand Down Expand Up @@ -129,6 +122,12 @@ document.onkeyup = function (e) {
// Space to jump to either callsign or the various exchanges
} else if (e.which == 32) {
var exchangetype = $("#exchangetype").val();

if (manual && $(document.activeElement).attr("id") == "start_time") {
$("#callsign").focus();
return false;
}

if (exchangetype == 'Exchange') {
if ($(document.activeElement).attr("id") == "callsign") {
$("#exch_rcvd").focus();
Expand Down Expand Up @@ -468,7 +467,11 @@ function logQso() {
$('#exch_rcvd').val("");
$('#exch_gridsquare_r').val("");
$('#exch_serial_r').val("");
$("#callsign").focus();
if (manual) {
$("#start_time").focus().select();
} else {
$("#callsign").focus();
}
setSession(formdata);

// try setting session data
Expand Down