Allow extra columns for studvw student list

This commit is contained in:
chfhtw
2026-07-08 11:00:20 +02:00
parent 5bed848aae
commit b991bbd9a5
6 changed files with 463 additions and 163 deletions
+13 -2
View File
@@ -40,6 +40,8 @@ class StudentListLib
{
$this->_ci =& get_instance(); // get code igniter instance
$this->_ci->load->config('stv');
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
if (isset($params['allowedStgs']))
@@ -111,7 +113,7 @@ class StudentListLib
) prest
WHERE laststatus NOT IN ('Abbrecher', 'Abgewiesener', 'Absolvent')
AND priorisierung <= tbl_prestudent.priorisierung
) || ' (' || COALESCE(tbl_prestudent.priorisierung::text, ' '::text) || ')' AS priorisierung_relativ", false); // TODO(chris): overwrite in fetchStudents
) || ' (' || COALESCE(tbl_prestudent.priorisierung::text, ' '::text) || ')' AS priorisierung_relativ", false);
$this->addSelect('mentor');
$this->addSelect('b.aktiv AS bnaktiv');
$this->addSelect('unruly');
@@ -119,7 +121,7 @@ class StudentListLib
// Add default JOINs
$this->addJoin('public.tbl_studiengang stg', 'studiengang_kz', 'LEFT');
$this->addJoin('public.tbl_person p', 'person_id');
$this->addJoin('public.tbl_student s', 'prestudent_id', 'LEFT'); // TODO(chris): overwrite in fetchStudents
$this->addJoin('public.tbl_student s', 'prestudent_id', 'LEFT');
$this->addJoin('public.tbl_prestudentstatus pls', '
pls.status_kurzbz=public.get_rolle_prestudent(tbl_prestudent.prestudent_id, NULL)
AND pls.prestudent_id=tbl_prestudent.prestudent_id
@@ -164,6 +166,15 @@ class StudentListLib
$this->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT');
}
// Add SELECTs and JOINs from config
$config = $this->_ci->config->item('list_columns') ?: [];
foreach ($config as $conf) {
$this->addSelect($conf['default']);
if (isset($conf['joins']))
foreach ($conf['joins'] as $join)
call_user_func_array([$this, 'addJoin'], $join);
}
}
//------------------------------------------------------------------------------------------------------------------