mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
BUG: add issue fix for tag ordering
This commit is contained in:
@@ -37,6 +37,7 @@ class Tag extends API_Controller
|
||||
|
||||
if (isset($tag))
|
||||
{
|
||||
$this->TagModel->addJoin('public.tbl_notiz_typ', 'typ_kurzbz', 'typ_kurzbz');
|
||||
$result = $this->TagModel->load($tag);
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
|
||||
@@ -70,6 +70,7 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
tbl_notiz.notiz_id,
|
||||
tbl_notiz_typ.style,
|
||||
tbl_notiz_typ.automatisiert,
|
||||
tbl_notiz_typ.prioritaet,
|
||||
tbl_notiz.erledigt as done,
|
||||
tbl_notiz.insertamum,
|
||||
tbl_notiz.updateamum,
|
||||
@@ -103,7 +104,8 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
style,
|
||||
beschreibung,
|
||||
tag,
|
||||
automatisiert
|
||||
automatisiert,
|
||||
prioritaet
|
||||
"
|
||||
);
|
||||
$this->NotiztypModel->addOrder('prioritaet');
|
||||
@@ -311,6 +313,7 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
tbl_notiz.notiz_id,
|
||||
tbl_notiz_typ.style,
|
||||
tbl_notiz_typ.automatisiert,
|
||||
tbl_notiz_typ.prioritaet,
|
||||
tbl_notiz.erledigt as done,
|
||||
tbl_notiz.insertamum,
|
||||
tbl_notiz.updateamum,
|
||||
@@ -330,6 +333,8 @@ class Tag_Controller extends FHCAPI_Controller
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_notizzuordnung notizzuordnung', 'tbl_notiz.notiz_id = notizzuordnung.notiz_id');
|
||||
|
||||
$this->NotizModel->addOrder('done');
|
||||
$this->NotizModel->addOrder('tbl_notiz_typ.prioritaet');
|
||||
$notiz = $this->NotizModel->loadWhere(array('prestudent_id' => $prestudent_id));
|
||||
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ class StudentListLib
|
||||
$subQueryTag = "(
|
||||
SELECT
|
||||
tag.prestudent_id,
|
||||
COALESCE(json_agg(tag ORDER BY tag.done), '[]'::json) AS tags
|
||||
COALESCE(json_agg(tag ORDER BY tag.done, tag.prioritaet), '[]'::json) AS tags
|
||||
FROM (
|
||||
SELECT DISTINCT ON (n.notiz_id)
|
||||
n.notiz_id AS id,
|
||||
@@ -330,6 +330,7 @@ class StudentListLib
|
||||
n.text AS notiz,
|
||||
nt.style,
|
||||
n.erledigt AS done,
|
||||
nt.prioritaet AS prioritaet,
|
||||
nz.prestudent_id,
|
||||
n.start,
|
||||
n.ende
|
||||
|
||||
@@ -719,7 +719,7 @@ EOSQL;
|
||||
return "tag_data_agg AS (
|
||||
SELECT
|
||||
lehreinheit_id,
|
||||
COALESCE(json_agg(tag ORDER BY done), '[]'::json) AS tags
|
||||
COALESCE(json_agg(tag ORDER BY done, prioritaet), '[]'::json) AS tags
|
||||
FROM (
|
||||
SELECT DISTINCT ON (public.tbl_notiz.notiz_id)
|
||||
tbl_notiz.notiz_id AS id,
|
||||
@@ -728,7 +728,8 @@ EOSQL;
|
||||
text AS notiz,
|
||||
style,
|
||||
erledigt AS done,
|
||||
lehreinheit_id
|
||||
lehreinheit_id,
|
||||
prioritaet
|
||||
FROM public.tbl_notizzuordnung
|
||||
JOIN public.tbl_notiz ON tbl_notizzuordnung.notiz_id = tbl_notiz.notiz_id
|
||||
JOIN public.tbl_notiz_typ ON tbl_notiz.typ = tbl_notiz_typ.typ_kurzbz
|
||||
|
||||
Reference in New Issue
Block a user