mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Save last qso count on dashboard setting and honor it in dashboard map and dashboard table
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
|
||||
class Dashboard extends CI_Controller {
|
||||
|
||||
const LAST_QSOS_COUNT = 18; // max number of most recent qsos to be displayed on a dashboard
|
||||
const DEFAULT_QSOS_COUNT = 20;
|
||||
const MAX_QSOS_COUNT_LIMIT = 50;
|
||||
|
||||
public function index()
|
||||
{
|
||||
@@ -116,10 +117,20 @@ class Dashboard extends CI_Controller {
|
||||
$data['qrz_sent_today'] = $QSLStatsBreakdownArray['QRZ_Sent_today'];
|
||||
$data['qrz_rcvd_today'] = $QSLStatsBreakdownArray['QRZ_Received_today'];
|
||||
|
||||
$data['last_qsos_list'] = $this->logbook_model->get_last_qsos(
|
||||
Dashboard::LAST_QSOS_COUNT,
|
||||
$logbooks_locations_array,
|
||||
);
|
||||
// Determine last (recent) QSO count to be fetched
|
||||
$last_qso_count_opt = $this->user_options_model->get_options(
|
||||
'dashboard',
|
||||
array('option_name' => 'last_qso_count', 'option_key' => 'count'),
|
||||
$this->uri->segment(3)
|
||||
)->result();
|
||||
if (count($last_qso_count_opt) > 0) {
|
||||
// value found in user options - use it
|
||||
$last_qso_count = $last_qso_count_opt[0]->option_value;
|
||||
} else {
|
||||
// value not found in user options - use default value
|
||||
$last_qso_count = \Dashboard::DEFAULT_QSOS_COUNT;
|
||||
}
|
||||
$data['last_qsos_list'] = $this->logbook_model->get_last_qsos($last_qso_count, $logbooks_locations_array);
|
||||
|
||||
$data['vucc'] = $this->vucc->fetchVuccSummary();
|
||||
$data['vuccSAT'] = $this->vucc->fetchVuccSummary('SAT');
|
||||
|
||||
Reference in New Issue
Block a user