diff --git a/application/controllers/CisHmvc/Cms.php b/application/controllers/CisHmvc/Cms.php index eed1a5fea..fad3366d4 100755 --- a/application/controllers/CisHmvc/Cms.php +++ b/application/controllers/CisHmvc/Cms.php @@ -69,12 +69,21 @@ class Cms extends Auth_Controller */ public function content($content_id, $version = null, $sprache = null, $sichtbar = true) { - $content = $this->cmslib->getContent($content_id, $version, $sprache, $sichtbar); + // return early if the content_id for the content is missing + if(!isset($content_id)) + $this->terminateWithError("content_id is missing"); + $content = $this->ContentModel->load($content_id); if (isError($content)) - return $this->load->view('CisHmvc/Error', ['error' => getError($content)]); + $this->terminateWithError(getError($content)); - $this->load->view('CisHmvc/Cms/Content', ['content' => getData($content)]); + $content = getData($content); + if(NULL === $content) + $this->terminateWithError("Content not found"); + + $content = current($content); + + $this->load->view('CisVue/Cms/Content', ['content_id' => $content_id, 'template_kurzbz'=>$content->template_kurzbz , 'version' => $version, 'sprache' => $sprache, 'sichtbar' => $sichtbar]); } /** @@ -101,48 +110,6 @@ class Cms extends Auth_Controller */ public function news($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true) { - $this->load->view('CisHtml/Cms/Content', ['infoscreen' => $infoscreen, 'studiengang_kz' => $studiengang_kz, 'semester' => $semester, 'mischen' => $mischen, 'titel' => $titel, 'edit' => $edit, 'sichtbar' => $sichtbar]); - } - - public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true) - { - $get_page = intval($this->input->get('page', true)); - $get_page_size = intval($this->input->get('page_size', true)); - if ($get_page) { - $page = $get_page; - } - if ($get_page_size) { - $page_size = $get_page_size; - } else { - $page_size = $this->page_size; - } - $news = $this->cmslib->getNews($infoscreen, $studiengang_kz, $semester, $mischen, $titel, $edit, $sichtbar, $page, $page_size); - - if (isError($news)) { - $this->terminateWithJsonError(getError($news)); - } - $news = hasData($news) ? getData($news) : null; - if ($news) { - echo json_encode($news); - } else { - show_error("News: No data found"); - } - - } - - public function getNewsRowCount($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $fachbereich_kurzbz = null, $maxalter = 0, $edit = false, $sichtbar = true, $page = 1, $page_size = 10) - { - list($studiengang_kz, $semester) = $this->cmslib->getStgAndSem($studiengang_kz, $semester); - $all = $edit; - $num_rows = $this->NewsModel->countNewsWithContent(getSprache(), $studiengang_kz, $semester, $fachbereich_kurzbz, $sichtbar, $maxalter, $page, $this->page_size, $all, $mischen); - if (isError($num_rows)) { - $this->terminateWithJsonError(getError($num_rows)); - } - $num_rows = hasData($num_rows) ? getData($num_rows) : null; - if ($num_rows) { - echo json_encode($num_rows); - } else { - show_error("News number rows: No data found"); - } + $this->load->view('CisHtml/Cms/Content', ['infoscreen' => $infoscreen, 'studiengang_kz' => $studiengang_kz, 'semester' => $semester, 'mischen' => $mischen, 'titel' => $titel, 'edit' => $edit, 'sichtbar' => $sichtbar, "template_kurzbz"=>"news"]); } } diff --git a/application/controllers/CisHtml/Cms.php b/application/controllers/CisHtml/Cms.php index f56b3eea3..102d0eff4 100755 --- a/application/controllers/CisHtml/Cms.php +++ b/application/controllers/CisHtml/Cms.php @@ -26,10 +26,6 @@ class Cms extends FHC_Controller 'global' ]); - $this->load->model('content/News_model', 'NewsModel'); - - // setting up the papgination_size - $this->page_size = 10; } // ----------------------------------------------------------------------------------------------------------------- @@ -45,12 +41,21 @@ class Cms extends FHC_Controller */ public function content($content_id, $version = null, $sprache = null, $sichtbar = true) { - $content = $this->cmslib->getContent($content_id, $version, $sprache, $sichtbar); + // return early if the content_id for the content is missing + if(!isset($content_id)) + $this->terminateWithError("content_id is missing"); + $content = $this->ContentModel->load($content_id); if (isError($content)) - return $this->load->view('CisHtml/Error', ['error' => getError($content)]); + $this->terminateWithError(getError($content)); - $this->load->view('CisHtml/Cms/Content', ['content' => getData($content)]); + $content = getData($content); + if(NULL === $content) + $this->terminateWithError("Content not found"); + + $content = current($content); + + $this->load->view('CisVue/Cms/Content', ['content_id' => $content_id, 'template_kurzbz'=>$content->template_kurzbz , 'version' => $version, 'sprache' => $sprache, 'sichtbar' => $sichtbar]); } /** @@ -66,48 +71,7 @@ class Cms extends FHC_Controller */ public function news($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true) { - $this->load->view('CisHtml/Cms/Content', ['infoscreen' => $infoscreen, 'studiengang_kz' => $studiengang_kz, 'semester' => $semester, 'mischen' => $mischen, 'titel' => $titel, 'edit' => $edit, 'sichtbar' => $sichtbar]); + $this->load->view('CisHtml/Cms/Content', ['infoscreen' => $infoscreen, 'studiengang_kz' => $studiengang_kz, 'semester' => $semester, 'mischen' => $mischen, 'titel' => $titel, 'edit' => $edit, 'sichtbar' => $sichtbar, "template_kurzbz"=>"news"]); } - public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true) - { - $get_page = intval($this->input->get('page', true)); - $get_page_size = intval($this->input->get('page_size', true)); - if ($get_page) { - $page = $get_page; - } - if ($get_page_size) { - $page_size = $get_page_size; - } else { - $page_size = $this->page_size; - } - $news = $this->cmslib->getNews($infoscreen, $studiengang_kz, $semester, $mischen, $titel, $edit, $sichtbar, $page, $page_size); - - if (isError($news)) { - $this->terminateWithJsonError(getError($news)); - } - $news = hasData($news) ? getData($news) : null; - if ($news) { - echo json_encode($news); - } else { - show_error("News: No data found"); - } - - } - - public function getNewsRowCount($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $fachbereich_kurzbz = null, $maxalter = 0, $edit = false, $sichtbar = true, $page = 1, $page_size = 10) - { - list($studiengang_kz, $semester) = $this->cmslib->getStgAndSem($studiengang_kz, $semester); - $all = $edit; - $num_rows = $this->NewsModel->countNewsWithContent(getSprache(), $studiengang_kz, $semester, $fachbereich_kurzbz, $sichtbar, $maxalter, $page, $this->page_size, $all, $mischen); - if (isError($num_rows)) { - $this->terminateWithJsonError(getError($num_rows)); - } - $num_rows = hasData($num_rows) ? getData($num_rows) : null; - if ($num_rows) { - echo json_encode($num_rows); - } else { - show_error("News number rows: No data found"); - } - } } diff --git a/application/controllers/CisVue/Cms.php b/application/controllers/CisVue/Cms.php index 2c1fa1fc6..4770a8399 100755 --- a/application/controllers/CisVue/Cms.php +++ b/application/controllers/CisVue/Cms.php @@ -24,6 +24,7 @@ class Cms extends FHC_Controller $this->loadPhrases([ 'global' ]); + } // ----------------------------------------------------------------------------------------------------------------- @@ -39,25 +40,15 @@ class Cms extends FHC_Controller */ public function content($content_id, $version = null, $sprache = null, $sichtbar = true) { - $content = $this->cmslib->getContent($content_id, $version, $sprache, $sichtbar); + $content = $this->ContentModel->load($content_id); + + $content = $this->getDataOrTerminateWithError($content); + + $content = current($content); - if (isError($content)) - return $this->load->view('CisHtml/Error', ['error' => getError($content)]); - - $this->load->view('CisHtml/Cms/Content', ['content' => getData($content)]); + $this->load->view('CisVue/Cms/Content', ['content_id' => $content_id, 'template_kurzbz'=>$content->template_kurzbz , 'version' => $version, 'sprache' => $sprache, 'sichtbar' => $sichtbar]); } - /** - * @param boolean $infoscreen - * @param string | null $studiengang_kz - * @param int | null $semester - * @param boolean $mischen - * @param string $titel - * @param boolean $edit - * @param boolean $sichtbar - * - * @return void - */ /** * @param boolean $infoscreen * @param string | null $studiengang_kz @@ -71,48 +62,7 @@ class Cms extends FHC_Controller */ public function news($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true) { - $this->load->view('CisHtml/Cms/Content', ['infoscreen' => $infoscreen, 'studiengang_kz' => $studiengang_kz, 'semester' => $semester, 'mischen' => $mischen, 'titel' => $titel, 'edit' => $edit, 'sichtbar' => $sichtbar]); + $this->load->view('CisHtml/Cms/Content', ['infoscreen' => $infoscreen, 'studiengang_kz' => $studiengang_kz, 'semester' => $semester, 'mischen' => $mischen, 'titel' => $titel, 'edit' => $edit, 'sichtbar' => $sichtbar, "template_kurzbz"=>"news"]); } - public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true) - { - $get_page = intval($this->input->get('page', true)); - $get_page_size = intval($this->input->get('page_size', true)); - if ($get_page) { - $page = $get_page; - } - if ($get_page_size) { - $page_size = $get_page_size; - } else { - $page_size = $this->page_size; - } - $news = $this->cmslib->getNews($infoscreen, $studiengang_kz, $semester, $mischen, $titel, $edit, $sichtbar, $page, $page_size); - - if (isError($news)) { - $this->terminateWithJsonError(getError($news)); - } - $news = hasData($news) ? getData($news) : null; - if ($news) { - echo json_encode($news); - } else { - show_error("News: No data found"); - } - - } - - public function getNewsRowCount($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $fachbereich_kurzbz = null, $maxalter = 0, $edit = false, $sichtbar = true, $page = 1, $page_size = 10) - { - list($studiengang_kz, $semester) = $this->cmslib->getStgAndSem($studiengang_kz, $semester); - $all = $edit; - $num_rows = $this->NewsModel->countNewsWithContent(getSprache(), $studiengang_kz, $semester, $fachbereich_kurzbz, $sichtbar, $maxalter, $page, $this->page_size, $all, $mischen); - if (isError($num_rows)) { - $this->terminateWithJsonError(getError($num_rows)); - } - $num_rows = hasData($num_rows) ? getData($num_rows) : null; - if ($num_rows) { - echo json_encode($num_rows); - } else { - show_error("News number rows: No data found"); - } - } } diff --git a/application/controllers/api/frontend/v1/Cms.php b/application/controllers/api/frontend/v1/Cms.php new file mode 100644 index 000000000..5ba635a8a --- /dev/null +++ b/application/controllers/api/frontend/v1/Cms.php @@ -0,0 +1,181 @@ +. + */ + +if (! defined('BASEPATH')) exit('No direct script access allowed'); + +/** + * This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end) + * Provides data to the ajax get calls about the searchbar component + * This controller works with JSON calls on the HTTP GET and the output is always JSON + */ +class Cms extends FHCAPI_Controller +{ + + /** + * Object initialization + */ + public function __construct() + { + // NOTE(chris): additional permission checks will be done in SearchBarLib + parent::__construct([ + 'ContentID' => self::PERM_LOGGED, + 'getOrtKurzbzContent' => self::PERM_LOGGED, + 'content' => self::PERM_LOGGED, + 'news' => self::PERM_LOGGED, + 'getNewsRowCount' => self::PERM_LOGGED, + 'getNews' => self::PERM_LOGGED, + + ]); + + $this->load->model('content/News_model', 'NewsModel'); + + // setting up the papgination_size + $this->page_size = 10; + + $this->load->library('CmsLib'); + + } + + //------------------------------------------------------------------------------------------------------------------ + // Private methods + + + //------------------------------------------------------------------------------------------------------------------ + // Public methods + + /** + * fetches the content with the content_id and additional parameters + */ + public function content() + { + // form validation + $this->load->library('form_validation'); + $this->form_validation->set_data($_GET); + $this->form_validation->set_rules('content_id','Content ID','required|is_natural'); + if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array()); + + // getting the get parameters + $content_id = $this->input->get("content_id",TRUE); + $version = $this->input->get("version",TRUE); + $sprache = $this->input->get("sprache",TRUE); + $sichtbar = $this->input->get("sichtbar",TRUE); + + $content = $this->cmslib->getContent($content_id); + + $content = $this->getDataOrTerminateWithError($content); + + $this->terminateWithSuccess($content); + } + + /** + * Gets a JSON body via HTTP POST and provides the parameters + */ + public function ContentID() + { + // form validation + $this->load->library('form_validation'); + $this->form_validation->set_data($_GET); + $this->form_validation->set_rules('ort_kurzbz', 'Ort', 'required'); + if ($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array()); + + $ort_kurzbz = $this->input->get('ort_kurzbz',TRUE); + + $content_id = $this->OrtModel->getContentID($ort_kurzbz); + + $content_id = current($this->getDataOrTerminateWithError($content_id))->content_id; + + $this->terminateWithSuccess($content_id); + } + + //todo: there is the method news and getNews but only one should exist + public function news() + { + // form validation + $this->load->library('form_validation'); + $this->form_validation->set_data($_GET); + $this->form_validation->set_rules('limit','Limit','required|is_natural_no_zero'); + if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array()); + + $this->load->model('content/news_model', 'NewsModel'); + + $limit = $this->input->get('limit',TRUE); + + //query the news + $news = $this->NewsModel->getAll($limit); + + //get the data or terminate with error + $news = $this->getDataOrTerminateWithError($news); + + // collect the content of the news + foreach($news as $news_element){ + $this->addMeta("content_id",$news_element->content_id); + + $content = $this->cmslib->getContent($news_element->content_id); + + $content = $this->getDataOrTerminateWithError($content); + + $news_element->content_obj = $content; + } + + $this->terminateWithSuccess($news); + + } + + public function getNewsRowCount($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $fachbereich_kurzbz = null, $maxalter = 0, $edit = false, $sichtbar = true, $page = 1, $page_size = 10) + { + list($studiengang_kz, $semester) = $this->cmslib->getStgAndSem($studiengang_kz, $semester); + $all = $edit; + + $this->load->model('content/News_model','NewsModel'); + + $num_rows = $this->NewsModel->countNewsWithContent(getSprache(), $studiengang_kz, $semester, $fachbereich_kurzbz, $sichtbar, $maxalter, $page, $page_size, $all, $mischen); + + $num_rows = $this->getDataOrTerminateWithError($num_rows); + + $this->terminateWithSuccess($num_rows); + + } + + + public function getNews($infoscreen = false, $studiengang_kz = null, $semester = null, $mischen = true, $titel = '', $edit = false, $sichtbar = true) + { + //form validation + $this->load->library('form_validation'); + $this->form_validation->set_data($_GET); + $this->form_validation->set_rules('page','Page','required|is_natural'); + $this->form_validation->set_rules('page_size', 'PageSize', 'is_natural'); + if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array()); + + // getting the GET parameters + $page = intval($this->input->get('page', true)); + $page_size = intval($this->input->get('page_size', true)); + + // default value for the page_size is 10 + $page_size = $page_size ?? 10; + + $news = $this->cmslib->getNews($infoscreen, $studiengang_kz, $semester, $mischen, $titel, $edit, $sichtbar, $page, $page_size); + + $news = $this->getDataOrTerminateWithError($news); + + $this->terminateWithSuccess($news); + + } + + +} + diff --git a/application/controllers/api/frontend/v1/Ort.php b/application/controllers/api/frontend/v1/Ort.php new file mode 100644 index 000000000..8c4059824 --- /dev/null +++ b/application/controllers/api/frontend/v1/Ort.php @@ -0,0 +1,95 @@ +. + */ + +if (! defined('BASEPATH')) exit('No direct script access allowed'); + +/** + * This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end) + * Provides data to the ajax get calls about the searchbar component + * This controller works with JSON calls on the HTTP GET and the output is always JSON + */ +class Ort extends FHCAPI_Controller +{ + + /** + * Object initialization + */ + public function __construct() + { + // NOTE(chris): additional permission checks will be done in SearchBarLib + parent::__construct([ + 'ContentID' => self::PERM_LOGGED, + 'getOrtKurzbzContent' => self::PERM_LOGGED, + ]); + + $this->load->model('ressource/Ort_model', 'OrtModel'); + + } + + //------------------------------------------------------------------------------------------------------------------ + // Public methods + + /** + * Gets a JSON body via HTTP POST and provides the parameters + */ + public function ContentID() + { + // if error + //$this->terminateWithError(SearchBarLib::ERROR_WRONG_JSON, self::ERROR_TYPE_GENERAL); + + $ort_kurzbz = $this->input->get('ort_kurzbz',TRUE); + + if(!$ort_kurzbz){ + $this->terminateWithError("missing ort_kurzbz parameter", self::ERROR_TYPE_GENERAL); + } + + $result = $this->OrtModel->getContentID($ort_kurzbz); + + if(isError($result)){ + $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + } + + $result = hasData($result) ? current(getData($result)) : null; + + $this->terminateWithSuccess($result->content_id ?? NULL); + } + + /** + * @param int $version + * @param string $sprache + * @param boolean $sichtbar + * + * @return $content + */ + public function getOrtKurzbzContent($version = null, $sprache = null, $sichtbar = true) + { + $content_id = $this->input->get("content_id",TRUE); + + $this->load->library('CmsLib'); + + $content = $this->cmslib->getContent($content_id, $version, $sprache, $sichtbar); + + if (isError($content)) + $this->terminateWithError(getError($content), self::ERROR_TYPE_GENERAL); + + $content = hasData($content) ? getData($content) : null; + + $this->terminateWithSuccess($content); + } +} + diff --git a/application/libraries/CmsLib.php b/application/libraries/CmsLib.php index 9a898df85..746d7f831 100755 --- a/application/libraries/CmsLib.php +++ b/application/libraries/CmsLib.php @@ -66,7 +66,6 @@ class CmsLib if (!getData($isberechtigt)) return error('global/keineBerechtigungFuerDieseSeite'); } - #$this->load->model('content/Content_model', 'ContentModel'); $content = $this->ci->ContentModel->getContent($content_id, $sprache, $version, $sichtbar, true); if (isError($content)) @@ -103,6 +102,12 @@ class CmsLib $XML = new DOMDocument(); $XML->loadXML($content->content); + if($content->titel){ + $betreff = $content->titel; + }else{ + $betreff = $XML->getElementsByTagName('betreff'); + } + $xsltemplate = new DOMDocument(); $xsltemplate->loadXML($template->xslt_xhtml_c4); @@ -110,10 +115,15 @@ class CmsLib $processor = new XSLTProcessor(); $processor->importStylesheet($xsltemplate); - $content = $processor->transformToXML($XML); - $content = str_replace('dms.php', APP_ROOT . 'cms/dms.php', $content); + + $transformed_content = $processor->transformToXML($XML); + $transformed_content = str_replace('dms.php', APP_ROOT . 'cms/dms.php', $transformed_content); - return success($content); + return success([ + "betreff"=>$betreff, + "type"=>$content->template_kurzbz, + "content"=>$transformed_content + ]); } /** diff --git a/application/models/content/News_model.php b/application/models/content/News_model.php index f4f98b601..0700a7057 100755 --- a/application/models/content/News_model.php +++ b/application/models/content/News_model.php @@ -19,14 +19,27 @@ class News_model extends DB_Model */ public function getAll($limit = null) { - return $this->loadWhere(' - text IS NOT NULL - AND datum <= NOW() AND (datum_bis IS NULL OR datum_bis >= now()::date) + $this->addJoin("campus.tbl_content","content_id"); + return $this->execReadOnlyQuery(' + SELECT * + FROM campus.tbl_news + JOIN campus.tbl_content content ON content.content_id = campus.tbl_news.content_id + WHERE + --text IS NOT NULL AND + datum <= NOW() AND (datum_bis IS NULL OR datum_bis >= now()::date) ORDER BY datum DESC LIMIT ' . $this->escape($limit) ); } + public function getNewsContentIDs($limit=10){ + $this->addSelect(['content_id']); + return $this->loadWhere("datum <= NOW() AND (datum_bis IS NULL OR datum_bis >= now()::date) + ORDER BY datum DESC + LIMIT " . $this->escape($limit)); + + } + /** diff --git a/application/models/ressource/Ort_model.php b/application/models/ressource/Ort_model.php index 59b213a54..de0c8e331 100755 --- a/application/models/ressource/Ort_model.php +++ b/application/models/ressource/Ort_model.php @@ -20,4 +20,16 @@ class Ort_model extends DB_Model return $this->OrtModel->loadWhere(array("raumtyp_kurzbz" => $raumtyp_kurzbz)); } + + public function getContentID($ort_kurzbz) + { + + return $this->execReadOnlyQuery(" + SELECT content_id + FROM public.tbl_ort + WHERE ort_kurzbz = ?; + ",[$ort_kurzbz]); + + } + } \ No newline at end of file diff --git a/application/views/Cis/Stundenplan.php b/application/views/Cis/Stundenplan.php index cb8f8a712..99103b373 100755 --- a/application/views/Cis/Stundenplan.php +++ b/application/views/Cis/Stundenplan.php @@ -8,10 +8,10 @@ $includesArray = array( $this->load->view('templates/CISHTML-Header', $includesArray); ?> -
+

Stundenplan


- +
load->view('templates/CISHTML-Footer', $includesArray); ?> diff --git a/application/views/CisHmvc/Cms/Content.php b/application/views/CisHmvc/Cms/Content.php index 7ca1347d3..494add9a4 100755 --- a/application/views/CisHmvc/Cms/Content.php +++ b/application/views/CisHmvc/Cms/Content.php @@ -1,20 +1,29 @@ 'FH-Complete', 'customJSModules' => ['public/js/apps/Cis/Cms.js'], + 'primevue3'=>true, 'customCSSs' => [ 'public/css/Cis4/Cms.css', #'skin/style.css.php' ] ); -$this->load->view('templates/FHC-Header', $includesArray); +switch($template_kurzbz){ + case 'raum_contentmittitel': + $includesArray['tabulator5'] = true; + break; +} + +$this->load->view('templates/CISVUE-Header', $includesArray); ?> + +

+
-'); ?> +' : ''); ?>
-load->view('templates/FHC-Footer', $includesArray); ?> +load->view('templates/CISVUE-Footer', $includesArray); ?> diff --git a/application/views/CisHtml/Cms/Content.php b/application/views/CisHtml/Cms/Content.php index ac62c985a..037f21cb6 100755 --- a/application/views/CisHtml/Cms/Content.php +++ b/application/views/CisHtml/Cms/Content.php @@ -1,19 +1,28 @@ true, 'customJSModules' => ['public/js/apps/Cis/Cms.js'], + 'primevue3'=>true, 'customCSSs' => [ 'public/css/Cis4/Cms.css', #'skin/style.css.php' ] ); +switch($template_kurzbz){ + case 'raum_contentmittitel': + $includesArray['tabulator5'] = true; + break; +} + $this->load->view('templates/CISHTML-Header', $includesArray); ?> +

+
-'); ?> - +' : ''); ?> +
-load->view('templates/CISHTML-Footer', $includesArray); ?> \ No newline at end of file +load->view('templates/CISHTML-Footer', $includesArray); ?> + diff --git a/application/views/CisVue/Cms/Content.php b/application/views/CisVue/Cms/Content.php index 02aa42b57..494add9a4 100755 --- a/application/views/CisVue/Cms/Content.php +++ b/application/views/CisVue/Cms/Content.php @@ -1,17 +1,28 @@ ['public/js/apps/Cis/Cms.js'], + 'primevue3'=>true, 'customCSSs' => [ 'public/css/Cis4/Cms.css', #'skin/style.css.php' ] ); +switch($template_kurzbz){ + case 'raum_contentmittitel': + $includesArray['tabulator5'] = true; + break; +} + $this->load->view('templates/CISVUE-Header', $includesArray); ?> + +

+
-'); ?> +' : ''); ?> +
load->view('templates/CISVUE-Footer', $includesArray); ?> diff --git a/public/css/components/dashboard.css b/public/css/components/dashboard.css index 9da199442..67dd9cf3f 100755 --- a/public/css/components/dashboard.css +++ b/public/css/components/dashboard.css @@ -1,4 +1,6 @@ @import './calendar.css'; +@import './dashboard/news.css'; + .empty-tile-hover { height: 100%; width: 100%; diff --git a/public/css/components/dashboard/news.css b/public/css/components/dashboard/news.css new file mode 100644 index 000000000..013401bc8 --- /dev/null +++ b/public/css/components/dashboard/news.css @@ -0,0 +1,24 @@ +.widgets-news .card-header { + flex-direction: column; + align-items: flex-start !important; + +} + +:root{ + --news-widget-height: 1; +} + +.widgets-news .news-content > div, +.widgets-news .news-content .row:nth-child(1), +.widgets-news .news-content .news-list, +.widgets-news .news-content .news-list-item, +.widgets-news .news-content .card-body +{ + height: 100%; +} + +.widgets-news .card-body{ + + /*max-height: calc(var(--news-widget-height)*var(--fhc-dg-row-height)); */ + overflow:scroll; +} \ No newline at end of file diff --git a/public/js/api/cms.js b/public/js/api/cms.js new file mode 100644 index 000000000..28cb56961 --- /dev/null +++ b/public/js/api/cms.js @@ -0,0 +1,40 @@ +export default { + content(content_id, version=null, sprache=null, sichtbar=null) { + return this.$fhcApi.get( + "/api/frontend/v1/Cms/content", + { + content_id: content_id, + ...(version?{version}:{}), + ...(sprache?{sprache}:{}), + ...(sichtbar?{sichtbar}:{}), + } + ); + }, + + news(limit) { + return this.$fhcApi.get( + "/api/frontend/v1/Cms/news", + { + limit: limit + } + ); + }, + + getNews(page = 1, page_size = 10) { + return this.$fhcApi.get( + "/api/frontend/v1/Cms/getNews", + { + page, + page_size, + }, + ); + }, + + getNewsRowCount: function () { + return this.$fhcApi.get( + "/api/frontend/v1/Cms/getNewsRowCount", + {} + ); + }, + + } \ No newline at end of file diff --git a/public/js/api/fhcapifactory.js b/public/js/api/fhcapifactory.js index 4627a7d5f..f6a4d6f6d 100644 --- a/public/js/api/fhcapifactory.js +++ b/public/js/api/fhcapifactory.js @@ -27,6 +27,8 @@ import stv from "./stv.js"; import notiz from "./notiz.js"; import betriebsmittel from "./betriebsmittel.js"; import ampeln from "./ampeln.js"; +import ort from "./ort.js"; +import cms from "./cms.js"; export default { search, @@ -41,4 +43,6 @@ export default { notiz, betriebsmittel ampeln, + ort, + cms, }; diff --git a/public/js/api/ort.js b/public/js/api/ort.js new file mode 100644 index 000000000..4c8e2ce73 --- /dev/null +++ b/public/js/api/ort.js @@ -0,0 +1,10 @@ +export default { + getContentID(ort_kurbz) { + return this.$fhcApi.get( + FHC_JS_DATA_STORAGE_OBJECT.app_root + + FHC_JS_DATA_STORAGE_OBJECT.ci_router + + "/api/frontend/v1/Ort/ContentID", + { ort_kurzbz: ort_kurbz } + ); + }, +} \ No newline at end of file diff --git a/public/js/apps/Cis/Cms.js b/public/js/apps/Cis/Cms.js index cd2b5f6e9..a2f9691b3 100755 --- a/public/js/apps/Cis/Cms.js +++ b/public/js/apps/Cis/Cms.js @@ -1,13 +1,14 @@ import BsConfirm from "../../components/Bootstrap/Confirm.js"; //import Pagination from "../../components/Pagination/Pagination.js"; -import Content from "../../components/Cis/Cms/Content.js"; -import Fhcapi from "../api/fhcapifactory.js"; +import CmsNews from "../../components/Cis/Cms/News.js"; +import CmsContent from "../../components/Cis/Cms/Content.js"; +import Phrasen from "../../plugin/Phrasen.js"; -Vue.$fhcapi = Fhcapi; const app = Vue.createApp({ components: { - Content, + CmsNews, + CmsContent, }, mounted() { document.querySelectorAll("#cms [data-confirm]").forEach((el) => { @@ -34,5 +35,6 @@ const app = Vue.createApp({ }, }); app.use(primevue.config.default, { zIndex: { overlay: 9999 } }); +app.use(Phrasen); app.mount("#cms"); //#cms [data-confirm], #cms [data-href] diff --git a/public/js/apps/Cis/Stundenplan.js b/public/js/apps/Cis/Stundenplan.js index 25823b193..edcad1da8 100755 --- a/public/js/apps/Cis/Stundenplan.js +++ b/public/js/apps/Cis/Stundenplan.js @@ -1,16 +1,28 @@ import FhcCalendar from "../../components/Calendar/Calendar.js"; +import CalendarModal from '../../components/Calendar/CalendarModal.js'; import Phrasen from "../../plugin/Phrasen.js"; const app = Vue.createApp({ components: { - FhcCalendar + FhcCalendar, + CalendarModal }, data() { return { stunden: [], - events: null + events: null, + currentlySelectedEvent:null, } }, + methods:{ + selectEvent: function(event){ + this.currentlySelectedEvent = event; + Vue.nextTick(()=>{ + this.$refs.calendarModal.show(); + }) + + }, + }, created() { axios.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/Cis/Stundenplan/Stunden').then(res => { res.data.retval.forEach(std => { @@ -48,7 +60,10 @@ const app = Vue.createApp({ }); }); }); - } + }, + template:` + + ` }); app.config.unwrapInjectedRef = true; app.use(Phrasen); diff --git a/public/js/apps/Dashboard/Admin.js b/public/js/apps/Dashboard/Admin.js index 49d43657f..e0b21cfb5 100755 --- a/public/js/apps/Dashboard/Admin.js +++ b/public/js/apps/Dashboard/Admin.js @@ -1,6 +1,7 @@ import {CoreNavigationCmpt} from '../../components/navigation/Navigation.js'; import DashboardAdmin from '../../components/Dashboard/Admin.js'; -import Phrasen from "../../plugin/Phrasen.js"; +import FhcApi from '../../plugin/FhcApi.js'; +import Phrasen from '../../plugin/Phrasen.js'; const app = Vue.createApp({ data: () => ({ @@ -12,5 +13,6 @@ const app = Vue.createApp({ } }); app.config.unwrapInjectedRef = true; +app.use(FhcApi); app.use(Phrasen); app.mount('#main'); diff --git a/public/js/apps/Dashboard/Fhc.js b/public/js/apps/Dashboard/Fhc.js index a20bb5b64..8dd8fe44b 100755 --- a/public/js/apps/Dashboard/Fhc.js +++ b/public/js/apps/Dashboard/Fhc.js @@ -1,5 +1,6 @@ import FhcDashboard from '../../components/Dashboard/Dashboard.js'; -import Phrasen from "../../plugin/Phrasen.js"; +import FhcApi from '../../plugin/FhcApi.js'; +import Phrasen from '../../plugin/Phrasen.js'; const app = Vue.createApp({ data: () => ({ @@ -10,5 +11,6 @@ const app = Vue.createApp({ } }); app.config.unwrapInjectedRef = true; +app.use(FhcApi); app.use(Phrasen); app.mount('#content'); diff --git a/public/js/apps/api/cms.js b/public/js/apps/api/cms.js deleted file mode 100644 index 6fbb0e727..000000000 --- a/public/js/apps/api/cms.js +++ /dev/null @@ -1,21 +0,0 @@ -export default { - getNews: function (page = 1, page_size = 10) { - const url = - FHC_JS_DATA_STORAGE_OBJECT.app_root + - FHC_JS_DATA_STORAGE_OBJECT.ci_router + - "/CisHtml/Cms/getNews"; - return axios.get(url, { - params: { - page, - page_size, - }, - }); - }, - getNewsRowCount: function () { - const url = - FHC_JS_DATA_STORAGE_OBJECT.app_root + - FHC_JS_DATA_STORAGE_OBJECT.ci_router + - "/CisHtml/Cms/getNewsRowCount"; - return axios.get(url); - }, -}; diff --git a/public/js/apps/api/fhcapifactory.js b/public/js/apps/api/fhcapifactory.js index 35120779f..4b35b807a 100755 --- a/public/js/apps/api/fhcapifactory.js +++ b/public/js/apps/api/fhcapifactory.js @@ -1,7 +1,5 @@ import Search from "./search.js"; -import Cms from "./cms.js"; export default { "Search": Search, - "Cms": Cms, }; diff --git a/public/js/components/Bootstrap/Modal.js b/public/js/components/Bootstrap/Modal.js index da73adc97..e390319e8 100755 --- a/public/js/components/Bootstrap/Modal.js +++ b/public/js/components/Bootstrap/Modal.js @@ -109,7 +109,7 @@ export default { document.body.appendChild(wrapper); }); }, - template: `