[ADIF Import / Export] GUI tweaking. Split into tabs. Added option for marking QSOs as exported to QRZ Logbook when importing from ADIF.

这个提交包含在:
Andreas 2020-12-04 14:52:00 +01:00
父节点 c1b0d49ae7
当前提交 b03a753ab6
共有 5 个文件被更改,包括 202 次插入177 次删除

查看文件

@ -221,7 +221,7 @@ class adif extends CI_Controller {
$custom_errors .= $this->logbook_model->import($record, $this->input->post('station_profile'),
$this->input->post('skipDuplicate'), $this->input->post('markLotw'), $this->input->post('dxccAdif'));
$this->input->post('skipDuplicate'), $this->input->post('markLotw'), $this->input->post('dxccAdif'), $this->input->post('markQrz'));
};

查看文件

@ -429,9 +429,9 @@ class API extends CI_Controller {
if(isset($obj['station_profile_id'])) {
$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL);
$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL, NULL);
} else {
$this->logbook_model->import($record, 0, NULL, NULL, NULL);
$this->logbook_model->import($record, 0, NULL, NULL, NULL, NULL);
}
};

查看文件

@ -489,7 +489,7 @@ class Lotw extends CI_Controller {
$station_id = $this->logbook_model->find_correct_station_id($record['station_callsign'], $record['my_gridsquare']);
if ($station_id != NULL) {
$result = $this->logbook_model->import($record, $station_id, NULL, NULL, NULL); // Create the Entry
$result = $this->logbook_model->import($record, $station_id, NULL, NULL, NULL, NULL); // Create the Entry
if ($result == "") {
$lotw_status = 'QSO imported';
} else {

查看文件

@ -1379,7 +1379,7 @@ class Logbook_model extends CI_Model {
return $this->db->get();
}
function import($record, $station_id = "0", $skipDuplicate, $markLotw, $dxccAdif) {
function import($record, $station_id = "0", $skipDuplicate, $markLotw, $dxccAdif, $markQrz) {
$CI =& get_instance();
$CI->load->library('frequency');
$my_error = "";
@ -1682,6 +1682,16 @@ class Logbook_model extends CI_Model {
}
}
// If user checked to mark QSOs as uploaded to QRZ Logbook, or else we try to find info in ADIF import.
if ($markQrz != null) {
$input_qrzcom_qso_upload_status = 'Y';
$input_qrzcom_qso_upload_date = $date = date("Y-m-d H:i:s", strtotime("now"));
}
else {
$input_qrzcom_qso_upload_date = (!empty($record['qrzcom_qso_upload_date'])) ? $record['qrzcom_qso_upload_date'] : null;
$input_qrzcom_qso_upload_status = (!empty($record['qrzcom_qso_upload_status'])) ? $record['qrzcom_qso_upload_status'] : '';
}
if (!$skip)
{
// Create array with QSO Data use ?:
@ -1791,8 +1801,8 @@ class Logbook_model extends CI_Model {
'COL_PRECEDENCE' => (!empty($record['precedence'])) ? $record['precedence'] : '',
'COL_PROP_MODE' => (!empty($record['prop_mode'])) ? $record['prop_mode'] : '',
'COL_PUBLIC_KEY' => (!empty($record['public_key'])) ? $record['public_key'] : '',
'COL_QRZCOM_QSO_UPLOAD_DATE' => (!empty($record['qrzcom_qso_upload_date'])) ? $record['qrzcom_qso_upload_date'] : null,
'COL_QRZCOM_QSO_UPLOAD_STATUS' => (!empty($record['qrzcom_qso_upload_status'])) ? $record['qrzcom_qso_upload_status'] : '',
'COL_QRZCOM_QSO_UPLOAD_DATE' => $input_qrzcom_qso_upload_date,
'COL_QRZCOM_QSO_UPLOAD_STATUS' => $input_qrzcom_qso_upload_status,
'COL_QSL_RCVD' => $input_qsl_rcvd,
'COL_QSL_RCVD_VIA' => $input_qsl_rcvd_via,
'COL_QSL_SENT' => $input_qsl_sent,

查看文件

@ -2,13 +2,28 @@
<div class="container adif">
<h2><?php echo $page_title; ?></h2>
<div class="card">
<div class="card-header">
ADIF Import
<ul class="nav nav-tabs card-header-tabs pull-right" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="import-tab" data-toggle="tab" href="#import" role="tab" aria-controls="import" aria-selected="true">ADIF Import</a>
</li>
<li class="nav-item">
<a class="nav-link" id="export-tab" data-toggle="tab" href="#export" role="tab" aria-controls="export" aria-selected="false">ADIF Export</a>
</li>
<li class="nav-item">
<a class="nav-link" id="lotw-tab" data-toggle="tab" href="#lotw" role="tab" aria-controls="lotw" aria-selected="false">Logbook Of The World</a>
</li>
<li class="nav-item">
<a class="nav-link" id="qrz-tab" data-toggle="tab" href="#qrz" role="tab" aria-controls="qrz" aria-selected="false">QRZ Logbook</a>
</li>
</ul>
</div>
<div class="card-body">
<div class="tab-content">
<div class="tab-pane active" id="import" role="tabpanel" aria-labelledby="home-tab">
<?php if(isset($error)) { ?>
<div class="alert alert-danger" role="alert">
<?php echo $error; ?>
@ -47,6 +62,16 @@
</div>
</div>
<div class="form-group row">
<div class="col-md-10">
<div class="form-check-inline">
<input class="form-check-input" type="checkbox" name="markQrz" value="1" id="markQrzImport">
<label class="form-check-label" for="markQrzImport">Mark imported QSOs as uploaded to QRZ Logbook</label>
</div>
<div class="small form-text text-muted">Select if ADIF being imported does not contain this information.</div>
</div>
</div>
<div class="form-group row">
<div class="col-md-10">
<div class="form-check-inline">
@ -60,20 +85,13 @@
<button type="submit" class="btn btn-primary mb-2" value="Upload">Upload</button>
</form>
</div>
</div>
<br>
<div class="card">
<div class="card-header">
ADIF Export
</div>
<div class="tab-pane fade" id="export" role="tabpanel" aria-labelledby="home-tab">
<div class="alert alert-warning" role="alert">
Exporting QSOs from the active station profile <span class="badge badge-danger"><?php echo $active_station_info->station_profile_name;?></span> with the station callsign <span class="badge badge-danger"><?php echo $active_station_info->station_callsign;?></span>
</div>
<div class="card-body">
<form class="form" action="<?php echo site_url('adif/export_custom'); ?>" method="post" enctype="multipart/form-data">
<h5 class="card-title">Take your logbook file anywhere!</h5>
<p class="card-text">Exporting ADIFs allows you to import contacts into third party applications like LoTW, Awards or just for keeping a backup.</p>
@ -126,14 +144,13 @@
<p><a href="<?php echo site_url('adif/exportsatlotw'); ?>" title="Export All Satellite QSOS Confirmed on LoTW" target="_blank" class="btn btn-primary">Export All Satellite QSOs Confirmed on LoTW</a></p>
</div>
</div>
<br>
<div class="card">
<div class="card-header">
Logbook Of The World
<div class="tab-pane fade" id="lotw" role="tabpanel" aria-labelledby="home-tab">
<div class="alert alert-warning" role="alert">
Marking QSOs in the active station profile <span class="badge badge-danger"><?php echo $active_station_info->station_profile_name;?></span> with the station callsign <span class="badge badge-danger"><?php echo $active_station_info->station_callsign;?></span>
</div>
<div class="card-body">
<p><span class="badge badge-warning">Warning</span> If a date range is not selected then all QSOs will be marked!</p>
<form class="form" action="<?php echo site_url('adif/mark_lotw'); ?>" method="post" enctype="multipart/form-data">
<p class="card-text">From date:</p>
@ -157,14 +174,13 @@
<br>
<button type="submit" class="btn btn-primary" value="Export">Mark QSOs as exported to LoTW</button>
</form>
</div></div>
<br>
<div class="card">
<div class="card-header">
QRZ Logbook
</div>
<div class="card-body">
<div class="tab-pane fade" id="qrz" role="tabpanel" aria-labelledby="home-tab">
<div class="alert alert-warning" role="alert">
Marking QSOs in the active station profile <span class="badge badge-danger"><?php echo $active_station_info->station_profile_name;?></span> with the station callsign <span class="badge badge-danger"><?php echo $active_station_info->station_callsign;?></span>
</div>
<p><span class="badge badge-warning">Warning</span> If a date range is not selected then all QSOs will be marked!</p>
<form class="form" action="<?php echo site_url('adif/mark_qrz'); ?>" method="post" enctype="multipart/form-data">
<p class="card-text">From date:</p>
@ -188,8 +204,7 @@
<br>
<button type="submit" class="btn btn-primary" value="Export">Mark QSOs as exported to QRZ Logbook</button>
</form>
</div></div>
</div>
</div>
</div>
</div>
</div>