mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 18:02:18 +00:00
Merge branch 'feature-75959/StudVw_Automatische_Tags' into studvw_2026_05_rc_tags
This commit is contained in:
@@ -147,7 +147,7 @@ class Students extends FHCAPI_Controller
|
||||
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ class Students extends FHCAPI_Controller
|
||||
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ class Students extends FHCAPI_Controller
|
||||
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -476,7 +476,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->PrestudentModel->loadWhere($where);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -631,10 +631,22 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->PrestudentModel->loadWhere($where);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
protected function decodeTagsJsonInResult(&$data)
|
||||
{
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED) {
|
||||
array_walk($data, function($item, $key) {
|
||||
if(isset($item->tags))
|
||||
{
|
||||
$item->tags = json_decode($item->tags);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $prestudent_id
|
||||
*
|
||||
@@ -679,7 +691,7 @@ class Students extends FHCAPI_Controller
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -722,7 +734,7 @@ class Students extends FHCAPI_Controller
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -764,7 +776,7 @@ class Students extends FHCAPI_Controller
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -840,7 +852,7 @@ class Students extends FHCAPI_Controller
|
||||
$result = $this->PrestudentModel->load();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->decodeTagsJsonInResult($data);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -882,12 +894,31 @@ class Students extends FHCAPI_Controller
|
||||
n.text AS notiz,
|
||||
nt.style,
|
||||
n.erledigt AS done,
|
||||
nz.prestudent_id
|
||||
nz.prestudent_id,
|
||||
n.start,
|
||||
n.ende
|
||||
FROM public.tbl_notizzuordnung AS nz
|
||||
JOIN public.tbl_notiz AS n ON nz.notiz_id = n.notiz_id
|
||||
JOIN public.tbl_notiz_typ AS nt ON n.typ = nt.typ_kurzbz "
|
||||
. $whereTags .
|
||||
"
|
||||
WHERE
|
||||
COALESCE(n.start, '1970-01-01') <= (
|
||||
SELECT
|
||||
ende
|
||||
FROM
|
||||
public.tbl_studiensemester
|
||||
WHERE
|
||||
studiensemester_kurzbz = '{$studiensemester_kurzbz}'
|
||||
)
|
||||
AND COALESCE(n.ende, '2170-12-31') >= (
|
||||
SELECT
|
||||
start
|
||||
FROM
|
||||
public.tbl_studiensemester
|
||||
WHERE
|
||||
studiensemester_kurzbz = '{$studiensemester_kurzbz}'
|
||||
)
|
||||
) AS tag
|
||||
GROUP BY tag.prestudent_id
|
||||
) AS tag_data_agg
|
||||
|
||||
@@ -45,4 +45,5 @@ class Tags extends Tag_Controller
|
||||
{
|
||||
parent::doneTag($this->config->item('stv_prestudent_tags'));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user