diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 4941ba9bd..d80d02b41 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -119,9 +119,10 @@ class Lehrveranstaltung_model extends DB_Model * Gets all students of a Lehrveranstaltung * @param $studiensemester_kurzbz * @param $lehrveranstaltung_id + * @param $active optional, if true, only active students retrieved, false - only inactive, all students otherwise * @return array|null */ - public function getStudentsByLv($studiensemester_kurzbz, $lehrveranstaltung_id) + public function getStudentsByLv($studiensemester_kurzbz, $lehrveranstaltung_id, $active = null) { $query = "SELECT distinct on(nachname, vorname, person_id) vorname, nachname, matrikelnr, @@ -144,8 +145,18 @@ class Lehrveranstaltung_model extends DB_Model WHERE vw_student_lehrveranstaltung.studiensemester_kurzbz=? AND - vw_student_lehrveranstaltung.lehrveranstaltung_id=? - ORDER BY nachname, vorname, person_id, tbl_bisio.bis DESC"; + vw_student_lehrveranstaltung.lehrveranstaltung_id=?"; + + if (isset($active)) + { + if ($active === true) + $query .= " AND tbl_benutzer.aktiv"; + elseif ($active === false) + $query .= " AND tbl_benutzer.aktiv = false"; + } + + $query .= + " ORDER BY nachname, vorname, person_id, tbl_bisio.bis DESC"; return $this->execQuery($query, array($studiensemester_kurzbz, $lehrveranstaltung_id)); } diff --git a/application/models/organisation/Organisationseinheit_model.php b/application/models/organisation/Organisationseinheit_model.php index 6439bc8d6..bec4aee47 100644 --- a/application/models/organisation/Organisationseinheit_model.php +++ b/application/models/organisation/Organisationseinheit_model.php @@ -33,7 +33,7 @@ class Organisationseinheit_model extends DB_Model FROM tree JOIN tbl_organisationseinheit oe ON (tree.oe_kurzbz = oe.oe_parent_kurzbz) ) SELECT oe_kurzbz AS id, - SUBSTRING(REGEXP_REPLACE(path, '[A-z]+\|', '-', 'g') || bezeichnung, 2) AS description + SUBSTRING(REGEXP_REPLACE(path, '[A-z0-9]+\|', '-', 'g') || bezeichnung, 2) AS description FROM tree"; $parametersArray = array(); diff --git a/application/widgets/Organisationseinheit_widget.php b/application/widgets/Organisationseinheit_widget.php index e4fbfe2ba..8aba73acc 100644 --- a/application/widgets/Organisationseinheit_widget.php +++ b/application/widgets/Organisationseinheit_widget.php @@ -31,7 +31,10 @@ class Organisationseinheit_widget extends DropdownWidget { // NOTE: no need to call addSelectToModel because getRecursiveList already returns // the correct names of the fields - $this->setElementsArray($this->OrganisationseinheitModel->getRecursiveList()); + $this->setElementsArray($this->OrganisationseinheitModel->getRecursiveList(), + true, + $this->p->t('lehre', 'organisationseinheit'), + 'No organisational unit found'); } $this->loadDropDownView($widgetData); diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php index b7654310e..66cb4a6e1 100644 --- a/cis/private/profile/zeitsperre_resturlaub.php +++ b/cis/private/profile/zeitsperre_resturlaub.php @@ -518,7 +518,7 @@ if(count($zeit->result)>0) $row_vertretung = $db->db_fetch_object($result_vertretung); $content_table.= "