Centralize unsupported prop modes variable

This commit is contained in:
phl0
2024-07-12 09:29:09 +02:00
parent f9b03fb8e5
commit ca6db420f7
3 changed files with 20 additions and 14 deletions

View File

@@ -11,9 +11,24 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|--------------------------------------------------------------------------
| Folder location for storing P12 certificate files on the system
|--------------------------------------------------------------------------
|
|
| This folder must be outside of your www root for security reasons
|
*/
$config['lotw_keys_folder'] = "";
/*
|--------------------------------------------------------------------------
| Propagation modes that are not supported by LoTW
|--------------------------------------------------------------------------
|
| As per tqsl config the following propagation modes are not supported by
| LoTW and ignored. So Wavelog will not handle them during LoTW sync.
| As per tqsl v2.7.3 these modes are:
| - RPT
| - INTERNET
| Please do not edit!
|
*/
$config['lotw_unsupported_prop_modes'] = array('INTERNET', 'RPT');

View File

@@ -5,10 +5,7 @@ class Migration_unmark_unsupported_lotw_uploads extends CI_Migration
{
public function up() {
// Missing in tqsl 2.7.3 config.xml
$lotw_unsupported_modes = array('INTERNET', 'RPT');
$this->db->where_in('COL_PROP_MODE', $lotw_unsupported_modes);
$this->db->where_in('COL_PROP_MODE', $this->config->item('lotw_unsupported_propmodes'));
$this->db->update($this->config->item('table_name'), array('COL_LOTW_QSLSDATE' => null, 'COL_LOTW_QSL_SENT' => 'N'));
}

View File

@@ -1230,16 +1230,13 @@ class Logbook_model extends CI_Model {
$eqsl_rcvd = 'N';
}
// Missing in tqsl 2.7.3 config.xml
$lotw_unsupported_modes = array('INTERNET', 'RPT');
if ($this->input->post('lotw_sent') && !in_array($this->input->post('prop_mode'), $lotw_unsupported_modes)) {
if ($this->input->post('lotw_sent') && !in_array($this->input->post('prop_mode'), $this->config->item('lotw_unsupported_prop_modes'))) {
$lotw_sent = $this->input->post('lotw_sent');
} else {
$lotw_sent = 'N';
}
if ($this->input->post('lotw_rcvd') && !in_array($this->input->post('prop_mode'), $lotw_unsupported_modes)) {
if ($this->input->post('lotw_rcvd') && !in_array($this->input->post('prop_mode'), $this->config->item('lotw_unsupported_prop_modes'))) {
$lotw_rcvd = $this->input->post('lotw_rcvd');
} else {
$lotw_rcvd = 'N';
@@ -4855,9 +4852,6 @@ function lotw_last_qsl_date($user_id) {
function get_lotw_qsos_to_upload($station_id, $start_date, $end_date) {
// Missing in tqsl 2.7.3 config.xml
$lotw_unsupported_modes = array('INTERNET', 'RPT');
$this->db->select('COL_PRIMARY_KEY,COL_CALL, COL_BAND, COL_BAND_RX, COL_TIME_ON, COL_RST_RCVD, COL_RST_SENT, COL_MODE, COL_SUBMODE, COL_FREQ, COL_FREQ_RX, COL_GRIDSQUARE, COL_SAT_NAME, COL_PROP_MODE, COL_LOTW_QSL_SENT, station_id');
$this->db->where("station_id", $station_id);
@@ -4865,7 +4859,7 @@ function lotw_last_qsl_date($user_id) {
$this->db->where('COL_LOTW_QSL_SENT', NULL);
$this->db->or_where('COL_LOTW_QSL_SENT !=', "Y");
$this->db->group_end();
$this->db->where_not_in('COL_PROP_MODE', $lotw_unsupported_modes);
$this->db->where_not_in('COL_PROP_MODE', $this->config->item('lotw_unsupported_prop_modes'));
$this->db->where('COL_TIME_ON >=', $start_date);
$this->db->where('COL_TIME_ON <=', $end_date);
$this->db->order_by("COL_TIME_ON", "desc");