Skip to content
Merged

2.8.13 #3430

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'] = 265;
$config['migration_version'] = 266;

/*
|--------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions application/config/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

$route['station-diary/(:any)'] = 'stationdiary/index/$1';
$route['station-diary/(:any)/rss'] = 'stationdiary/rss/$1';
$route['station-diary/(:any)/search'] = 'stationdiary/search/$1';
$route['station-diary/(:any)/entry/(:num)'] = 'stationdiary/entry/$1/$2';
$route['station-diary/(:any)/entry/(:num)/react'] = 'stationdiary/react/$1/$2';
$route['station-diary/(:any)/(:num)'] = 'stationdiary/index/$1/$2';
Expand Down
9 changes: 9 additions & 0 deletions application/controllers/Accumulated.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ public function index()
$this->load->view('interface_assets/footer');
}

public function component_accumulated_results() {
$data['band'] = $this->input->post('band') ?: 'All';
$data['mode'] = $this->input->post('mode') ?: 'All';
$data['award'] = $this->input->post('awardradio') ?: 'dxcc';
$data['period'] = $this->input->post('periodradio') ?: 'year';

$this->load->view('accumulate/component_results', $data);
}

/*
* Used for ajax-call in javascript to fetch the data and insert into table and chart
*/
Expand Down
39 changes: 39 additions & 0 deletions application/controllers/Activators.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,43 @@ public function details() {
$this->load->view('activators/details', $data);
}

public function component_activators() {
// HTMX endpoint for activators table
$this->load->model('Activators_model');
$this->load->model('bands');

$band = $this->input->post('band') ?: 'All';
$mincount = $this->input->post('mincount') ?: 2;
$leogeo = $this->input->post('leogeo') ?: 'both';

$activators_array = $this->Activators_model->get_activators($band, $mincount, $leogeo);
$activators_vucc_array = $this->Activators_model->get_activators_vucc($band, $leogeo);

// Get Date format
if($this->session->userdata('user_date_format')) {
$custom_date_format = $this->session->userdata('user_date_format');
} else {
$custom_date_format = $this->config->item('qso_date_format');
}

$vucc_grids = array();
if ($activators_vucc_array) {
foreach ($activators_vucc_array as $line) {
$vucc_grids[$line->call] = $line->vucc_grids;
}
}

if ($activators_array) {
$this->load->view('activators/component_table', array(
'activators_array' => $activators_array,
'vucc_grids' => $vucc_grids,
'custom_date_format' => $custom_date_format,
'band' => $band,
'leogeo' => $leogeo
));
} else {
echo '<div class="alert alert-info" role="alert">No activators found for the selected filters.</div>';
}
}

}
7 changes: 7 additions & 0 deletions application/controllers/Continents.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,11 @@ public function get_continents() {
echo json_encode($continentsstats);
}

public function component_continent_results() {
$data['band'] = xss_clean($this->input->post('band')) ?: '';
$data['mode'] = xss_clean($this->input->post('mode')) ?: '';

$this->load->view('continents/component_results', $data);
}

}
39 changes: 19 additions & 20 deletions application/controllers/Emeinitials.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,33 @@ public function index()
// Render Page
$data['page_title'] = "EME Initials";

$this->load->model('Emeinitials_model');

if ($this->input->post('band') != NULL) { // Band is not set when page first loads.
$band = $this->input->post('band');
}
else {
$band = 'All';
}

if ($this->input->post('mode') != NULL) {
$mode = $this->input->post('mode');
}
else {
$mode = 'All';
}

$this->load->model('modes');
$this->load->model('bands');

$data['modes'] = $this->modes->active();

$data['timeline_array'] = $this->Emeinitials_model->get_initials($band, $mode);
$data['worked_bands'] = $this->bands->get_worked_bands();
$data['bandselect'] = $band;
$data['modeselect'] = $mode;

$this->load->view('interface_assets/header', $data);
$this->load->view('emeinitials/index');
$this->load->view('interface_assets/footer');
}

