kopia lustrzana https://github.com/magicbug/Cloudlog
[Adif backup] Fetches all locations for user instead of from active logbook
rodzic
95b9ca27f5
commit
f87997f223
|
@ -10,8 +10,7 @@ class adif_data extends CI_Model {
|
||||||
if (strpos($this->api_model->access($api_key), 'r') !== false) {
|
if (strpos($this->api_model->access($api_key), 'r') !== false) {
|
||||||
$this->api_model->update_last_used($api_key);
|
$this->api_model->update_last_used($api_key);
|
||||||
$user_id = $this->api_model->key_userid($api_key);
|
$user_id = $this->api_model->key_userid($api_key);
|
||||||
$active_station_logbook = $CI->logbooks_model->find_active_station_logbook_from_userid($user_id);
|
$logbooks_locations_array = $this->list_station_locations($user_id);
|
||||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($active_station_logbook);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||||
|
@ -27,6 +26,22 @@ class adif_data extends CI_Model {
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function list_station_locations($user_id) {
|
||||||
|
$this->db->where('user_id', $user_id);
|
||||||
|
$query = $this->db->get('station_profile');
|
||||||
|
|
||||||
|
if ($query->num_rows() == 0) {
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
$locations_array = array();
|
||||||
|
foreach ($query->result() as $row) {
|
||||||
|
array_push($locations_array, $row->station_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $locations_array;
|
||||||
|
}
|
||||||
|
|
||||||
function export_printrequested($station_id = NULL) {
|
function export_printrequested($station_id = NULL) {
|
||||||
$this->load->model('stations');
|
$this->load->model('stations');
|
||||||
$active_station_id = $this->stations->find_active();
|
$active_station_id = $this->stations->find_active();
|
||||||
|
|
Ładowanie…
Reference in New Issue