diff --git a/application/controllers/Cis/ProjektabgabeUebersicht.php b/application/controllers/Cis/ProjektabgabeUebersicht.php index 62c46dd5f..e7ce692f0 100644 --- a/application/controllers/Cis/ProjektabgabeUebersicht.php +++ b/application/controllers/Cis/ProjektabgabeUebersicht.php @@ -25,12 +25,6 @@ class ProjektabgabeUebersicht extends Auth_Controller */ public function index() { - // TODO create permission - $viewData = array( - 'uid' => getAuthUID(), - 'showEdit' => true - ); - - $this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'ProjektabgabeUebersicht']); + $this->load->view('CisRouterView/CisRouterView.php', ['route' => 'ProjektabgabeUebersicht']); } } diff --git a/application/controllers/api/frontend/v1/education/PaabgabeUebersicht.php b/application/controllers/api/frontend/v1/education/PaabgabeUebersicht.php index 13824d6df..f4efe2942 100644 --- a/application/controllers/api/frontend/v1/education/PaabgabeUebersicht.php +++ b/application/controllers/api/frontend/v1/education/PaabgabeUebersicht.php @@ -27,11 +27,12 @@ class PaabgabeUebersicht extends FHCAPI_Controller public function __construct() { parent::__construct([ + 'viewData' => self::PERM_LOGGED, 'getPaAbgaben' => array('lehre/abgabetool:r'), 'getStudiengaenge' => array('lehre/abgabetool:r'), 'getTermine' => array('lehre/abgabetool:r'), 'getPaAbgabetypen' => array('lehre/abgabetool:r'), - 'downloadZip' => array('lehre/abgabetool:r') + 'downloadZip' => array('lehre/abgabetool:r'), //'downloadProjektarbeit' => array('lehre/abgabetool:r') ]); @@ -45,6 +46,17 @@ class PaabgabeUebersicht extends FHCAPI_Controller ]); } + public function viewData() + { + $viewData = [ + "uid" => getAuthUID(), + // TODO create permission + "showEdit" => true, + ]; + + $this->terminateWithSuccess($viewData); + } + /** * Get Projektabgaben for search criteria. */ diff --git a/application/libraries/StundenplanLib.php b/application/libraries/StundenplanLib.php index 5be6e4110..cc8d4cc87 100644 --- a/application/libraries/StundenplanLib.php +++ b/application/libraries/StundenplanLib.php @@ -361,7 +361,10 @@ class StundenplanLib if (isError($ort_content_object)) { return error(getData($ort_content_object)); } - $ort_content_object = getData($ort_content_object)[0]; + $ort_content_object_data = getData($ort_content_object); + $ort_content_object = (is_array($ort_content_object_data) && count($ort_content_object_data) > 0) + ? $ort_content_object_data[0] + : null; if($ort_content_object) { $item->ort_content_id = $ort_content_object->content_id; } diff --git a/public/js/api/factory/paabgabeUebersicht.js b/public/js/api/factory/paabgabeUebersicht.js index 35120d2ab..bea754a14 100644 --- a/public/js/api/factory/paabgabeUebersicht.js +++ b/public/js/api/factory/paabgabeUebersicht.js @@ -26,5 +26,11 @@ export default { method: 'get', url: '/api/frontend/v1/education/PaabgabeUebersicht/getPaAbgabetypen' }; + }, + getViewData() { + return { + method: 'get', + url: '/api/frontend/v1/education/PaabgabeUebersicht/viewData' + }; } }; \ No newline at end of file diff --git a/public/js/components/Calendar/Base/Grid.js b/public/js/components/Calendar/Base/Grid.js index 1a10533b3..91f954d35 100644 --- a/public/js/components/Calendar/Base/Grid.js +++ b/public/js/components/Calendar/Base/Grid.js @@ -19,7 +19,8 @@ export default { originalBackgrounds: "backgrounds", dropAllowed: "dropAllowed", timezone: "timezone", - reservierbar: "isReservierbar" + reservierbar: "isReservierbar", + reservierbarMap: "reservierbarMap", }, provide() { return { @@ -328,6 +329,9 @@ export default { return !dayEvents.some(ev => ev.start < end && ev.end > start); } }, + created() { + this.$p.loadCategory(["LvPlan"]); + }, beforeUnmount() { this.disableAutoScroll(); }, @@ -424,9 +428,11 @@ export default { class="fhc-calendar-empty-slot" style="position:absolute; inset:0; z-index:1" v-cal-click:slot="{ date, part }" + :title="this.reservierbarMap?.[date.toISODate()] ? $p.t('LvPlan/add_reservation') : $p.t('LvPlan/reservation_not_allowed')" >