public function component_eme_results() {
$this->load->model('Emeinitials_model');

$band = $this->input->post('band') ?: 'All';
$mode = $this->input->post('mode') ?: 'All';

// Get Date format
if ($this->session->userdata('user_date_format')) {
$custom_date_format = $this->session->userdata('user_date_format');
} else {
$custom_date_format = $this->config->item('qso_date_format');
}

$data['timeline_array'] = $this->Emeinitials_model->get_initials($band, $mode);
$data['custom_date_format'] = $custom_date_format;

$this->load->view('emeinitials/component_results', $data);
}
}
16 changes: 8 additions & 8 deletions application/controllers/Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,14 @@ function email_save() {
// Update smtpPassword choice within the options system
$smtpPasswordupdate = $this->optionslib->update('smtpPassword', $this->input->post('smtpPassword'), 'yes');

// Check if all updates are successful
$updateSuccessful = $emailProtocolupdate &&
$smtpEncryptionupdate &&
$emailSenderNameupdate &&
$emailAddressupdate &&
$smtpHostupdate &&
$smtpPortupdate &&
$smtpUsernameupdate &&
// Consider save successful when at least one value is persisted.
$updateSuccessful = $emailProtocolupdate ||
$smtpEncryptionupdate ||
$emailSenderNameupdate ||
$emailAddressupdate ||
$smtpHostupdate ||
$smtpPortupdate ||
$smtpUsernameupdate ||
$smtpPasswordupdate;

// Set flash session based on update success
Expand Down
76 changes: 76 additions & 0 deletions application/controllers/Stationdiary.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,4 +397,80 @@ public function get_qso_map_data()
// Merge and return
echo json_encode(array_merge($plotArray, $stationArray));
}

public function search($callsign = NULL)
{
if ($this->security->xss_clean($callsign, TRUE) === FALSE) {
show_404();
return;
}

$resolution = $this->note->resolve_public_user_by_callsign($callsign);
if (!isset($resolution['status']) || $resolution['status'] !== 'ok') {
show_404();
return;
}

$query = trim((string)$this->input->get('q', TRUE));
$cleanCallsign = strtoupper($resolution['callsign']);

if ($query === '') {
redirect('station-diary/' . rawurlencode($cleanCallsign));
return;
}

$user_id = (int)$resolution['user_id'];
$perPage = 10;
$totalRows = $this->note->count_public_station_diary_search_results($user_id, $query);

$config['base_url'] = site_url('station-diary/' . rawurlencode($cleanCallsign) . '/search');
$config['total_rows'] = $totalRows;
$config['per_page'] = $perPage;
$config['num_links'] = 5;
$config['page_query_string'] = TRUE;
$config['reuse_query_string'] = TRUE;
$config['query_string_segment'] = 'page';
$config['use_page_numbers'] = FALSE;
$config['full_tag_open'] = '<ul class="pagination pagination-sm">';
$config['full_tag_close'] = '</ul>';
$config['attributes'] = array('class' => 'page-link');
$config['first_link'] = FALSE;
$config['last_link'] = FALSE;
$config['first_tag_open'] = '<li class="page-item">';
$config['first_tag_close'] = '</li>';
$config['prev_link'] = '&laquo';
$config['prev_tag_open'] = '<li class="page-item">';
$config['prev_tag_close'] = '</li>';
$config['next_link'] = '&raquo';
$config['next_tag_open'] = '<li class="page-item">';
$config['next_tag_close'] = '</li>';
$config['last_tag_open'] = '<li class="page-item">';
$config['last_tag_close'] = '</li>';
$config['cur_tag_open'] = '<li class="page-item active"><a href="#" class="page-link">';
$config['cur_tag_close'] = '<span class="visually-hidden">(current)</span></a></li>';
$config['num_tag_open'] = '<li class="page-item">';
$config['num_tag_close'] = '</li>';

$this->pagination->initialize($config);

$pageOffset = (int)$this->input->get('page', TRUE);
if ($pageOffset < 0) {
$pageOffset = 0;
}

$data['callsign'] = $cleanCallsign;
$data['entries'] = $this->note->search_public_station_diary_entries($user_id, $query, $perPage, $pageOffset);
$data['pagination_links'] = $this->pagination->create_links();
$data['page_title'] = 'Search: ' . $query . ' - Station Diary - ' . $cleanCallsign;
$data['rss_url'] = site_url('station-diary/' . rawurlencode($cleanCallsign) . '/rss');
$data['qso_datetime_format'] = $this->get_public_qso_datetime_format($resolution['user_date_format'] ?? NULL);
$data['is_single_entry'] = false;
$data['defer_qso_list'] = false;
$data['current_entry_permalink'] = '';
$data['is_search_results'] = true;
$data['search_query'] = $query;
$data['search_total'] = $totalRows;

$this->load->view('station_diary/public_index', $data);
}
}
14 changes: 10 additions & 4 deletions application/controllers/Timeplotter.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,23 @@ public function index()
$this->load->view('interface_assets/footer');
}

