diff --git a/application/controllers/Dashboard.php b/application/controllers/Dashboard.php index 8a238d6f..1036dc77 100644 --- a/application/controllers/Dashboard.php +++ b/application/controllers/Dashboard.php @@ -145,6 +145,8 @@ class Dashboard extends CI_Controller { echo "{\"markers\": ["; $count = 1; foreach ($qsos->result() as $row) { + // check if qso is confirmed // + if (($row->COL_EQSL_QSL_RCVD=='Y') || ($row->COL_LOTW_QSL_RCVD=='Y') || ($row->COL_QSL_RCVD=='Y')) { $row->_is_confirmed = 'Y'; } else { $row->_is_confirmed = 'N'; } //print_r($row); if($row->COL_GRIDSQUARE != null) { $stn_loc = $this->qra->qra2latlong($row->COL_GRIDSQUARE); @@ -155,11 +157,11 @@ class Dashboard extends CI_Controller { if($row->COL_SAT_NAME != null) { echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: "; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; - echo "\",\"label\":\"".$row->COL_CALL."\"}"; + echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } else { echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: "; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; - echo "\",\"label\":\"".$row->COL_CALL."\"}"; + echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } $count++; @@ -196,11 +198,11 @@ class Dashboard extends CI_Controller { if($row->COL_SAT_NAME != null) { echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: "; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; - echo "\",\"label\":\"".$row->COL_CALL."\"}"; + echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } else { echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: "; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; - echo "\",\"label\":\"".$row->COL_CALL."\"}"; + echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } $count++; @@ -215,12 +217,18 @@ class Dashboard extends CI_Controller { } echo "{\"lat\":\"".$lat."\",\"lng\":\"".$lng."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: "; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; - echo "\",\"label\":\"".$row->COL_CALL."\"}"; + echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; $count++; } } echo "]"; + + // [MAP Custom] ADD Station // + $this->load->model('Stations'); + $station_json = $this->Stations->get_station_json_for_map(); + echo (!empty($station_json))?', '.$station_json:''; + echo "}"; } diff --git a/application/controllers/Logbook.php b/application/controllers/Logbook.php index 543f620b..9cf88fbe 100644 --- a/application/controllers/Logbook.php +++ b/application/controllers/Logbook.php @@ -575,6 +575,9 @@ function worked_grid_before($gridsquare, $type, $band, $mode) echo "{\"markers\": ["; $count = 1; foreach ($data['qsos']->result() as $row) { + // check if qso is confirmed // + if (($row->COL_EQSL_QSL_RCVD=='Y') || ($row->COL_LOTW_QSL_RCVD=='Y') || ($row->COL_QSL_RCVD=='Y')) { $row->_is_confirmed = 'Y'; } else { $row->_is_confirmed = 'N'; } + if($row->COL_GRIDSQUARE != null) { $stn_loc = $this->qra->qra2latlong($row->COL_GRIDSQUARE); if($count != 1) { @@ -584,11 +587,11 @@ function worked_grid_before($gridsquare, $type, $band, $mode) if($row->COL_SAT_NAME != null) { echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: "; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; - echo "\",\"label\":\"".$row->COL_CALL."\"}"; + echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } else { echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: "; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; - echo "\",\"label\":\"".$row->COL_CALL."\"}"; + echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } $count++; @@ -625,11 +628,11 @@ function worked_grid_before($gridsquare, $type, $band, $mode) if($row->COL_SAT_NAME != null) { echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: "; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; - echo "\",\"label\":\"".$row->COL_CALL."\"}"; + echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } else { echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: "; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; - echo "\",\"label\":\"".$row->COL_CALL."\"}"; + echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } $count++; @@ -647,12 +650,18 @@ function worked_grid_before($gridsquare, $type, $band, $mode) } echo "{\"lat\":\"".$lat."\",\"lng\":\"".$lng."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: "; echo $row->COL_SUBMODE==null?$row->COL_MODE:$row->COL_SUBMODE; - echo "\",\"label\":\"".$row->COL_CALL."\"}"; + echo "\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; $count++; } } echo "]"; + + // [MAP Custom] ADD Station // + $this->load->model('Stations'); + $station_json = $this->Stations->get_station_json_for_map(); + echo (!empty($station_json))?', '.$station_json:''; + echo "}"; } diff --git a/application/controllers/Map.php b/application/controllers/Map.php index c3f443ff..a7b5757e 100644 --- a/application/controllers/Map.php +++ b/application/controllers/Map.php @@ -115,6 +115,9 @@ class Map extends CI_Controller { $count = 1; if ($qsos) { foreach ($qsos->result() as $row) { + // check if qso is confirmed // + if (($row->COL_EQSL_QSL_RCVD=='Y') || ($row->COL_LOTW_QSL_RCVD=='Y') || ($row->COL_QSL_RCVD=='Y')) { $row->_is_confirmed = 'Y'; } else { $row->_is_confirmed = 'N'; } + //print_r($row); if($row->COL_GRIDSQUARE != null) { $stn_loc = $this->qra->qra2latlong($row->COL_GRIDSQUARE); @@ -123,9 +126,9 @@ class Map extends CI_Controller { } if($row->COL_SAT_NAME != null) { - echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}"; + echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } else { - echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}"; + echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } $count++; @@ -160,9 +163,9 @@ class Map extends CI_Controller { } if($row->COL_SAT_NAME != null) { - echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}"; + echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } else { - echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}"; + echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } $count++; @@ -176,13 +179,19 @@ class Map extends CI_Controller { $lng = $row->long; } - echo "{\"lat\":\"".$lat."\",\"lng\":\"".$lng."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}"; + echo "{\"lat\":\"".$lat."\",\"lng\":\"".$lng."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; $count++; } } } echo "]"; + + // [MAP Custom] ADD Station // + $this->load->model('Stations'); + $station_json = $this->Stations->get_station_json_for_map(); + echo (!empty($station_json))?', '.$station_json:''; + echo "}"; } @@ -203,6 +212,9 @@ class Map extends CI_Controller { echo "{\"markers\": ["; $count = 1; foreach ($qsos->result() as $row) { + // check if qso is confirmed // + if (($row->COL_EQSL_QSL_RCVD=='Y') || ($row->COL_LOTW_QSL_RCVD=='Y') || ($row->COL_QSL_RCVD=='Y')) { $row->_is_confirmed = 'Y'; } else { $row->_is_confirmed = 'N'; } + //print_r($row); if($row->COL_GRIDSQUARE != null) { $stn_loc = $this->qra->qra2latlong($row->COL_GRIDSQUARE); @@ -211,9 +223,9 @@ class Map extends CI_Controller { } if($row->COL_SAT_NAME != null) { - echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}"; + echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } else { - echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}"; + echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } $count++; @@ -249,9 +261,9 @@ class Map extends CI_Controller { } if($row->COL_SAT_NAME != null) { - echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}"; + echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
SAT: ".$row->COL_SAT_NAME."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } else { - echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}"; + echo "{\"lat\":\"".$stn_loc[0]."\",\"lng\":\"".$stn_loc[1]."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; } $count++; @@ -268,13 +280,19 @@ class Map extends CI_Controller { if($count != 1) { echo ","; } - echo "{\"lat\":\"".$dxcc->lat."\",\"lng\":\"".$dxcc->long."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\"}"; + echo "{\"lat\":\"".$dxcc->lat."\",\"lng\":\"".$dxcc->long."\", \"html\":\"Callsign: ".$row->COL_CALL."
Date/Time: ".$row->COL_TIME_ON."
Band: ".$row->COL_BAND."
Mode: ".$row->COL_MODE."\",\"label\":\"".$row->COL_CALL."\", \"confirmed\":\"".$row->_is_confirmed."\"}"; $count++; } } } echo "]"; + + // [MAP Custom] ADD Station // + $this->load->model('Stations'); + $station_json = $this->Stations->get_station_json_for_map(); + echo (!empty($station_json))?', '.$station_json:''; + echo "}"; } diff --git a/application/controllers/User.php b/application/controllers/User.php index 06f9a533..7dd7802d 100644 --- a/application/controllers/User.php +++ b/application/controllers/User.php @@ -488,6 +488,38 @@ class User extends CI_Controller { $data['user_winkey'] = $q->winkey; } + // [MAP Custom] GET user options // + $this->load->model('user_options_model'); + $options_object = $this->user_options_model->get_options('map_custom')->result(); + if (count($options_object)>0) { + foreach ($options_object as $row) { + if ($row->option_name=='icon') { + $option_value = json_decode($row->option_value,true); + foreach ($option_value as $ktype => $vtype) { + if($this->input->post('user_map_'.$row->option_key.'_icon')) { + $data['user_map_'.$row->option_key.'_'.$ktype] = $this->input->post('user_map_'.$row->option_key.'_'.$ktype, true); + } else { + $data['user_map_'.$row->option_key.'_'.$ktype] = $vtype; + } + } + } else { + $data['user_map_'.$row->option_name.'_'.$row->option_key] = $row->option_value; + } + } + } else { + $data['user_map_qso_icon'] = "fas fa-dot-circle"; + $data['user_map_qso_color'] = "#FF0000"; + $data['user_map_station_icon'] = "0"; + $data['user_map_station_color'] = "#0000FF"; + $data['user_map_qsoconfirm_icon'] = "0"; + $data['user_map_qsoconfirm_color'] = "#00AA00"; + $data['user_map_gridsquare_show'] = "0"; + } + $data['map_icon_select'] = array( + 'station'=>array('0', 'fas fa-home', 'fas fa-broadcast-tower', 'fas fa-user', 'fas fa-dot-circle' ), + 'qso'=>array('fas fa-broadcast-tower', 'fas fa-user', 'fas fa-dot-circle' ), + 'qsoconfirm'=>array('0', 'fas fa-broadcast-tower', 'fas fa-user', 'fas fa-dot-circle', 'fas fa-check-circle' )); + $this->load->view('interface_assets/header', $data); $this->load->view('user/edit', $data); $this->load->view('interface_assets/footer'); @@ -518,6 +550,24 @@ class User extends CI_Controller { $this->input->set_cookie($cookie); } if($this->session->userdata('user_id') == $this->input->post('id', true)) { + // [MAP Custom] ADD to user options // + $array_icon = array('station','qso','qsoconfirm'); + foreach ($array_icon as $icon) { + $data_options['user_map_'.$icon.'_icon'] = xss_clean($this->input->post('user_map_'.$icon.'_icon', true)); + $data_options['user_map_'.$icon.'_color'] = xss_clean($this->input->post('user_map_'.$icon.'_color', true)); + } + $this->load->model('user_options_model'); + if (!empty($data_options['user_map_qso_icon'])) { + foreach ($array_icon as $icon) { + $json = json_encode(array('icon'=>$data_options['user_map_'.$icon.'_icon'], 'color'=>$data_options['user_map_'.$icon.'_color'])); + $this->user_options_model->set_option('map_custom','icon',array($icon=>$json)); + } + $this->user_options_model->set_option('map_custom','gridsquare',array('show'=>xss_clean($this->input->post('user_map_gridsquare_show', true)))); + } else { + $this->user_options_model->del_option('map_custom','icon'); + $this->user_options_model->del_option('map_custom','gridsquare'); + } + $this->session->set_flashdata('success', lang('account_user').' '.$this->input->post('user_name', true).' '.lang('account_word_edited')); redirect('user/edit/'.$this->uri->segment(3)); } else { diff --git a/application/controllers/User_options.php b/application/controllers/User_options.php index 3aa337de..be73d480 100755 --- a/application/controllers/User_options.php +++ b/application/controllers/User_options.php @@ -46,6 +46,18 @@ class User_Options extends CI_Controller { header('Content-Type: application/json'); echo json_encode($jsonout); } + + // [MAP Custom] // + public function get_map_custom() { + $result=$this->user_options_model->get_options('map_custom'); + $jsonout=[]; + foreach($result->result() as $options) { + if ($options->option_name=='icon') $jsonout[$options->option_key]=json_decode($options->option_value,true); + else $jsonout[$options->option_name.'_'.$options->option_key]=$options->option_value; + } + header('Content-Type: application/json'); + echo json_encode($jsonout); + } } diff --git a/application/language/english/account_lang.php b/application/language/english/account_lang.php index 8b809bce..8fee1837 100644 --- a/application/language/english/account_lang.php +++ b/application/language/english/account_lang.php @@ -115,3 +115,8 @@ $lang['account_winkeyer'] = 'Winkeyer'; $lang['account_winkeyer_hint'] = "Winkeyer support in Cloudlog is very experimental read the wiki first at https://github.com/magicbug/Cloudlog/wiki/Winkey before enabling."; $lang['account_winkeyer_enabled'] = "Winkeyer Features Enabled"; +$lang['account_map_params'] = "Paramètre de la carte"; +$lang['account_map_qso_by_default'] = "QSO (by default)"; +$lang['account_map_qso_confirm'] = "QSO (confirmed)"; +$lang['account_map_qso_confirm_same_qso'] = "(If 'No', displayed as ".$lang['account_map_qso_by_default'].")"; + diff --git a/application/language/english/general_words_lang.php b/application/language/english/general_words_lang.php index 28604afc..93793b1d 100644 --- a/application/language/english/general_words_lang.php +++ b/application/language/english/general_words_lang.php @@ -23,6 +23,8 @@ $lang['general_word_export'] = "Export"; $lang['general_word_import'] = "Import"; $lang['general_word_count'] = "Count"; $lang['general_word_filtering_on'] = "Filtering on"; +$lang['general_word_not_display'] = "Not display"; +$lang['general_word_icon'] = "Icon"; $lang['general_word_date'] = 'Date'; $lang['general_word_startdate'] = "Start Date"; @@ -167,6 +169,7 @@ $lang['gen_hamradio_wwff'] = 'WWFF'; $lang['gen_hamradio_pota'] = 'POTA'; $lang['gen_hamradio_gridsquare'] = 'Gridsquare'; $lang['gen_hamradio_get_gridsquare'] = 'Get Gridsquare'; +$lang['gen_hamradio_gridsquare_show'] = "Show Locator"; $lang['gen_hamradio_latitude'] = "Latitude"; $lang['gen_hamradio_longitude'] = "Longitude"; $lang['gen_hamradio_bearing'] = "Bearing"; diff --git a/application/models/Stations.php b/application/models/Stations.php index 49674824..46ae25e3 100644 --- a/application/models/Stations.php +++ b/application/models/Stations.php @@ -512,6 +512,16 @@ class Stations extends CI_Model { } return false; } + + // [MAP Custom] get json structure (for map) about info's station // + public function get_station_json_for_map() { + $_jsonresult = array(); + list($station_lat, $station_lng) = array(0,0); + $station_active = $this->profile($this->find_active())->row(); + if (!empty($station_active)) { list($station_lat, $station_lng) = $this->qra->qra2latlong($station_active->station_gridsquare); } + if (($station_lat!=0)&&($station_lng!=0)) { $_jsonresult = array('lat'=>$station_lat,'lng'=>$station_lng,'html'=>$station_active->station_gridsquare,'label'=>$station_active->station_profile_name,'icon'=>'stationIcon'); } + return (count($_jsonresult)>0)?("\"station\":".json_encode($_jsonresult)):''; + } } ?> diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index d013da67..2496cc11 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -3048,6 +3048,31 @@ function viewEqsl(picture, callsign) { +uri->segment(1) == "user") && ($this->uri->segment(2) == "edit")) { ?> + + + + + + session->userdata('user_id') == $this->uri->segment(3)) { ?> + +
+
+
+ lang->line('account_map_params'); ?> +
+
+
+
+
+
+
+
+
+ +
lang->line('general_word_not_display'),0,10).'.':("")); ?>
+
+
+ ".(($val=="0")?$this->lang->line('general_word_not_display'):("")).""; + } ?> +
+
+
+
" data-icon="station" />
+
+
+
+ +
+
+
+ +
"; ?>
+
+
+ "; + } ?> +
+
+
+ +
+
+
+
+ +
+
+
+
+ +
lang->line('general_word_no'):("")); ?>
+
+
+ ".(($val=="0")?$this->lang->line('general_word_no'):("")).""; + } ?> +
+
+
+ " data-icon="qsoconfirm" /> +
+
+
+
+ +
+
+ +
+
+
+
+
+
diff --git a/assets/css/general.css b/assets/css/general.css index 18577b8b..317418d3 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -628,4 +628,27 @@ table.dataTable tfoot td { .qso_eqsl_qslmsg_update { cursor: pointer; margin-left: 10px; +} + +.icon_selectBox { + position: relative; +} +.icon_selectBox_data { + display: none; + position:absolute; + z-index:50; + left:initial; + border:1px solid var(--bs-border-color); + padding:5px; + top:initial; + background-color:var(--bs-card-bg); + color:var(--bs-body-color); +} +.icon_selectBox_data label { + display:block; + margin-bottom:0px!important; + text-align:center; cursor:pointer; +} +.icon_selectBox_data label:hover { + background-color:var(--bs-primary); } \ No newline at end of file diff --git a/assets/js/leaflet/leafembed.js b/assets/js/leaflet/leafembed.js index 5b8e556e..a9319cc8 100644 --- a/assets/js/leaflet/leafembed.js +++ b/assets/js/leaflet/leafembed.js @@ -1,28 +1,17 @@ - - var map; -var ajaxRequest; -var plotlist; var plotlayers=[]; +var iconsList={'qso':{'color':'#FF0000','icon':'fas fa-dot-circle'}}; -var greenIcon = L.icon({ - iconUrl: icon_dot_url, - iconSize: [10, 10], // size of the icon -}); +var stationIcon = L.divIcon({className:'cspot_station'}); +var qsoIcon = L.divIcon({className:'cspot_qso'}); //default (fas fa-dot-circle red) +var qsoconfirmIcon = L.divIcon({className:'cspot_qsoconfirm'}); +var redIconImg = L.icon({ iconUrl: icon_dot_url, iconSize: [10, 10] }); // old // var osmUrl = $('#leafembed').attr("tileUrl"); -function initmap(ShowGrid = 'No', MapTag = 'map') { - // set up AJAX request - ajaxRequest=getXmlHttpObject(); - if (ajaxRequest==null) { - alert ("This browser does not support HTTP Request"); - return; - } - +function initmap(ShowGrid='No', MapTag='map', options={}) { // set up the map map = new L.Map(MapTag); - // create the tile layer with correct attribution var osmAttrib='Map data © OpenStreetMap contributors'; var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 12, attribution: osmAttrib}); @@ -35,54 +24,64 @@ function initmap(ShowGrid = 'No', MapTag = 'map') { hideControlContainer: true }).addTo(map); - // start the map in South-East England - map.setView(new L.LatLng(q_lat, q_lng), q_zoom); - + // new synthaxe, use array by function argument // + if (typeof options.q_lat!=="undefined") { _q_lat = options.q_lat; } else { if (typeof q_lat!=="undefined") { _q_lat = q_lat; } else { _q_lat = 0; } } + if (typeof options.q_lng!=="undefined") { _q_lng = options.q_lng; } else { if (typeof q_lng!=="undefined") { _q_lng = q_lng; } else { _q_lng = 0; } } + if (typeof options.q_zoom!=="undefined") { _q_zoom = options.q_zoom; } else { if (typeof q_zoom!=="undefined") { _q_zoom = q_zoom; } else { _q_zoom = 1; } } + if (typeof options.url_qso!=="undefined") { _url_qso = options.url_qso; } else { if (typeof qso_loc!=="undefined") { _url_qso = qso_loc; } else { _url_qso = ''; console.log('[ERROR] url with qso location not defined.'); } } + options.map_id = '#'+MapTag; + + // start the map in center of word, it nothing is defined + map.setView(new L.LatLng(_q_lat, _q_lng), _q_zoom); map.addLayer(osm); - askForPlots(); + //map.on('moveend', onMapMove); // all data load directecty, without interest in recharging during a movement + var layerControl = new L.Control.Layers(null, { 'Gridsquares': maidenhead = L.maidenhead() }).addTo(map); + if(ShowGrid == "Yes") { maidenhead.addTo(map); } - map.on('moveend', onMapMove); + // get map custon infos // + $.ajax({ + url: base_url+'index.php/user_options/get_map_custom', type: 'GET', dataType: 'json', + error: function() { console.log('[ERROR] ajax get_map_custom() function return error.'); }, + success: function(json_mapinfo) { + if (typeof json_mapinfo.qso !== "undefined") { iconsList = json_mapinfo; } + if(json_mapinfo.gridsquare_show == "1") { maidenhead.addTo(map); } + //console.log(_url_qso); + askForPlots(_url_qso, options); + } + }); +} - if(ShowGrid == "Yes") { - var maidenhead = L.maidenhead().addTo(map); - } - - var layerControl = new L.Control.Layers(null, { - 'Gridsquares': maidenhead = L.maidenhead() - }).addTo(map); -} - -function getXmlHttpObject() { - if (window.XMLHttpRequest) { return new XMLHttpRequest(); } - if (window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } - return null; -} - -function askForPlots() { - // request the marker info with AJAX for the current bounds - ajaxRequest.onreadystatechange = stateChanged; - ajaxRequest.open('GET', qso_loc, true); - ajaxRequest.send(null); -} - -function stateChanged() { - // if AJAX returned a list of markers, add them to the map - if (ajaxRequest.readyState==4) { - //use the info here that was returned - if (ajaxRequest.status==200) { - plotlist=eval("(" + ajaxRequest.responseText + ")"); - plotlist = plotlist['markers']; - removeMarkers(); - for (i=0;i"+plotlist[i].label+""+plotlist[i].html); - plotlayers.push(plotmark); - } - } +function askForPlots(_url_qso, options={}) { + removeMarkers(); + $.ajax({ + url: _url_qso, type: 'GET', dataType: 'json', + error: function() { console.log('[ERROR] ajax askForPlots() function return error.'); }, + success: function(plotjson) { + if ((typeof plotjson['markers'] !== "undefined")&&(plotjson['markers'].length>0)) { + for (i=0;i"+_plot.label+""):""; + if ((_plot.label+_plot.html)!="") { plotmark.bindPopup(_plot.label+_plot.html); } } + plotlayers.push(plotmark); } function removeMarkers() { @@ -90,8 +89,4 @@ function removeMarkers() { map.removeLayer(plotlayers[i]); } plotlayers=[]; -} - -function onMapMove(e) { - askForPlots(); -} +} \ No newline at end of file