Skip to content

Commit

Permalink
2.6.7
Browse files Browse the repository at this point in the history
  • Loading branch information
magicbug authored Mar 21, 2024
2 parents 9273c2c + 51eb502 commit 167d78f
Show file tree
Hide file tree
Showing 33 changed files with 1,628 additions and 829 deletions.
2 changes: 1 addition & 1 deletion application/config/migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
|
*/

$config['migration_version'] = 173;
$config['migration_version'] = 174;

/*
|--------------------------------------------------------------------------
Expand Down
45 changes: 35 additions & 10 deletions application/controllers/Components.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,39 @@ function __construct() {
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); }
}

public function index() {
$this->load->model('stations');
$url = 'https://hams.at/api/alerts/upcoming';
$json = file_get_contents($url);
$data['rovedata'] = json_decode($json, true);
$data['gridsquare'] = strtoupper($this->stations->find_gridsquare());

// load view
$this->load->view('components/hamsat/table', $data);
}
public function index() {
$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';
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);
}
$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['gridsquare'] = strtoupper($this->stations->find_gridsquare());

// load view
$this->load->view('components/hamsat/table', $data);
}
}
2 changes: 2 additions & 0 deletions application/controllers/Contesting.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ public function checkIfWorkedBefore() {
$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));
echo json_encode(array('message' => 'Worked at '.$abstimeb4.' ('.$timeb4.' ago) before'));
} else {
echo json_encode(array('message' => 'OKAY'));
}
return;
}
Expand Down
61 changes: 58 additions & 3 deletions application/controllers/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,64 @@ public function index()
$data['total_countries_confirmed_eqsl'] = $CountriesBreakdown['Countries_Worked_EQSL'];
$data['total_countries_confirmed_lotw'] = $CountriesBreakdown['Countries_Worked_LOTW'];

$data['dashboard_upcoming_dx_card'] = false;
$data['dashboard_qslcard_card'] = false;
$data['dashboard_eqslcard_card'] = false;
$data['dashboard_lotw_card'] = false;
$data['dashboard_vuccgrids_card'] = false;

$dashboard_options = $this->user_options_model->get_options('dashboard')->result();

foreach ($dashboard_options as $item) {
$option_name = $item->option_name;
$option_key = $item->option_key;
$option_value = $item->option_value;

if ($option_name == 'dashboard_upcoming_dx_card' && $option_key == 'enabled') {
if($option_value == 'true') {
$data['dashboard_upcoming_dx_card'] = true;
} else {
$data['dashboard_upcoming_dx_card'] = false;
}
}

if ($option_name == 'dashboard_qslcards_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_qslcard_card'] = true;
} else {
$data['dashboard_qslcard_card'] = false;
}
}

if ($option_name == 'dashboard_eqslcards_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_eqslcard_card'] = true;
} else {
$data['dashboard_eqslcard_card'] = false;
}
}

if ($option_name == 'dashboard_lotw_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_lotw_card'] = true;
} else {
$data['dashboard_lotw_card'] = false;
}
}

if ($option_name == 'dashboard_vuccgrids_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_vuccgrids_card'] = true;

$data['vucc'] = $this->vucc->fetchVuccSummary();
$data['vuccSAT'] = $this->vucc->fetchVuccSummary('SAT');
} else {
$data['dashboard_vuccgrids_card'] = false;
}
}
}


$QSLStatsBreakdownArray = $this->logbook_model->get_QSLStats($logbooks_locations_array);

$data['total_qsl_sent'] = $QSLStatsBreakdownArray['QSL_Sent'];
Expand All @@ -115,9 +173,6 @@ public function index()

$data['last_five_qsos'] = $this->logbook_model->get_last_qsos('18', $logbooks_locations_array);

$data['vucc'] = $this->vucc->fetchVuccSummary();
$data['vuccSAT'] = $this->vucc->fetchVuccSummary('SAT');

$data['page_title'] = "Dashboard";

$this->load->model('dxcc');
Expand Down
121 changes: 120 additions & 1 deletion application/controllers/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ function add() {
$data['user_qso_end_times'] = $this->input->post('user_qso_end_times');
$data['user_quicklog'] = $this->input->post('user_quicklog');
$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');
$this->load->view('user/edit', $data);
} else {
Expand Down Expand Up @@ -134,6 +136,8 @@ function add() {
$this->input->post('user_quicklog'),
$this->input->post('user_quicklog_enter'),
$this->input->post('language'),
$this->input->post('user_hamsat_key'),
$this->input->post('user_hamsat_workable_only')
)) {
// Check for errors
case EUSERNAMEEXISTS:
Expand Down Expand Up @@ -491,6 +495,87 @@ function edit() {
$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'] = "";
}
}

// Get Settings for Dashboard

// Set defaults
$data['dashboard_upcoming_dx_card'] = false;
$data['dashboard_qslcard_card'] = false;
$data['dashboard_eqslcard_card'] = false;
$data['dashboard_lotw_card'] = false;
$data['dashboard_vuccgrids_card'] = false;

$dashboard_options = $this->user_options_model->get_options('dashboard')->result();

foreach ($dashboard_options as $item) {
$option_name = $item->option_name;
$option_key = $item->option_key;
$option_value = $item->option_value;

if ($option_name == 'dashboard_upcoming_dx_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_upcoming_dx_card'] = true;
} else {
$data['dashboard_upcoming_dx_card'] = false;
}
}

if ($option_name == 'dashboard_qslcards_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_qslcard_card'] = true;
} else {
$data['dashboard_qslcard_card'] = false;
}
}

if ($option_name == 'dashboard_eqslcards_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_eqslcard_card'] = true;
} else {
$data['dashboard_eqslcard_card'] = false;
}
}

if ($option_name == 'dashboard_lotw_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_lotw_card'] = true;
} else {
$data['dashboard_lotw_card'] = false;
}
}

if ($option_name == 'dashboard_vuccgrids_card' && $option_key == 'enabled') {
if($item->option_value == 'true') {
$data['dashboard_vuccgrids_card'] = true;
} else {
$data['dashboard_vuccgrids_card'] = false;
}
}
}

// [MAP Custom] GET user options //
$this->load->model('user_options_model');
$options_object = $this->user_options_model->get_options('map_custom')->result();
Expand Down Expand Up @@ -553,6 +638,36 @@ function edit() {
$this->input->set_cookie($cookie);
}
if($this->session->userdata('user_id') == $this->input->post('id', true)) {
if (isset($_POST['user_dashboard_enable_dxpedition_card'])) {
$this->user_options_model->set_option('dashboard', 'dashboard_upcoming_dx_card', array('enabled' => 'true'));
} else {
$this->user_options_model->set_option('dashboard', 'dashboard_upcoming_dx_card', array('enabled' => 'false'));
}

if (isset($_POST['user_dashboard_enable_qslcards_card'])) {
$this->user_options_model->set_option('dashboard', 'dashboard_qslcards_card', array('enabled' => 'true'));
} else {
$this->user_options_model->set_option('dashboard', 'dashboard_qslcards_card', array('enabled' => 'false'));
}

if (isset($_POST['user_dashboard_enable_eqslcards_card'])) {
$this->user_options_model->set_option('dashboard', 'dashboard_eqslcards_card', array('enabled' => 'true'));
} else {
$this->user_options_model->set_option('dashboard', 'dashboard_eqslcards_card', array('enabled' => 'false'));
}

if (isset($_POST['user_dashboard_enable_lotw_card'])) {
$this->user_options_model->set_option('dashboard', 'dashboard_lotw_card', array('enabled' => 'true'));
} else {
$this->user_options_model->set_option('dashboard', 'dashboard_lotw_card', array('enabled' => 'false'));
}

if (isset($_POST['user_dashboard_enable_vuccgrids_card'])) {
$this->user_options_model->set_option('dashboard', 'dashboard_vuccgrids_card', array('enabled' => 'true'));
} else {
$this->user_options_model->set_option('dashboard', 'dashboard_vuccgrids_card', array('enabled' => 'false'));
}

// [MAP Custom] ADD to user options //
$array_icon = array('station','qso','qsoconfirm');
foreach ($array_icon as $icon) {
Expand Down Expand Up @@ -580,7 +695,6 @@ function edit() {
return;
}
$data['page_title'] = "Edit User";

$this->load->view('interface_assets/header', $data);
$data['user_name'] = $this->input->post('user_name', true);
$data['user_email'] = $this->input->post('user_email', true);
Expand Down Expand Up @@ -614,6 +728,11 @@ function edit() {
$data['user_quicklog_enter'] = $this->input->post('user_quicklog_enter');
$data['language'] = $this->input->post('language');
$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('interface_assets/footer');
}
Expand Down
7 changes: 6 additions & 1 deletion application/language/bulgarian/account_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,9 @@
$lang['account_qso_logging_options'] = "QSO Logging Options";
$lang['account_third_party_services'] = "Third Party Services";
$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";
5 changes: 5 additions & 0 deletions application/language/chinese_simplified/account_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,8 @@
$lang['account_third_party_services'] = "第三方服务";
$lang['account_default_values'] = "默认值";
$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";
5 changes: 5 additions & 0 deletions application/language/czech/account_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,8 @@
$lang['account_third_party_services'] = "Third Party Services";
$lang['account_default_values'] = "Default Values";
$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";
7 changes: 6 additions & 1 deletion application/language/dutch/account_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,9 @@
$lang['account_qso_logging_options'] = "QSO Logging Options";
$lang['account_third_party_services'] = "Third Party Services";
$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";
6 changes: 6 additions & 0 deletions application/language/english/account_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,9 @@
$lang['account_third_party_services'] = "Third Party Services";
$lang['account_default_values'] = "Default Values";
$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.";
7 changes: 6 additions & 1 deletion application/language/finnish/account_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,9 @@
$lang['account_qso_logging_options'] = "QSO Logging Options";
$lang['account_third_party_services'] = "Third Party Services";
$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";
7 changes: 6 additions & 1 deletion application/language/french/account_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,9 @@
$lang['account_qso_logging_options'] = "QSO Logging Options";
$lang['account_third_party_services'] = "Third Party Services";
$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";
7 changes: 6 additions & 1 deletion application/language/german/account_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,9 @@
$lang['account_qso_logging_options'] = "QSO-Logging Optionen";
$lang['account_third_party_services'] = "Externe Dienste";
$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";
Loading

0 comments on commit 167d78f

Please sign in to comment.