change settings bezeichnung_mehrsprachig::varchar[] in TagController functions getTag and getTags

This commit is contained in:
ma0068
2026-04-27 10:01:54 +02:00
parent 2723d6a741
commit e856c8ad6b
4 changed files with 10 additions and 11 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ $config['stv_prestudent_tags'] = [
'prewh_auto' => ['readonly' => true],
'out_auto' => ['readonly' => false],
'zgv_auto' => ['readonly' => true],
'unterbrecher_auto' => ['readonly' => true],
'unterbrecher_auto' => ['readonly' => false],
'stbtr_erh_auto' => ['readonly' => true],
'jgv_auto' => ['readonly' => false],
];
+7 -8
View File
@@ -43,7 +43,6 @@ class Tag_Controller extends FHCAPI_Controller
public function getTag($readonly_tags = null)
{
$language = $this->_getLanguageIndex();
$id = $this->input->get('id');
if (is_array($readonly_tags) && !isEmptyArray($readonly_tags))
@@ -68,7 +67,7 @@ class Tag_Controller extends FHCAPI_Controller
$this->NotizModel->addSelect(
"tbl_notiz.titel,
tbl_notiz.text,
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $language. " as bezeichnung,
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung,
tbl_notiz.notiz_id,
tbl_notiz_typ.style,
tbl_notiz_typ.automatisiert,
@@ -97,14 +96,16 @@ class Tag_Controller extends FHCAPI_Controller
public function getTags($tags = null)
{
$language = $this->_getLanguageIndex();
$this->NotiztypModel->addSelect(
'typ_kurzbz as tag_typ_kurzbz,
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung,
"typ_kurzbz as tag_typ_kurzbz,
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $language. " as bezeichnung,
style,
beschreibung,
tag,
automatisiert
'
"
);
$this->NotiztypModel->addOrder('prioritaet');
@@ -283,7 +284,6 @@ class Tag_Controller extends FHCAPI_Controller
}
public function getAllTags($readonly_tags = false){
$language = $this->_getLanguageIndex();
$prestudent_id = $this->input->get('prestudent_id');
//TODO check for readonly: necessary?
@@ -305,11 +305,10 @@ class Tag_Controller extends FHCAPI_Controller
END as readonly
");
}
$this->NotizModel->addSelect(
"tbl_notiz.titel,
tbl_notiz.text,
array_to_json(bezeichnung_mehrsprachig::varchar[])->>". $language. " as bezeichnung,
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung,
tbl_notiz.notiz_id,
tbl_notiz_typ.style,
tbl_notiz_typ.automatisiert,
+1
View File
@@ -3,6 +3,7 @@
export function idTagFormatter (id, tagData, tagComponent, typeId)
{
if (!id) return;
console.log(tagData);
const parsedTags = tagData.map(tag => ({
id: tag.notiz_id,
+1 -2
View File
@@ -46,8 +46,7 @@ export function tagFormatter(cell, tagComponent)
const tagDef = mappedData.find(t => t.typ_kurzbz === tag.typ_kurzbz);
//todo: check trigger manually after creation of manual automatic tag
if (!tagDef && tag.typ_kurzbz.includes("_auto") || tagDef?.automatisiert) {
if (!tagDef && tag.typ_kurzbz?.includes("_auto") || tagDef?.automatisiert) {
tagElement.className += " tag_auto";
tagElement.innerHTML = "<i class='fa-solid fa-lock'></i> " + tag.beschreibung;
}