Added datepicker for LoTW report download. Fixes #465.

这个提交包含在:
AndreasK79 2020-04-25 23:11:13 +02:00
父节点 93b7100c51
当前提交 adbc7f68ce
共有 3 个文件被更改,包括 37 次插入8 次删除

查看文件

@ -111,8 +111,8 @@ class Lotw extends CI_Controller {
// Get credentials for LoTW
$query = $this->user_model->get_by_id($this->session->userdata('user_id'));
$q = $query->row();
$data['user_lotw_name'] = $q->user_lotw_name;
$q = $query->row();
$data['user_lotw_name'] = $q->user_lotw_name;
$data['user_lotw_password'] = $q->user_lotw_password;
// Get URL for downloading LoTW
@ -127,8 +127,17 @@ class Lotw extends CI_Controller {
$this->session->set_flashdata('warning', 'You have not defined your ARRL LoTW credentials!'); redirect('lotw/import');
}
// Query the logbook to determine when the last LoTW confirmation was
$lotw_last_qsl_date = date('Y-m-d', strtotime($this->logbook_model->lotw_last_qsl_date()));
$customDate = $this->input->post('from');
if ($customDate != NULL) {
$customDate = DateTime::createFromFormat('d/m/Y', $customDate);
$customDate = $customDate->format('Y-m-d');
$lotw_last_qsl_date = date($customDate);
}
else {
// Query the logbook to determine when the last LoTW confirmation was
$lotw_last_qsl_date = date('Y-m-d', strtotime($this->logbook_model->lotw_last_qsl_date()));
}
// Build URL for LoTW report file
$lotw_url .= "?";
@ -139,8 +148,8 @@ class Lotw extends CI_Controller {
//TODO: Option to specifiy whether we download location data from LoTW or not
//$lotw_url .= "&qso_qsldetail=\"yes\";
$lotw_url .= "&qso_qslsince=";
$lotw_url .= "$lotw_last_qsl_date";
$lotw_url .= "&qso_qslsince=";
$lotw_url .= "$lotw_last_qsl_date";
// Only pull back entries that belong to this callsign
$lotw_call = $this->session->userdata('user_callsign');

查看文件

@ -1128,5 +1128,17 @@ $(document).ready(function(){
</script>
<?php } ?>
<?php if ($this->uri->segment(2) == "import") { ?>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.2/moment.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/tempusdominus-bootstrap-4/5.0.1/js/tempusdominus-bootstrap-4.min.js"></script>
<script type="text/javascript">
$(function () {
$('#datetimepicker1').datetimepicker({
format: 'DD/MM/YYYY',
});
});
</script>
<?php } ?>
</body>
</html>

查看文件

@ -27,9 +27,17 @@
<input type="radio" name="lotwimport" id="fetch" class="custom-control-input" value="fetch" />
<label class="custom-control-label" for="fetch">Pull LoTW data for me</label>
</div>
<p class="card-text">From date:</p>
<div class="row">
<div class="input-group date col-md-3" id="datetimepicker1" data-target-input="nearest">
<input name="from" type="text" placeholder="DD/MM/YYYY" class="form-control datetimepicker-input" data-target="#datetimepicker1"/>
<div class="input-group-append" data-target="#datetimepicker1" data-toggle="datetimepicker">
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
</div>
</div>
</div>
<p class="form-text text-muted">Cloudlog will use the LoTW username and password stored in your user profile to download a report from LoTW for you. The report Cloudlog downloads will have all confirmations since your last LoTW confirmation, up until now.</p>
<p class="form-text text-muted">Cloudlog will use the LoTW username and password stored in your user profile to download a report from LoTW for you. The report Cloudlog downloads will have all confirmations since chosen date, or since your last LoTW confirmation (fetched from your log), up until now.</p>
<p class="form-text text-muted"><span class="badge badge-info">Important</span> You must have QSOs in the logbook before this option works, it will not populate your log from empty based on LoTW QSOs yet.</p>