mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-24 07:29:28 +00:00
Merge branch 'feature-25999/C4_cleanup' into feature-25999/C4_cleanup_merge_anrechnungen_bs5
This commit is contained in:
@@ -26,7 +26,8 @@ class CisVue extends Auth_Controller
|
||||
public function Menu()
|
||||
{
|
||||
$this->load->model('content/Content_model', 'ContentModel');
|
||||
$result = $this->ContentModel->getMenu(defined('CIS4_MENU_ENTRY') ? CIS4_MENU_ENTRY : null, getAuthUID());
|
||||
$menu_contentID = $this->ContentModel->getMenuContentID();
|
||||
$result = $this->ContentModel->getMenu($menu_contentID, getAuthUID());
|
||||
$menu = getData($result) ?? (object)['childs' => []];
|
||||
|
||||
$this->outputJsonSuccess($menu);
|
||||
|
||||
@@ -71,13 +71,23 @@ class Content_model extends DB_Model
|
||||
*
|
||||
* @return integer|null content_id of the Cis4_Root Menu
|
||||
*/
|
||||
public function getCIS4_ContentID(){
|
||||
public function getMenuContentID(){
|
||||
// early return if the CIS4_MENU_ENTRY constant is defined
|
||||
if(defined('CIS4_MENU_ENTRY'))
|
||||
{
|
||||
return CIS4_MENU_ENTRY;
|
||||
}
|
||||
|
||||
// load the CIS4 Menu content_id from the database using the column 'beschreibugn' of the campus.tbl_content table
|
||||
$CIS4_ROOT_CONTENT = $this->loadWhere(["beschreibung"=>"CIS4_ROOT"]);
|
||||
|
||||
if(isError($CIS4_ROOT_CONTENT))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$CIS4_ROOT_CONTENT = getData($CIS4_ROOT_CONTENT);
|
||||
|
||||
if(count($CIS4_ROOT_CONTENT) > 0)
|
||||
{
|
||||
return current($CIS4_ROOT_CONTENT)->content_id ?? null;
|
||||
|
||||
@@ -19,7 +19,7 @@ $this->load->view('templates/FHC-Header', $includesArray);
|
||||
if (!isset($menu)) {
|
||||
$ci =& get_instance(); // get CI instance
|
||||
$ci->load->model('content/Content_model', 'ContentModel');
|
||||
$cis4_content_id = $ci->ContentModel->getCIS4_ContentID();
|
||||
$cis4_content_id = $ci->ContentModel->getMenuContentID();
|
||||
$result = $ci->ContentModel->getMenu($cis4_content_id, getAuthUID());
|
||||
$menu = getData($result)->childs ?? [];
|
||||
}
|
||||
|
||||
@@ -2,7 +2,3 @@
|
||||
color: #565e647f !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.mylv_dropdown{
|
||||
margin-left: -5px !important;
|
||||
}
|
||||
@@ -123,18 +123,18 @@ export default {
|
||||
<div class="card-body " :style="bodyStyle">
|
||||
<ul class="list-group border-top-0 border-bottom-0 rounded-0">
|
||||
<template v-if="menu">
|
||||
<li :type="menuItem.c4_link ? 'button' : null" v-for="menuItem in menu" class="list-group-item border-0 ">
|
||||
<div class="d-flex flex-row" >
|
||||
<li :type="menuItem.c4_link ? 'button' : null" v-for="menuItem in menu" class="list-group-item border-0 " >
|
||||
<div class="d-flex flex-row" :data-bs-toggle="menuItem.c4_moodle_links?.length ? 'dropdown' : null">
|
||||
<div class="mx-4">
|
||||
<i :class="[menuItem.c4_icon2 ? menuItem.c4_icon2 : 'fa-solid fa-pen-to-square', !menuItem.c4_link ? 'unavailable' : null ]"></i>
|
||||
</div>
|
||||
<a class="text-decoration-none text-truncate" :id="'moodle_links_'+lehrveranstaltung_id" :data-bs-toggle="menuItem.c4_moodle_links?.length ? 'dropdown' : null" :class="{'link-dark':menuItem.c4_link, 'unavailable':!menuItem.c4_link, 'dropdown-toggle':menuItem.c4_moodle_links?.length }" :target="menuItem.c4_target" :href="menuItem.c4_link ? !menuItem.c4_moodle_links?.length && menuItem.c4_link : null">
|
||||
<a class="text-decoration-none text-truncate" :id="'moodle_links_'+lehrveranstaltung_id" :class="{'link-dark':menuItem.c4_link, 'unavailable':!menuItem.c4_link, 'dropdown-toggle':menuItem.c4_moodle_links?.length }" :target="menuItem.c4_target" :href="menuItem.c4_link ? !menuItem.c4_moodle_links?.length && menuItem.c4_link : null">
|
||||
{{menuItem.name}}
|
||||
</a>
|
||||
<ul v-if="menuItem.c4_moodle_links?.length" class="dropdown-menu p-0 mylv_dropdown" :aria-labelledby="'moodle_links_'+lehrveranstaltung_id">
|
||||
<li v-for="item in menuItem.c4_moodle_links"><a class="dropdown-item border-bottom" :href="item.url">{{item.lehrform_kurzbz}}</a></li>
|
||||
</div>
|
||||
<ul v-if="menuItem.c4_moodle_links?.length" class="dropdown-menu p-0" :aria-labelledby="'moodle_links_'+lehrveranstaltung_id">
|
||||
<li v-for="item in menuItem.c4_moodle_links"><a class="dropdown-item border-bottom" :href="item.url">{{item.lehrform}}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
</template>
|
||||
<template v-else>
|
||||
|
||||
@@ -5,6 +5,7 @@ export default {
|
||||
data: () => ({
|
||||
title_input: "",
|
||||
url_input: "",
|
||||
invalidURL: false,
|
||||
}),
|
||||
mixins: [AbstractWidget],
|
||||
computed: {
|
||||
@@ -35,6 +36,15 @@ export default {
|
||||
if ((await this.$fhcAlert.confirmDelete()) === false) return;
|
||||
},
|
||||
addLink() {
|
||||
// reset is-invalid css on url input field
|
||||
this.invalidURL = false;
|
||||
|
||||
if(!URL.canParse(this.url_input))
|
||||
{
|
||||
this.$fhcAlert.alertError(this.$p.t("bookmark", "invalidUrl"));
|
||||
this.invalidURL = true;
|
||||
return;
|
||||
}
|
||||
this.$fhcApi.factory.bookmark
|
||||
.insert({
|
||||
tag: this.config.tag,
|
||||
@@ -83,7 +93,10 @@ export default {
|
||||
<header><b>{{$p.t('bookmark','newLink')}}</b></header><br>
|
||||
<div>
|
||||
<input class="form-control form-control-sm" placeholder="Titel" type="text" v-model="title_input" name="title" maxlength="50" required>
|
||||
<input class="form-control form-control-sm mt-2" type="url" placeholder="URL" v-model="url_input" name="url" required>
|
||||
<input required id="bookmark_link" class="form-control form-control-sm mt-2" :class="{'is-invalid':invalidURL}" type="url" placeholder="URL" v-model="url_input" name="url">
|
||||
<div class="invalid-feedback">
|
||||
{{$p.t("bookmark", "invalidUrl")}}.
|
||||
</div>
|
||||
<button class="btn btn-outline-secondary btn-sm w-100 mt-2" @click="addLink" type="button">{{$p.t('bookmark','saveLink')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -410,16 +410,6 @@ if ($result = @$db->db_query("SELECT * FROM campus.tbl_content WHERE beschreibun
|
||||
10487, NOW(), null, null, null, 8
|
||||
);
|
||||
|
||||
INSERT INTO campus.tbl_contentchild
|
||||
(content_id, child_content_id, insertamum, insertvon, updateamum, updatevon, sort)
|
||||
VALUES
|
||||
(
|
||||
-- queries the content_id for the CIS4_ROOT
|
||||
(SELECT content_id from campus.tbl_content WHERE beschreibung = 'CIS4_ROOT'),
|
||||
-- 10568 is the content_id for Zahlungen
|
||||
10568, NOW(), null, null, null, 9
|
||||
);
|
||||
|
||||
###### Mein Studium childs
|
||||
|
||||
INSERT INTO campus.tbl_contentchild
|
||||
@@ -465,6 +455,16 @@ if ($result = @$db->db_query("SELECT * FROM campus.tbl_content WHERE beschreibun
|
||||
(SELECT content_id from campus.tbl_content WHERE beschreibung = 'BESTÄTIGUNGEN_ZEUGNISSE'),
|
||||
NOW(), null, null, null, 4
|
||||
);
|
||||
|
||||
INSERT INTO campus.tbl_contentchild
|
||||
(content_id, child_content_id, insertamum, insertvon, updateamum, updatevon, sort)
|
||||
VALUES
|
||||
(
|
||||
-- queries the content_id for the MEIN_STUDIUM
|
||||
(SELECT content_id from campus.tbl_content WHERE beschreibung = 'MEIN_STUDIUM'),
|
||||
-- 10568 is the content_id for Zahlungen
|
||||
10568, NOW(), null, null, null, 5
|
||||
);
|
||||
|
||||
INSERT INTO campus.tbl_contentchild
|
||||
(content_id, child_content_id, insertamum, insertvon, updateamum, updatevon, sort)
|
||||
@@ -473,7 +473,7 @@ if ($result = @$db->db_query("SELECT * FROM campus.tbl_content WHERE beschreibun
|
||||
-- queries the content_id for the MEIN_STUDIUM
|
||||
(SELECT content_id from campus.tbl_content WHERE beschreibung = 'MEIN_STUDIUM'),
|
||||
-- 10795 is the content_id for Studierendenstatus
|
||||
10795, NOW(), null, null, null, 5
|
||||
10795, NOW(), null, null, null, 6
|
||||
);
|
||||
|
||||
###### VPN_STUDIERENDE childs
|
||||
|
||||
@@ -31504,6 +31504,26 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'bookmark',
|
||||
'phrase' => 'invalidUrl',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Ungültiger Link',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Invalid link',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'global',
|
||||
|
||||
Reference in New Issue
Block a user