mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 08:52:21 +00:00
first template for the hr view to accept or deny profil update requests
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ProfilUpdate extends Auth_Controller
|
||||
{
|
||||
|
||||
public function __construct(){
|
||||
parent::__construct([
|
||||
'index' => ['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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
$includesArray = ['title'=> 'Profil Änderungen',
|
||||
'customJSModules'=> ['public/js/apps/Cis/ProfilUpdateRequests.js'],
|
||||
'tabulator5'=> true,
|
||||
'customCSSs'=>['public/css/components/FilterComponent.css'],
|
||||
];
|
||||
|
||||
$this->load->view('templates/CISHTML-Header',$includesArray);
|
||||
?>
|
||||
|
||||
<div id="content">
|
||||
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('templates/CISHTML-Footer',$includesArray); ?>
|
||||
@@ -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:`
|
||||
<div>
|
||||
|
||||
<core-filter-cmpt title="Update Requests" ref="UpdatesTable" :tabulator-options="profil_updates_table_options" tableOnly :sideMenu="false" />
|
||||
|
||||
</div>`,
|
||||
|
||||
})
|
||||
|
||||
app.mount('#content');
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ export default {
|
||||
<template v-for="(object,objectkey) in value" >
|
||||
<div class="col-12 ">
|
||||
<div class="row gy-3">
|
||||
<div v-for="(propertyValue,propertyKey) in object" class="col-12" >
|
||||
<div v-for="(propertyValue,propertyKey) in object" class="col-6" >
|
||||
|
||||
<div class="form-underline ">
|
||||
<div class="form-underline-titel">
|
||||
@@ -155,7 +155,7 @@ export default {
|
||||
|
||||
</div>
|
||||
<div v-else class="row gy-3">
|
||||
<div v-for="(propertyValue,propertyKey) in value" class="col-12">
|
||||
<div v-for="(propertyValue,propertyKey) in value" class="col-6">
|
||||
|
||||
<div class="form-underline ">
|
||||
<div class="form-underline-titel">
|
||||
|
||||
@@ -30,8 +30,6 @@ export default {
|
||||
},
|
||||
],
|
||||
columns: [
|
||||
//? option when wanting to hide the collapsed list
|
||||
|
||||
{
|
||||
title:
|
||||
"<i id='collapseIconFunktionen' role='button' class='fa-solid fa-angle-down '></i>",
|
||||
@@ -492,7 +490,7 @@ export default {
|
||||
|
||||
<!-- Bearbeiten Button -->
|
||||
<div class="col-md-6 col-sm-12 ">
|
||||
<button @click="showModal" type="button" class="text-start w-100 btn btn-outline-primary" >
|
||||
<button @click="showModal" type="button" class="text-start w-100 btn btn-outline-primary" >
|
||||
<div class="row">
|
||||
<div class="col-2">
|
||||
<i class="fa fa-edit"></i>
|
||||
@@ -736,7 +734,7 @@ export default {
|
||||
<!-- FIRST TABLE -->
|
||||
<div class="col-12 mb-4" >
|
||||
|
||||
<core-filter-cmpt ref="funktionenTable" :tabulator-options="funktionen_table_options" tableOnly :sideMenu="false" />
|
||||
<core-filter-cmpt title="Funktionen" ref="funktionenTable" :tabulator-options="funktionen_table_options" tableOnly :sideMenu="false" />
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user