From c0c4caa53a2e0f083ffd44e997bedf40e2a75123 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Sun, 9 Oct 2022 14:55:46 +0100 Subject: [PATCH] [Welcome] Claim all station logbooks to first user in the datbase --- application/controllers/Welcome.php | 13 ++++++ application/models/Stations.php | 14 ++++++ application/views/welcome/index.php | 70 ++++++++++++++++++++++++++++- 3 files changed, 96 insertions(+), 1 deletion(-) diff --git a/application/controllers/Welcome.php b/application/controllers/Welcome.php index 5da06b80..ec4f4ee0 100644 --- a/application/controllers/Welcome.php +++ b/application/controllers/Welcome.php @@ -17,4 +17,17 @@ class Welcome extends CI_Controller { $this->load->view('welcome/index'); $this->load->view('interface_assets/footer'); } + + public function locationsclaim() { + try { + // load model Stations and call function ClaimAllStationLocations + $this->load->model('stations'); + $this->stations->ClaimAllStationLocations(); + + echo "All Station Locations Claimed"; + } catch (Exception $e) { + log_message('error', 'Error Claiming Station Locations during Migration. '.$e->getMessage()); + echo "Error Claiming Station Locations during Migration. See Logs for further information"; + } + } } \ No newline at end of file diff --git a/application/models/Stations.php b/application/models/Stations.php index f5834328..69e4a44f 100644 --- a/application/models/Stations.php +++ b/application/models/Stations.php @@ -142,6 +142,20 @@ class Stations extends CI_Model { $this->db->update('station_profile', $data); } + function ClaimAllStationLocations($id = NULL) { + // if $id is empty then use session user_id + if (empty($id)) { + // Get the first USER ID from user table in the database + $id = $this->db->get("users")->row()->user_id; + } + + $data = array( + 'user_id' => $id, + ); + + $this->db->update('station_profile', $data); + } + function set_active($current, $new) { // Clean inputs $clean_current = $this->security->xss_clean($current); diff --git a/application/views/welcome/index.php b/application/views/welcome/index.php index 2421a60a..608dcc02 100644 --- a/application/views/welcome/index.php +++ b/application/views/welcome/index.php @@ -12,7 +12,7 @@

After many years and hard work Cloudlog version 2.0 has finally arrived, this brings multi-user support, logbooks to group station locations, improved code with lots of speed increases sprinkled around.

-

I'd like to thank Andreas (LA8AJA) and Flo (DF2ET) for helping getting this over the finish line.

+

This guide is to help you get your installation configured to work with all the new features please follow it!

@@ -48,5 +48,73 @@ $config['auth_level'][99] = "Administrator"; + +
+ +
+
Cronjob Refresher
+
+

Needs Text

+ + + # Update the Cloudlog installation every day at midnight
+ 0 0 * * * /bin/bash -c "/cloudlog.sh"
+
+ # Upload QSOs to Club Log (ignore cron job if this integration is not required)
+ 0 */6 * * * curl --silent /clublog/upload/ &>/dev/null
+
+ # Upload QSOs to LoTW if certs have been provided every hour.
+ 0 */1 * * * curl --silent /lotw/lotw_upload &>/dev/null
+
+ # Upload QSOs to QRZ Logbook (ignore cron job if this integration is not required)
+ 0 */6 * * * curl --silent /qrz/upload &>/dev/null
+
+ # Update LOTW Users Database
+ @weekly curl --silent/lotw/load_users &>/dev/null
+
+ # Update Clublog SCP Database File
+ @weekly curl --silent /update/update_clublog_scp &>/dev/null
+
+ # Update DOK File for autocomplete
+ @monthly curl --silent /update/update_dok &>/dev/null
+
+ # Update SOTA File for autocomplete
+ @monthly curl --silent /update/update_sota &>/dev/null
+
+ # Update WWFF File for autocomplete
+ @monthly curl --silent /update/update_wwff &>/dev/null
+
+
+
+ +
+ +
+
Assign ALL Station Locations to this username
+
+

With Cloudlog Version 2.0, Station Locations must be associated with a user pressing the button below will assign all Station Locations to the first user in the database

+ +
+
+ +
+ +
+
Create Station Logbooks
+
+

Needs Text

+
+
+ +
+ +
+
Update Country Files
+
+

Needs Text

+
+
+ +
\ No newline at end of file