diff --git a/application/libraries/StundenplanLib.php b/application/libraries/StundenplanLib.php index 6d53a2e2e..7ed64da2c 100644 --- a/application/libraries/StundenplanLib.php +++ b/application/libraries/StundenplanLib.php @@ -229,9 +229,10 @@ class StundenplanLib $this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel'); $is_mitarbeiter = getData($this->_ci->MitarbeiterModel->isMitarbeiter(getAuthUID())); - - if ($is_mitarbeiter) { - $reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date, $ort_kurzbz); + + if ($is_mitarbeiter && empty($ort_kurzbz)) { + // request for personal lvplan show only reservations of logged in user + $reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date); } else { // querying the reservierungen $reservierungen = $this->_ci->ReservierungModel->getReservierungen($start_date, $end_date, $ort_kurzbz); diff --git a/application/models/ressource/Reservierung_model.php b/application/models/ressource/Reservierung_model.php index 789ff3d9c..0c391ea20 100644 --- a/application/models/ressource/Reservierung_model.php +++ b/application/models/ressource/Reservierung_model.php @@ -76,7 +76,7 @@ class Reservierung_model extends DB_Model * * @return stdClass */ - public function getReservierungenMitarbeiter($start_date, $end_date, $ort_kurzbz = null) + public function getReservierungenMitarbeiter($start_date, $end_date) { $raum_reservierungen_query = "SELECT res.*, beginn, ende, @@ -89,7 +89,6 @@ class Reservierung_model extends DB_Model JOIN lehre.tbl_stunde ON lehre.tbl_stunde.stunde = res.stunde WHERE res.uid = ? AND datum >= ? AND datum <= ?"; -// $subquery = is_null($ort_kurzbz)? $lvplan_reservierungen_query:$raum_reservierungen_query; $subquery = $raum_reservierungen_query; diff --git a/public/js/apps/Cis.js b/public/js/apps/Cis.js index 73703b42b..5b76c5721 100644 --- a/public/js/apps/Cis.js +++ b/public/js/apps/Cis.js @@ -50,7 +50,7 @@ const app = Vue.createApp({ defaultaction: { type: "link", renderif: function(data) { - if(data.content_id === "N/A"){ + if(data.content_id === null){ return false; } return true; @@ -79,7 +79,7 @@ const app = Vue.createApp({ icon: "fas fa-info-circle", type: "link", renderif: function(data) { - if(data.content_id === "N/A"){ + if(data.content_id === null){ return false; } return true; diff --git a/public/js/components/searchbar/result/template/action.js b/public/js/components/searchbar/result/template/action.js index eb4b1db3a..fdcbfaee8 100644 --- a/public/js/components/searchbar/result/template/action.js +++ b/public/js/components/searchbar/result/template/action.js @@ -19,10 +19,24 @@ export default { if (this.action.type === 'function') this.action.action(this.res); this.$emit('actionexecuted'); + }, + renderif: function() { + if(this.action?.renderif === undefined) { + return true; + } + + return this.action.renderif(this.res); } }, template: ` + + ` }; \ No newline at end of file diff --git a/public/js/components/searchbar/result/template/actions.js b/public/js/components/searchbar/result/template/actions.js index 726fef4dd..8bfd08420 100644 --- a/public/js/components/searchbar/result/template/actions.js +++ b/public/js/components/searchbar/result/template/actions.js @@ -10,11 +10,20 @@ export default { res: Object, actions: Array }, + methods: { + renderif: function(action) { + if(action?.renderif === undefined) { + return true; + } + + return action.renderif(this.res); + } + }, template: `
+
` }; \ No newline at end of file