diff --git a/application/controllers/Adif.php b/application/controllers/Adif.php index e5fd4820..b9393ef1 100644 --- a/application/controllers/Adif.php +++ b/application/controllers/Adif.php @@ -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')); }; diff --git a/application/controllers/Api.php b/application/controllers/Api.php index 55dc6e27..c8bc5c4b 100644 --- a/application/controllers/Api.php +++ b/application/controllers/Api.php @@ -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); } }; diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index d7cb4a14..137b489d 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -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 { diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index ced1876b..10ce49d2 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -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, diff --git a/application/views/adif/import.php b/application/views/adif/import.php index 0a2302af..e2e610bc 100644 --- a/application/views/adif/import.php +++ b/application/views/adif/import.php @@ -2,194 +2,209 @@
Important Log files must have the file type .adi
-Warning Maximum file upload size is B.
- - -Warning If a date range is not selected then all QSOs will be marked!
- -Important Log files must have the file type .adi
+Warning Maximum file upload size is B.
+ + +Warning If a date range is not selected then all QSOs will be marked!
-