From 5b385d376e23d2ecd34428544d5de6ddd29d752e Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Tue, 14 Nov 2023 11:52:45 +0100 Subject: [PATCH 001/201] creating the controller/view/api base --- application/controllers/Cis/Profil.php | 67 +++++++++++++++++++++++ application/views/Cis/Profil.php | 18 ++++++ public/js/apps/Cis/ProfilApp.js | 24 ++++++++ public/js/apps/api/dummyapi.php | 13 +++++ public/js/apps/api/fhcapifactory.js | 4 +- public/js/apps/api/userdata.js | 13 +++++ public/js/components/Cis/Profil/Profil.js | 27 +++++++++ 7 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 application/controllers/Cis/Profil.php create mode 100644 application/views/Cis/Profil.php create mode 100644 public/js/apps/Cis/ProfilApp.js create mode 100644 public/js/apps/api/dummyapi.php create mode 100644 public/js/apps/api/userdata.js create mode 100644 public/js/components/Cis/Profil/Profil.js diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php new file mode 100644 index 000000000..f24216bfd --- /dev/null +++ b/application/controllers/Cis/Profil.php @@ -0,0 +1,67 @@ + ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions? + 'getUser' => ['student/anrechnung_beantragen:r','user:r'] + ]); + } + + // ----------------------------------------------------------------------------------------------------------------- + // Public methods + + /** + * @return void + */ + public function index() + { + //echo = getAuthUID(); + + $this->load->view('Cis/Profil', ["uid" => getAuthUID()]); + } + + public function getUser() + { + $myObj = new stdClass(); + $myObj->name = "John"; + $myObj->age = 30; + $myObj->city = "New York"; + echo json_encode($myObj); + } + + /* + public function _remap($param) + { + /$uid wird als global variable weiter gegeben + /get the data from the database with the uid + /give the data to the view + /put the queried data in global array and access properties needed in the specific view $profile_information = array() + /$this -> load->view('Cis/StudentProfile', ["uid" => $uid]) + + + if ($param === 'some_method') + { + echo "if"; + } + else + { + echo "else"; + } + }*/ + + + +} diff --git a/application/views/Cis/Profil.php b/application/views/Cis/Profil.php new file mode 100644 index 000000000..c8207f0c5 --- /dev/null +++ b/application/views/Cis/Profil.php @@ -0,0 +1,18 @@ + 'Stundenplan', + 'customJSModules' => ['public/js/apps/Cis/ProfilApp.js'], + 'customCSSs' => ['public/css/components/calendar.css'] +); + +$this->load->view('templates/CISHTML-Header', $includesArray); +?> + +
+

Profil

+
+

+ +
+ +load->view('templates/CISHTML-Footer', $includesArray); ?> diff --git a/public/js/apps/Cis/ProfilApp.js b/public/js/apps/Cis/ProfilApp.js new file mode 100644 index 000000000..b6c727e88 --- /dev/null +++ b/public/js/apps/Cis/ProfilApp.js @@ -0,0 +1,24 @@ +import Profil from "../../components/Cis/Profil/Profil.js"; + +import fhcapifactory from "../api/fhcapifactory.js"; + +Vue.$fhcapi = fhcapifactory; + +const app = Vue.createApp({ + components: { + Profil, + }, + data() { + return { + stunden: [], + events: null + } + }, + methods: { + testsearch: function() { + return Vue.$fhcapi.UserData.getUser(); + } + }, + +}); +app.mount('#content'); \ No newline at end of file diff --git a/public/js/apps/api/dummyapi.php b/public/js/apps/api/dummyapi.php new file mode 100644 index 000000000..515e72bcf --- /dev/null +++ b/public/js/apps/api/dummyapi.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/public/js/apps/api/fhcapifactory.js b/public/js/apps/api/fhcapifactory.js index c1f1e0d5c..f75b03482 100644 --- a/public/js/apps/api/fhcapifactory.js +++ b/public/js/apps/api/fhcapifactory.js @@ -1,5 +1,7 @@ import Search from "./search.js"; +import UserData from "./userdata.js"; export default { - "Search": Search + "Search": Search, + "UserData": UserData }; diff --git a/public/js/apps/api/userdata.js b/public/js/apps/api/userdata.js new file mode 100644 index 000000000..d36628561 --- /dev/null +++ b/public/js/apps/api/userdata.js @@ -0,0 +1,13 @@ +export default { + + getUser: function() { + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + + 'Cis/Profil/getUser'; + return axios.get(url); + }, + getUserDumy: function(){ + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + + 'public/js/apps/api/dummyapi.php/getUser'; + return axios.get(url); + } +}; \ No newline at end of file diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js new file mode 100644 index 000000000..546767c5c --- /dev/null +++ b/public/js/components/Cis/Profil/Profil.js @@ -0,0 +1,27 @@ + + +export default { + + data: function() { + return { + person: null, + } + }, + methods: { + testsearch: function() { + + } + }, + created(){ + this.$parent.testsearch().then((res) => { + this.person = res.data; + }); + }, + + template: ` +
+

test

+ {{JSON.stringify(person)}} +
+ `, +}; \ No newline at end of file From 9227cc12f04aa1cf112a8d78416ae20a6ca63a6d Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Tue, 14 Nov 2023 14:36:47 +0100 Subject: [PATCH 002/201] retrieving user data from mitarbeiter and benutzer models --- application/controllers/Cis/Profil.php | 23 ++++++++++++++++++----- public/js/apps/Cis/ProfilApp.js | 3 +++ public/js/apps/api/userdata.js | 5 +++++ public/js/components/Cis/Profil/Profil.js | 2 ++ 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index f24216bfd..9764b0cae 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -18,6 +18,8 @@ class Profil extends Auth_Controller 'index' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions? 'getUser' => ['student/anrechnung_beantragen:r','user:r'] ]); + $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); + $this->load->model('person/Benutzer_model', 'BenutzerModel'); } // ----------------------------------------------------------------------------------------------------------------- @@ -33,15 +35,26 @@ class Profil extends Auth_Controller $this->load->view('Cis/Profil', ["uid" => getAuthUID()]); } + + //? public function getUser returns information related to a user public function getUser() { - $myObj = new stdClass(); - $myObj->name = "John"; - $myObj->age = 30; - $myObj->city = "New York"; - echo json_encode($myObj); + //* retrieve info from the Mitarbeiter model + $mitarbeiter_result = $this->MitarbeiterModel->load(getAuthUID()); + //* retrieve info from the Benutzer model + $benutzer_result = $this->BenutzerModel->load([getAuthUID()]); + //* return JSON with info + $res = ['mitarbeiter' => $mitarbeiter_result, + 'Benutzer' => $benutzer_result]; + + echo json_encode($res); } + + + + + //? this idea was to use _remap, to call different views based on the type of user /* public function _remap($param) { diff --git a/public/js/apps/Cis/ProfilApp.js b/public/js/apps/Cis/ProfilApp.js index b6c727e88..31abc2ec9 100644 --- a/public/js/apps/Cis/ProfilApp.js +++ b/public/js/apps/Cis/ProfilApp.js @@ -17,6 +17,9 @@ const app = Vue.createApp({ methods: { testsearch: function() { return Vue.$fhcapi.UserData.getUser(); + }, + testsearch2: function() { + return Vue.$fhcapi.UserData.getUser2("ma0594"); } }, diff --git a/public/js/apps/api/userdata.js b/public/js/apps/api/userdata.js index d36628561..0b5442add 100644 --- a/public/js/apps/api/userdata.js +++ b/public/js/apps/api/userdata.js @@ -5,6 +5,11 @@ export default { + 'Cis/Profil/getUser'; return axios.get(url); }, + getUser2: function(uid) { + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + + 'models/person/Benutzer_model/getFromPersonId'; + return axios.get(url,{params: {uid}}); + }, getUserDumy: function(){ const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + 'public/js/apps/api/dummyapi.php/getUser'; diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index 546767c5c..1a054fc80 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -16,6 +16,8 @@ export default { this.$parent.testsearch().then((res) => { this.person = res.data; }); + + }, template: ` From 7c229bbcee8b4506468466ddb81f7bd27f35dbe8 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Wed, 15 Nov 2023 13:49:06 +0100 Subject: [PATCH 003/201] importing the api calls in the component and creating api endpoints for the cis profile page --- application/controllers/Cis/Profil.php | 42 ++++++++++++++--- .../models/ressource/Student_model.php | 41 +++++++++++++++++ application/views/Cis/Profil.php | 5 ++- public/js/apps/Cis/ProfilApp.js | 15 ++----- public/js/apps/api/userdata.js | 11 +++++ public/js/components/Cis/Profil/Profil.js | 45 ++++++++++++++----- 6 files changed, 127 insertions(+), 32 deletions(-) create mode 100644 application/models/ressource/Student_model.php diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index 9764b0cae..4221e3837 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -16,10 +16,16 @@ class Profil extends Auth_Controller { parent::__construct([ 'index' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions? - 'getUser' => ['student/anrechnung_beantragen:r','user:r'] + 'getUser' => ['student/anrechnung_beantragen:r','user:r'], + 'isMitarbeiterOrStudent' => ['student/anrechnung_beantragen:r','user:r'], + 'getPersonInformation' => ['student/anrechnung_beantragen:r','user:r'], + ]); $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); + $this->load->model('ressource/student_model', 'StudentModel'); $this->load->model('person/Benutzer_model', 'BenutzerModel'); + $this->load->model('person/Person_model', 'PersonModel'); + } // ----------------------------------------------------------------------------------------------------------------- @@ -30,9 +36,11 @@ class Profil extends Auth_Controller */ public function index() { - //echo = getAuthUID(); - $this->load->view('Cis/Profil', ["uid" => getAuthUID()]); + //? we can pass data to the view by using the second parameter of the load->view() function + //* the first parameter is the route that Code Igniter will switch to + //* the second parameter can be used to pass data to the view + $this->load->view('Cis/Profil', ["uid" => getAuthUID(),"pid" => getAuthPersonId()]); } @@ -42,14 +50,36 @@ class Profil extends Auth_Controller //* retrieve info from the Mitarbeiter model $mitarbeiter_result = $this->MitarbeiterModel->load(getAuthUID()); //* retrieve info from the Benutzer model - $benutzer_result = $this->BenutzerModel->load([getAuthUID()]); + $benutzer_result = $this->BenutzerModel->getFromPersonId(getAuthUID()); //* return JSON with info - $res = ['mitarbeiter' => $mitarbeiter_result, - 'Benutzer' => $benutzer_result]; + //! was removed from $res for testing purposes: 'Benutzer' => $benutzer_result + $res = ['mitarbeiter' => $mitarbeiter_result,'Benutzer' => $benutzer_result + ]; echo json_encode($res); } + public function getPersonInformation($pid){ + //? get the person information using the benutzer uid + echo json_encode($this->PersonModel->getPersonStammdaten($pid)->retval); + } + + //? check wheter the parameter uid is a Mitarbeiter or a Student + public function isMitarbeiterOrStudent($uid){ + if($this->MitarbeiterModel->isMitarbeiter($uid)->retval){ + echo json_encode("Mitarbeiter"); + }//! not sure if the user is automatically a student if he is not a mitarbeiter + else if($this->StudentModel->isStudent($uid)->retval){ + echo json_encode("Student"); + }else{ + echo json_encode("Not a Mitarbeiter or Student"); + } + + + } + + + diff --git a/application/models/ressource/Student_model.php b/application/models/ressource/Student_model.php new file mode 100644 index 000000000..937361b56 --- /dev/null +++ b/application/models/ressource/Student_model.php @@ -0,0 +1,41 @@ +dbTable = 'public.tbl_student'; + $this->pk = 'student_uid'; + } + + /** + * Checks if the user is a Student. + * @param string $uid + * @return array + */ + public function isStudent($uid) + { + $this->addSelect('1'); + + + $result = $this->loadWhere(array('student_uid' => $uid)); + + + if(hasData($result)) + { + return success(true); + } + else + { + return success(false); + } + } + + //! THIS FILE WAS CREATED USING THE Mitarbeiter_model.php FILE + + +} diff --git a/application/views/Cis/Profil.php b/application/views/Cis/Profil.php index c8207f0c5..e02d895c3 100644 --- a/application/views/Cis/Profil.php +++ b/application/views/Cis/Profil.php @@ -9,10 +9,11 @@ $this->load->view('templates/CISHTML-Header', $includesArray); ?>
-

Profil

+

Profil2


- + +
load->view('templates/CISHTML-Footer', $includesArray); ?> diff --git a/public/js/apps/Cis/ProfilApp.js b/public/js/apps/Cis/ProfilApp.js index 31abc2ec9..d83e46846 100644 --- a/public/js/apps/Cis/ProfilApp.js +++ b/public/js/apps/Cis/ProfilApp.js @@ -1,8 +1,5 @@ import Profil from "../../components/Cis/Profil/Profil.js"; -import fhcapifactory from "../api/fhcapifactory.js"; - -Vue.$fhcapi = fhcapifactory; const app = Vue.createApp({ components: { @@ -10,18 +7,12 @@ const app = Vue.createApp({ }, data() { return { - stunden: [], - events: null + } }, methods: { - testsearch: function() { - return Vue.$fhcapi.UserData.getUser(); - }, - testsearch2: function() { - return Vue.$fhcapi.UserData.getUser2("ma0594"); - } + }, }); -app.mount('#content'); \ No newline at end of file +app.mount('#content'); \ No newline at end of file diff --git a/public/js/apps/api/userdata.js b/public/js/apps/api/userdata.js index 0b5442add..ccd408ae5 100644 --- a/public/js/apps/api/userdata.js +++ b/public/js/apps/api/userdata.js @@ -5,6 +5,17 @@ export default { + 'Cis/Profil/getUser'; return axios.get(url); }, + isMitarbeiterOrStudent: function(uid) { + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + + `Cis/Profil/isMitarbeiterOrStudent/${uid}`; + return axios.get(url); + }, + getPersonInformation: function(uid) { + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + + `Cis/Profil/getPersonInformation/${uid}`; + return axios.get(url); + }, + getUser2: function(uid) { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + 'models/person/Benutzer_model/getFromPersonId'; diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index 1a054fc80..f00f6a85e 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -1,29 +1,50 @@ - +import fhcapifactory from "../../../apps/api/fhcapifactory.js"; export default { data: function() { return { person: null, + person_info: null, + role: null, } }, + //? this prop was passed in the Profil.php view file + props:['uid','pid'], methods: { - testsearch: function() { - - } - }, - created(){ - this.$parent.testsearch().then((res) => { - this.person = res.data; - }); - - }, + }, + computed:{ + cis_profil_info(){ + return { + anrede:this.person_info.anrede, + titelpre:this.person_info.titelpre, + titelpost:this.person_info.titelpost, + vorname:this.person_info.vorname, + nachname:this.person_info.nachname, + gebdatum:this.person_info.gebdatum, + gebort:this.person_info.gebort, + }; + } + }, + created(){ + fhcapifactory.UserData.getUser().then(res => this.person = res.data); + fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then(res => this.role = res.data); + fhcapifactory.UserData.getPersonInformation(this.pid).then(res => this.person_info = res.data); + + }, template: `

test

- {{JSON.stringify(person)}} +

{{"here is the uid "+uid}}

+

{{"here is the pid "+pid}}

+ {{JSON.stringify(cis_profil_info)}} + +
+ {{JSON.stringify(person)}} +
+ {{JSON.stringify(role)}}
`, }; \ No newline at end of file From dee0bdaa170439fc2a4f698dd6da66cc5a29baba Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Wed, 15 Nov 2023 15:09:59 +0100 Subject: [PATCH 004/201] querying new data for the cis profile page --- application/controllers/Cis/Profil.php | 12 +++++++++++- public/js/components/Cis/Profil/Profil.js | 23 +++++++++++++++++++---- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index 4221e3837..c4d97b2fd 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -25,6 +25,7 @@ class Profil extends Auth_Controller $this->load->model('ressource/student_model', 'StudentModel'); $this->load->model('person/Benutzer_model', 'BenutzerModel'); $this->load->model('person/Person_model', 'PersonModel'); + $this->load->model('person/Adresse_model', 'AdresseModel'); } @@ -61,7 +62,16 @@ class Profil extends Auth_Controller public function getPersonInformation($pid){ //? get the person information using the benutzer uid - echo json_encode($this->PersonModel->getPersonStammdaten($pid)->retval); + $json_result = $this->PersonModel->getPersonStammdaten($pid)->retval; + + + //! the following line is not needed because it is already included in the getPersonStammdaten function + //$json_result->addresse_info = $this->AdresseModel->getZustellAdresse($pid)->retval; + echo json_encode($json_result); + return; + + + } //? check wheter the parameter uid is a Mitarbeiter or a Student diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index f00f6a85e..7f953b150 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -24,6 +24,15 @@ export default { nachname:this.person_info.nachname, gebdatum:this.person_info.gebdatum, gebort:this.person_info.gebort, + adresse:this.person_info.adressen[0].strasse + " " + this.person_info.adressen[0].plz, + + }; + }, + cis_profil_info_no_foto(){ + return { + ...this.person_info, + foto:null, + }; } }, @@ -39,12 +48,18 @@ export default {

test

{{"here is the uid "+uid}}

{{"here is the pid "+pid}}

- {{JSON.stringify(cis_profil_info)}} - + +
{{JSON.stringify(cis_profil_info,null,2)}}
+
{{JSON.stringify(cis_profil_info_no_foto,null,2)}}
+
- {{JSON.stringify(person)}} +
{{JSON.stringify(person)}}

- {{JSON.stringify(role)}} +
{{JSON.stringify(role)}}
`, }; \ No newline at end of file From 6b27c00d30aa474b2d1eef3e5e7888ec7c048b44 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Fri, 17 Nov 2023 13:09:32 +0100 Subject: [PATCH 005/201] new data collection --- application/controllers/Cis/Profil.php | 117 ++++++++++++++++++---- public/js/apps/Cis/ProfilApp.js | 3 +- public/js/apps/api/userdata.js | 4 +- public/js/components/Cis/Profil/Profil.js | 43 ++++---- 4 files changed, 119 insertions(+), 48 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index c4d97b2fd..16446f493 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -16,9 +16,8 @@ class Profil extends Auth_Controller { parent::__construct([ 'index' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions? - 'getUser' => ['student/anrechnung_beantragen:r','user:r'], 'isMitarbeiterOrStudent' => ['student/anrechnung_beantragen:r','user:r'], - 'getPersonInformation' => ['student/anrechnung_beantragen:r','user:r'], + 'getMitarbeiterAnsicht' => ['student/anrechnung_beantragen:r','user:r'], ]); $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); @@ -26,6 +25,8 @@ class Profil extends Auth_Controller $this->load->model('person/Benutzer_model', 'BenutzerModel'); $this->load->model('person/Person_model', 'PersonModel'); $this->load->model('person/Adresse_model', 'AdresseModel'); + $this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel'); + } @@ -45,29 +46,107 @@ class Profil extends Auth_Controller } - //? public function getUser returns information related to a user - public function getUser() - { - //* retrieve info from the Mitarbeiter model - $mitarbeiter_result = $this->MitarbeiterModel->load(getAuthUID()); - //* retrieve info from the Benutzer model - $benutzer_result = $this->BenutzerModel->getFromPersonId(getAuthUID()); - //* return JSON with info - //! was removed from $res for testing purposes: 'Benutzer' => $benutzer_result - $res = ['mitarbeiter' => $mitarbeiter_result,'Benutzer' => $benutzer_result - ]; + + + public function getMitarbeiterAnsicht(){ - echo json_encode($res); - } + $benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(); + if(isError($benutzer_funktion_res)){ + // error handling + }else{ + $benutzer_funktion_res = hasData($benutzer_funktion_res)? getData($benutzer_funktion_res) : null; + } - public function getPersonInformation($pid){ + //! THERE COULD BE MULTIPLE ADRESSES + $adresse_res = $this->AdresseModel->load(getAuthPersonId()); + if(isError($adresse_res)){ + // error handling + }else{ //! not only one + $adresse_res = hasData($adresse_res)? getData($adresse_res)[0] : null; + } + + $benutzer_res = $this->PersonModel->load(getAuthUID()); + if(isError($benutzer_res)){ + // error handling + }else{ + $benutzer_res = hasData($benutzer_res)? getData($benutzer_res)[0] : null; + } + + $person_res = $this->PersonModel->load(getAuthPersonId()); + if(isError($person_res)){ + // error handling + }else{ + $person_res = hasData($person_res)? getData($person_res)[0] : null; + } + //? get the person information using the benutzer uid - $json_result = $this->PersonModel->getPersonStammdaten($pid)->retval; - + //! verwendet getAuthUID() + $mitarbeiter_res = $this->MitarbeiterModel->load(getAuthUID()); + if(isError($mitarbeiter_res)){ + // error handling + }else{ + //? checks whether the getData does not return null + //? and then checks that the current does return an empty array + $mitarbeiter_res = hasData($mitarbeiter_res)? getData($mitarbeiter_res)[0] : null; + } + $res = new stdClass(); + $res->username = getAuthUID(); + //? Person Info + $res->foto = $person_res->foto; + $res->foto_sperre = $person_res->foto_sperre; + $res->anrede = $person_res->anrede; + $res->titelpre = $person_res->titelpre; + $res->titelpost = $person_res->titelpost; + $res->vorname = $person_res->vorname; + $res->nachname = $person_res->nachname; + //$res->postnomen = $person_res->postnomen; //!POSTNOMEN? + $res->gebdatum = $person_res->gebdatum; + $res->gebort = $person_res->gebort; + //? Mitarbeiter Info + $res->kurzbz = $mitarbeiter_res->kurzbz; + $res->telefonklappe = $mitarbeiter_res->telefonklappe; + //? Benutzer Info + $res->email_intern = getAuthUID() . "@technikum-wien.at"; + $res->email_extern = $benutzer_res->alias . "@technikum-wien.at"; + //? Adresse Info + $res->strasse = $adresse_res->strasse; + $res->heimatadresse = $adresse_res->heimatadresse; + $res->zustelladresse = $adresse_res->zustelladresse; + $res->plz = $adresse_res->plz; + $res->ort = $adresse_res->ort; + //? Benutzerfunktion Info + $res->funktionen = $benutzer_funktion_res; + + + + echo json_encode($res); + + return; + /* + $res = getData($this->PersonModel->getPersonStammdaten($pid)); + $json_result = new stdClass(); + $json_result->anrede = $res->anrede; + $json_result->titelpre = $res->titelpre; + $json_result->titelpost = $res->titelpost; + $json_result->vorname = $res->vorname; + $json_result->nachname = $res->nachname; + $json_result->gebdatum = $res->gebdatum; + $json_result->gebort = $res->gebort; + $json_result->adressen = $res->adressen; + + anrede:this.person_info.anrede, + titelpre:this.person_info.titelpre, + titelpost:this.person_info.titelpost, + vorname:this.person_info.vorname, + nachname:this.person_info.nachname, + gebdatum:this.person_info.gebdatum, + gebort:this.person_info.gebort, + adresse:this.person_info.adressen[0].strasse + " " + this.person_info.adressen[0].plz, + */ //! the following line is not needed because it is already included in the getPersonStammdaten function //$json_result->addresse_info = $this->AdresseModel->getZustellAdresse($pid)->retval; - echo json_encode($json_result); + echo json_encode($res); return; diff --git a/public/js/apps/Cis/ProfilApp.js b/public/js/apps/Cis/ProfilApp.js index d83e46846..7a663f108 100644 --- a/public/js/apps/Cis/ProfilApp.js +++ b/public/js/apps/Cis/ProfilApp.js @@ -2,6 +2,7 @@ import Profil from "../../components/Cis/Profil/Profil.js"; const app = Vue.createApp({ + components: { Profil, }, @@ -15,4 +16,4 @@ const app = Vue.createApp({ }, }); -app.mount('#content'); \ No newline at end of file +app.mount("#content"); \ No newline at end of file diff --git a/public/js/apps/api/userdata.js b/public/js/apps/api/userdata.js index ccd408ae5..63d605230 100644 --- a/public/js/apps/api/userdata.js +++ b/public/js/apps/api/userdata.js @@ -10,9 +10,9 @@ export default { + `Cis/Profil/isMitarbeiterOrStudent/${uid}`; return axios.get(url); }, - getPersonInformation: function(uid) { + getMitarbeiterAnsicht: function() { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root - + `Cis/Profil/getPersonInformation/${uid}`; + + `Cis/Profil/getMitarbeiterAnsicht`; return axios.get(url); }, diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index 7f953b150..7a73a6f06 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -1,45 +1,34 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; + + export default { - - data: function() { + + data() { return { - person: null, + person_info: null, + //? beinhaltet die Information ob der angefragte user ein Student oder Mitarbeiter ist role: null, } }, - //? this prop was passed in the Profil.php view file + //? this props were passed in the Profil.php view file props:['uid','pid'], methods: { }, computed:{ - cis_profil_info(){ + computed_placeholder(){ return { - anrede:this.person_info.anrede, - titelpre:this.person_info.titelpre, - titelpost:this.person_info.titelpost, - vorname:this.person_info.vorname, - nachname:this.person_info.nachname, - gebdatum:this.person_info.gebdatum, - gebort:this.person_info.gebort, - adresse:this.person_info.adressen[0].strasse + " " + this.person_info.adressen[0].plz, - + // }; }, - cis_profil_info_no_foto(){ - return { - ...this.person_info, - foto:null, - - }; - } + }, created(){ - fhcapifactory.UserData.getUser().then(res => this.person = res.data); + //error //! fhcapifactory.UserData.getUser().then(res => this.person = res.data); fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then(res => this.role = res.data); - fhcapifactory.UserData.getPersonInformation(this.pid).then(res => this.person_info = res.data); + fhcapifactory.UserData.getMitarbeiterAnsicht().then(res => {this.person_info = res.data;}); }, @@ -52,14 +41,16 @@ export default { //! printing 2 computed functions //* one to output the collected need information for the cis page //* and the other returns all the information retrieved from the model without the foto data - --> +
{{JSON.stringify(cis_profil_info,null,2)}}
{{JSON.stringify(cis_profil_info_no_foto,null,2)}}

{{JSON.stringify(person)}}
-
-
{{JSON.stringify(role)}}
+ --> + + +

test

`, }; \ No newline at end of file From 4fead18c067017a1c6fdaa1e09f8cd1738168407 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Fri, 17 Nov 2023 15:27:41 +0100 Subject: [PATCH 006/201] adds the model calls for the benutzerfunktionen information for the cis profile --- .gitignore | 2 + application/controllers/Cis/Profil.php | 54 ++++++++------------------ public/js/apps/api/userdata.js | 17 ++------ 3 files changed, 22 insertions(+), 51 deletions(-) diff --git a/.gitignore b/.gitignore index 96af3e5dc..84957a801 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ documents/ vendor/ /nbproject/ +.vscode +composer.phar /.idea/ .settings .project diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index 16446f493..8d3c2f692 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -49,12 +49,18 @@ class Profil extends Auth_Controller public function getMitarbeiterAnsicht(){ + - $benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(); - if(isError($benutzer_funktion_res)){ - // error handling - }else{ - $benutzer_funktion_res = hasData($benutzer_funktion_res)? getData($benutzer_funktion_res) : null; + if( + isSuccess($this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as bf_bezeichnung","tbl_organisationseinheit.bezeichnung as oe_bezeichnung","datum_von","datum_bis","wochenstunden"])) + && isSuccess($this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit","oe_kurzbz")) + ){ + $benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere("uid='" . getAuthUID() . "'"); + if(isError($benutzer_funktion_res)){ + // error handling + }else{ + $benutzer_funktion_res = hasData($benutzer_funktion_res)? getData($benutzer_funktion_res) : null; + } } //! THERE COULD BE MULTIPLE ADRESSES @@ -65,7 +71,7 @@ class Profil extends Auth_Controller $adresse_res = hasData($adresse_res)? getData($adresse_res)[0] : null; } - $benutzer_res = $this->PersonModel->load(getAuthUID()); + $benutzer_res = $this->BenutzerModel->load([getAuthUID()]); if(isError($benutzer_res)){ // error handling }else{ @@ -79,16 +85,13 @@ class Profil extends Auth_Controller $person_res = hasData($person_res)? getData($person_res)[0] : null; } - //? get the person information using the benutzer uid - //! verwendet getAuthUID() $mitarbeiter_res = $this->MitarbeiterModel->load(getAuthUID()); if(isError($mitarbeiter_res)){ // error handling }else{ - //? checks whether the getData does not return null - //? and then checks that the current does return an empty array $mitarbeiter_res = hasData($mitarbeiter_res)? getData($mitarbeiter_res)[0] : null; } + $res = new stdClass(); $res->username = getAuthUID(); //? Person Info @@ -106,8 +109,8 @@ class Profil extends Auth_Controller $res->kurzbz = $mitarbeiter_res->kurzbz; $res->telefonklappe = $mitarbeiter_res->telefonklappe; //? Benutzer Info - $res->email_intern = getAuthUID() . "@technikum-wien.at"; - $res->email_extern = $benutzer_res->alias . "@technikum-wien.at"; + $res->email_intern = getAuthUID() . DOMAIN; + $res->email_extern = $benutzer_res->alias . DOMAIN; //? Adresse Info $res->strasse = $adresse_res->strasse; $res->heimatadresse = $adresse_res->heimatadresse; @@ -119,35 +122,10 @@ class Profil extends Auth_Controller + echo json_encode($res); return; - /* - $res = getData($this->PersonModel->getPersonStammdaten($pid)); - $json_result = new stdClass(); - $json_result->anrede = $res->anrede; - $json_result->titelpre = $res->titelpre; - $json_result->titelpost = $res->titelpost; - $json_result->vorname = $res->vorname; - $json_result->nachname = $res->nachname; - $json_result->gebdatum = $res->gebdatum; - $json_result->gebort = $res->gebort; - $json_result->adressen = $res->adressen; - - anrede:this.person_info.anrede, - titelpre:this.person_info.titelpre, - titelpost:this.person_info.titelpost, - vorname:this.person_info.vorname, - nachname:this.person_info.nachname, - gebdatum:this.person_info.gebdatum, - gebort:this.person_info.gebort, - adresse:this.person_info.adressen[0].strasse + " " + this.person_info.adressen[0].plz, - */ - - //! the following line is not needed because it is already included in the getPersonStammdaten function - //$json_result->addresse_info = $this->AdresseModel->getZustellAdresse($pid)->retval; - echo json_encode($res); - return; diff --git a/public/js/apps/api/userdata.js b/public/js/apps/api/userdata.js index 63d605230..2c72e9618 100644 --- a/public/js/apps/api/userdata.js +++ b/public/js/apps/api/userdata.js @@ -2,28 +2,19 @@ export default { getUser: function() { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root - + 'Cis/Profil/getUser'; + + 'cis.php/Cis/Profil/getUser'; return axios.get(url); }, isMitarbeiterOrStudent: function(uid) { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root - + `Cis/Profil/isMitarbeiterOrStudent/${uid}`; + + `cis.php/Cis/Profil/isMitarbeiterOrStudent/${uid}`; return axios.get(url); }, getMitarbeiterAnsicht: function() { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root - + `Cis/Profil/getMitarbeiterAnsicht`; + + `cis.php/Cis/Profil/getMitarbeiterAnsicht`; return axios.get(url); }, - getUser2: function(uid) { - const url = FHC_JS_DATA_STORAGE_OBJECT.app_root - + 'models/person/Benutzer_model/getFromPersonId'; - return axios.get(url,{params: {uid}}); - }, - getUserDumy: function(){ - const url = FHC_JS_DATA_STORAGE_OBJECT.app_root - + 'public/js/apps/api/dummyapi.php/getUser'; - return axios.get(url); - } + }; \ No newline at end of file From 16b61d05602582ef782836f2f1227acebfb9cdf1 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 20 Nov 2023 17:30:58 +0100 Subject: [PATCH 007/201] Daten fuer die Betriebsmittel und zutrittskarten_ausgegebenam gesammelt --- application/controllers/Cis/Profil.php | 29 ++++++++++++- application/models/crm/Student_model.php | 22 ++++++++++ .../models/ressource/Student_model.php | 41 ------------------- application/views/Cis/Profil.php | 2 +- public/js/components/Cis/Profil/Profil.js | 2 +- 5 files changed, 51 insertions(+), 45 deletions(-) delete mode 100644 application/models/ressource/Student_model.php diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index 8d3c2f692..a45edcab2 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -21,11 +21,13 @@ class Profil extends Auth_Controller ]); $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); - $this->load->model('ressource/student_model', 'StudentModel'); + $this->load->model('crm/Student_model', 'StudentModel'); $this->load->model('person/Benutzer_model', 'BenutzerModel'); $this->load->model('person/Person_model', 'PersonModel'); $this->load->model('person/Adresse_model', 'AdresseModel'); $this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel'); + $this->load->model('ressource/Betriebsmittelperson_model', 'BetriebsmittelpersonModel'); + $this->load->model('person/Kontakt_model', 'KontaktModel'); } @@ -50,7 +52,27 @@ class Profil extends Auth_Controller public function getMitarbeiterAnsicht(){ + + + $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittel(getAuthPersonId()); + if(isError($zutrittskarte_ausgegebenam)){ + // error handling + }else{ + $zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam)? getData($zutrittskarte_ausgegebenam)[0] : null; + } + + if( + isSuccess($this->BetriebsmittelpersonModel->addSelect(["betriebsmitteltyp", "beschreibung","nummer","ausgegebenam"])) + ){ + $betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel(getAuthPersonId()); + if(isError($betriebsmittelperson_res)){ + // error handling + }else{ + $betriebsmittelperson_res = hasData($betriebsmittelperson_res)? getData($betriebsmittelperson_res) : null; + } + } + if( isSuccess($this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as bf_bezeichnung","tbl_organisationseinheit.bezeichnung as oe_bezeichnung","datum_von","datum_bis","wochenstunden"])) && isSuccess($this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit","oe_kurzbz")) @@ -119,7 +141,10 @@ class Profil extends Auth_Controller $res->ort = $adresse_res->ort; //? Benutzerfunktion Info $res->funktionen = $benutzer_funktion_res; - + //? Betriebsmittel Info + $res->mittel = $betriebsmittelperson_res; + $res->zutrittskarte_ausgegebenam = $zutrittskarte_ausgegebenam->ausgegebenam; + $res->kontakt = $kontakte; diff --git a/application/models/crm/Student_model.php b/application/models/crm/Student_model.php index e27fa68dc..ad642aa75 100644 --- a/application/models/crm/Student_model.php +++ b/application/models/crm/Student_model.php @@ -13,6 +13,28 @@ class Student_model extends DB_Model $this->hasSequence = false; } + /** + * Checks if the user is a Student. + * @param string $uid + * @return array + */ + public function isStudent($uid) + { + $this->addSelect('1'); + + $result = $this->loadWhere(array('student_uid' => $uid)); + + + if(hasData($result)) + { + return success(true); + } + else + { + return success(false); + } + } + // **** // * Generiert die Matrikelnummer // * FORMAT: 0710254001 diff --git a/application/models/ressource/Student_model.php b/application/models/ressource/Student_model.php deleted file mode 100644 index 937361b56..000000000 --- a/application/models/ressource/Student_model.php +++ /dev/null @@ -1,41 +0,0 @@ -dbTable = 'public.tbl_student'; - $this->pk = 'student_uid'; - } - - /** - * Checks if the user is a Student. - * @param string $uid - * @return array - */ - public function isStudent($uid) - { - $this->addSelect('1'); - - - $result = $this->loadWhere(array('student_uid' => $uid)); - - - if(hasData($result)) - { - return success(true); - } - else - { - return success(false); - } - } - - //! THIS FILE WAS CREATED USING THE Mitarbeiter_model.php FILE - - -} diff --git a/application/views/Cis/Profil.php b/application/views/Cis/Profil.php index e02d895c3..7be2cc0cc 100644 --- a/application/views/Cis/Profil.php +++ b/application/views/Cis/Profil.php @@ -9,7 +9,7 @@ $this->load->view('templates/CISHTML-Header', $includesArray); ?>
-

Profil2

+

Profil22


diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index 7a73a6f06..a4c7a91dd 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -27,7 +27,7 @@ export default { }, created(){ //error //! fhcapifactory.UserData.getUser().then(res => this.person = res.data); - fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then(res => this.role = res.data); + fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then(res => {console.log(res.data);this.role = res.data;}); fhcapifactory.UserData.getMitarbeiterAnsicht().then(res => {this.person_info = res.data;}); }, From 0e813f78fbc83f706ea008cac71656f61d41e380 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Wed, 22 Nov 2023 09:51:49 +0100 Subject: [PATCH 008/201] updates the foto_sperre_function to automatically update the data of the vue component --- application/controllers/Cis/Profil.php | 95 ++++++++++++---- application/views/Cis/Profil.php | 3 +- public/js/apps/api/userdata.js | 5 + public/js/components/Cis/Profil/Profil.js | 126 ++++++++++++++++++---- 4 files changed, 186 insertions(+), 43 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index a45edcab2..ef15d830c 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -18,6 +18,9 @@ class Profil extends Auth_Controller 'index' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions? 'isMitarbeiterOrStudent' => ['student/anrechnung_beantragen:r','user:r'], 'getMitarbeiterAnsicht' => ['student/anrechnung_beantragen:r','user:r'], + 'foto_sperre_function' => ['student/anrechnung_beantragen:r','user:r'], + + ]); $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); @@ -52,8 +55,32 @@ class Profil extends Auth_Controller public function getMitarbeiterAnsicht(){ + if( + isSuccess($this->PersonModel->addSelect('gruppe_kurzbz, beschreibung'))&& + isSuccess($this->PersonModel->addJoin('tbl_benutzer', 'person_id')) && + isSuccess($this->PersonModel->addJoin('tbl_benutzergruppe', 'uid')) && + isSuccess($this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz'))){ - + $mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid'=>getAuthUID())); + if( isError($mailverteiler_res)){ + // catch error + } + $mailverteiler_res = hasData($mailverteiler_res)? getData($mailverteiler_res) : null; + } + + if(isSuccess($this->KontaktModel->addSelect('DISTINCT ON (kontakttyp) kontakttyp, kontakt, tbl_kontakt.anmerkung, tbl_kontakt.zustellung')) && + isSuccess($this->KontaktModel->addJoin('public.tbl_standort', 'standort_id', 'LEFT')) && + isSuccess($this->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT'))&& + isSuccess($this->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum')) + ){ + $kontakte_res = $this->KontaktModel->loadWhere(array('person_id' => getAuthPersonID())); + if(isError($kontakte_res)){ + // handle error + }else{ + $kontakte_res = hasData($kontakte_res)? getData($kontakte_res) : null; + } + + } $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittel(getAuthPersonId()); if(isError($zutrittskarte_ausgegebenam)){ @@ -64,6 +91,7 @@ class Profil extends Auth_Controller if( isSuccess($this->BetriebsmittelpersonModel->addSelect(["betriebsmitteltyp", "beschreibung","nummer","ausgegebenam"])) + ){ $betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel(getAuthPersonId()); if(isError($betriebsmittelperson_res)){ @@ -74,10 +102,11 @@ class Profil extends Auth_Controller } if( - isSuccess($this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as bf_bezeichnung","tbl_organisationseinheit.bezeichnung as oe_bezeichnung","datum_von","datum_bis","wochenstunden"])) - && isSuccess($this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit","oe_kurzbz")) + //! Summe der Wochenstunden wird jetzt in der hr/tbl_dienstverhaeltnis gespeichert + isSuccess($this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as bf_bezeichnung","tbl_organisationseinheit.bezeichnung as oe_bezeichnung","datum_von","datum_bis","wochenstunden"]))&& + isSuccess($this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit","oe_kurzbz")) ){ - $benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere("uid='" . getAuthUID() . "'"); + $benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(array('uid'=>getAuthUID())); if(isError($benutzer_funktion_res)){ // error handling }else{ @@ -85,12 +114,19 @@ class Profil extends Auth_Controller } } - //! THERE COULD BE MULTIPLE ADRESSES - $adresse_res = $this->AdresseModel->load(getAuthPersonId()); - if(isError($adresse_res)){ - // error handling - }else{ //! not only one - $adresse_res = hasData($adresse_res)? getData($adresse_res)[0] : null; + + if( + isSuccess($adresse_res = $this->AdresseModel->addSelect(array("strasse","tbl_adressentyp.bezeichnung as adr_typ","plz","ort")))&& + isSuccess($adresse_res = $this->AdresseModel->addOrder("zustelladresse","DESC"))&& + isSuccess($adresse_res = $this->AdresseModel->addOrder("sort"))&& + isSuccess($adresse_res = $this->AdresseModel->addJoin("tbl_adressentyp","typ=adressentyp_kurzbz")) + ){ + $adresse_res = $this->AdresseModel->loadWhere(array("person_id"=>getAuthPersonID())); + if(isError($adresse_res)){ + // error handling + }else{ + $adresse_res = hasData($adresse_res)? getData($adresse_res) : null; + } } $benutzer_res = $this->BenutzerModel->load([getAuthUID()]); @@ -134,26 +170,20 @@ class Profil extends Auth_Controller $res->email_intern = getAuthUID() . DOMAIN; $res->email_extern = $benutzer_res->alias . DOMAIN; //? Adresse Info - $res->strasse = $adresse_res->strasse; - $res->heimatadresse = $adresse_res->heimatadresse; - $res->zustelladresse = $adresse_res->zustelladresse; - $res->plz = $adresse_res->plz; - $res->ort = $adresse_res->ort; + $res->adressen = $adresse_res; //? Benutzerfunktion Info $res->funktionen = $benutzer_funktion_res; //? Betriebsmittel Info $res->mittel = $betriebsmittelperson_res; + //? Austellungsdatum von der Zutrittskarte $res->zutrittskarte_ausgegebenam = $zutrittskarte_ausgegebenam->ausgegebenam; - $res->kontakt = $kontakte; - - + //? Kontakt Info + $res->kontakte = $kontakte_res; + //? Mailverteiler Info + $res->mailverteiler = $mailverteiler_res; echo json_encode($res); - return; - - - } //? check wheter the parameter uid is a Mitarbeiter or a Student @@ -170,6 +200,27 @@ class Profil extends Auth_Controller } + public function foto_sperre_function($value){ + $res = $this->PersonModel->update(getAuthPersonID(),array("foto_sperre"=>$value)); + if(isError($res)){ + // error handling + }else{ + //? select the value of the column foto_sperre to return + if(isSuccess($this->PersonModel->addSelect("foto_sperre"))){ + $res = $this->PersonModel->load(getAuthPersonID()); + if(isError($res)){ + // error handling + } + $res = hasData($res) ? getData($res)[0] : null; + } + + } + echo json_encode($res); + } + + + + diff --git a/application/views/Cis/Profil.php b/application/views/Cis/Profil.php index 7be2cc0cc..4feb98ec4 100644 --- a/application/views/Cis/Profil.php +++ b/application/views/Cis/Profil.php @@ -9,7 +9,8 @@ $this->load->view('templates/CISHTML-Header', $includesArray); ?>
-

Profil22

+

Profil

+

diff --git a/public/js/apps/api/userdata.js b/public/js/apps/api/userdata.js index 2c72e9618..cd701a2d1 100644 --- a/public/js/apps/api/userdata.js +++ b/public/js/apps/api/userdata.js @@ -15,6 +15,11 @@ export default { + `cis.php/Cis/Profil/getMitarbeiterAnsicht`; return axios.get(url); }, + sperre_foto_function: function(value) { + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + + `cis.php/Cis/Profil/foto_sperre_function/${value}`; + return axios.get(url); + }, }; \ No newline at end of file diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index a4c7a91dd..3b1ca8e03 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -1,6 +1,6 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; - +//"
  • {{element}}
" export default { @@ -15,14 +15,69 @@ export default { //? this props were passed in the Profil.php view file props:['uid','pid'], methods: { + concatenate_addresses(address_array){ + let result = ""; + for (let i = 0; i < address_array.length; i++) { + result += address_array[i].strasse + " " + address_array[i].plz + " " + address_array[i].ort + "\n"; + } + return result; + }, + render_unterelement(wert,bezeichnung){ + if (isArray(bezeichnung)){ + + } + }, + concatenate_kontakte(kontakt_array){ + let result = ""; + for (let i = 0; i < kontakt_array.length; i++) { + result += kontakt_array[i].kontakttyp + " " + kontakt_array[i].kontakt + " " + kontakt_array[i].zustellung + "\n"; + } + return result; + }, + sperre_foto_function(value){ + fhcapifactory.UserData.sperre_foto_function(value).then(res => { + console.log(res.data); + if(res.data){ + + this.person_info.foto_sperre = res.data.foto_sperre; + } + }); + + }, }, computed:{ - computed_placeholder(){ - return { - // + + get_image_base64_src(){ + return "data:image/jpeg;base64,"+this.person_info.foto; + }, + first_col(){ + //! postnomen is still missing + return { + Username:this.uid, + Anrede:this.person_info.anrede, + Titel:(this.person_info.titelpre&&this.person_info.titelpost)?this.person_info.titelpre.concat(this.person_info.titelpost):"null", + Vorname:this.person_info.vorname, + Nachname:this.person_info.nachname, + Postnomen:null, + Geburtsdatum:this.person_info.gebdatum, + Geburtsort: this.person_info.gebort, + Adresse: this.person_info.adressen, + Kurzzeichen: this.person_info.kurzbz, + Telefon: this.person_info.telefonklappe, }; }, + second_col(){ + //! postnomen is still missing + return { + Intern:this.person_info.email_intern, + Alias:this.person_info.email_extern, + Kontakte:this.person_info.kontakte, + }; + }, + + + }, created(){ @@ -33,24 +88,55 @@ export default { }, template: ` -
-

test

-

{{"here is the uid "+uid}}

-

{{"here is the pid "+pid}}

- + +

{{wert + ": " + bezeichnung}}

+

{{JSON.stringify(first_col)}}

+

{{"here is the uid "+uid}}

+

{{"here is the pid "+pid}}

+
+
+
+ +
+

Profilfoto gesperrt

+ Sperre des Profilfotos aufheben +
+ Profilfoto sperren -

test

+
+
+ + +
    +
  1. + +

    {{element.strasse +" "+element.adr_typ+" " + element.plz+" "+element.ort}}

    + +

    {{bezeichnung +": " +wert}}

    +
  2. +
+
+
+
    + +
  1. + +

    + {{element.kontakttyp + " " + element.kontakt+" " }} + + + +

    + +

    {{bezeichnung +": "+wert}}

    + +
  2. +
+ + +
+
`, }; \ No newline at end of file From d08b90453083d18bda692b0c0a7d512f64ab6f7b Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Thu, 23 Nov 2023 10:02:22 +0100 Subject: [PATCH 009/201] mailverteiler und deren mailto href --- application/controllers/Cis/Profil.php | 9 +- application/views/Cis/Profil.php | 3 +- public/js/apps/api/userdata.js | 6 + public/js/components/Cis/Profil/Profil.js | 172 ++++++++++++++++++---- 4 files changed, 159 insertions(+), 31 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index ef15d830c..bd0970923 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -66,8 +66,12 @@ class Profil extends Auth_Controller // catch error } $mailverteiler_res = hasData($mailverteiler_res)? getData($mailverteiler_res) : null; + + $mailverteiler_res = array_map(function($element) { $element->mailto="mailto:".$element->gruppe_kurzbz."@".DOMAIN; return $element;},$mailverteiler_res); } + + if(isSuccess($this->KontaktModel->addSelect('DISTINCT ON (kontakttyp) kontakttyp, kontakt, tbl_kontakt.anmerkung, tbl_kontakt.zustellung')) && isSuccess($this->KontaktModel->addJoin('public.tbl_standort', 'standort_id', 'LEFT')) && isSuccess($this->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT'))&& @@ -90,7 +94,7 @@ class Profil extends Auth_Controller } if( - isSuccess($this->BetriebsmittelpersonModel->addSelect(["betriebsmitteltyp", "beschreibung","nummer","ausgegebenam"])) + isSuccess($this->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel","nummer as Nummer","ausgegebenam as Ausgegeben_am"])) ){ $betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel(getAuthPersonId()); @@ -103,7 +107,7 @@ class Profil extends Auth_Controller if( //! Summe der Wochenstunden wird jetzt in der hr/tbl_dienstverhaeltnis gespeichert - isSuccess($this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as bf_bezeichnung","tbl_organisationseinheit.bezeichnung as oe_bezeichnung","datum_von","datum_bis","wochenstunden"]))&& + isSuccess($this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as Bezeichnung","tbl_organisationseinheit.bezeichnung as Organisationseinheit","datum_von as Gültig_von","datum_bis as Gültig_bis","wochenstunden as Wochenstunden"]))&& isSuccess($this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit","oe_kurzbz")) ){ $benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(array('uid'=>getAuthUID())); @@ -219,6 +223,7 @@ class Profil extends Auth_Controller } + diff --git a/application/views/Cis/Profil.php b/application/views/Cis/Profil.php index 4feb98ec4..8c930db09 100644 --- a/application/views/Cis/Profil.php +++ b/application/views/Cis/Profil.php @@ -2,6 +2,7 @@ $includesArray = array( 'title' => 'Stundenplan', 'customJSModules' => ['public/js/apps/Cis/ProfilApp.js'], + 'tabulator5' => true, 'customCSSs' => ['public/css/components/calendar.css'] ); @@ -12,7 +13,7 @@ $this->load->view('templates/CISHTML-Header', $includesArray);

Profil


-

+
diff --git a/public/js/apps/api/userdata.js b/public/js/apps/api/userdata.js index cd701a2d1..9550171c3 100644 --- a/public/js/apps/api/userdata.js +++ b/public/js/apps/api/userdata.js @@ -20,6 +20,12 @@ export default { + `cis.php/Cis/Profil/foto_sperre_function/${value}`; return axios.get(url); }, + getBenutzerFunktionen: function() { + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ + "/Cis/Profil/getBenutzerFunktionen"; + + return axios.get(url); + }, }; \ No newline at end of file diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index 3b1ca8e03..e8970f3f5 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -1,17 +1,61 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; -//"
  • {{element}}
" +import {CoreFilterCmpt} from "../../../components/filter/Filter.js" + + +/* [ + {title: 'Log ID', field: 'LogId', headerFilter: true}, + {title: 'Request ID', field: 'RequestId', headerFilter: true}, + {title: 'Execution time', field: 'ExecutionTime', headerFilter: true}, + {title: 'Executed by', field: 'ExecutedBy', headerFilter: true}, + {title: 'Description', field: 'Description', headerFilter: true}, + {title: 'Data', field: 'Data', headerFilter: true}, + {title: 'Web service type', field: 'WebserviceType', headerFilter: true} +] */ + +//? old data +/* ajaxUrl: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ + "/Cis/Profil/getBenutzerFunktionen", */ export default { - + components:{ + CoreFilterCmpt, + }, data() { return { - + person_info: null, //? beinhaltet die Information ob der angefragte user ein Student oder Mitarbeiter ist role: null, + //"bf_bezeichnung", "oe_bezeichnung", "datum_von", "datum_bis", "wochenstunden" ] + + funktionen_table_options: { + height: 300, + layout: 'fitColumns', + //ajaxUrl: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ + //"/Cis/Profil/getBenutzerFunktionen", + data:[{Bezeichnung:"test1",Organisationseinheit:"test2",Gültig_von:"test3",Gültig_bis:"test4",Wochenstunden:"test5"}], + + columns: [{title: 'Bezeichnung', field: 'Bezeichnung', headerFilter: true}, + {title: 'Organisationseinheit', field: 'Organisationseinheit', headerFilter: true}, + {title: 'Gültig_von', field: 'Gültig_von', headerFilter: true}, + {title: 'Gültig_bis', field: 'Gültig_bis', headerFilter: true}, + {title: 'Wochenstunden', field: 'Wochenstunden', headerFilter: true},] + + }, + betriebsmittel_table_options:{ + height: 300, + layout: 'fitColumns', + data:[{Bezeichnung:"test1",Organisationseinheit:"test2",Gültig_von:"test3",Gültig_bis:"test4",Wochenstunden:"test5"}], + + columns: [{title: 'Betriebsmittel', field: 'betriebsmittel', headerFilter: true}, + {title: 'Nummer', field: 'Nummer', headerFilter: true}, + {title: 'Ausgegeben_am', field: 'Ausgegeben_am', headerFilter: true},] + + }, } }, + //? this props were passed in the Profil.php view file props:['uid','pid'], methods: { @@ -35,23 +79,39 @@ export default { return result; }, sperre_foto_function(value){ + if(!this.person_info){ + return; + } fhcapifactory.UserData.sperre_foto_function(value).then(res => { - console.log(res.data); - if(res.data){ this.person_info.foto_sperre = res.data.foto_sperre; - } + }); }, + }, computed:{ - + test_computed(){ + return "test_computed"; + }, + get_Functions_Tabulator_Columns(){ + if(!this.person_info){ + return []; + } + return Object.keys(this.person_info.funktionen[0]).map(key => {return {title: key,field:key, headerFilter:true}}); + }, get_image_base64_src(){ - return "data:image/jpeg;base64,"+this.person_info.foto; + if(!this.person_info){ + return ""; + } + return "data:image/jpeg;base64,"+(this.person_info ? this.person_info.foto : ""); }, first_col(){ + if(!this.person_info){ + return {}; + } //! postnomen is still missing return { Username:this.uid, @@ -68,6 +128,9 @@ export default { }; }, second_col(){ + if(!this.person_info){ + return {}; + } //! postnomen is still missing return { Intern:this.person_info.email_intern, @@ -75,37 +138,55 @@ export default { Kontakte:this.person_info.kontakte, }; }, - - - }, - created(){ - //error //! fhcapifactory.UserData.getUser().then(res => this.person = res.data); - fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then(res => {console.log(res.data);this.role = res.data;}); - fhcapifactory.UserData.getMitarbeiterAnsicht().then(res => {this.person_info = res.data;}); + created(){ + + //error //! fhcapifactory.UserData.getUser().then(res => this.person = res.data); + fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then(res => {this.role = res.data;}); + + + //.tabulator.setData(this.person_info?.funktionen); + + }, + mounted(){ + fhcapifactory.UserData.getMitarbeiterAnsicht().then(res => { + this.person_info = res.data; + this.$refs.funktionenTable.tabulator.setData(res.data.funktionen); + this.$refs.betriebsmittelTable.tabulator.setData(res.data.mittel); + }); }, template: ` +
+
+
-

{{wert + ": " + bezeichnung}}

-

{{JSON.stringify(first_col)}}

-

{{"here is the uid "+uid}}

-

{{"here is the pid "+pid}}

-
-
-
- -
+
+
+ +
+
+
+ +
+ +
+ +
+
+ -
+
    @@ -117,7 +198,7 @@ export default {
-
+
  1. @@ -135,6 +216,41 @@ export default {
+
+
+ +
+ +
+ + +
+ +
+ +
+ +
+ + +
+
+
+ +
+ +
+
Mailverteilers
+

Sie sind Mitgglied in folgenden Verteilern:

+
+ +
{{verteiler.beschreibung}}
+
+
From dee3b35a5d99b70c9c2c3fa6a86081e32d83d01b Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Thu, 23 Nov 2023 14:48:05 +0100 Subject: [PATCH 010/201] solved table bug --- application/controllers/Cis/Profil.php | 21 ++++++--- application/views/Cis/Profil.php | 2 +- public/js/components/Cis/Profil/Profil.js | 53 ++++++++++++++++------- public/js/components/filter/Filter.js | 3 ++ 4 files changed, 56 insertions(+), 23 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index bd0970923..cbbc84145 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -86,12 +86,16 @@ class Profil extends Auth_Controller } - $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittel(getAuthPersonId()); + $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid(getAuthUID(),"Zutrittskarte"); if(isError($zutrittskarte_ausgegebenam)){ // error handling }else{ - $zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam)? getData($zutrittskarte_ausgegebenam)[0] : null; + $zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam)? getData($zutrittskarte_ausgegebenam)[0]->ausgegebenam : null; + //? formats the date from 01-01-2000 to 01.01.2000 + $zutrittskarte_ausgegebenam = str_replace("-",".",$zutrittskarte_ausgegebenam); } + + if( isSuccess($this->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel","nummer as Nummer","ausgegebenam as Ausgegeben_am"])) @@ -170,9 +174,14 @@ class Profil extends Auth_Controller //? Mitarbeiter Info $res->kurzbz = $mitarbeiter_res->kurzbz; $res->telefonklappe = $mitarbeiter_res->telefonklappe; - //? Benutzer Info - $res->email_intern = getAuthUID() . DOMAIN; - $res->email_extern = $benutzer_res->alias . DOMAIN; + //? Email Info + $intern_email = array(); + $intern_email+=array("type" => "intern"); + $intern_email+=array("email"=> getAuthUID() . DOMAIN); + $extern_email=array(); + $extern_email+=array("type" => "extern"); + $extern_email+=array("email" => $benutzer_res->alias . DOMAIN); + $res->emails = array($intern_email,$extern_email); //? Adresse Info $res->adressen = $adresse_res; //? Benutzerfunktion Info @@ -180,7 +189,7 @@ class Profil extends Auth_Controller //? Betriebsmittel Info $res->mittel = $betriebsmittelperson_res; //? Austellungsdatum von der Zutrittskarte - $res->zutrittskarte_ausgegebenam = $zutrittskarte_ausgegebenam->ausgegebenam; + $res->zutrittskarte_ausgegebenam = $zutrittskarte_ausgegebenam; //? Kontakt Info $res->kontakte = $kontakte_res; //? Mailverteiler Info diff --git a/application/views/Cis/Profil.php b/application/views/Cis/Profil.php index 8c930db09..931d879d5 100644 --- a/application/views/Cis/Profil.php +++ b/application/views/Cis/Profil.php @@ -3,7 +3,7 @@ $includesArray = array( 'title' => 'Stundenplan', 'customJSModules' => ['public/js/apps/Cis/ProfilApp.js'], 'tabulator5' => true, - 'customCSSs' => ['public/css/components/calendar.css'] + 'customCSSs' => ['public/css/components/calendar.css', 'public/css/components/FilterComponent.css'] ); $this->load->view('templates/CISHTML-Header', $includesArray); diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index e8970f3f5..7361f8026 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -46,7 +46,7 @@ export default { betriebsmittel_table_options:{ height: 300, layout: 'fitColumns', - data:[{Bezeichnung:"test1",Organisationseinheit:"test2",Gültig_von:"test3",Gültig_bis:"test4",Wochenstunden:"test5"}], + data:[{betriebsmittel:"test1",Nummer:"test2",Ausgegeben_am:"test3"}], columns: [{title: 'Betriebsmittel', field: 'betriebsmittel', headerFilter: true}, {title: 'Nummer', field: 'Nummer', headerFilter: true}, @@ -59,6 +59,7 @@ export default { //? this props were passed in the Profil.php view file props:['uid','pid'], methods: { + concatenate_addresses(address_array){ let result = ""; for (let i = 0; i < address_array.length; i++) { @@ -133,8 +134,8 @@ export default { } //! postnomen is still missing return { - Intern:this.person_info.email_intern, - Alias:this.person_info.email_extern, + FhAusweisStatus: this.person_info.zutrittskarte_ausgegebenam, + emails:this.person_info.emails, Kontakte:this.person_info.kontakte, }; }, @@ -150,12 +151,21 @@ export default { //.tabulator.setData(this.person_info?.funktionen); }, - mounted(){ - fhcapifactory.UserData.getMitarbeiterAnsicht().then(res => { - this.person_info = res.data; - this.$refs.funktionenTable.tabulator.setData(res.data.funktionen); - this.$refs.betriebsmittelTable.tabulator.setData(res.data.mittel); - }); + mounted(){ + //? this function is to update the tabulator information only when the tabulator was build checking the tableBulit event + //! only the tableBuilt event of the second tabulator was used to update the table informations + this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { + fhcapifactory.UserData.getMitarbeiterAnsicht().then((res)=>{ + this.person_info = res.data; + this.$refs.funktionenTable.tabulator.setData(res.data.funktionen); + this.$refs.betriebsmittelTable.tabulator.setData(res.data.mittel); + + }) + }) + + + + }, template: ` @@ -200,17 +210,27 @@ export default {
    - +
  1. -

    + +

    +

    FH-Ausweis Status

    +

    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}

    +
    + + + +
    +

    Private Kontakte

    + {{element.kontakttyp + " " + element.kontakt+" " }} + +
    -

    - -

    {{bezeichnung +": "+wert}}

    +
@@ -223,7 +243,7 @@ export default {
- +
@@ -231,8 +251,9 @@ export default {
+ - +
diff --git a/public/js/components/filter/Filter.js b/public/js/components/filter/Filter.js index 2bf878e5a..985dc9a6e 100644 --- a/public/js/components/filter/Filter.js +++ b/public/js/components/filter/Filter.js @@ -182,8 +182,11 @@ export const CoreFilterCmpt = { const cols = this.tabulator.getColumns(); this.fields = cols.map(col => col.getField()); this.selectedFields = cols.filter(col => col.isVisible()).map(col => col.getField()); + }); + } + }, updateTabulator() { if (this.tabulator) { From 1817757745ec564b84f9ebf5423335ef2785d7f8 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 27 Nov 2023 12:01:04 +0100 Subject: [PATCH 011/201] adds the @ to the emails and changes the layout of the information displayed on the profile page --- application/controllers/Cis/Profil.php | 20 +++++-- public/js/components/Cis/Profil/Profil.js | 63 +++++++++++++++-------- 2 files changed, 58 insertions(+), 25 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index cbbc84145..048c25959 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -158,17 +158,31 @@ class Profil extends Auth_Controller $mitarbeiter_res = hasData($mitarbeiter_res)? getData($mitarbeiter_res)[0] : null; } + // collection for the first collumn + $first_column = new stdClass(); + $first_column->username = getAuthUID(); + $first_column->anrede = $person_res->anrede; + $first_column->titelpre = $person_res->titelpre; + $first_column->titelpost = $person_res->titelpost; + $first_column->vorname = $person_res->vorname; + $first_column->nachname = $person_res->nachname; + + $res = new stdClass(); $res->username = getAuthUID(); + + //? Person Info $res->foto = $person_res->foto; $res->foto_sperre = $person_res->foto_sperre; + $res->anrede = $person_res->anrede; $res->titelpre = $person_res->titelpre; $res->titelpost = $person_res->titelpost; $res->vorname = $person_res->vorname; $res->nachname = $person_res->nachname; //$res->postnomen = $person_res->postnomen; //!POSTNOMEN? + $res->gebdatum = $person_res->gebdatum; $res->gebort = $person_res->gebort; //? Mitarbeiter Info @@ -177,10 +191,10 @@ class Profil extends Auth_Controller //? Email Info $intern_email = array(); $intern_email+=array("type" => "intern"); - $intern_email+=array("email"=> getAuthUID() . DOMAIN); + $intern_email+=array("email"=> getAuthUID() . "@" . DOMAIN); $extern_email=array(); - $extern_email+=array("type" => "extern"); - $extern_email+=array("email" => $benutzer_res->alias . DOMAIN); + $extern_email+=array("type" => "alias"); + $extern_email+=array("email" => $benutzer_res->alias . "@" . DOMAIN); $res->emails = array($intern_email,$extern_email); //? Adresse Info $res->adressen = $adresse_res; diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index 7361f8026..260d92b02 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -109,26 +109,33 @@ export default { } return "data:image/jpeg;base64,"+(this.person_info ? this.person_info.foto : ""); }, - first_col(){ + personData(){ if(!this.person_info){ return {}; } //! postnomen is still missing return { - Username:this.uid, + Allgemein: { + Username:this.uid, Anrede:this.person_info.anrede, Titel:(this.person_info.titelpre&&this.person_info.titelpost)?this.person_info.titelpre.concat(this.person_info.titelpost):"null", Vorname:this.person_info.vorname, Nachname:this.person_info.nachname, Postnomen:null, + }, + GeburtsDaten:{ Geburtsdatum:this.person_info.gebdatum, Geburtsort: this.person_info.gebort, - Adresse: this.person_info.adressen, + }, + Adressen: this.person_info.adressen, + SpecialInformation: { Kurzzeichen: this.person_info.kurzbz, Telefon: this.person_info.telefonklappe, + }, }; }, - second_col(){ + //? this computed conains all the information that is used for the second column that displays the information of the person + kontaktInfo(){ if(!this.person_info){ return {}; } @@ -169,6 +176,7 @@ export default { }, template: ` +
@@ -180,7 +188,7 @@ export default {
-
+
@@ -197,37 +205,48 @@ export default {
- -
    -
  1. +

    Mitarbeiter

    +

    Student

    + +
    + +
    {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}}
    +
    {{bez}}: {{val}}
    + +
    -

    {{element.strasse +" "+element.adr_typ+" " + element.plz+" "+element.ort}}

    - -

    {{bezeichnung +": " +wert}}

    -
  2. -
    -
  1. +
  2. -
    -

    FH-Ausweis Status

    -

    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}

    +
    +

    FH-Ausweis Status

    +

    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}

    + + + +
    +

    eMail

    +

    {{email.type}}: {{email.email}}

    +
    -
    -

    Private Kontakte

    - - {{element.kontakttyp + " " + element.kontakt+" " }} +
    +

    Private Kontakte

    +
    +
    {{element.kontakttyp + " " + element.kontakt+" " }}
    +
    {{element?.anmerkung}}
    +
    - +
    +
    From 2df956ef206e3a642f763c0d96b14c82d3480dde Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 27 Nov 2023 12:04:57 +0100 Subject: [PATCH 012/201] layout for index Mitarbeiter --- public/js/components/Cis/Profil/Profil.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index 260d92b02..476677368 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -233,7 +233,7 @@ export default {

    eMail

    -

    {{email.type}}: {{email.email}}

    +

    {{email.type}}: {{email.email}}

    From e3ec0fc36c61eae666f1a45f64df43f98df18d95 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 28 Nov 2023 14:55:42 +0100 Subject: [PATCH 013/201] upadtes api calls --- public/js/apps/api/userdata.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/public/js/apps/api/userdata.js b/public/js/apps/api/userdata.js index 9550171c3..7f5b32704 100644 --- a/public/js/apps/api/userdata.js +++ b/public/js/apps/api/userdata.js @@ -27,5 +27,26 @@ export default { return axios.get(url); }, + indexProfilInformaion: function() { + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ + "/Cis/Profil/indexProfilInformaion"; + + return axios.get(url); + }, + mitarbeiterProfil: function() { + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ + "/Cis/Profil/mitarbeiterProfil"; + + return axios.get(url); + }, + studentProfil: function() { + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ + "/Cis/Profil/studentProfil"; + + return axios.get(url); + }, + + + }; \ No newline at end of file From c68856b7407adb3a1b5311747abda231f5bc4ce5 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 28 Nov 2023 14:56:42 +0100 Subject: [PATCH 014/201] completes the index view for both student and mitarbeiter --- application/controllers/Cis/Profil.php | 231 +++++++++++++++++++++- public/js/components/Cis/Profil/Profil.js | 167 ++++++++++------ 2 files changed, 324 insertions(+), 74 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index 048c25959..d6ec53a1a 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -19,6 +19,10 @@ class Profil extends Auth_Controller 'isMitarbeiterOrStudent' => ['student/anrechnung_beantragen:r','user:r'], 'getMitarbeiterAnsicht' => ['student/anrechnung_beantragen:r','user:r'], 'foto_sperre_function' => ['student/anrechnung_beantragen:r','user:r'], + 'indexProfilInformaion' => ['student/anrechnung_beantragen:r','user:r'], + 'mitarbeiterProfil' => ['student/anrechnung_beantragen:r','user:r'], + 'studentProfil' => ['student/anrechnung_beantragen:r','user:r'], + @@ -29,8 +33,11 @@ class Profil extends Auth_Controller $this->load->model('person/Person_model', 'PersonModel'); $this->load->model('person/Adresse_model', 'AdresseModel'); $this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel'); + $this->load->model('person/Benutzergruppe_model', 'BenutzergruppeModel'); $this->load->model('ressource/Betriebsmittelperson_model', 'BetriebsmittelpersonModel'); $this->load->model('person/Kontakt_model', 'KontaktModel'); + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $this->load->model('crm/Prestudent_model', 'PrestudentModel'); } @@ -51,10 +58,223 @@ class Profil extends Auth_Controller } + public function studentProfil(){ + + if( + isSuccess($this->BenutzergruppeModel->addSelect(['bezeichnung'])) + && isSuccess($this->BenutzergruppeModel->addJoin('tbl_gruppe', 'gruppe_kurzbz' )) + ){ + $zutrittsgruppe_res = $this->BenutzergruppeModel->loadWhere(array("uid"=>getAuthUID(), "zutrittssystem"=>true)); + if(isError($zutrittsgruppe_res)){ + // catch error + } + $zutrittsgruppe_res = hasData($zutrittsgruppe_res) ? getData($zutrittsgruppe_res) : null; + + } + + + + //? personenkennzeichen ist die Spalte Matrikelnr in der Tabelle Student + if(isSuccess($this->StudentModel->addSelect(['tbl_studiengang.bezeichnung as studiengang','tbl_student.semester', 'tbl_student.verband', 'tbl_student.gruppe' ,'tbl_student.matrikelnr as personenkennzeichen'])) + && isSuccess($this->StudentModel->addJoin('tbl_studiengang', "tbl_studiengang.studiengang_kz=tbl_student.studiengang_kz"))) + { + $student_res = $this->StudentModel->load([getAuthUID()]); + if(isError($student_res)){ + // catch error + } + $student_res = hasData($student_res)?getData($student_res)[0]:null; + + } + + + + //? Matrikelnummer ist die Spalte matr_nr in Person + if(isSuccess($this->StudentModel->addSelect(["matr_nr"]))){ + $person_res = $this->PersonModel->load(getAuthPersonID()); + if(isError($person_res)){ + // catch error + }else{ + $person_res = hasData($person_res)? getData($person_res)[0] : []; + + } + } + + $res = new stdClass(); + $res->matrikelnummer = $person_res->matr_nr; + foreach($student_res as $key => $value){ + $res->$key = $value; + } + $res->zuttritsgruppen = $zutrittsgruppe_res; + + echo json_encode($res); + + + + } + + public function mitarbeiterProfil(){ + //? informationen die nur für den Mitarbeiter verfügbar sind + + + if( + //! Summe der Wochenstunden wird jetzt in der hr/tbl_dienstverhaeltnis gespeichert + isSuccess($this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as Bezeichnung","tbl_organisationseinheit.bezeichnung as Organisationseinheit","datum_von as Gültig_von","datum_bis as Gültig_bis","wochenstunden as Wochenstunden"]))&& + isSuccess($this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit","oe_kurzbz")) + ){ + $benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(array('uid'=>getAuthUID())); + if(isError($benutzer_funktion_res)){ + // error handling + }else{ + $benutzer_funktion_res = hasData($benutzer_funktion_res)? getData($benutzer_funktion_res) : null; + } + } + + + + if(isSuccess($this->MitarbeiterModel->addSelect(["kurzbz","telefonklappe", "alias"])) + && isSuccess($this->MitarbeiterModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid")) + ){ + $mitarbeiter_res = $this->MitarbeiterModel->load(getAuthUID()); + if(isError($mitarbeiter_res)){ + // error handling + }else{ + $mitarbeiter_res = hasData($mitarbeiter_res)? getData($mitarbeiter_res)[0] : null; + } + } + $res = new stdClass(); + foreach($mitarbeiter_res as $key => $value){ + $res->$key = $value; + } + $intern_email = array(); + $intern_email+=array("type" => "intern"); + $intern_email+=array("email"=> getAuthUID() . "@" . DOMAIN); + $extern_email=array(); + $extern_email+=array("type" => "alias"); + $extern_email+=array("email" => $mitarbeiter_res->alias . "@" . DOMAIN); + $res->emails = array($intern_email,$extern_email); + + $res->funktionen = $benutzer_funktion_res; + echo json_encode($res); + } + + public function indexProfilInformaion(){ + //? funktion returns all data needed for the student and the mitarbeiter profil view + + + + if( + isSuccess($this->PersonModel->addSelect('gruppe_kurzbz, beschreibung'))&& + isSuccess($this->PersonModel->addJoin('tbl_benutzer', 'person_id')) && + isSuccess($this->PersonModel->addJoin('tbl_benutzergruppe', 'uid')) && + isSuccess($this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz'))){ + + $mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid'=>getAuthUID())); + if( isError($mailverteiler_res)){ + // catch error + } + $mailverteiler_res = hasData($mailverteiler_res)? getData($mailverteiler_res) : null; + + $mailverteiler_res = array_map(function($element) { $element->mailto="mailto:".$element->gruppe_kurzbz."@".DOMAIN; return $element;},$mailverteiler_res); + } + + + + if( + isSuccess($this->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel","nummer as Nummer","ausgegebenam as Ausgegeben_am"])) + + ){ + $betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel(getAuthPersonId()); + if(isError($betriebsmittelperson_res)){ + // error handling + }else{ + $betriebsmittelperson_res = hasData($betriebsmittelperson_res)? getData($betriebsmittelperson_res) : null; + } + } + + + if(isSuccess($this->KontaktModel->addSelect('DISTINCT ON (kontakttyp) kontakttyp, kontakt, tbl_kontakt.anmerkung, tbl_kontakt.zustellung')) && + isSuccess($this->KontaktModel->addJoin('public.tbl_standort', 'standort_id', 'LEFT')) && + isSuccess($this->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT'))&& + isSuccess($this->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum')) + ){ + $kontakte_res = $this->KontaktModel->loadWhere(array('person_id' => getAuthPersonID())); + if(isError($kontakte_res)){ + // handle error + }else{ + $kontakte_res = hasData($kontakte_res)? getData($kontakte_res) : null; + } + + } + + $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid(getAuthUID(),"Zutrittskarte"); + if(isError($zutrittskarte_ausgegebenam)){ + // error handling + }else{ + $zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam)? getData($zutrittskarte_ausgegebenam)[0]->ausgegebenam : null; + //? formats the date from 01-01-2000 to 01.01.2000 + $zutrittskarte_ausgegebenam = str_replace("-",".",$zutrittskarte_ausgegebenam); + } + + if( + isSuccess($adresse_res = $this->AdresseModel->addSelect(array("strasse","tbl_adressentyp.bezeichnung as adr_typ","plz","ort")))&& + isSuccess($adresse_res = $this->AdresseModel->addOrder("zustelladresse","DESC"))&& + isSuccess($adresse_res = $this->AdresseModel->addOrder("sort"))&& + isSuccess($adresse_res = $this->AdresseModel->addJoin("tbl_adressentyp","typ=adressentyp_kurzbz")) + ){ + $adresse_res = $this->AdresseModel->loadWhere(array("person_id"=>getAuthPersonID())); + if(isError($adresse_res)){ + // error handling + }else{ + $adresse_res = hasData($adresse_res)? getData($adresse_res) : null; + } + } + + if(isSuccess($this->PersonModel->addSelect(["foto","foto_sperre","anrede","titelpost","titelpre","vorname","nachname", "gebort", "gebdatum"]))){ + + $person_res = $this->PersonModel->load(getAuthPersonId()); + if(isError($person_res)){ + // error handling + }else{ + $person_res = hasData($person_res)? getData($person_res)[0] : null; + } + } + + + + $res = new stdClass(); + $res->foto = $person_res->foto; + $res->foto_sperre = $person_res->foto_sperre; + $res->username = getAuthUID(); + + $res->anrede = $person_res->anrede; + $res->titel = $person_res->titelpre ." " . $person_res->titelpost; + $res->vorname = $person_res->vorname; + $res->nachname = $person_res->nachname; + $res->gebort = $person_res->gebort; + $res->gebdatum = $person_res->gebdatum; + $res->adressen = $adresse_res; + $res->zutrittsdatum = $zutrittskarte_ausgegebenam; + //$res->postnomen = $person_res->postnomen; //! still not found + $intern_email = array(); + $intern_email+=array("type" => "intern"); + $intern_email+=array("email"=> getAuthUID() . "@" . DOMAIN); + $res->emails = array($intern_email); + + $res->kontakte = $kontakte_res; + $res->mittel = $betriebsmittelperson_res; + $res->mailverteiler = $mailverteiler_res; + + + + echo json_encode($res); + + } public function getMitarbeiterAnsicht(){ + + if( isSuccess($this->PersonModel->addSelect('gruppe_kurzbz, beschreibung'))&& isSuccess($this->PersonModel->addJoin('tbl_benutzer', 'person_id')) && @@ -158,15 +378,6 @@ class Profil extends Auth_Controller $mitarbeiter_res = hasData($mitarbeiter_res)? getData($mitarbeiter_res)[0] : null; } - // collection for the first collumn - $first_column = new stdClass(); - $first_column->username = getAuthUID(); - $first_column->anrede = $person_res->anrede; - $first_column->titelpre = $person_res->titelpre; - $first_column->titelpost = $person_res->titelpost; - $first_column->vorname = $person_res->vorname; - $first_column->nachname = $person_res->nachname; - $res = new stdClass(); $res->username = getAuthUID(); @@ -208,7 +419,7 @@ class Profil extends Auth_Controller $res->kontakte = $kontakte_res; //? Mailverteiler Info $res->mailverteiler = $mailverteiler_res; - + echo json_encode($res); } diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index 476677368..c27893551 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -23,8 +23,9 @@ export default { }, data() { return { - - person_info: null, + index_information: null, + mitarbeiter_info: null, + student_info:null, //? beinhaltet die Information ob der angefragte user ein Student oder Mitarbeiter ist role: null, //"bf_bezeichnung", "oe_bezeichnung", "datum_von", "datum_bis", "wochenstunden" ] @@ -32,10 +33,7 @@ export default { funktionen_table_options: { height: 300, layout: 'fitColumns', - //ajaxUrl: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ - //"/Cis/Profil/getBenutzerFunktionen", data:[{Bezeichnung:"test1",Organisationseinheit:"test2",Gültig_von:"test3",Gültig_bis:"test4",Wochenstunden:"test5"}], - columns: [{title: 'Bezeichnung', field: 'Bezeichnung', headerFilter: true}, {title: 'Organisationseinheit', field: 'Organisationseinheit', headerFilter: true}, {title: 'Gültig_von', field: 'Gültig_von', headerFilter: true}, @@ -47,12 +45,17 @@ export default { height: 300, layout: 'fitColumns', data:[{betriebsmittel:"test1",Nummer:"test2",Ausgegeben_am:"test3"}], - columns: [{title: 'Betriebsmittel', field: 'betriebsmittel', headerFilter: true}, {title: 'Nummer', field: 'Nummer', headerFilter: true}, {title: 'Ausgegeben_am', field: 'Ausgegeben_am', headerFilter: true},] }, + zutrittsgruppen_table_options:{ + height: 300, + layout: 'fitColumns', + data:[{bezeichnung:"test1"}], + columns: [{title: 'Zutritt', field: 'bezeichnung'}] + } } }, @@ -80,12 +83,12 @@ export default { return result; }, sperre_foto_function(value){ - if(!this.person_info){ + if(!(this.mitarbeiter_info && this.index_information && this.student_info) ){ return; } fhcapifactory.UserData.sperre_foto_function(value).then(res => { - this.person_info.foto_sperre = res.data.foto_sperre; + this.index_information.foto_sperre = res.data.foto_sperre; }); @@ -94,56 +97,63 @@ export default { }, computed:{ - test_computed(){ - return "test_computed"; - }, - get_Functions_Tabulator_Columns(){ - if(!this.person_info){ - return []; - } - return Object.keys(this.person_info.funktionen[0]).map(key => {return {title: key,field:key, headerFilter:true}}); - }, + + get_image_base64_src(){ - if(!this.person_info){ + if(!this.index_information){ return ""; } - return "data:image/jpeg;base64,"+(this.person_info ? this.person_info.foto : ""); + return "data:image/jpeg;base64,"+this.index_information.foto; }, personData(){ - if(!this.person_info){ + if(!this.index_information){ return {}; } - //! postnomen is still missing + return { - Allgemein: { - Username:this.uid, - Anrede:this.person_info.anrede, - Titel:(this.person_info.titelpre&&this.person_info.titelpost)?this.person_info.titelpre.concat(this.person_info.titelpost):"null", - Vorname:this.person_info.vorname, - Nachname:this.person_info.nachname, + Allgemein: this.role =='Mitarbeiter'?{ + Username:this.index_information.username, + Anrede:this.index_information.anrede, + Titel:this.index_information.titel, + Vorname:this.index_information.vorname, + Nachname:this.index_information.nachname, + Postnomen:null, + }:{ + Username:this.index_information.username, + Matrikelnummer: this.student_info?.matrikelnummer, + Anrede:this.index_information.anrede, + Titel:this.index_information.titel, + Vorname:this.index_information.vorname, + Nachname:this.index_information.nachname, Postnomen:null, }, GeburtsDaten:{ - Geburtsdatum:this.person_info.gebdatum, - Geburtsort: this.person_info.gebort, + Geburtsdatum:this.index_information.gebdatum, + Geburtsort: this.index_information.gebort, }, - Adressen: this.person_info.adressen, - SpecialInformation: { - Kurzzeichen: this.person_info.kurzbz, - Telefon: this.person_info.telefonklappe, + Adressen: this.index_information.adressen, + SpecialInformation: this.role =='Mitarbeiter'? { + Kurzzeichen: this.mitarbeiter_info?.kurzbz, + Telefon: this.mitarbeiter_info?.telefonklappe, + } : { + Studiengang:this.student_info?.studiengang, + Semester:this.student_info?.semester, + Verband:this.student_info?.verband, + Gruppe:this.student_info?.gruppe, + Personenkennzeichen:this.student_info?.personenkennzeichen }, }; }, //? this computed conains all the information that is used for the second column that displays the information of the person kontaktInfo(){ - if(!this.person_info){ + if(!this.index_information){ return {}; } - //! postnomen is still missing + return { - FhAusweisStatus: this.person_info.zutrittskarte_ausgegebenam, - emails:this.person_info.emails, - Kontakte:this.person_info.kontakte, + FhAusweisStatus: this.index_information.zutrittsdatum, + emails: this.role === 'Mitarbeiter'? this.mitarbeiter_info?.emails: this.index_information.emails, + Kontakte:this.index_information.kontakte, }; }, @@ -151,26 +161,54 @@ export default { created(){ - //error //! fhcapifactory.UserData.getUser().then(res => this.person = res.data); - fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then(res => {this.role = res.data;}); + + - //.tabulator.setData(this.person_info?.funktionen); }, mounted(){ + + console.log(this.uid); + console.log(this.pid); + //? this function is to update the tabulator information only when the tabulator was build checking the tableBulit event //! only the tableBuilt event of the second tabulator was used to update the table informations - this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { - fhcapifactory.UserData.getMitarbeiterAnsicht().then((res)=>{ - this.person_info = res.data; - this.$refs.funktionenTable.tabulator.setData(res.data.funktionen); - this.$refs.betriebsmittelTable.tabulator.setData(res.data.mittel); + this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { + + fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then((res) => { + this.role = res.data; + + + //? Die anderen api calls werden erst gemacht wenn der call zu isMitarbeiterOrStudent gemacht worden ist + + + //! indexProfilInformationen werden immer gefetcht + fhcapifactory.UserData.indexProfilInformaion().then((res) => { + this.index_information = res.data; + this.$refs.betriebsmittelTable.tabulator.setData(res.data.mittel); + }); - }) - }) - - + + //? Danach werden die Informationen der Role gefetcht + if(this.role === 'Student'){ + fhcapifactory.UserData.studentProfil().then((res)=> { + this.student_info = res.data; + this.$refs.zutrittsgruppenTable.tabulator.setData(res.data.zuttritsgruppen); + }) + } + + if(this.role === 'Mitarbeiter'){ + fhcapifactory.UserData.mitarbeiterProfil().then((res)=> { + this.mitarbeiter_info = res.data; + this.$refs.funktionenTable.tabulator.setData(res.data.funktionen); + }) + } + }); + + + }) + }, @@ -196,7 +234,7 @@ export default {
    -
    +

    Profilfoto gesperrt

    Sperre des Profilfotos aufheben
    @@ -206,8 +244,8 @@ export default {
    -

    Mitarbeiter

    -

    Student

    +

    Mitarbeiter

    +

    Student

    @@ -240,9 +278,9 @@ export default {

    Private Kontakte

    -
    {{element.kontakttyp + " " + element.kontakt+" " }}
    -
    {{element?.anmerkung}}
    -
    +
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    +
    {{element?.anmerkung}}
    +
    @@ -260,21 +298,22 @@ export default {
    -
    - + +
    -
    + +
    - -
    - -
    +
    +
    + +
    @@ -286,7 +325,7 @@ export default {
    Mailverteilers

    Sie sind Mitgglied in folgenden Verteilern:

    -
    +
    {{verteiler.beschreibung}}
    From f26801b7dee3c338cf55fa19eda3e3dea6152080 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 28 Nov 2023 14:58:16 +0100 Subject: [PATCH 015/201] adds a prop to the FilterTable component to conditionally render the filter columns, this was added because there is no need for a filter column when the table only has 1 column --- public/js/components/filter/Filter.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/js/components/filter/Filter.js b/public/js/components/filter/Filter.js index 985dc9a6e..b5a132318 100644 --- a/public/js/components/filter/Filter.js +++ b/public/js/components/filter/Filter.js @@ -45,7 +45,8 @@ export const CoreFilterCmpt = { }, tabulatorOptions: Object, tabulatorEvents: Array, - tableOnly: Boolean + tableOnly: Boolean, + noColFilter:Boolean, }, data: function() { return { @@ -586,10 +587,10 @@ export const CoreFilterCmpt = {
    [ {{ filterName }} ] - +
    -
    +
    From 38f76f68f1be95a554e61735b4320b47285f6206 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Fri, 1 Dec 2023 11:07:25 +0100 Subject: [PATCH 016/201] conditional rendering for different Profile Views --- application/controllers/Cis/Profil.php | 211 ++++++++++++++-------- application/views/Cis/Profil.php | 4 +- public/js/apps/Cis.js | 4 + public/js/apps/api/search.js | 2 +- public/js/apps/api/userdata.js | 32 +--- public/js/components/Cis/Profil/Profil.js | 118 ++++++------ 6 files changed, 218 insertions(+), 153 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index d6ec53a1a..dd1de706d 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -16,6 +16,8 @@ class Profil extends Auth_Controller { parent::__construct([ 'index' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions? + 'View' => ['student/anrechnung_beantragen:r','user:r'], + 'isMitarbeiterOrStudent' => ['student/anrechnung_beantragen:r','user:r'], 'getMitarbeiterAnsicht' => ['student/anrechnung_beantragen:r','user:r'], 'foto_sperre_function' => ['student/anrechnung_beantragen:r','user:r'], @@ -48,23 +50,54 @@ class Profil extends Auth_Controller /** * @return void */ + + public function index() { //? we can pass data to the view by using the second parameter of the load->view() function //* the first parameter is the route that Code Igniter will switch to //* the second parameter can be used to pass data to the view - $this->load->view('Cis/Profil', ["uid" => getAuthUID(),"pid" => getAuthPersonId()]); + $this->load->view('Cis/Profil', ["uid" => getAuthUID(),"pid" => getAuthPersonId(), "view"=> false]); } + //? attempt at rerouting methods + /* public function _remap($method, $params = array()) + { + if($method ==='View' || $method === 'Mitarbeiter'){ + + + return call_user_func_array(array($this, "searchView"), $params); + + }else{ + if (method_exists($this, $method)) + { + return call_user_func_array(array($this, $method), $params); + } + } + } */ + + public function View($uid){ + + //? get the personID of the uid + isSuccess($this->BenutzerModel->addSelect(["person_id"])); + $personID_res = $this->BenutzerModel->load([$uid]); + $personID_res = hasData($personID_res) ? getData($personID_res)[0] : null; + + $this->load->view('Cis/Profil', ["uid" => $uid,"pid" => $personID_res->person_id,"view"=>true]); + + } + - public function studentProfil(){ + + public function studentProfil($uid, $view=false){ if( + !$view && isSuccess($this->BenutzergruppeModel->addSelect(['bezeichnung'])) && isSuccess($this->BenutzergruppeModel->addJoin('tbl_gruppe', 'gruppe_kurzbz' )) ){ - $zutrittsgruppe_res = $this->BenutzergruppeModel->loadWhere(array("uid"=>getAuthUID(), "zutrittssystem"=>true)); + $zutrittsgruppe_res = $this->BenutzergruppeModel->loadWhere(array("uid"=>$uid, "zutrittssystem"=>true)); if(isError($zutrittsgruppe_res)){ // catch error } @@ -78,7 +111,7 @@ class Profil extends Auth_Controller if(isSuccess($this->StudentModel->addSelect(['tbl_studiengang.bezeichnung as studiengang','tbl_student.semester', 'tbl_student.verband', 'tbl_student.gruppe' ,'tbl_student.matrikelnr as personenkennzeichen'])) && isSuccess($this->StudentModel->addJoin('tbl_studiengang', "tbl_studiengang.studiengang_kz=tbl_student.studiengang_kz"))) { - $student_res = $this->StudentModel->load([getAuthUID()]); + $student_res = $this->StudentModel->load([$uid]); if(isError($student_res)){ // catch error } @@ -89,8 +122,9 @@ class Profil extends Auth_Controller //? Matrikelnummer ist die Spalte matr_nr in Person - if(isSuccess($this->StudentModel->addSelect(["matr_nr"]))){ - $person_res = $this->PersonModel->load(getAuthPersonID()); + if(isSuccess($this->BenutzerModel->addSelect(["matr_nr"])) + && isSuccess($this->BenutzerModel->addJoin("tbl_person","person_id"))){ + $person_res = $this->BenutzerModel->load([$uid]); if(isError($person_res)){ // catch error }else{ @@ -104,7 +138,9 @@ class Profil extends Auth_Controller foreach($student_res as $key => $value){ $res->$key = $value; } + if(!$view){ $res->zuttritsgruppen = $zutrittsgruppe_res; + } echo json_encode($res); @@ -112,7 +148,7 @@ class Profil extends Auth_Controller } - public function mitarbeiterProfil(){ + public function mitarbeiterProfil($uid){ //? informationen die nur für den Mitarbeiter verfügbar sind @@ -121,7 +157,7 @@ class Profil extends Auth_Controller isSuccess($this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as Bezeichnung","tbl_organisationseinheit.bezeichnung as Organisationseinheit","datum_von as Gültig_von","datum_bis as Gültig_bis","wochenstunden as Wochenstunden"]))&& isSuccess($this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit","oe_kurzbz")) ){ - $benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(array('uid'=>getAuthUID())); + $benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(array('uid'=>$uid)); if(isError($benutzer_funktion_res)){ // error handling }else{ @@ -134,7 +170,7 @@ class Profil extends Auth_Controller if(isSuccess($this->MitarbeiterModel->addSelect(["kurzbz","telefonklappe", "alias"])) && isSuccess($this->MitarbeiterModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid")) ){ - $mitarbeiter_res = $this->MitarbeiterModel->load(getAuthUID()); + $mitarbeiter_res = $this->MitarbeiterModel->load($uid); if(isError($mitarbeiter_res)){ // error handling }else{ @@ -148,7 +184,7 @@ class Profil extends Auth_Controller } $intern_email = array(); $intern_email+=array("type" => "intern"); - $intern_email+=array("email"=> getAuthUID() . "@" . DOMAIN); + $intern_email+=array("email"=> $uid . "@" . DOMAIN); $extern_email=array(); $extern_email+=array("type" => "alias"); $extern_email+=array("email" => $mitarbeiter_res->alias . "@" . DOMAIN); @@ -158,10 +194,84 @@ class Profil extends Auth_Controller echo json_encode($res); } - public function indexProfilInformaion(){ + + //? the view parameter is a flag that describes if a Profile from a different person is being viewed + public function indexProfilInformaion($uid, $view=false){ //? funktion returns all data needed for the student and the mitarbeiter profil view + $res = new stdClass(); + + //! falls der view flag auf flase gesetzt ist werden extra informationen des Users abgefragt + if(!$view){ + //? betriebsmittel soll nur der user selber sehen + if( + + isSuccess($this->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel","nummer as Nummer","ausgegebenam as Ausgegeben_am"])) + + ){ + //? betriebsmittel are not needed in a view + $betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel(getAuthPersonId()); + if(isError($betriebsmittelperson_res)){ + // error handling + }else{ + $betriebsmittelperson_res = hasData($betriebsmittelperson_res)? getData($betriebsmittelperson_res) : null; + } + } + + if( + + //? kontaktdaten soll auch nur der user selbst sehen + isSuccess($this->KontaktModel->addSelect('DISTINCT ON (kontakttyp) kontakttyp, kontakt, tbl_kontakt.anmerkung, tbl_kontakt.zustellung')) && + isSuccess($this->KontaktModel->addJoin('public.tbl_standort', 'standort_id', 'LEFT')) && + isSuccess($this->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT'))&& + isSuccess($this->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum')) + ){ + $kontakte_res = $this->KontaktModel->loadWhere(array('person_id' => getAuthPersonID())); + if(isError($kontakte_res)){ + // handle error + }else{ + $kontakte_res = hasData($kontakte_res)? getData($kontakte_res) : null; + } + + } + + //? FH Ausweis Austellungsdatum soll auch nur der user selbst sehen + $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid($uid,"Zutrittskarte"); + if(isError($zutrittskarte_ausgegebenam)){ + // error handling + }else{ + $zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam)? getData($zutrittskarte_ausgegebenam)[0]->ausgegebenam : null; + //? formats the date from 01-01-2000 to 01.01.2000 + $zutrittskarte_ausgegebenam = str_replace("-",".",$zutrittskarte_ausgegebenam); + } + + + //? Die Adressen soll auch nur der user selber sehen + + if( + !$view && + isSuccess($adresse_res = $this->AdresseModel->addSelect(array("strasse","tbl_adressentyp.bezeichnung as adr_typ","plz","ort")))&& + isSuccess($adresse_res = $this->AdresseModel->addOrder("zustelladresse","DESC"))&& + isSuccess($adresse_res = $this->AdresseModel->addOrder("sort"))&& + isSuccess($adresse_res = $this->AdresseModel->addJoin("tbl_adressentyp","typ=adressentyp_kurzbz")) + ){ + $adresse_res = $this->AdresseModel->loadWhere(array("person_id"=>getAuthPersonID())); + if(isError($adresse_res)){ + // error handling + }else{ + $adresse_res = hasData($adresse_res)? getData($adresse_res) : null; + } + } + + //? die folgenden Informationen darf nur der eigene user sehen + $res->adressen = $adresse_res; + $res->zutrittsdatum = $zutrittskarte_ausgegebenam; + $res->kontakte = $kontakte_res; + $res->mittel = $betriebsmittelperson_res; + + } + if( isSuccess($this->PersonModel->addSelect('gruppe_kurzbz, beschreibung'))&& @@ -169,7 +279,7 @@ class Profil extends Auth_Controller isSuccess($this->PersonModel->addJoin('tbl_benutzergruppe', 'uid')) && isSuccess($this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz'))){ - $mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid'=>getAuthUID())); + $mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid'=>$uid)); if( isError($mailverteiler_res)){ // catch error } @@ -179,60 +289,15 @@ class Profil extends Auth_Controller } - - if( - isSuccess($this->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel","nummer as Nummer","ausgegebenam as Ausgegeben_am"])) - - ){ - $betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel(getAuthPersonId()); - if(isError($betriebsmittelperson_res)){ - // error handling - }else{ - $betriebsmittelperson_res = hasData($betriebsmittelperson_res)? getData($betriebsmittelperson_res) : null; - } - } - - - if(isSuccess($this->KontaktModel->addSelect('DISTINCT ON (kontakttyp) kontakttyp, kontakt, tbl_kontakt.anmerkung, tbl_kontakt.zustellung')) && - isSuccess($this->KontaktModel->addJoin('public.tbl_standort', 'standort_id', 'LEFT')) && - isSuccess($this->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT'))&& - isSuccess($this->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum')) - ){ - $kontakte_res = $this->KontaktModel->loadWhere(array('person_id' => getAuthPersonID())); - if(isError($kontakte_res)){ - // handle error - }else{ - $kontakte_res = hasData($kontakte_res)? getData($kontakte_res) : null; - } - - } - - $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid(getAuthUID(),"Zutrittskarte"); - if(isError($zutrittskarte_ausgegebenam)){ - // error handling - }else{ - $zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam)? getData($zutrittskarte_ausgegebenam)[0]->ausgegebenam : null; - //? formats the date from 01-01-2000 to 01.01.2000 - $zutrittskarte_ausgegebenam = str_replace("-",".",$zutrittskarte_ausgegebenam); + $benutzer_info_sql_columns = ["foto","foto_sperre","anrede","titelpost","titelpre","vorname","nachname"]; + //? der Geburtsort und das Geburtsdatum darf auch nur der eigene User sehen + if (!$view){ + array_push($benutzer_info_sql_columns, "gebort", "gebdatum"); } + if(isSuccess($this->BenutzerModel->addSelect($benutzer_info_sql_columns)) + && isSuccess($this->BenutzerModel->addJoin("tbl_person", "person_id"))){ - if( - isSuccess($adresse_res = $this->AdresseModel->addSelect(array("strasse","tbl_adressentyp.bezeichnung as adr_typ","plz","ort")))&& - isSuccess($adresse_res = $this->AdresseModel->addOrder("zustelladresse","DESC"))&& - isSuccess($adresse_res = $this->AdresseModel->addOrder("sort"))&& - isSuccess($adresse_res = $this->AdresseModel->addJoin("tbl_adressentyp","typ=adressentyp_kurzbz")) - ){ - $adresse_res = $this->AdresseModel->loadWhere(array("person_id"=>getAuthPersonID())); - if(isError($adresse_res)){ - // error handling - }else{ - $adresse_res = hasData($adresse_res)? getData($adresse_res) : null; - } - } - - if(isSuccess($this->PersonModel->addSelect(["foto","foto_sperre","anrede","titelpost","titelpre","vorname","nachname", "gebort", "gebdatum"]))){ - - $person_res = $this->PersonModel->load(getAuthPersonId()); + $person_res = $this->BenutzerModel->load([$uid]); if(isError($person_res)){ // error handling }else{ @@ -242,27 +307,27 @@ class Profil extends Auth_Controller - $res = new stdClass(); + $res->foto = $person_res->foto; $res->foto_sperre = $person_res->foto_sperre; - $res->username = getAuthUID(); + $res->username = $uid; $res->anrede = $person_res->anrede; $res->titel = $person_res->titelpre ." " . $person_res->titelpost; $res->vorname = $person_res->vorname; $res->nachname = $person_res->nachname; + if(!$view){ $res->gebort = $person_res->gebort; $res->gebdatum = $person_res->gebdatum; - $res->adressen = $adresse_res; - $res->zutrittsdatum = $zutrittskarte_ausgegebenam; + } //$res->postnomen = $person_res->postnomen; //! still not found $intern_email = array(); $intern_email+=array("type" => "intern"); - $intern_email+=array("email"=> getAuthUID() . "@" . DOMAIN); + $intern_email+=array("email"=> $uid . "@" . DOMAIN); $res->emails = array($intern_email); - $res->kontakte = $kontakte_res; - $res->mittel = $betriebsmittelperson_res; + + $res->mailverteiler = $mailverteiler_res; @@ -271,6 +336,10 @@ class Profil extends Auth_Controller } + + + //! old function that was used to fetch all the data + // todo delete the function at the end public function getMitarbeiterAnsicht(){ diff --git a/application/views/Cis/Profil.php b/application/views/Cis/Profil.php index 931d879d5..83d9e6008 100644 --- a/application/views/Cis/Profil.php +++ b/application/views/Cis/Profil.php @@ -14,8 +14,8 @@ $this->load->view('templates/CISHTML-Header', $includesArray);
    - - + + view=>
    load->view('templates/CISHTML-Footer', $includesArray); ?> diff --git a/public/js/apps/Cis.js b/public/js/apps/Cis.js index 0e1461a0f..a00178056 100644 --- a/public/js/apps/Cis.js +++ b/public/js/apps/Cis.js @@ -23,6 +23,10 @@ Vue.createApp({ type: "function", action: function(data) { alert('employee defaultaction ' + JSON.stringify(data)); + //return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ + //"/Cis/Profil/"+data.person_id; + //? Person id is data.person_id + //? Benutzer UID is data.uid } }, childactions: [] diff --git a/public/js/apps/api/search.js b/public/js/apps/api/search.js index 529c5dcc7..eddd3fe5b 100644 --- a/public/js/apps/api/search.js +++ b/public/js/apps/api/search.js @@ -2,7 +2,7 @@ export default { search: function(searchsettings) { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router - + 'components/SearchBar/search'; + + '/components/SearchBar/search'; return axios.post(url, searchsettings); }, searchdummy: function(searchsettings) { diff --git a/public/js/apps/api/userdata.js b/public/js/apps/api/userdata.js index 7f5b32704..ad09144a7 100644 --- a/public/js/apps/api/userdata.js +++ b/public/js/apps/api/userdata.js @@ -1,47 +1,35 @@ export default { - getUser: function() { - const url = FHC_JS_DATA_STORAGE_OBJECT.app_root - + 'cis.php/Cis/Profil/getUser'; - return axios.get(url); - }, + + isMitarbeiterOrStudent: function(uid) { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + `cis.php/Cis/Profil/isMitarbeiterOrStudent/${uid}`; return axios.get(url); }, - getMitarbeiterAnsicht: function() { - const url = FHC_JS_DATA_STORAGE_OBJECT.app_root - + `cis.php/Cis/Profil/getMitarbeiterAnsicht`; - return axios.get(url); - }, + sperre_foto_function: function(value) { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + `cis.php/Cis/Profil/foto_sperre_function/${value}`; return axios.get(url); }, - getBenutzerFunktionen: function() { - const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ - "/Cis/Profil/getBenutzerFunktionen"; - - return axios.get(url); - }, + - indexProfilInformaion: function() { + indexProfilInformaion: function(uid, view=false) { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ - "/Cis/Profil/indexProfilInformaion"; + `/Cis/Profil/indexProfilInformaion/${uid}/${view}`; return axios.get(url); }, - mitarbeiterProfil: function() { + mitarbeiterProfil: function(uid) { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ - "/Cis/Profil/mitarbeiterProfil"; + `/Cis/Profil/mitarbeiterProfil/${uid}`; return axios.get(url); }, - studentProfil: function() { + studentProfil: function(uid, view=false) { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ - "/Cis/Profil/studentProfil"; + `/Cis/Profil/studentProfil/${uid}/${view}`; return axios.get(url); }, diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index c27893551..ff40f7bd7 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -2,20 +2,12 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; import {CoreFilterCmpt} from "../../../components/filter/Filter.js" - -/* [ - {title: 'Log ID', field: 'LogId', headerFilter: true}, - {title: 'Request ID', field: 'RequestId', headerFilter: true}, - {title: 'Execution time', field: 'ExecutionTime', headerFilter: true}, - {title: 'Executed by', field: 'ExecutedBy', headerFilter: true}, - {title: 'Description', field: 'Description', headerFilter: true}, - {title: 'Data', field: 'Data', headerFilter: true}, - {title: 'Web service type', field: 'WebserviceType', headerFilter: true} -] */ - -//? old data -/* ajaxUrl: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ - "/Cis/Profil/getBenutzerFunktionen", */ +//? possible types of roles: +//! depending on the role of the current view, different content is being displayed and fetched +//* Student +//* Mitarbeiter +//* View_Student +//* View_Mitarbeiter export default { components:{ @@ -28,7 +20,6 @@ export default { student_info:null, //? beinhaltet die Information ob der angefragte user ein Student oder Mitarbeiter ist role: null, - //"bf_bezeichnung", "oe_bezeichnung", "datum_von", "datum_bis", "wochenstunden" ] funktionen_table_options: { height: 300, @@ -60,7 +51,7 @@ export default { }, //? this props were passed in the Profil.php view file - props:['uid','pid'], + props:['uid','pid','view'], methods: { concatenate_addresses(address_array){ @@ -111,7 +102,7 @@ export default { } return { - Allgemein: this.role =='Mitarbeiter'?{ + Allgemein: (this.role =='Mitarbeiter' || this.role =='View_Mitarbeiter')?{ Username:this.index_information.username, Anrede:this.index_information.anrede, Titel:this.index_information.titel, @@ -127,12 +118,12 @@ export default { Nachname:this.index_information.nachname, Postnomen:null, }, - GeburtsDaten:{ + GeburtsDaten:!this.role.includes("View")?{ Geburtsdatum:this.index_information.gebdatum, Geburtsort: this.index_information.gebort, - }, + }: null, Adressen: this.index_information.adressen, - SpecialInformation: this.role =='Mitarbeiter'? { + SpecialInformation: this.role =='Mitarbeiter' || this.role === 'View_Mitarbeiter'? { Kurzzeichen: this.mitarbeiter_info?.kurzbz, Telefon: this.mitarbeiter_info?.telefonklappe, } : { @@ -152,7 +143,7 @@ export default { return { FhAusweisStatus: this.index_information.zutrittsdatum, - emails: this.role === 'Mitarbeiter'? this.mitarbeiter_info?.emails: this.index_information.emails, + emails: this.role === 'Mitarbeiter' || this.role === 'View_Mitarbeiter'? this.mitarbeiter_info?.emails: this.index_information.emails, Kontakte:this.index_information.kontakte, }; }, @@ -171,43 +162,57 @@ export default { console.log(this.uid); console.log(this.pid); + console.log(this.view); + console.log(typeof this.view); + if(this.view){console.log("view is true")}else{ console.log("view is false")} //? this function is to update the tabulator information only when the tabulator was build checking the tableBulit event //! only the tableBuilt event of the second tabulator was used to update the table informations - this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { - - fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then((res) => { - this.role = res.data; - + - //? Die anderen api calls werden erst gemacht wenn der call zu isMitarbeiterOrStudent gemacht worden ist + fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then((res) => { + + this.role = this.view? "View_"+res.data: res.data; + if(!this.role.includes('View')){ + this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { + }) + } - //! indexProfilInformationen werden immer gefetcht - fhcapifactory.UserData.indexProfilInformaion().then((res) => { - this.index_information = res.data; - this.$refs.betriebsmittelTable.tabulator.setData(res.data.mittel); - }); - + console.log("the role of the current view: ", this.role); + + - //? Danach werden die Informationen der Role gefetcht - if(this.role === 'Student'){ - fhcapifactory.UserData.studentProfil().then((res)=> { - this.student_info = res.data; - this.$refs.zutrittsgruppenTable.tabulator.setData(res.data.zuttritsgruppen); - }) + //? Die anderen api calls werden erst gemacht wenn der call zu isMitarbeiterOrStudent gemacht worden ist + + + //! indexProfilInformationen werden immer gefetcht + fhcapifactory.UserData.indexProfilInformaion(this.uid,this.view).then((res) => { + console.log(res.data); + this.index_information = res.data; + if(!this.role.includes("View")){ + this.$refs.betriebsmittelTable.tabulator.setData(res.data.mittel); + } + }); + + + //? Danach werden die Informationen der Role gefetcht + if(this.role === "Student" || this.role === "View_Student"){ + fhcapifactory.UserData.studentProfil(this.uid,this.view).then((res)=> { + this.student_info = res.data; + if(this.role ==="Student"){ + this.$refs.zutrittsgruppenTable.tabulator.setData(res.data.zuttritsgruppen); } - - if(this.role === 'Mitarbeiter'){ - fhcapifactory.UserData.mitarbeiterProfil().then((res)=> { - this.mitarbeiter_info = res.data; - this.$refs.funktionenTable.tabulator.setData(res.data.funktionen); - }) - } - }); - - - }) + }) + } + + if(this.role === "Mitarbeiter" || this.role === "View_Mitarbeiter"){ + fhcapifactory.UserData.mitarbeiterProfil(this.uid).then((res)=> { + this.mitarbeiter_info = res.data; + this.$refs.funktionenTable.tabulator.setData(res.data.funktionen); + }) + } + }); @@ -218,7 +223,6 @@ export default {
    -
    @@ -244,7 +248,7 @@ export default {
    -

    Mitarbeiter

    +

    Mitarbeiter

    Student

    @@ -261,7 +265,7 @@ export default {
  3. -
    +

    FH-Ausweis Status

    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}

    @@ -299,15 +303,15 @@ export default {
    -
    +
    - - + +
    - +
    From 48f4afae73a377ed60dabcd87bb30fee90934d54 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Fri, 1 Dec 2023 11:41:17 +0100 Subject: [PATCH 017/201] adds Ort_kurzbz for the View_Mitarbeiter --- application/controllers/Cis/Profil.php | 3 ++- public/js/components/Cis/Profil/Profil.js | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index dd1de706d..523a64386 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -166,8 +166,9 @@ class Profil extends Auth_Controller } + - if(isSuccess($this->MitarbeiterModel->addSelect(["kurzbz","telefonklappe", "alias"])) + if(isSuccess($this->MitarbeiterModel->addSelect(["kurzbz","telefonklappe", "alias","ort_kurzbz"])) && isSuccess($this->MitarbeiterModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid")) ){ $mitarbeiter_res = $this->MitarbeiterModel->load($uid); diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index ff40f7bd7..1e7900c38 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -126,6 +126,7 @@ export default { SpecialInformation: this.role =='Mitarbeiter' || this.role === 'View_Mitarbeiter'? { Kurzzeichen: this.mitarbeiter_info?.kurzbz, Telefon: this.mitarbeiter_info?.telefonklappe, + ...(this.role === 'View_Mitarbeiter'?{Büro:this.mitarbeiter_info?.ort_kurzbz}:{}) , } : { Studiengang:this.student_info?.studiengang, Semester:this.student_info?.semester, @@ -223,6 +224,8 @@ export default {
    +
    +   
         
    From 75547ea5e3bc74ce21856c6da3abdea8690d0429 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Fri, 1 Dec 2023 13:35:29 +0100 Subject: [PATCH 018/201] adding link to search to view profile --- application/controllers/Cis/Profil.php | 4 ++-- public/js/apps/Cis.js | 10 ++++---- public/js/components/Cis/Profil/Profil.js | 28 +++++++++-------------- 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index 523a64386..0cba7e940 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -314,14 +314,14 @@ class Profil extends Auth_Controller $res->username = $uid; $res->anrede = $person_res->anrede; - $res->titel = $person_res->titelpre ." " . $person_res->titelpost; + $res->titel = $person_res->titelpre; $res->vorname = $person_res->vorname; $res->nachname = $person_res->nachname; if(!$view){ $res->gebort = $person_res->gebort; $res->gebdatum = $person_res->gebdatum; } - //$res->postnomen = $person_res->postnomen; //! still not found + $res->postnomen = $person_res->titelpost; $intern_email = array(); $intern_email+=array("type" => "intern"); $intern_email+=array("email"=> $uid . "@" . DOMAIN); diff --git a/public/js/apps/Cis.js b/public/js/apps/Cis.js index a00178056..b514f3662 100644 --- a/public/js/apps/Cis.js +++ b/public/js/apps/Cis.js @@ -20,13 +20,11 @@ Vue.createApp({ actions: { employee: { defaultaction: { - type: "function", + type: "link", action: function(data) { - alert('employee defaultaction ' + JSON.stringify(data)); - //return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ - //"/Cis/Profil/"+data.person_id; - //? Person id is data.person_id - //? Benutzer UID is data.uid + return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ + "/Cis/Profil/View/"+data.uid; + } }, childactions: [] diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index 1e7900c38..190962f85 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -24,7 +24,7 @@ export default { funktionen_table_options: { height: 300, layout: 'fitColumns', - data:[{Bezeichnung:"test1",Organisationseinheit:"test2",Gültig_von:"test3",Gültig_bis:"test4",Wochenstunden:"test5"}], + data:[{Bezeichnung:"",Organisationseinheit:"",Gültig_von:"",Gültig_bis:"",Wochenstunden:""}], columns: [{title: 'Bezeichnung', field: 'Bezeichnung', headerFilter: true}, {title: 'Organisationseinheit', field: 'Organisationseinheit', headerFilter: true}, {title: 'Gültig_von', field: 'Gültig_von', headerFilter: true}, @@ -35,7 +35,7 @@ export default { betriebsmittel_table_options:{ height: 300, layout: 'fitColumns', - data:[{betriebsmittel:"test1",Nummer:"test2",Ausgegeben_am:"test3"}], + data:[{betriebsmittel:"",Nummer:"",Ausgegeben_am:""}], columns: [{title: 'Betriebsmittel', field: 'betriebsmittel', headerFilter: true}, {title: 'Nummer', field: 'Nummer', headerFilter: true}, {title: 'Ausgegeben_am', field: 'Ausgegeben_am', headerFilter: true},] @@ -108,7 +108,7 @@ export default { Titel:this.index_information.titel, Vorname:this.index_information.vorname, Nachname:this.index_information.nachname, - Postnomen:null, + Postnomen:this.index_information.postnomen, }:{ Username:this.index_information.username, Matrikelnummer: this.student_info?.matrikelnummer, @@ -116,7 +116,7 @@ export default { Titel:this.index_information.titel, Vorname:this.index_information.vorname, Nachname:this.index_information.nachname, - Postnomen:null, + Postnomen:this.index_information.postnomen, }, GeburtsDaten:!this.role.includes("View")?{ Geburtsdatum:this.index_information.gebdatum, @@ -126,6 +126,7 @@ export default { SpecialInformation: this.role =='Mitarbeiter' || this.role === 'View_Mitarbeiter'? { Kurzzeichen: this.mitarbeiter_info?.kurzbz, Telefon: this.mitarbeiter_info?.telefonklappe, + //* Wird das Feld Ort_kurzbz noch gepflegt? ...(this.role === 'View_Mitarbeiter'?{Büro:this.mitarbeiter_info?.ort_kurzbz}:{}) , } : { Studiengang:this.student_info?.studiengang, @@ -150,15 +151,7 @@ export default { }, }, - - created(){ - - - - - - - }, + mounted(){ console.log(this.uid); @@ -241,12 +234,13 @@ export default {
    -
    @@ -303,9 +297,9 @@ export default {
    -
    +
    - +
    From 71fda916a36a349986db9182d288a87f85f16340 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 4 Dec 2023 09:25:08 +0100 Subject: [PATCH 019/201] added Menu link and Profile pop up link --- application/controllers/Cis/Profil.php | 11 +++++------ application/models/content/Content_model.php | 17 +++++++++++++---- application/views/Cis/Profil.php | 5 +++-- application/views/templates/CISHTML-Header.php | 2 +- public/js/components/Cis/Profil/Profil.js | 3 +-- 5 files changed, 23 insertions(+), 15 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index 0cba7e940..3782dfbe2 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -79,13 +79,12 @@ class Profil extends Auth_Controller public function View($uid){ - //? get the personID of the uid - isSuccess($this->BenutzerModel->addSelect(["person_id"])); - $personID_res = $this->BenutzerModel->load([$uid]); - $personID_res = hasData($personID_res) ? getData($personID_res)[0] : null; + if($uid === getAuthUID()){ + $this->index(); + }else{ + $this->load->view('Cis/Profil', ["uid" => $uid,"view"=>true]); + } - $this->load->view('Cis/Profil', ["uid" => $uid,"pid" => $personID_res->person_id,"view"=>true]); - } diff --git a/application/models/content/Content_model.php b/application/models/content/Content_model.php index 9bc3ab03d..0a196f9fb 100644 --- a/application/models/content/Content_model.php +++ b/application/models/content/Content_model.php @@ -99,6 +99,15 @@ class Content_model extends DB_Model { "content_id": 1000002, "template_kurzbz": "redirect", + "titel": "Profil", + "content": "", + "menu_open": false, + "aktiv": true, + "childs": [] + }, + { + "content_id": 1000003, + "template_kurzbz": "redirect", "titel": "COVID-19", "content": "", "menu_open": false, @@ -106,7 +115,7 @@ class Content_model extends DB_Model "childs": [] }, { - "content_id": 1000003, + "content_id": 1000004, "template_kurzbz": "redirect", "titel": "Meine LV", "content": "", @@ -115,7 +124,7 @@ class Content_model extends DB_Model "childs": [] }, { - "content_id": 1000004, + "content_id": 1000005, "template_kurzbz": "redirect", "titel": "Stundenplan", "content": "", @@ -124,7 +133,7 @@ class Content_model extends DB_Model "childs": [] }, { - "content_id": 1000005, + "content_id": 1000006, "template_kurzbz": "redirect", "titel": "Dokumente", "content": "", @@ -133,7 +142,7 @@ class Content_model extends DB_Model "childs": [] }, { - "content_id": 1000006, + "content_id": 1000007, "template_kurzbz": "redirect", "titel": "Studierendenstatus", "content": "", diff --git a/application/views/Cis/Profil.php b/application/views/Cis/Profil.php index 83d9e6008..866fbc959 100644 --- a/application/views/Cis/Profil.php +++ b/application/views/Cis/Profil.php @@ -3,7 +3,8 @@ $includesArray = array( 'title' => 'Stundenplan', 'customJSModules' => ['public/js/apps/Cis/ProfilApp.js'], 'tabulator5' => true, - 'customCSSs' => ['public/css/components/calendar.css', 'public/css/components/FilterComponent.css'] + 'customCSSs' => ['public/css/components/calendar.css', 'public/css/components/FilterComponent.css'], + 'childs' => ['test1','test2','test3','test4'] ); $this->load->view('templates/CISHTML-Header', $includesArray); @@ -15,7 +16,7 @@ $this->load->view('templates/CISHTML-Header', $includesArray);
    - view=> + view=>
    load->view('templates/CISHTML-Footer', $includesArray); ?> diff --git a/application/views/templates/CISHTML-Header.php b/application/views/templates/CISHTML-Header.php index 2ae90bda8..71f268112 100644 --- a/application/views/templates/CISHTML-Header.php +++ b/application/views/templates/CISHTML-Header.php @@ -46,7 +46,7 @@ if (!isset($menu)) {
    From 02e7ef12dec6b7845fe7ebbf8c9d73ba6e00b580 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Wed, 6 Dec 2023 13:47:35 +0100 Subject: [PATCH 024/201] Profil information layout --- application/controllers/Cis/Profil.php | 28 +++++++-- public/js/apps/Cis/Profil.js | 21 ++++--- .../Cis/Profil/MitarbeiterProfil.js | 61 +++++++++++-------- .../Cis/Profil/MitarbeiterViewProfil.js | 6 +- 4 files changed, 73 insertions(+), 43 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index de6f115da..9dfbc741d 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -618,20 +618,31 @@ class Profil extends Auth_Controller $uid = $uid != "Profil" ? $uid : null; + $isMitarbeiter = null; - if($uid) + if($uid){ + + if(isSuccess($this->PersonModel->addSelect(["person_id"]))){ + $pid = $this->PersonModel->getByUid($uid); + $pid = hasData($pid) ? getData($pid)[0] : null; + + } + if(!$pid){ + return null; + } + $isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($uid); + } else $isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($this->uid); if(isError($isMitarbeiter)){ //catch error - echo "error"; - return; } $isMitarbeiter = hasData($isMitarbeiter) ? getData($isMitarbeiter) : null; + $res = new stdClass(); if($uid == $this->uid || !$uid ){ @@ -639,10 +650,12 @@ class Profil extends Auth_Controller if($isMitarbeiter ) { $res->view= "MitarbeiterProfil"; $res->data = $this->mitarbeiterProfil(); + $res->data->pid = $this->pid; } else { $res->view= "StudentProfil"; $res->data = $this->studentProfil(); + $res->data->pid = $this->pid; } } elseif($uid){ @@ -650,10 +663,12 @@ class Profil extends Auth_Controller if($isMitarbeiter ){ $res->view= "ViewMitarbeiterProfil"; $res->data= $this->viewMitarbeiterProfil($uid); + } else { $res->view= "ViewStudentProfil"; $res->data= $this->viewStudentProfil($uid); + } } @@ -661,9 +676,14 @@ class Profil extends Auth_Controller echo json_encode($res); } - public function foto_sperre_function($value, $uid=""){ + + public function foto_sperre_function($value){ + //? Nur der Index User hat die Erlaubniss das Profilbild zu sperren $res = $this->PersonModel->update($this->pid,array("foto_sperre"=>$value)); + if(isError($res)){ + echo json_encode("error encountered when updating foto_sperre"); + return; // error handling }else{ //? select the value of the column foto_sperre to return diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index c48d7ef23..a6f811478 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -21,6 +21,8 @@ const app = Vue.createApp({ return { view:null, data:null, + // notfound is null by default, but contains an UID if no user exists with that UID + notFoundUID:null, } }, @@ -32,21 +34,22 @@ const app = Vue.createApp({ let path = location.pathname; let uid = path.substring(path.lastIndexOf('/')).replace("/",""); - - /* const payload = { - ...(uid != "Profil" ? {uid} : {}) - }; - */ + Vue.$fhcapi.UserData.getView(uid).then((res)=>{ - this.view = res.data.view; - this.data = res.data.data; + if(!res.data){ + this.notFoundUID=uid; + } + this.view = res.data?.view; + this.data = res.data?.data; }); }, template:`
    - - +
    +

    Es wurden keine oder mehrere Profile für {{this.notFoundUID}} gefunden

    +
    +
    ` diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 765893f8f..12f7cb88e 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -40,7 +40,7 @@ export default { betriebsmittel_table_options: { height: 300, layout: "fitColumns", - data: [{ betriebsmittel: "", Nummer: "", Ausgegeben_am: "" }], + data: [{ betriebsmittel: "test", Nummer: "", Ausgegeben_am: "" }], columns: [ { title: "Betriebsmittel", @@ -93,8 +93,6 @@ export default { Vorname: this.data.vorname, Nachname: this.data.nachname, Postnomen: this.data.postnomen, - }, - GeburtsDaten: { Geburtsdatum: this.data.gebdatum, Geburtsort: this.data.gebort, }, @@ -121,7 +119,7 @@ export default { }, mounted() { - this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { + this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); @@ -132,12 +130,11 @@ export default { this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); }) - + }, template: ` -
    @@ -147,9 +144,10 @@ export default { -
    +
    +

    Mitarbeiter

    @@ -168,52 +166,65 @@ export default { -
    +
    -

    Mitarbeiter

    -
    + -
    {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}}
    -
    {{bez}}: {{val}}
    +
    +
    + +
    +
    Adressen
    +
    + {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}} +
    +
    + +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    -
    +
    -
    -
    -
    -

    + + +

    + +
    -

    FH-Ausweis Status

    -

    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}

    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -

    eMail

    -

    {{email.type}}: {{email.email}}

    +
    eMail
    +
    {{email.type}}: {{email.email}}
    -

    Private Kontakte

    -
    +
    Private Kontakte
    +
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    {{element?.anmerkung}}
    -
    +
    -

    +
    +
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index d7da24779..b35942fea 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -123,11 +123,7 @@ export default {
    -
    -

    Profilfoto gesperrt

    - Sperre des Profilfotos aufheben -
    - Profilfoto sperren +
    From a48cbaabb925edbdceb32735c865b500ac010704 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Thu, 7 Dec 2023 15:59:01 +0100 Subject: [PATCH 025/201] layout template --- application/views/Cis/Profil.php | 2 +- public/css/components/Profil.css | 42 +++ public/js/apps/Cis/Profil.js | 9 +- public/js/components/Cis/Profil/Base.js | 295 ++++++++++++++++++ .../Cis/Profil/MitarbeiterProfil.js | 166 ++++++---- .../Cis/Profil/MitarbeiterViewProfil.js | 187 ++++++----- .../js/components/Cis/Profil/StudentProfil.js | 218 +++++++------ .../Cis/Profil/StudentViewProfil.js | 149 +++++---- 8 files changed, 774 insertions(+), 294 deletions(-) create mode 100644 public/css/components/Profil.css create mode 100644 public/js/components/Cis/Profil/Base.js diff --git a/application/views/Cis/Profil.php b/application/views/Cis/Profil.php index a107f0775..059a4edc1 100644 --- a/application/views/Cis/Profil.php +++ b/application/views/Cis/Profil.php @@ -3,7 +3,7 @@ $includesArray = array( 'title' => 'Stundenplan', 'customJSModules' => ['public/js/apps/Cis/Profil.js'], 'tabulator5' => true, - 'customCSSs' => ['public/css/components/calendar.css', 'public/css/components/FilterComponent.css'], + 'customCSSs' => ['public/css/components/calendar.css', 'public/css/components/FilterComponent.css','public/css/components/Profil.css'], ); diff --git a/public/css/components/Profil.css b/public/css/components/Profil.css new file mode 100644 index 000000000..a8f0e5d4b --- /dev/null +++ b/public/css/components/Profil.css @@ -0,0 +1,42 @@ + + +@media (max-width: 991px) { + + .md-invisible{ + display:none; + } + } + + @media (min-width: 992px) { + + .lg-invisible{ + display:none; + } + } + +/* dl { + width: 100%; + overflow: hidden; + + padding: 0; + margin: 0 + } + dt { + float: left; + width: 35%; + + + + padding: 0; + margin: 0 + } + dd { + float: left; + width: 50%; + + + padding: 0; + margin: 0 + } + */ + \ No newline at end of file diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index a6f811478..eb5cfbf4a 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -3,6 +3,7 @@ import StudentProfil from "../../components/Cis/Profil/StudentProfil.js"; import MitarbeiterProfil from "../../components/Cis/Profil/MitarbeiterProfil.js"; import ViewStudentProfil from "../../components/Cis/Profil/StudentViewProfil.js"; import ViewMitarbeiterProfil from "../../components/Cis/Profil/MitarbeiterViewProfil.js"; +import Base from "../../components/Cis/Profil/Base.js"; import fhcapifactory from "../api/fhcapifactory.js"; Vue.$fhcapi = fhcapifactory; @@ -11,7 +12,7 @@ Vue.$fhcapi = fhcapifactory; const app = Vue.createApp({ components: { - + Base, StudentProfil, MitarbeiterProfil, ViewStudentProfil, @@ -41,15 +42,17 @@ const app = Vue.createApp({ } this.view = res.data?.view; this.data = res.data?.data; + //* only for testing purposes and needs to be deleted after + this.data.base = "Base"; }); }, template:`
    - +

    Es wurden keine oder mehrere Profile für {{this.notFoundUID}} gefunden

    - +
    ` diff --git a/public/js/components/Cis/Profil/Base.js b/public/js/components/Cis/Profil/Base.js new file mode 100644 index 000000000..0726fa552 --- /dev/null +++ b/public/js/components/Cis/Profil/Base.js @@ -0,0 +1,295 @@ +import fhcapifactory from "../../../apps/api/fhcapifactory.js"; +import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; + + +export default { + components: { + CoreFilterCmpt, + }, + data() { + return { + + + funktionen_table_options: { + height: 300, + layout: "fitColumns", + data: [ + { + Bezeichnung: "", + Organisationseinheit: "", + Gültig_von: "", + Gültig_bis: "", + Wochenstunden: "", + }, + ], + columns: [ + { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true }, + { + title: "Organisationseinheit", + field: "Organisationseinheit", + headerFilter: true, + }, + { title: "Gültig_von", field: "Gültig_von", headerFilter: true }, + { title: "Gültig_bis", field: "Gültig_bis", headerFilter: true }, + { + title: "Wochenstunden", + field: "Wochenstunden", + headerFilter: true, + }, + ], + }, + betriebsmittel_table_options: { + height: 300, + layout: "fitColumns", + data: [{ betriebsmittel: "test", Nummer: "", Ausgegeben_am: "" }], + columns: [ + { + title: "Betriebsmittel", + field: "betriebsmittel", + headerFilter: true, + }, + { title: "Nummer", field: "Nummer", headerFilter: true }, + { + title: "Ausgegeben_am", + field: "Ausgegeben_am", + headerFilter: true, + }, + ], + }, + + }; + }, + + //? this is the prop passed to the dynamic component with the custom data of the view + props: ["data"], + methods: { + + sperre_foto_function(value) { + if (!this.data) { + return; + } + fhcapifactory.UserData.sperre_foto_function(value).then((res) => { + this.data.foto_sperre = res.data.foto_sperre; + }); + }, + }, + computed: { + refreshMailTo() { + return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]` + }, + + get_image_base64_src() { + if (!this.data) { + return ""; + } + return "data:image/jpeg;base64," + this.data.foto; + }, + //? this computed function returns all the informations for the first column in the profil + personData() { + if (!this.data) { + return {}; + } + + return { + Allgemein: { + Username: this.data.username, + Anrede: this.data.anrede, + Titel: this.data.titel, + Vorname: this.data.vorname, + Nachname: this.data.nachname, + Postnomen: this.data.postnomen, + Geburtsdatum: this.data.gebdatum, + Geburtsort: this.data.gebort, + Kurzzeichen: this.data.kurzbz, + Telefon: this.data.telefonklappe, + Büro:this.data.ort_kurzbz, + FhAusweisStatus: this.data.zutrittsdatum, + }, + + + + + + + }; + }, + //? this computed function returns the data for the second column in the profil + kontaktInfo() { + if (!this.data) { + return {}; + } + + return { + + + emails: this.data.emails, + Kontakte: this.data.kontakte, + Adressen: this.data.adressen, + }; + }, + }, + + mounted() { + this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { + + this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); + + }) + + this.$refs.funktionenTable.tabulator.on('tableBuilt', () => { + + this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); + + }) + + }, + + template: ` + +
    +
    +
    + +
    +
    + + + + + +
    +
    + +
    +
    + + + + +
    +
    + +
    +
    + + + + +
    + +
    + + + +
    +
    +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    +
    +
    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    +
    +
    + + +
    + + + +
    + +
    +
    +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    +
    +
    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    +
    +
    +
    + + + + +
    + + + + +
    + +
    + + + + +
    +
    + + +
    Mailverteilers
    +

    Sie sind Mitgglied in folgenden Verteilern:

    +
    + +
    {{verteiler.beschreibung}}
    +
    + + + +
    +
    +
    + + +
    +
    + + +
    + + +
    +
    + +
    + + +
    + +
    + + + + + +
    + + +
    + + `, +}; diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 12f7cb88e..2f3ef7d88 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -1,6 +1,7 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; + export default { components: { CoreFilterCmpt, @@ -73,6 +74,10 @@ export default { }, }, computed: { + refreshMailTo() { + return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]` + }, + get_image_base64_src() { if (!this.data) { return ""; @@ -95,13 +100,17 @@ export default { Postnomen: this.data.postnomen, Geburtsdatum: this.data.gebdatum, Geburtsort: this.data.gebort, + Kurzzeichen: this.data.kurzbz, + Telefon: this.data.telefonklappe, + Büro:this.data.ort_kurzbz, + FhAusweisStatus: this.data.zutrittsdatum, }, - Adressen: this.data.adressen, - SpecialInformation: { - Kurzzeichen: this.data.kurzbz, - Telefon: this.data.telefonklappe, - Büro:this.data.ort_kurzbz, - }, + + + + + + }; }, //? this computed function returns the data for the second column in the profil @@ -111,9 +120,11 @@ export default { } return { - FhAusweisStatus: this.data.zutrittsdatum, + + emails: this.data.emails, Kontakte: this.data.kontakte, + Adressen: this.data.adressen, }; }, }, @@ -137,20 +148,32 @@ export default {
    -
    +
    -
    -
    +
    + +
    -
    +
    +
    -
    +

    Mitarbeiter

    - + +
    + + + +
    +
    @@ -160,31 +183,36 @@ export default { Profilfoto sperren
    +
    -
    +
    -
    +
    -
    -
    Adressen
    -
    - {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}} -
    -
    + -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    +
    + + +
    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    + +
    +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    @@ -192,46 +220,69 @@ export default { -
    - -
    - - -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -
    +
    + +
    + + + - - -
    -
    eMail
    -
    {{email.type}}: {{email.email}}
    -
    +
    +
    FH-Ausweis Status
    +
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    +
    +
    - -
    -
    Private Kontakte
    -
    -
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    -
    {{element?.anmerkung}}
    -
    - - -
    -
    -
    - -
    -
    + + + +
    +
    eMail
    +
    +
    {{email.type}}: {{email.email}}
    +
    +
    + + +
    +
    Private Kontakte
    +
    +
    +
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    +
    {{element?.anmerkung}}
    +
    + + +
    +
    +
    +
    + + +
    +
    Adressen
    +
    +
    + {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}} +
    +
    +
    + +
    +
    - +
    +
    +

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    +
    +
    @@ -248,8 +299,8 @@ export default {
    -
    -
    +
    +
    Zeitwuensche Lehrveranstaltungen Zeitsperren von Gschnell @@ -264,6 +315,7 @@ export default {
    +
    `, diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index b35942fea..589f1b204 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -114,103 +114,122 @@ export default { template: ` -
    - -
    - -
    +
    + +
    + +
    +
    + + + +
    +

    Mitarbeiter

    - - -
    - - -
    - - -

    Mitarbeiter

    - -
    - -
    {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}}
    -
    {{bez}}: {{val}}
    - -
    - -
    -
    -
    - -

    - - -

    -

    FH-Ausweis Status

    -

    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}

    -
    - - - - -
    -

    eMail

    -

    {{email.type}}: {{email.email}}

    -
    - - -
    -

    Private Kontakte

    -
    -
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    -
    {{element?.anmerkung}}
    -
    - - -
    -
    -
    - -

    -
    - -
    - -
    - - -
    - - -
    - - -
    - -
    -
    - -
    -
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    -
    - -
    {{verteiler.beschreibung}}
    + + + + +
    + + + + + +
    +
    + + +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    + +
    + + + + +
    + +
    + + +
    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    +
    + + + + +
    +
    eMail
    +
    {{email.type}}: {{email.email}}
    +
    + + +
    +
    Private Kontakte
    +
    +
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    +
    {{element?.anmerkung}}
    +
    + + +
    +
    +
    + +
    +
    + + +
    +
    + + +
    + + +
    + + +
    + + +
    + + +
    + +
    + +
    +
    Mailverteilers
    +

    Sie sind Mitgglied in folgenden Verteilern:

    +
    + +
    {{verteiler.beschreibung}}
    +
    + + `, }; diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index a0aff3196..8df546c67 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -51,6 +51,9 @@ export default { }, }, computed: { + refreshMailTo() { + return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]` + }, get_image_base64_src() { if (!this.data) { return ""; @@ -72,11 +75,10 @@ export default { Vorname: this.data.vorname, Nachname: this.data.nachname, Postnomen: this.data.postnomen, - }, - GeburtsDaten: { Geburtsdatum: this.data.gebdatum, Geburtsort: this.data.gebort, }, + Adressen: this.data.adressen, SpecialInformation: { Studiengang: this.data.studiengang, @@ -118,85 +120,108 @@ export default { template: ` - -
    - -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -

    Profilfoto gesperrt

    - Sperre des Profilfotos aufheben -
    - Profilfoto sperren -
    -
    -
    - - -
    - - -

    Student

    - -
    - -

    {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}}

    -
    {{bez}}: {{val}}
    - -
    - -
    -
    -
    - -

    - - -

    -

    FH-Ausweis Status

    -

    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}

    -
    - - - - -
    -

    eMail

    -

    {{email.type}}: {{email.email}}

    -
    - - -
    -

    Private Kontakte

    -
    -
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    -
    {{element?.anmerkung}}
    -
    - - -
    -
    -
    - -

    -
    +
    + +
    + +
    +
    + -
    +
    +
    +
    +

    Student

    + +
    +
    +
    +
    +
    +

    Profilfoto gesperrt

    + Sperre des Profilfotos aufheben +
    + Profilfoto sperren +
    +
    +
    + + + + + +
    + + + + + +
    +
    + +
    +
    Adressen
    +
    + {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}} +
    +
    + +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    +
    + + + +
    + +
    + + +
    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    +
    + + -
    + +
    +
    eMail
    +
    {{email.type}}: {{email.email}}
    +
    + + +
    +
    Private Kontakte
    +
    +
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    +
    {{element?.anmerkung}}
    +
    + + +
    +
    +
    + +
    +
    +
    + + +
    +
    + +
    +
    +

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    +
    +
    +
    @@ -208,26 +233,29 @@ export default {
    - -
    + +
    -
    - -
    -
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    -
    - -
    {{verteiler.beschreibung}}
    -
    -
    -
    -
    -
    +
    + +
    +
    Mailverteilers
    +

    Sie sind Mitgglied in folgenden Verteilern:

    +
    + +
    {{verteiler.beschreibung}}
    +
    +
    +
    +
    +
    + + + `, }; diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 8dbc4275e..b119ebdeb 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -80,73 +80,114 @@ export default { template: ` -
    - -
    - -
    + +
    + +
    + +
    +
    + + + +
    +

    Student

    - - -
    - - -
    - - -

    Student

    - -
    - -
    {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}}
    -
    {{bez}}: {{val}}
    - -
    - -
    -
    -
    - -

    - -

    -

    eMail

    -

    {{email.type}}: {{email.email}}

    -
    - - - -

    -
    - -
    - - -
    -
    - -
    -
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    -
    - -
    {{verteiler.beschreibung}}
    + + + + +
    + + + + + +
    +
    + + +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    + +
    + + + + +
    + +
    + + +
    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    +
    + + + + +
    +
    eMail
    +
    {{email.type}}: {{email.email}}
    +
    + + +
    +
    Private Kontakte
    +
    +
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    +
    {{element?.anmerkung}}
    +
    + + +
    +
    +
    + +
    +
    + + +
    +
    + + + + + +
    + +
    + +
    +
    Mailverteilers
    +

    Sie sind Mitgglied in folgenden Verteilern:

    +
    + +
    {{verteiler.beschreibung}}
    +
    + + `, }; From 8f152cdf5015456810bb749e4debd991d69176de Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 11 Dec 2023 08:51:51 +0100 Subject: [PATCH 026/201] fixed layout bug, table now shows under profil information without disturbing the right panel --- public/js/components/Cis/Profil/Base.js | 33 ++++++++++++++----------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/public/js/components/Cis/Profil/Base.js b/public/js/components/Cis/Profil/Base.js index 0726fa552..16bd5404c 100644 --- a/public/js/components/Cis/Profil/Base.js +++ b/public/js/components/Cis/Profil/Base.js @@ -176,10 +176,13 @@ export default {
    +
    +
    +
    -
    +
    @@ -229,7 +232,21 @@ export default {
    +
    +
    +
    + +
    + + +
    +
    + +
    + + +
    @@ -266,19 +283,7 @@ export default {
    -
    - - -
    - - -
    -
    - -
    - - -
    +
    From e8a89cf2772eaf473e4741bcffcda6262a70d7a2 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 11 Dec 2023 09:43:32 +0100 Subject: [PATCH 027/201] add comments to the layout to logically seperate the different columns and rows --- public/js/components/Cis/Profil/Base.js | 311 ++++++++++++++---------- 1 file changed, 178 insertions(+), 133 deletions(-) diff --git a/public/js/components/Cis/Profil/Base.js b/public/js/components/Cis/Profil/Base.js index 16bd5404c..eaa85c6b3 100644 --- a/public/js/components/Cis/Profil/Base.js +++ b/public/js/components/Cis/Profil/Base.js @@ -1,15 +1,12 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; - export default { components: { CoreFilterCmpt, }, data() { return { - - funktionen_table_options: { height: 300, layout: "fitColumns", @@ -41,7 +38,13 @@ export default { betriebsmittel_table_options: { height: 300, layout: "fitColumns", - data: [{ betriebsmittel: "test", Nummer: "", Ausgegeben_am: "" }], + data: [ + { + betriebsmittel: "test", + Nummer: "", + Ausgegeben_am: "", + }, + ], columns: [ { title: "Betriebsmittel", @@ -56,14 +59,12 @@ export default { }, ], }, - }; }, - //? this is the prop passed to the dynamic component with the custom data of the view + //? this is the prop passed to the dynamic component with the custom data of the view props: ["data"], methods: { - sperre_foto_function(value) { if (!this.data) { return; @@ -75,7 +76,7 @@ export default { }, computed: { refreshMailTo() { - return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]` + return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]`; }, get_image_base64_src() { @@ -84,7 +85,7 @@ export default { } return "data:image/jpeg;base64," + this.data.foto; }, - //? this computed function returns all the informations for the first column in the profil + //? this computed function returns all the informations for the first column in the profil personData() { if (!this.data) { return {}; @@ -102,26 +103,18 @@ export default { Geburtsort: this.data.gebort, Kurzzeichen: this.data.kurzbz, Telefon: this.data.telefonklappe, - Büro:this.data.ort_kurzbz, + Büro: this.data.ort_kurzbz, FhAusweisStatus: this.data.zutrittsdatum, }, - - - - - - }; }, - //? this computed function returns the data for the second column in the profil + //? this computed function returns the data for the second column in the profil kontaktInfo() { if (!this.data) { return {}; } return { - - emails: this.data.emails, Kontakte: this.data.kontakte, Adressen: this.data.adressen, @@ -130,170 +123,222 @@ export default { }, mounted() { - this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { - - this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); - - }) + this.$refs.betriebsmittelTable.tabulator.on("tableBuilt", () => { + this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); + }); - this.$refs.funktionenTable.tabulator.on('tableBuilt', () => { - - this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); - - }) - + this.$refs.funktionenTable.tabulator.on("tableBuilt", () => { + this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); + }); }, template: ` - +
    -
    -
    - +
    +
    - + -
    -
    - +
    + + + + +
    -
    - -
    - -
    -
    + +
    + +
    + +
    + + + + +
    - - -
    - -
    + + +
    -
    -
    -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    + +
    + + + + + +
    +
    +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    +
    +
    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    +
    +
    + + + +
    -
    -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -
    -
    -
    + +
    -
    -
    -
    -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    + + +
    +
    +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    +
    +
    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    +
    +
    + + + + +
    -
    -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    + + + + + +
    + + +
    -
    + +
    + + + + + +
    + + +
    + +
    + + +
    + +
    + + +
    + + + + + + + +
    - - -
    - -
    -
    -
    - - -
    - - -
    -
    - -
    -
    - - -
    - +
    + -
    -
    - + + + + + + + +
    + +
    + + + + +
    Mailverteilers
    +

    Sie sind Mitgglied in folgenden Verteilern:

    +
    + +
    {{verteiler.beschreibung}}
    +
    + + + +
    + + +
    + +
    -
    -
    -
    - - -
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    -
    - -
    {{verteiler.beschreibung}}
    -
    - - - -
    -
    -
    -
    - - -
    + - +
    - +
    `, From f45d692e662bf755701bb7c5c1a98d690830a0ee Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 11 Dec 2023 12:55:54 +0100 Subject: [PATCH 028/201] used new layout for the different views --- application/controllers/Cis/Profil.php | 1 + public/js/apps/Cis/Profil.js | 2 +- public/js/components/Cis/Profil/Base.js | 13 +- .../Cis/Profil/MitarbeiterProfil.js | 426 +++++++++++------- .../Cis/Profil/MitarbeiterViewProfil.js | 306 +++++++++---- .../js/components/Cis/Profil/StudentProfil.js | 387 +++++++++++----- .../Cis/Profil/StudentViewProfil.js | 294 ++++++++---- 7 files changed, 962 insertions(+), 467 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index 9dfbc741d..a5640d916 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -628,6 +628,7 @@ class Profil extends Auth_Controller } if(!$pid){ + //! if no Person_ID was found, null is returned and the vue component will show a 404 View return null; } diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index eb5cfbf4a..825b7a5ce 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -52,7 +52,7 @@ const app = Vue.createApp({

    Es wurden keine oder mehrere Profile für {{this.notFoundUID}} gefunden

    - +
    ` diff --git a/public/js/components/Cis/Profil/Base.js b/public/js/components/Cis/Profil/Base.js index eaa85c6b3..10ff32739 100644 --- a/public/js/components/Cis/Profil/Base.js +++ b/public/js/components/Cis/Profil/Base.js @@ -172,14 +172,14 @@ export default {
    -
    - +
    +
    -
    +
    @@ -254,6 +254,13 @@ export default {
    +
    +
    +

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    +
    +
    + + diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 2f3ef7d88..b6f416d43 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -145,178 +145,296 @@ export default { }, template: ` - -
    - -
    - -
    - -
    - - - -
    - -
    -
    -

    Mitarbeiter

    - - -
    - - - - -
    - -
    -
    -
    -

    Profilfoto gesperrt

    - Sperre des Profilfotos aufheben -
    - Profilfoto sperren -
    -
    - -
    + +
    + +
    + +
    + - - -
    - - - - - -
    -
    - - -
    - - -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    - -
    -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    -
    -
    - -
    - - - - -
    - -
    - - - +
    +
    + +
    +
    -
    -
    FH-Ausweis Status
    -
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -
    -
    - - - - -
    -
    eMail
    -
    -
    {{email.type}}: {{email.email}}
    -
    -
    - - -
    -
    Private Kontakte
    -
    -
    -
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    -
    {{element?.anmerkung}}
    -
    - - -
    -
    -
    -
    - - -
    -
    Adressen
    -
    -
    - {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}} -
    -
    -
    - -
    -
    -
    + + +
    + -
    -
    - + + +
    + +
    + +
    + + + + + + +
    -
    -

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    -
    -
    -
    - - -
    - - -
    -
    - -
    - +
    +
    +
    + - + + + + + + +
    +
    + + + +
    +

    Profilfoto gesperrt

    + Sperre des Profilfotos aufheben +
    + + Profilfoto sperren + + + + +
    +
    + + + + + + + +
    -
    -
    + + + +
    + + + + +
    + + + + +
    + + + + + +
    +
    +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    +
    +
    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    +
    +
    + + + + +
    + + + +
    + + + + + + +
    + + + + +
    +
    eMail
    +
    +
    {{email.type}}: {{email.email}}
    +
    +
    + + + +
    +
    Private Kontakte
    +
    +
    +
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    +
    {{element?.anmerkung}}
    +
    + + +
    +
    +
    +
    + + + + +
    +
    Adressen
    +
    +
    + {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}} +
    +
    +
    + +
    + + + + + +
    + + + + + +
    + + + +
    + +
    + + + + +
    +
    +

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    +
    +
    + + + + + + +
    + + +
    + +
    + + +
    + +
    + + +
    + + + + + + + + +
    + + + + + +
    + + + + + + + +
    +
    + -
    -
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    -
    - -
    {{verteiler.beschreibung}}
    -
    -
    +
    - -
    + + + +
    + +
    + + + + +
    Mailverteilers
    +

    Sie sind Mitgglied in folgenden Verteilern:

    +
    + +
    {{verteiler.beschreibung}}
    +
    + + + +
    + + +
    + + +
    + + + + + + + + +
    + + +
    `, }; diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index 589f1b204..dfd610672 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -114,122 +114,230 @@ export default { template: ` -
    - -
    - -
    + +
    + +
    + +
    + + + + + +
    +
    + +
    +
    + + + + +
    + + + + + +
    + +
    + +
    + + + + + + + +
    +
    + +
    +
    + + + + + + + + +
    + + + + +
    + + + +
    - -
    -
    -
    -

    Mitarbeiter

    - + + +
    + + + + + +
    +
    +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    +
    +
    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    + + + + +
    + + + +
    + + + + + + +
    + + + + +
    +
    eMail
    +
    +
    {{email.type}}: {{email.email}}
    +
    +
    + + +
    + + + + + +
    + + + + +
    - - - -
    - - - - - -
    -
    - - -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    -
    - -
    - - - - -
    - -
    - - -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -
    - - - - -
    -
    eMail
    -
    {{email.type}}: {{email.email}}
    -
    - - -
    -
    Private Kontakte
    -
    -
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    -
    {{element?.anmerkung}}
    -
    - - -
    -
    -
    - -
    -
    -
    + +
    + +
    -
    + + + +
    + + +
    + +
    + + +
    + + + + + + + + +
    + + + + + +
    + + + + + + + + + + + +
    -
    - - -
    - - -
    - - +
    + + + + +
    Mailverteilers
    +

    Sie sind Mitgglied in folgenden Verteilern:

    +
    + +
    {{verteiler.beschreibung}}
    - + + +
    + +
    -
    - -
    -
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    -
    - -
    {{verteiler.beschreibung}}
    -
    -
    -
    -
    -
    - - + +
    + + + + + + + +
    + + +
    + `, }; diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 8df546c67..4d8b2d2da 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -77,16 +77,15 @@ export default { Postnomen: this.data.postnomen, Geburtsdatum: this.data.gebdatum, Geburtsort: this.data.gebort, - }, - - Adressen: this.data.adressen, - SpecialInformation: { Studiengang: this.data.studiengang, Semester: this.data.semester, Verband: this.data.verband, Gruppe: this.data.gruppe, Personenkennzeichen: this.data.personenkennzeichen, + FhAusweisStatus: this.data.zutrittsdatum, }, + + }; }, //? this computed function returns the data for the second column in the profil @@ -96,9 +95,9 @@ export default { } return { - FhAusweisStatus: this.data.zutrittsdatum, emails: this.data.emails, Kontakte: this.data.kontakte, + Adressen: this.data.adressen, }; }, }, @@ -120,141 +119,297 @@ export default { template: ` +
    - -
    - -
    -
    - + +
    + +
    + -
    -
    -
    -

    Student

    - -
    -
    -
    -
    -
    -

    Profilfoto gesperrt

    - Sperre des Profilfotos aufheben -
    - Profilfoto sperren + + +
    +
    +
    +
    + + + +
    + - - -
    - - - - - + +
    + +
    + +
    + + + + + + +
    -
    - -
    -
    Adressen
    -
    - {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}} -
    -
    - -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    -
    - +
    +
    - - - - -
    +
    + + + + + + + + +
    +
    + + -
    - - -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -
    - - - - -
    -
    eMail
    -
    {{email.type}}: {{email.email}}
    -
    - - -
    -
    Private Kontakte
    -
    -
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    -
    {{element?.anmerkung}}
    -
    - - -
    -
    -
    - -
    +
    +

    Profilfoto gesperrt

    + Sperre des Profilfotos aufheben
    + + Profilfoto sperren + + + + +
    +
    + + + + + + + + +
    + + + + +
    + + + + +
    + + + + +
    + + + + + +
    +
    +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    +
    +
    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    +
    +
    + + + +
    + +
    + + + + + + +
    + + + + +
    +
    eMail
    +
    +
    {{email.type}}: {{email.email}}
    +
    +
    + + + +
    +
    Private Kontakte
    +
    +
    +
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    +
    {{element?.anmerkung}}
    +
    + + +
    +
    +
    +
    + + + + +
    +
    Adressen
    +
    +
    + {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}} +
    +
    +
    + +
    + + + + + +
    + + + + + +
    + + +
    + +
    + + + + +
    +
    +

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    +
    +
    + + + + + + +
    + + +
    + +
    + + +
    + +
    + + +
    + + + + + + + +
    - -
    -
    -

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    -
    -
    -
    - + + + + + +
    + + + + + + + + + + + +
    + +
    -
    - -
    -
    - -
    - -
    - -
    - -
    - -
    -
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    -
    + + +
    Mailverteilers
    +

    Sie sind Mitgglied in folgenden Verteilern:

    +
    {{verteiler.beschreibung}}
    -
    -
    -
    -
    -
    +
    + +
    + + +
    + + +
    + + + + + + + + +
    + + +
    + `, diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index b119ebdeb..69c59c6f7 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -80,114 +80,220 @@ export default { template: ` - -
    - -
    - -
    + +
    + +
    + +
    + + + + + +
    +
    + +
    +
    + + + + +
    + + + + + +
    + +
    + +
    + + + + + + + +
    +
    + +
    +
    + + + + + + + + + + + + + +
    + + + + +
    + + + +
    - - - -
    -
    -
    -

    Student

    - -
    -
    - -
    - - -
    - - - - - -
    -
    - - -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    -
    - -
    - - - - -
    - -
    - - -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -
    + +
    - + + + + +
    +
    +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    +
    - -
    -
    eMail
    -
    {{email.type}}: {{email.email}}
    -
    - - -
    -
    Private Kontakte
    -
    -
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    -
    {{element?.anmerkung}}
    -
    - - -
    -
    -
    - -
    -
    -
    - -
    + + + + +
    + + + +
    + + + + + + +
    + + + + +
    +
    eMail
    +
    +
    {{email.type}}: {{email.email}}
    +
    +
    + + + +
    + + + + + +
    + + + + +
    - - - + + + +
    + +
    + + + + + + +
    + + + + + +
    + + + + + + + + -
    - -
    -
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    -
    - -
    {{verteiler.beschreibung}}
    -
    + + +
    + +
    + + + + +
    Mailverteilers
    +

    Sie sind Mitgglied in folgenden Verteilern:

    +
    + +
    {{verteiler.beschreibung}}
    + + + +
    + +
    -
    -
    - - + + +
    + + + + + + + + +
    + + +
    + + `, }; From d378cd30026ebe9edc8dd000f97fa554777145a3 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 11 Dec 2023 13:05:25 +0100 Subject: [PATCH 029/201] center profil image in the middle --- public/js/components/Cis/Profil/MitarbeiterProfil.js | 4 ++-- public/js/components/Cis/Profil/MitarbeiterViewProfil.js | 4 ++-- public/js/components/Cis/Profil/StudentProfil.js | 4 ++-- public/js/components/Cis/Profil/StudentViewProfil.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index b6f416d43..b0819801b 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -192,8 +192,8 @@ export default { -
    -
    +
    +
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index dfd610672..7865b8f2c 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -161,8 +161,8 @@ export default { -
    -
    +
    +
    diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 4d8b2d2da..ece1f3fe4 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -166,8 +166,8 @@ export default { -
    -
    +
    +
    diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 69c59c6f7..45454c2de 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -127,8 +127,8 @@ export default { -
    -
    +
    +
    From 832a3de8c55e7209b9c576e683d3ff855a5ac93d Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 11 Dec 2023 13:38:44 +0100 Subject: [PATCH 030/201] centers the text of the link under the image --- public/js/components/Cis/Profil/MitarbeiterProfil.js | 4 ++-- public/js/components/Cis/Profil/StudentProfil.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index b0819801b..decd08914 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -205,8 +205,8 @@ export default { -
    -
    +
    +
    diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index ece1f3fe4..86233962c 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -179,8 +179,8 @@ export default { -
    -
    +
    +
    From 9beb42653166e3bff4e60f28892ca110a1edb4e8 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 11 Dec 2023 13:47:56 +0100 Subject: [PATCH 031/201] adding word wrap to bootstrap columns --- .../components/Cis/Profil/MitarbeiterProfil.js | 16 ++++++++-------- .../Cis/Profil/MitarbeiterViewProfil.js | 4 ++-- public/js/components/Cis/Profil/StudentProfil.js | 4 ++-- .../components/Cis/Profil/StudentViewProfil.js | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index decd08914..561e2c9fa 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -245,7 +245,7 @@ export default { -
    +
    @@ -271,7 +271,7 @@ export default { -
    +
    @@ -284,8 +284,8 @@ export default {
    -
    eMail
    -
    +
    eMail
    +
    {{email.type}}: {{email.email}}
    @@ -293,8 +293,8 @@ export default {
    -
    Private Kontakte
    -
    +
    Private Kontakte
    +
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    {{element?.anmerkung}}
    @@ -310,8 +310,8 @@ export default {
    -
    Adressen
    -
    +
    Adressen
    +
    {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}}
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index 7865b8f2c..64307cb7c 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -189,7 +189,7 @@ export default { -
    +
    @@ -215,7 +215,7 @@ export default { -
    +
    diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 86233962c..368034b1d 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -219,7 +219,7 @@ export default { -
    +
    @@ -245,7 +245,7 @@ export default { -
    +
    diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 45454c2de..23e66564e 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -160,7 +160,7 @@ export default { -
    +
    @@ -183,7 +183,7 @@ export default { -
    +
    From 84706c957edc7fffc3a6b4f6feadae281f575833 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 11 Dec 2023 14:35:17 +0100 Subject: [PATCH 032/201] changes dynamically the col width if a kontakt anmerkung is vorhanden or not --- .../Cis/Profil/MitarbeiterProfil.js | 50 +++++++++++-------- .../Cis/Profil/MitarbeiterViewProfil.js | 8 +-- .../js/components/Cis/Profil/StudentProfil.js | 39 +++++++++------ .../Cis/Profil/StudentViewProfil.js | 8 +-- 4 files changed, 59 insertions(+), 46 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 561e2c9fa..71afab9cd 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -103,7 +103,7 @@ export default { Kurzzeichen: this.data.kurzbz, Telefon: this.data.telefonklappe, Büro:this.data.ort_kurzbz, - FhAusweisStatus: this.data.zutrittsdatum, + }, @@ -121,7 +121,7 @@ export default { return { - + FhAusweisStatus: this.data.zutrittsdatum, emails: this.data.emails, Kontakte: this.data.kontakte, Adressen: this.data.adressen, @@ -146,7 +146,7 @@ export default { template: ` -
    +
    @@ -245,7 +245,7 @@ export default { -
    +
    @@ -254,14 +254,14 @@ export default {
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    + +
    -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -
    + +
    @@ -271,7 +271,7 @@ export default { -
    +
    @@ -280,24 +280,30 @@ export default {
    + +
    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    +
    +
    -
    eMail
    -
    -
    {{email.type}}: {{email.email}}
    -
    +
    eMail
    +
    +
    {{email.type}}: {{email.email}}
    +
    -
    Private Kontakte
    -
    +
    Private Kontakte
    +
    -
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    -
    {{element?.anmerkung}}
    +
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    +
    {{element?.anmerkung}}
    @@ -310,8 +316,8 @@ export default {
    -
    Adressen
    -
    +
    Adressen
    +
    {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}}
    @@ -380,7 +386,7 @@ export default { -
    +
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index 64307cb7c..ec2c277a0 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -115,7 +115,7 @@ export default { -
    +
    @@ -189,7 +189,7 @@ export default { -
    +
    @@ -215,7 +215,7 @@ export default { -
    +
    @@ -283,7 +283,7 @@ export default { -
    +
    diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 368034b1d..c22bafe4a 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -120,7 +120,7 @@ export default { template: ` -
    +
    @@ -219,7 +219,7 @@ export default { -
    +
    @@ -232,10 +232,7 @@ export default {
    {{wert?wert:"-"}}
    -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -
    +
    @@ -245,7 +242,7 @@ export default { -
    +
    @@ -254,12 +251,22 @@ export default {
    + + + + +
    +
    FH-Ausweis Status
    +
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    +
    + +
    -
    eMail
    -
    +
    eMail
    +
    {{email.type}}: {{email.email}}
    @@ -267,11 +274,11 @@ export default {
    -
    Private Kontakte
    -
    +
    Private Kontakte
    +
    -
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    -
    {{element?.anmerkung}}
    +
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    +
    {{element?.anmerkung}}
    @@ -284,8 +291,8 @@ export default {
    -
    Adressen
    -
    +
    Adressen
    +
    {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}}
    @@ -354,7 +361,7 @@ export default { -
    +
    diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 23e66564e..4cca513bc 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -81,7 +81,7 @@ export default { -
    +
    @@ -160,7 +160,7 @@ export default { -
    +
    @@ -183,7 +183,7 @@ export default { -
    +
    @@ -237,7 +237,7 @@ export default { -
    +
    From 37f89010a4cc0de2c2b0a48d655a03221f481ee3 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 11 Dec 2023 15:18:44 +0100 Subject: [PATCH 033/201] adds Mitarbeiter und Studenten Profil Titel --- .../Cis/Profil/MitarbeiterProfil.js | 36 +++++++++++-------- .../Cis/Profil/MitarbeiterViewProfil.js | 26 +++++++------- .../js/components/Cis/Profil/StudentProfil.js | 33 +++++++++-------- .../Cis/Profil/StudentViewProfil.js | 23 ++++++------ 4 files changed, 62 insertions(+), 56 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 71afab9cd..7b513801b 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -92,6 +92,7 @@ export default { return { Allgemein: { + Username: this.data.username, Anrede: this.data.anrede, Titel: this.data.titel, @@ -187,7 +188,13 @@ export default {
    - + + + + + + + @@ -246,23 +253,24 @@ export default {
    + + + +
    + +
    +
    MitarbeiterIn
    +
    - - - -
    -
    -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    -
    - +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    -
    + +
    - -
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index ec2c277a0..fc4f49641 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -191,22 +191,20 @@ export default {
    +
    + +
    +
    MitarbeiterIn
    +
    - - -
    -
    -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    -
    -
    -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -
    -
    +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    + + +
    diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index c22bafe4a..7f2088e43 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -68,6 +68,7 @@ export default { return { Allgemein: { + Username: this.data.username, Matrikelnummer: this.data.matrikelnummer, Anrede: this.data.anrede, @@ -82,7 +83,7 @@ export default { Verband: this.data.verband, Gruppe: this.data.gruppe, Personenkennzeichen: this.data.personenkennzeichen, - FhAusweisStatus: this.data.zutrittsdatum, + }, @@ -95,6 +96,7 @@ export default { } return { + FhAusweisStatus: this.data.zutrittsdatum, emails: this.data.emails, Kontakte: this.data.kontakte, Adressen: this.data.adressen, @@ -162,9 +164,6 @@ export default { - - -
    @@ -221,20 +220,20 @@ export default {
    +
    + +
    +
    StudentIn
    +
    - - -
    -
    -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    -
    -
    - -
    - +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    + + +
    @@ -255,7 +254,7 @@ export default { -
    +
    FH-Ausweis Status
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 4cca513bc..628414007 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -162,19 +162,20 @@ export default {
    +
    + +
    +
    StudentIn
    +
    - - -
    -
    -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    -
    -
    - -
    +
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    +
    + + +
    From efc8e7c5feee90a5b5d0c22b3bfc4bd63cc709e8 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 12 Dec 2023 09:04:07 +0100 Subject: [PATCH 034/201] css fix to wrap words when space gets little --- .../components/Cis/Profil/MitarbeiterProfil.js | 16 +++------------- .../Cis/Profil/MitarbeiterViewProfil.js | 2 +- public/js/components/Cis/Profil/StudentProfil.js | 2 +- .../components/Cis/Profil/StudentViewProfil.js | 2 +- 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 7b513801b..210c2dd99 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -147,7 +147,7 @@ export default { template: ` -
    +
    @@ -183,19 +183,9 @@ export default {
    -
    +
    -
    - - - - - - - - - - +
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index fc4f49641..95bea8724 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -115,7 +115,7 @@ export default { -
    +
    diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 7f2088e43..75b6a41b3 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -122,7 +122,7 @@ export default { template: ` -
    +
    diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 628414007..8196d428f 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -81,7 +81,7 @@ export default { -
    +
    From aefe73b64208aab528f42cfa3652a48744104581 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 12 Dec 2023 09:28:49 +0100 Subject: [PATCH 035/201] overflow-wrap: break-word style for better text wrapping --- public/js/components/Cis/Profil/MitarbeiterProfil.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 210c2dd99..fe55b11bb 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -232,7 +232,7 @@ export default { -
    +
    @@ -296,10 +296,10 @@ export default { -
    +
    Private Kontakte
    -
    +
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    {{element?.anmerkung}}
    From 38301572aec355339be5915632188dbb46c95ea5 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 12 Dec 2023 09:41:53 +0100 Subject: [PATCH 036/201] Mailverteiler nehmen ganze Spalte ein bei Viewport lg --- public/js/components/Cis/Profil/MitarbeiterProfil.js | 6 +++--- public/js/components/Cis/Profil/MitarbeiterViewProfil.js | 6 +++--- public/js/components/Cis/Profil/StudentProfil.js | 6 +++--- public/js/components/Cis/Profil/StudentViewProfil.js | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index fe55b11bb..7a23d298d 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -412,10 +412,10 @@ export default {
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    +

    Sie sind Mitgglied in folgenden Verteilern:

    - -
    {{verteiler.beschreibung}}
    + +
    {{verteiler.beschreibung}}
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index 95bea8724..26baaf24e 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -309,10 +309,10 @@ export default {
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    +

    Sie sind Mitgglied in folgenden Verteilern:

    - -
    {{verteiler.beschreibung}}
    + +
    {{verteiler.beschreibung}}
    diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 75b6a41b3..a248eab34 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -388,10 +388,10 @@ export default {
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    +

    Sie sind Mitgglied in folgenden Verteilern:

    - -
    {{verteiler.beschreibung}}
    + +
    {{verteiler.beschreibung}}
    diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 8196d428f..fc942a51b 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -266,10 +266,10 @@ export default {
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    +

    Sie sind Mitgglied in folgenden Verteilern:

    - -
    {{verteiler.beschreibung}}
    + +
    {{verteiler.beschreibung}}
    From 3a191f4a11b2d4335ebc02137771820c74695d3c Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 12 Dec 2023 12:09:03 +0100 Subject: [PATCH 037/201] adds responsive layout to the tables by collapsing the columns of a table --- public/css/components/Profil.css | 5 ++ .../Cis/Profil/MitarbeiterProfil.js | 60 +++++++++++++++---- 2 files changed, 55 insertions(+), 10 deletions(-) diff --git a/public/css/components/Profil.css b/public/css/components/Profil.css index a8f0e5d4b..6bca17d6b 100644 --- a/public/css/components/Profil.css +++ b/public/css/components/Profil.css @@ -14,6 +14,11 @@ } } +.tabulator-collapsed-row{ + padding:7px; + +} + /* dl { width: 100%; overflow: hidden; diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 7a23d298d..0a32e0941 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -2,6 +2,7 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; + export default { components: { CoreFilterCmpt, @@ -12,8 +13,37 @@ export default { funktionen_table_options: { height: 300, - layout: "fitColumns", + layout:"fitColumns", + responsiveLayout:"collapse", + responsiveLayoutCollapseUseFormatters:false, + responsiveLayoutCollapseFormatter:function(data){ + //data - an array of objects containing the column title and value for each cell + var container = document.createElement("div"); + //container.classList.add("container-fluid"); + //container.classList.add("p-0"); + container.classList.add("tabulator-collapsed-row"); + var list = document.createElement("div"); + list.classList.add("row"); + container.appendChild(list); + + data.forEach(function(col){ + let item = document.createElement("div"); + item.classList.add("col-6"); + let item2 = document.createElement("div"); + item2.classList.add("col-6"); + + item.innerHTML = "" + col.title + ""; + console.log("col values",col); + item2.innerHTML = col.value?col.value:"-"; + list.appendChild(item); + list.appendChild(item2); + }); + + return Object.keys(data).length ? container : ""; + }, + data: [ + { Bezeichnung: "", Organisationseinheit: "", @@ -23,19 +53,29 @@ export default { }, ], columns: [ - { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true }, + //? option when wanting to hide the collapsed list + /* { + title: "", + field: "", + headerSort: false, + formatter:"responsiveCollapse", + maxWidth:20, + }, */ + { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true,minWidth:200, }, { title: "Organisationseinheit", field: "Organisationseinheit", - headerFilter: true, + headerFilter: true,minWidth:200, }, - { title: "Gültig_von", field: "Gültig_von", headerFilter: true }, - { title: "Gültig_bis", field: "Gültig_bis", headerFilter: true }, + { title: "Gültig_von", field: "Gültig_von", headerFilter: true, resizable:true,minWidth:200, }, + { title: "Gültig_bis", field: "Gültig_bis", headerFilter: true, resizable:true,minWidth:200, }, { title: "Wochenstunden", field: "Wochenstunden", headerFilter: true, + minWidth:200, }, + ], }, betriebsmittel_table_options: { @@ -46,13 +86,13 @@ export default { { title: "Betriebsmittel", field: "betriebsmittel", - headerFilter: true, + headerFilter: true }, - { title: "Nummer", field: "Nummer", headerFilter: true }, + { title: "Nummer", field: "Nummer", headerFilter: true, resizable:true }, { title: "Ausgegeben_am", field: "Ausgegeben_am", - headerFilter: true, + headerFilter: true }, ], }, @@ -254,8 +294,8 @@ export default {
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    +
    {{bez}}
    +
    {{wert?wert:"-"}}
    From 350911d474a2e8ada75d4c68f825dbc53cc0b7f3 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 12 Dec 2023 12:15:27 +0100 Subject: [PATCH 038/201] adds responsive layout collapse to both tables --- .../Cis/Profil/MitarbeiterProfil.js | 62 ++++++++++--------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 0a32e0941..2ad709afd 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -2,6 +2,32 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; +const collapseFormatter = function(data){ + //data - an array of objects containing the column title and value for each cell + var container = document.createElement("div"); + container.classList.add("tabulator-collapsed-row"); + + var list = document.createElement("div"); + list.classList.add("row"); + + container.appendChild(list); + + data.forEach(function(col){ + let item = document.createElement("div"); + item.classList.add("col-6"); + let item2 = document.createElement("div"); + item2.classList.add("col-6"); + + item.innerHTML = "" + col.title + ""; + console.log("col values",col); + item2.innerHTML = col.value?col.value:"-"; + list.appendChild(item); + list.appendChild(item2); + }); + + return Object.keys(data).length ? container : ""; +}; + export default { components: { @@ -16,31 +42,7 @@ export default { layout:"fitColumns", responsiveLayout:"collapse", responsiveLayoutCollapseUseFormatters:false, - responsiveLayoutCollapseFormatter:function(data){ - //data - an array of objects containing the column title and value for each cell - var container = document.createElement("div"); - //container.classList.add("container-fluid"); - //container.classList.add("p-0"); - container.classList.add("tabulator-collapsed-row"); - var list = document.createElement("div"); - list.classList.add("row"); - container.appendChild(list); - - data.forEach(function(col){ - let item = document.createElement("div"); - item.classList.add("col-6"); - let item2 = document.createElement("div"); - item2.classList.add("col-6"); - - item.innerHTML = "" + col.title + ""; - console.log("col values",col); - item2.innerHTML = col.value?col.value:"-"; - list.appendChild(item); - list.appendChild(item2); - }); - - return Object.keys(data).length ? container : ""; - }, + responsiveLayoutCollapseFormatter:collapseFormatter, data: [ @@ -81,18 +83,22 @@ export default { betriebsmittel_table_options: { height: 300, layout: "fitColumns", + responsiveLayout:"collapse", + responsiveLayoutCollapseUseFormatters:false, + responsiveLayoutCollapseFormatter:collapseFormatter, data: [{ betriebsmittel: "test", Nummer: "", Ausgegeben_am: "" }], columns: [ { title: "Betriebsmittel", field: "betriebsmittel", - headerFilter: true + headerFilter: true, minWidth:200, }, - { title: "Nummer", field: "Nummer", headerFilter: true, resizable:true }, + { title: "Nummer", field: "Nummer", headerFilter: true, resizable:true, minWidth:200, }, { title: "Ausgegeben_am", field: "Ausgegeben_am", - headerFilter: true + headerFilter: true, + minWidth:200, }, ], }, From b2c8bcb2bf0bd5cc8533a750ff0b458f36d9f763 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 12 Dec 2023 13:21:15 +0100 Subject: [PATCH 039/201] adds a little shadow to the collapsed columns in the tables --- public/css/components/Profil.css | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/css/components/Profil.css b/public/css/components/Profil.css index 6bca17d6b..66b52439c 100644 --- a/public/css/components/Profil.css +++ b/public/css/components/Profil.css @@ -15,8 +15,13 @@ } .tabulator-collapsed-row{ - padding:7px; - + padding:15px; + background-color: rgba(0,0,0,0.1); + +} + +.tabulator-responsive-collapse{ + padding:0 !important; } /* dl { From 4b45914d4fa22edb7598630008f1223865a373a4 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 12 Dec 2023 13:50:38 +0100 Subject: [PATCH 040/201] adds the collapse formater function as a global Vue function that can be used by alle the different view components --- public/js/apps/Cis/Profil.js | 26 ++++++++++++++- .../Cis/Profil/MitarbeiterProfil.js | 33 ++++--------------- .../Cis/Profil/MitarbeiterViewProfil.js | 25 +++++++++++--- .../js/components/Cis/Profil/StudentProfil.js | 9 +++-- 4 files changed, 59 insertions(+), 34 deletions(-) diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index 825b7a5ce..d9bff2cb4 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -7,7 +7,31 @@ import Base from "../../components/Cis/Profil/Base.js"; import fhcapifactory from "../api/fhcapifactory.js"; Vue.$fhcapi = fhcapifactory; - +Vue.$collapseFormatter = function(data){ + //data - an array of objects containing the column title and value for each cell + var container = document.createElement("div"); + container.classList.add("tabulator-collapsed-row"); + + var list = document.createElement("div"); + list.classList.add("row"); + + container.appendChild(list); + + data.forEach(function(col){ + let item = document.createElement("div"); + item.classList.add("col-6"); + let item2 = document.createElement("div"); + item2.classList.add("col-6"); + + item.innerHTML = "" + col.title + ""; + console.log("col values",col); + item2.innerHTML = col.value?col.value:"-"; + list.appendChild(item); + list.appendChild(item2); + }); + + return Object.keys(data).length ? container : ""; + }; const app = Vue.createApp({ diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 2ad709afd..bf8c3144e 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -2,31 +2,7 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; -const collapseFormatter = function(data){ - //data - an array of objects containing the column title and value for each cell - var container = document.createElement("div"); - container.classList.add("tabulator-collapsed-row"); - var list = document.createElement("div"); - list.classList.add("row"); - - container.appendChild(list); - - data.forEach(function(col){ - let item = document.createElement("div"); - item.classList.add("col-6"); - let item2 = document.createElement("div"); - item2.classList.add("col-6"); - - item.innerHTML = "" + col.title + ""; - console.log("col values",col); - item2.innerHTML = col.value?col.value:"-"; - list.appendChild(item); - list.appendChild(item2); - }); - - return Object.keys(data).length ? container : ""; -}; export default { @@ -42,7 +18,7 @@ export default { layout:"fitColumns", responsiveLayout:"collapse", responsiveLayoutCollapseUseFormatters:false, - responsiveLayoutCollapseFormatter:collapseFormatter, + responsiveLayoutCollapseFormatter:Vue.$collapseFormatter, data: [ @@ -68,6 +44,7 @@ export default { title: "Organisationseinheit", field: "Organisationseinheit", headerFilter: true,minWidth:200, + }, { title: "Gültig_von", field: "Gültig_von", headerFilter: true, resizable:true,minWidth:200, }, { title: "Gültig_bis", field: "Gültig_bis", headerFilter: true, resizable:true,minWidth:200, }, @@ -85,7 +62,7 @@ export default { layout: "fitColumns", responsiveLayout:"collapse", responsiveLayoutCollapseUseFormatters:false, - responsiveLayoutCollapseFormatter:collapseFormatter, + responsiveLayoutCollapseFormatter:Vue.$collapseFormatter, data: [{ betriebsmittel: "test", Nummer: "", Ausgegeben_am: "" }], columns: [ { @@ -177,9 +154,13 @@ export default { }, mounted() { + + + this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); + this.$refs.betriebsmittelTable.tabulator.hideColumn("betriebsmittel"); }) diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index 26baaf24e..e7fbbeff4 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -12,8 +12,13 @@ export default { funktionen_table_options: { height: 300, - layout: "fitColumns", + layout:"fitColumns", + responsiveLayout:"collapse", + responsiveLayoutCollapseUseFormatters:false, + responsiveLayoutCollapseFormatter:Vue.$collapseFormatter, + data: [ + { Bezeichnung: "", Organisationseinheit: "", @@ -23,19 +28,29 @@ export default { }, ], columns: [ - { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true }, + //? option when wanting to hide the collapsed list + /* { + title: "", + field: "", + headerSort: false, + formatter:"responsiveCollapse", + maxWidth:20, + }, */ + { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true,minWidth:200, }, { title: "Organisationseinheit", field: "Organisationseinheit", - headerFilter: true, + headerFilter: true,minWidth:200, }, - { title: "Gültig_von", field: "Gültig_von", headerFilter: true }, - { title: "Gültig_bis", field: "Gültig_bis", headerFilter: true }, + { title: "Gültig_von", field: "Gültig_von", headerFilter: true, resizable:true,minWidth:200, }, + { title: "Gültig_bis", field: "Gültig_bis", headerFilter: true, resizable:true,minWidth:200, }, { title: "Wochenstunden", field: "Wochenstunden", headerFilter: true, + minWidth:200, }, + ], }, diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index a248eab34..4aa242a30 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -14,21 +14,26 @@ export default { betriebsmittel_table_options: { height: 300, layout: "fitColumns", + responsiveLayout:"collapse", + responsiveLayoutCollapseUseFormatters:false, + responsiveLayoutCollapseFormatter:Vue.$collapseFormatter, data: [{ betriebsmittel: "", Nummer: "", Ausgegeben_am: "" }], columns: [ { title: "Betriebsmittel", field: "betriebsmittel", - headerFilter: true, + headerFilter: true, minWidth:200, }, - { title: "Nummer", field: "Nummer", headerFilter: true }, + { title: "Nummer", field: "Nummer", headerFilter: true, resizable:true, minWidth:200, }, { title: "Ausgegeben_am", field: "Ausgegeben_am", headerFilter: true, + minWidth:200, }, ], }, + zutrittsgruppen_table_options: { height: 300, layout: "fitColumns", From 036365e148901ea14698ebc392168d5807e808f9 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 12 Dec 2023 14:00:01 +0100 Subject: [PATCH 041/201] shows all columns, removes the hidding of a column --- public/js/components/Cis/Profil/MitarbeiterProfil.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index bf8c3144e..95863e3b6 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -68,7 +68,8 @@ export default { { title: "Betriebsmittel", field: "betriebsmittel", - headerFilter: true, minWidth:200, + headerFilter: true, + minWidth:200, }, { title: "Nummer", field: "Nummer", headerFilter: true, resizable:true, minWidth:200, }, { @@ -160,7 +161,6 @@ export default { this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); - this.$refs.betriebsmittelTable.tabulator.hideColumn("betriebsmittel"); }) From 5b03abb50c2b7112390fb2aee454f85fda5f5860 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 12 Dec 2023 14:42:15 +0100 Subject: [PATCH 042/201] restyling for the hidden dropdown quick links --- public/js/apps/Cis/Profil.js | 2 +- .../Cis/Profil/MitarbeiterProfil.js | 70 ++++++++++--------- .../Cis/Profil/MitarbeiterViewProfil.js | 37 +++++----- .../js/components/Cis/Profil/StudentProfil.js | 35 +++++----- .../Cis/Profil/StudentViewProfil.js | 37 +++++----- 5 files changed, 90 insertions(+), 91 deletions(-) diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index d9bff2cb4..eec4f9960 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -24,8 +24,8 @@ Vue.$collapseFormatter = function(data){ item2.classList.add("col-6"); item.innerHTML = "" + col.title + ""; - console.log("col values",col); item2.innerHTML = col.value?col.value:"-"; + list.appendChild(item); list.appendChild(item2); }); diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 95863e3b6..68693b887 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -4,7 +4,6 @@ import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; - export default { components: { CoreFilterCmpt, @@ -14,14 +13,13 @@ export default { funktionen_table_options: { + reactiveData:true, height: 300, layout:"fitColumns", responsiveLayout:"collapse", responsiveLayoutCollapseUseFormatters:false, responsiveLayoutCollapseFormatter:Vue.$collapseFormatter, - data: [ - { Bezeichnung: "", Organisationseinheit: "", @@ -58,12 +56,13 @@ export default { ], }, betriebsmittel_table_options: { + height: 300, layout: "fitColumns", responsiveLayout:"collapse", responsiveLayoutCollapseUseFormatters:false, responsiveLayoutCollapseFormatter:Vue.$collapseFormatter, - data: [{ betriebsmittel: "test", Nummer: "", Ausgegeben_am: "" }], + data: [{ betriebsmittel: "", Nummer: "", Ausgegeben_am: "" }], columns: [ { title: "Betriebsmittel", @@ -130,12 +129,6 @@ export default { Büro:this.data.ort_kurzbz, }, - - - - - - }; }, //? this computed function returns the data for the second column in the profil @@ -167,12 +160,27 @@ export default { this.$refs.funktionenTable.tabulator.on('tableBuilt', () => { this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); - + }) }, - template: ` +/* + +*/ + template: ` + + +
    @@ -180,28 +188,26 @@ export default {
    - - - - -
    -
    - + +
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index e7fbbeff4..9329eb538 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -136,28 +136,25 @@ export default {
    - - - - -
    -
    - +
    diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 4aa242a30..ce4f1545e 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -133,26 +133,25 @@ export default {
    - - - - -
    -
    - +
    diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index fc942a51b..4d4584dca 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -87,28 +87,25 @@ export default {
    - - - - -
    -
    - +
    From 633cd6be0fcfed2703ec6038b1604a4fe16ac572 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 12 Dec 2023 14:48:26 +0100 Subject: [PATCH 043/201] adds wrap word to every view and deltes the old profil view --- .../Cis/Profil/MitarbeiterViewProfil.js | 6 +- public/js/components/Cis/Profil/Profil.old.js | 337 ------------------ .../js/components/Cis/Profil/StudentProfil.js | 2 +- .../Cis/Profil/StudentViewProfil.js | 6 +- 4 files changed, 7 insertions(+), 344 deletions(-) delete mode 100644 public/js/components/Cis/Profil/Profil.old.js diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index 9329eb538..7131c7d8e 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -191,7 +191,7 @@ export default { -
    +
    @@ -238,8 +238,8 @@ export default {
    -
    eMail
    -
    +
    eMail
    +
    {{email.type}}: {{email.email}}
    diff --git a/public/js/components/Cis/Profil/Profil.old.js b/public/js/components/Cis/Profil/Profil.old.js deleted file mode 100644 index 3e25652c5..000000000 --- a/public/js/components/Cis/Profil/Profil.old.js +++ /dev/null @@ -1,337 +0,0 @@ - -import fhcapifactory from "../../../apps/api/fhcapifactory.js"; -import {CoreFilterCmpt} from "../../../components/filter/Filter.js" - -//? possible types of roles: -//! depending on the role of the current view, different content is being displayed and fetched -//* Student -//* Mitarbeiter -//* View_Student -//* View_Mitarbeiter - -export default { - components:{ - CoreFilterCmpt, - }, - data() { - return { - index_information: null, - mitarbeiter_info: null, - student_info:null, - //? beinhaltet die Information ob der angefragte user ein Student oder Mitarbeiter ist - role: null, - - funktionen_table_options: { - height: 300, - layout: 'fitColumns', - data:[{Bezeichnung:"",Organisationseinheit:"",Gültig_von:"",Gültig_bis:"",Wochenstunden:""}], - columns: [{title: 'Bezeichnung', field: 'Bezeichnung', headerFilter: true}, - {title: 'Organisationseinheit', field: 'Organisationseinheit', headerFilter: true}, - {title: 'Gültig_von', field: 'Gültig_von', headerFilter: true}, - {title: 'Gültig_bis', field: 'Gültig_bis', headerFilter: true}, - {title: 'Wochenstunden', field: 'Wochenstunden', headerFilter: true},] - - }, - betriebsmittel_table_options:{ - height: 300, - layout: 'fitColumns', - data:[{betriebsmittel:"",Nummer:"",Ausgegeben_am:""}], - columns: [{title: 'Betriebsmittel', field: 'betriebsmittel', headerFilter: true}, - {title: 'Nummer', field: 'Nummer', headerFilter: true}, - {title: 'Ausgegeben_am', field: 'Ausgegeben_am', headerFilter: true},] - - }, - zutrittsgruppen_table_options:{ - height: 300, - layout: 'fitColumns', - data:[{bezeichnung:"test1"}], - columns: [{title: 'Zutritt', field: 'bezeichnung'}] - } - } - }, - - //? this props were passed in the Profil.php view file - props:['data','view'], - methods: { - - concatenate_addresses(address_array){ - let result = ""; - for (let i = 0; i < address_array.length; i++) { - result += address_array[i].strasse + " " + address_array[i].plz + " " + address_array[i].ort + "\n"; - } - return result; - }, - render_unterelement(wert,bezeichnung){ - if (isArray(bezeichnung)){ - - } - }, - concatenate_kontakte(kontakt_array){ - let result = ""; - for (let i = 0; i < kontakt_array.length; i++) { - result += kontakt_array[i].kontakttyp + " " + kontakt_array[i].kontakt + " " + kontakt_array[i].zustellung + "\n"; - } - return result; - }, - sperre_foto_function(value){ - if(!(this.mitarbeiter_info && this.index_information && this.student_info) ){ - return; - } - fhcapifactory.UserData.sperre_foto_function(value).then(res => { - - this.index_information.foto_sperre = res.data.foto_sperre; - - }); - - }, - - - }, - computed:{ - - - get_image_base64_src(){ - if(!this.index_information){ - return ""; - } - return "data:image/jpeg;base64,"+this.index_information.foto; - }, - personData(){ - if(!this.index_information){ - return {}; - } - - return { - Allgemein: (this.role =='Mitarbeiter' || this.role =='View_Mitarbeiter')?{ - Username:this.index_information.username, - Anrede:this.index_information.anrede, - Titel:this.index_information.titel, - Vorname:this.index_information.vorname, - Nachname:this.index_information.nachname, - Postnomen:this.index_information.postnomen, - }:{ - Username:this.index_information.username, - Matrikelnummer: this.student_info?.matrikelnummer, - Anrede:this.index_information.anrede, - Titel:this.index_information.titel, - Vorname:this.index_information.vorname, - Nachname:this.index_information.nachname, - Postnomen:this.index_information.postnomen, - }, - GeburtsDaten:!this.role.includes("View")?{ - Geburtsdatum:this.index_information.gebdatum, - Geburtsort: this.index_information.gebort, - }: null, - Adressen: this.index_information.adressen, - SpecialInformation: this.role =='Mitarbeiter' || this.role === 'View_Mitarbeiter'? { - Kurzzeichen: this.mitarbeiter_info?.kurzbz, - Telefon: this.mitarbeiter_info?.telefonklappe, - //* Wird das Feld Ort_kurzbz noch gepflegt? - ...(this.role === 'View_Mitarbeiter'?{Büro:this.mitarbeiter_info?.ort_kurzbz}:{}) , - } : { - Studiengang:this.student_info?.studiengang, - Semester:this.student_info?.semester, - Verband:this.student_info?.verband, - Gruppe:this.student_info?.gruppe, - Personenkennzeichen:this.student_info?.personenkennzeichen - }, - }; - }, - //? this computed conains all the information that is used for the second column that displays the information of the person - kontaktInfo(){ - if(!this.index_information){ - return {}; - } - - return { - FhAusweisStatus: this.index_information.zutrittsdatum, - emails: this.role === 'Mitarbeiter' || this.role === 'View_Mitarbeiter'? this.mitarbeiter_info?.emails: this.index_information.emails, - Kontakte:this.index_information.kontakte, - }; - }, - - }, - - mounted(){ - - console.log(this.uid); - console.log(this.view); - console.log(typeof this.view); - if(this.view){console.log("view is true")}else{ console.log("view is false")} - - //? this function is to update the tabulator information only when the tabulator was build checking the tableBulit event - //! only the tableBuilt event of the second tabulator was used to update the table informations - - - fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then((res) => { - - this.role = this.view? "View_"+res.data: res.data; - if(!this.role.includes('View')){ - this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { - }) - } - - - console.log("the role of the current view: ", this.role); - - - - //? Die anderen api calls werden erst gemacht wenn der call zu isMitarbeiterOrStudent gemacht worden ist - - - //! indexProfilInformationen werden immer gefetcht - fhcapifactory.UserData.indexProfilInformaion(this.uid,this.view).then((res) => { - console.log(res.data); - this.index_information = res.data; - if(!this.role.includes("View")){ - this.$refs.betriebsmittelTable.tabulator.setData(res.data.mittel); - } - }); - - - //? Danach werden die Informationen der Role gefetcht - if(this.role === "Student" || this.role === "View_Student"){ - fhcapifactory.UserData.studentProfil(this.uid,this.view).then((res)=> { - this.student_info = res.data; - if(this.role ==="Student"){ - this.$refs.zutrittsgruppenTable.tabulator.setData(res.data.zuttritsgruppen); - } - }) - } - - if(this.role === "Mitarbeiter" || this.role === "View_Mitarbeiter"){ - fhcapifactory.UserData.mitarbeiterProfil(this.uid).then((res)=> { - this.mitarbeiter_info = res.data; - this.$refs.funktionenTable.tabulator.setData(res.data.funktionen); - }) - } - }); - - - - }, - - template: ` - -
    -
    -
    -
    -   
    -    
    -
    - -
    -
    -
    - -
    - -
    - -
    -
    -
    - -
    -
    -

    Profilfoto gesperrt

    - Sperre des Profilfotos aufheben -
    - Profilfoto sperren -
    - -
    -
    - -

    Mitarbeiter

    -

    Student

    - -
    - -
    {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}}
    -
    {{bez}}: {{val}}
    - -
    - -
    -
    -
      - -
    1. - - -
      -

      FH-Ausweis Status

      -

      {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}

      -
      - - - - -
      -

      eMail

      -

      {{email.type}}: {{email.email}}

      -
      - - -
      -

      Private Kontakte

      -
      -
      {{element.kontakttyp + ": " + element.kontakt+" " }}
      -
      {{element?.anmerkung}}
      -
      - - -
      -
      -
      - - - -
    2. -
    - - -
    -
    - -
    - - -
    - - - - -
    -
    - - - -
    - -
    - - -
    - -
    - -
    -
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    -
    - -
    {{verteiler.beschreibung}}
    -
    -
    -
    -
    -
    - `, -}; \ No newline at end of file diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index ce4f1545e..ee1b6f660 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -212,7 +212,7 @@ export default { -
    +
    diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 4d4584dca..c142937dd 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -147,7 +147,7 @@ export default { -
    +
    @@ -194,8 +194,8 @@ export default {
    -
    eMail
    -
    +
    eMail
    +
    {{email.type}}: {{email.email}}
    From a72b8a153efad8b4c232a81fb0cd0fb85fe9ee31 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 12 Dec 2023 15:34:28 +0100 Subject: [PATCH 044/201] layout changes --- .../Cis/Profil/MitarbeiterProfil.js | 25 ++++++------------- .../Cis/Profil/MitarbeiterViewProfil.js | 4 +-- .../js/components/Cis/Profil/StudentProfil.js | 6 ++--- .../Cis/Profil/StudentViewProfil.js | 2 +- public/js/components/filter/Filter.js | 8 +++--- 5 files changed, 17 insertions(+), 28 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 68693b887..27b6bb9b1 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -13,8 +13,7 @@ export default { funktionen_table_options: { - reactiveData:true, - height: 300, + height:400, layout:"fitColumns", responsiveLayout:"collapse", responsiveLayoutCollapseUseFormatters:false, @@ -30,7 +29,8 @@ export default { ], columns: [ //? option when wanting to hide the collapsed list - /* { + /* + { title: "", field: "", headerSort: false, @@ -57,7 +57,7 @@ export default { }, betriebsmittel_table_options: { - height: 300, + height:300, layout: "fitColumns", responsiveLayout:"collapse", responsiveLayoutCollapseUseFormatters:false, @@ -165,18 +165,7 @@ export default { }, -/* - -*/ + template: ` @@ -207,7 +196,7 @@ export default {
    - +
    @@ -417,7 +406,7 @@ export default { -
    +
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index 7131c7d8e..9e04c2c34 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -11,7 +11,7 @@ export default { funktionen_table_options: { - height: 300, + height: 400, layout:"fitColumns", responsiveLayout:"collapse", responsiveLayoutCollapseUseFormatters:false, @@ -293,7 +293,7 @@ export default { -
    +
    diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index ee1b6f660..147ab5d34 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -35,7 +35,7 @@ export default { }, zutrittsgruppen_table_options: { - height: 300, + height: 200, layout: "fitColumns", data: [{ bezeichnung: "test1" }], columns: [{ title: "Zutritt", field: "bezeichnung" }], @@ -345,7 +345,7 @@ export default {
    - +
    @@ -364,7 +364,7 @@ export default { -
    +
    diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index c142937dd..216ddcbfd 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -235,7 +235,7 @@ export default { -
    +
    diff --git a/public/js/components/filter/Filter.js b/public/js/components/filter/Filter.js index b5a132318..40821cf00 100644 --- a/public/js/components/filter/Filter.js +++ b/public/js/components/filter/Filter.js @@ -46,7 +46,7 @@ export const CoreFilterCmpt = { tabulatorOptions: Object, tabulatorEvents: Array, tableOnly: Boolean, - noColFilter:Boolean, + noColumnFilter:Boolean, }, data: function() { return { @@ -154,7 +154,7 @@ export const CoreFilterCmpt = { initTabulator() { // Define a default tabulator options in case it was not provided let tabulatorOptions = {...{ - height: 500, + height: 500, layout: "fitColumns", movableColumns: true, reactiveData: true @@ -587,10 +587,10 @@ export const CoreFilterCmpt = {
    [ {{ filterName }} ] - +
    -
    +
    From 4715ce3b958c3f93b1cea5d980c01738ff6b1ab0 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Wed, 13 Dec 2023 10:58:05 +0100 Subject: [PATCH 045/201] icon to show or hide all collapsed columns --- public/css/components/Profil.css | 4 + .../Cis/Profil/MitarbeiterProfil.js | 99 +++++++++++++------ .../Cis/Profil/MitarbeiterViewProfil.js | 16 +-- .../js/components/Cis/Profil/StudentProfil.js | 20 ++-- .../Cis/Profil/StudentViewProfil.js | 17 ++-- 5 files changed, 105 insertions(+), 51 deletions(-) diff --git a/public/css/components/Profil.css b/public/css/components/Profil.css index 66b52439c..2ae004c9f 100644 --- a/public/css/components/Profil.css +++ b/public/css/components/Profil.css @@ -20,6 +20,10 @@ } +.tabulator-col{ + justify-content:center !important; +} + .tabulator-responsive-collapse{ padding:0 !important; } diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 27b6bb9b1..0db26f157 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -1,7 +1,10 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; - +let customEvents = [{event: "headerClick", handler:function(e,column){ + console.log(e); + console.log(column); +}}] export default { @@ -11,9 +14,9 @@ export default { data() { return { - + showCollapsedColumn: true, funktionen_table_options: { - height:400, + height:300, layout:"fitColumns", responsiveLayout:"collapse", responsiveLayoutCollapseUseFormatters:false, @@ -29,14 +32,15 @@ export default { ], columns: [ //? option when wanting to hide the collapsed list - /* + { - title: "", - field: "", + title: "", + field: "collapse", headerSort: false, + headerFilter:false, formatter:"responsiveCollapse", maxWidth:20, - }, */ + }, { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true,minWidth:200, }, { title: "Organisationseinheit", @@ -115,7 +119,8 @@ export default { return { Allgemein: { - + + View:"MitarbeiterIn", Username: this.data.username, Anrede: this.data.anrede, Titel: this.data.titel, @@ -159,10 +164,48 @@ export default { this.$refs.funktionenTable.tabulator.on('tableBuilt', () => { - this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); + this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); + }) + + + this.$refs.funktionenTable.tabulator.on("headerClick", function(e, column){ + this.showCollapsedColumn = !this.showCollapsedColumn; + + if(column._column.field == "collapse"){ + //* changes the icon that shows or hides all the collapsed columns + if(this.showCollapsedColumn){ + document.getElementById("collapseIcon").classList.replace("fa-angle-up","fa-angle-down"); + }else{ + document.getElementById("collapseIcon").classList.replace("fa-angle-down","fa-angle-up"); + } + + //* changes the icon for every collapsed column to open or closed + [...document.getElementsByClassName("tabulator-responsive-collapse-toggle")].forEach(ele => { + if(this.showCollapsedColumn){ + ele.classList.replace("close","open"); + + }else{ + ele.classList.replace("open","close"); + } + }); + + //* hides or shows the collapsed columns + [...document.getElementsByClassName("tabulator-responsive-collapse")].forEach(ele => { + if(this.showCollapsedColumn){ + ele.style.display="" + + }else{ + ele.style.display="none" + } + + }); + + } + + }); }, @@ -177,10 +220,10 @@ export default {
    -
    +

    - @@ -207,7 +250,7 @@ export default {

    -
    +
    @@ -254,7 +297,7 @@ export default { -
    +
    @@ -264,20 +307,20 @@ export default { -
    +
    - -
    -
    MitarbeiterIn
    -
    + -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    +
    +
    {{wert}}
    +
    @@ -291,7 +334,7 @@ export default { -
    +
    @@ -368,7 +411,7 @@ export default {
    -
    +

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    @@ -381,12 +424,12 @@ export default {
    -
    - +
    +
    -
    +
    @@ -414,7 +457,7 @@ export default { -
    +
    Zeitwuensche @@ -426,7 +469,7 @@ export default { -
    +
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index 9e04c2c34..370a77a40 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -85,6 +85,7 @@ export default { return { Allgemein: { + View:"MitarbeiterIn", Username: this.data.username, Anrede: this.data.anrede, Titel: this.data.titel, @@ -205,14 +206,15 @@ export default {
    - -
    -
    MitarbeiterIn
    -
    + -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    +
    + +
    {{wert}}
    +
    diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 147ab5d34..0eaf820d4 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -73,7 +73,7 @@ export default { return { Allgemein: { - + View:"StudentIn", Username: this.data.username, Matrikelnummer: this.data.matrikelnummer, Anrede: this.data.anrede, @@ -226,14 +226,16 @@ export default {
    - -
    -
    StudentIn
    -
    + -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    +
    + + +
    {{wert}}
    +
    @@ -325,7 +327,7 @@ export default { -
    +

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 216ddcbfd..2834fdbcd 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -39,6 +39,7 @@ export default { return { Allgemein: { + View:"StudentIn", Username: this.data.username, Matrikelnummer: this.data.matrikelnummer, Anrede: this.data.anrede, @@ -161,14 +162,16 @@ export default {
    - -
    -
    StudentIn
    -
    + + -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    +
    + +
    {{wert}}
    +
    From 058863ba8db882fe24db0d3331d2bfef3745bed1 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Wed, 13 Dec 2023 11:22:47 +0100 Subject: [PATCH 046/201] fix for show/hide all collapsed columns icon function, weird bug where collapsed columns icons don't work on first click --- .../Cis/Profil/MitarbeiterProfil.js | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 0db26f157..0f672a005 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -6,6 +6,8 @@ let customEvents = [{event: "headerClick", handler:function(e,column){ console.log(column); }}] +let showCollapsedColumn= true; + export default { components: { @@ -14,7 +16,7 @@ export default { data() { return { - showCollapsedColumn: true, + funktionen_table_options: { height:300, layout:"fitColumns", @@ -39,7 +41,7 @@ export default { headerSort: false, headerFilter:false, formatter:"responsiveCollapse", - maxWidth:20, + maxWidth:40, }, { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true,minWidth:200, }, { @@ -172,11 +174,15 @@ export default { this.$refs.funktionenTable.tabulator.on("headerClick", function(e, column){ - this.showCollapsedColumn = !this.showCollapsedColumn; + //* update the reactive data + console.log(showCollapsedColumn); + showCollapsedColumn = !showCollapsedColumn; + console.log(showCollapsedColumn); + if(column._column.field == "collapse"){ //* changes the icon that shows or hides all the collapsed columns - if(this.showCollapsedColumn){ + if(showCollapsedColumn){ document.getElementById("collapseIcon").classList.replace("fa-angle-up","fa-angle-down"); }else{ document.getElementById("collapseIcon").classList.replace("fa-angle-down","fa-angle-up"); @@ -184,25 +190,24 @@ export default { //* changes the icon for every collapsed column to open or closed [...document.getElementsByClassName("tabulator-responsive-collapse-toggle")].forEach(ele => { - if(this.showCollapsedColumn){ - ele.classList.replace("close","open"); + if(showCollapsedColumn){ + ele.classList.add("open"); }else{ - ele.classList.replace("open","close"); + ele.classList.remove("open") } }); //* hides or shows the collapsed columns [...document.getElementsByClassName("tabulator-responsive-collapse")].forEach(ele => { - if(this.showCollapsedColumn){ + if(showCollapsedColumn){ ele.style.display="" }else{ ele.style.display="none" } - }); - + } }); From b400ea758c578c61725097fcf830bb55d989dce6 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Wed, 13 Dec 2023 12:54:44 +0100 Subject: [PATCH 047/201] fixing the hide/show all collapsed table columns function by calling the click event instead of changing the classes and styles manually --- .../Cis/Profil/MitarbeiterProfil.js | 48 +++++++++---------- .../Cis/Profil/MitarbeiterViewProfil.js | 6 +-- .../js/components/Cis/Profil/StudentProfil.js | 6 +-- .../Cis/Profil/StudentViewProfil.js | 6 +-- 4 files changed, 31 insertions(+), 35 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 0f672a005..9cd334431 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -190,23 +190,19 @@ export default { //* changes the icon for every collapsed column to open or closed [...document.getElementsByClassName("tabulator-responsive-collapse-toggle")].forEach(ele => { - if(showCollapsedColumn){ - ele.classList.add("open"); - - }else{ - ele.classList.remove("open") - } - }); - - //* hides or shows the collapsed columns - [...document.getElementsByClassName("tabulator-responsive-collapse")].forEach(ele => { if(showCollapsedColumn){ - ele.style.display="" - + if(!ele.classList.contains("open")) + ele.click(); }else{ - ele.style.display="none" + if(ele.classList.contains("open")) + ele.click(); } - }); + + + }); + + + } @@ -219,13 +215,13 @@ export default { -
    +
    -
    +

    From 91781d3a38d299f17d4aea673253ef10981a25c4 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Wed, 13 Dec 2023 15:56:24 +0100 Subject: [PATCH 053/201] adds cards to the main information of the mitarbeiter profil view --- .../Cis/Profil/MitarbeiterProfil.js | 56 +++++++++++++------ 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index d65c320bb..2d4e2b4d8 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -309,22 +309,30 @@ export default {
    +
    + +
    - -
    + +
    -
    -
    {{wert}}
    - -
    - - -
    +
    +
    {{wert}}
    + +
    + + +
    + +
    +
    + + @@ -337,7 +345,9 @@ export default {
    - +
    + +
    @@ -390,7 +400,8 @@ export default {
    - +
    +
    @@ -457,13 +468,26 @@ export default { -
    +
    -
    + + + + + +
    From 98006b3d2be7afea876fde6f998ef3f6431ac744 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Thu, 14 Dec 2023 09:19:07 +0100 Subject: [PATCH 054/201] puts hidden quick links in card --- .../components/Cis/Profil/MitarbeiterProfil.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 2d4e2b4d8..f0e437ee9 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -223,9 +223,14 @@ export default {

    - +

    From 1d75a26230e863ead48dad1645963b0df47bd61d Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Fri, 15 Dec 2023 14:40:56 +0100 Subject: [PATCH 055/201] responsive layout --- public/css/components/Profil.css | 18 + public/js/apps/Cis/Profil.js | 5 +- public/js/components/Cis/Profil/Base.js | 837 +++++++++++++----- .../Cis/Profil/MitarbeiterProfil.js | 9 +- 4 files changed, 640 insertions(+), 229 deletions(-) diff --git a/public/css/components/Profil.css b/public/css/components/Profil.css index 2ae004c9f..f5a3eec6e 100644 --- a/public/css/components/Profil.css +++ b/public/css/components/Profil.css @@ -28,6 +28,24 @@ padding:0 !important; } +.form-control_{ + border:0; + border-bottom: 1px solid #ced4da; + height:auto !important; + padding-bottom: 5px !important; + padding-left: 3px !important; + border-radius:0px; +} + +.form-control-plaintext[readonly]{ + background-color:white; +} + +.form-control:focus{ + border-color:white; + box-shadow:none; +} + /* dl { width: 100%; overflow: hidden; diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index eec4f9960..8c3727401 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -11,10 +11,12 @@ Vue.$collapseFormatter = function(data){ //data - an array of objects containing the column title and value for each cell var container = document.createElement("div"); container.classList.add("tabulator-collapsed-row"); + container.classList.add("text-break"); var list = document.createElement("div"); list.classList.add("row"); + container.appendChild(list); data.forEach(function(col){ @@ -74,9 +76,10 @@ const app = Vue.createApp({
    +

    Es wurden keine oder mehrere Profile für {{this.notFoundUID}} gefunden

    - +
    ` diff --git a/public/js/components/Cis/Profil/Base.js b/public/js/components/Cis/Profil/Base.js index 10ff32739..547b6da57 100644 --- a/public/js/components/Cis/Profil/Base.js +++ b/public/js/components/Cis/Profil/Base.js @@ -7,9 +7,14 @@ export default { }, data() { return { + collapseIconFunktionen: true, + collapseIconBetriebsmittel: true, funktionen_table_options: { height: 300, layout: "fitColumns", + responsiveLayout: "collapse", + responsiveLayoutCollapseUseFormatters: false, + responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, data: [ { Bezeichnung: "", @@ -20,42 +25,88 @@ export default { }, ], columns: [ - { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true }, + //? option when wanting to hide the collapsed list + + { + title: + "", + field: "collapse", + headerSort: false, + headerFilter: false, + formatter: "responsiveCollapse", + maxWidth: 40, + headerClick: this.collapseFunction, + }, + { + title: "Bezeichnung", + field: "Bezeichnung", + headerFilter: true, + minWidth: 200, + }, { title: "Organisationseinheit", field: "Organisationseinheit", headerFilter: true, + minWidth: 200, + }, + { + title: "Gültig_von", + field: "Gültig_von", + headerFilter: true, + resizable: true, + minWidth: 200, + }, + { + title: "Gültig_bis", + field: "Gültig_bis", + headerFilter: true, + resizable: true, + minWidth: 200, }, - { title: "Gültig_von", field: "Gültig_von", headerFilter: true }, - { title: "Gültig_bis", field: "Gültig_bis", headerFilter: true }, { title: "Wochenstunden", field: "Wochenstunden", headerFilter: true, + minWidth: 200, }, ], }, betriebsmittel_table_options: { height: 300, layout: "fitColumns", - data: [ - { - betriebsmittel: "test", - Nummer: "", - Ausgegeben_am: "", - }, - ], + responsiveLayout: "collapse", + responsiveLayoutCollapseUseFormatters: false, + responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, + data: [{ betriebsmittel: "", Nummer: "", Ausgegeben_am: "" }], columns: [ + { + title: + "", + field: "collapse", + headerSort: false, + headerFilter: false, + formatter: "responsiveCollapse", + maxWidth: 40, + headerClick: this.collapseFunction, + }, { title: "Betriebsmittel", field: "betriebsmittel", headerFilter: true, + minWidth: 200, + }, + { + title: "Nummer", + field: "Nummer", + headerFilter: true, + resizable: true, + minWidth: 200, }, - { title: "Nummer", field: "Nummer", headerFilter: true }, { title: "Ausgegeben_am", field: "Ausgegeben_am", headerFilter: true, + minWidth: 200, }, ], }, @@ -65,15 +116,52 @@ export default { //? this is the prop passed to the dynamic component with the custom data of the view props: ["data"], methods: { - sperre_foto_function(value) { + sperre_foto_function() { if (!this.data) { return; } - fhcapifactory.UserData.sperre_foto_function(value).then((res) => { + fhcapifactory.UserData.sperre_foto_function(!this.data.foto_sperre).then((res) => { this.data.foto_sperre = res.data.foto_sperre; }); }, + collapseFunction(e, column) { + //* the if of the column has to match with the name of the responsive data in the vue component + this[e.target.id] = !this[e.target.id]; + + //* gets all event icons of the different rows to use the onClick event later + let allClickableIcons = column._column.cells.map((row) => { + return row.element.children[0]; + }); + + //* changes the icon that shows or hides all the collapsed columns + //* if the replace function does not find the class to replace, it just simply returns false + if (this[e.target.id]) { + e.target.classList.replace("fa-angle-up", "fa-angle-down"); + } else { + e.target.classList.replace("fa-angle-down", "fa-angle-up"); + } + + //* changes the icon for every collapsed column to open or closed + if (this[e.target.id]) { + allClickableIcons + .filter((column) => { + return !column.classList.contains("open"); + }) + .forEach((col) => { + col.click(); + }); + } else { + allClickableIcons + .filter((column) => { + return column.classList.contains("open"); + }) + .forEach((col) => { + col.click(); + }); + } + }, }, + computed: { refreshMailTo() { return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]`; @@ -92,29 +180,64 @@ export default { } return { - Allgemein: { - Username: this.data.username, - Anrede: this.data.anrede, - Titel: this.data.titel, - Vorname: this.data.vorname, - Nachname: this.data.nachname, - Postnomen: this.data.postnomen, - Geburtsdatum: this.data.gebdatum, - Geburtsort: this.data.gebort, - Kurzzeichen: this.data.kurzbz, - Telefon: this.data.telefonklappe, - Büro: this.data.ort_kurzbz, - FhAusweisStatus: this.data.zutrittsdatum, - }, + Username: this.data.username, + Anrede: this.data.anrede, + Titel: this.data.titel, + Postnomen: this.data.postnomen, }; }, - //? this computed function returns the data for the second column in the profil + + personKontakt() { + if (!this.data) { + return {}; + } + + return { + emails: this.data.emails, + + }; + }, + + specialData() { + if (!this.data) { + return {}; + } + + return { + Geburtsdatum: this.data.gebdatum, + Geburtsort: this.data.gebort, + Kurzzeichen: this.data.kurzbz, + Telefon: this.data.telefonklappe, + Büro: this.data.ort_kurzbz, + }; + }, + + privateKontakte() { + if (!this.data) { + return {}; + } + + return this.data.kontakte; + + }, + + privateAdressen() { + if (!this.data) { + return {}; + } + + return this.data.adressen; + + }, + + kontaktInfo() { if (!this.data) { return {}; } return { + FhAusweisStatus: this.data.zutrittsdatum, emails: this.data.emails, Kontakte: this.data.kontakte, Adressen: this.data.adressen, @@ -132,221 +255,489 @@ export default { }); }, - template: ` - -
    - -
    - -
    + template: ` + +
    + +
    + +
    + + + +
    + + + +
    + + +
    +
    +
    + Der FH Ausweis ist am {{data.zutrittsdatum}} ausgegeben worden. +
    +
    +
    + +
    + + + +
    + + + + + + +
    + + + + + + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + MitarbeiterIn +
    +
    + - - -
    -
    - -
    -
    - - - - -
    - - - - - -
    - -
    - -
    - -
    - - - - -
    - - - - -
    - - - - -
    + +
    - -
    -
    -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    -
    -
    -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -
    -
    - - - - -
    - - - -
    - - - - - - -
    -
    -
    -
    {{bez}}
    -
    {{wert?wert:"-"}}
    -
    -
    -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -
    -
    - - - - - -
    - - - - - -
    - - - -
    - -
    - - -
    -
    -

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    -
    -
    - - - - - -
    - - -
    - -
    - - -
    - -
    - - -
    - - - - - - - - -
    - - - - - -
    - - - - - - - - - - - -
    + + +
    +
    +
    + + + + +
    + -
    - - - -
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    -
    - -
    {{verteiler.beschreibung}}
    -
    - - - -
    - -
    - -
    +
    + +
    + + + + + +
    +
    +
    +
    + + + +
    +
    +
    +
    + + + +
    +
    +
    + + +
    + + + + + + + + +
    +
    + + + +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    + +
    + +
    + Mitarbeiter Information +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    + +
    + +
    + - + +
    + + + + + + + + + + + + +
    + +
    +
    +
    + + +
    +
    + Mails +
    + +
    + + + +
    + + + + + + +
    +
    +
    + + + +
    +
    +
    + + + + + + + + + +
    + + +
    +
    +
    + + +
    +
    +
    +
    + Private Kontakte +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    + + +
    +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    Private Adressen
    +
    + +
    + +
    + + + +
    +
    +
    + + +
    +
    + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    + + + + + +
    + + + + + + +
    + + + + +
    +
    +

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    +
    + + + + + + +
    + + +
    + +
    + + +
    + +
    + + +
    + + + + + + + + +
    + + + + + +
    + + + + + + + +
    +
    + +
    +
    + Quick Links +
    + +
    + + + + +
    +
    + + + +
    - -
    +
    + + + + +
    +
    + Mailverteilers +
    +
    + +
    Sie sind Mitgglied in folgenden Verteilern:
    +
    +
    +
    +
    + + + +
    + +
    + +
    +
    {{verteiler.beschreibung}}
    +
    + +
    +
    + + + + + +
    + + +
    + + +
    + + + + + + + + +
    + + +
    `, }; diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index f0e437ee9..a4a008fe2 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -212,8 +212,6 @@ export default { template: ` - -
    @@ -319,7 +317,7 @@ export default {
    -
    +
    @@ -330,10 +328,11 @@ export default {
    {{wert?wert:"-"}}
    - -
    + + +
    From fa3d9e1e05ab6217cf30ec267dbe96afc1410640 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 18 Dec 2023 12:13:03 +0100 Subject: [PATCH 056/201] layout changes --- public/js/apps/Cis/Profil.js | 2 +- public/js/components/Cis/Profil/Base.js | 2 +- .../Cis/Profil/MitarbeiterProfil.js | 666 ++++++++++++------ .../Cis/Profil/MitarbeiterViewProfil.js | 418 ++++++++--- 4 files changed, 738 insertions(+), 350 deletions(-) diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index 8c3727401..5eac4db58 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -79,7 +79,7 @@ const app = Vue.createApp({

    Es wurden keine oder mehrere Profile für {{this.notFoundUID}} gefunden

    - +
    ` diff --git a/public/js/components/Cis/Profil/Base.js b/public/js/components/Cis/Profil/Base.js index 547b6da57..ce6ca16f5 100644 --- a/public/js/components/Cis/Profil/Base.js +++ b/public/js/components/Cis/Profil/Base.js @@ -491,7 +491,7 @@ export default {
    - + {{email.email}}
    diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index a4a008fe2..ce6ca16f5 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -1,27 +1,20 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; - - - - - export default { components: { CoreFilterCmpt, }, data() { return { - collapseIconFunktionen: true, collapseIconBetriebsmittel: true, funktionen_table_options: { - - height:300, - layout:"fitColumns", - responsiveLayout:"collapse", - responsiveLayoutCollapseUseFormatters:false, - responsiveLayoutCollapseFormatter:Vue.$collapseFormatter, + height: 300, + layout: "fitColumns", + responsiveLayout: "collapse", + responsiveLayoutCollapseUseFormatters: false, + responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, data: [ { Bezeichnung: "", @@ -32,118 +25,146 @@ export default { }, ], columns: [ - //? option when wanting to hide the collapsed list - - { - title: "", + //? option when wanting to hide the collapsed list + + { + title: + "", field: "collapse", headerSort: false, - headerFilter:false, - formatter:"responsiveCollapse", - maxWidth:40, - headerClick:this.collapseFunction, - }, - { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true,minWidth:200, }, + headerFilter: false, + formatter: "responsiveCollapse", + maxWidth: 40, + headerClick: this.collapseFunction, + }, + { + title: "Bezeichnung", + field: "Bezeichnung", + headerFilter: true, + minWidth: 200, + }, { title: "Organisationseinheit", field: "Organisationseinheit", - headerFilter: true,minWidth:200, - + headerFilter: true, + minWidth: 200, + }, + { + title: "Gültig_von", + field: "Gültig_von", + headerFilter: true, + resizable: true, + minWidth: 200, + }, + { + title: "Gültig_bis", + field: "Gültig_bis", + headerFilter: true, + resizable: true, + minWidth: 200, }, - { title: "Gültig_von", field: "Gültig_von", headerFilter: true, resizable:true,minWidth:200, }, - { title: "Gültig_bis", field: "Gültig_bis", headerFilter: true, resizable:true,minWidth:200, }, { title: "Wochenstunden", field: "Wochenstunden", headerFilter: true, - minWidth:200, + minWidth: 200, }, - ], }, betriebsmittel_table_options: { - - height:300, + height: 300, layout: "fitColumns", - responsiveLayout:"collapse", - responsiveLayoutCollapseUseFormatters:false, - responsiveLayoutCollapseFormatter:Vue.$collapseFormatter, + responsiveLayout: "collapse", + responsiveLayoutCollapseUseFormatters: false, + responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, data: [{ betriebsmittel: "", Nummer: "", Ausgegeben_am: "" }], columns: [ { - title: "", + title: + "", field: "collapse", headerSort: false, - headerFilter:false, - formatter:"responsiveCollapse", - maxWidth:40, - headerClick:this.collapseFunction, - }, + headerFilter: false, + formatter: "responsiveCollapse", + maxWidth: 40, + headerClick: this.collapseFunction, + }, { title: "Betriebsmittel", field: "betriebsmittel", headerFilter: true, - minWidth:200, + minWidth: 200, + }, + { + title: "Nummer", + field: "Nummer", + headerFilter: true, + resizable: true, + minWidth: 200, }, - { title: "Nummer", field: "Nummer", headerFilter: true, resizable:true, minWidth:200, }, { title: "Ausgegeben_am", field: "Ausgegeben_am", headerFilter: true, - minWidth:200, + minWidth: 200, }, ], }, - }; }, - //? this is the prop passed to the dynamic component with the custom data of the view + //? this is the prop passed to the dynamic component with the custom data of the view props: ["data"], methods: { - - sperre_foto_function(value) { + sperre_foto_function() { if (!this.data) { return; } - fhcapifactory.UserData.sperre_foto_function(value).then((res) => { + fhcapifactory.UserData.sperre_foto_function(!this.data.foto_sperre).then((res) => { this.data.foto_sperre = res.data.foto_sperre; }); }, - collapseFunction (e, column){ - + collapseFunction(e, column) { //* the if of the column has to match with the name of the responsive data in the vue component this[e.target.id] = !this[e.target.id]; //* gets all event icons of the different rows to use the onClick event later - let allClickableIcons = column._column.cells.map(row => { + let allClickableIcons = column._column.cells.map((row) => { return row.element.children[0]; }); - + //* changes the icon that shows or hides all the collapsed columns //* if the replace function does not find the class to replace, it just simply returns false - if(this[e.target.id]){ - e.target.classList.replace("fa-angle-up","fa-angle-down"); - }else{ - e.target.classList.replace("fa-angle-down","fa-angle-up"); + if (this[e.target.id]) { + e.target.classList.replace("fa-angle-up", "fa-angle-down"); + } else { + e.target.classList.replace("fa-angle-down", "fa-angle-up"); } - + //* changes the icon for every collapsed column to open or closed - if(this[e.target.id]){ - allClickableIcons.filter(column => { + if (this[e.target.id]) { + allClickableIcons + .filter((column) => { return !column.classList.contains("open"); - }).forEach(col => {col.click();}) - }else{ - allClickableIcons.filter(column => { + }) + .forEach((col) => { + col.click(); + }); + } else { + allClickableIcons + .filter((column) => { return column.classList.contains("open"); - }).forEach(col => {col.click();}) - } + }) + .forEach((col) => { + col.click(); + }); + } + }, }, - }, - + computed: { refreshMailTo() { - return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]` + return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]`; }, get_image_base64_src() { @@ -152,39 +173,70 @@ export default { } return "data:image/jpeg;base64," + this.data.foto; }, - //? this computed function returns all the informations for the first column in the profil + //? this computed function returns all the informations for the first column in the profil personData() { if (!this.data) { return {}; } return { - Allgemein: { - - View:"MitarbeiterIn", - Username: this.data.username, - Anrede: this.data.anrede, - Titel: this.data.titel, - Vorname: this.data.vorname, - Nachname: this.data.nachname, - Postnomen: this.data.postnomen, - Geburtsdatum: this.data.gebdatum, - Geburtsort: this.data.gebort, - Kurzzeichen: this.data.kurzbz, - Telefon: this.data.telefonklappe, - Büro:this.data.ort_kurzbz, - - }, + Username: this.data.username, + Anrede: this.data.anrede, + Titel: this.data.titel, + Postnomen: this.data.postnomen, }; }, - //? this computed function returns the data for the second column in the profil + + personKontakt() { + if (!this.data) { + return {}; + } + + return { + emails: this.data.emails, + + }; + }, + + specialData() { + if (!this.data) { + return {}; + } + + return { + Geburtsdatum: this.data.gebdatum, + Geburtsort: this.data.gebort, + Kurzzeichen: this.data.kurzbz, + Telefon: this.data.telefonklappe, + Büro: this.data.ort_kurzbz, + }; + }, + + privateKontakte() { + if (!this.data) { + return {}; + } + + return this.data.kontakte; + + }, + + privateAdressen() { + if (!this.data) { + return {}; + } + + return this.data.adressen; + + }, + + kontaktInfo() { if (!this.data) { return {}; } return { - FhAusweisStatus: this.data.zutrittsdatum, emails: this.data.emails, Kontakte: this.data.kontakte, @@ -194,24 +246,17 @@ export default { }, mounted() { - this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { - - this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); - - }) + this.$refs.betriebsmittelTable.tabulator.on("tableBuilt", () => { + this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); + }); - this.$refs.funktionenTable.tabulator.on('tableBuilt', () => { - + this.$refs.funktionenTable.tabulator.on("tableBuilt", () => { this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); - - - }) + }); }, - template: ` -
    @@ -247,168 +292,173 @@ export default { +
    + + +
    +
    +
    + Der FH Ausweis ist am {{data.zutrittsdatum}} ausgegeben worden. +
    +
    +
    + +
    +
    -
    - -
    - - - -
    -
    - -
    -
    - - - - - - - - -
    -
    - - - -
    -

    Profilfoto gesperrt

    - Sperre des Profilfotos aufheben -
    - - Profilfoto sperren - - - - -
    -
    - - - - - - - - -
    - - - - -
    + -
    +
    - -
    + + + + + + + + + + + + + + + +
    +
    +
    +
    - +
    + MitarbeiterIn +
    -
    - - -
    -
    {{wert}}
    - -
    -
    - +
    + + + + + +
    +
    +
    + + + + +
    + + + +
    +
    +
    + +
    + + + + + +
    +
    +
    +
    + + + +
    +
    +
    +
    + + + +
    +
    +
    + + +
    + + + + + + + + +
    +
    + + + +
    +
    + + +
    + + +
    - - +
    +
    +
    + + +
    + +
    + +
    + Mitarbeiter Information +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    + +
    + +
    - +
    - -
    - - -
    + -
    - -
    - - -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -
    - - - - -
    -
    eMail
    -
    -
    {{email.type}}: {{email.email}}
    -
    -
    - - - -
    -
    Private Kontakte
    -
    -
    -
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    -
    {{element?.anmerkung}}
    -
    - - -
    -
    -
    -
    - - - - -
    -
    Adressen
    -
    -
    - {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}} -
    -
    -
    - -
    - - -
    -
    - - -
    + @@ -416,9 +466,143 @@ export default {
    +
    +
    +
    - -
    + +
    +
    + Mails +
    + +
    + + + +
    + + + + + + +
    +
    +
    + + {{email.email}} + + +
    +
    +
    + + + + + + + + + +
    + + +
    +
    +
    + + +
    +
    +
    +
    + Private Kontakte +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    + + +
    +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    Private Adressen
    +
    + +
    + +
    + + + +
    +
    +
    + + +
    +
    + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    + + + + + +
    + + + + +
    @@ -426,7 +610,7 @@ export default {
    -
    +

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    @@ -439,12 +623,12 @@ export default {
    -
    +
    -
    +
    @@ -511,9 +695,21 @@ export default {
    Sie sind Mitgglied in folgenden Verteilern:
    -
    - -
    {{verteiler.beschreibung}}
    +
    +
    +
    +
    + + + +
    + +
    + +
    +
    {{verteiler.beschreibung}}
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index 01e5fe9b5..d4b289c4e 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -115,36 +115,38 @@ export default { } return { - Allgemein: { - View:"MitarbeiterIn", - Username: this.data.username, - Anrede: this.data.anrede, - Titel: this.data.titel, - Vorname: this.data.vorname, - Nachname: this.data.nachname, - Postnomen: this.data.postnomen, - }, - - - SpecialInformation: { - Kurzzeichen: this.data.kurzbz, - Telefon: this.data.telefonklappe, - Büro:this.data.ort_kurzbz, - }, + Username: this.data.username, + Anrede: this.data.anrede, + Titel: this.data.titel, + Postnomen: this.data.postnomen, }; }, - //? this computed function returns the data for the second column in the profil - kontaktInfo() { + + personKontakt() { + if (!this.data) { + return {}; + } + + return { + emails: this.data.emails, + + }; + }, + + specialData() { if (!this.data) { return {}; } return { - emails: this.data.emails, - + Kurzzeichen: this.data.kurzbz, + Telefon: this.data.telefonklappe, + Büro: this.data.ort_kurzbz, }; }, + + }, mounted() { @@ -159,21 +161,25 @@ export default { }, template: ` + - - -
    +
    -
    +

    - +

    @@ -187,105 +193,178 @@ export default {
    +
    +
    + + +
    +
    +
    + Der FH Ausweis ist am {{data.zutrittsdatum}} ausgegeben worden. +
    +
    +
    + +
    +
    -
    - -
    - - - - - - - -
    -
    - -
    -
    - - - - - - - - -
    - - - - -
    + -
    +
    - -
    -
    + + + + + + + + + + + + + +
    +
    +
    + +
    +
    + MitarbeiterIn +
    +
    + + -
    - -
    {{wert}}
    - + + +
    + + + + + + +
    +
    +
    + + + + +
    + + +
    +
    +
    + +
    + + + + + +
    +
    +
    +
    - -
    + + +
    +
    +
    +
    + + + +
    +
    +
    + + +
    + - + + + + +
    +
    + + + +
    +
    + +
    - -
    - - - - - - -
    - - - - -
    -
    eMail
    -
    -
    {{email.type}}: {{email.email}}
    -
    -
    - - -
    - - - - -
    +
    +
    +
    +
    + + +
    + +
    + +
    + Mitarbeiter Information +
    +
    +
    +
    +
    + + +
    +
    +
    + +
    + +
    + +
    + + + + + +
    + + + + + + + @@ -293,21 +372,98 @@ export default {
    +
    +
    +
    - -
    + +
    +
    + Mails +
    + +
    + + + +
    + + + + + + +
    +
    +
    + + {{email.email}} + + +
    +
    +
    + + + + + + + + + +
    + + +
    +
    +
    + + + + +
    +
    +
    +
    + + + + + +
    + + + + +
    + +
    +
    +

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    +
    +
    + + + +
    -
    - +
    + +
    + + +
    +
    @@ -334,34 +490,69 @@ export default { -
    +
    -
    +
    -
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    -
    - -
    {{verteiler.beschreibung}}
    +
    +
    + Mailverteilers +
    +
    + +
    Sie sind Mitgglied in folgenden Verteilern:
    +
    +
    +
    +
    + + + +
    + +
    + +
    +
    {{verteiler.beschreibung}}
    +
    + +
    + +
    @@ -381,6 +572,7 @@ export default {
    - + + `, }; From 5fbe374ea323574f11d9eaab4038989793878a39 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 18 Dec 2023 12:21:17 +0100 Subject: [PATCH 057/201] removes the p-4 for all screensizes from the cis-main and adds different padding for mobile view Cis-main in Cis.css --- application/views/templates/CISHTML-Header.php | 2 +- public/css/Cis4/Cis.css | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/application/views/templates/CISHTML-Header.php b/application/views/templates/CISHTML-Header.php index 71f268112..838b242c2 100644 --- a/application/views/templates/CISHTML-Header.php +++ b/application/views/templates/CISHTML-Header.php @@ -62,4 +62,4 @@ if (!isset($menu)) { -
    +
    diff --git a/public/css/Cis4/Cis.css b/public/css/Cis4/Cis.css index 6e987b92c..7120d60f7 100644 --- a/public/css/Cis4/Cis.css +++ b/public/css/Cis4/Cis.css @@ -285,6 +285,9 @@ html { } /* mobile */ @media (max-width: 991.98px) { + #cis-main{ + padding: 0.75rem 0.75rem; + } #cis-main > :first-child { margin-top: var(--fhc-cis-header-height); } From 8b06ef030af955e1f549a0a961fecd4595a7a8cb Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Mon, 18 Dec 2023 15:27:45 +0100 Subject: [PATCH 058/201] adds icons and some layout changes --- .../Cis/Profil/MitarbeiterProfil.js | 115 +++++++++++------- .../Cis/Profil/MitarbeiterViewProfil.js | 11 -- 2 files changed, 68 insertions(+), 58 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index ce6ca16f5..a64016556 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -292,22 +292,11 @@ export default { -
    - - -
    -
    -
    - Der FH Ausweis ist am {{data.zutrittsdatum}} ausgegeben worden. -
    -
    -
    - -
    + -
    +
    @@ -381,15 +370,15 @@ export default {
    - - + +
    - - + +
    @@ -407,8 +396,8 @@ export default {
    - - + +
    @@ -435,8 +424,8 @@ export default {
    - - + +
    @@ -487,13 +476,21 @@ export default { -
    +
    + +
    +
    + + + +
    +
    - - {{email.email}} - - + {{email.email}} + +
    +
    @@ -523,20 +520,22 @@ export default {
    - -
    +
    + +
    +
    -
    +
    -
    +
    @@ -557,34 +556,37 @@ export default {
    -
    + +
    -
    +
    - - + +
    +
    + -
    +
    - - + +
    -
    +
    - - + +
    -
    +
    - - + +
    @@ -648,7 +650,7 @@ export default { -
    +
    @@ -679,6 +681,25 @@ export default {
    +
    + + +
    + + + +
    +
    + Der FH Ausweis ist am {{data.zutrittsdatum}} ausgegeben worden. +
    + +
    + + +
    + +
    +
    @@ -698,18 +719,18 @@ export default {
    - -
    {{verteiler.beschreibung}}
    +
    {{verteiler.beschreibung}}
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index d4b289c4e..88fd2caab 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -198,18 +198,7 @@ export default { -
    - -
    -
    -
    - Der FH Ausweis ist am {{data.zutrittsdatum}} ausgegeben worden. -
    -
    -
    - -
    From a3e70afdc1d9c98021c4c871d3ddbc664838f558 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 19 Dec 2023 11:01:51 +0100 Subject: [PATCH 059/201] adds font-size 1rem to the .tabulator class of the FilterComponent --- public/css/components/FilterComponent.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/css/components/FilterComponent.css b/public/css/components/FilterComponent.css index cd0b33a48..1a6698890 100644 --- a/public/css/components/FilterComponent.css +++ b/public/css/components/FilterComponent.css @@ -64,3 +64,7 @@ margin-top: 20px; } +.tabulator{ + font-size:1rem; +} + From 030be5b83f559337b7b2cce228f93443357ffa6e Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 19 Dec 2023 11:02:44 +0100 Subject: [PATCH 060/201] queryies the telefon number of the mitarbeiter with standort and adds tel links to all phone numbers --- application/controllers/Cis/Profil.php | 43 +++++++++++++++- .../Cis/Profil/MitarbeiterProfil.js | 51 +++++++++++++------ 2 files changed, 77 insertions(+), 17 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index a5640d916..d2618274d 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -128,6 +128,21 @@ class Profil extends Auth_Controller } } + //? querying the telefon number of the office + if(isSuccess($this->MitarbeiterModel->addSelect(["mitarbeiter_uid"])) && + isSuccess($this->MitarbeiterModel->addJoin("tbl_kontakt", "tbl_mitarbeiter.standort_id = tbl_kontakt.standort_id")) + + + ){ + $this->MitarbeiterModel->addLimit(1); + $telefon_res = $this->MitarbeiterModel->loadWhere(["mitarbeiter_uid"=>$this->uid, "kontakttyp"=>"telefon"]); + if(isError($telefon_res)){ + // error handling + }else{ + $telefon_res = hasData($telefon_res)? getData($telefon_res)[0] : null; + } + } + $res = new stdClass(); $res->username = $uid; @@ -163,6 +178,8 @@ class Profil extends Auth_Controller //? Mailverteiler Info $res->mailverteiler = $mailverteiler_res; + + $res->standort_telefon = $telefon_res; return $res; @@ -301,6 +318,9 @@ class Profil extends Auth_Controller } + + //$this->MitarbeiterModel->load($this->uid); + //? FH Ausweis Austellungsdatum soll auch nur der user selbst sehen $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid($this->uid,"Zutrittskarte"); if(isError($zutrittskarte_ausgegebenam)){ @@ -378,10 +398,28 @@ class Profil extends Auth_Controller } + //? querying the telefon number of the office + if(isSuccess($this->MitarbeiterModel->addSelect(["mitarbeiter_uid"])) && + isSuccess($this->MitarbeiterModel->addJoin("tbl_kontakt", "tbl_mitarbeiter.standort_id = tbl_kontakt.standort_id")) + + + ){ + $this->MitarbeiterModel->addLimit(1); + $telefon_res = $this->MitarbeiterModel->loadWhere(["mitarbeiter_uid"=>$this->uid, "kontakttyp"=>"telefon"]); + if(isError($telefon_res)){ + // error handling + }else{ + $telefon_res = hasData($telefon_res)? getData($telefon_res)[0] : null; + } + } + + + - if(isSuccess($this->MitarbeiterModel->addSelect(["kurzbz","telefonklappe", "alias","ort_kurzbz"])) + if(isSuccess($this->MitarbeiterModel->addSelect(["kurzbz","tbl_mitarbeiter.telefonklappe", "alias","ort_kurzbz"])) && isSuccess($this->MitarbeiterModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid")) + ){ $mitarbeiter_res = $this->MitarbeiterModel->load($this->uid); if(isError($mitarbeiter_res)){ @@ -426,6 +464,9 @@ class Profil extends Auth_Controller $res->emails = array($intern_email,$extern_email); $res->funktionen = $benutzer_funktion_res; + + //telefon nummer von dem Standort + $res->standort_telefon = $telefon_res; return $res; } diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index a64016556..6a858bb32 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -173,6 +173,14 @@ export default { } return "data:image/jpeg;base64," + this.data.foto; }, + + get_mitarbeiter_standort_telefon(){ + if(this.data.standort_telefon){ + return "tel:"+ this.data.telefonklappe + this.data.standort_telefon; + }else{ + return null; + } + }, //? this computed function returns all the informations for the first column in the profil personData() { if (!this.data) { @@ -207,7 +215,7 @@ export default { Geburtsdatum: this.data.gebdatum, Geburtsort: this.data.gebort, Kurzzeichen: this.data.kurzbz, - Telefon: this.data.telefonklappe, + Telefon: this.data.telefonklappe + (this.data.standort_telefon?this.data.standort_telefon:""), Büro: this.data.ort_kurzbz, }; }, @@ -253,6 +261,8 @@ export default { this.$refs.funktionenTable.tabulator.on("tableBuilt", () => { this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); }); + + }, template: ` @@ -423,8 +433,14 @@ export default {
    -
    - + + +
    + + {{wert?wert:''}} + + +
    @@ -480,7 +496,7 @@ export default {
    -
    +
    @@ -517,17 +533,26 @@ export default {
    Private Kontakte
    -
    +
    -
    - +
    + +
    -
    - + + +
    + {{element.kontakt}}
    + +
    + {{element.kontakt}} + +
    +
    @@ -610,13 +635,7 @@ export default { - -
    -
    -

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    -
    -
    - + From c08171536c2a93762ea8da5acad87645ea312ae6 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 19 Dec 2023 15:34:28 +0100 Subject: [PATCH 061/201] changes the tel and mailto links of all profil views --- application/controllers/Cis/Profil.php | 6 +- .../Cis/Profil/MitarbeiterProfil.js | 36 +- .../Cis/Profil/MitarbeiterViewProfil.js | 249 +++--- .../js/components/Cis/Profil/StudentProfil.js | 757 ++++++++++++------ .../Cis/Profil/StudentViewProfil.js | 446 +++++++---- 5 files changed, 978 insertions(+), 516 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index d2618274d..b17022e6e 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -129,13 +129,13 @@ class Profil extends Auth_Controller } //? querying the telefon number of the office - if(isSuccess($this->MitarbeiterModel->addSelect(["mitarbeiter_uid"])) && + if(isSuccess($this->MitarbeiterModel->addSelect(["kontakt"])) && isSuccess($this->MitarbeiterModel->addJoin("tbl_kontakt", "tbl_mitarbeiter.standort_id = tbl_kontakt.standort_id")) ){ $this->MitarbeiterModel->addLimit(1); - $telefon_res = $this->MitarbeiterModel->loadWhere(["mitarbeiter_uid"=>$this->uid, "kontakttyp"=>"telefon"]); + $telefon_res = $this->MitarbeiterModel->loadWhere(["mitarbeiter_uid"=>$uid, "kontakttyp"=>"telefon"]); if(isError($telefon_res)){ // error handling }else{ @@ -179,7 +179,7 @@ class Profil extends Auth_Controller //? Mailverteiler Info $res->mailverteiler = $mailverteiler_res; - $res->standort_telefon = $telefon_res; + $res->standort_telefon = $telefon_res->kontakt; return $res; diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 6a858bb32..d0ecebc13 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -163,6 +163,7 @@ export default { }, computed: { + //? legacy mailto link to create an email with information that should be changed refreshMailTo() { return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]`; }, @@ -190,7 +191,7 @@ export default { return { Username: this.data.username, Anrede: this.data.anrede, - Titel: this.data.titel, + Titel: this.data.titelpre, Postnomen: this.data.postnomen, }; }, @@ -437,8 +438,11 @@ export default {
    - {{wert?wert:''}} - + + + + + @@ -503,8 +507,10 @@ export default {
    - {{email.email}} - + + + +
    @@ -544,13 +550,25 @@ export default {
    - {{element.kontakt}} - + + + + + + + +
    - {{element.kontakt}} - + + + + + + + +
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index 88fd2caab..1e92108dd 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -1,24 +1,21 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; - export default { components: { CoreFilterCmpt, }, data() { return { - collapseIconFunktionen:true, - + collapseIconFunktionen: true, + funktionen_table_options: { - height: 400, - layout:"fitColumns", - responsiveLayout:"collapse", - responsiveLayoutCollapseUseFormatters:false, - responsiveLayoutCollapseFormatter:Vue.$collapseFormatter, - + height: 300, + layout: "fitColumns", + responsiveLayout: "collapse", + responsiveLayoutCollapseUseFormatters: false, + responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, data: [ - { Bezeichnung: "", Organisationseinheit: "", @@ -28,87 +25,116 @@ export default { }, ], columns: [ - - { - title: "", - field: "collapse", - headerSort: false, - headerFilter:false, - formatter:"responsiveCollapse", - maxWidth:40, - headerClick:this.collapseFunction, - }, - { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true,minWidth:200, }, + //? option when wanting to hide the collapsed list + + { + title: + "", + field: "collapse", + headerSort: false, + headerFilter: false, + formatter: "responsiveCollapse", + maxWidth: 40, + headerClick: this.collapseFunction, + }, + { + title: "Bezeichnung", + field: "Bezeichnung", + headerFilter: true, + minWidth: 200, + }, { title: "Organisationseinheit", field: "Organisationseinheit", - headerFilter: true,minWidth:200, + headerFilter: true, + minWidth: 200, + }, + { + title: "Gültig_von", + field: "Gültig_von", + headerFilter: true, + resizable: true, + minWidth: 200, + }, + { + title: "Gültig_bis", + field: "Gültig_bis", + headerFilter: true, + resizable: true, + minWidth: 200, }, - { title: "Gültig_von", field: "Gültig_von", headerFilter: true, resizable:true,minWidth:200, }, - { title: "Gültig_bis", field: "Gültig_bis", headerFilter: true, resizable:true,minWidth:200, }, { title: "Wochenstunden", field: "Wochenstunden", headerFilter: true, - minWidth:200, + minWidth: 200, }, - ], }, - - + }; }, + //? this is the prop passed to the dynamic component with the custom data of the view props: ["data"], methods: { - - sperre_foto_function(value) { - if (!this.data) { - return; - } - fhcapifactory.UserData.sperre_foto_function(value).then((res) => { - this.data.foto_sperre = res.data.foto_sperre; - }); - }, - collapseFunction (e, column){ - + + collapseFunction(e, column) { //* the if of the column has to match with the name of the responsive data in the vue component this[e.target.id] = !this[e.target.id]; //* gets all event icons of the different rows to use the onClick event later - let allClickableIcons = column._column.cells.map(row => { + let allClickableIcons = column._column.cells.map((row) => { return row.element.children[0]; }); - + //* changes the icon that shows or hides all the collapsed columns //* if the replace function does not find the class to replace, it just simply returns false - if(this[e.target.id]){ - e.target.classList.replace("fa-angle-up","fa-angle-down"); - }else{ - e.target.classList.replace("fa-angle-down","fa-angle-up"); + if (this[e.target.id]) { + e.target.classList.replace("fa-angle-up", "fa-angle-down"); + } else { + e.target.classList.replace("fa-angle-down", "fa-angle-up"); } - + //* changes the icon for every collapsed column to open or closed - if(this[e.target.id]){ - allClickableIcons.filter(column => { + if (this[e.target.id]) { + allClickableIcons + .filter((column) => { return !column.classList.contains("open"); - }).forEach(col => {col.click();}) - }else{ - allClickableIcons.filter(column => { + }) + .forEach((col) => { + col.click(); + }); + } else { + allClickableIcons + .filter((column) => { return column.classList.contains("open"); - }).forEach(col => {col.click();}) - } - }, + }) + .forEach((col) => { + col.click(); + }); + } + }, }, + computed: { + + get_image_base64_src() { if (!this.data) { return ""; } return "data:image/jpeg;base64," + this.data.foto; }, - //? this computed function returns all the informations for the first column in the profil + + get_mitarbeiter_standort_telefon(){ + if(this.data.standort_telefon){ + return "tel:"+ this.data.telefonklappe + this.data.standort_telefon; + }else{ + return null; + } + }, + //? this computed function returns all the informations for the first column in the profil personData() { if (!this.data) { return {}; @@ -117,7 +143,7 @@ export default { return { Username: this.data.username, Anrede: this.data.anrede, - Titel: this.data.titel, + Titel: this.data.titelpre, Postnomen: this.data.postnomen, }; }, @@ -139,29 +165,27 @@ export default { } return { - + Kurzzeichen: this.data.kurzbz, - Telefon: this.data.telefonklappe, + Telefon: this.data.telefonklappe + (this.data.standort_telefon?this.data.standort_telefon:""), Büro: this.data.ort_kurzbz, }; }, - - + + }, mounted() { + + this.$refs.funktionenTable.tabulator.on("tableBuilt", () => { + this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); + }); - this.$refs.funktionenTable.tabulator.on('tableBuilt', () => { - - this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); - - }) - + }, - template: ` - + template: `
    @@ -198,11 +222,11 @@ export default { - + -
    +
    @@ -254,14 +278,7 @@ export default {
    - - - -
    - - - -
    +
    @@ -276,15 +293,15 @@ export default {
    - - + +
    - - + +
    @@ -302,8 +319,8 @@ export default {
    - - + +
    @@ -329,9 +346,16 @@ export default {
    -
    - - + + +
    + + + + + + +
    @@ -382,13 +406,24 @@ export default { -
    +
    + +
    +
    + + + +
    +
    - {{email.email}} - - + + + + +
    +
    @@ -408,14 +443,6 @@ export default {
    - - - -
    -
    -
    -
    - @@ -431,13 +458,7 @@ export default { - -
    -
    -

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    -
    -
    - + @@ -450,10 +471,7 @@ export default {
    - -
    - -
    +
    @@ -471,7 +489,7 @@ export default { -
    +
    @@ -502,6 +520,8 @@ export default {
    + +
    @@ -521,18 +541,18 @@ export default {
    - -
    {{verteiler.beschreibung}}
    +
    {{verteiler.beschreibung}}
    @@ -562,6 +582,5 @@ export default {
    - `, }; diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 42cf4f2da..850d4da68 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -1,182 +1,221 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; - export default { components: { CoreFilterCmpt, }, data() { return { - - - collapseIconBetriebsmittel:true, + + collapseIconBetriebsmittel: true, + zutrittsgruppen_table_options: { + height: 200, + layout: "fitColumns", + data: [{ bezeichnung: "" }], + columns: [{ title: "Zutritt", field: "bezeichnung" }], + }, betriebsmittel_table_options: { height: 300, layout: "fitColumns", - responsiveLayout:"collapse", - responsiveLayoutCollapseUseFormatters:false, - responsiveLayoutCollapseFormatter:Vue.$collapseFormatter, + responsiveLayout: "collapse", + responsiveLayoutCollapseUseFormatters: false, + responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, data: [{ betriebsmittel: "", Nummer: "", Ausgegeben_am: "" }], columns: [ { - title: "", + title: + "", field: "collapse", headerSort: false, - headerFilter:false, - formatter:"responsiveCollapse", - maxWidth:40, - headerClick:this.collapseFunction, - }, + headerFilter: false, + formatter: "responsiveCollapse", + maxWidth: 40, + headerClick: this.collapseFunction, + }, { title: "Betriebsmittel", field: "betriebsmittel", - headerFilter: true, minWidth:200, + headerFilter: true, + minWidth: 200, + }, + { + title: "Nummer", + field: "Nummer", + headerFilter: true, + resizable: true, + minWidth: 200, }, - { title: "Nummer", field: "Nummer", headerFilter: true, resizable:true, minWidth:200, }, { title: "Ausgegeben_am", field: "Ausgegeben_am", headerFilter: true, - minWidth:200, + minWidth: 200, }, ], }, - - zutrittsgruppen_table_options: { - height: 200, - layout: "fitColumns", - data: [{ bezeichnung: "test1" }], - columns: [{ title: "Zutritt", field: "bezeichnung" }], - }, }; }, //? this is the prop passed to the dynamic component with the custom data of the view props: ["data"], methods: { - sperre_foto_function(value) { + sperre_foto_function() { if (!this.data) { return; } - fhcapifactory.UserData.sperre_foto_function(value).then((res) => { + fhcapifactory.UserData.sperre_foto_function(!this.data.foto_sperre).then((res) => { this.data.foto_sperre = res.data.foto_sperre; }); }, - collapseFunction (e, column){ - + collapseFunction(e, column) { //* the if of the column has to match with the name of the responsive data in the vue component this[e.target.id] = !this[e.target.id]; //* gets all event icons of the different rows to use the onClick event later - let allClickableIcons = column._column.cells.map(row => { + let allClickableIcons = column._column.cells.map((row) => { return row.element.children[0]; }); - + //* changes the icon that shows or hides all the collapsed columns //* if the replace function does not find the class to replace, it just simply returns false - if(this[e.target.id]){ - e.target.classList.replace("fa-angle-up","fa-angle-down"); - }else{ - e.target.classList.replace("fa-angle-down","fa-angle-up"); + if (this[e.target.id]) { + e.target.classList.replace("fa-angle-up", "fa-angle-down"); + } else { + e.target.classList.replace("fa-angle-down", "fa-angle-up"); } - + //* changes the icon for every collapsed column to open or closed - if(this[e.target.id]){ - allClickableIcons.filter(column => { + if (this[e.target.id]) { + allClickableIcons + .filter((column) => { return !column.classList.contains("open"); - }).forEach(col => {col.click();}) - }else{ - allClickableIcons.filter(column => { + }) + .forEach((col) => { + col.click(); + }); + } else { + allClickableIcons + .filter((column) => { return column.classList.contains("open"); - }).forEach(col => {col.click();}) - } - }, - }, - computed: { - refreshMailTo() { - return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]` + }) + .forEach((col) => { + col.click(); + }); + } }, + }, + + computed: { + + get_image_base64_src() { if (!this.data) { return ""; } return "data:image/jpeg;base64," + this.data.foto; }, - //? this computed function returns all the informations for the first column in the profil + + + //? this computed function returns all the informations for the first column in the profil personData() { if (!this.data) { return {}; } return { - Allgemein: { - View:"StudentIn", - Username: this.data.username, - Matrikelnummer: this.data.matrikelnummer, - Anrede: this.data.anrede, - Titel: this.data.titel, - Vorname: this.data.vorname, - Nachname: this.data.nachname, - Postnomen: this.data.postnomen, - Geburtsdatum: this.data.gebdatum, - Geburtsort: this.data.gebort, - Studiengang: this.data.studiengang, - Semester: this.data.semester, - Verband: this.data.verband, - Gruppe: this.data.gruppe, - Personenkennzeichen: this.data.personenkennzeichen, - - }, - - + Username: this.data.username, + Anrede: this.data.anrede, + Matrikelnummer: this.data.matrikelnummer, + Titel: this.data.titelpre, + Postnomen: this.data.postnomen, }; }, - //? this computed function returns the data for the second column in the profil - kontaktInfo() { + + personKontakt() { if (!this.data) { return {}; } return { - FhAusweisStatus: this.data.zutrittsdatum, emails: this.data.emails, - Kontakte: this.data.kontakte, - Adressen: this.data.adressen, + }; }, + + specialData() { + if (!this.data) { + return {}; + } + + return { + Geburtsdatum: this.data.gebdatum, + Geburtsort: this.data.gebort, + Personenkennzeichen: this.data.personenkennzeichen, + Studiengang: this.data.studiengang, + Semester: this.data.semester, + Verband: this.data.verband, + Gruppe: this.data.gruppe, + }; + }, + + privateKontakte() { + if (!this.data) { + return {}; + } + + return this.data.kontakte; + + }, + + privateAdressen() { + if (!this.data) { + return {}; + } + + return this.data.adressen; + + }, + + + }, mounted() { this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { - this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); - - }) + this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); + + }) - this.$refs.zutrittsgruppenTable.tabulator.on('tableBuilt', () => { - - this.$refs.zutrittsgruppenTable.tabulator.setData(this.data.zuttritsgruppen); - - }) + this.$refs.zutrittsgruppenTable.tabulator.on('tableBuilt', () => { + + this.$refs.zutrittsgruppenTable.tabulator.setData(this.data.zuttritsgruppen); + + }) + }, - template: ` + template: ` - -
    +
    -
    +

    - +

    @@ -190,165 +229,170 @@ export default {
    - - +
    + + -
    +
    -
    - -
    - - - - -
    -
    - -
    -
    - - - - - - - - -
    -
    - - - -
    -

    Profilfoto gesperrt

    - Sperre des Profilfotos aufheben -
    - - Profilfoto sperren - - - - -
    -
    - - - - - - - - -
    - - - - -
    + -
    +
    - -
    -
    + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + StudentIn +
    +
    + -
    - -
    {{wert}}
    - + +
    + + + + + + +
    +
    +
    + + + + +
    + + +
    +
    +
    + +
    + + + + + +
    +
    +
    +
    - -
    + + +
    +
    +
    +
    + + + +
    +
    +
    + + +
    + - + + + + + +
    +
    + + + +
    +
    + +
    - -
    - - - - - - -
    - - - - - -
    -
    FH-Ausweis Status
    -
    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
    -
    - - - - - -
    -
    eMail
    -
    -
    {{email.type}}: {{email.email}}
    -
    -
    - - -
    -
    Private Kontakte
    -
    -
    -
    {{element.kontakttyp + ": " + element.kontakt+" " }}
    -
    {{element?.anmerkung}}
    -
    - - -
    -
    -
    -
    - - - - -
    -
    Adressen
    -
    -
    - {{element.strasse}} ({{element.adr_typ}})
    {{ element.plz}} {{element.ort}} -
    -
    -
    - -
    - - - - -
    +
    +
    +
    +
    + + +
    + +
    + +
    + Studenten Information +
    +
    +
    +
    + + +
    + + + +
    +
    +
    + +
    + +
    + +
    + + + + + +
    + + + + + + + @@ -356,21 +400,183 @@ export default {
    +
    +
    +
    - -
    + +
    +
    + Mails +
    + +
    + + + +
    + + + + + + +
    +
    + +
    +
    + + + +
    +
    +
    + + + + + +
    +
    +
    +
    +
    + + + + + + + + + +
    + + +
    +
    +
    + + +
    +
    +
    +
    + Private Kontakte +
    +
    + +
    +
    + + +
    +
    + + +
    + + + + + + +
    + + +
    + + + + + + +
    + +
    +
    +
    + + +
    +
    +
    + + +
    +
    + +
    +
    +
    +
    + + + +
    +
    +
    +
    Private Adressen
    +
    + +
    + + +
    + + + +
    +
    +
    + + +
    +
    +
    + + +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    + + + + + +
    + + + + +
    - -
    -
    -

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    -
    -
    - + @@ -378,14 +584,17 @@ export default {
    - -
    - -
    + - -
    - + +
    + +
    + + +
    + +
    @@ -404,7 +613,7 @@ export default { -
    +
    @@ -412,34 +621,88 @@ export default { -
    +
    +
    + + +
    + + + +
    +
    + Der FH Ausweis ist am {{data.zutrittsdatum}} ausgegeben worden. +
    + +
    + + +
    + +
    + -
    +
    -
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    -
    - -
    {{verteiler.beschreibung}}
    +
    +
    + Mailverteilers +
    +
    + +
    Sie sind Mitgglied in folgenden Verteilern:
    +
    +
    +
    +
    + + + +
    + +
    + +
    +
    {{verteiler.beschreibung}}
    +
    + +
    + +
    @@ -459,8 +722,6 @@ export default {
    - - `, }; diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 815b70fee..39fc844be 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -1,99 +1,100 @@ -import fhcapifactory from "../../../apps/api/fhcapifactory.js"; - export default { - + data() { return { - - + }; }, - //? this is the prop passed to the dynamic component with the custom data of the view + //? this is the prop passed to the dynamic component with the custom data of the view props: ["data"], methods: { - - sperre_foto_function(value) { - if (!this.data) { - return; - } - fhcapifactory.UserData.sperre_foto_function(value).then((res) => { - this.data.foto_sperre = res.data.foto_sperre; - }); - }, + }, + computed: { + + get_image_base64_src() { if (!this.data) { return ""; } return "data:image/jpeg;base64," + this.data.foto; }, - //? this computed function returns all the informations for the first column in the profil + + + //? this computed function returns all the informations for the first column in the profil personData() { if (!this.data) { return {}; } return { - Allgemein: { - View:"StudentIn", - Username: this.data.username, - Matrikelnummer: this.data.matrikelnummer, - Anrede: this.data.anrede, - Titel: this.data.titel, - Vorname: this.data.vorname, - Nachname: this.data.nachname, - Postnomen: this.data.postnomen, - }, - - - SpecialInformation: { - Studiengang: this.data.studiengang, - Semester: this.data.semester, - Verband: this.data.verband, - Gruppe: this.data.gruppe, - Personenkennzeichen: this.data.personenkennzeichen, - }, + Username: this.data.username, + Anrede: this.data.anrede, + Matrikelnummer: this.data.matrikelnummer, + Titel: this.data.titelpre, + Postnomen: this.data.postnomen, }; }, - //? this computed function returns the data for the second column in the profil - kontaktInfo() { + + personKontakt() { if (!this.data) { return {}; } return { - emails: this.data.emails, - + }; }, + + specialData() { + if (!this.data) { + return {}; + } + + return { + Personenkennzeichen: this.data.personenkennzeichen, + Studiengang: this.data.studiengang, + Semester: this.data.semester, + Verband: this.data.verband, + Gruppe: this.data.gruppe, + }; + }, + + + + }, mounted() { + }, - template: ` + template: ` - - -
    +
    -
    +

    - +

    @@ -107,111 +108,163 @@ export default {
    +
    + + -
    +
    -
    - -
    - - - - - - - -
    -
    - -
    -
    - - - - - - - - - - - - -
    - - - - -
    -
    +
    - -
    -
    - + + + + + + + + + + + + + +
    +
    +
    + + +
    +
    + StudentIn +
    +
    + -
    - -
    {{wert}}
    - -
    - + -
    +
    - + + + +
    +
    +
    + + +
    +
    + +
    + + + + + +
    +
    +
    +
    + + + +
    +
    +
    +
    + + + +
    +
    +
    + + +
    + + + + + + + + +
    +
    + + + +
    +
    + +
    - -
    - - - - - - -
    - - - - -
    -
    eMail
    -
    -
    {{email.type}}: {{email.email}}
    -
    -
    - - -
    - - - - -
    +
    +
    +
    +
    + + +
    + +
    + +
    + Studenten Information +
    +
    +
    +
    + + +
    + + + +
    +
    +
    + +
    + +
    + +
    + + + + + +
    + + + + + + + @@ -219,15 +272,92 @@ export default {
    +
    +
    +
    - -
    + +
    +
    + Mails +
    + +
    + + + +
    + + + + + + +
    +
    + +
    +
    + + + +
    +
    +
    + + + + + + +
    +
    +
    +
    +
    + + + + + + + + + +
    + + +
    +
    +
    + + + + + + + + +
    + + + + +
    - + + + + + + + + + @@ -238,7 +368,7 @@ export default { -
    +
    @@ -246,34 +376,70 @@ export default { -
    +
    + -
    +
    -
    Mailverteilers
    -

    Sie sind Mitgglied in folgenden Verteilern:

    -
    - -
    {{verteiler.beschreibung}}
    +
    +
    + Mailverteilers +
    +
    + +
    Sie sind Mitgglied in folgenden Verteilern:
    +
    +
    +
    +
    + + + +
    + +
    + +
    +
    {{verteiler.beschreibung}}
    +
    + +
    + +
    @@ -293,8 +459,6 @@ export default {
    - - `, }; From 8666dbe3a658b5d98c8b17b90b26d124f78881af Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 19 Dec 2023 15:36:11 +0100 Subject: [PATCH 062/201] wrong uid was used to get the emails of the student profil view --- application/controllers/Cis/Profil.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index b17022e6e..aed70c0ae 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -262,7 +262,7 @@ class Profil extends Auth_Controller $intern_email = array(); $intern_email+=array("type" => "intern"); - $intern_email+=array("email"=> $this->uid . "@" . DOMAIN); + $intern_email+=array("email"=> $uid . "@" . DOMAIN); $res->emails = array($intern_email); From 9c69d8cc466b8d4e1a5e16ce2fd7334e6772b792 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 19 Dec 2023 15:49:57 +0100 Subject: [PATCH 063/201] trims the student information so that the value is falsy in javascript --- application/controllers/Cis/Profil.php | 2 +- public/js/components/Cis/Profil/StudentProfil.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index aed70c0ae..0a3189fdd 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -639,7 +639,7 @@ class Profil extends Auth_Controller $res->mittel = $betriebsmittelperson_res; $res->matrikelnummer = $matr_res->matr_nr; foreach($student_res as $key => $value){ - $res->$key = $value; + $res->$key = trim($value); } $res->zuttritsgruppen = $zutrittsgruppe_res; diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 850d4da68..f05c53dc6 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -366,9 +366,9 @@ export default {
    - +
    - +
    From 6f8bd9527c3eb9428db63e690f76f796f7f9d09f Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Tue, 19 Dec 2023 16:00:43 +0100 Subject: [PATCH 064/201] changes the styling when hovering over form-control fields in the profil view, so that it does not also change the behavior of other elements that use form-control on the web page --- public/css/components/Profil.css | 4 ++-- public/js/components/Cis/Profil/MitarbeiterProfil.js | 2 +- public/js/components/Cis/Profil/MitarbeiterViewProfil.js | 2 +- public/js/components/Cis/Profil/StudentProfil.js | 8 +------- public/js/components/Cis/Profil/StudentViewProfil.js | 2 +- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/public/css/components/Profil.css b/public/css/components/Profil.css index f5a3eec6e..42defa8e7 100644 --- a/public/css/components/Profil.css +++ b/public/css/components/Profil.css @@ -41,10 +41,10 @@ background-color:white; } -.form-control:focus{ +.fhc-form .form-control:focus{ border-color:white; box-shadow:none; -} +} /* dl { width: 100%; diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index d0ecebc13..b827358b8 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -268,7 +268,7 @@ export default { template: ` -
    +
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index 1e92108dd..f7efd5d19 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -187,7 +187,7 @@ export default { template: ` -
    +
    diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index f05c53dc6..98fa81cb6 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -199,7 +199,7 @@ export default { template: ` -
    +
    @@ -329,12 +329,6 @@ export default {
    - - - - - -
    diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 39fc844be..5967fe7f9 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -78,7 +78,7 @@ export default { template: ` -
    +
    From fed4f7f9293853a886704c3e62d8bbdb458b12fe Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Thu, 21 Dec 2023 08:53:56 +0100 Subject: [PATCH 065/201] replaced form-control with custom css construct --- application/views/Cis/Profil.php | 12 -- public/css/components/Profil.css | 59 ++++++ public/js/apps/Cis/Profil.js | 15 +- .../Cis/Profil/MitarbeiterProfil.js | 189 ++++++++++-------- .../Cis/Profil/MitarbeiterViewProfil.js | 94 +++++---- .../js/components/Cis/Profil/StudentProfil.js | 26 ++- .../Cis/Profil/StudentViewProfil.js | 78 ++++---- 7 files changed, 280 insertions(+), 193 deletions(-) diff --git a/application/views/Cis/Profil.php b/application/views/Cis/Profil.php index 059a4edc1..9e09bea62 100644 --- a/application/views/Cis/Profil.php +++ b/application/views/Cis/Profil.php @@ -9,18 +9,6 @@ $includesArray = array( $this->load->view('templates/CISHTML-Header', $includesArray); ?> -
    diff --git a/public/css/components/Profil.css b/public/css/components/Profil.css index 42defa8e7..5334dfa48 100644 --- a/public/css/components/Profil.css +++ b/public/css/components/Profil.css @@ -46,6 +46,65 @@ box-shadow:none; } +.fhc-form .form-floating > .form-control:focus ~ .floating-title, .form-floating > .form-control:not(:placeholder-shown) ~ .floating-title, .form-floating > .form-select ~ .floating-title{ + opacity: .65; + transform: scale(.85) translateY(-.5rem) translateX(.15rem); +} + +.fhc-form .form-floating > .floating-title{ + position: absolute; + top: 0; + left: 0; + height: 100%; + padding: 1rem .75rem; + pointer-events: none; + border: 1px solid transparent; + transform-origin: 0 0; + transition: opacity .1s ease-in-out,transform .1s ease-in-out; +} + +.floating-title{ + display:inline-block; +} + +.form-floating>.form-control, .form-floating>.form-select{ + height: auto; +} + + +/* FORM UNDERLINE +*/ +.form-underline{ + display: flex; + flex-direction: column; + justify-content: center; + align-content: space-between; + +} +.form-underline .form-underline-content{ + border-width: 1px; + border-color: transparent transparent #dee2e6 transparent; + border-style: solid; + padding-bottom: 0.25rem; + padding-left: 0.5rem; + + /*optional not wrapping text that is horizontally scrollable and does not display a scrollbar */ + white-space: nowrap; + overflow: auto; + scrollbar-width: none; + +} + +.form-underline .form-underline-content::-webkit-scrollbar { + display: none; +} + +.form-underline .form-underline-titel{ + opacity: 0.65; + font-size: .85rem; + padding-left: 0.5rem; +} + /* dl { width: 100%; overflow: hidden; diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index 5eac4db58..f1a1206a5 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -38,7 +38,6 @@ Vue.$collapseFormatter = function(data){ const app = Vue.createApp({ components: { - Base, StudentProfil, MitarbeiterProfil, ViewStudentProfil, @@ -68,18 +67,20 @@ const app = Vue.createApp({ } this.view = res.data?.view; this.data = res.data?.data; - //* only for testing purposes and needs to be deleted after - this.data.base = "Base"; + }); }, template:`
    -
    +
    + +

    Es wurden keine oder mehrere Profile für {{this.notFoundUID}} gefunden

    + +
    + + -

    Es wurden keine oder mehrere Profile für {{this.notFoundUID}} gefunden

    -
    -
    ` diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index b827358b8..c466c28f0 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -216,7 +216,7 @@ export default { Geburtsdatum: this.data.gebdatum, Geburtsort: this.data.gebort, Kurzzeichen: this.data.kurzbz, - Telefon: this.data.telefonklappe + (this.data.standort_telefon?this.data.standort_telefon:""), + Telefon: (this.data.standort_telefon?this.data.standort_telefon:"") + " " + this.data.telefonklappe, Büro: this.data.ort_kurzbz, }; }, @@ -348,7 +348,7 @@ export default { -
    +
    @@ -377,20 +377,25 @@ export default {
    -
    +
    -
    + - - -
    +
    +
    Vorname
    + {{data.vorname}} +
    + + +
    -
    - - - + +
    +
    Nachname
    + {{data.nachname}}
    +
    @@ -405,11 +410,15 @@ export default {
    -
    - - - + + +
    +
    {{bez}}
    + {{wert?wert:'-'}}
    + + +
    @@ -432,21 +441,25 @@ export default { Mitarbeiter Information
    -
    +
    -
    - + + - - - +
    +
    {{bez }}
    - - - -
    + + {{wert?wert:'-'}} + + + {{wert?wert:'-'}} +
    + + +
    @@ -489,29 +502,36 @@ export default { + +
    + -
    -
    +
    +
    +
    -
    -
    - - - - + + +
    + +
    +
    {{email.type}}
    + {{email.email}}
    + +
    @@ -541,49 +561,43 @@ export default {
    -
    +
    +
    +
    -
    +
    -
    + - - - - - - - -
    - -
    - - - - - - - - +
    +
    {{element.kontakttyp}}
    + {{element.kontakt}} + {{element.kontakt}}
    + +
    -
    -
    - - -
    +
    + +
    +
    Anmerkung
    + {{element.anmerkung}}
    -
    + + +
    +
    - +
    +
    @@ -597,7 +611,10 @@ export default {
    Private Adressen
    -
    +
    +
    +
    +
    @@ -605,35 +622,43 @@ export default {
    -
    -
    - - -
    +
    + +
    +
    Strasse
    + {{element.strasse}} +
    + +
    -
    -
    -
    - - +
    + + +
    +
    Typ
    + {{element.adr_typ}} +
    + +
    +
    + +
    +
    Ort
    + {{element.ort}}
    -
    -
    - - -
    -
    -
    -
    - - +
    +
    +
    PLZ
    + {{element.plz}}
    +
    +
    diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index f7efd5d19..b20818517 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -129,7 +129,7 @@ export default { get_mitarbeiter_standort_telefon(){ if(this.data.standort_telefon){ - return "tel:"+ this.data.telefonklappe + this.data.standort_telefon; + return "tel:"+ this.data.telefonklappe + this.data.standort_telefon ; }else{ return null; } @@ -167,7 +167,7 @@ export default { return { Kurzzeichen: this.data.kurzbz, - Telefon: this.data.telefonklappe + (this.data.standort_telefon?this.data.standort_telefon:""), + Telefon: (this.data.standort_telefon?this.data.standort_telefon:"") + " " + this.data.telefonklappe , Büro: this.data.ort_kurzbz, }; }, @@ -333,44 +333,7 @@ export default {
    -
    - - -
    - -
    - -
    - Mitarbeiter Information -
    -
    -
    -
    - - -
    - - - - - - - -
    -
    -
    - -
    - -
    - -
    - - - - - -
    + @@ -418,10 +381,11 @@ export default {
    - - + + {{email.email}} - +
    {{email.type }}
    +
    @@ -444,6 +408,50 @@ export default {
    + +
    + + +
    + +
    + +
    + Mitarbeiter Information +
    +
    +
    +
    + + +
    + + + + + +
    +
    +
    + +
    + +
    + +
    + +
    + + + diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 98fa81cb6..469c72411 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -155,7 +155,7 @@ export default { Studiengang: this.data.studiengang, Semester: this.data.semester, Verband: this.data.verband, - Gruppe: this.data.gruppe, + Gruppe: this.data.gruppe.trim(), }; }, @@ -419,19 +419,24 @@ export default {
    +
    - + {{email.email}} - +
    {{email.type }}
    + + +
    @@ -464,27 +469,28 @@ export default {
    - +
    - - + + {{element.kontakt}} - +
    {{element.kontakttyp }}
    - - + + {{element.kontakt}} - +
    {{element.kontakttyp }}
    +
    diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 5967fe7f9..b05c68db7 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -61,7 +61,7 @@ export default { Studiengang: this.data.studiengang, Semester: this.data.semester, Verband: this.data.verband, - Gruppe: this.data.gruppe, + Gruppe: this.data.gruppe.trim(), }; }, @@ -224,40 +224,7 @@ export default {
    -
    - - -
    - -
    - -
    - Studenten Information -
    -
    -
    -
    - - -
    - - - -
    -
    -
    - -
    - -
    - -
    - - - - - -
    + @@ -305,10 +272,10 @@ export default {
    - - + + {{email.email}} - +
    {{email.type }}
    @@ -331,8 +298,41 @@ export default {
    - + +
    + +
    + +
    + +
    + Studenten Information +
    +
    +
    +
    + + +
    + + + +
    +
    +
    + +
    + +
    + +
    + + + +
    + + From d6ef9c4ec4f3f3144cffc4e872273ce6dbcc1bc9 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Thu, 21 Dec 2023 11:46:42 +0100 Subject: [PATCH 066/201] adds custom floating label css construct to the rest of the profil views --- .../Cis/Profil/MitarbeiterViewProfil.js | 90 +++++---- .../js/components/Cis/Profil/StudentProfil.js | 181 ++++++++++-------- .../Cis/Profil/StudentViewProfil.js | 74 ++++--- 3 files changed, 201 insertions(+), 144 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index b20818517..6b3ab22bb 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -289,20 +289,27 @@ export default {
    -
    +
    -
    - - - + + +
    +
    Vorname
    + {{data.vorname}} +
    + +
    -
    - - - + + +
    +
    Nachname
    + {{data.nachname}} +
    +
    @@ -317,13 +324,18 @@ export default {
    -
    - - -
    -
    + + +
    +
    {{bez}}
    + {{wert?wert:'-'}} + +
    + +
    +
    @@ -369,8 +381,8 @@ export default { -
    -
    +
    +
    @@ -379,14 +391,16 @@ export default {
    -
    - - - {{email.email}} - -
    {{email.type }}
    -
    + + +
    +
    {{email.type}}
    + {{email.email}} +
    + + +
    @@ -420,25 +434,25 @@ export default { Mitarbeiter Information
    -
    +
    -
    - - + - - -
    +
    +
    {{bez}}
    + + {{wert?wert:'-'}} + + + {{wert?wert:'-'}} + + +
    + + +
    diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 469c72411..62a4a0799 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -245,7 +245,7 @@ export default { -
    +
    @@ -265,7 +265,7 @@ export default {
    -
    +
    @@ -279,7 +279,7 @@ export default { -
    +
    @@ -308,20 +308,29 @@ export default {
    -
    +
    -
    + - - -
    +
    +
    Vorname
    + {{data.vorname}} + +
    + + +
    -
    - - - -
    + + + +
    +
    Nachname
    + {{data.nachname}} + +
    +
    @@ -330,11 +339,15 @@ export default {
    -
    - - - + + + +
    +
    {{bez}}
    + {{wert?wert:'-'}} +
    +
    @@ -346,7 +359,7 @@ export default {
    -
    +
    @@ -357,15 +370,18 @@ export default { Studenten Information
    -
    +
    -
    +
    +
    {{bez}}
    + {{wert?wert:'-'}} + +
    - - -
    + +
    @@ -415,8 +431,8 @@ export default { -
    -
    +
    +
    +
    -
    +
    -
    + + +
    +
    {{element.kontakttyp}}
    + {{element.kontakt}} + {{element.kontakt}} +
    - - {{element.kontakt}} - -
    {{element.kontakttyp }}
    + + +
    +
    -
    - - -
    - - - {{element.kontakt}} - -
    {{element.kontakttyp }}
    - - -
    - +
    +
    Anmerkung
    + {{element.anmerkung}}
    -
    -
    - - -
    + +
    -
    +
    - +
    +
    +
    @@ -520,7 +534,10 @@ export default {
    Private Adressen
    -
    +
    +
    +
    +
    @@ -528,35 +545,43 @@ export default {
    -
    -
    - - -
    +
    + +
    +
    Strasse
    + {{element.strasse}} +
    + +
    -
    -
    -
    - - +
    + + +
    +
    Typ
    + {{element.adr_typ}} +
    + +
    +
    + +
    +
    Ort
    + {{element.ort}}
    -
    -
    - - -
    -
    -
    -
    - - +
    +
    +
    PLZ
    + {{element.plz}}
    +
    +
    diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index b05c68db7..38aadb1d6 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -158,7 +158,7 @@ export default { -
    +
    @@ -180,20 +180,31 @@ export default {
    -
    +
    -
    + - - -
    +
    +
    Vorname
    + {{data.vorname}} + +
    + + +
    -
    + - - -
    + + +
    +
    Nachname
    + {{data.nachname}} + +
    + +
    @@ -208,11 +219,16 @@ export default {
    -
    + - - +
    +
    {{bez}}
    + {{wert?wert:'-'}} +
    + + +
    @@ -260,8 +276,8 @@ export default { -
    -
    +
    +
    @@ -270,14 +286,15 @@ export default {
    -
    + - - {{email.email}} - -
    {{email.type }}
    +
    +
    {{email.type }}
    + {{email.email}} + +
    -
    +
    @@ -299,7 +316,7 @@ export default {
    -
    +
    @@ -310,15 +327,16 @@ export default { Studenten Information
    -
    +
    + +
    +
    {{bez}}
    + {{wert?wert:'-'}} + +
    -
    - - - -
    From 733275a16270f4b74aaf600b671f90913a6b5e6c Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Fri, 22 Dec 2023 14:18:49 +0100 Subject: [PATCH 067/201] first profil info edit template --- application/controllers/Cis/Profil.php | 20 +- .../models/crm/Profil_change_model.php | 38 ++++ public/css/components/Profil.css | 16 +- public/js/apps/api/userdata.js | 6 +- .../Cis/Profil/MitarbeiterProfil.js | 176 +++++++++++++++++- .../components/Cis/Profil/ProfilEditModal.js | 61 ++++++ .../js/components/Cis/Profil/StudentProfil.js | 6 +- system/dbupdate_3.4.php | 3 +- system/dbupdate_3.4/25999_C4_ma0594.php | 31 +++ 9 files changed, 343 insertions(+), 14 deletions(-) create mode 100644 application/models/crm/Profil_change_model.php create mode 100644 public/js/components/Cis/Profil/ProfilEditModal.js create mode 100644 system/dbupdate_3.4/25999_C4_ma0594.php diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index 0a3189fdd..d125fcc0e 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -19,6 +19,7 @@ class Profil extends Auth_Controller 'View' => ['student/anrechnung_beantragen:r','user:r'], 'foto_sperre_function' => ['student/anrechnung_beantragen:r','user:r'], 'getView' => ['student/anrechnung_beantragen:r','user:r'], + 'editProfil' => ['student/anrechnung_beantragen:r','user:r'], ]); $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); @@ -30,7 +31,7 @@ class Profil extends Auth_Controller $this->load->model('person/Benutzergruppe_model', 'BenutzergruppeModel'); $this->load->model('ressource/Betriebsmittelperson_model', 'BetriebsmittelpersonModel'); $this->load->model('person/Kontakt_model', 'KontaktModel'); - + $this->load->model('crm/Profil_change_model', 'ChangeModel'); //? put the uid and pid inside the controller for further usage in views $this->uid = getAuthUID(); @@ -62,6 +63,23 @@ class Profil extends Auth_Controller + + + public function editProfil(){ + + $json = $this->input->raw_input_stream; + $data = ["uid"=>"karpenko", "profil_changes"=>$json, "change_timestamp"=>"NOW()"]; + //? gets the data inside the public.tbl_cis_profil_update + //$res = json_encode($this->ChangeModel->load([$this->uid])); + + //? inserts new row inside the public.tbl_cis_profil_update table + $insert_res = json_encode($this->ChangeModel->insert($data)); + + echo $insert_res; + + } + + private function viewMitarbeiterProfil($uid){ diff --git a/application/models/crm/Profil_change_model.php b/application/models/crm/Profil_change_model.php new file mode 100644 index 000000000..eea42a5d0 --- /dev/null +++ b/application/models/crm/Profil_change_model.php @@ -0,0 +1,38 @@ +dbTable = 'public.tbl_cis_profil_update'; + $this->pk = ['uid']; + $this->hasSequence = false; + + //? loading other models to query them + $this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel'); + } + + /** + * getLastStatuses + */ + public function getData($uid){ + + $res = $this->load($uid); + $res = hasData($res) ? getData($res)[0] : null; + + return $res; + } + + public function insertData($data){ + + $res = $this->insert($data); + //$res = hasData($res) ? getData($res)[0] : null; + + return $res; + } + +} diff --git a/public/css/components/Profil.css b/public/css/components/Profil.css index 5334dfa48..e6d820ed6 100644 --- a/public/css/components/Profil.css +++ b/public/css/components/Profil.css @@ -14,6 +14,18 @@ } } +.image-lock{ + height:22px; + width:21px; + background-color:white; + position:absolute; + top:0; + right:12px; + display:flex; + align-items:center; + justify-content:center; +} + .tabulator-collapsed-row{ padding:15px; background-color: rgba(0,0,0,0.1); @@ -41,10 +53,10 @@ background-color:white; } -.fhc-form .form-control:focus{ +/* .fhc-form .form-control:focus{ border-color:white; box-shadow:none; -} +} */ .fhc-form .form-floating > .form-control:focus ~ .floating-title, .form-floating > .form-control:not(:placeholder-shown) ~ .floating-title, .form-floating > .form-select ~ .floating-title{ opacity: .65; diff --git a/public/js/apps/api/userdata.js b/public/js/apps/api/userdata.js index 8a13d16ae..d671cbd66 100644 --- a/public/js/apps/api/userdata.js +++ b/public/js/apps/api/userdata.js @@ -1,6 +1,10 @@ export default { - + editProfil: function(payload) { + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ + `/Cis/Profil/editProfil`; + return axios.post(url,payload); + }, isMitarbeiterOrStudent: function(uid) { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index c466c28f0..c6306b982 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -1,14 +1,18 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; +import BsModal from "../../Bootstrap/Modal.js"; export default { components: { CoreFilterCmpt, + BsModal, }, data() { return { collapseIconFunktionen: true, collapseIconBetriebsmittel: true, + //? this reactive object contains all the field the user is able to edit and keep track of which fields he has edited + editData:null, funktionen_table_options: { height: 300, layout: "fitColumns", @@ -114,8 +118,64 @@ export default { }, //? this is the prop passed to the dynamic component with the custom data of the view - props: ["data"], + + props: { + data: Object, + + /* + * NOTE(chris): + * Hack to expose in "emits" declared events to $props which we use + * in the v-bind directive to forward all events. + * @see: https://github.com/vuejs/core/issues/3432 + + onHideBsModal: Function, + onHiddenBsModal: Function, + onHidePreventedBsModal: Function, + onShowBsModal: Function, + onShownBsModal: Function + */ + }, + /* mixins: [ + BsModal, + + ], */ + popup(options) { + return BsModal.popup.bind(this)(null, options); + }, methods: { + showModal() { + this.$refs.bsmodal.show() + }, + + hideModal() { + // You can call the hide method of the modal component if needed + this.$refs.bsmodal.hide(); + }, + + + insertEditData(){ + + + let editDataKeys = Object.keys(this.editData); + let this_data = Object.entries(this.data).filter(([key,value])=>{ + return editDataKeys.includes(key); + }) + + if(JSON.stringify(this_data) == JSON.stringify(Object.entries(this.editData))){ + + console.log("the editData contains the same information",JSON.stringify(this_data),"editData values:", JSON.stringify(Object.entries(this.editData))); + }else{ + console.log("the editData HAS DIFFERENT INFORMATION"); + } + + /* if(somethingChanged){ + console.log("the editData contains changed information"); + }else{ + console.log("the editData does not contain changed information"); + } */ + //? insert editData into a new row inside the public.tbl_cis_profil_update table + //Vue.$fhcapi.UserData.editProfil(this.editData); + }, sperre_foto_function() { if (!this.data) { return; @@ -191,7 +251,7 @@ export default { return { Username: this.data.username, Anrede: this.data.anrede, - Titel: this.data.titelpre, + Titel: this.data.titel, Postnomen: this.data.postnomen, }; }, @@ -253,8 +313,26 @@ export default { }; }, }, + created() { + + this.editData = JSON.parse( + JSON.stringify( + { + emails:this.data.emails, + kontakte: this.data.kontakte, + + personData : {...this.personData, vorname: this.data.vorname, nachname: this.data.nachname} + })); + + console.log(this.data.titelpre); + + + }, mounted() { + + + this.$refs.betriebsmittelTable.tabulator.on("tableBuilt", () => { this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); }); @@ -262,12 +340,18 @@ export default { this.$refs.funktionenTable.tabulator.on("tableBuilt", () => { this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); }); + + + + }, template: ` +
    {{JSON.stringify(editData,null,2)}}
    {{JSON.stringify(data.emails,null,2)}}
    +
    @@ -362,11 +446,11 @@ export default { -
    +
    - -
    + +
    @@ -461,7 +545,87 @@ export default {
    -
    + + + +
    + + + + + + + + + + + + +
    +
    diff --git a/public/js/components/Cis/Profil/ProfilEditModal.js b/public/js/components/Cis/Profil/ProfilEditModal.js new file mode 100644 index 000000000..4813e2d3b --- /dev/null +++ b/public/js/components/Cis/Profil/ProfilEditModal.js @@ -0,0 +1,61 @@ + +export default { + + data() { + return { + + + }; + }, + + + props: ["editData"], + methods: { + + }, + + computed: { + + + + + }, + + mounted() { + console.log(this.editData); + + + }, + + template: ` + + + + + + + + `, + }; + + + + + + diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 62a4a0799..84997b0ac 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -293,11 +293,11 @@ export default { -
    +
    - -
    + +
    diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php index 0d1e554dc..4a20a6289 100644 --- a/system/dbupdate_3.4.php +++ b/system/dbupdate_3.4.php @@ -47,7 +47,7 @@ require_once('dbupdate_3.4/30181_tabelle_anrechnung_neue_attribute_fuer_begruend require_once('dbupdate_3.4/29529_infocenter_anpassungen.php'); require_once('dbupdate_3.4/29835_uhstat1_erfassung_der_uhstat1_daten_ueber_das_bewerbungstool.php'); require_once('dbupdate_3.4/33714_erhoehter_studienbeitrag_fuer_drittsaatenangehoerig.php'); - +require_once('dbupdate_3.4/25999_C4_ma0594.php'); // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

    Pruefe Tabellen und Attribute!

    '; @@ -221,6 +221,7 @@ $tabellen=array( "public.tbl_benutzerfunktion" => array("benutzerfunktion_id","fachbereich_kurzbz","uid","oe_kurzbz","funktion_kurzbz","semester", "datum_von","datum_bis", "updateamum","updatevon","insertamum","insertvon","ext_id","bezeichnung","wochenstunden"), "public.tbl_benutzergruppe" => array("uid","gruppe_kurzbz","studiensemester_kurzbz","updateamum","updatevon","insertamum","insertvon","ext_id"), "public.tbl_bewerbungstermine" => array("bewerbungstermin_id","studiengang_kz","studiensemester_kurzbz","beginn","ende","nachfrist","nachfrist_ende","anmerkung", "insertamum", "insertvon", "updateamum", "updatevon","studienplan_id","nationengruppe_kurzbz"), + "public.tbl_cis_profil_update" => array("uid","profil_changes","change_timestamp"), "public.tbl_buchungstyp" => array("buchungstyp_kurzbz","beschreibung","standardbetrag","standardtext","aktiv","credit_points"), "public.tbl_dokument" => array("dokument_kurzbz","bezeichnung","ext_id","bezeichnung_mehrsprachig","dokumentbeschreibung_mehrsprachig","ausstellungsdetails"), "public.tbl_dokumentprestudent" => array("dokument_kurzbz","prestudent_id","mitarbeiter_uid","datum","updateamum","updatevon","insertamum","insertvon","ext_id"), diff --git a/system/dbupdate_3.4/25999_C4_ma0594.php b/system/dbupdate_3.4/25999_C4_ma0594.php new file mode 100644 index 000000000..f5bb66213 --- /dev/null +++ b/system/dbupdate_3.4/25999_C4_ma0594.php @@ -0,0 +1,31 @@ +db_query("SELECT 1 FROM public.tbl_cis_profil_update LIMIT 1")) + { + $qry = "CREATE TABLE public.tbl_cis_profil_update ( + uid VARCHAR(32) NOT NULL, + profil_changes jsonb NOT NULL, + change_timestamp TIMESTAMP NOT NULL, + CONSTRAINT tbl_cis_profil_update_pk PRIMARY KEY(uid), + CONSTRAINT tbl_cis_profil_update_fk FOREIGN KEY(uid) REFERENCES public.tbl_benutzer(uid) + ); + + GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_cis_profil_update TO vilesci; + GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_cis_profil_update TO web;"; + + if(!$db->db_query($qry)) + echo 'public.tbl_cis_profil_update: '.$db->db_last_error().'
    '; + else + echo '
    public.tbl_cis_profil_update: table created'; + } + + + if($db->db_num_rows($result)==0) + { + $qry = "INSERT INTO public.tbl_cis_profil_update(uid, profil_changes, change_timestamp) VALUES('ma0594', '{\"test\":\"data\"}', NOW());"; + + if(!$db->db_query($qry)) + echo 'Prüfungstyp: '.$db->db_last_error().'
    '; + else + echo '
    test eintrag in public.tbl_cis_profil_update hinzugefügt'; + } \ No newline at end of file From 620528fa50b36b8c761e9f5165079c769b64442f Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Wed, 27 Dec 2023 09:27:18 +0100 Subject: [PATCH 068/201] moves the collapseFunction to the parent component Profil and also manages the collapse state from the parent --- public/css/components/Profil.css | 43 ----------------- public/js/apps/Cis/Profil.js | 44 +++++++++++++++++ .../Cis/Profil/MitarbeiterProfil.js | 47 ++----------------- .../Cis/Profil/MitarbeiterViewProfil.js | 40 +--------------- .../js/components/Cis/Profil/StudentProfil.js | 39 +-------------- 5 files changed, 53 insertions(+), 160 deletions(-) diff --git a/public/css/components/Profil.css b/public/css/components/Profil.css index e6d820ed6..7b13f048c 100644 --- a/public/css/components/Profil.css +++ b/public/css/components/Profil.css @@ -40,49 +40,6 @@ padding:0 !important; } -.form-control_{ - border:0; - border-bottom: 1px solid #ced4da; - height:auto !important; - padding-bottom: 5px !important; - padding-left: 3px !important; - border-radius:0px; -} - -.form-control-plaintext[readonly]{ - background-color:white; -} - -/* .fhc-form .form-control:focus{ - border-color:white; - box-shadow:none; -} */ - -.fhc-form .form-floating > .form-control:focus ~ .floating-title, .form-floating > .form-control:not(:placeholder-shown) ~ .floating-title, .form-floating > .form-select ~ .floating-title{ - opacity: .65; - transform: scale(.85) translateY(-.5rem) translateX(.15rem); -} - -.fhc-form .form-floating > .floating-title{ - position: absolute; - top: 0; - left: 0; - height: 100%; - padding: 1rem .75rem; - pointer-events: none; - border: 1px solid transparent; - transform-origin: 0 0; - transition: opacity .1s ease-in-out,transform .1s ease-in-out; -} - -.floating-title{ - display:inline-block; -} - -.form-floating>.form-control, .form-floating>.form-select{ - height: auto; -} - /* FORM UNDERLINE */ diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index f1a1206a5..989a1b5e2 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -35,6 +35,8 @@ Vue.$collapseFormatter = function(data){ return Object.keys(data).length ? container : ""; }; + + const app = Vue.createApp({ components: { @@ -53,6 +55,48 @@ const app = Vue.createApp({ } }, methods: { + //? arrow function because it references to the this element of the components that use the function + collapseFunction: function (e, column) { + + //* check if property doesn't exist already and add it to the reactive this properties + if(this[e.target.id] === undefined){ + this[e.target.id] = true + + } + this[e.target.id]=!this[e.target.id]; + + //* gets all event icons of the different rows to use the onClick event later + let allClickableIcons = column._column.cells.map((row) => { + return row.element.children[0]; + }); + + //* changes the icon that shows or hides all the collapsed columns + //* if the replace function does not find the class to replace, it just simply returns false + if (this[e.target.id]) { + e.target.classList.replace("fa-angle-up", "fa-angle-down"); + } else { + e.target.classList.replace("fa-angle-down", "fa-angle-up"); + } + + //* changes the icon for every collapsed column to open or closed + if (this[e.target.id]) { + allClickableIcons + .filter((column) => { + return !column.classList.contains("open"); + }) + .forEach((col) => { + col.click(); + }); + } else { + allClickableIcons + .filter((column) => { + return column.classList.contains("open"); + }) + .forEach((col) => { + col.click(); + }); + } + } }, created(){ diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index c6306b982..2df528335 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -2,6 +2,7 @@ import fhcapifactory from "../../../apps/api/fhcapifactory.js"; import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; import BsModal from "../../Bootstrap/Modal.js"; + export default { components: { CoreFilterCmpt, @@ -9,8 +10,7 @@ export default { }, data() { return { - collapseIconFunktionen: true, - collapseIconBetriebsmittel: true, + //? this reactive object contains all the field the user is able to edit and keep track of which fields he has edited editData:null, funktionen_table_options: { @@ -39,7 +39,7 @@ export default { headerFilter: false, formatter: "responsiveCollapse", maxWidth: 40, - headerClick: this.collapseFunction, + headerClick: this.$parent.collapseFunction, }, { title: "Bezeichnung", @@ -91,7 +91,7 @@ export default { headerFilter: false, formatter: "responsiveCollapse", maxWidth: 40, - headerClick: this.collapseFunction, + headerClick: this.$parent.collapseFunction, }, { title: "Betriebsmittel", @@ -184,42 +184,7 @@ export default { this.data.foto_sperre = res.data.foto_sperre; }); }, - collapseFunction(e, column) { - //* the if of the column has to match with the name of the responsive data in the vue component - this[e.target.id] = !this[e.target.id]; - - //* gets all event icons of the different rows to use the onClick event later - let allClickableIcons = column._column.cells.map((row) => { - return row.element.children[0]; - }); - - //* changes the icon that shows or hides all the collapsed columns - //* if the replace function does not find the class to replace, it just simply returns false - if (this[e.target.id]) { - e.target.classList.replace("fa-angle-up", "fa-angle-down"); - } else { - e.target.classList.replace("fa-angle-down", "fa-angle-up"); - } - - //* changes the icon for every collapsed column to open or closed - if (this[e.target.id]) { - allClickableIcons - .filter((column) => { - return !column.classList.contains("open"); - }) - .forEach((col) => { - col.click(); - }); - } else { - allClickableIcons - .filter((column) => { - return column.classList.contains("open"); - }) - .forEach((col) => { - col.click(); - }); - } - }, + }, computed: { @@ -330,8 +295,6 @@ export default { }, mounted() { - - this.$refs.betriebsmittelTable.tabulator.on("tableBuilt", () => { this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index 6b3ab22bb..ddabf6815 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -35,7 +35,7 @@ export default { headerFilter: false, formatter: "responsiveCollapse", maxWidth: 40, - headerClick: this.collapseFunction, + headerClick: this.$parent.collapseFunction, }, { title: "Bezeichnung", @@ -78,43 +78,7 @@ export default { //? this is the prop passed to the dynamic component with the custom data of the view props: ["data"], methods: { - - collapseFunction(e, column) { - //* the if of the column has to match with the name of the responsive data in the vue component - this[e.target.id] = !this[e.target.id]; - - //* gets all event icons of the different rows to use the onClick event later - let allClickableIcons = column._column.cells.map((row) => { - return row.element.children[0]; - }); - - //* changes the icon that shows or hides all the collapsed columns - //* if the replace function does not find the class to replace, it just simply returns false - if (this[e.target.id]) { - e.target.classList.replace("fa-angle-up", "fa-angle-down"); - } else { - e.target.classList.replace("fa-angle-down", "fa-angle-up"); - } - - //* changes the icon for every collapsed column to open or closed - if (this[e.target.id]) { - allClickableIcons - .filter((column) => { - return !column.classList.contains("open"); - }) - .forEach((col) => { - col.click(); - }); - } else { - allClickableIcons - .filter((column) => { - return column.classList.contains("open"); - }) - .forEach((col) => { - col.click(); - }); - } - }, + }, computed: { diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index 84997b0ac..bc59514fa 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -31,7 +31,7 @@ export default { headerFilter: false, formatter: "responsiveCollapse", maxWidth: 40, - headerClick: this.collapseFunction, + headerClick: this.$parent.collapseFunction, }, { title: "Betriebsmittel", @@ -68,42 +68,7 @@ export default { this.data.foto_sperre = res.data.foto_sperre; }); }, - collapseFunction(e, column) { - //* the if of the column has to match with the name of the responsive data in the vue component - this[e.target.id] = !this[e.target.id]; - - //* gets all event icons of the different rows to use the onClick event later - let allClickableIcons = column._column.cells.map((row) => { - return row.element.children[0]; - }); - - //* changes the icon that shows or hides all the collapsed columns - //* if the replace function does not find the class to replace, it just simply returns false - if (this[e.target.id]) { - e.target.classList.replace("fa-angle-up", "fa-angle-down"); - } else { - e.target.classList.replace("fa-angle-down", "fa-angle-up"); - } - - //* changes the icon for every collapsed column to open or closed - if (this[e.target.id]) { - allClickableIcons - .filter((column) => { - return !column.classList.contains("open"); - }) - .forEach((col) => { - col.click(); - }); - } else { - allClickableIcons - .filter((column) => { - return column.classList.contains("open"); - }) - .forEach((col) => { - col.click(); - }); - } - }, + }, computed: { From f3e23b888d7c1f45b6a7ce4fdb6a4007228ecc0c Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Wed, 27 Dec 2023 10:42:33 +0100 Subject: [PATCH 069/201] fixing the accordion with editData --- .../Cis/Profil/MitarbeiterProfil.js | 48 ++++++++++++++----- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 2df528335..900c7e83f 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -521,7 +521,7 @@ export default {
    - + @@ -532,26 +532,49 @@ export default { -
    -
    -

    -

    -
    +
    -
    -
    -
    +
    + +
    +
    +
    + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + +
    + +
    +
    +
    + +
    - +
    - +
    @@ -581,6 +604,7 @@ export default { {{""}} --> + From d8cd52f7a0377668397a263687f8c70df3c33a18 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Wed, 27 Dec 2023 11:16:18 +0100 Subject: [PATCH 070/201] accordion styling --- .../Cis/Profil/MitarbeiterProfil.js | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 900c7e83f..fe4622656 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -284,10 +284,11 @@ export default { this.editData = JSON.parse( JSON.stringify( { - emails:this.data.emails, - kontakte: this.data.kontakte, - - personData : {...this.personData, vorname: this.data.vorname, nachname: this.data.nachname} + Personen_Informationen : {...this.personData, vorname: this.data.vorname, nachname: this.data.nachname}, + Mitarbeiter_Informatinen: this.specialData, + Emails:this.data.emails, + Private_Kontakte: this.data.kontakte, + Private_Adressen:this.privateAdressen, })); console.log(this.data.titelpre); @@ -313,8 +314,8 @@ export default { template: ` -
    {{JSON.stringify(editData,null,2)}}
    {{JSON.stringify(data.emails,null,2)}}
    - +
    @@ -535,8 +536,8 @@ export default {

    -

    @@ -545,7 +546,8 @@ export default {
    -
    + + +
    @@ -574,7 +580,7 @@ export default {
    - +
    From 87f640d66a2eff7b6d188f66ac739dd12ffef956 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Wed, 27 Dec 2023 11:20:54 +0100 Subject: [PATCH 071/201] little layout fix for MitarbeiterViewProfil.js --- public/js/components/Cis/Profil/MitarbeiterViewProfil.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index ddabf6815..de5b33624 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -231,7 +231,7 @@ export default { -
    +
    From 981e782c578b3f5775d0473ec1670dbf246106e0 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Thu, 28 Dec 2023 10:15:24 +0100 Subject: [PATCH 072/201] checks whether the editProfilData was changed by the user and is not in the original state --- application/controllers/Cis/Profil.php | 4 +- .../{crm => person}/Profil_change_model.php | 0 .../Cis/Profil/MitarbeiterProfil.js | 65 ++++++++++--------- 3 files changed, 37 insertions(+), 32 deletions(-) rename application/models/{crm => person}/Profil_change_model.php (100%) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index d125fcc0e..747a667db 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -31,7 +31,7 @@ class Profil extends Auth_Controller $this->load->model('person/Benutzergruppe_model', 'BenutzergruppeModel'); $this->load->model('ressource/Betriebsmittelperson_model', 'BetriebsmittelpersonModel'); $this->load->model('person/Kontakt_model', 'KontaktModel'); - $this->load->model('crm/Profil_change_model', 'ChangeModel'); + $this->load->model('person/Profil_change_model', 'ProfilChangeModel'); //? put the uid and pid inside the controller for further usage in views $this->uid = getAuthUID(); @@ -73,7 +73,7 @@ class Profil extends Auth_Controller //$res = json_encode($this->ChangeModel->load([$this->uid])); //? inserts new row inside the public.tbl_cis_profil_update table - $insert_res = json_encode($this->ChangeModel->insert($data)); + $insert_res = json_encode($this->ProfilChangeModel->insert($data)); echo $insert_res; diff --git a/application/models/crm/Profil_change_model.php b/application/models/person/Profil_change_model.php similarity index 100% rename from application/models/crm/Profil_change_model.php rename to application/models/person/Profil_change_model.php diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index fe4622656..a23b8c452 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -10,7 +10,7 @@ export default { }, data() { return { - + //? this reactive object contains all the field the user is able to edit and keep track of which fields he has edited editData:null, funktionen_table_options: { @@ -139,9 +139,7 @@ export default { BsModal, ], */ - popup(options) { - return BsModal.popup.bind(this)(null, options); - }, + methods: { showModal() { this.$refs.bsmodal.show() @@ -153,15 +151,10 @@ export default { }, - insertEditData(){ + submitProfilChange(){ - let editDataKeys = Object.keys(this.editData); - let this_data = Object.entries(this.data).filter(([key,value])=>{ - return editDataKeys.includes(key); - }) - - if(JSON.stringify(this_data) == JSON.stringify(Object.entries(this.editData))){ + if(this.isEditDataChanged){ console.log("the editData contains the same information",JSON.stringify(this_data),"editData values:", JSON.stringify(Object.entries(this.editData))); }else{ @@ -193,6 +186,8 @@ export default { return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]`; }, + + get_image_base64_src() { if (!this.data) { return ""; @@ -200,6 +195,11 @@ export default { return "data:image/jpeg;base64," + this.data.foto; }, + + isEditDataChanged: function(){ + return JSON.stringify(this.editData) != this.originalEditData; + }, + get_mitarbeiter_standort_telefon(){ if(this.data.standort_telefon){ return "tel:"+ this.data.telefonklappe + this.data.standort_telefon; @@ -278,21 +278,25 @@ export default { }; }, }, + created() { + - this.editData = JSON.parse( - JSON.stringify( + + //? storing an original version of the editData to check if the editData was changed by the user and is not in the original state + this.originalEditData = JSON.stringify( { Personen_Informationen : {...this.personData, vorname: this.data.vorname, nachname: this.data.nachname}, Mitarbeiter_Informatinen: this.specialData, Emails:this.data.emails, Private_Kontakte: this.data.kontakte, Private_Adressen:this.privateAdressen, - })); + }); + + this.editData = JSON.parse(this.originalEditData); + - console.log(this.data.titelpre); - }, mounted() { @@ -306,7 +310,6 @@ export default { }); - @@ -314,8 +317,8 @@ export default { template: ` - +
    {{JSON.stringify(editData,null,2)}}
    {{JSON.stringify(data.emails,null,2)}}
    +
    @@ -530,7 +533,7 @@ export default { - +
    @@ -597,20 +600,17 @@ export default { - - - + - + - --> - + @@ -845,8 +845,13 @@ export default {
    - -
    +
    +
    Funktionen
    +
    + +
    +
    +
    From 414541b6cfe783a92fa085a84387c8e13f4105a9 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Thu, 28 Dec 2023 10:43:21 +0100 Subject: [PATCH 073/201] checks if table entry for uid exists and performs update or insert on result --- application/controllers/Cis/Profil.php | 1030 +++++++++-------- public/js/apps/Cis/Profil.js | 1 - public/js/components/Cis/Profil/Base.js | 743 ------------ .../Cis/Profil/MitarbeiterProfil.js | 23 +- 4 files changed, 540 insertions(+), 1257 deletions(-) delete mode 100644 public/js/components/Cis/Profil/Base.js diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index 747a667db..a2de9497e 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -1,6 +1,7 @@ ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions? - 'View' => ['student/anrechnung_beantragen:r','user:r'], - 'foto_sperre_function' => ['student/anrechnung_beantragen:r','user:r'], - 'getView' => ['student/anrechnung_beantragen:r','user:r'], - 'editProfil' => ['student/anrechnung_beantragen:r','user:r'], - + 'index' => ['student/anrechnung_beantragen:r', 'user:r'], // TODO(chris): permissions? + 'View' => ['student/anrechnung_beantragen:r', 'user:r'], + 'foto_sperre_function' => ['student/anrechnung_beantragen:r', 'user:r'], + 'getView' => ['student/anrechnung_beantragen:r', 'user:r'], + 'editProfil' => ['student/anrechnung_beantragen:r', 'user:r'], + ]); $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); $this->load->model('crm/Student_model', 'StudentModel'); @@ -36,7 +37,7 @@ class Profil extends Auth_Controller //? put the uid and pid inside the controller for further usage in views $this->uid = getAuthUID(); $this->pid = getAuthPersonID(); - + } // ----------------------------------------------------------------------------------------------------------------- @@ -46,122 +47,139 @@ class Profil extends Auth_Controller * @return void */ - + public function index() { $this->load->view('Cis/Profil'); } - public function View($uid){ - - if($uid === $this->uid){ + public function View($uid) + { + + if ($uid === $this->uid) { $this->index(); - }else{ + } else { $this->load->view('Cis/Profil'); } - + } - - public function editProfil(){ - + + public function editProfil() + { + $json = $this->input->raw_input_stream; - $data = ["uid"=>"karpenko", "profil_changes"=>$json, "change_timestamp"=>"NOW()"]; - //? gets the data inside the public.tbl_cis_profil_update - //$res = json_encode($this->ChangeModel->load([$this->uid])); - //? inserts new row inside the public.tbl_cis_profil_update table - $insert_res = json_encode($this->ProfilChangeModel->insert($data)); - - echo $insert_res; + $data = ["uid" => $this->uid, "profil_changes" => $json, "change_timestamp" => "NOW()"]; + + $res = $this->ProfilChangeModel->load([$this->uid]); + $res = hasData($res) ? getData($res) : null; + + if (empty($res)) { + $insert_res = $this->ProfilChangeModel->insert($data); + echo json_encode($insert_res); + } else { + $update_res = $this->ProfilChangeModel->update([$this->uid], $data); + echo json_encode($update_res); + } + + } - private function viewMitarbeiterProfil($uid){ + private function viewMitarbeiterProfil($uid) + { - - if( - isSuccess($this->PersonModel->addSelect('gruppe_kurzbz, beschreibung'))&& - isSuccess($this->PersonModel->addJoin('tbl_benutzer', 'person_id')) && - isSuccess($this->PersonModel->addJoin('tbl_benutzergruppe', 'uid')) && - isSuccess($this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz'))){ - $mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid'=>$uid)); - if( isError($mailverteiler_res)){ + if ( + isSuccess($this->PersonModel->addSelect('gruppe_kurzbz, beschreibung')) && + isSuccess($this->PersonModel->addJoin('tbl_benutzer', 'person_id')) && + isSuccess($this->PersonModel->addJoin('tbl_benutzergruppe', 'uid')) && + isSuccess($this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz')) + ) { + + $mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid' => $uid)); + if (isError($mailverteiler_res)) { // catch error } - $mailverteiler_res = hasData($mailverteiler_res)? getData($mailverteiler_res) : null; - - $mailverteiler_res = array_map(function($element) { $element->mailto="mailto:".$element->gruppe_kurzbz."@".DOMAIN; return $element;},$mailverteiler_res); + $mailverteiler_res = hasData($mailverteiler_res) ? getData($mailverteiler_res) : null; + + $mailverteiler_res = array_map(function ($element) { + $element->mailto = "mailto:" . $element->gruppe_kurzbz . "@" . DOMAIN; + return $element; }, $mailverteiler_res); } - - - if( + + + if ( //! Summe der Wochenstunden wird jetzt in der hr/tbl_dienstverhaeltnis gespeichert - isSuccess($this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as Bezeichnung","tbl_organisationseinheit.bezeichnung as Organisationseinheit","datum_von as Gültig_von","datum_bis as Gültig_bis","wochenstunden as Wochenstunden"]))&& - isSuccess($this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit","oe_kurzbz")) - ){ - $benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(array('uid'=>$uid)); - if(isError($benutzer_funktion_res)){ + isSuccess($this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as Bezeichnung", "tbl_organisationseinheit.bezeichnung as Organisationseinheit", "datum_von as Gültig_von", "datum_bis as Gültig_bis", "wochenstunden as Wochenstunden"])) && + isSuccess($this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit", "oe_kurzbz")) + ) { + $benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(array('uid' => $uid)); + if (isError($benutzer_funktion_res)) { // error handling - }else{ - $benutzer_funktion_res = hasData($benutzer_funktion_res)? getData($benutzer_funktion_res) : null; + } else { + $benutzer_funktion_res = hasData($benutzer_funktion_res) ? getData($benutzer_funktion_res) : null; } } - if(isSuccess($this->BenutzerModel->addSelect(["alias"]))){ - $benutzer_res = $this->BenutzerModel->load([$uid]); - if(isError($benutzer_res)){ - // error handling - }else{ - $benutzer_res = hasData($benutzer_res)? getData($benutzer_res)[0] : null; - } + if (isSuccess($this->BenutzerModel->addSelect(["alias"]))) { + $benutzer_res = $this->BenutzerModel->load([$uid]); + if (isError($benutzer_res)) { + // error handling + } else { + $benutzer_res = hasData($benutzer_res) ? getData($benutzer_res)[0] : null; + } } - if(isSuccess($this->BenutzerModel->addSelect(["foto","foto_sperre","anrede","titelpost","titelpre","vorname","nachname"])) - && isSuccess($this->BenutzerModel->addJoin("tbl_person", "person_id"))){ + if ( + isSuccess($this->BenutzerModel->addSelect(["foto", "foto_sperre", "anrede", "titelpost", "titelpre", "vorname", "nachname"])) + && isSuccess($this->BenutzerModel->addJoin("tbl_person", "person_id")) + ) { $person_res = $this->BenutzerModel->load([$uid]); - if(isError($person_res)){ + if (isError($person_res)) { // error handling - }else{ - $person_res = hasData($person_res)? getData($person_res)[0] : null; + } else { + $person_res = hasData($person_res) ? getData($person_res)[0] : null; } } - if(isSuccess($this->MitarbeiterModel->addSelect(["kurzbz","telefonklappe", "alias","ort_kurzbz"])) - && isSuccess($this->MitarbeiterModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid"))) - { + if ( + isSuccess($this->MitarbeiterModel->addSelect(["kurzbz", "telefonklappe", "alias", "ort_kurzbz"])) + && isSuccess($this->MitarbeiterModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid")) + ) { $mitarbeiter_res = $this->MitarbeiterModel->load($uid); - if(isError($mitarbeiter_res)){ + if (isError($mitarbeiter_res)) { // error handling - }else{ - $mitarbeiter_res = hasData($mitarbeiter_res)? getData($mitarbeiter_res)[0] : null; + } else { + $mitarbeiter_res = hasData($mitarbeiter_res) ? getData($mitarbeiter_res)[0] : null; } } //? querying the telefon number of the office - if(isSuccess($this->MitarbeiterModel->addSelect(["kontakt"])) && + if ( + isSuccess($this->MitarbeiterModel->addSelect(["kontakt"])) && isSuccess($this->MitarbeiterModel->addJoin("tbl_kontakt", "tbl_mitarbeiter.standort_id = tbl_kontakt.standort_id")) - - - ){ + + + ) { $this->MitarbeiterModel->addLimit(1); - $telefon_res = $this->MitarbeiterModel->loadWhere(["mitarbeiter_uid"=>$uid, "kontakttyp"=>"telefon"]); - if(isError($telefon_res)){ + $telefon_res = $this->MitarbeiterModel->loadWhere(["mitarbeiter_uid" => $uid, "kontakttyp" => "telefon"]); + if (isError($telefon_res)) { // error handling - }else{ - $telefon_res = hasData($telefon_res)? getData($telefon_res)[0] : null; + } else { + $telefon_res = hasData($telefon_res) ? getData($telefon_res)[0] : null; } } - + $res = new stdClass(); $res->username = $uid; @@ -169,592 +187,616 @@ class Profil extends Auth_Controller //? Person Info $res->foto = $person_res->foto; $res->foto_sperre = $person_res->foto_sperre; - + $res->anrede = $person_res->anrede; $res->titelpre = $person_res->titelpre; $res->titelpost = $person_res->titelpost; $res->vorname = $person_res->vorname; $res->nachname = $person_res->nachname; - - + + //? Mitarbeiter Info - foreach($mitarbeiter_res as $key => $val){ + foreach ($mitarbeiter_res as $key => $val) { $res->$key = $val; } //? Email Info $intern_email = array(); - $intern_email+=array("type" => "intern"); - $intern_email+=array("email"=> $uid . "@" . DOMAIN); - $extern_email=array(); - $extern_email+=array("type" => "alias"); - $extern_email+=array("email" => $benutzer_res->alias . "@" . DOMAIN); - $res->emails = array($intern_email,$extern_email); - + $intern_email += array("type" => "intern"); + $intern_email += array("email" => $uid . "@" . DOMAIN); + $extern_email = array(); + $extern_email += array("type" => "alias"); + $extern_email += array("email" => $benutzer_res->alias . "@" . DOMAIN); + $res->emails = array($intern_email, $extern_email); + //? Benutzerfunktion Info $res->funktionen = $benutzer_funktion_res; - + //? Mailverteiler Info $res->mailverteiler = $mailverteiler_res; $res->standort_telefon = $telefon_res->kontakt; - + return $res; } - - private function viewStudentProfil($uid){ - + + private function viewStudentProfil($uid) + { - if( - isSuccess($this->PersonModel->addSelect('gruppe_kurzbz, beschreibung'))&& - isSuccess($this->PersonModel->addJoin('tbl_benutzer', 'person_id')) && - isSuccess($this->PersonModel->addJoin('tbl_benutzergruppe', 'uid')) && - isSuccess($this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz'))){ - $mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid'=>$uid)); - if( isError($mailverteiler_res)){ + if ( + isSuccess($this->PersonModel->addSelect('gruppe_kurzbz, beschreibung')) && + isSuccess($this->PersonModel->addJoin('tbl_benutzer', 'person_id')) && + isSuccess($this->PersonModel->addJoin('tbl_benutzergruppe', 'uid')) && + isSuccess($this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz')) + ) { + + $mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid' => $uid)); + if (isError($mailverteiler_res)) { // catch error } - $mailverteiler_res = hasData($mailverteiler_res)? getData($mailverteiler_res) : null; - - $mailverteiler_res = array_map(function($element) { $element->mailto="mailto:".$element->gruppe_kurzbz."@".DOMAIN; return $element;},$mailverteiler_res); + $mailverteiler_res = hasData($mailverteiler_res) ? getData($mailverteiler_res) : null; + + $mailverteiler_res = array_map(function ($element) { + $element->mailto = "mailto:" . $element->gruppe_kurzbz . "@" . DOMAIN; + return $element; }, $mailverteiler_res); } - - - if(isSuccess($this->BenutzerModel->addSelect(["foto","foto_sperre","anrede","titelpost","titelpre","vorname","nachname"])) - && isSuccess($this->BenutzerModel->addJoin("tbl_person", "person_id"))){ + + + if ( + isSuccess($this->BenutzerModel->addSelect(["foto", "foto_sperre", "anrede", "titelpost", "titelpre", "vorname", "nachname"])) + && isSuccess($this->BenutzerModel->addJoin("tbl_person", "person_id")) + ) { $person_res = $this->BenutzerModel->load([$uid]); - if(isError($person_res)){ + if (isError($person_res)) { // error handling - }else{ - $person_res = hasData($person_res)? getData($person_res)[0] : null; + } else { + $person_res = hasData($person_res) ? getData($person_res)[0] : null; } } - + //? personenkennzeichen ist die Spalte Matrikelnr in der Tabelle Student - if(isSuccess($this->StudentModel->addSelect(['tbl_studiengang.bezeichnung as studiengang','tbl_student.semester', 'tbl_student.verband', 'tbl_student.gruppe' ,'tbl_student.matrikelnr as personenkennzeichen'])) - && isSuccess($this->StudentModel->addJoin('tbl_studiengang', "tbl_studiengang.studiengang_kz=tbl_student.studiengang_kz"))) - { + if ( + isSuccess($this->StudentModel->addSelect(['tbl_studiengang.bezeichnung as studiengang', 'tbl_student.semester', 'tbl_student.verband', 'tbl_student.gruppe', 'tbl_student.matrikelnr as personenkennzeichen'])) + && isSuccess($this->StudentModel->addJoin('tbl_studiengang', "tbl_studiengang.studiengang_kz=tbl_student.studiengang_kz")) + ) { $student_res = $this->StudentModel->load([$uid]); - if(isError($student_res)){ + if (isError($student_res)) { // catch error } - $student_res = hasData($student_res)?getData($student_res)[0]:null; - - } - + $student_res = hasData($student_res) ? getData($student_res)[0] : null; + + } + + - //? Matrikelnummer ist die Spalte matr_nr in Person - if(isSuccess($this->BenutzerModel->addSelect(["matr_nr"])) - && isSuccess($this->BenutzerModel->addJoin("tbl_person","person_id"))){ + if ( + isSuccess($this->BenutzerModel->addSelect(["matr_nr"])) + && isSuccess($this->BenutzerModel->addJoin("tbl_person", "person_id")) + ) { $matr_res = $this->BenutzerModel->load([$uid]); - if(isError($matr_res)){ + if (isError($matr_res)) { // catch error - }else{ - $matr_res = hasData($matr_res)? getData($matr_res)[0] : []; - + } else { + $matr_res = hasData($matr_res) ? getData($matr_res)[0] : []; + } } $res = new stdClass(); - - + + $res->foto = $person_res->foto; $res->username = $uid; - + $res->anrede = $person_res->anrede; $res->titel = $person_res->titelpre; $res->vorname = $person_res->vorname; $res->nachname = $person_res->nachname; - - - $res->postnomen = $person_res->titelpost; - + + + $res->postnomen = $person_res->titelpost; + $intern_email = array(); - $intern_email+=array("type" => "intern"); - $intern_email+=array("email"=> $uid . "@" . DOMAIN); - - $res->emails = array($intern_email); - - - - + $intern_email += array("type" => "intern"); + $intern_email += array("email" => $uid . "@" . DOMAIN); + + $res->emails = array($intern_email); + + + + $res->matrikelnummer = $matr_res->matr_nr; - foreach($student_res as $key => $value){ + foreach ($student_res as $key => $value) { $res->$key = $value; } - - + + $res->mailverteiler = $mailverteiler_res; - + return $res; - - + + } - private function mitarbeiterProfil(){ - - - //? betriebsmittel soll nur der user selber sehen - if( - - isSuccess($this->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel","nummer as Nummer","ausgegebenam as Ausgegeben_am"])) - - ){ - //? betriebsmittel are not needed in a view - $betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel($this->pid); - if(isError($betriebsmittelperson_res)){ - // error handling - }else{ - $betriebsmittelperson_res = hasData($betriebsmittelperson_res)? getData($betriebsmittelperson_res) : null; - } - } - - if( - - //? kontaktdaten soll auch nur der user selbst sehen - isSuccess($this->KontaktModel->addSelect('DISTINCT ON (kontakttyp) kontakttyp, kontakt, tbl_kontakt.anmerkung, tbl_kontakt.zustellung')) && - isSuccess($this->KontaktModel->addJoin('public.tbl_standort', 'standort_id', 'LEFT')) && - isSuccess($this->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT'))&& - isSuccess($this->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum')) - ){ - $kontakte_res = $this->KontaktModel->loadWhere(array('person_id' => $this->pid)); - if(isError($kontakte_res)){ - // handle error - }else{ - $kontakte_res = hasData($kontakte_res)? getData($kontakte_res) : null; - } - - } + private function mitarbeiterProfil() + { - //$this->MitarbeiterModel->load($this->uid); + //? betriebsmittel soll nur der user selber sehen + if ( - //? FH Ausweis Austellungsdatum soll auch nur der user selbst sehen - $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid($this->uid,"Zutrittskarte"); - if(isError($zutrittskarte_ausgegebenam)){ + isSuccess($this->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel", "nummer as Nummer", "ausgegebenam as Ausgegeben_am"])) + + ) { + //? betriebsmittel are not needed in a view + $betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel($this->pid); + if (isError($betriebsmittelperson_res)) { // error handling - }else{ - $zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam)? getData($zutrittskarte_ausgegebenam)[0]->ausgegebenam : null; - //? formats the date from 01-01-2000 to 01.01.2000 - $zutrittskarte_ausgegebenam = str_replace("-",".",$zutrittskarte_ausgegebenam); + } else { + $betriebsmittelperson_res = hasData($betriebsmittelperson_res) ? getData($betriebsmittelperson_res) : null; + } + } + + if ( + + //? kontaktdaten soll auch nur der user selbst sehen + isSuccess($this->KontaktModel->addSelect('DISTINCT ON (kontakttyp) kontakttyp, kontakt, tbl_kontakt.anmerkung, tbl_kontakt.zustellung')) && + isSuccess($this->KontaktModel->addJoin('public.tbl_standort', 'standort_id', 'LEFT')) && + isSuccess($this->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT')) && + isSuccess($this->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum')) + ) { + $kontakte_res = $this->KontaktModel->loadWhere(array('person_id' => $this->pid)); + if (isError($kontakte_res)) { + // handle error + } else { + $kontakte_res = hasData($kontakte_res) ? getData($kontakte_res) : null; } + } - //? Die Adressen soll auch nur der user selber sehen - if( - - isSuccess($adresse_res = $this->AdresseModel->addSelect(array("strasse","tbl_adressentyp.bezeichnung as adr_typ","plz","ort")))&& - isSuccess($adresse_res = $this->AdresseModel->addOrder("zustelladresse","DESC"))&& - isSuccess($adresse_res = $this->AdresseModel->addOrder("sort"))&& - isSuccess($adresse_res = $this->AdresseModel->addJoin("tbl_adressentyp","typ=adressentyp_kurzbz")) - ){ - $adresse_res = $this->AdresseModel->loadWhere(array("person_id"=>$this->pid)); - if(isError($adresse_res)){ - // error handling - }else{ - $adresse_res = hasData($adresse_res)? getData($adresse_res) : null; - } + //$this->MitarbeiterModel->load($this->uid); + + //? FH Ausweis Austellungsdatum soll auch nur der user selbst sehen + $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid($this->uid, "Zutrittskarte"); + if (isError($zutrittskarte_ausgegebenam)) { + // error handling + } else { + $zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam) ? getData($zutrittskarte_ausgegebenam)[0]->ausgegebenam : null; + //? formats the date from 01-01-2000 to 01.01.2000 + $zutrittskarte_ausgegebenam = str_replace("-", ".", $zutrittskarte_ausgegebenam); + } + + + //? Die Adressen soll auch nur der user selber sehen + + if ( + + isSuccess($adresse_res = $this->AdresseModel->addSelect(array("strasse", "tbl_adressentyp.bezeichnung as adr_typ", "plz", "ort"))) && + isSuccess($adresse_res = $this->AdresseModel->addOrder("zustelladresse", "DESC")) && + isSuccess($adresse_res = $this->AdresseModel->addOrder("sort")) && + isSuccess($adresse_res = $this->AdresseModel->addJoin("tbl_adressentyp", "typ=adressentyp_kurzbz")) + ) { + $adresse_res = $this->AdresseModel->loadWhere(array("person_id" => $this->pid)); + if (isError($adresse_res)) { + // error handling + } else { + $adresse_res = hasData($adresse_res) ? getData($adresse_res) : null; } + } - //? die folgenden Informationen darf nur der eigene user sehen - + //? die folgenden Informationen darf nur der eigene user sehen - - - if( - isSuccess($this->PersonModel->addSelect('gruppe_kurzbz, beschreibung'))&& - isSuccess($this->PersonModel->addJoin('tbl_benutzer', 'person_id')) && - isSuccess($this->PersonModel->addJoin('tbl_benutzergruppe', 'uid')) && - isSuccess($this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz'))){ - $mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid'=>$this->uid)); - if( isError($mailverteiler_res)){ + + + if ( + isSuccess($this->PersonModel->addSelect('gruppe_kurzbz, beschreibung')) && + isSuccess($this->PersonModel->addJoin('tbl_benutzer', 'person_id')) && + isSuccess($this->PersonModel->addJoin('tbl_benutzergruppe', 'uid')) && + isSuccess($this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz')) + ) { + + $mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid' => $this->uid)); + if (isError($mailverteiler_res)) { // catch error } - $mailverteiler_res = hasData($mailverteiler_res)? getData($mailverteiler_res) : null; - - $mailverteiler_res = array_map(function($element) { $element->mailto="mailto:".$element->gruppe_kurzbz."@".DOMAIN; return $element;},$mailverteiler_res); + $mailverteiler_res = hasData($mailverteiler_res) ? getData($mailverteiler_res) : null; + + $mailverteiler_res = array_map(function ($element) { + $element->mailto = "mailto:" . $element->gruppe_kurzbz . "@" . DOMAIN; + return $element; }, $mailverteiler_res); } - - - if(isSuccess($this->BenutzerModel->addSelect(["foto","foto_sperre","anrede","titelpost","titelpre","vorname","nachname", "gebort", "gebdatum"])) - && isSuccess($this->BenutzerModel->addJoin("tbl_person", "person_id"))){ + + + if ( + isSuccess($this->BenutzerModel->addSelect(["foto", "foto_sperre", "anrede", "titelpost", "titelpre", "vorname", "nachname", "gebort", "gebdatum"])) + && isSuccess($this->BenutzerModel->addJoin("tbl_person", "person_id")) + ) { $person_res = $this->BenutzerModel->load([$this->uid]); - if(isError($person_res)){ + if (isError($person_res)) { // error handling - }else{ - $person_res = hasData($person_res)? getData($person_res)[0] : null; + } else { + $person_res = hasData($person_res) ? getData($person_res)[0] : null; } } - if( + if ( //! Summe der Wochenstunden wird jetzt in der hr/tbl_dienstverhaeltnis gespeichert - isSuccess($this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as Bezeichnung","tbl_organisationseinheit.bezeichnung as Organisationseinheit","datum_von as Gültig_von","datum_bis as Gültig_bis","wochenstunden as Wochenstunden"]))&& - isSuccess($this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit","oe_kurzbz")) - ){ - $benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(array('uid'=>$this->uid)); - if(isError($benutzer_funktion_res)){ + isSuccess($this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as Bezeichnung", "tbl_organisationseinheit.bezeichnung as Organisationseinheit", "datum_von as Gültig_von", "datum_bis as Gültig_bis", "wochenstunden as Wochenstunden"])) && + isSuccess($this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit", "oe_kurzbz")) + ) { + $benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(array('uid' => $this->uid)); + if (isError($benutzer_funktion_res)) { // error handling - }else{ - $benutzer_funktion_res = hasData($benutzer_funktion_res)? getData($benutzer_funktion_res) : null; + } else { + $benutzer_funktion_res = hasData($benutzer_funktion_res) ? getData($benutzer_funktion_res) : null; } } - - + + //? querying the telefon number of the office - if(isSuccess($this->MitarbeiterModel->addSelect(["mitarbeiter_uid"])) && + if ( + isSuccess($this->MitarbeiterModel->addSelect(["mitarbeiter_uid"])) && isSuccess($this->MitarbeiterModel->addJoin("tbl_kontakt", "tbl_mitarbeiter.standort_id = tbl_kontakt.standort_id")) - - - ){ + + + ) { $this->MitarbeiterModel->addLimit(1); - $telefon_res = $this->MitarbeiterModel->loadWhere(["mitarbeiter_uid"=>$this->uid, "kontakttyp"=>"telefon"]); - if(isError($telefon_res)){ + $telefon_res = $this->MitarbeiterModel->loadWhere(["mitarbeiter_uid" => $this->uid, "kontakttyp" => "telefon"]); + if (isError($telefon_res)) { // error handling - }else{ - $telefon_res = hasData($telefon_res)? getData($telefon_res)[0] : null; + } else { + $telefon_res = hasData($telefon_res) ? getData($telefon_res)[0] : null; } } - - - - - - if(isSuccess($this->MitarbeiterModel->addSelect(["kurzbz","tbl_mitarbeiter.telefonklappe", "alias","ort_kurzbz"])) + + + + + + if ( + isSuccess($this->MitarbeiterModel->addSelect(["kurzbz", "tbl_mitarbeiter.telefonklappe", "alias", "ort_kurzbz"])) && isSuccess($this->MitarbeiterModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid")) - - ){ + + ) { $mitarbeiter_res = $this->MitarbeiterModel->load($this->uid); - if(isError($mitarbeiter_res)){ - // error handling - }else{ - $mitarbeiter_res = hasData($mitarbeiter_res)? getData($mitarbeiter_res)[0] : null; - } - } - - $res = new stdClass(); - $res->foto = $person_res->foto; - $res->foto_sperre = $person_res->foto_sperre; - $res->username = $this->uid; - - $res->anrede = $person_res->anrede; - $res->titel = $person_res->titelpre; - $res->vorname = $person_res->vorname; - $res->nachname = $person_res->nachname; - - $res->gebort = $person_res->gebort; - $res->gebdatum = $person_res->gebdatum; - - $res->postnomen = $person_res->titelpost; - - - $res->adressen = $adresse_res; - $res->zutrittsdatum = $zutrittskarte_ausgegebenam; - $res->kontakte = $kontakte_res; - $res->mittel = $betriebsmittelperson_res; - - $res->mailverteiler = $mailverteiler_res; - - foreach($mitarbeiter_res as $key => $value){ - $res->$key = $value; - } - $intern_email = array(); - $intern_email+=array("type" => "intern"); - $intern_email+=array("email"=> $this->uid . "@" . DOMAIN); - $extern_email=array(); - $extern_email+=array("type" => "alias"); - $extern_email+=array("email" => $mitarbeiter_res->alias . "@" . DOMAIN); - $res->emails = array($intern_email,$extern_email); - - $res->funktionen = $benutzer_funktion_res; - - //telefon nummer von dem Standort - $res->standort_telefon = $telefon_res; - return $res; - } - - - private function studentProfil(){ - - - - //? betriebsmittel soll nur der user selber sehen - if( - - isSuccess($this->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel","nummer as Nummer","ausgegebenam as Ausgegeben_am"])) - - ){ - //? betriebsmittel are not needed in a view - $betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel($this->pid); - if(isError($betriebsmittelperson_res)){ - // error handling - }else{ - $betriebsmittelperson_res = hasData($betriebsmittelperson_res)? getData($betriebsmittelperson_res) : null; - } - } - - if( - - //? kontaktdaten soll auch nur der user selbst sehen - isSuccess($this->KontaktModel->addSelect('DISTINCT ON (kontakttyp) kontakttyp, kontakt, tbl_kontakt.anmerkung, tbl_kontakt.zustellung')) && - isSuccess($this->KontaktModel->addJoin('public.tbl_standort', 'standort_id', 'LEFT')) && - isSuccess($this->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT'))&& - isSuccess($this->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum')) - ){ - $kontakte_res = $this->KontaktModel->loadWhere(array('person_id' => $this->pid)); - if(isError($kontakte_res)){ - // handle error - }else{ - $kontakte_res = hasData($kontakte_res)? getData($kontakte_res) : null; - } - - } - - //? FH Ausweis Austellungsdatum soll auch nur der user selbst sehen - $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid($this->uid,"Zutrittskarte"); - if(isError($zutrittskarte_ausgegebenam)){ + if (isError($mitarbeiter_res)) { // error handling - }else{ - $zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam)? getData($zutrittskarte_ausgegebenam)[0]->ausgegebenam : null; - //? formats the date from 01-01-2000 to 01.01.2000 - $zutrittskarte_ausgegebenam = str_replace("-",".",$zutrittskarte_ausgegebenam); - } - - - //? Die Adressen soll auch nur der user selber sehen - - if( - - isSuccess($adresse_res = $this->AdresseModel->addSelect(array("strasse","tbl_adressentyp.bezeichnung as adr_typ","plz","ort")))&& - isSuccess($adresse_res = $this->AdresseModel->addOrder("zustelladresse","DESC"))&& - isSuccess($adresse_res = $this->AdresseModel->addOrder("sort"))&& - isSuccess($adresse_res = $this->AdresseModel->addJoin("tbl_adressentyp","typ=adressentyp_kurzbz")) - ){ - $adresse_res = $this->AdresseModel->loadWhere(array("person_id"=>$this->pid)); - if(isError($adresse_res)){ - // error handling - }else{ - $adresse_res = hasData($adresse_res)? getData($adresse_res) : null; - } - } - - //? die folgenden Informationen darf nur der eigene user sehen - - - - - - if( - isSuccess($this->PersonModel->addSelect('gruppe_kurzbz, beschreibung'))&& - isSuccess($this->PersonModel->addJoin('tbl_benutzer', 'person_id')) && - isSuccess($this->PersonModel->addJoin('tbl_benutzergruppe', 'uid')) && - isSuccess($this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz'))){ - - $mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid'=>$this->uid)); - if( isError($mailverteiler_res)){ - // catch error - } - $mailverteiler_res = hasData($mailverteiler_res)? getData($mailverteiler_res) : null; - - $mailverteiler_res = array_map(function($element) { $element->mailto="mailto:".$element->gruppe_kurzbz."@".DOMAIN; return $element;},$mailverteiler_res); - } - - - - if(isSuccess($this->BenutzerModel->addSelect(["foto","foto_sperre","anrede","titelpost","titelpre","vorname","nachname", "gebort", "gebdatum"])) - && isSuccess($this->BenutzerModel->addJoin("tbl_person", "person_id"))){ - - $person_res = $this->BenutzerModel->load([$this->uid]); - if(isError($person_res)){ - // error handling - }else{ - $person_res = hasData($person_res)? getData($person_res)[0] : null; - } - } - - if( - - isSuccess($this->BenutzergruppeModel->addSelect(['bezeichnung'])) - && isSuccess($this->BenutzergruppeModel->addJoin('tbl_gruppe', 'gruppe_kurzbz' )) - ){ - $zutrittsgruppe_res = $this->BenutzergruppeModel->loadWhere(array("uid"=>$this->uid, "zutrittssystem"=>true)); - if(isError($zutrittsgruppe_res)){ - // catch error - } - $zutrittsgruppe_res = hasData($zutrittsgruppe_res) ? getData($zutrittsgruppe_res) : null; - - } - - - - //? personenkennzeichen ist die Spalte Matrikelnr in der Tabelle Student - if(isSuccess($this->StudentModel->addSelect(['tbl_studiengang.bezeichnung as studiengang','tbl_student.semester', 'tbl_student.verband', 'tbl_student.gruppe' ,'tbl_student.matrikelnr as personenkennzeichen'])) - && isSuccess($this->StudentModel->addJoin('tbl_studiengang', "tbl_studiengang.studiengang_kz=tbl_student.studiengang_kz"))) - { - $student_res = $this->StudentModel->load([$this->uid]); - if(isError($student_res)){ - // catch error - } - $student_res = hasData($student_res)?getData($student_res)[0]:null; - - } - - - - //? Matrikelnummer ist die Spalte matr_nr in Person - if(isSuccess($this->BenutzerModel->addSelect(["matr_nr"])) - && isSuccess($this->BenutzerModel->addJoin("tbl_person","person_id"))){ - $matr_res = $this->BenutzerModel->load([$this->uid]); - if(isError($matr_res)){ - // catch error - }else{ - $matr_res = hasData($matr_res)? getData($matr_res)[0] : []; - + } else { + $mitarbeiter_res = hasData($mitarbeiter_res) ? getData($mitarbeiter_res)[0] : null; } } $res = new stdClass(); - - $res->foto = $person_res->foto; $res->foto_sperre = $person_res->foto_sperre; $res->username = $this->uid; - + $res->anrede = $person_res->anrede; $res->titel = $person_res->titelpre; $res->vorname = $person_res->vorname; $res->nachname = $person_res->nachname; - + $res->gebort = $person_res->gebort; $res->gebdatum = $person_res->gebdatum; - - $res->postnomen = $person_res->titelpost; - + + $res->postnomen = $person_res->titelpost; + + + $res->adressen = $adresse_res; + $res->zutrittsdatum = $zutrittskarte_ausgegebenam; + $res->kontakte = $kontakte_res; + $res->mittel = $betriebsmittelperson_res; + + $res->mailverteiler = $mailverteiler_res; + + foreach ($mitarbeiter_res as $key => $value) { + $res->$key = $value; + } + $intern_email = array(); + $intern_email += array("type" => "intern"); + $intern_email += array("email" => $this->uid . "@" . DOMAIN); + $extern_email = array(); + $extern_email += array("type" => "alias"); + $extern_email += array("email" => $mitarbeiter_res->alias . "@" . DOMAIN); + $res->emails = array($intern_email, $extern_email); + + $res->funktionen = $benutzer_funktion_res; + + //telefon nummer von dem Standort + $res->standort_telefon = $telefon_res; + return $res; + } + + + private function studentProfil() + { + + + + //? betriebsmittel soll nur der user selber sehen + if ( + + isSuccess($this->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel", "nummer as Nummer", "ausgegebenam as Ausgegeben_am"])) + + ) { + //? betriebsmittel are not needed in a view + $betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel($this->pid); + if (isError($betriebsmittelperson_res)) { + // error handling + } else { + $betriebsmittelperson_res = hasData($betriebsmittelperson_res) ? getData($betriebsmittelperson_res) : null; + } + } + + if ( + + //? kontaktdaten soll auch nur der user selbst sehen + isSuccess($this->KontaktModel->addSelect('DISTINCT ON (kontakttyp) kontakttyp, kontakt, tbl_kontakt.anmerkung, tbl_kontakt.zustellung')) && + isSuccess($this->KontaktModel->addJoin('public.tbl_standort', 'standort_id', 'LEFT')) && + isSuccess($this->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT')) && + isSuccess($this->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum')) + ) { + $kontakte_res = $this->KontaktModel->loadWhere(array('person_id' => $this->pid)); + if (isError($kontakte_res)) { + // handle error + } else { + $kontakte_res = hasData($kontakte_res) ? getData($kontakte_res) : null; + } + + } + + //? FH Ausweis Austellungsdatum soll auch nur der user selbst sehen + $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid($this->uid, "Zutrittskarte"); + if (isError($zutrittskarte_ausgegebenam)) { + // error handling + } else { + $zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam) ? getData($zutrittskarte_ausgegebenam)[0]->ausgegebenam : null; + //? formats the date from 01-01-2000 to 01.01.2000 + $zutrittskarte_ausgegebenam = str_replace("-", ".", $zutrittskarte_ausgegebenam); + } + + + //? Die Adressen soll auch nur der user selber sehen + + if ( + + isSuccess($adresse_res = $this->AdresseModel->addSelect(array("strasse", "tbl_adressentyp.bezeichnung as adr_typ", "plz", "ort"))) && + isSuccess($adresse_res = $this->AdresseModel->addOrder("zustelladresse", "DESC")) && + isSuccess($adresse_res = $this->AdresseModel->addOrder("sort")) && + isSuccess($adresse_res = $this->AdresseModel->addJoin("tbl_adressentyp", "typ=adressentyp_kurzbz")) + ) { + $adresse_res = $this->AdresseModel->loadWhere(array("person_id" => $this->pid)); + if (isError($adresse_res)) { + // error handling + } else { + $adresse_res = hasData($adresse_res) ? getData($adresse_res) : null; + } + } + + //? die folgenden Informationen darf nur der eigene user sehen + + + + + + if ( + isSuccess($this->PersonModel->addSelect('gruppe_kurzbz, beschreibung')) && + isSuccess($this->PersonModel->addJoin('tbl_benutzer', 'person_id')) && + isSuccess($this->PersonModel->addJoin('tbl_benutzergruppe', 'uid')) && + isSuccess($this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz')) + ) { + + $mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid' => $this->uid)); + if (isError($mailverteiler_res)) { + // catch error + } + $mailverteiler_res = hasData($mailverteiler_res) ? getData($mailverteiler_res) : null; + + $mailverteiler_res = array_map(function ($element) { + $element->mailto = "mailto:" . $element->gruppe_kurzbz . "@" . DOMAIN; + return $element; }, $mailverteiler_res); + } + + + + if ( + isSuccess($this->BenutzerModel->addSelect(["foto", "foto_sperre", "anrede", "titelpost", "titelpre", "vorname", "nachname", "gebort", "gebdatum"])) + && isSuccess($this->BenutzerModel->addJoin("tbl_person", "person_id")) + ) { + + $person_res = $this->BenutzerModel->load([$this->uid]); + if (isError($person_res)) { + // error handling + } else { + $person_res = hasData($person_res) ? getData($person_res)[0] : null; + } + } + + if ( + + isSuccess($this->BenutzergruppeModel->addSelect(['bezeichnung'])) + && isSuccess($this->BenutzergruppeModel->addJoin('tbl_gruppe', 'gruppe_kurzbz')) + ) { + $zutrittsgruppe_res = $this->BenutzergruppeModel->loadWhere(array("uid" => $this->uid, "zutrittssystem" => true)); + if (isError($zutrittsgruppe_res)) { + // catch error + } + $zutrittsgruppe_res = hasData($zutrittsgruppe_res) ? getData($zutrittsgruppe_res) : null; + + } + + + + //? personenkennzeichen ist die Spalte Matrikelnr in der Tabelle Student + if ( + isSuccess($this->StudentModel->addSelect(['tbl_studiengang.bezeichnung as studiengang', 'tbl_student.semester', 'tbl_student.verband', 'tbl_student.gruppe', 'tbl_student.matrikelnr as personenkennzeichen'])) + && isSuccess($this->StudentModel->addJoin('tbl_studiengang', "tbl_studiengang.studiengang_kz=tbl_student.studiengang_kz")) + ) { + $student_res = $this->StudentModel->load([$this->uid]); + if (isError($student_res)) { + // catch error + } + $student_res = hasData($student_res) ? getData($student_res)[0] : null; + + } + + + + //? Matrikelnummer ist die Spalte matr_nr in Person + if ( + isSuccess($this->BenutzerModel->addSelect(["matr_nr"])) + && isSuccess($this->BenutzerModel->addJoin("tbl_person", "person_id")) + ) { + $matr_res = $this->BenutzerModel->load([$this->uid]); + if (isError($matr_res)) { + // catch error + } else { + $matr_res = hasData($matr_res) ? getData($matr_res)[0] : []; + + } + } + + $res = new stdClass(); + + + $res->foto = $person_res->foto; + $res->foto_sperre = $person_res->foto_sperre; + $res->username = $this->uid; + + $res->anrede = $person_res->anrede; + $res->titel = $person_res->titelpre; + $res->vorname = $person_res->vorname; + $res->nachname = $person_res->nachname; + + $res->gebort = $person_res->gebort; + $res->gebdatum = $person_res->gebdatum; + + $res->postnomen = $person_res->titelpost; + $intern_email = array(); - $intern_email+=array("type" => "intern"); - $intern_email+=array("email"=> $this->uid . "@" . DOMAIN); - + $intern_email += array("type" => "intern"); + $intern_email += array("email" => $this->uid . "@" . DOMAIN); + $res->emails = array($intern_email); $res->adressen = $adresse_res; $res->zutrittsdatum = $zutrittskarte_ausgegebenam; $res->kontakte = $kontakte_res; $res->mittel = $betriebsmittelperson_res; $res->matrikelnummer = $matr_res->matr_nr; - foreach($student_res as $key => $value){ + foreach ($student_res as $key => $value) { $res->$key = trim($value); } $res->zuttritsgruppen = $zutrittsgruppe_res; - - + + $res->mailverteiler = $mailverteiler_res; - + return $res; - - + + } - public function getView($uid){ - - + public function getView($uid) + { + + $uid = $uid != "Profil" ? $uid : null; - - - + + + $isMitarbeiter = null; - if($uid){ - - if(isSuccess($this->PersonModel->addSelect(["person_id"]))){ + if ($uid) { + + if (isSuccess($this->PersonModel->addSelect(["person_id"]))) { $pid = $this->PersonModel->getByUid($uid); $pid = hasData($pid) ? getData($pid)[0] : null; - + } - if(!$pid){ + if (!$pid) { //! if no Person_ID was found, null is returned and the vue component will show a 404 View return null; } - - $isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($uid); - } - else - $isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($this->uid); - - if(isError($isMitarbeiter)){ + $isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($uid); + } else + $isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($this->uid); + + + if (isError($isMitarbeiter)) { //catch error } $isMitarbeiter = hasData($isMitarbeiter) ? getData($isMitarbeiter) : null; - - + + $res = new stdClass(); - - if($uid == $this->uid || !$uid ){ + + if ($uid == $this->uid || !$uid) { // if the $uid is empty, then no payload was supplied and the own profile is being requested - if($isMitarbeiter ) { - $res->view= "MitarbeiterProfil"; + if ($isMitarbeiter) { + $res->view = "MitarbeiterProfil"; $res->data = $this->mitarbeiterProfil(); $res->data->pid = $this->pid; - } - else { - $res->view= "StudentProfil"; + } else { + $res->view = "StudentProfil"; $res->data = $this->studentProfil(); $res->data->pid = $this->pid; } - } - elseif($uid){ + } elseif ($uid) { // if an $uid was passed as payload to the function then the user is trying to view another profile - if($isMitarbeiter ){ - $res->view= "ViewMitarbeiterProfil"; - $res->data= $this->viewMitarbeiterProfil($uid); - - } - else { - $res->view= "ViewStudentProfil"; - $res->data= $this->viewStudentProfil($uid); - + if ($isMitarbeiter) { + $res->view = "ViewMitarbeiterProfil"; + $res->data = $this->viewMitarbeiterProfil($uid); + + } else { + $res->view = "ViewStudentProfil"; + $res->data = $this->viewStudentProfil($uid); + } } echo json_encode($res); - + } - public function foto_sperre_function($value){ + public function foto_sperre_function($value) + { //? Nur der Index User hat die Erlaubniss das Profilbild zu sperren - $res = $this->PersonModel->update($this->pid,array("foto_sperre"=>$value)); - - if(isError($res)){ + $res = $this->PersonModel->update($this->pid, array("foto_sperre" => $value)); + + if (isError($res)) { echo json_encode("error encountered when updating foto_sperre"); return; // error handling - }else{ + } else { //? select the value of the column foto_sperre to return - if(isSuccess($this->PersonModel->addSelect("foto_sperre"))){ + if (isSuccess($this->PersonModel->addSelect("foto_sperre"))) { $res = $this->PersonModel->load($this->pid); - if(isError($res)){ + if (isError($res)) { // error handling } $res = hasData($res) ? getData($res)[0] : null; } - + } echo json_encode($res); } diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index 989a1b5e2..2547f9e48 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -3,7 +3,6 @@ import StudentProfil from "../../components/Cis/Profil/StudentProfil.js"; import MitarbeiterProfil from "../../components/Cis/Profil/MitarbeiterProfil.js"; import ViewStudentProfil from "../../components/Cis/Profil/StudentViewProfil.js"; import ViewMitarbeiterProfil from "../../components/Cis/Profil/MitarbeiterViewProfil.js"; -import Base from "../../components/Cis/Profil/Base.js"; import fhcapifactory from "../api/fhcapifactory.js"; Vue.$fhcapi = fhcapifactory; diff --git a/public/js/components/Cis/Profil/Base.js b/public/js/components/Cis/Profil/Base.js deleted file mode 100644 index ce6ca16f5..000000000 --- a/public/js/components/Cis/Profil/Base.js +++ /dev/null @@ -1,743 +0,0 @@ -import fhcapifactory from "../../../apps/api/fhcapifactory.js"; -import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; - -export default { - components: { - CoreFilterCmpt, - }, - data() { - return { - collapseIconFunktionen: true, - collapseIconBetriebsmittel: true, - funktionen_table_options: { - height: 300, - layout: "fitColumns", - responsiveLayout: "collapse", - responsiveLayoutCollapseUseFormatters: false, - responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, - data: [ - { - Bezeichnung: "", - Organisationseinheit: "", - Gültig_von: "", - Gültig_bis: "", - Wochenstunden: "", - }, - ], - columns: [ - //? option when wanting to hide the collapsed list - - { - title: - "", - field: "collapse", - headerSort: false, - headerFilter: false, - formatter: "responsiveCollapse", - maxWidth: 40, - headerClick: this.collapseFunction, - }, - { - title: "Bezeichnung", - field: "Bezeichnung", - headerFilter: true, - minWidth: 200, - }, - { - title: "Organisationseinheit", - field: "Organisationseinheit", - headerFilter: true, - minWidth: 200, - }, - { - title: "Gültig_von", - field: "Gültig_von", - headerFilter: true, - resizable: true, - minWidth: 200, - }, - { - title: "Gültig_bis", - field: "Gültig_bis", - headerFilter: true, - resizable: true, - minWidth: 200, - }, - { - title: "Wochenstunden", - field: "Wochenstunden", - headerFilter: true, - minWidth: 200, - }, - ], - }, - betriebsmittel_table_options: { - height: 300, - layout: "fitColumns", - responsiveLayout: "collapse", - responsiveLayoutCollapseUseFormatters: false, - responsiveLayoutCollapseFormatter: Vue.$collapseFormatter, - data: [{ betriebsmittel: "", Nummer: "", Ausgegeben_am: "" }], - columns: [ - { - title: - "", - field: "collapse", - headerSort: false, - headerFilter: false, - formatter: "responsiveCollapse", - maxWidth: 40, - headerClick: this.collapseFunction, - }, - { - title: "Betriebsmittel", - field: "betriebsmittel", - headerFilter: true, - minWidth: 200, - }, - { - title: "Nummer", - field: "Nummer", - headerFilter: true, - resizable: true, - minWidth: 200, - }, - { - title: "Ausgegeben_am", - field: "Ausgegeben_am", - headerFilter: true, - minWidth: 200, - }, - ], - }, - }; - }, - - //? this is the prop passed to the dynamic component with the custom data of the view - props: ["data"], - methods: { - sperre_foto_function() { - if (!this.data) { - return; - } - fhcapifactory.UserData.sperre_foto_function(!this.data.foto_sperre).then((res) => { - this.data.foto_sperre = res.data.foto_sperre; - }); - }, - collapseFunction(e, column) { - //* the if of the column has to match with the name of the responsive data in the vue component - this[e.target.id] = !this[e.target.id]; - - //* gets all event icons of the different rows to use the onClick event later - let allClickableIcons = column._column.cells.map((row) => { - return row.element.children[0]; - }); - - //* changes the icon that shows or hides all the collapsed columns - //* if the replace function does not find the class to replace, it just simply returns false - if (this[e.target.id]) { - e.target.classList.replace("fa-angle-up", "fa-angle-down"); - } else { - e.target.classList.replace("fa-angle-down", "fa-angle-up"); - } - - //* changes the icon for every collapsed column to open or closed - if (this[e.target.id]) { - allClickableIcons - .filter((column) => { - return !column.classList.contains("open"); - }) - .forEach((col) => { - col.click(); - }); - } else { - allClickableIcons - .filter((column) => { - return column.classList.contains("open"); - }) - .forEach((col) => { - col.click(); - }); - } - }, - }, - - computed: { - refreshMailTo() { - return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]`; - }, - - get_image_base64_src() { - if (!this.data) { - return ""; - } - return "data:image/jpeg;base64," + this.data.foto; - }, - //? this computed function returns all the informations for the first column in the profil - personData() { - if (!this.data) { - return {}; - } - - return { - Username: this.data.username, - Anrede: this.data.anrede, - Titel: this.data.titel, - Postnomen: this.data.postnomen, - }; - }, - - personKontakt() { - if (!this.data) { - return {}; - } - - return { - emails: this.data.emails, - - }; - }, - - specialData() { - if (!this.data) { - return {}; - } - - return { - Geburtsdatum: this.data.gebdatum, - Geburtsort: this.data.gebort, - Kurzzeichen: this.data.kurzbz, - Telefon: this.data.telefonklappe, - Büro: this.data.ort_kurzbz, - }; - }, - - privateKontakte() { - if (!this.data) { - return {}; - } - - return this.data.kontakte; - - }, - - privateAdressen() { - if (!this.data) { - return {}; - } - - return this.data.adressen; - - }, - - - kontaktInfo() { - if (!this.data) { - return {}; - } - - return { - FhAusweisStatus: this.data.zutrittsdatum, - emails: this.data.emails, - Kontakte: this.data.kontakte, - Adressen: this.data.adressen, - }; - }, - }, - - mounted() { - this.$refs.betriebsmittelTable.tabulator.on("tableBuilt", () => { - this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); - }); - - this.$refs.funktionenTable.tabulator.on("tableBuilt", () => { - this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); - }); - }, - - template: ` - -
    - -
    - -
    - - - -
    - - - -
    - - -
    -
    -
    - Der FH Ausweis ist am {{data.zutrittsdatum}} ausgegeben worden. -
    -
    -
    - -
    - - - -
    - - - - - - -
    - - - - - - - - - - - - - - - - - - -
    -
    -
    - - -
    -
    - MitarbeiterIn -
    -
    - - - - - -
    - - - - - - -
    -
    -
    - - - - -
    - - - -
    -
    -
    - -
    - - - - - -
    -
    -
    -
    - - - -
    -
    -
    -
    - - - -
    -
    -
    - - -
    - - - - - - - - -
    -
    - - - -
    -
    - - -
    - - - -
    -
    -
    -
    -
    - - -
    - -
    - -
    - Mitarbeiter Information -
    -
    -
    -
    -
    - - -
    -
    -
    - -
    - -
    - -
    - - - - - -
    - - - - - - - - - - - - -
    - -
    -
    -
    - - -
    -
    - Mails -
    - -
    - - - -
    - - - - - - -
    -
    -
    - - {{email.email}} - - -
    -
    -
    - - - - - - - - - -
    - - -
    -
    -
    - - -
    -
    -
    -
    - Private Kontakte -
    -
    - -
    - -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    - - -
    -
    - -
    -
    -
    -
    - - - -
    -
    -
    -
    Private Adressen
    -
    - -
    - -
    - - - -
    -
    -
    - - -
    -
    - -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    - - -
    -
    -
    -
    -
    -
    -
    - - - - - -
    - - - - - - -
    - - - - -
    -
    -

    Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

    -
    -
    - - - - - - -
    - - -
    - -
    - - -
    - -
    - - -
    - - - - - - - - -
    - - - - - -
    - - - - - - - -
    -
    - -
    -
    - Quick Links -
    - -
    - - - - -
    -
    - - - -
    - -
    - - - - -
    -
    - Mailverteilers -
    -
    - -
    Sie sind Mitgglied in folgenden Verteilern:
    -
    -
    -
    -
    - - - -
    - -
    - -
    -
    {{verteiler.beschreibung}}
    -
    - -
    -
    - - - - - -
    - - -
    - - -
    - - - - - - - - -
    - - -
    - - `, -}; diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index a23b8c452..ad1fe4a9d 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -135,10 +135,6 @@ export default { onShownBsModal: Function */ }, - /* mixins: [ - BsModal, - - ], */ methods: { showModal() { @@ -152,22 +148,11 @@ export default { submitProfilChange(){ - - if(this.isEditDataChanged){ - - console.log("the editData contains the same information",JSON.stringify(this_data),"editData values:", JSON.stringify(Object.entries(this.editData))); - }else{ - console.log("the editData HAS DIFFERENT INFORMATION"); + //? inserts new row in public.tbl_cis_profil_update + Vue.$fhcapi.UserData.editProfil(this.editData); + } - - /* if(somethingChanged){ - console.log("the editData contains changed information"); - }else{ - console.log("the editData does not contain changed information"); - } */ - //? insert editData into a new row inside the public.tbl_cis_profil_update table - //Vue.$fhcapi.UserData.editProfil(this.editData); }, sperre_foto_function() { if (!this.data) { @@ -608,7 +593,7 @@ export default { From 59b848c576df20a43c6164bf60ecfb6d43f9f373 Mon Sep 17 00:00:00 2001 From: Simon Gschnell Date: Thu, 28 Dec 2023 11:51:58 +0100 Subject: [PATCH 074/201] fetches profil update request if an entry with uid in table public.tbl_cis_profil_update exists --- application/controllers/Cis/Profil.php | 28 ++++++++- public/js/apps/Cis/Profil.js | 1 + public/js/apps/api/userdata.js | 25 +++----- .../Cis/Profil/MitarbeiterProfil.js | 59 +++++++++---------- .../Cis/Profil/MitarbeiterViewProfil.js | 2 +- 5 files changed, 63 insertions(+), 52 deletions(-) diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index a2de9497e..d46217fea 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -21,6 +21,7 @@ class Profil extends Auth_Controller 'foto_sperre_function' => ['student/anrechnung_beantragen:r', 'user:r'], 'getView' => ['student/anrechnung_beantragen:r', 'user:r'], 'editProfil' => ['student/anrechnung_beantragen:r', 'user:r'], + ]); $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); @@ -90,6 +91,7 @@ class Profil extends Auth_Controller } + private function viewMitarbeiterProfil($uid) { @@ -179,6 +181,7 @@ class Profil extends Auth_Controller } } + $res = new stdClass(); $res->username = $uid; @@ -482,6 +485,15 @@ class Profil extends Auth_Controller } } + + //? querying if the user already has a pending profil information update request + $editData_res = $this->ProfilChangeModel->load([$this->uid]); + if(isError($editData_res)){ + //error handling + }else{ + $editData_res = hasData($editData_res) ? getData($editData_res)[0] : null; + } + $res = new stdClass(); $res->foto = $person_res->foto; $res->foto_sperre = $person_res->foto_sperre; @@ -520,6 +532,10 @@ class Profil extends Auth_Controller //telefon nummer von dem Standort $res->standort_telefon = $telefon_res; + + $res->editData = json_decode($editData_res->profil_changes); + $res->editDataTimestamp = $editData_res->change_timestamp; + return $res; } @@ -672,6 +688,15 @@ class Profil extends Auth_Controller } } + //? querying if the user already has a pending profil information update request + $editData_res = $this->ProfilChangeModel->load([$this->uid]); + if(isError($editData_res)){ + //error handling + }else{ + $editData_res = hasData($editData_res) ? getData($editData_res)[0] : null; + } + + $res = new stdClass(); @@ -708,7 +733,8 @@ class Profil extends Auth_Controller $res->mailverteiler = $mailverteiler_res; - + $res->editData = json_decode($editData_res->profil_changes); + $res->editDataTimestamp = $editData_res->change_timestamp; return $res; diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index 2547f9e48..2969d62f2 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -111,6 +111,7 @@ const app = Vue.createApp({ this.view = res.data?.view; this.data = res.data?.data; + }); }, template:` diff --git a/public/js/apps/api/userdata.js b/public/js/apps/api/userdata.js index d671cbd66..8e7ea9b47 100644 --- a/public/js/apps/api/userdata.js +++ b/public/js/apps/api/userdata.js @@ -5,6 +5,12 @@ export default { `/Cis/Profil/editProfil`; return axios.post(url,payload); }, + + getEditProfil: function() { + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ + `/Cis/Profil/getEditProfil`; + return axios.get(url); + }, isMitarbeiterOrStudent: function(uid) { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root @@ -25,24 +31,7 @@ export default { }, - indexProfilInformaion: function(uid, view=false) { - const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ - `/Cis/Profil/indexProfilInformaion/${uid}/${view}`; - - return axios.get(url); - }, - mitarbeiterProfil: function() { - const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ - `/Cis/Profil/mitarbeiterProfil/`; - - return axios.get(url); - }, - studentProfil: function(uid, view=false) { - const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ - `/Cis/Profil/studentProfil/${uid}/${view}`; - - return axios.get(url); - }, + diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index ad1fe4a9d..5630fa8ee 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -11,8 +11,7 @@ export default { data() { return { - //? this reactive object contains all the field the user is able to edit and keep track of which fields he has edited - editData:null, + funktionen_table_options: { height: 300, layout: "fitColumns", @@ -150,7 +149,7 @@ export default { submitProfilChange(){ if(this.isEditDataChanged){ //? inserts new row in public.tbl_cis_profil_update - Vue.$fhcapi.UserData.editProfil(this.editData); + Vue.$fhcapi.UserData.editProfil(this.data.editData); } }, @@ -182,7 +181,7 @@ export default { isEditDataChanged: function(){ - return JSON.stringify(this.editData) != this.originalEditData; + return JSON.stringify(this.data.editData) != this.originalEditData; }, get_mitarbeiter_standort_telefon(){ @@ -266,23 +265,22 @@ export default { created() { + if(this.data.editData){ + this.originalEditData = JSON.stringify(this.data.editData); + }else{ + //? storing an original version of the editData to check if the editData was changed by the user and is not in the original state + this.originalEditData = JSON.stringify( + { + Personen_Informationen : {...this.personData, vorname: this.data.vorname, nachname: this.data.nachname}, + Mitarbeiter_Informatinen: this.specialData, + Emails:this.data.emails, + Private_Kontakte: this.data.kontakte, + Private_Adressen:this.privateAdressen, + }); - - - //? storing an original version of the editData to check if the editData was changed by the user and is not in the original state - this.originalEditData = JSON.stringify( - { - Personen_Informationen : {...this.personData, vorname: this.data.vorname, nachname: this.data.nachname}, - Mitarbeiter_Informatinen: this.specialData, - Emails:this.data.emails, - Private_Kontakte: this.data.kontakte, - Private_Adressen:this.privateAdressen, - }); + this.data.editData = JSON.parse(this.originalEditData); - this.editData = JSON.parse(this.originalEditData); - - - + } }, mounted() { @@ -295,14 +293,11 @@ export default { }); - - - }, template: ` -
    {{JSON.stringify(editData,null,2)}}
    {{JSON.stringify(data.emails,null,2)}}
    +
    {{JSON.stringify(data.editData,null,2)}}
    {{JSON.stringify(data.emails,null,2)}}
    @@ -522,7 +517,7 @@ export default {
    -
    +