kopia lustrzana https://github.com/magicbug/Cloudlog
[API][QSO] Adds field "station_profile_id"
This adds the field station_profile_id to the QSO API this is the number thats shown when you are editing a profile.pull/678/head
rodzic
855c34f955
commit
48679662de
|
@ -388,7 +388,11 @@ class API extends CI_Controller {
|
||||||
return $arguments;
|
return $arguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* Function: QSO
|
||||||
|
* Task: allows passing of ADIF data to Cloudlog
|
||||||
|
*/
|
||||||
function qso() {
|
function qso() {
|
||||||
header('Content-type: application/json');
|
header('Content-type: application/json');
|
||||||
|
|
||||||
|
@ -397,12 +401,14 @@ class API extends CI_Controller {
|
||||||
// Decode JSON and store
|
// Decode JSON and store
|
||||||
$obj = json_decode(file_get_contents("php://input"), true);
|
$obj = json_decode(file_get_contents("php://input"), true);
|
||||||
|
|
||||||
|
|
||||||
if(!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
|
if(!isset($obj['key']) || $this->api_model->authorize($obj['key']) == 0) {
|
||||||
http_response_code(401);
|
http_response_code(401);
|
||||||
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
|
echo json_encode(['status' => 'failed', 'reason' => "missing api key"]);
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($obj['type'] == "adif" && $obj['string'] != "") {
|
if($obj['type'] == "adif" && $obj['string'] != "") {
|
||||||
// Load the logbook model for adding QSO records
|
// Load the logbook model for adding QSO records
|
||||||
$this->load->model('logbook_model');
|
$this->load->model('logbook_model');
|
||||||
|
@ -421,7 +427,12 @@ class API extends CI_Controller {
|
||||||
break;
|
break;
|
||||||
};
|
};
|
||||||
|
|
||||||
$this->logbook_model->import($record, 0, NULL, NULL, NULL);
|
|
||||||
|
if(isset($obj['station_profile_id'])) {
|
||||||
|
$this->logbook_model->import($record, $obj['station_profile_id'], NULL, NULL, NULL);
|
||||||
|
} else {
|
||||||
|
$this->logbook_model->import($record, 0, NULL, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
http_response_code(201);
|
http_response_code(201);
|
||||||
|
|
Ładowanie…
Reference in New Issue