Check if QRZ-QSOs belong to user, when triggering via GUI

这个提交包含在:
int2001 2023-07-31 07:16:15 +00:00
父节点 bcc8bda3e5
当前提交 112d997ca5
找不到此签名对应的密钥
GPG 密钥 ID: DFB1C13CD2DB037B
共有 2 个文件被更改,包括 20 次插入15 次删除

查看文件

@ -26,7 +26,7 @@ class Qrz extends CI_Controller {
if ($station_ids) {
foreach ($station_ids as $station) {
$qrz_api_key = $station->qrzapikey;
if($this->mass_upload_qsos($station->station_id, $qrz_api_key)) {
if($this->mass_upload_qsos($station->station_id, $qrz_api_key, true)) {
echo "QSOs have been uploaded to QRZ.com.";
log_message('info', 'QSOs have been uploaded to QRZ.com.');
} else{
@ -53,9 +53,9 @@ class Qrz extends CI_Controller {
* Function gets all QSOs from given station_id, that are not previously uploaded to qrz.
* Adif is build for each qso, and then uploaded, one at a time
*/
function mass_upload_qsos($station_id, $qrz_api_key) {
function mass_upload_qsos($station_id, $qrz_api_key, $trusted = false) {
$i = 0;
$data['qsos'] = $this->logbook_model->get_qrz_qsos($station_id);
$data['qsos'] = $this->logbook_model->get_qrz_qsos($station_id, $trusted);
$errormessages=array();
$CI =& get_instance();

查看文件

@ -1483,19 +1483,24 @@ class Logbook_model extends CI_Model {
/*
* Function returns the QSOs from the logbook, which have not been either marked as uploaded to qrz, or has been modified with an edit
*/
function get_qrz_qsos($station_id){
$sql = 'select *, dxcc_entities.name as station_country from ' . $this->config->item('table_name') . ' thcv ' .
' left join station_profile on thcv.station_id = station_profile.station_id' .
' left outer join dxcc_entities on thcv.col_my_dxcc = dxcc_entities.adif' .
' where thcv.station_id = ' . $station_id .
' and (COL_QRZCOM_QSO_UPLOAD_STATUS is NULL
or COL_QRZCOM_QSO_UPLOAD_STATUS = ""
or COL_QRZCOM_QSO_UPLOAD_STATUS = "M"
or COL_QRZCOM_QSO_UPLOAD_STATUS = "N")';
function get_qrz_qsos($station_id, $trusted = false){
$CI =& get_instance();
$CI->load->model('stations');
if ((!$trusted) && (!$CI->stations->check_station_is_accessible($station_id))) {
return;
}
$sql = 'select *, dxcc_entities.name as station_country from ' . $this->config->item('table_name') . ' thcv ' .
' left join station_profile on thcv.station_id = station_profile.station_id' .
' left outer join dxcc_entities on thcv.col_my_dxcc = dxcc_entities.adif' .
' where thcv.station_id = ' . $station_id .
' and (COL_QRZCOM_QSO_UPLOAD_STATUS is NULL
or COL_QRZCOM_QSO_UPLOAD_STATUS = ""
or COL_QRZCOM_QSO_UPLOAD_STATUS = "M"
or COL_QRZCOM_QSO_UPLOAD_STATUS = "N")';
$query = $this->db->query($sql);
return $query;
}
$query = $this->db->query($sql);
return $query;
}
/*
* Function returns the QSOs from the logbook, which have not been either marked as uploaded to webADIF