diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index 687f2becc..9f692b0a9 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -17,7 +17,6 @@ class Profil extends Auth_Controller { parent::__construct([ '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'], @@ -35,7 +34,7 @@ class Profil extends Auth_Controller $this->load->model('person/Kontakt_model', 'KontaktModel'); $this->load->model('person/Profil_change_model', 'ProfilChangeModel'); - //? put the uid and pid inside the controller for further usage in views + //? put the uid and pid inside the controller to reuse in controller $this->uid = getAuthUID(); $this->pid = getAuthPersonID(); diff --git a/application/controllers/Cis/ProfilUpdate.php b/application/controllers/Cis/ProfilUpdate.php new file mode 100644 index 000000000..5e410bace --- /dev/null +++ b/application/controllers/Cis/ProfilUpdate.php @@ -0,0 +1,42 @@ + ['student/anrechnung_beantragen:r', 'user:r'], // TODO(chris): permissions? + 'getAllRequests' => ['student/anrechnung_beantragen:r', 'user:r'], + + ]); + //? put the uid and pid inside the controller to reuse in controller + $this->uid = getAuthUID(); + $this->pid = getAuthPersonID(); + + $this->load->model('person/Profil_change_model','ProfilChangeModel'); + } + + + public function index(){ + $this->load->view('Cis/ProfilUpdate'); + } + + public function getAllRequests(){ + + $res = $this->ProfilChangeModel->load(); + if(isError($res)){ + // catch exception + echo $res->retval->data; + return; + }else{ + $res = hasData($res)? getData($res) : null; + } + echo json_encode($res); + } +} \ No newline at end of file diff --git a/application/views/Cis/ProfilUpdate.php b/application/views/Cis/ProfilUpdate.php new file mode 100644 index 000000000..f55fd4dc1 --- /dev/null +++ b/application/views/Cis/ProfilUpdate.php @@ -0,0 +1,15 @@ + 'Profil Änderungen', + 'customJSModules'=> ['public/js/apps/Cis/ProfilUpdateRequests.js'], + 'tabulator5'=> true, + 'customCSSs'=>['public/css/components/FilterComponent.css'], + ]; + +$this->load->view('templates/CISHTML-Header',$includesArray); +?> + +
+ +
+ +load->view('templates/CISHTML-Footer',$includesArray); ?> \ No newline at end of file diff --git a/public/js/apps/Cis/ProfilUpdateRequests.js b/public/js/apps/Cis/ProfilUpdateRequests.js new file mode 100644 index 000000000..4a518796c --- /dev/null +++ b/public/js/apps/Cis/ProfilUpdateRequests.js @@ -0,0 +1,73 @@ +import fhcapifactory from "../api/fhcapifactory.js"; +import {CoreFilterCmpt} from '../../components/filter/Filter.js' +Vue.$fhcapi = fhcapifactory; + +const app = Vue.createApp({ + components:{ + CoreFilterCmpt, + }, + data(){ + return{ + profil_updates_table_options:{ + height:300, + layout:'fitColumns', + responsiveLayout: "collapse", + data: [ + { + uid: "", + profil_changes: "", + change_timestamp: "", + }, + ], + columns: [ + { + title: "Uid", + field: "uid", + minWidth: 200, + }, + { + title: "Update", + field: "profil_changes", + minWidth: 200, + }, + { + title: "Date", + field: "change_timestamp", + resizable: true, + minWidth: 200, + }, + + ], + }, + } + }, + methods:{ + sideMenuFunction: function(){ + console.log("test from the side menu"); + } + }, + created(){ + + + + + }, + mounted(){ + + this.$refs.UpdatesTable.tabulator.on('tableBuilt',()=>{ + Vue.$fhcapi.UserData.getProfilUpdateRequest().then((data)=>{ + this.$refs.UpdatesTable.tabulator.setData(data.data); + }).catch(()=>{}); + + }); + }, + template:` +
+ + + +
`, + +}) + +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 8e7ea9b47..bb0309423 100644 --- a/public/js/apps/api/userdata.js +++ b/public/js/apps/api/userdata.js @@ -1,5 +1,8 @@ export default { + + //! API Calls for Profil Views + editProfil: function(payload) { const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router+ `/Cis/Profil/editProfil`; @@ -31,6 +34,12 @@ export default { }, + //! API Calls for Profil Update View + + getProfilUpdateRequest: function(){ + const url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/Cis/ProfilUpdate/getAllRequests'; + return axios.get(url); + } diff --git a/public/js/components/Cis/Profil/EditProfil.js b/public/js/components/Cis/Profil/EditProfil.js index 84997caea..b29c1c345 100644 --- a/public/js/components/Cis/Profil/EditProfil.js +++ b/public/js/components/Cis/Profil/EditProfil.js @@ -132,7 +132,7 @@ export default {