Merge pull request #2772 from abarrau/ans-fix-qso-time-end

[QSO] Fix TimeOff on qso post
这个提交包含在:
Andreas Kristiansen 2023-12-06 18:08:37 +01:00 提交者 GitHub
当前提交 5e8075196b
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23
共有 19 个文件被更改,包括 89 次插入4 次删除

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik
$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Нулирай';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = '此笔记内容被导出到QSL服务,如 eqsl.c
$lang['qso_eqsl_qslmsg_helptext'] = "获取该站的 eQSL 默认消息。";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = '重置';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik
$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Vymazat';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik
$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Wis QSO';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik
$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Reset';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'Tämä viestisi siirtyy myös QSL-palveluihin, ku
$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Tyhjennä';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik
$lang['qso_eqsl_qslmsg_helptext'] = "Récupérer le message par défaut pour ce lieu de station.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "Heure de fin inférieure à celle de début";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Réinitialiser';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'Dieser Notizeninhalt wird an QSL Services wie eqs
$lang['qso_eqsl_qslmsg_helptext'] = "Setze die eQSL Nachricht auf den Standardtext zurück.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Zurücksetzen';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'Αυτό το περιεχόμενο σημείω
$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Επαναφορά';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'Il contenuto di questa nota è esportato a serviz
$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Reset';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik
$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Resetuj';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'СОдержимое этой заметки эк
$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Сброс';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'This note content is exported to QSL services lik
$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Resetear';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'Detta innehåll exporteras till QSL-services som
$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Reset';

查看文件

@ -28,6 +28,9 @@ $lang['qsl_notes_helptext'] = 'Bu not içeriği eqsl.cc gibi QSL servislere akta
$lang['qso_eqsl_qslmsg_helptext'] = "Get the default message for eQSL, for this station.";
// error text //
$lang['qso_error_timeoff_less_timeon'] = "TimeOff is less than TimeOn";
// Button Text on /qso Display
$lang['qso_btn_reset_qso'] = 'Baştan başla';

查看文件

@ -9,7 +9,12 @@ class Logbook_model extends CI_Model {
// Join date+time
$datetime = date("Y-m-d",strtotime($this->input->post('start_date')))." ". $this->input->post('start_time');
if ($this->input->post('end_time') != null) {
$datetime_off = date("Y-m-d",strtotime($this->input->post('start_date')))." ". $this->input->post('end_time');
$datetime_off = date("Y-m-d",strtotime($this->input->post('start_date')))." ". $this->input->post('end_time');
// if time off < time on, and time off is on 00:xx >> add 1 day (concidering start and end are between 23:00 and 00:59) //
$_tmp_datetime_off = strtotime($datetime_off);
if (($_tmp_datetime_off < strtotime($datetime)) && (substr($this->input->post('end_time'),0,2)=="00")) {
$datetime_off = date("Y-m-d H:i:s", ($_tmp_datetime_off + 60*60*24));
}
} else {
$datetime_off = $datetime;
}

查看文件

@ -1,4 +1,8 @@
<div class="container qso_panel">
<script language="javascript">
var qso_manual = "<?php echo $_GET['manual']; ?>";
var text_error_timeoff_less_timeon = "<?php echo lang('qso_error_timeoff_less_timeon'); ?>";
</script>
<div class="row qsopane">
@ -113,8 +117,8 @@
<small id="callsign_info" class="badge text-bg-secondary"></small> <a id="lotw_link"><small id="lotw_info" class="badge text-bg-success"></small></a>
</div>
<div class="mb-3 col-md-3 align-self-center">
<small id="qrz_info" class="badge text-bg-secondary"></small>
<small id="hamqth_info" class="badge text-bg-secondary"></small>
<small id="qrz_info" class="text-bg-secondary me-1"></small>
<small id="hamqth_info" class="text-bg-secondary me-1"></small>
</div>
</div>
@ -548,6 +552,7 @@
<button type="reset" class="btn btn-secondary" onclick="reset_fields()"><?php echo lang('qso_btn_reset_qso'); ?></button>
<button type="submit" class="btn btn-primary"><i class="fas fa-save"></i> <?php echo lang('qso_btn_save_qso'); ?></button>
<div class="alert alert-danger warningOnSubmit mt-3" style="display:none;"><span><i class="fas fa-times-circle"></i></span> <span class="warningOnSubmit_txt ms-1">Error</span></div>
</div>
</form>
</div>

查看文件

@ -644,4 +644,8 @@ div#station_logbooks_linked_table_paginate {
}
.icon_selectBox_data label:hover {
background-color:var(--bs-primary);
}
}
.inputError {
border: 2px solid rgb(217, 83, 79);
}

查看文件

@ -345,6 +345,14 @@ var favs={};
$('.satellite_names_list').append(items.join( "" ));
});
// Test Consistency value on submit form //
$("#qso_input").off('submit').on('submit', function(){
var _submit = true;
if ((typeof qso_manual !== "undefined")&&(qso_manual == "1")) {
if ($('#qso_input input[name="end_time"]').length == 1) { _submit = testTimeOffConsistency(); }
}
return _submit;
})
});
var selected_sat;
@ -1055,3 +1063,21 @@ function closeModal() {
container.removeChild(modal)
}, 200)
}
// [TimeOff] test Consistency timeOff value (concidering start and end are between 23:00 and 00:59) //
function testTimeOffConsistency() {
var _start_time = $('#qso_input input[name="start_time"]').val();
var _end_time = $('#qso_input input[name="end_time"]').val();
$('#qso_input input[name="end_time"]').removeClass('inputError');
$('#qso_input .warningOnSubmit').hide();
$('#qso_input .warningOnSubmit_txt').empty();
if ( !( (parseInt(_start_time.replaceAll(':','')) <= parseInt(_end_time.replaceAll(':','')))
|| ((_start_time.substring(0,2)=="23")&&(_end_time.substring(0,2)=="00")) ) ) {
$('#qso_input input[name="end_time"]').addClass('inputError');
$('#qso_input .warningOnSubmit_txt').html(text_error_timeoff_less_timeon);
$('#qso_input .warningOnSubmit').show();
$('#qso_input input[name="end_time"]').off('change').on('change',function(){ testTimeOffConsistency(); });
return false;
}
return true;
}