From e475fe568e11cee436b5d53ffc23084369d2910b Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Thu, 17 Oct 2024 09:58:28 +0200 Subject: [PATCH] adds the dashboard menu punkt and adds greeting to the dashboard view --- application/controllers/Cis4.php | 9 +++- application/models/person/Person_model.php | 15 +++++++ application/views/CisVue/Dashboard.php | 2 +- system/dbupdate_3.4/25999_C4_Menu.php | 48 ++++++++++++++++++---- 4 files changed, 65 insertions(+), 9 deletions(-) diff --git a/application/controllers/Cis4.php b/application/controllers/Cis4.php index d05b9e5fc..ad4b2dbf9 100755 --- a/application/controllers/Cis4.php +++ b/application/controllers/Cis4.php @@ -27,6 +27,13 @@ class Cis4 extends FHC_Controller */ public function index() { - $this->load->view('CisVue/Dashboard.php'); + $this->load->model('person/Person_model','PersonModel'); + $begrüsung = $this->PersonModel->getFirstName(getAuthUID()); + if(isError($begrüsung)) + { + show_error("name couldn't be loaded for username ".getAuthUID()); + } + $begrüsung = getData($begrüsung); + $this->load->view('CisVue/Dashboard.php',["name"=> $begrüsung]); } } diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 88813220e..cc4327318 100755 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -290,6 +290,21 @@ class Person_model extends DB_Model return success($result->vorname. ' '. $result->nachname); } + /** + * Get first name of given uid. (Vorname Nachname) + * @param $uid + * @return array + */ + public function getFirstName($uid) + { + $result = getData($this->getByUid($uid))[0]; + if (!$result) { + show_error('Failed loading person'); + } + + return success($result->vorname); + } + public function checkDuplicate($person_id) { $qry = "SELECT person_id diff --git a/application/views/CisVue/Dashboard.php b/application/views/CisVue/Dashboard.php index ec08a8ffa..cf97eacab 100755 --- a/application/views/CisVue/Dashboard.php +++ b/application/views/CisVue/Dashboard.php @@ -12,7 +12,7 @@ $this->load->view('templates/CISVUE-Header', $includesArray); ?>
-

Dashboard

+

Hallo !


diff --git a/system/dbupdate_3.4/25999_C4_Menu.php b/system/dbupdate_3.4/25999_C4_Menu.php index ec31f3cc3..c645fafa1 100755 --- a/system/dbupdate_3.4/25999_C4_Menu.php +++ b/system/dbupdate_3.4/25999_C4_Menu.php @@ -117,6 +117,15 @@ if ($result = @$db->db_query("SELECT * FROM campus.tbl_content WHERE beschreibun 'redirect','etw',NOW(),null,null,null,TRUE,FALSE,'MYLV' ); + -- DASHBOARD + + INSERT INTO campus.tbl_content + (template_kurzbz, oe_kurzbz, insertamum, insertvon, updateamum, updatevon, aktiv, menu_open, beschreibung) + VALUES + ( + 'redirect','etw',NOW(),null,null,null,TRUE,FALSE,'DASHBOARD' + ); + -- ##################################### CONTENTSPRACHE -- CIS4_ROOT @@ -272,10 +281,35 @@ if ($result = @$db->db_query("SELECT * FROM campus.tbl_content WHERE beschreibun null,null,null,null,NOW(),null,'MyLv',null ); + -- DASHBOARD + + INSERT INTO campus.tbl_contentsprache + (sprache, content_id, version, sichtbar, content, reviewvon, reviewamum, updateamum, updatevon, insertamum, insertvon, titel, gesperrt_uid) + VALUES + ( + 'German', + -- queries the content_id for the DASHBOARD + (SELECT content_id from campus.tbl_content WHERE beschreibung = 'DASHBOARD'), + 1,TRUE, + '', + null,null,null,null,NOW(),null,'Dashboard',null + ); + -- ##################################### CONTENTCHILD -- CIS4_ROOT childs + INSERT INTO campus.tbl_contentchild + (content_id, child_content_id, insertamum, insertvon, updateamum, updatevon, sort) + VALUES + ( + -- queries the content_id for the CIS4_ROOT + (SELECT content_id from campus.tbl_content WHERE beschreibung = 'CIS4_ROOT'), + -- queries the content_id for the DASHBOARD + (SELECT content_id from campus.tbl_content WHERE beschreibung = 'DASHBOARD'), + NOW(), null, null, null, 1 + ); + INSERT INTO campus.tbl_contentchild (content_id, child_content_id, insertamum, insertvon, updateamum, updatevon, sort) VALUES @@ -284,7 +318,7 @@ if ($result = @$db->db_query("SELECT * FROM campus.tbl_content WHERE beschreibun (SELECT content_id from campus.tbl_content WHERE beschreibung = 'CIS4_ROOT'), -- queries the content_id for the MEIN_STUDIUM (SELECT content_id from campus.tbl_content WHERE beschreibung = 'MEIN_STUDIUM'), - NOW(), null, null, null, 1 + NOW(), null, null, null, 2 ); INSERT INTO campus.tbl_contentchild @@ -295,7 +329,7 @@ if ($result = @$db->db_query("SELECT * FROM campus.tbl_content WHERE beschreibun (SELECT content_id from campus.tbl_content WHERE beschreibung = 'CIS4_ROOT'), -- queries the content_id for the VPN_STUDIERENDE (SELECT content_id from campus.tbl_content WHERE beschreibung = 'VPN_STUDIERENDE'), - NOW(), null, null, null, 2 + NOW(), null, null, null, 3 ); INSERT INTO campus.tbl_contentchild @@ -306,7 +340,7 @@ if ($result = @$db->db_query("SELECT * FROM campus.tbl_content WHERE beschreibun (SELECT content_id from campus.tbl_content WHERE beschreibung = 'CIS4_ROOT'), -- queries the content_id for the NEWS (SELECT content_id from campus.tbl_content WHERE beschreibung = 'NEWS'), - NOW(), null, null, null, 3 + NOW(), null, null, null, 4 ); INSERT INTO campus.tbl_contentchild @@ -317,7 +351,7 @@ if ($result = @$db->db_query("SELECT * FROM campus.tbl_content WHERE beschreibun (SELECT content_id from campus.tbl_content WHERE beschreibung = 'CIS4_ROOT'), -- queries the content_id for the DOKUMENTE (SELECT content_id from campus.tbl_content WHERE beschreibung = 'DOKUMENTE'), - NOW(), null, null, null, 4 + NOW(), null, null, null, 5 ); INSERT INTO campus.tbl_contentchild @@ -328,7 +362,7 @@ if ($result = @$db->db_query("SELECT * FROM campus.tbl_content WHERE beschreibun (SELECT content_id from campus.tbl_content WHERE beschreibung = 'CIS4_ROOT'), -- queries the content_id for the TLC (SELECT content_id from campus.tbl_content WHERE beschreibung = 'TLC'), - NOW(), null, null, null, 5 + NOW(), null, null, null, 6 ); INSERT INTO campus.tbl_contentchild @@ -338,7 +372,7 @@ if ($result = @$db->db_query("SELECT * FROM campus.tbl_content WHERE beschreibun -- queries the content_id for the CIS4_ROOT (SELECT content_id from campus.tbl_content WHERE beschreibung = 'CIS4_ROOT'), -- 10487 is the content_id for Modul International Skills - 10487, NOW(), null, null, null, 6 + 10487, NOW(), null, null, null, 7 ); INSERT INTO campus.tbl_contentchild @@ -348,7 +382,7 @@ if ($result = @$db->db_query("SELECT * FROM campus.tbl_content WHERE beschreibun -- queries the content_id for the CIS4_ROOT (SELECT content_id from campus.tbl_content WHERE beschreibung = 'CIS4_ROOT'), -- 10568 is the content_id for Zahlungen - 10568, NOW(), null, null, null, 7 + 10568, NOW(), null, null, null, 8 ); -- Mein Studium childs