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) { if ($station_ids) {
foreach ($station_ids as $station) { foreach ($station_ids as $station) {
$qrz_api_key = $station->qrzapikey; $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."; echo "QSOs have been uploaded to QRZ.com.";
log_message('info', 'QSOs have been uploaded to QRZ.com.'); log_message('info', 'QSOs have been uploaded to QRZ.com.');
} else{ } 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. * 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 * 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; $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(); $errormessages=array();
$CI =& get_instance(); $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 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){ function get_qrz_qsos($station_id, $trusted = false){
$sql = 'select *, dxcc_entities.name as station_country from ' . $this->config->item('table_name') . ' thcv ' . $CI =& get_instance();
' left join station_profile on thcv.station_id = station_profile.station_id' . $CI->load->model('stations');
' left outer join dxcc_entities on thcv.col_my_dxcc = dxcc_entities.adif' . if ((!$trusted) && (!$CI->stations->check_station_is_accessible($station_id))) {
' where thcv.station_id = ' . $station_id . return;
' and (COL_QRZCOM_QSO_UPLOAD_STATUS is NULL }
or COL_QRZCOM_QSO_UPLOAD_STATUS = "" $sql = 'select *, dxcc_entities.name as station_country from ' . $this->config->item('table_name') . ' thcv ' .
or COL_QRZCOM_QSO_UPLOAD_STATUS = "M" ' left join station_profile on thcv.station_id = station_profile.station_id' .
or COL_QRZCOM_QSO_UPLOAD_STATUS = "N")'; ' 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); $query = $this->db->query($sql);
return $query; return $query;
} }
/* /*
* Function returns the QSOs from the logbook, which have not been either marked as uploaded to webADIF * Function returns the QSOs from the logbook, which have not been either marked as uploaded to webADIF