mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge pull request #2957 from kc9uhi/station-link_active_log
This commit is contained in:
@@ -304,6 +304,7 @@ class Stationsetup_model extends CI_Model {
|
||||
// Data for user_options
|
||||
$optiondata = [
|
||||
'eqsl_default_qslmsg' => xss_clean($loc['eqsl_default_qslmsg'] ?? null),
|
||||
'link_active_logbook' => (empty($loc['link_active_logbook']) ? 'false' : 'true')
|
||||
];
|
||||
|
||||
// Insert or update location in DB
|
||||
@@ -369,6 +370,15 @@ class Stationsetup_model extends CI_Model {
|
||||
$this->load->model('user_options_model');
|
||||
$this->user_options_model->set_option('eqsl_default_qslmsg', 'key_station_id', array($location_id => $optiondata['eqsl_default_qslmsg']),($user_id ?? $this->session->userdata('user_id')));
|
||||
}
|
||||
if ($optiondata['link_active_logbook'] === 'true') {
|
||||
$this->load->model('logbooks_model');
|
||||
$active_logbook = $this->logbooks_model->find_active_station_logbook_from_userid($dbdata['user_id']);
|
||||
if(!empty($active_logbook)) {
|
||||
// Can't use create_logbook_location_link if coming from API (No session->user_id, fails access check)
|
||||
$data = array('station_logbook_id' => $active_logbook, 'station_location_id' => $location_id);
|
||||
$this->db->insert('station_logbooks_relationship', $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user