From 82e52a36193e24cef05346c3269eb738a828cf9b Mon Sep 17 00:00:00 2001 From: int2001 Date: Fri, 18 Oct 2024 09:36:35 +0000 Subject: [PATCH] Added hint for next automatic syncs to eQSL, LoTW and QRZ --- application/controllers/Eqsl.php | 3 +++ application/controllers/Lotw.php | 3 +++ application/controllers/Qrz.php | 3 +++ application/models/Cron_model.php | 10 ++++++++++ application/views/eqsl/import.php | 3 ++- application/views/lotw_views/index.php | 1 + application/views/qrz/export.php | 2 ++ 7 files changed, 24 insertions(+), 1 deletion(-) diff --git a/application/controllers/Eqsl.php b/application/controllers/Eqsl.php index 608cd7668..dcc4a8808 100644 --- a/application/controllers/Eqsl.php +++ b/application/controllers/Eqsl.php @@ -54,6 +54,9 @@ class eqsl extends CI_Controller { $station_profile = $this->stations->profile($active_station_id); $data['active_station_info'] = $station_profile->row(); + $this->load->model('cron_model'); + $data['next_run'] = $this->cron_model->get_next_run("eqsl_sync"); + // Check if eQSL Nicknames have been defined $this->load->model('eqslmethods_model'); $eqsl_locations = $this->eqslmethods_model->all_of_user_with_eqsl_nick_defined(); diff --git a/application/controllers/Lotw.php b/application/controllers/Lotw.php index 8e2d39a0b..54a219d61 100644 --- a/application/controllers/Lotw.php +++ b/application/controllers/Lotw.php @@ -56,6 +56,9 @@ class Lotw extends CI_Controller { $uploads_folder = $this->permissions->is_really_writable('uploads'); $data['uploads_folder'] = $uploads_folder; + $this->load->model('cron_model'); + $data['next_run'] = $this->cron_model->get_next_run("lotw_lotw_download"); + // Load Views $this->load->view('interface_assets/header', $data); $this->load->view('lotw_views/index'); diff --git a/application/controllers/Qrz.php b/application/controllers/Qrz.php index 5cc904f51..ea44f343f 100644 --- a/application/controllers/Qrz.php +++ b/application/controllers/Qrz.php @@ -199,6 +199,9 @@ class Qrz extends CI_Controller { $data['station_profile'] = $this->stations->stations_with_qrz_api_key(); $this->load->model('Stations'); $data['callsigns'] = $this->Stations->callsigns_of_user($this->session->userdata('user_id')); + $this->load->model('cron_model'); + $data['next_run_up'] = $this->cron_model->get_next_run("qrz_upload"); + $data['next_run_down'] = $this->cron_model->get_next_run("qrz_download"); $this->load->view('interface_assets/header', $data); $this->load->view('qrz/export'); diff --git a/application/models/Cron_model.php b/application/models/Cron_model.php index c616382f3..ad8080162 100644 --- a/application/models/Cron_model.php +++ b/application/models/Cron_model.php @@ -90,4 +90,14 @@ class Cron_model extends CI_Model $this->set_modified($id); } + + function get_next_run($what) { + $crons=$this->get_crons(); + $one_cron = $crons[array_search($what,array_column($crons,'id'),true)]; + if (property_exists($one_cron,'next_run')) { + return $one_cron->next_run; + } else { + return null; + } + } } diff --git a/application/views/eqsl/import.php b/application/views/eqsl/import.php index 08bd6d058..f80ead102 100644 --- a/application/views/eqsl/import.php +++ b/application/views/eqsl/import.php @@ -25,6 +25,7 @@
+ ".__("The next automatic sync with eQSL will happen at: ").$next_run."

"; } ?>
- \ No newline at end of file + diff --git a/application/views/lotw_views/index.php b/application/views/lotw_views/index.php index 4d86c06cc..3f2387730 100644 --- a/application/views/lotw_views/index.php +++ b/application/views/lotw_views/index.php @@ -141,6 +141,7 @@
+ ".__("The next automatic sync with LoTW will happen at: ").$next_run."

"; } ?> diff --git a/application/views/qrz/export.php b/application/views/qrz/export.php index 5dd471567..554c00c8e 100644 --- a/application/views/qrz/export.php +++ b/application/views/qrz/export.php @@ -24,6 +24,7 @@
+ ".__("The next automatic Upload to QRZ will happen at: ").$next_run_up."

"; } ?>

config->item('disable_manual_qrz'))) { echo '

Warning This might take a while as QSO uploads are processed sequentially.

'; } ?> @@ -70,6 +71,7 @@
+ ".__("The next automatic Download from QRZ-QSLs will happen at: ").$next_run_down."

"; } ?>