Merge branch 'master' into feature-68744/Studierendenverwaltung_Einstellungen

This commit is contained in:
Harald Bamberger
2025-11-19 11:42:21 +01:00
35 changed files with 814 additions and 270 deletions
+6
View File
@@ -349,5 +349,11 @@ $config['navigation_menu']['apps'] = [
'description' => 'LV Verwaltung',
#'icon' => 'person-chalkboard',
'requiredPermissions' => array('admin:r', 'assistenz:r')
],
'lav' => [
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'),
'description' => 'Lehraufträge',
#'icon' => 'person-chalkboard',
'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r', 'lehre/lehrauftrag_erteilen:r')
]
];
@@ -119,7 +119,19 @@ class Lehrveranstaltung extends FHCAPI_Controller
if (hasData($lehreinheiten_data))
{
$lehreinheiten = getData($lehreinheiten_data);
$rowData->_children = $lehreinheiten;
if (!isset($row->_children))
{
$row->_children = $lehreinheiten;
}
else
{
if (!is_array($row->_children))
{
$row->_children = [$row->_children];
}
$row->_children = array_merge($row->_children, $lehreinheiten);
}
}
if (!isEmptyString($row->studienplan_lehrveranstaltung_id_parent))
@@ -12,8 +12,8 @@ class Gruppe extends FHCAPI_Controller
'add' => ['admin:rw', 'assistenz:rw'],
'delete' => ['admin:rw', 'assistenz:rw'],
'deleteFromLVPlan' => ['admin:rw', 'assistenz:rw'],
'getBenutzer' => ['admin:r', 'assistenz:r'],
'getAll' => ['admin:r', 'assistenz:r'],
'getBenutzerSearch' => ['admin:r', 'assistenz:r'],
'getAllSearch' => ['admin:r', 'assistenz:r'],
'getByLehreinheit' => ['admin:r', 'assistenz:r'],
]);
@@ -22,7 +22,8 @@ class Gruppe extends FHCAPI_Controller
$this->_ci->load->library('PhrasesLib');
$this->loadPhrases(
array(
'ui'
'ui',
'lehre'
)
);
@@ -91,11 +92,11 @@ class Gruppe extends FHCAPI_Controller
$lehreinheitgruppe_id = $this->input->post('lehreinheitgruppe_id');
if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id) || is_null($lehreinheitgruppe_id) || !ctype_digit((string)$lehreinheitgruppe_id))
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$lehreinheitgruppe_result = $this->_ci->LehreinheitgruppeModel->loadWhere(array('lehreinheitgruppe_id' => $lehreinheitgruppe_id));
if (!hasData($lehreinheitgruppe_result) || isError($lehreinheitgruppe_result))
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$this->checkPermission($lehreinheit_id);
@@ -108,15 +109,33 @@ class Gruppe extends FHCAPI_Controller
}
public function getAll()
public function getAllSearch()
{
$query = $this->input->get('query');
if (is_null($query))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$query_words = explode(' ', $query);
$this->_ci->GruppeModel->addSelect('gruppe_kurzbz,
studiengang_kz,
semester,
bezeichnung,
gid,
\'false\' as lehrverband');
$gruppen_result = $this->_ci->GruppeModel->loadWhere(array('sichtbar' => true, 'aktiv' => true, 'lehre' => true, 'direktinskription' => false, 'semester IS NOT NULL' => null));
$this->_ci->GruppeModel->db->where(array('sichtbar' => true, 'aktiv' => true, 'lehre' => true, 'direktinskription' => false, 'semester IS NOT NULL' => null));
$this->_ci->GruppeModel->db->group_start();
foreach ($query_words as $word)
{
$this->_ci->GruppeModel->db->group_start();
$this->_ci->GruppeModel->db->where('gruppe_kurzbz ILIKE', "%" . $word . "%");
$this->_ci->GruppeModel->db->or_where('bezeichnung ILIKE', "%" . $word . "%");
$this->_ci->GruppeModel->db->group_end();
}
$this->_ci->GruppeModel->db->group_end();
$gruppen_result = $this->_ci->GruppeModel->load();
$gruppen_array = array();
@@ -135,7 +154,18 @@ class Gruppe extends FHCAPI_Controller
$this->_ci->LehrverbandModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
$this->_ci->LehrverbandModel->addOrder('verband');
$this->_ci->LehrverbandModel->addOrder('gruppe');
$lehrverband_result = $this->_ci->LehrverbandModel->loadWhere(array('tbl_lehrverband.aktiv' => true));
$this->_ci->LehrverbandModel->db->where(array('tbl_lehrverband.aktiv' => true));
$this->_ci->LehrverbandModel->db->group_start();
foreach ($query_words as $word)
{
$this->_ci->LehrverbandModel->db->group_start();
$this->_ci->LehrverbandModel->db->where('CONCAT(CONCAT(typ, kurzbz), \'\', semester, verband, COALESCE(gruppe,\'\')) ILIKE', "%" . $word . "%");
$this->_ci->LehrverbandModel->db->or_where('tbl_lehrverband.bezeichnung ILIKE', "%" . $word . "%");
$this->_ci->LehrverbandModel->db->group_end();
}
$this->_ci->LehrverbandModel->db->group_end();
$lehrverband_result = $this->_ci->LehrverbandModel->load();
$lehrverband_array = array();
@@ -150,15 +180,40 @@ class Gruppe extends FHCAPI_Controller
$this->terminateWithSuccess($all_gruppen);
}
public function getBenutzer()
public function getBenutzerSearch()
{
$query = $this->input->get('query');
if (is_null($query))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$query_words = explode(' ', $query);
$this->_ci->PersonModel->addSelect('vorname, nachname, uid, semester, UPPER(CONCAT(tbl_studiengang.typ, tbl_studiengang.kurzbz)) as studiengang');
$this->_ci->PersonModel->addJoin('public.tbl_benutzer', 'person_id');
$this->_ci->PersonModel->addJoin('public.tbl_mitarbeiter', 'uid = mitarbeiter_uid', 'LEFT');
$this->_ci->PersonModel->addJoin('public.tbl_student', 'uid = student_uid', 'LEFT');
$this->_ci->PersonModel->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT');
$personen = $this->_ci->PersonModel->loadWhere(array('tbl_benutzer.aktiv' => true));
$this->_ci->PersonModel->db->where(array('tbl_benutzer.aktiv' => true));
$this->_ci->PersonModel->db->group_start();
foreach ($query_words as $word)
{
$this->_ci->PersonModel->db->group_start();
$this->_ci->PersonModel->db->where('tbl_person.vorname ILIKE', "%" . $word . "%");
$this->_ci->PersonModel->db->or_where('tbl_person.nachname ILIKE', "%" . $word . "%");
$this->_ci->PersonModel->db->or_where('uid ILIKE', "%" . $word . "%");
$this->_ci->PersonModel->db->or_where('CONCAT(tbl_studiengang.typ, tbl_studiengang.kurzbz) ILIKE', "%" . $word . "%");
if (is_numeric($word))
{
$this->_ci->PersonModel->db->or_where('semester', $word);
}
$this->_ci->PersonModel->db->group_end();
}
$this->_ci->PersonModel->db->group_end();
$personen = $this->_ci->PersonModel->load();
$this->terminateWithSuccess(hasData($personen) ? getData($personen) : array());
}
@@ -169,6 +169,10 @@ class Lehreinheit extends FHCAPI_Controller
{
$value = $this->input->post($field);
if ($field === 'lehre')
{
$value = (bool)$value;
}
if ($value !== null)
{
$updateData[$field] = $value;
@@ -281,15 +285,43 @@ class Lehreinheit extends FHCAPI_Controller
public function delete()
{
$lehreinheit_id = $this->input->post('lehreinheit_id');
$lehreinheit = $this->checkLehreinheit($lehreinheit_id);
$this->checkPermission($lehreinheit->lehreinheit_id);
$result = $this->_ci->LehreinheitModel->deleteLehreinheit($lehreinheit->lehreinheit_id);
$errors = array();
if (is_array($lehreinheit_id))
{
foreach ($lehreinheit_id as $le_id)
{
$lehreinheit = $this->checkLehreinheit($le_id);
$this->checkPermission($lehreinheit->lehreinheit_id);
if (isError($result))
$this->terminateWithValidationErrors(getError($result));
$result = $this->_ci->LehreinheitModel->deleteLehreinheit($lehreinheit->lehreinheit_id);
$this->terminateWithSuccess('Erfolgreich geloescht');
if (isError($result))
{
$errors[] = getError($result);
}
}
}
else
{
$lehreinheit = $this->checkLehreinheit($lehreinheit_id);
$this->checkPermission($lehreinheit->lehreinheit_id);
$result = $this->_ci->LehreinheitModel->deleteLehreinheit($lehreinheit->lehreinheit_id);
if (isError($result))
$this->terminateWithError(getError($result));
}
if (!isEmptyArray($errors))
{
if (count($errors) !== count($lehreinheit_id))
$this->terminateWithSuccess(array('errors' => $errors));
else
$this->terminateWithError($errors);
}
else
$this->terminateWithSuccess('Erfolgreich geloescht');
}
public function update()
@@ -15,7 +15,7 @@ class Lektor extends FHCAPI_Controller
'deleteLVPlan' => ['admin:rw', 'assistenz:rw'],
'deletePerson' => ['admin:rw', 'assistenz:rw'],
'getLehrfunktionen' => ['admin:r', 'assistenz:r'],
'getLektoren' => ['admin:r', 'assistenz:r'],
'getLektorenSearch' => ['admin:r', 'assistenz:r'],
'getLektorenByLE' => ['admin:r', 'assistenz:r'],
'getLektorDaten' => ['admin:r', 'assistenz:r'],
'getLektorVertrag' => ['admin:r', 'assistenz:r'],
@@ -208,12 +208,35 @@ class Lektor extends FHCAPI_Controller
$this->terminateWithSuccess(getData($this->_ci->LehrfunktionModel->load()));
}
public function getLektoren()
public function getLektorenSearch()
{
$query = $this->input->get('query');
if (is_null($query))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$query_words = explode(' ', $query);
$this->_ci->MitarbeiterModel->addSelect('uid, person_id, vorname, nachname');
$this->_ci->MitarbeiterModel->addJoin('public.tbl_benutzer', 'uid = mitarbeiter_uid');
$this->_ci->MitarbeiterModel->addJoin('public.tbl_person', 'person_id');
$this->terminateWithSuccess(getData($this->_ci->MitarbeiterModel->loadWhere(array('public.tbl_benutzer.aktiv' => true))));
$this->_ci->MitarbeiterModel->db->where('public.tbl_benutzer.aktiv', true);
$this->_ci->MitarbeiterModel->db->group_start();
foreach ($query_words as $word)
{
$this->_ci->MitarbeiterModel->db->group_start();
$this->_ci->MitarbeiterModel->db->where('tbl_person.vorname ILIKE', "%" . $word . "%");
$this->_ci->MitarbeiterModel->db->or_where('tbl_person.nachname ILIKE', "%" . $word . "%");
$this->_ci->MitarbeiterModel->db->or_where('uid ILIKE', "%" . $word . "%");
$this->_ci->MitarbeiterModel->db->group_end();
}
$this->_ci->MitarbeiterModel->db->group_end();
$this->_ci->MitarbeiterModel->addOrder('nachname');
$this->_ci->MitarbeiterModel->addOrder('vorname');
$result = $this->_ci->MitarbeiterModel->load();
$this->terminateWithSuccess(hasData($result) ? getData($result) : array());
}
private function checkLehreinheit($lehreinheit_id)
@@ -5,7 +5,7 @@ if (!defined('BASEPATH'))
class Tags extends Tag_Controller
{
const BERECHTIGUNG_KURZBZ = ['admin:rw', 'assistenz:rw'];
const BERECHTIGUNG_KURZBZ = ['admin:rw', 'assistenz:r'];
public function __construct()
{
@@ -591,10 +591,14 @@ class Dokumente extends FHCAPI_Controller
$documents = [
buildDropdownEntryPrintArray("accountinfo", "Accountinfoblatt", "xml=accountinfoblatt.xml.php&xsl=AccountInfo&output=pdf", $uid, 10, null),
buildDropdownEntryPrintArray("ausbildungsvertrag", "Ausbildungsvertrag", "xml=ausbildungsvertrag.xml.php&xsl=Ausbildungsver&output=pdf", $uid, 20, null),
buildDropdownEntryPrintArray("ausbildungsvertrag_en", "Ausbildungsvertrag Englisch", "xml=ausbildungsvertrag.xml.php&xsl=AusbVerEng&output=pdf", $uid, 21, null),
buildDropdownEntryPrintArray("studienbestaetigung", "Studienbestätigung", "xml=student.rdf.php&xsl=Inskription&output=pdf", $uid, 40, null),
buildDropdownEntryPrintArray("studienbestaetigung_en", "Studienbestätigung Englisch", "xml=student.rdf.php&xsl=InskriptionEng&output=pdf", $uid, 41, null),
buildDropdownEntryPrintArray("zutrittskarte", "Zutrittskarte", "xsl=ZutrittskarteStud&output=pdf&data=$uid", $uid,100, "zutrittskarte.php"),
buildDropdownEntryPrintArray("ausbildungsvertrag_en", "Ausbildungsvertrag Zweisprachig", "xml=ausbildungsvertrag.xml.php&xsl=AusbVerEng&output=pdf", $uid, 21, null),
buildDropdownEntryPrintArray("bescheid", "Bescheid (nur Voransicht)", "xml=abschlusspruefung.rdf.php&xsl_stg_kz=$studiengang_kz&xsl=Bescheid&output=pdf", $uid, 25, null),
buildDropdownEntryPrintArray("diplomasupp", "Diploma Supplement (nur Voransicht)", "xml=diplomasupplement.xml.php&xsl_stg_kz=$studiengang_kz&xsl=DiplSupplement&output=pdf", $uid, 26, null),
buildDropdownEntryPrintArray("studienbestaetigung", "Studienbestätigung", "xml=student.rdf.php&xsl=Inskription&output=pdf", $uid, 50, null),
buildDropdownEntryPrintArray("studienbestaetigung_en", "Studienbestätigung Englisch", "xml=student.rdf.php&xsl=InskriptionEng&output=pdf", $uid, 51, null),
buildDropdownEntryPrintArray("zutrittskarte", "Zutrittskarte", "xsl=ZutrittskarteStud&output=pdf&data=$uid", $uid,200, "zutrittskarte.php"),
buildDropdownEntryPrintArray("studienblatt", "Studienblatt", "xml=studienblatt.xml.php&xsl=Studienblatt&output=pdf&ss=$studiensemester_kurzbz", $uid, 60, null),
buildDropdownEntryPrintArray("studienblatt_eng", "Studienblatt Englisch", "xml=studienblatt.xml.php&xsl=StudienblattEng&output=pdf&ss=$studiensemester_kurzbz", $uid, 61, null),
@@ -616,10 +620,11 @@ class Dokumente extends FHCAPI_Controller
]
],
$this->loadDropDownEntriesFinalExam($hasPermissionOutputformat, $stgTyp, $uid),
//Bakkzeugnis bzw. Diplomzeugnis is just shown in tab final_exam
buildDropdownEntryPrintArray("zeugnis", "Zeugnis", "xml=zeugnis.rdf.php&xsl=Zeugnis&output=pdf&xsl_stg_kz=$studiengang_kz&ss=$studiensemester_kurzbz", $uid, 121, null),
buildDropdownEntryPrintArray("zeugnis_en", "Zeugnis Englisch", "xml=zeugnis.rdf.php&xsl=ZeugnisEng&output=pdf&xsl_stg_kz=$studiengang_kz&ss=$studiensemester_kurzbz", $uid, 122, null),
buildDropdownEntryPrintArray("bescheid", "Bescheid (nur Voransicht)", "xml=abschlusspruefung.rdf.php&xsl_stg_kz=$studiengang_kz&xsl=Bescheid&output=pdf", $uid, 80, null),
buildDropdownEntryPrintArray("diplomasupp", "Diploma Supplement (nur Voransicht)", "xml=diplomasupplement.xml.php&xsl_stg_kz=$studiengang_kz&xsl=DiplSupplement&output=pdf", $uid, 81, null)
];
Events::trigger('DocumentGenerationDropDown',
@@ -632,15 +637,18 @@ class Dokumente extends FHCAPI_Controller
$studiengang_kz
);
$extraEntries = $this->loadDropDownEntriesBakkOrDipl($stgTyp, $uid);
$documents = array_merge($documents, $extraEntries);
usort($documents, function ($a, $b) {
$orderA = isset($a['order']) ? (int)$a['order'] : PHP_INT_MAX;
$orderB = isset($b['order']) ? (int)$b['order'] : PHP_INT_MAX;
return $orderA <=> $orderB;
});
$this->terminateWithSuccess($documents);
return $documents || null;
//return $documents || null;
}
public function getDocumentDropDownMulti($studiensemester_kurzbz,$studiengang_kz)
@@ -678,9 +686,9 @@ class Dokumente extends FHCAPI_Controller
buildDropdownEntryPrintArray("accountinfo", "Accountinfoblatt", "xml=accountinfoblatt.xml.php&xsl=AccountInfo&output=pdf", $uidString, 10, null),
buildDropdownEntryPrintArray("ausbildungsvertrag", "Ausbildungsvertrag", "xml=ausbildungsvertrag.xml.php&xsl=Ausbildungsver&output=pdf", $uidString, 20, null),
buildDropdownEntryPrintArray("ausbildungsvertrag_en", "Ausbildungsvertrag Englisch", "xml=ausbildungsvertrag.xml.php&xsl=AusbVerEng&output=pdf", $uidString, 21, null),
buildDropdownEntryPrintArray("studienbestaetigung", "Studienbestätigung", "xml=student.rdf.php&xsl=Inskription&output=pdf", $uidString, 40, null),
buildDropdownEntryPrintArray("studienbestaetigung_en", "Studienbestätigung Englisch", "xml=student.rdf.php&xsl=InskriptionEng&output=pdf", $uidString, 41, null),
buildDropdownEntryPrintArray("zutrittskarte", "Zutrittskarte", "xsl=ZutrittskarteStud&output=pdf&data=$uidString", $uidString,100, "zutrittskarte.php"),
buildDropdownEntryPrintArray("studienbestaetigung", "Studienbestätigung", "xml=student.rdf.php&xsl=Inskription&output=pdf", $uidString, 50, null),
buildDropdownEntryPrintArray("studienbestaetigung_en", "Studienbestätigung Englisch", "xml=student.rdf.php&xsl=InskriptionEng&output=pdf", $uidString, 51, null),
buildDropdownEntryPrintArray("zutrittskarte", "Zutrittskarte", "xsl=ZutrittskarteStud&output=pdf&data=$uidString", $uidString,200, "zutrittskarte.php"),
buildDropdownEntryPrintArray("studienblatt", "Studienblatt", "xml=studienblatt.xml.php&xsl=Studienblatt&output=pdf&ss=$studiensemester_kurzbz", $uidString, 60, null),
buildDropdownEntryPrintArray("studienblatt_eng", "Studienblatt Englisch", "xml=studienblatt.xml.php&xsl=StudienblattEng&output=pdf&ss=$studiensemester_kurzbz", $uidString, 61, null),
@@ -703,13 +711,9 @@ class Dokumente extends FHCAPI_Controller
]
],
$this->loadDropDownEntriesFinalExam($hasPermissionOutputformat, $stgTyp, $uidString),
//TODO(Manu) also in Fas multi not working
/* buildDropdownEntryPrintArray("bescheid", "Bescheid (nur Voransicht)", "xml=abschlusspruefung.rdf.php&xsl_stg_kz=$studiengang_kz&xsl=Bescheid&output=pdf", $uidString, 80, null),
*/
buildDropdownEntryPrintArray("diplomasupp", "Diploma Supplement (nur Voransicht)", "xml=diplomasupplement.xml.php&xsl_stg_kz=$studiengang_kz&xsl=DiplSupplement&output=pdf", $uidString, 81, null)
buildDropdownEntryPrintArray("diplomasupp", "Diploma Supplement (nur Voransicht)", "xml=diplomasupplement.xml.php&xsl_stg_kz=$studiengang_kz&xsl=DiplSupplement&output=pdf", $uidString, 35, null),
buildDropdownEntryPrintArray("zeugnis", "Zeugnis", "xml=zeugnis.rdf.php&xsl=Zeugnis&output=pdf&xsl_stg_kz=$studiengang_kz&ss=$studiensemester_kurzbz", $uidString, 121, null),
buildDropdownEntryPrintArray("zeugnis_en", "Zeugnis Englisch", "xml=zeugnis.rdf.php&xsl=ZeugnisEng&output=pdf&xsl_stg_kz=$studiengang_kz&ss=$studiensemester_kurzbz", $uidString, 122, null),
];
Events::trigger('DocumentGenerationDropDownMulti',
@@ -722,6 +726,10 @@ class Dokumente extends FHCAPI_Controller
$studiengang_kz
);
$extraEntries = $this->loadDropDownEntriesBakkOrDipl($stgTyp, $uidString);
$documents = array_merge($documents, $extraEntries);
usort($documents, function ($a, $b) {
$orderA = isset($a['order']) ? (int)$a['order'] : PHP_INT_MAX;
$orderB = isset($b['order']) ? (int)$b['order'] : PHP_INT_MAX;
@@ -960,4 +968,23 @@ class Dokumente extends FHCAPI_Controller
];
}
private function loadDropDownEntriesBakkOrDipl($stgTyp, $uid)
{
$entries = [];
if ($stgTyp == 'b')
{
$entries[] = buildDropdownEntryPrintArray("bakkurkunde", "Bakkurkunde", "xml=abschlusspruefung.rdf.php&xsl=Bakkurkunde&output=pdf", $uid, 22, null);
$entries[] = buildDropdownEntryPrintArray("bakkurkundeEng", "Bakkurkunde Englisch", "xml=abschlusspruefung.rdf.php&xsl=BakkurkundeEng&output=pdf", $uid, 23, null);
}
if ($stgTyp == 'm' || $stgTyp == 'd')
{
$entries[] = buildDropdownEntryPrintArray("diplomurkunde", "Diplomurkunde", "xml=abschlusspruefung.rdf.php&xsl=Diplomurkunde&output=pdf", $uid, 27, null);
$entries[] = buildDropdownEntryPrintArray("diplomurkundeEng", "Diplomurkunde Englisch", "xml=abschlusspruefung.rdf.php&xsl=DiplomurkundeEng&output=pdf", $uid, 28, null);
}
return $entries;
}
}
@@ -112,16 +112,28 @@ class Student extends FHCAPI_Controller
if (defined('ACTIVE_ADDONS') && strpos(ACTIVE_ADDONS, 'bewerbung') !== false) {
$this->PrestudentModel->addSelect(
"(
SELECT kontakt
FROM public.tbl_kontakt
WHERE kontakttyp='email'
AND person_id=p.person_id
AND zustellung
ORDER BY kontakt_id
SELECT kontakt
FROM public.tbl_kontakt
WHERE kontakttyp='email'
AND person_id=p.person_id
AND zustellung
ORDER BY kontakt_id DESC
LIMIT 1
) AS email_privat",
false
);
$this->PrestudentModel->addSelect(
"(
SELECT kontakt
FROM public.tbl_kontakt
WHERE kontakttyp='email_unverifiziert'
AND person_id=p.person_id
AND zustellung
ORDER BY kontakt_id DESC
LIMIT 1
) AS email_privat_unverified",
false
);
}
$this->PrestudentModel->addSelect(
"(
+10 -2
View File
@@ -17,6 +17,7 @@ class LektorLib
$this->_ci->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
$this->_ci->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel');
$this->_ci->load->library('PhrasesLib', array('lehre'));
}
public function addLektorToLehreinheit($lehreinheit_id, $mitarbeiter_uid)
@@ -35,7 +36,7 @@ class LektorLib
if (isError($already_assigned)) return $already_assigned;
if (hasData($already_assigned)) return error('Lektor already assigned');
if (hasData($already_assigned)) return error($this->_ci->phraseslib->t("lehre", "bereitzugeteilt"));
$studiensemester_result = $this->_ci->StudiensemesterModel->loadWhere(array('studiensemester_kurzbz' => $lehreinheit->studiensemester_kurzbz));
if (isError($studiensemester_result)) return $studiensemester_result;
@@ -88,6 +89,7 @@ class LektorLib
$lehreinheit = getData($lehreinheit_result)[0];
//TODO kollision check, wird vorerst nicht implementiert -> nur über das FAS möglich
if (isset($new_data['mitarbeiter_uid']) && $new_data['mitarbeiter_uid'] !== $mitarbeiter_uid)
{
@@ -98,7 +100,13 @@ class LektorLib
$verplant = $this->_ci->StundenplandevModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
if (hasData($verplant))
return error('Wechsel vom Mitarbeiter nicht möglich da er bereits verplant ist!');
return error($this->_ci->phraseslib->t("lehre", "lektorbereitsverplant"));
$lehreinheit_data = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('mitarbeiter_uid' => $new_data['mitarbeiter_uid'], 'lehreinheit_id' => $lehreinheit_id));
if (hasData($lehreinheit_data))
return error($this->_ci->phraseslib->t("lehre", "bereitzugeteilt"));
}
$warning = '';
if (isset($new_data['semesterstunden']))
@@ -651,7 +651,13 @@ EOSQL;
ELSE NULL
END
END,
' '
' '
ORDER BY
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz),
COALESCE(TRIM(tbl_lehreinheitgruppe.semester::text), ''),
COALESCE(TRIM(tbl_lehreinheitgruppe.verband), ''),
COALESCE(TRIM(tbl_lehreinheitgruppe.gruppe), ''),
COALESCE(tbl_lehreinheitgruppe.gruppe_kurzbz, '')
) AS gruppen
FROM lehre.tbl_lehreinheitgruppe
LEFT JOIN public.tbl_studiengang USING (studiengang_kz)
@@ -374,7 +374,7 @@ class Lehreinheitgruppe_model extends DB_Model
return success('Group assigned successfully to Lehreinheit');
}
else
return error('Group already assigned');
return error($this->p->t('lehre', 'grpbereitszugeteilt'));
}
public function deleteGroup($lehreinheit_id, $lehreinheitgruppe_id)
@@ -401,7 +401,7 @@ class Lehreinheitgruppe_model extends DB_Model
$stundenplan_result = $this->loadWhere(array('tbl_lehreinheitgruppe.lehreinheitgruppe_id' => $lehreinheitgruppe_id));
if (hasData($stundenplan_result))
return error('Gruppe already verplant');
return error($this->p->t('lehre', 'grpbereitsverplant'));
$delete_result = $this->delete($lehreinheitgruppe_id);
@@ -254,22 +254,16 @@ EOSQL;
return $dvs;
}
public function existsDienstverhaeltnis($mitarbeiter_uid, $start, $ende = null, $vertragsart_kurzbz = null)
public function existsDienstverhaeltnis($mitarbeiter_uid, $start, $ende, $vertragsart_kurzbz)
{
$this->addOrder('von', 'DESC');
$this->db->where('mitarbeiter_uid', $mitarbeiter_uid);
if (!is_null($vertragsart_kurzbz))
$this->db->where('vertragsart_kurzbz', $this->escape($vertragsart_kurzbz));
$this->db->where('vertragsart_kurzbz', $vertragsart_kurzbz);
$this->db->where('von <=', $ende);
if (!is_null($ende))
{
$this->db->group_start();
$this->db->where('bis >=', $start);
$this->db->or_where('bis IS NULL', null, false);
$this->db->group_end();
}
$this->db->group_start();
$this->db->where('bis >=', $start);
$this->db->or_where('bis IS NULL', null, false);
$this->db->group_end();
$this->addLimit(1);
return $this->load();
@@ -106,6 +106,7 @@
<tbody>
<?php
$lastMailAdress = '';
$lastUnverifiedMailAdress = '';
foreach ($stammdaten->kontakte as $kontakt): ?>
<tr>
<?php if ($kontakt->kontakttyp === 'email'): ?>
@@ -119,14 +120,16 @@
<?php echo '<span class="kontakt '.$kontakt->kontakttyp.'" data-id="'. $kontakt->kontakt_id .'" data-value="' . $kontakt->kontakt .'">';?>
<?php if ($kontakt->kontakttyp === 'email'): ?>
<a href="mailto:<?php echo $kontakt->kontakt; ?>" target="_top">
<?php $lastMailAdress = $kontakt->kontakt;
<?php $lastMailAdress = $kontakt->kontakt; ?>
<?php elseif ($kontakt->kontakttyp === 'email_unverifiziert'): ?>
<?php $lastUnverifiedMailAdress = $kontakt->kontakt;
endif;
echo $kontakt->kontakt;
if ($kontakt->kontakttyp === 'email'):
if ($kontakt->kontakttyp === 'email'):
?>
</a>
<?php endif; ?>
<?php echo '</span>'?>
<?php endif; ?>
<?php echo '</span>'?>
</td>
<td><?php echo $kontakt->anmerkung; ?></td>
</tr>
@@ -140,9 +143,9 @@
<?php if (isset($adresse)): ?>
<div class="row adresse col-sm-12" data-id="<?php echo $adresse->adresse_id ?>">
<div class="float-left" data-value="<?php echo $adresse->strasse ?>" data-type="strasse"><?php echo $adresse->strasse ?></div>
<div class="float-left" data-value="<?php echo $adresse->plz ?>" data-type="plz"><?php echo $adresse->plz ?></div>
<div class="float-left" data-value="<?php echo $adresse->ort ?>" data-type="ort"><?php echo $adresse->ort ?></div>
<?php if (isset($adresse->nationkurztext)): ?>
@@ -182,7 +185,8 @@
</div>
<?php if (isset($stammdaten->zugangscode)): ?>
<div class="col-xs-6 text-right">
<a href="<?php echo CIS_ROOT.'addons/bewerbung/cis/registration.php?code='.html_escape($stammdaten->zugangscode).'&emailAdresse='.$lastMailAdress.'&keepEmailUnverified=true' ?>"
<a href="<?php echo CIS_ROOT.'addons/bewerbung/cis/registration.php?code='.html_escape($stammdaten->zugangscode)
.'&emailAdresse='.(isEmptyString($lastMailAdress)?$lastUnverifiedMailAdress:$lastMailAdress).'&keepEmailUnverified=true' ?>"
target='_blank'><i class="glyphicon glyphicon-new-window"></i>&nbsp;<?php echo $this->p->t('infocenter','zugangBewerbung') ?></a>
</div>
<?php endif; ?>