Merge branch 'dev' into patch-1
这个提交包含在:
		
						当前提交
						1eb655b5a2
					
				
					共有  24 个文件被更改,包括 358 次插入 和 133 次删除
				
			
		|  | @ -14,9 +14,34 @@ class Components extends CI_Controller { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	public function index() { | 	public function index() { | ||||||
|         $this->load->model('stations'); | 		$this->load->model("user_options_model"); | ||||||
|  | 		$hkey_opt=$this->user_options_model->get_options('hamsat',array('option_name'=>'hamsat_key','option_key'=>'api'))->result(); | ||||||
|  | 		if (count($hkey_opt)>0) { | ||||||
|  | 			$data['user_hamsat_key'] = $hkey_opt[0]->option_value; | ||||||
|  | 		} else { | ||||||
|  | 			$data['user_hamsat_key']=''; | ||||||
|  | 		} | ||||||
| 		$url = 'https://hams.at/api/alerts/upcoming'; | 		$url = 'https://hams.at/api/alerts/upcoming'; | ||||||
|  | 		if ($data['user_hamsat_key'] ?? '' != '') { | ||||||
|  | 			$options = array( | ||||||
|  | 				'http' => array( | ||||||
|  | 					'method' => 'GET', | ||||||
|  | 					'header' => "Authorization: Bearer ".$data['user_hamsat_key']."\r\n" | ||||||
|  | 				) | ||||||
|  | 			); | ||||||
|  | 			$context = stream_context_create($options); | ||||||
|  | 			$json = file_get_contents($url, false, $context); | ||||||
|  | 		} else { | ||||||
| 			$json = file_get_contents($url); | 			$json = file_get_contents($url); | ||||||
|  | 		} | ||||||
|  | 		$hkey_opt=$this->user_options_model->get_options('hamsat',array('option_name'=>'hamsat_key','option_key'=>'workable'))->result(); | ||||||
|  | 		if (count($hkey_opt)>0) { | ||||||
|  | 			$data['user_hamsat_workable_only'] = $hkey_opt[0]->option_value; | ||||||
|  | 		} else { | ||||||
|  | 			$data['user_hamsat_workable_only'] = 0; | ||||||
|  | 		} | ||||||
|  | 
 | ||||||
|  | 		$this->load->model('stations'); | ||||||
| 		$data['rovedata'] = json_decode($json, true); | 		$data['rovedata'] = json_decode($json, true); | ||||||
| 		$data['gridsquare'] = strtoupper($this->stations->find_gridsquare()); | 		$data['gridsquare'] = strtoupper($this->stations->find_gridsquare()); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -202,6 +202,8 @@ class Contesting extends CI_Controller { | ||||||
|         		$custom_date_format = $this->session->userdata('user_date_format'); |         		$custom_date_format = $this->session->userdata('user_date_format'); | ||||||
| 			$abstimeb4=date($custom_date_format, strtotime($result->row()->COL_TIME_OFF)).' '.date('H:i',strtotime($result->row()->COL_TIME_OFF)); | 			$abstimeb4=date($custom_date_format, strtotime($result->row()->COL_TIME_OFF)).' '.date('H:i',strtotime($result->row()->COL_TIME_OFF)); | ||||||
| 			echo json_encode(array('message' => 'Worked at '.$abstimeb4.' ('.$timeb4.' ago) before')); | 			echo json_encode(array('message' => 'Worked at '.$abstimeb4.' ('.$timeb4.' ago) before')); | ||||||
|  | 		} else { | ||||||
|  | 			echo json_encode(array('message' => 'OKAY')); | ||||||
| 		} | 		} | ||||||
| 		return; | 		return; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -95,6 +95,8 @@ class User extends CI_Controller { | ||||||
| 				$data['user_qso_end_times'] = $this->input->post('user_qso_end_times'); | 				$data['user_qso_end_times'] = $this->input->post('user_qso_end_times'); | ||||||
| 				$data['user_quicklog'] = $this->input->post('user_quicklog'); | 				$data['user_quicklog'] = $this->input->post('user_quicklog'); | ||||||
| 				$data['user_quicklog_enter'] = $this->input->post('user_quicklog_enter'); | 				$data['user_quicklog_enter'] = $this->input->post('user_quicklog_enter'); | ||||||
|  | 				$data['user_hamsat_key'] = $this->input->post('user_hamsat_key'); | ||||||
|  | 				$data['user_hamsat_workable_only'] = $this->input->post('user_hamsat_workable_only'); | ||||||
| 				$data['language'] = $this->input->post('language'); | 				$data['language'] = $this->input->post('language'); | ||||||
| 				$this->load->view('user/edit', $data); | 				$this->load->view('user/edit', $data); | ||||||
| 			} else { | 			} else { | ||||||
|  | @ -133,7 +135,9 @@ class User extends CI_Controller { | ||||||
| 				$this->input->post('user_qso_end_times'), | 				$this->input->post('user_qso_end_times'), | ||||||
| 				$this->input->post('user_quicklog'), | 				$this->input->post('user_quicklog'), | ||||||
| 				$this->input->post('user_quicklog_enter'), | 				$this->input->post('user_quicklog_enter'), | ||||||
| 				$this->input->post('language') | 				$this->input->post('language'), | ||||||
|  | 				$this->input->post('user_hamsat_key'), | ||||||
|  | 				$this->input->post('user_hamsat_workable_only')                             | ||||||
| 				)) { | 				)) { | ||||||
| 				// Check for errors
 | 				// Check for errors
 | ||||||
| 				case EUSERNAMEEXISTS: | 				case EUSERNAMEEXISTS: | ||||||
|  | @ -491,6 +495,30 @@ class User extends CI_Controller { | ||||||
| 				$data['user_winkey'] = $q->winkey; | 				$data['user_winkey'] = $q->winkey; | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
|  | 			$this->load->model('user_options_model'); | ||||||
|  | 			$hamsat_user_object = $this->user_options_model->get_options('hamsat')->result(); | ||||||
|  | 
 | ||||||
|  | 			if($this->input->post('user_hamsat_key', true)) { | ||||||
|  | 				$data['user_hamsat_key'] = $this->input->post('user_hamsat_key', true); | ||||||
|  | 			} else { | ||||||
|  | 				// get $q->hamsat_key if its set if not null
 | ||||||
|  | 				if(isset($hamsat_user_object[0]->option_value)) { | ||||||
|  | 					$data['user_hamsat_key'] = $hamsat_user_object[0]->option_value; | ||||||
|  | 				} else { | ||||||
|  | 					$data['user_hamsat_key'] = ""; | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
|  | 			if($this->input->post('user_hamsat_workable_only')) { | ||||||
|  | 				$data['user_hamsat_workable_only'] = $this->input->post('user_hamsat_workable_only', false); | ||||||
|  | 			} else { | ||||||
|  | 				if(isset($hamsat_user_object[1]->option_value)) { | ||||||
|  | 					$data['user_hamsat_workable_only'] = $hamsat_user_object[1]->option_value; | ||||||
|  | 				} else { | ||||||
|  | 					$data['user_hamsat_workable_only'] = ""; | ||||||
|  | 				} | ||||||
|  | 			} | ||||||
|  | 
 | ||||||
| 			// [MAP Custom] GET user options //
 | 			// [MAP Custom] GET user options //
 | ||||||
| 			$this->load->model('user_options_model'); | 			$this->load->model('user_options_model'); | ||||||
| 			$options_object = $this->user_options_model->get_options('map_custom')->result(); | 			$options_object = $this->user_options_model->get_options('map_custom')->result(); | ||||||
|  | @ -614,6 +642,8 @@ class User extends CI_Controller { | ||||||
| 			$data['user_quicklog_enter'] = $this->input->post('user_quicklog_enter'); | 			$data['user_quicklog_enter'] = $this->input->post('user_quicklog_enter'); | ||||||
| 			$data['language'] = $this->input->post('language'); | 			$data['language'] = $this->input->post('language'); | ||||||
| 			$data['user_winkey'] = $this->input->post('user_winkey'); | 			$data['user_winkey'] = $this->input->post('user_winkey'); | ||||||
|  | 			$data['user_hamsat_key'] = $this->input->post('user_hamsat_key'); | ||||||
|  | 			$data['user_hamsat_workable_only'] = $this->input->post('user_hamsat_workable_only'); | ||||||
| 			$this->load->view('user/edit'); | 			$this->load->view('user/edit'); | ||||||
| 			$this->load->view('interface_assets/footer'); | 			$this->load->view('interface_assets/footer'); | ||||||
| 		} | 		} | ||||||
|  |  | ||||||
|  | @ -127,3 +127,8 @@ $lang['account_qso_logging_options'] = "QSO Logging Options"; | ||||||
| $lang['account_third_party_services'] = "Third Party Services"; | $lang['account_third_party_services'] = "Third Party Services"; | ||||||
| $lang['account_default_values'] = "Default Values"; | $lang['account_default_values'] = "Default Values"; | ||||||
| $lang['account_miscellaneous'] = "Miscellaneous"; | $lang['account_miscellaneous'] = "Miscellaneous"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  |  | ||||||
|  | @ -127,3 +127,8 @@ $lang['account_qso_logging_options'] = "QSO录入选项"; | ||||||
| $lang['account_third_party_services'] = "第三方服务"; | $lang['account_third_party_services'] = "第三方服务"; | ||||||
| $lang['account_default_values'] = "默认值"; | $lang['account_default_values'] = "默认值"; | ||||||
| $lang['account_miscellaneous'] = "其他"; | $lang['account_miscellaneous'] = "其他"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  |  | ||||||
|  | @ -127,3 +127,8 @@ $lang['account_qso_logging_options'] = "QSO Logging Options"; | ||||||
| $lang['account_third_party_services'] = "Third Party Services"; | $lang['account_third_party_services'] = "Third Party Services"; | ||||||
| $lang['account_default_values'] = "Default Values"; | $lang['account_default_values'] = "Default Values"; | ||||||
| $lang['account_miscellaneous'] = "Miscellaneous"; | $lang['account_miscellaneous'] = "Miscellaneous"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  |  | ||||||
|  | @ -127,3 +127,8 @@ $lang['account_qso_logging_options'] = "QSO Logging Options"; | ||||||
| $lang['account_third_party_services'] = "Third Party Services"; | $lang['account_third_party_services'] = "Third Party Services"; | ||||||
| $lang['account_default_values'] = "Default Values"; | $lang['account_default_values'] = "Default Values"; | ||||||
| $lang['account_miscellaneous'] = "Miscellaneous"; | $lang['account_miscellaneous'] = "Miscellaneous"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  |  | ||||||
|  | @ -127,3 +127,9 @@ $lang['account_qso_logging_options'] = "QSO Logging Options"; | ||||||
| $lang['account_third_party_services'] = "Third Party Services"; | $lang['account_third_party_services'] = "Third Party Services"; | ||||||
| $lang['account_default_values'] = "Default Values"; | $lang['account_default_values'] = "Default Values"; | ||||||
| $lang['account_miscellaneous'] = "Miscellaneous"; | $lang['account_miscellaneous'] = "Miscellaneous"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  | $lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; | ||||||
|  |  | ||||||
|  | @ -127,3 +127,8 @@ $lang['account_qso_logging_options'] = "QSO Logging Options"; | ||||||
| $lang['account_third_party_services'] = "Third Party Services"; | $lang['account_third_party_services'] = "Third Party Services"; | ||||||
| $lang['account_default_values'] = "Default Values"; | $lang['account_default_values'] = "Default Values"; | ||||||
| $lang['account_miscellaneous'] = "Miscellaneous"; | $lang['account_miscellaneous'] = "Miscellaneous"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  |  | ||||||
|  | @ -125,3 +125,8 @@ $lang['account_qso_logging_options'] = "QSO Logging Options"; | ||||||
| $lang['account_third_party_services'] = "Third Party Services"; | $lang['account_third_party_services'] = "Third Party Services"; | ||||||
| $lang['account_default_values'] = "Valeur par défaut"; | $lang['account_default_values'] = "Valeur par défaut"; | ||||||
| $lang['account_miscellaneous'] = "Divers"; | $lang['account_miscellaneous'] = "Divers"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  |  | ||||||
|  | @ -127,3 +127,8 @@ $lang['account_qso_logging_options'] = "QSO-Logging Optionen"; | ||||||
| $lang['account_third_party_services'] = "Externe Dienste"; | $lang['account_third_party_services'] = "Externe Dienste"; | ||||||
| $lang['account_default_values'] = "Standardwerte / Favoriten"; | $lang['account_default_values'] = "Standardwerte / Favoriten"; | ||||||
| $lang['account_miscellaneous'] = "Verschiedenes"; | $lang['account_miscellaneous'] = "Verschiedenes"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "Siehe dein Profil unter <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Zeige nur Überflüge an, die gearbeitet werden können"; | ||||||
|  |  | ||||||
|  | @ -127,3 +127,8 @@ $lang['account_qso_logging_options'] = "QSO Logging Options"; | ||||||
| $lang['account_third_party_services'] = "Third Party Services"; | $lang['account_third_party_services'] = "Third Party Services"; | ||||||
| $lang['account_default_values'] = "Default Values"; | $lang['account_default_values'] = "Default Values"; | ||||||
| $lang['account_miscellaneous'] = "Miscellaneous"; | $lang['account_miscellaneous'] = "Miscellaneous"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  |  | ||||||
|  | @ -127,3 +127,8 @@ $lang['account_qso_logging_options'] = "QSO Logging Options"; | ||||||
| $lang['account_third_party_services'] = "Third Party Services"; | $lang['account_third_party_services'] = "Third Party Services"; | ||||||
| $lang['account_default_values'] = "Default Values"; | $lang['account_default_values'] = "Default Values"; | ||||||
| $lang['account_miscellaneous'] = "Miscellaneous"; | $lang['account_miscellaneous'] = "Miscellaneous"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  |  | ||||||
|  | @ -127,3 +127,8 @@ $lang['account_qso_logging_options'] = "QSO Logging Options"; | ||||||
| $lang['account_third_party_services'] = "Third Party Services"; | $lang['account_third_party_services'] = "Third Party Services"; | ||||||
| $lang['account_default_values'] = "Default Values"; | $lang['account_default_values'] = "Default Values"; | ||||||
| $lang['account_miscellaneous'] = "Miscellaneous"; | $lang['account_miscellaneous'] = "Miscellaneous"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  |  | ||||||
|  | @ -127,3 +127,9 @@ $lang['account_qso_logging_options'] = "Настройки записи QSO"; | ||||||
| $lang['account_third_party_services'] = "Сторонние сервисы"; | $lang['account_third_party_services'] = "Сторонние сервисы"; | ||||||
| $lang['account_default_values'] = "Значения по умолчанию"; | $lang['account_default_values'] = "Значения по умолчанию"; | ||||||
| $lang['account_miscellaneous'] = "Разное"; | $lang['account_miscellaneous'] = "Разное"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  | $lang['account_hamsat_workable_only_hint'] = "If enabled shows only workable passes based on the gridsquare set in your hams.at account. Requires private feed key to be set."; | ||||||
|  |  | ||||||
|  | @ -127,3 +127,8 @@ $lang['account_qso_logging_options'] = "Opciones del Registro de QSO"; | ||||||
| $lang['account_third_party_services'] = "Servicios de Terceros"; | $lang['account_third_party_services'] = "Servicios de Terceros"; | ||||||
| $lang['account_default_values'] = "Valores por Defecto"; | $lang['account_default_values'] = "Valores por Defecto"; | ||||||
| $lang['account_miscellaneous'] = "Otras Opciones"; | $lang['account_miscellaneous'] = "Otras Opciones"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  |  | ||||||
|  | @ -127,3 +127,8 @@ $lang['account_qso_logging_options'] = "QSO Logging Options"; | ||||||
| $lang['account_third_party_services'] = "Third Party Services"; | $lang['account_third_party_services'] = "Third Party Services"; | ||||||
| $lang['account_default_values'] = "Default Values"; | $lang['account_default_values'] = "Default Values"; | ||||||
| $lang['account_miscellaneous'] = "Miscellaneous"; | $lang['account_miscellaneous'] = "Miscellaneous"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  |  | ||||||
|  | @ -127,3 +127,8 @@ $lang['account_qso_logging_options'] = "QSO Logging Options"; | ||||||
| $lang['account_third_party_services'] = "Third Party Services"; | $lang['account_third_party_services'] = "Third Party Services"; | ||||||
| $lang['account_default_values'] = "Default Values"; | $lang['account_default_values'] = "Default Values"; | ||||||
| $lang['account_miscellaneous'] = "Miscellaneous"; | $lang['account_miscellaneous'] = "Miscellaneous"; | ||||||
|  | 
 | ||||||
|  | $lang['account_hamsat'] = "Hams.at"; | ||||||
|  | $lang['account_hamsat_private_feed_key'] = "Private Feed Key"; | ||||||
|  | $lang['account_hamsat_hint'] = "See your profile at <a href='https://hams.at/users/settings' target='_blank'>https://hams.at/users/settings</a>."; | ||||||
|  | $lang['account_hamsat_workable_only'] = "Show Workable Passes Only"; | ||||||
|  |  | ||||||
|  | @ -149,7 +149,8 @@ class User_Model extends CI_Model { | ||||||
| 		$measurement, $user_date_format, $user_stylesheet, $user_qth_lookup, $user_sota_lookup, $user_wwff_lookup, | 		$measurement, $user_date_format, $user_stylesheet, $user_qth_lookup, $user_sota_lookup, $user_wwff_lookup, | ||||||
| 		$user_pota_lookup, $user_show_notes, $user_column1, $user_column2, $user_column3, $user_column4, $user_column5, | 		$user_pota_lookup, $user_show_notes, $user_column1, $user_column2, $user_column3, $user_column4, $user_column5, | ||||||
| 		$user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload, $user_mastodon_url, | 		$user_show_profile_image, $user_previous_qsl_type, $user_amsat_status_upload, $user_mastodon_url, | ||||||
| 		$user_default_band, $user_default_confirmation, $user_qso_end_times, $user_quicklog, $user_quicklog_enter, $language) { | 		$user_default_band, $user_default_confirmation, $user_qso_end_times, $user_quicklog, $user_quicklog_enter, | ||||||
|  | 		$language, $user_hamsat_key, $user_hamsat_workable_only) { | ||||||
| 		// Check that the user isn't already used
 | 		// Check that the user isn't already used
 | ||||||
| 		if(!$this->exists($username)) { | 		if(!$this->exists($username)) { | ||||||
| 			$data = array( | 			$data = array( | ||||||
|  | @ -184,7 +185,7 @@ class User_Model extends CI_Model { | ||||||
| 				'user_qso_end_times' => xss_clean($user_qso_end_times), | 				'user_qso_end_times' => xss_clean($user_qso_end_times), | ||||||
| 				'user_quicklog' => xss_clean($user_quicklog), | 				'user_quicklog' => xss_clean($user_quicklog), | ||||||
| 				'user_quicklog_enter' => xss_clean($user_quicklog_enter), | 				'user_quicklog_enter' => xss_clean($user_quicklog_enter), | ||||||
| 				'language' => xss_clean($language), | 				'language' => xss_clean($language) | ||||||
| 			); | 			); | ||||||
| 
 | 
 | ||||||
| 			// Check the password is valid
 | 			// Check the password is valid
 | ||||||
|  | @ -202,6 +203,8 @@ class User_Model extends CI_Model { | ||||||
| 			$insert_id = $this->db->insert_id(); | 			$insert_id = $this->db->insert_id(); | ||||||
| 			$this->db->query("insert into bandxuser (bandid, userid, active, cq, dok, dxcc, iota, pota, sig, sota, uscounties, was, wwff, vucc) select bands.id, " . $insert_id . ", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 from bands;"); | 			$this->db->query("insert into bandxuser (bandid, userid, active, cq, dok, dxcc, iota, pota, sig, sota, uscounties, was, wwff, vucc) select bands.id, " . $insert_id . ", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 from bands;"); | ||||||
| 			$this->db->query("insert into paper_types (user_id,paper_name,metric,width,orientation,height) SELECT ".$insert_id.", paper_name, metric, width, orientation,height FROM paper_types where user_id = -1;"); | 			$this->db->query("insert into paper_types (user_id,paper_name,metric,width,orientation,height) SELECT ".$insert_id.", paper_name, metric, width, orientation,height FROM paper_types where user_id = -1;"); | ||||||
|  | 			$this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'hamsat','hamsat_key','api','".xss_clean($user_hamsat_key)."');"); | ||||||
|  | 			$this->db->query("insert into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $insert_id . ", 'hamsat','hamsat_key','workable','".xss_clean($user_hamsat_workable_only)."');"); | ||||||
| 			return OK; | 			return OK; | ||||||
| 		} else { | 		} else { | ||||||
| 			return EUSERNAMEEXISTS; | 			return EUSERNAMEEXISTS; | ||||||
|  | @ -252,6 +255,9 @@ class User_Model extends CI_Model { | ||||||
| 					'winkey' => xss_clean($fields['user_winkey']), | 					'winkey' => xss_clean($fields['user_winkey']), | ||||||
| 				); | 				); | ||||||
| 
 | 
 | ||||||
|  | 				$this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'hamsat','hamsat_key','api','".xss_clean($fields['user_hamsat_key'])."');"); | ||||||
|  | 				$this->db->query("replace into user_options (user_id, option_type, option_name, option_key, option_value) values (" . $fields['id'] . ", 'hamsat','hamsat_key','workable','".xss_clean($fields['user_hamsat_workable_only'])."');"); | ||||||
|  | 
 | ||||||
| 				// Check to see if the user is allowed to change user levels
 | 				// Check to see if the user is allowed to change user levels
 | ||||||
| 				if($this->session->userdata('user_type') == 99) { | 				if($this->session->userdata('user_type') == 99) { | ||||||
| 					$data['user_type'] = $fields['user_type']; | 					$data['user_type'] = $fields['user_type']; | ||||||
|  | @ -308,6 +314,7 @@ class User_Model extends CI_Model { | ||||||
| 
 | 
 | ||||||
| 		if($this->exists_by_id($user_id)) { | 		if($this->exists_by_id($user_id)) { | ||||||
| 			$this->db->query("DELETE FROM ".$this->config->item('auth_table')." WHERE user_id = '".$user_id."'"); | 			$this->db->query("DELETE FROM ".$this->config->item('auth_table')." WHERE user_id = '".$user_id."'"); | ||||||
|  | 			$this->db->query("delete from user_options where user_id=?",$user_id); | ||||||
| 
 | 
 | ||||||
| 			return 1; | 			return 1; | ||||||
| 		} else { | 		} else { | ||||||
|  | @ -380,7 +387,7 @@ class User_Model extends CI_Model { | ||||||
| 			'active_station_logbook' => $u->row()->active_station_logbook, | 			'active_station_logbook' => $u->row()->active_station_logbook, | ||||||
| 			'language' => isset($u->row()->language) ? $u->row()->language: 'english', | 			'language' => isset($u->row()->language) ? $u->row()->language: 'english', | ||||||
| 			'isWinkeyEnabled' => $u->row()->winkey, | 			'isWinkeyEnabled' => $u->row()->winkey, | ||||||
| 			'hasQrzKey' => $this->hasQrzKey($u->row()->user_id), | 			'hasQrzKey' => $this->hasQrzKey($u->row()->user_id) | ||||||
| 		); | 		); | ||||||
| 
 | 
 | ||||||
| 		$this->session->set_userdata($userdata); | 		$this->session->set_userdata($userdata); | ||||||
|  |  | ||||||
|  | @ -33,8 +33,10 @@ class User_options_model extends CI_Model { | ||||||
| 		} | 		} | ||||||
| 	}	 | 	}	 | ||||||
| 
 | 
 | ||||||
| 	public function get_options($option_type, $option_array=null) { | 	public function get_options($option_type, $option_array=null, $uid=null) { | ||||||
|  | 		if ($uid ?? '' == '') { | ||||||
| 			$uid=$this->session->userdata('user_id'); | 			$uid=$this->session->userdata('user_id'); | ||||||
|  | 		} | ||||||
| 		$sql_more = ""; | 		$sql_more = ""; | ||||||
| 		$array_sql_value = array($uid, $option_type); | 		$array_sql_value = array($uid, $option_type); | ||||||
| 		if (is_array($option_array)) { | 		if (is_array($option_array)) { | ||||||
|  |  | ||||||
|  | @ -1,7 +1,18 @@ | ||||||
| <div class="table-responsive"> | <div class="table-responsive"> | ||||||
|     <br> |     <br> | ||||||
|     <h2>Hamsat - Satellite Rovers</h2> |     <h2>Hamsat - Satellite Rovers</h2> | ||||||
|     <p>This data is from <a target="_blank" href="https://hams.at/">https://hams.at/</a></p> |     <p>This data is from <a target="_blank" href="https://hams.at/">https://hams.at/</a>. | ||||||
|  |     <?php if ($user_hamsat_workable_only) { | ||||||
|  |     echo " Only workable passes shown."; | ||||||
|  |     } else { | ||||||
|  |     echo " All passes shown."; | ||||||
|  |     }?>
 | ||||||
|  |     </p> | ||||||
|  |     <?php if ($user_hamsat_workable_only && $user_hamsat_key == '') { ?>
 | ||||||
|  |     <div class="alert alert-warning" role="warning"> | ||||||
|  |        Private feed key empty. Please set the feed key in your profile. | ||||||
|  |     </div> | ||||||
|  |     <?php } else { ?>
 | ||||||
|     <?php if ($rovedata['data'] == []) { ?>
 |     <?php if ($rovedata['data'] == []) { ?>
 | ||||||
|      <div class="alert alert-warning" role="warning"> |      <div class="alert alert-warning" role="warning"> | ||||||
|        <?php echo lang('hams_at_no_activations_found');?>
 |        <?php echo lang('hams_at_no_activations_found');?>
 | ||||||
|  | @ -15,13 +26,20 @@ | ||||||
|                    <th>Callsign</th> |                    <th>Callsign</th> | ||||||
|                    <th>Comment</th> |                    <th>Comment</th> | ||||||
|                    <th>Satellite</th> |                    <th>Satellite</th> | ||||||
|  |                    <th>Mode</th> | ||||||
|                    <th>Gridsquare(s)</th> |                    <th>Gridsquare(s)</th> | ||||||
|  |                    <th>Workable</th> | ||||||
|                    <th></th> |                    <th></th> | ||||||
|                    <th></th> |                    <th></th> | ||||||
|                </tr> |                </tr> | ||||||
|            </thead> |            </thead> | ||||||
|            <tbody> |            <tbody> | ||||||
|             <?php foreach ($rovedata['data'] as $rove) : ?>
 |                <?php foreach ($rovedata['data'] as $rove) : | ||||||
|  |                if ($user_hamsat_workable_only) { | ||||||
|  |                   if (!$rove['is_workable']) { | ||||||
|  |                      continue; | ||||||
|  |                   } | ||||||
|  |                } ?>
 | ||||||
|                    <tr> |                    <tr> | ||||||
|                        <td> |                        <td> | ||||||
|                            <?php |                            <?php | ||||||
|  | @ -31,7 +49,7 @@ | ||||||
|                                // If Logged in and session exists
 |                                // If Logged in and session exists
 | ||||||
|                                $custom_date_format = $this->session->userdata('user_date_format'); |                                $custom_date_format = $this->session->userdata('user_date_format'); | ||||||
|                            } else { |                            } else { | ||||||
|                             // Get Default date format from /config/cloudlog.php
 |                                // Get Default date format from /config/wavelog.php
 | ||||||
|                                $custom_date_format = $this->config->item('qso_date_format'); |                                $custom_date_format = $this->config->item('qso_date_format'); | ||||||
|                            } |                            } | ||||||
|     |     | ||||||
|  | @ -80,7 +98,8 @@ | ||||||
|                           } |                           } | ||||||
|     |     | ||||||
|                        ?>
 |                        ?>
 | ||||||
|                     <td><span data-bs-toggle="tooltip" title="<?php if ($rove['mhz'] != '') { printf("%.3f", $rove['mhz']); echo " ".$direction ?? ''; } ?>"><?= $rove['satellite']['name'] ?></span> <span title="<?php echo $rove['mode']; ?>" class="badge <?php echo $modeclass; ?>"><?php echo $rove['mode']; ?></span></td>
 |                        <td><span data-bs-toggle="tooltip" title="<?php if ($rove['mhz'] != '') { printf("%.3f", $rove['mhz']); echo " ".$direction ?? ''; } ?>"><?= $rove['satellite']['name'] ?></span></td>
 | ||||||
|  |                        <td><span title="<?php echo $rove['mode']; ?>" class="badge <?php echo $modeclass; ?>"><?php echo $rove['mode']; ?></span></td>
 | ||||||
|                        <td> |                        <td> | ||||||
|     |     | ||||||
|     |     | ||||||
|  | @ -97,6 +116,19 @@ | ||||||
|                            ?>
 |                            ?>
 | ||||||
|     |     | ||||||
|     |     | ||||||
|  |                        </td> | ||||||
|  |                        <td> | ||||||
|  |                        <?php | ||||||
|  |                           if ($user_hamsat_key != '') { | ||||||
|  |                              if ($rove['is_workable']) { | ||||||
|  |                                 echo date("H:i", strtotime($rove['workable_start_at']))." - ".date("H:i", strtotime($rove['workable_end_at'])); | ||||||
|  |                              } else { | ||||||
|  |                                 echo "<span data-bs-toggle=\"tooltip\" title=\"No\" class=\"badge bg-danger\">No</span>"; | ||||||
|  |                              } | ||||||
|  |                           } else { | ||||||
|  |                                 echo "<span data-bs-toggle=\"tooltip\" title=\"Unkown\" class=\"badge bg-warning\">Unknown</span>"; | ||||||
|  |                           } | ||||||
|  |                        ?>
 | ||||||
|                        </td> |                        </td> | ||||||
|                        <td><a href="<?php echo $rove['url']; ?>" target="_blank">Track</a></td> |                        <td><a href="<?php echo $rove['url']; ?>" target="_blank">Track</a></td> | ||||||
|                        <?php |                        <?php | ||||||
|  | @ -107,10 +139,16 @@ | ||||||
|                               break; |                               break; | ||||||
|                            } |                            } | ||||||
|                        ?>
 |                        ?>
 | ||||||
|                     <td><a href="https://sat.fg8oj.com/sked.php?s%5B%5D=<?php echo $sat; ?>&l=<?php echo strtoupper($gridsquare); ?>&el1=0&l2=<?php echo $rove['grids'][0]; ?>&el2=0&duration=1&start=0&OK=Search" target="_blank">Sked</a></td> |                        <td> | ||||||
|  |                        <?php | ||||||
|  |                           if ($rove['is_workable'] || $user_hamsat_key == '') { ?>
 | ||||||
|  |    <a href="https://sat.fg8oj.com/sked.php?s%5B%5D=<?php echo $sat; ?>&l=<?php echo strtoupper($gridsquare); ?>&el1=0&l2=<?php echo $rove['grids'][0]; ?>&el2=0&duration=1&start=0&OK=Search" target="_blank">Sked</a> | ||||||
|  |                        <?php } ?>
 | ||||||
|  |                        </td> | ||||||
|                    </tr> |                    </tr> | ||||||
|                <?php endforeach; ?>
 |                <?php endforeach; ?>
 | ||||||
|            </tbody> |            </tbody> | ||||||
|        </table> |        </table> | ||||||
|        <?php } ?>
 |        <?php } ?>
 | ||||||
|  |     <?php } ?>
 | ||||||
| </div> | </div> | ||||||
|  |  | ||||||
|  | @ -764,6 +764,32 @@ | ||||||
| 							</div> | 							</div> | ||||||
| 						</div> | 						</div> | ||||||
| 					</div> | 					</div> | ||||||
|  | 
 | ||||||
|  | 					<div class="row"> | ||||||
|  | 						<!-- Hams.at Settings --> | ||||||
|  | 						<div class="col-md"> | ||||||
|  | 							<div class="card"> | ||||||
|  | 								<div class="card-header"><?php echo lang('account_hamsat'); ?></div>
 | ||||||
|  | 								<div class="card-body"> | ||||||
|  | 									<div class="mb-3"> | ||||||
|  | 									<label><?php echo lang('account_hamsat_private_feed_key'); ?></label>
 | ||||||
|  | 										<input class="form-control" type="text" name="user_hamsat_key" value="<?php if(isset($user_hamsat_key)) { echo $user_hamsat_key; } ?>" /> | ||||||
|  | 										<small class="form-text text-muted"><?php echo lang('account_hamsat_hint'); ?></a></small>
 | ||||||
|  | 									</div> | ||||||
|  | 									<div class="mb-3"> | ||||||
|  | 										<label><?php echo lang('account_hamsat_workable_only'); ?></label>
 | ||||||
|  | 										<?php if(!isset($user_hamsat_workable_only)) { $user_hamsat_workable_only='0'; }?>
 | ||||||
|  | 										<select class="form-select" name="user_hamsat_workable_only" id="user_hamsat_workable_only"> | ||||||
|  | 											<option value="0" <?php if ($user_hamsat_workable_only == 0) { echo 'selected="selected"'; } ?>><?php echo lang('general_word_no'); ?></option>
 | ||||||
|  | 											<option value="1" <?php if ($user_hamsat_workable_only == 1) { echo 'selected="selected"'; } ?>><?php echo lang('general_word_yes'); ?></option>
 | ||||||
|  | 										</select> | ||||||
|  | 										<small class="form-text text-muted"><?php echo lang('account_hamsat_workable_only_hint'); ?></small>
 | ||||||
|  | 									</div> | ||||||
|  | 								</div> | ||||||
|  | 							</div> | ||||||
|  | 						</div> | ||||||
|  | 
 | ||||||
|  | 					</div> | ||||||
| 				</div> | 				</div> | ||||||
| 			</div> | 			</div> | ||||||
| 		</div> | 		</div> | ||||||
|  |  | ||||||
|  | @ -336,6 +336,8 @@ | ||||||
|                         <td><?php echo lang('gen_hamradio_dok'); ?></td>
 |                         <td><?php echo lang('gen_hamradio_dok'); ?></td>
 | ||||||
|                         <?php if (preg_match('/^[A-Y]\d{2}$/', $row->COL_DARC_DOK)) { ?>
 |                         <?php if (preg_match('/^[A-Y]\d{2}$/', $row->COL_DARC_DOK)) { ?>
 | ||||||
|                         <td><a href="https://www.darc.de/<?php echo $row->COL_DARC_DOK; ?>" target="_blank"><?php echo $row->COL_DARC_DOK; ?></a></td>
 |                         <td><a href="https://www.darc.de/<?php echo $row->COL_DARC_DOK; ?>" target="_blank"><?php echo $row->COL_DARC_DOK; ?></a></td>
 | ||||||
|  |                         <?php } else if (preg_match('/^DV[ABCDEFGHIKLMNOPQRSTUVWXY]$/', $row->COL_DARC_DOK)) { ?>
 | ||||||
|  |                         <td><a href="https://www.darc.de/der-club/distrikte/<?php echo strtolower(substr($row->COL_DARC_DOK, 2, 1)); ?>" target="_blank"><?php echo $row->COL_DARC_DOK; ?></a></td>
 | ||||||
|                         <?php } else if (preg_match('/^Z\d{2}$/', $row->COL_DARC_DOK)) { ?>
 |                         <?php } else if (preg_match('/^Z\d{2}$/', $row->COL_DARC_DOK)) { ?>
 | ||||||
|                         <td><a href="https://<?php echo $row->COL_DARC_DOK; ?>.vfdb.org" target="_blank"><?php echo $row->COL_DARC_DOK; ?></a></td>
 |                         <td><a href="https://<?php echo $row->COL_DARC_DOK; ?>.vfdb.org" target="_blank"><?php echo $row->COL_DARC_DOK; ?></a></td>
 | ||||||
|                         <?php } else { ?>
 |                         <?php } else { ?>
 | ||||||
|  |  | ||||||
|  | @ -103,6 +103,11 @@ $(function () { | ||||||
| 	}); | 	}); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
|  | // checked if worked before after blur
 | ||||||
|  | $("#callsign").blur(function () { | ||||||
|  | 	        checkIfWorkedBefore(); | ||||||
|  | }); | ||||||
|  | 
 | ||||||
| // Here we capture keystrokes to execute functions
 | // Here we capture keystrokes to execute functions
 | ||||||
| document.onkeyup = function (e) { | document.onkeyup = function (e) { | ||||||
| 	// ALT-W wipe
 | 	// ALT-W wipe
 | ||||||
|  | @ -217,8 +222,8 @@ $("#callsign").keyup(function () { | ||||||
| 				highlight(call.toUpperCase()); | 				highlight(call.toUpperCase()); | ||||||
| 			} | 			} | ||||||
| 		}); | 		}); | ||||||
| 
 | 		// moved to blur
 | ||||||
| 		checkIfWorkedBefore(); | 		// checkIfWorkedBefore();
 | ||||||
| 		var qTable = $('.qsotable').DataTable(); | 		var qTable = $('.qsotable').DataTable(); | ||||||
| 		qTable.search(call).draw(); | 		qTable.search(call).draw(); | ||||||
| 	} | 	} | ||||||
|  | @ -242,10 +247,21 @@ function checkIfWorkedBefore() { | ||||||
| 			}, | 			}, | ||||||
| 			success: function (result) { | 			success: function (result) { | ||||||
| 				if (result.message.substr(0, 6) == 'Worked') { | 				if (result.message.substr(0, 6) == 'Worked') { | ||||||
|  | 					$('#callsign_info').removeClass('text-bg-success'); | ||||||
|  | 					$('#callsign_info').addClass('text-bg-danger'); | ||||||
| 					$('#callsign_info').text(result.message); | 					$('#callsign_info').text(result.message); | ||||||
| 				} | 				} | ||||||
|  | 				else if (result.message == "OKAY") { | ||||||
|  | 					$('#callsign_info').removeClass('text-bg-danger'); | ||||||
|  | 					$('#callsign_info').addClass('text-bg-success'); | ||||||
|  | 					$('#callsign_info').text("Go Work Them!"); | ||||||
|  | 				} else { | ||||||
|  | 					$('#callsign_info').text(""); | ||||||
|  | 				} | ||||||
| 			} | 			} | ||||||
| 		}); | 		}); | ||||||
|  | 	} else { | ||||||
|  | 		$('#callsign_info').text(""); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		正在加载…
	
		在新工单中引用