[WAB] Added ability to store WAB reference in Station Locations

Added ability to store WAB reference in Station Locations and also its exported in ADIF with the custom tag of "APP_CLOUDLOG_MY_WAB"
这个提交包含在:
Peter Goodhall 2024-05-14 15:25:10 +01:00
父节点 62a83c6072
当前提交 c6716ab57a
共有 7 个文件被更改,包括 449 次插入378 次删除

查看文件

@ -22,7 +22,7 @@ $config['migration_enabled'] = TRUE;
|
*/
$config['migration_version'] = 182;
$config['migration_version'] = 183;
/*
|--------------------------------------------------------------------------

查看文件

@ -209,7 +209,7 @@ class AdifHelper {
$line .= $this->getAdifFieldLine("MY_POTA_REF", $qso->station_pota);
$line .= $this->getAdifFieldLine("MY_CQ_ZONE", $qso->station_cq);
$line .= $this->getAdifFieldLine("APP_CLOUDLOG_MY_WAB", $qso->station_wab);
$line .= $this->getAdifFieldLine("MY_ITU_ZONE", $qso->station_itu);
if($qso->state) {

查看文件

@ -0,0 +1,29 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
/*
* Add WAB Field to Station Location
*/
class Migration_add_wab_to_location extends CI_Migration
{
public function up()
{
if (!$this->db->field_exists('station_wab', 'station_profile')) {
// Add WAB Ref to station profile
$fields = array(
'station_wab varchar(10) DEFAULT NULL',
);
$this->dbforge->add_column('station_profile', $fields);
}
}
public function down()
{
if ($this->db->field_exists('station_wab', 'station_profile')) {
$this->dbforge->drop_column('station_profile', 'station_wab');
}
}
}

查看文件

@ -91,6 +91,7 @@ class Stations extends CI_Model {
'station_sota' => xss_clean(strtoupper($this->input->post('sota', true))),
'station_wwff' => xss_clean(strtoupper($this->input->post('wwff', true))),
'station_pota' => xss_clean(strtoupper($this->input->post('pota', true))),
'station_wab' => xss_clean(strtoupper($this->input->post('wab', true))),
'station_sig' => xss_clean(strtoupper($this->input->post('sig', true))),
'station_sig_info' => xss_clean(strtoupper($this->input->post('sig_info', true))),
'station_callsign' => xss_clean($this->input->post('station_callsign', true)),
@ -141,6 +142,7 @@ class Stations extends CI_Model {
'station_sota' => xss_clean($this->input->post('sota', true)),
'station_wwff' => xss_clean($this->input->post('wwff', true)),
'station_pota' => xss_clean($this->input->post('pota', true)),
'station_wab' => xss_clean($this->input->post('wab', true)),
'station_sig' => xss_clean($this->input->post('sig', true)),
'station_sig_info' => xss_clean($this->input->post('sig_info', true)),
'station_callsign' => xss_clean($this->input->post('station_callsign', true)),

查看文件

@ -1628,7 +1628,9 @@ if ($this->session->userdata('user_id') != null) {
}).addTo(map);
/*Legend specific*/
var legend = L.control({ position: "topright" });
var legend = L.control({
position: "topright"
});
legend.onAdd = function(map) {
var div = L.DomUtil.create("div", "legend");
@ -3109,6 +3111,25 @@ legend.addTo(map);
<script>
var baseURL = "<?php echo base_url(); ?>";
$(document).ready(function() {
function checkSelectedValue() {
var selectedValue = $('#dxcc_select').val();
var valuesToShow = [223, 279, 294, 265, 106, 122];
if (valuesToShow.includes(Number(selectedValue))) {
$('#WABbox').show();
} else {
$('#WABbox').hide();
}
}
// Call on page load
checkSelectedValue();
// Call on change event
$('#dxcc_select').change(checkSelectedValue);
});
var state = $("#StateHelp option:selected").text();
if (state != "") {
$("#stationCntyInput").prop('disabled', false);

查看文件

@ -1,4 +1,3 @@
<div class="container" id="create_station_profile">
<br>
@ -65,7 +64,8 @@
<select class="form-select" id="dxcc_select" name="dxcc" aria-describedby="stationCallsignInputHelp">
<option value="0" selected><?php echo "- " . lang('general_word_none') . " -"; ?></option>
<?php foreach ($dxcc_list->result() as $dxcc) { ?>
<option value="<?php echo $dxcc->adif; ?>"><?php echo ucwords(strtolower($dxcc->name)) . ' - ' . $dxcc->prefix; if ($dxcc->end != NULL) echo ' ('.lang('gen_hamradio_deleted_dxcc').')';?>
<option value="<?php echo $dxcc->adif; ?>"><?php echo ucwords(strtolower($dxcc->name)) . ' - ' . $dxcc->prefix;
if ($dxcc->end != NULL) echo ' (' . lang('gen_hamradio_deleted_dxcc') . ')'; ?>
</option>
<?php } ?>
</select>
@ -245,6 +245,12 @@
<small id="stationPOTAInputHelp" class="form-text text-muted"><?php echo lang("station_location_pota_hint_ln1"); ?></small>
</div>
<div class="mb-3" id="WABbox">
<label for="stationWABInput">Worked All Britain Reference</label>
<input type="text" class="form-control" name="wab" id="stationWABInput" aria-describedby="stationWABInputHelp">
<small id="stationWABInputHelp" class="form-text text-muted">Enter your WAB Square, if you dont know it use <a href="https://www.whatsmylocator.co.uk/" target="_blank">WhatsMyLocator</a></small>
</div>
<div class="mb-3">
<label for="stationSigInput"><?php echo lang("station_location_signature"); ?></label>
<input type="text" class="form-control" name="sig" id="stationSigInput" aria-describedby="stationSigInputHelp">

查看文件

@ -319,6 +319,19 @@
</div>
</div>
</div>
<div class="col-md" id="WABbox">
<div class="card">
<h5 class="card-header">Worked All Britain Reference</h5>
<div class="card-body">
<div class="mb-3">
<label for="stationWABInput">WAB Reference Number</label>
<input type="text" class="form-control" name="wab" id="stationWABInput" aria-describedby="stationWABInputHelp" value="<?php if(set_value('wab') != "") { echo set_value('wab'); } else { echo $my_station_profile->station_wab; } ?>">
<small id="stationWABInputHelp" class="form-text text-muted">Enter your WAB Square, if you dont know it use <a href="https://www.whatsmylocator.co.uk/" target="_blank">WhatsMyLocator</a></small>
</div>
</div>
</div>
</div>
</div>
<div class="row">