public function component_timeplot_results() {
$data['band'] = $this->input->post('band') ?: 'All';
$data['dxcc'] = $this->input->post('dxcc') ?: 'All';
$data['cqzone'] = $this->input->post('cqzone') ?: 'All';

$this->load->view('timeplotter/component_results', $data);
}

public function getTimes() {
// POST data
$postData = $this->input->post();

//load model
$this->load->model('Timeplotter_model');

// get data
$data = $this->Timeplotter_model->getTimes($postData);

return json_encode($data);
// Model method writes JSON response directly
$this->Timeplotter_model->getTimes($postData);

}

Expand Down
2 changes: 1 addition & 1 deletion application/language/english/gridsquares_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$lang['gridsquares_total_count'] = 'Total count';

$lang['gridsquares_minimum_count'] = "Minimum Count";
$lang['gridsquares_show_qsos'] = "Show QSO's";
$lang['gridsquares_show_qsos'] = "Show QSOs";
$lang['gridsquares_show_map'] = "Show Map";
$lang['gridsquares_band'] = 'Band';
$lang['gridsquares_mode'] = 'Mode';
Expand Down
3 changes: 2 additions & 1 deletion application/models/Logbook_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ function create_qso()
}

//$darc_dok = $this->input->post('darc_dok');
$qso_locator = strtoupper(trim(xss_clean($this->input->post('locator')) ?? ''));
// Handle both single gridsquare (locator) and multiple gridsquares (vucc_grids) from SimpleFLE
$qso_locator = strtoupper(trim(xss_clean($this->input->post('vucc_grids') ?? '') ?: xss_clean($this->input->post('locator') ?? '')));
$qso_name = $this->input->post('name');
$qso_age = null;
$qso_usa_state = $this->input->post('usa_state') == null ? '' : $this->input->post('usa_state');
Expand Down
42 changes: 42 additions & 0 deletions application/models/Note.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,48 @@ public function count_public_station_diary_entries($user_id) {
return (int)$this->db->count_all_results();
}

public function count_public_station_diary_search_results($user_id, $query) {
$this->db->from('notes');
$this->db->where('user_id', (int)$user_id);
$this->db->where('cat', 'Station Diary');
$this->db->where('is_public', 1);
$this->db->group_start();
$this->db->like('title', $query);
$this->db->or_like('note', $query);
$this->db->group_end();
return (int)$this->db->count_all_results();
}

public function search_public_station_diary_entries($user_id, $query, $limit = 10, $offset = 0) {
$this->db->from('notes');
$this->db->where('user_id', (int)$user_id);
$this->db->where('cat', 'Station Diary');
$this->db->where('is_public', 1);
$this->db->group_start();
$this->db->like('title', $query);
$this->db->or_like('note', $query);
$this->db->group_end();
$this->db->order_by('created_at', 'DESC');
$this->db->order_by('id', 'DESC');
$this->db->limit((int)$limit, (int)$offset);

$entries = $this->db->get()->result();

$ids = array();
foreach ($entries as $entry) {
$ids[] = (int)$entry->id;
}

$imagesMap = $this->get_diary_images($ids);
foreach ($entries as $entry) {
$entry->images = isset($imagesMap[$entry->id]) ? $imagesMap[$entry->id] : array();
$entry->qso_summary = null;
$entry->qso_list = array();
}

return $entries;
}

public function get_public_station_diary_entries($user_id, $limit = 10, $offset = 0, $include_qso_list = TRUE) {
$this->db->from('notes');
$this->db->where('user_id', (int)$user_id);
Expand Down
2 changes: 1 addition & 1 deletion application/models/Options_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function update($option_name, $option_value, $auto_load = NULL) {
// Save to database
$this->db->insert('options', $data);

return FALSE;
return TRUE;
}
}

Expand Down
Loading
Loading