diff --git a/application/config/cis.php b/application/config/cis.php
index 82655f244..8d3bc347e 100644
--- a/application/config/cis.php
+++ b/application/config/cis.php
@@ -7,3 +7,9 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
$config['cis_menu_root_content_id'] = 11087;
// send Mails for ProfilUpdate
$config['cis_send_profil_update_mails'] = true;
+// Vilesci CI BaseUrl
+$config['cis_vilesci_base_url'] = defined('VILESCI_ROOT') ? VILESCI_ROOT : APP_ROOT;
+$config['cis_vilesci_index_page'] = 'index.ci.php';
+// Cis CI BaseUrl
+$config['cis_base_url'] = defined('CIS_ROOT') ? CIS_ROOT : APP_ROOT;
+$config['cis_index_page'] = 'cis.php';
diff --git a/application/config/lvverwaltung.php b/application/config/lvverwaltung.php
index 466f5c7ab..4fe09bff3 100644
--- a/application/config/lvverwaltung.php
+++ b/application/config/lvverwaltung.php
@@ -1,11 +1,11 @@
['readonly' => false],
- 'hinweis' => ['readonly' => false],
- 'hinweis_assistenz' => ['readonly' => false],
- 'finished_stg' => ['readonly' => false],
+/*It defines which tags are available in LVVerwaltung and whether they are editable
- 'finished_kf' => ['readonly' => true],
- 'inwork_kf' => ['readonly' => true],
+$config['lvverwaltung_tags'] = [
+ 'tag_1' => ['readonly' => false],
+ 'tag_1' => ['readonly' => true]
];
+*/
+
+$config['lvverwaltung_tags'] = [];
\ No newline at end of file
diff --git a/application/config/navigation.php b/application/config/navigation.php
index 5cbb6512c..11fd1a3a6 100644
--- a/application/config/navigation.php
+++ b/application/config/navigation.php
@@ -64,7 +64,7 @@ $config['navigation_header'] = array(
'lehrveranstaltungen' => array(
'link' => site_url('lehre/lvplanung/LvTemplateUebersicht'),
'icon' => '',
- 'description' => 'Lehrveranstaltungen',
+ 'description' => 'Lehrveranstaltungen Templates',
'sort' => 15
),
'reihungstest' => array(
@@ -81,6 +81,16 @@ $config['navigation_header'] = array(
'sort' => 30,
'requiredPermissions' => 'infocenter:r'
),
+ 'lvverwaltung' => array(
+ 'link' => site_url('LVVerwaltung'),
+ 'icon' => '',
+ 'description' => 'LV Verwaltung',
+ 'requiredPermissions' => array(
+ 'admin:r',
+ 'assistenz:r'
+ ),
+ 'sort' => 35
+ ),
'lehrauftrag' => array(
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'),
'description' => 'Lehrauftrag',
diff --git a/application/config/routes.php b/application/config/routes.php
index b4ce2ed4a..de8e6e098 100644
--- a/application/config/routes.php
+++ b/application/config/routes.php
@@ -63,6 +63,7 @@ $route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
$route['Cis/LvPlan/.*'] = 'Cis/LvPlan/index/$1';
$route['Cis/MyLvPlan/.*'] = 'Cis/MyLvPlan/index/$1';
+$route['Cis/MyLv/.*'] = 'Cis/MyLv/index/$1';
// Studierendenverwaltung List Routes
$route['api/frontend/v1/stv/[sS]tudents/inout'] = 'api/frontend/v1/stv/Students/index';
@@ -116,20 +117,23 @@ $subdirs = ['application/config/extensions', 'application/config/' . ENVIRONMENT
foreach($subdirs as $subdir)
{
- $dirlist = scandir($subdir);
- if ($dirlist)
+ if(is_dir($subdir))
{
- $files = array_diff($dirlist, array('.','..'));
-
- foreach ($files as &$item)
+ $dirlist = scandir($subdir);
+ if ($dirlist)
{
- if (is_dir($subdir . DIRECTORY_SEPARATOR . $item))
- {
- $routes_file = $subdir . DIRECTORY_SEPARATOR . $item . DIRECTORY_SEPARATOR . 'routes.php';
+ $files = array_diff($dirlist, array('.','..'));
- if (file_exists($routes_file))
+ foreach ($files as &$item)
+ {
+ if (is_dir($subdir . DIRECTORY_SEPARATOR . $item))
{
- require($routes_file);
+ $routes_file = $subdir . DIRECTORY_SEPARATOR . $item . DIRECTORY_SEPARATOR . 'routes.php';
+
+ if (file_exists($routes_file))
+ {
+ require($routes_file);
+ }
}
}
}
diff --git a/application/config/searchcis.php b/application/config/searchcis.php
index e3d1e2213..12bad025d 100644
--- a/application/config/searchcis.php
+++ b/application/config/searchcis.php
@@ -27,7 +27,7 @@ $config['student']['resultfields'] = [
"(p.vorname || ' ' || p.nachname) AS name",
"ARRAY[s.student_uid || '@' || '" . DOMAIN . "'] AS email",
"CASE
- WHEN p.foto IS NOT NULL THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
+ WHEN (p.foto_sperre = false AND p.foto IS NOT NULL) THEN 'data:image/jpeg' || CONVERT_FROM(DECODE('3b','hex'), 'UTF8') || 'base64,' || p.foto
ELSE NULL END
AS photo_url",
"b.aktiv"
diff --git a/application/config/stv.php b/application/config/stv.php
index 675899108..42afc318c 100644
--- a/application/config/stv.php
+++ b/application/config/stv.php
@@ -83,3 +83,33 @@ if (!defined('ZGV_DOKTOR_ANZEIGEN') || !ZGV_DOKTOR_ANZEIGEN) {
$fieldsZgvDoktor
);
}
+
+$config['student_tab_order'] = [
+ 'details',
+ 'notes',
+ 'messages',
+ 'contact',
+ 'prestudent',
+ 'status',
+ 'documents',
+ 'archive',
+ 'banking',
+ 'grades',
+ 'exam',
+ 'exemptions',
+ 'finalexam',
+ 'mobility',
+ 'jointstudies',
+ 'admissionDates',
+ 'groups',
+ 'functions',
+ 'coursedates',
+ 'resources',
+];
+$config['students_tab_order'] = [
+ 'banking',
+ 'status',
+ 'groups',
+ 'finalexam',
+ 'archive',
+];
diff --git a/application/controllers/Cis/Auth.php b/application/controllers/Cis/Auth.php
index 59dab1568..67267ebf6 100644
--- a/application/controllers/Cis/Auth.php
+++ b/application/controllers/Cis/Auth.php
@@ -72,6 +72,7 @@ class Auth extends FHC_Controller
{
$this->load->library('AuthLib');
$this->authlib->logout();
- redirect('/Cis/Auth/login', 'refresh');
+ setcookie('fhclogout', 'fhclogout', 0, '/');
+ redirect(base_url('/cis/private/logout.php'), 'refresh');
}
}
diff --git a/application/controllers/Cis/ProfilUpdate.php b/application/controllers/Cis/ProfilUpdate.php
index c47b7540b..74641d748 100644
--- a/application/controllers/Cis/ProfilUpdate.php
+++ b/application/controllers/Cis/ProfilUpdate.php
@@ -9,54 +9,21 @@ if (!defined('BASEPATH'))
class ProfilUpdate extends Auth_Controller
{
- public static $STATUS_PENDING = NULL;
- public static $STATUS_ACCEPTED = NULL;
- public static $STATUS_REJECTED = NULL;
-
- public static $TOPICS = [];
-
-
public function __construct()
{
parent::__construct([
'index' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r'],
- 'id' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r'],
- 'getProfilUpdateWithPermission' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r'],
- 'acceptProfilRequest' => ['student/stammdaten:rw', 'mitarbeiter/stammdaten:rw'],
- 'denyProfilRequest' => ['student/stammdaten:rw', 'mitarbeiter/stammdaten:rw'],
'show' => ['basis/cis:r'],
-
- 'insertProfilRequest' => ['basis/cis:rw'],
- 'updateProfilRequest' => ['basis/cis:rw'],
- 'deleteProfilRequest' => ['basis/cis:rw'],
- 'selectProfilRequest' => ['basis/cis:r'],
- 'insertFile' => ['basis/cis:rw'],
- 'getProfilRequestFiles' => ['basis/cis:r'],
- 'getStatus' => ['basis/cis:r'],
- 'getTopic' => ['basis/cis:r'],
+ 'id' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r']
]);
- $this->load->config('cis');
-
$this->load->model('person/Profil_update_model', 'ProfilUpdateModel');
- $this->load->model('person/Kontakt_model', 'KontaktModel');
- $this->load->model('person/Adresse_model', 'AdresseModel');
- $this->load->model('person/Adressentyp_model', 'AdressenTypModel');
- $this->load->model('person/Person_model', 'PersonModel');
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
$this->load->model('crm/Student_model', 'StudentModel');
- $this->load->model('person/Benutzer_model', 'BenutzerModel');
- $this->load->model('system/Sprache_model', 'SpracheModel');
- $this->load->model('person/Profil_update_status_model', 'ProfilUpdateStatusModel');
- $this->load->model('person/Profil_update_topic_model', 'ProfilUpdateTopicModel');
// Load language phrases
$this->loadPhrases(
array(
- 'ui',
- 'global',
- 'person',
- 'profil',
'profilUpdate'
)
);
@@ -64,32 +31,10 @@ class ProfilUpdate extends Auth_Controller
$this->load->library('DmsLib');
$this->load->library('PermissionLib');
- //? put the uid and pid inside the controller for reusability
$this->uid = getAuthUID();
$this->pid = getAuthPersonID();
-
- // setup the ProfilUpdate states
- $this->ProfilUpdateStatusModel->addSelect(['status_kurzbz']);
- $status_kurzbz = $this->ProfilUpdateStatusModel->load();
- if (hasData($status_kurzbz)) {
- list($status_pending, $status_accepted, $status_rejected) = getData($status_kurzbz);
-
- self::$STATUS_PENDING = $status_pending->status_kurzbz;
- self::$STATUS_ACCEPTED = $status_accepted->status_kurzbz;
- self::$STATUS_REJECTED = $status_rejected->status_kurzbz;
- }
- // setup the ProfilUpdate topics
- $this->ProfilUpdateTopicModel->addSelect(['topic_kurzbz']);
- $topic_kurzbz = $this->ProfilUpdateTopicModel->load();
-
- if (hasData($topic_kurzbz)) {
- foreach (getData($topic_kurzbz) as $topic) {
- self::$TOPICS[$topic->topic_kurzbz] = $topic->topic_kurzbz;
- }
- }
}
-
public function index()
{
$this->load->view('Cis/ProfilUpdate');
@@ -100,129 +45,14 @@ class ProfilUpdate extends Auth_Controller
$this->load->view('Cis/ProfilUpdate', ['profil_update_id' => $profil_update_id]);
}
- public function getStatus()
- {
- echo json_encode([self::$STATUS_PENDING => self::$STATUS_PENDING, self::$STATUS_ACCEPTED => self::$STATUS_ACCEPTED, self::$STATUS_REJECTED => self::$STATUS_REJECTED]);
- }
-
- public function getTopic()
- {
- echo json_encode(self::$TOPICS);
- }
-
- private function sendEmail_onProfilUpdate_response($uid, $topic, $status)
- {
- if($this->config->item('cis_send_profil_update_mails') === false)
- {
- return;
- }
-
- $this->load->helper('hlp_sancho_helper');
- $email = $uid . "@" . DOMAIN;
-
-
- function languageQuery($language)
- {
- return "select index from public.tbl_sprache where sprache = '" + $language + "'";
- }
- $this->ProfilUpdateStatusModel->addSelect(["bezeichnung_mehrsprachig[(" . languageQuery('German') . ")] as status_de", "bezeichnung_mehrsprachig[(" . languageQuery('English') . ")] as status_en"]);
- $status_translation = $this->ProfilUpdateStatusModel->loadWhere(["status_kurzbz" => $status]);
- if (isError($status_translation)) {
- show_error($this->p->t('profilUpdate', 'ProfilUpdateStatusTranslationError'));
- }
- $status_translation = hasData($status_translation) ? getData($status_translation)[0] : null;
- if (isset($status_translation)) {
- $mail_res = sendSanchoMail("profil_update_response", ['topic' => $topic, 'status_de' => $status_translation->status_de, 'status_en' => $status_translation->status_en, 'href' => APP_ROOT . 'Cis/Profil'], $email, ("Profil Änderung " . $this->p->t('profilUpdate', 'pending')));
- if (!$mail_res) {
- show_error($this->p->t('profilUpdate', 'profilUpdate_email_error'));
- }
- }
-
- }
-
-
- private function sendEmail_onProfilUpdate_insertion($uid, $profil_update_id, $topic)
- {
- if($this->config->item('cis_send_profil_update_mails') === false)
- {
- return;
- }
-
- $this->load->helper('hlp_sancho_helper');
- $emails = [];
-
- $isMitarbeiter_res = $this->MitarbeiterModel->isMitarbeiter($uid);
- if (isError($isMitarbeiter_res)) {
- show_error($this->p->t('profilUpdate', 'profilUpdate_mitarbeiterCheck_error'));
- }
- $isMitarbeiter_res = getData($isMitarbeiter_res);
-
- //! if the $uid is a mitarbeiter and student, only the hr is notified by email
- if ($isMitarbeiter_res) {
- //? user is not a student therefore he is a mitarbeiter, send email to Personalverwaltung
- //? use constant variable MAIL_GST to mail to the personalverwaltung
- $this->MitarbeiterModel->addSelect([TRUE]);
- $this->MitarbeiterModel->addJoin("public.tbl_benutzer", "public.tbl_benutzer.uid = public.tbl_mitarbeiter.mitarbeiter_uid");
- //? check if the the userID is a mitarbeiter and if the benutzer is active
- $res = $this->MitarbeiterModel->loadWhere(["public.tbl_mitarbeiter.mitarbeiter_uid" => $uid, "public.tbl_benutzer.aktiv" => TRUE]);
- if (isError($res)) {
- show_error("was not able to query the mitarbeiter and benutzer by the uid: " . $uid);
- }
- if (hasData($res)) {
- array_push($emails, MAIL_GST);
- } else {
- show_error($this->p->t('profilUpdate', 'profilUpdate_mitarbeiterCheck_error'));
- }
- } else {
- //? if it is not a mitarbeiter, check whether it is a student and send email to studiengang
- $isStudent_res = $this->StudentModel->isStudent($uid);
- if (isError($isStudent_res)) {
- show_error($this->p->t('profilUpdate', 'profilUpdate_studentCheck_error'));
- }
- $isStudent_res = getData($isStudent_res);
- if ($isStudent_res) {
- //? Send email to the Studiengangsassistentinnen
- $this->StudentModel->addSelect(["public.tbl_studiengang.email"]);
- $this->StudentModel->addJoin("public.tbl_benutzer", "public.tbl_benutzer.uid = public.tbl_student.student_uid");
- $this->StudentModel->addJoin("public.tbl_prestudent", "public.tbl_benutzer.person_id = public.tbl_prestudent.person_id");
- $this->StudentModel->addJoin("public.tbl_prestudentstatus", "public.tbl_prestudentstatus.prestudent_id = public.tbl_prestudent.prestudent_id");
- $this->StudentModel->addJoin("public.tbl_studiengang", "public.tbl_studiengang.studiengang_kz = public.tbl_prestudent.studiengang_kz");
- //* check if the benutzer itself is active
- //* check if the student status is Student or Diplomand (active students)
- $this->StudentModel->db->where_in("public.tbl_prestudentstatus.status_kurzbz", ['Student', 'Diplomand']);
- $res = $this->StudentModel->loadWhere(["public.tbl_benutzer.aktiv" => TRUE, "public.tbl_student.student_uid" => $uid]);
- if (isError($res)) {
- show_error(getData($res));
- } else {
- $res = hasData($res) ? getData($res) : [];
- foreach ($res as $emailObj) {
- array_push($emails, $emailObj->email);
- }
- }
- }
- }
- $mail_res = [];
- //? sending email
- foreach ($emails as $email) {
- array_push($mail_res, sendSanchoMail("profil_update", ['uid' => $uid, 'topic' => $topic, 'href' => APP_ROOT . 'Cis/ProfilUpdate/id/' . $profil_update_id], $email, ("Profil Änderung von " . $uid)));
- }
- foreach ($mail_res as $m_res) {
- if (!$m_res) {
- show_error($this->p->t('profilUpdate', 'profilUpdate_email_error'));
- }
- }
-
- }
-
-
public function show($dms_id)
{
-
$profil_update = $this->ProfilUpdateModel->loadWhere(['attachment_id' => $dms_id]);
$profil_update = hasData($profil_update) ? getData($profil_update)[0] : null;
//? checks if an profil update exists with the dms_id requested from the user
- if ($profil_update) {
+ if ($profil_update)
+ {
$is_mitarbeiter_profil_update = getData($this->MitarbeiterModel->isMitarbeiter($profil_update->uid));
$is_student_profil_update = getData($this->StudentModel->isStudent($profil_update->uid));
@@ -230,7 +60,8 @@ class ProfilUpdate extends Auth_Controller
$this->permissionlib->isBerechtigt('student/stammdaten:r') && $is_student_profil_update ||
$this->permissionlib->isBerechtigt('mitarbeiter/stammdaten:r') && $is_mitarbeiter_profil_update ||
$this->uid == $profil_update->uid
- ) {
+ )
+ {
// Get file to be downloaded from DMS
$newFilename = $this->uid . "/document_" . $dms_id;
$download = $this->dmslib->download($dms_id);
@@ -239,576 +70,17 @@ class ProfilUpdate extends Auth_Controller
// Download file
$this->outputFile(getData($download));
-
-
- } else {
+ }
+ else
+ {
show_error($this->p->t('profilUpdate', 'profilUpdate_permission_error'));
return;
}
-
- } else {
+ }
+ else
+ {
show_error($this->p->t('profilUpdate', 'profilUpdate_dms_error'));
return;
}
-
}
-
-
- public function insertFile($replace)
- {
- $replace = json_decode($replace);
-
- if (!count($_FILES)) {
- echo json_encode([]);
- return;
- }
-
- //? if replace is set it contains the profil_update_id in which the attachment_id has to be replaced
- if (isset($replace)) {
- $this->ProfilUpdateModel->addSelect(["attachment_id"]);
- $profilUpdate = $this->ProfilUpdateModel->load([$replace]);
- if (isError($profilUpdate)) {
- return json_encode(error($this->p->t('profilUpdate', 'profilUpdate_loading_error')));
- }
- //? get the attachmentID
- $dms_id = hasData($profilUpdate) ? getData($profilUpdate)[0]->attachment_id : null;
-
- //? delete old dms_file of Profil Update
- $this->deleteOldVersionFile($dms_id);
- }
-
-
- $files = $_FILES['files'];
- $file_count = count($files['name']);
-
- $res = [];
-
- for ($i = 0; $i < $file_count; $i++) {
- $_FILES['files']['name'] = $files['name'][$i];
- $_FILES['files']['type'] = $files['type'][$i];
- $_FILES['files']['tmp_name'] = $files['tmp_name'][$i];
- $_FILES['files']['error'] = $files['error'][$i];
- $_FILES['files']['size'] = $files['size'][$i];
-
- $dms = [
- "kategorie_kurzbz" => "profil_aenderung",
- "version" => 0,
- "name" => $_FILES['files']['name'],
- "mimetype" => $_FILES['files']['type'],
- "beschreibung" => $this->uid . " Profil Änderung",
- "insertvon" => $this->uid,
- "insertamum" => "NOW()",
- ];
-
- $tmp_res = $this->dmslib->upload($dms, 'files', array("jpg", "png", "pdf"));
-
- $tmp_res = hasData($tmp_res) ? getData($tmp_res) : null;
- array_push($res, $tmp_res);
- }
-
- echo json_encode($res);
- }
-
-
- public function selectProfilRequest()
- {
- $_GET = json_decode($this->input->raw_input_stream, true);
- $uid = $this->input->get('uid');
- $id = $this->input->get('id');
- $whereClause = ['uid' => $this->uid];
-
- if (isset($uid))
- $whereClause['uid'] = $uid;
- if (isset($id))
- $whereClause['id'] = $id;
-
- $res = $this->ProfilUpdateModel->getProfilUpdatesWhere($whereClause);
- $res = hasData($res) ? getData($res) : null;
- echo json_encode($res);
-
- }
-
-
- public function getProfilRequestFiles()
- {
- $id = json_decode($this->input->raw_input_stream);
-
- $this->ProfilUpdateModel->addSelect(["attachment_id"]);
- $attachmentID = $this->ProfilUpdateModel->load([$id]);
- if (isError($attachmentID)) {
- return json_encode(error($this->p->t('profilUpdate', 'profilUpdate_loading_error')));
- }
- //? get the attachmentID
- $dms_id = hasData($attachmentID) ? getData($attachmentID)[0]->attachment_id : null;
-
- //? get the name to the file
- $this->DmsVersionModel->addSelect(["name", "dms_id"]);
- $attachment = $this->DmsVersionModel->load([$dms_id, 0]);
- if (isError($attachment)) {
- return json_encode(error($this->p->t('profilUpdate', 'profilUpdate_dmsVersion_error')));
- }
- $attachment = hasData($attachment) ? getData($attachment) : null;
- //? returns {name:..., dms_id:...}
- echo json_encode($attachment);
- }
-
- public function insertProfilRequest()
- {
-
- $json = json_decode($this->input->raw_input_stream);
-
- $payload = $json->payload;
- $identifier = property_exists($json->payload, "kontakt_id") ? "kontakt_id" : (property_exists($json->payload, "adresse_id") ? "adresse_id" : null);
-
- $data = ["topic" => $json->topic, "uid" => $this->uid, "requested_change" => json_encode($payload), "insertamum" => "NOW()", "insertvon" => $this->uid, "status" => self::$STATUS_PENDING ?: 'Pending'];
-
- //? insert fileID in the dataset if sent with post request
- if (isset($json->fileID)) {
- $data['attachment_id'] = $json->fileID;
-
- }
-
- //? loops over all updateRequests from a user to validate if the new request is valid
- $res = $this->ProfilUpdateModel->getProfilUpdatesWhere(["uid" => $this->uid]);
- if (isError($res)) {
- show_error($this->p->t('profilUpdate', 'profilUpdate_loading_error'));
- }
- $res = hasData($res) ? getData($res) : null;
-
- //? the user cannot delete a zustelladresse/kontakt
- if (isset($payload->delete) && $payload->{$identifier == "kontakt_id" ? "zustellung" : "zustelladresse"}) {
- echo json_encode(error($this->p->t('profilUpdate', 'profilUpdate_deleteZustellung_error')));
- return;
- }
-
- //? if the user tries to delete a adresse, checks whether the adresse is a heimatadresse, if so an error is raised
- if (isset($payload->delete) && $identifier == "adresse_id") {
- $adr = $this->AdresseModel->load($payload->$identifier);
- $adr = getData($adr)[0];
- if ($adr->heimatadresse) {
- echo json_encode(error($this->p->t('profilUpdate', 'profilUpdate_deleteZustellung_error')));
- return;
- }
- }
-
- if ($res) {
- $pending_changes = array_filter($res, function ($element) {
- return $element->status == (self::$STATUS_PENDING ?: "Pending");
- });
-
- foreach ($pending_changes as $update_request) {
- $existing_change = $update_request->requested_change;
-
- //? the user can add as many new kontakte/adressen as he likes
- if (!isset($payload->add) && property_exists($existing_change, $identifier) && property_exists($payload, $identifier) && $existing_change->$identifier == $payload->$identifier) {
- //? the kontakt_id / adresse_id of a change has to be unique
- echo json_encode(error($this->p->t('profilUpdate', 'profilUpdate_changeTwice_error')));
- return;
- }
-
- //? if it is not updating any kontakt/adresse, the topic has to be unique
- elseif (!$identifier && $update_request->topic == $json->topic) {
- echo json_encode(error($this->p->t('profilUpdate', 'profilUpdate_changeTopicTwice_error', ['0' => $update_request->topic])));
- return;
- }
- }
- }
-
- $insertID = $this->ProfilUpdateModel->insert($data);
-
- if (isError($insertID)) {
- show_error(getData($insertID));
- } else {
- $insertID = hasData($insertID) ? getData($insertID) : null;
-
- //? sends emails to the correspondents of the $uid
- $this->sendEmail_onProfilUpdate_insertion($this->uid, $insertID, $json->topic);
- echo json_encode(success($insertID));
- }
- }
-
- public function updateProfilRequest()
- {
- $json = json_decode($this->input->raw_input_stream);
-
- $updateData = ["requested_change" => json_encode($json->payload), "updateamum" => "NOW()", "updatevon" => $this->uid];
- if (isset($json->fileID)) {
- $updateData['attachment_id'] = json_decode($json->fileID);
- }
- $updateID = $this->ProfilUpdateModel->update([$json->ID], $updateData);
- //? insert fileID in the dataset if sent with post request
-
- if (isError($updateID)) {
- //catch error
- } else {
- $updateID = hasData($updateID) ? getData($updateID)[0] : null;
- //TODO: should an email be sent to the responsable people when the user changes his profil update
- echo json_encode(success($updateID));
- }
- }
-
- public function deleteProfilRequest()
- {
-
- $json = json_decode($this->input->raw_input_stream);
- $delete_res = $this->ProfilUpdateModel->delete([$json]);
- echo json_encode($delete_res);
- }
-
-
- public function getProfilUpdateWithPermission($status = null)
- {
- // early return if no status has been passed as argument
- if (!isset($status)) {
- echo json_encode($this->ProfilUpdateModel->getProfilUpdateWithPermission());
- return;
- }
-
- // get the sprache of the user
- $sprachenIndex = $this->SpracheModel->loadWhere(["sprache" => getUserLanguage()]);
- $sprachenIndex = hasData($sprachenIndex) ? getData($sprachenIndex)[0]->index : null;
-
- if (isset($sprachenIndex) && isset($status)) {
- // get the corresponding status kurz_bz primary key out of the translation
- $status = $this->ProfilUpdateStatusModel->execReadOnlyQuery("select * from public.tbl_profil_update_status where ? = ANY(bezeichnung_mehrsprachig)", [$status]);
- $status = hasData($status) ? getData($status)[0]->status_kurzbz : null;
- $res = $this->ProfilUpdateModel->getProfilUpdateWithPermission(isset($status) ? ['status' => $status] : null);
-
- echo json_encode($res);
- }
- }
-
-
-
- private function getOE_from_student($student_uid)
- {
-
- //? returns the oe_einheit eines Studenten
- $query = "SELECT public.tbl_studiengang.oe_kurzbz
- FROM public.tbl_student
- JOIN public.tbl_studiengang ON tbl_student.studiengang_kz = public.tbl_studiengang.studiengang_kz
- WHERE public.tbl_student.student_uid = ?;";
-
- $res = $this->StudentModel->execReadOnlyQuery($query, [$student_uid]);
- if (!isSuccess($res)) {
- show_error($this->p->t('profilUpdate', 'profilUpdate_loadingOE_error'));
- }
- $res = hasData($res) ? getData($res) : [];
- $res = array_map(
- function ($item) {
- return $item->oe_kurzbz;
- },
- $res
- );
- return $res;
- }
-
-
- public function acceptProfilRequest()
- {
- $_POST = json_decode($this->input->raw_input_stream, true);
- $id = $this->input->post('profil_update_id', true);
- $uid = $this->input->post('uid', true);
-
- //? fetching person_id using UID
- $personID = $this->PersonModel->getByUid($uid);
- $personID = hasData($personID) ? getData($personID)[0]->person_id : null;
- $status_message = $this->input->post('status_message', true);
- $topic = $this->input->post('topic', true);
-
- //! somehow the xss check converted boolean false to empty string
- $requested_change = $this->input->post('requested_change');
-
- //! check for required information
- if (!isset($id) || !isset($uid) || !isset($personID) || !isset($requested_change) || !isset($topic)) {
- return json_encode(error($this->p->t('profilUpdate', 'profilUpdate_requiredInformation_error')));
- }
-
- $is_mitarbeiter_profil_update = getData($this->MitarbeiterModel->isMitarbeiter($uid));
- $is_student_profil_update = getData($this->StudentModel->isStudent($uid));
-
-
- //? check if the permissions are set correctly
- if (
- $this->permissionlib->isBerechtigt('student/stammdaten', "suid", $this->getOE_from_student($uid)) && $is_student_profil_update ||
- $this->permissionlib->isBerechtigt('mitarbeiter/stammdaten', "suid") && $is_mitarbeiter_profil_update
- ) {
-
- if (is_array($requested_change) && array_key_exists("adresse_id", $requested_change)) {
- $insertID = $this->handleAdresse($requested_change, $personID);
- $insertID = hasData($insertID) ? getData($insertID) : null;
- if (isset($insertID)) {
- $requested_change['adresse_id'] = $insertID;
- $update_res = $this->updateRequestedChange($id, $requested_change);
- if (isError($update_res)) {
- echo json_encode(error($this->p->t('profilUpdate', 'profilUpdate_address_error', [$insertID])));
- return;
- }
- }
-
- } else if (is_array($requested_change) && array_key_exists("kontakt_id", $requested_change)) {
- $insertID = $this->handleKontakt($requested_change, $personID);
- $insertID = hasData($insertID) ? getData($insertID) : null;
- if (isset($insertID)) {
- $requested_change['kontakt_id'] = $insertID;
- $update_res = $this->updateRequestedChange($id, $requested_change);
- if (isError($update_res)) {
- echo json_encode(error($this->p->t('profilUpdate', 'profilUpdate_kontakt_error', [$insertID])));
- return;
- }
- }
-
-
- } else {
- switch ($topic) {
- // mapping phrasen to database columns to make the update with the correct column names
- case self::$TOPICS['Titel']:
- $topic = "titelpre";
- break;
- case self::$TOPICS['Postnomen']:
- $topic = "titelpost";
- break;
- case self::$TOPICS['Vorname']:
- $topic = "vorname";
- break;
- case self::$TOPICS['Nachname']:
- $topic = "nachname";
- break;
- default:
- show_error($this->p->t('profilUpdate', 'profilUpdate_topic_error', [$topic]));
- return;
- }
-
- $result = $this->PersonModel->update($personID, [$topic => $requested_change["value"]]);
- if (isError($result)) {
- echo json_encode(error($this->p->t('profilUpdate', 'profilUpdate_insert_error')));
- return;
- }
- }
- $this->sendEmail_onProfilUpdate_response($uid, $topic, self::$STATUS_ACCEPTED);
-
- echo json_encode($this->setStatusOnUpdateRequest($id, self::$STATUS_ACCEPTED, $status_message, $requested_change));
- } else {
- show_error($this->p->t('profilUpdate', 'profilUpdate_permission_error'));
- }
-
-
- }
-
- public function denyProfilRequest()
- {
-
- $_POST = json_decode($this->input->raw_input_stream, true);
- $id = $this->input->post('profil_update_id', true);
- $uid = $this->input->post('uid', true);
- $topic = $this->input->post('topic', true);
- $status_message = $this->input->post('status_message', true);
-
- $is_mitarbeiter_profil_update = getData($this->MitarbeiterModel->isMitarbeiter($uid));
- $is_student_profil_update = getData($this->StudentModel->isStudent($uid));
-
-
- if (
- $this->permissionlib->isBerechtigt('student/stammdaten', "suid", $this->getOE_from_student($uid)) && $is_student_profil_update ||
- $this->permissionlib->isBerechtigt('mitarbeiter/stammdaten', "suid") && $is_mitarbeiter_profil_update
- ) {
- $this->sendEmail_onProfilUpdate_response($uid, $topic, self::$STATUS_REJECTED);
- echo json_encode($this->setStatusOnUpdateRequest($id, self::$STATUS_REJECTED, $status_message));
- } else {
- show_error($this->p->t('profilUpdate', 'profilUpdate_permission_error'));
- }
-
-
- }
-
- private function updateRequestedChange($id, $requested_change)
- {
- return $this->ProfilUpdateModel->update([$id], ['requested_change' => json_encode($requested_change)]);
- }
-
- private function setStatusOnUpdateRequest($id, $status, $status_message)
- {
- return $this->ProfilUpdateModel->update([$id], ["status" => $status, "status_timestamp" => "NOW()", "status_message" => $status_message]);
- }
-
- private function deleteOldVersionFile($dms_id)
- {
- if (!isset($dms_id)) {
- return;
- }
-
- //? collect all the results of the deleted versions in an array
- $res = array();
-
- //? delete all the different versions of the dms_file
- $dmsVersions = $this->DmsVersionModel->loadWhere(["dms_id" => $dms_id]);
- $dmsVersions = hasData($dmsVersions) ? getData($dmsVersions) : null;
- if (isset($dmsVersions)) {
- $zwischen_res = array_map(function ($item) {
- return $item->version;
- }, $dmsVersions);
- foreach ($zwischen_res as $version) {
- array_push($res, $this->DmsVersionModel->delete([$dms_id, $version]));
- }
- } else {
- echo json_encode(error($this->p->t('profilUpdate', 'profilUpdate_dmsVersion_error')));
- }
-
- //? returns a result for each deleted dms_file
- return $res;
- }
-
-
- private function handleKontakt($requested_change, $personID)
- {
- $kontakt_id = $requested_change["kontakt_id"];
- //? removes the kontakt_id because we don't want to update the kontakt_id in the database
- unset($requested_change["kontakt_id"]);
-
-
- //! ADD
- if (array_key_exists('add', $requested_change) && $requested_change['add']) {
- //? removes add flag
- unset($requested_change['add']);
- $requested_change['person_id'] = $personID;
- $requested_change['insertamum'] = "NOW()";
- $requested_change['insertvon'] = getAuthUID();
- $insertID = $this->KontaktModel->insert($requested_change);
- $insert_kontakt_id = $insertID;
- if (isError($insert_kontakt_id)) {
- show_error($this->p->t('profilUpdate', 'profilUpdate_insertKontakt_error'));
- }
- $insert_kontakt_id = hasData($insert_kontakt_id) ? getData($insert_kontakt_id) : null;
- if ($insert_kontakt_id) {
- $this->handleDupplicateZustellKontakte($requested_change['zustellung'], $insert_kontakt_id);
- }
-
-
- }
- //! DELETE
- elseif (array_key_exists('delete', $requested_change) && $requested_change['delete']) {
- $this->KontaktModel->delete($kontakt_id);
- }
- //! UPDATE
- else {
- $requested_change['updateamum'] = "NOW()";
- $requested_change['updatevon'] = getAuthUID();
-
- $update_kontakt_id = $this->KontaktModel->update($kontakt_id, $requested_change);
-
- if (isError($update_kontakt_id)) {
- show_error($this->p->t('profilUpdate', 'profilUpdate_updateKontakt_error'));
- }
- $update_kontakt_id = hasData($update_kontakt_id) ? getData($update_kontakt_id) : null;
- if ($update_kontakt_id) {
- $this->handleDupplicateZustellKontakte($requested_change['zustellung'], $update_kontakt_id);
- }
- }
- return isset($insertID) ? $insertID : null;
- }
-
- private function handleAdresse($requested_change, $personID)
- {
-
- $this->AdressenTypModel->addSelect(["adressentyp_kurzbz"]);
- $adr_kurzbz = $this->AdressenTypModel->loadWhere(["bezeichnung" => $requested_change['typ']]);
- $adr_kurzbz = hasData($adr_kurzbz) ? getData($adr_kurzbz)[0]->adressentyp_kurzbz : null;
- //? replace the address_typ with its correct kurzbz foreign key
- $requested_change['typ'] = $adr_kurzbz;
-
- $adresse_id = $requested_change["adresse_id"];
- //? removes the adresse_id because we don't want to update the kontakt_id in the database
- unset($requested_change["adresse_id"]);
-
-
- //! ADD
- if (array_key_exists('add', $requested_change) && $requested_change['add']) {
-
- //? removes add flag
- unset($requested_change['add']);
- $requested_change['insertamum'] = "NOW()";
- $requested_change['insertvon'] = getAuthUID();
- $requested_change['person_id'] = $personID;
- //TODO: zustelladresse, heimatadresse, rechnungsadresse und nation werden nicht beachtet
- $insertID = $this->AdresseModel->insert($requested_change);
- $insert_adresse_id = $insertID;
- if (isError($insert_adresse_id)) {
- show_error($this->p->t('profilUpdate', 'profilUpdate_insertAdresse_error'));
- }
- $insert_adresse_id = hasData($insert_adresse_id) ? getData($insert_adresse_id) : null;
- if ($insert_adresse_id) {
- $this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $insert_adresse_id);
- }
-
- }
- //! DELETE
- elseif (array_key_exists('delete', $requested_change) && $requested_change['delete']) {
- $this->AdresseModel->delete($adresse_id);
- }
- //! UPDATE
- else {
- $requested_change['updateamum'] = "NOW()";
- $requested_change['updatevon'] = getAuthUID();
- $update_adresse_id = $this->AdresseModel->update($adresse_id, $requested_change);
- if (isError($update_adresse_id)) {
- show_error($this->p->t('profilUpdate', 'profilUpdate_updateAdresse_error'));
- }
- $update_adresse_id = hasData($update_adresse_id) ? getData($update_adresse_id) : null;
- if ($update_adresse_id) {
- $this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $update_adresse_id);
- }
- }
- return isset($insertID) ? $insertID : null;
- }
-
-
- private function handleDupplicateZustellKontakte($zustellung, $kontakt_id)
- {
- if ($zustellung) {
- $this->PersonModel->addSelect("public.tbl_kontakt.kontakt_id");
- $this->PersonModel->addJoin("public.tbl_kontakt", "public.tbl_kontakt.person_id = public.tbl_person.person_id");
- $zustellKontakteArray = $this->PersonModel->loadWhere(["public.tbl_person.person_id" => $this->pid, "zustellung" => TRUE]);
- if (!isSuccess($zustellKontakteArray)) {
- return error($this->p->t('profilUpdate', 'profilUpdate_loadingZustellkontakte_error'));
- }
- $zustellKontakteArray = hasData($zustellKontakteArray) ? getData($zustellKontakteArray) : null;
-
- if ($zustellung && count($zustellKontakteArray) > 0) {
- $zustellKontakteArray = array_filter($zustellKontakteArray, function ($kontakt) use ($kontakt_id) {
- return $kontakt->kontakt_id != $kontakt_id;
- });
- foreach ($zustellKontakteArray as $kontakt) {
- $this->KontaktModel->update($kontakt->kontakt_id, ["zustellung" => FALSE]);
- }
-
- }
- }
- }
-
- private function handleDupplicateZustellAdressen($zustellung, $adresse_id)
- {
- if ($zustellung) {
- $this->PersonModel->addSelect("public.tbl_adresse.adresse_id");
- $this->PersonModel->addJoin("public.tbl_adresse", "public.tbl_adresse.person_id = public.tbl_person.person_id");
- $zustellAdressenArray = $this->PersonModel->loadWhere(["public.tbl_person.person_id" => $this->pid, "zustelladresse" => TRUE]);
- if (!isSuccess($zustellAdressenArray)) {
- return error($this->p->t('profilUpdate', 'profilUpdate_loadingZustellAdressen_error'));
- }
- $zustellAdressenArray = hasData($zustellAdressenArray) ? getData($zustellAdressenArray) : null;
-
- if ($zustellung && count($zustellAdressenArray) > 0) {
-
- $zustellAdressenArray = array_filter($zustellAdressenArray, function ($adresse) use ($adresse_id) {
-
- return $adresse->adresse_id != $adresse_id;
- });
- foreach ($zustellAdressenArray as $adresse) {
- $this->AdresseModel->update($adresse->adresse_id, ["zustelladresse" => FALSE]);
- }
-
- }
- }
- }
-
-
-}
\ No newline at end of file
+}
diff --git a/application/controllers/api/frontend/v1/LvMenu.php b/application/controllers/api/frontend/v1/LvMenu.php
index 2a305dbb5..45936d9f5 100644
--- a/application/controllers/api/frontend/v1/LvMenu.php
+++ b/application/controllers/api/frontend/v1/LvMenu.php
@@ -51,7 +51,7 @@ class LvMenu extends FHCAPI_Controller
$this->load->library("PermissionLib", null, 'PermissionLib');
- $this->load->library("PhrasesLib");
+ $this->load->library("PhrasesLib", null, 'PhrasesLib');
$this->loadPhrases(array('global', 'lehre'));
}
@@ -333,6 +333,7 @@ class LvMenu extends FHCAPI_Controller
'id'=>'core_menu_lvinfo',
'position'=>'10',
'name'=>$this->p->t('lehre', 'lehrveranstaltungsinformation'),
+ 'phrase' => 'lehre/lehrveranstaltungsinformation',
'icon'=>'../../../skin/images/button_lvinfo.png',
'link'=>'',
'c4_icon'=> base_url('skin/images/button_lvinfo.png'),
@@ -351,6 +352,7 @@ class LvMenu extends FHCAPI_Controller
'id'=>'core_menu_feedback',
'position'=>'60',
'name'=>$this->p->t('lehre', 'feedback'),
+ 'phrase' => 'lehre/feedback',
'c4_icon'=> base_url('skin/images/button_feedback.png'),
'c4_link'=> base_url('feedback.php?lvid='.$lvid),
);
@@ -368,6 +370,7 @@ class LvMenu extends FHCAPI_Controller
'id'=>'core_menu_gesamtnote',
'position'=>'80',
'name'=>$this->p->t('lehre', 'gesamtnote'),
+ 'phrase' => 'lehre/gesamtnote',
'c4_icon'=> base_url('skin/images/button_endnote.png'),
'c4_link'=> base_url('cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem))
//'c4_link'=> base_url('benotungstool/lvgesamtnoteverwalten.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem))
@@ -380,6 +383,7 @@ class LvMenu extends FHCAPI_Controller
'id'=>'core_menu_gesamtnote',
'position'=>'80',
'name'=>$this->p->t('lehre', 'gesamtnote'),
+ 'phrase'=>'lehre/gesamtnote',
'c4_icon'=>base_url('skin/images/button_endnote.png'),
'c4_link'=>'#',
'c4_linkList'=>[[$this->p->t('lehre', 'noteneingabedeaktiviert'),'#']],
@@ -452,6 +456,7 @@ class LvMenu extends FHCAPI_Controller
'id'=>'core_menu_mailanstudierende',
'position'=>'100',
'name'=>$this->p->t('lehre', 'mail'),
+ 'phrase' => 'lehre/mail',
'c4_icon'=>base_url('skin/images/button_feedback.png'),
'c4_icon2' => 'fa-regular fa-envelope',
'c4_link'=>$mailto,
@@ -476,6 +481,7 @@ class LvMenu extends FHCAPI_Controller
'id'=>'core_menu_abmeldung',
'position'=>'120',
'name'=>$this->p->t('lehre', 'abmelden'),
+ 'phrase'=>'lehre/abmelden',
'c4_icon'=>base_url('skin/images/button_studiupload.png'),
'c4_link'=>base_url('abmeldung.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem)),
);
@@ -510,6 +516,7 @@ class LvMenu extends FHCAPI_Controller
'id' => 'core_menu_anerkennungNachgewiesenerKenntnisse',
'position' => '128',
'name' => $this->p->t('lehre', 'anrechnung'),
+ 'phrase' => 'lehre/anrechnung',
'c4_icon' => base_url('skin/images/button_listen.png'),
'c4_icon2' => 'fa-regular fa-folder-open',
'c4_link' => base_url('cis.php/lehre/anrechnung/RequestAnrechnung?studiensemester='.urlencode($angezeigtes_stsem).'&lv_id='.urlencode($lvid))
@@ -527,6 +534,7 @@ class LvMenu extends FHCAPI_Controller
'id' => 'core_menu_anerkennungNachgewiesenerKenntnisse_empfehlen',
'position' => '128',
'name' => $this->p->t('lehre', 'anrechnungen'),
+ 'phrase' => 'lehre/anrechnung',
'c4_icon'=> base_url('skin/images/button_listen.png'),
'c4_icon2' => 'fa-regular fa-folder-open',
'c4_link' => base_url('cis.php/lehre/anrechnung/ReviewAnrechnungUebersicht?studiensemester='.urlencode($angezeigtes_stsem))
diff --git a/application/controllers/api/frontend/v1/LvPlan.php b/application/controllers/api/frontend/v1/LvPlan.php
index 3b6b55911..28b48e3f1 100644
--- a/application/controllers/api/frontend/v1/LvPlan.php
+++ b/application/controllers/api/frontend/v1/LvPlan.php
@@ -176,6 +176,7 @@ class LvPlan extends FHCAPI_Controller
{
$this->load->model('ressource/Stunde_model', 'StundeModel');
+ $this->StundeModel->addOrder('stunde', 'ASC');
$stunden = $this->StundeModel->load();
$stunden = $this->getDataOrTerminateWithError($stunden);
diff --git a/application/controllers/api/frontend/v1/ProfilUpdate.php b/application/controllers/api/frontend/v1/ProfilUpdate.php
index 929ea49d6..bbfed651c 100644
--- a/application/controllers/api/frontend/v1/ProfilUpdate.php
+++ b/application/controllers/api/frontend/v1/ProfilUpdate.php
@@ -573,8 +573,7 @@ class ProfilUpdate extends FHCAPI_Controller
{
// early return if no status has been passed as argument
if (!isset($status)) {
- echo json_encode($this->ProfilUpdateModel->getProfilUpdateWithPermission());
- return;
+ $this->terminateWithSuccess($this->ProfilUpdateModel->getProfilUpdateWithPermission());
}
// get the sprache of the user
@@ -587,7 +586,7 @@ class ProfilUpdate extends FHCAPI_Controller
$status = hasData($status) ? getData($status)[0]->status_kurzbz : null;
$res = $this->ProfilUpdateModel->getProfilUpdateWithPermission(isset($status) ? ['status' => $status] : null);
- echo json_encode($res);
+ $this->terminateWithSuccess($res);
}
}
@@ -641,6 +640,7 @@ class ProfilUpdate extends FHCAPI_Controller
$this->StudentModel->addJoin("public.tbl_prestudent", "public.tbl_benutzer.person_id = public.tbl_prestudent.person_id");
$this->StudentModel->addJoin("public.tbl_prestudentstatus", "public.tbl_prestudentstatus.prestudent_id = public.tbl_prestudent.prestudent_id");
$this->StudentModel->addJoin("public.tbl_studiengang", "public.tbl_studiengang.studiengang_kz = public.tbl_prestudent.studiengang_kz");
+ $this->StudentModel->addGroupBy(["public.tbl_studiengang.email"]);
//* check if the benutzer itself is active
//* check if the student status is Student or Diplomand (active students)
$this->StudentModel->db->where_in("public.tbl_prestudentstatus.status_kurzbz", ['Student', 'Diplomand']);
@@ -657,8 +657,10 @@ class ProfilUpdate extends FHCAPI_Controller
}
$mail_res = [];
//? sending email
- foreach ($emails as $email) {
- array_push($mail_res, sendSanchoMail("profil_update", ['uid' => $uid, 'topic' => $topic, 'href' => APP_ROOT . 'Cis/ProfilUpdate/id/' . $profil_update_id], $email, ("Profil Änderung von " . $uid)));
+ foreach ($emails as $email)
+ {
+ $href = $this->config->item('cis_vilesci_base_url') . $this->config->item('cis_vilesci_index_page') . '/Cis/ProfilUpdate/id/' . $profil_update_id;
+ array_push($mail_res, sendSanchoMail("profil_update", ['uid' => $uid, 'topic' => $topic, 'href' => $href], $email, ("Profil Änderung von " . $uid)));
}
foreach ($mail_res as $m_res) {
if (!$m_res) {
@@ -681,21 +683,21 @@ class ProfilUpdate extends FHCAPI_Controller
function languageQuery($language)
{
- return "select index from public.tbl_sprache where sprache = '" + $language + "'";
+ return "select index from public.tbl_sprache where sprache = '" . $language . "'";
}
$this->ProfilUpdateStatusModel->addSelect(["bezeichnung_mehrsprachig[(" . languageQuery('German') . ")] as status_de", "bezeichnung_mehrsprachig[(" . languageQuery('English') . ")] as status_en"]);
$status_translation = $this->ProfilUpdateStatusModel->loadWhere(["status_kurzbz" => $status]);
-
if (isError($status_translation)) {
$this->terminateWithError($this->p->t('profilUpdate', 'ProfilUpdateStatusTranslationError'));
}
$status_translation = hasData($status_translation) ? getData($status_translation)[0] : null;
-
- if (isset($status_translation)) {
- $mail_res = sendSanchoMail("profil_update_response", ['topic' => $topic, 'status_de' => $status_translation->status_de, 'status_en' => $status_translation->status_en, 'href' => APP_ROOT . 'Cis/Profil'], $email, ("Profil Änderung " . $this->p->t('profilUpdate', 'pending')));
+ if (isset($status_translation))
+ {
+ $href = $this->config->item('cis_base_url') . $this->config->item('cis_index_page') . '/Cis/Profil';
+ $mail_res = sendSanchoMail("profil_update_response", ['topic' => $topic, 'status_de' => $status_translation->status_de, 'status_en' => $status_translation->status_en, 'href' => $href], $email, ("Profil Änderung " . $status_translation->status_de . ' / Profile Update ' . $status_translation->status_en));
if (!$mail_res) {
$this->addError($this->p->t('profilUpdate', 'profilUpdate_email_error'));
}
diff --git a/application/controllers/api/frontend/v1/RouteInfo.php b/application/controllers/api/frontend/v1/RouteInfo.php
new file mode 100644
index 000000000..78db3ba2c
--- /dev/null
+++ b/application/controllers/api/frontend/v1/RouteInfo.php
@@ -0,0 +1,60 @@
+.
+ */
+if (!defined('BASEPATH'))
+ exit('No direct script access allowed');
+
+class RouteInfo extends FHCAPI_Controller
+{
+
+ public function __construct()
+ {
+ parent::__construct([
+ 'info' => self::PERM_LOGGED,
+ ]);
+
+ $this->load->model('system/Webservicelog_model', 'WebservicelogModel');
+ }
+
+ public function info()
+ {
+ $payload = json_decode($this->input->raw_input_stream);
+
+ if (isset($payload->app) && isset($payload->path) && $this->isValidApp($payload->app) && $this->isValidPath($payload->path))
+ {
+ $this->WebservicelogModel->insert(array(
+ 'webservicetyp_kurzbz' => 'content',
+ 'beschreibung' => $payload->app,
+ 'request_data' => $payload->path,
+ 'execute_user' => getAuthUID(),
+ 'execute_time' => 'NOW()'
+ ));
+ }
+ $this->terminateWithSuccess(true);
+ }
+
+ protected function isValidApp($app)
+ {
+ return preg_match("/^[A-Za-z0-9\-_]+$/", $app);
+ }
+
+ protected function isValidPath($path)
+ {
+ return preg_match("/^[\/A-Za-z0-9_.\-~?%=&;]+$/", $path);
+ }
+}
diff --git a/application/controllers/api/frontend/v1/Searchbar.php b/application/controllers/api/frontend/v1/Searchbar.php
index 363b6e534..b4c251555 100644
--- a/application/controllers/api/frontend/v1/Searchbar.php
+++ b/application/controllers/api/frontend/v1/Searchbar.php
@@ -39,6 +39,8 @@ class Searchbar extends FHCAPI_Controller
'searchCis' => self::PERM_LOGGED,
'searchStv' => self::PERM_LOGGED
]);
+
+ $this->load->model('system/Webservicelog_model', 'WebservicelogModel');
}
//------------------------------------------------------------------------------------------------------------------
@@ -103,6 +105,17 @@ class Searchbar extends FHCAPI_Controller
// Convert to json the result from searchlib->search
$result = $this->searchlib->search($this->input->post(self::SEARCHSTR_PARAM), $this->input->post(self::TYPES_PARAM));
+ $this->WebservicelogModel->insert(array(
+ 'webservicetyp_kurzbz' => 'content',
+ 'beschreibung' => $config['config'],
+ 'request_data' => json_encode(array(
+ self::SEARCHSTR_PARAM => $this->input->post(self::SEARCHSTR_PARAM),
+ self::TYPES_PARAM => $this->input->post(self::TYPES_PARAM)
+ )),
+ 'execute_user' => getAuthUID(),
+ 'execute_time' => 'NOW()'
+ ));
+
$data = $this->getDataOrTerminateWithError($result);
$this->addMeta('time', $result->meta['time']);
diff --git a/application/controllers/api/frontend/v1/lv/Lehreinheit.php b/application/controllers/api/frontend/v1/lv/Lehreinheit.php
index b851f8c22..958007901 100644
--- a/application/controllers/api/frontend/v1/lv/Lehreinheit.php
+++ b/application/controllers/api/frontend/v1/lv/Lehreinheit.php
@@ -350,7 +350,7 @@ class Lehreinheit extends FHCAPI_Controller
$this->form_validation->set_rules($field, 'Start KW', 'integer|greater_than[0]|less_than_equal_to[53]');
break;
case 'gewicht':
- $this->form_validation->set_rules($field, 'Gewicht', 'numeric');
+ $this->form_validation->set_rules($field, 'Gewicht', 'numeric|greater_than_equal_to[0]');
break;
case 'raumtyp':
$this->form_validation->set_rules($field, 'Raumtyp', 'required|max_length[16]');
@@ -365,7 +365,7 @@ class Lehreinheit extends FHCAPI_Controller
$this->form_validation->set_rules($field, 'LVNR', 'integer');
break;
case 'unr':
- $this->form_validation->set_rules($field, 'UNR', 'integer');
+ $this->form_validation->set_rules($field, 'UNR', 'integer|greater_than_equal_to[0]');
break;
case 'lehre':
$this->form_validation->set_rules($field, 'Lehre', 'trim');
diff --git a/application/controllers/api/frontend/v1/lv/Lektor.php b/application/controllers/api/frontend/v1/lv/Lektor.php
index 4a244c1a1..68bec1bc4 100644
--- a/application/controllers/api/frontend/v1/lv/Lektor.php
+++ b/application/controllers/api/frontend/v1/lv/Lektor.php
@@ -107,7 +107,8 @@ class Lektor extends FHCAPI_Controller
$this->form_validation->set_rules($field, 'Planstunden', 'integer|greater_than_equal_to[0]');
break;
case 'stundensatz':
- $this->form_validation->set_rules($field, 'Stundensatz', 'numeric|greater_than_equal_to[0]');
+ $formData['stundensatz'] = str_replace(',', '.', $formData['stundensatz']);
+ $this->form_validation->set_rules($field, 'Stundensatz', 'callback__check_stundensatz');
break;
case 'faktor':
$this->form_validation->set_rules($field, 'Faktor', 'numeric|greater_than_equal_to[0]');
@@ -119,6 +120,7 @@ class Lektor extends FHCAPI_Controller
$this->form_validation->set_rules($field, 'Bis Melden', 'trim');
break;
case 'semesterstunden':
+ $formData['semesterstunden'] = str_replace(',', '.', $formData['semesterstunden']);
$this->form_validation->set_rules($field, 'Semesterstunden', 'callback__check_semesterstunden');
break;
case 'mitarbeiter_uid':
@@ -129,7 +131,7 @@ class Lektor extends FHCAPI_Controller
}
if (!$this->form_validation->run())
{
- $this->terminateWithError($this->form_validation->error_array());
+ $this->terminateWithValidationErrors($this->form_validation->error_array());
}
if (isset($formData['semesterstunden']) && (!is_numeric($formData['semesterstunden']) || $formData['semesterstunden'] === ''))
@@ -145,9 +147,26 @@ class Lektor extends FHCAPI_Controller
$result = $this->_ci->lektorlib->updateLektorFromLehreinheit($lehreinheit_id, $mitarbeiter_uid, $formData);
if (isError($result)) $this->terminateWithError(getError($result));
- $this->terminateWithSuccess("Erfolgreich geupdated");
+ $this->terminateWithSuccess($result);
}
+ public function _check_stundensatz($value)
+ {
+ $value = str_replace(',', '.', $value);
+
+ if (!is_numeric($value))
+ {
+ $this->form_validation->set_message('_check_decimal', 'Das Feld {field} muss eine Zahl sein.');
+ return false;
+ }
+
+ if ($value < 0 || $value >= 10000) {
+ $this->form_validation->set_message('_check_decimal', 'Das Feld {field} muss zwischen 0 und 10000 liegen.');
+ return false;
+ }
+
+ return true;
+ }
public function _check_semesterstunden($value)
{
if ($value === null || $value === '') {
@@ -171,6 +190,14 @@ class Lektor extends FHCAPI_Controller
);
return false;
}
+ if ($value > 999.99)
+ {
+ $this->form_validation->set_message(
+ '_check_semesterstunden',
+ 'Das Feld {field} darf maximal 999,99 betragen.'
+ );
+ return false;
+ }
return true;
}
diff --git a/application/controllers/api/frontend/v1/lv/Setup.php b/application/controllers/api/frontend/v1/lv/Setup.php
index cf73697a7..a2c167dd6 100644
--- a/application/controllers/api/frontend/v1/lv/Setup.php
+++ b/application/controllers/api/frontend/v1/lv/Setup.php
@@ -50,6 +50,11 @@ class Setup extends FHCAPI_Controller
'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Details.js',
'config' => []
);
+ $tabs['gruppen'] = array (
+ 'title' => 'Gruppen',
+ 'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Gruppen.js',
+ 'config' => []
+ );
$tabs['lektor'] = array (
'title' => 'LektorInnenzuteilung',
'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Lektor.js',
diff --git a/application/controllers/api/frontend/v1/stv/Config.php b/application/controllers/api/frontend/v1/stv/Config.php
index 2fb436384..d52016943 100644
--- a/application/controllers/api/frontend/v1/stv/Config.php
+++ b/application/controllers/api/frontend/v1/stv/Config.php
@@ -184,7 +184,9 @@ class Config extends FHCAPI_Controller
return $result;
});
- $this->terminateWithSuccess($result);
+ $sortConfig = $this->config->item('student_tab_order');
+
+ $this->terminateWithSuccess($this->sortTabList($result, $sortConfig));
}
public function students()
@@ -231,7 +233,9 @@ class Config extends FHCAPI_Controller
return $result;
});
- $this->terminateWithSuccess($result);
+ $sortConfig = $this->config->item('students_tab_order');
+
+ $this->terminateWithSuccess($this->sortTabList($result, $sortConfig));
}
protected function kontoColumns()
@@ -507,4 +511,34 @@ class Config extends FHCAPI_Controller
return $list;
}
+
+ /**
+ * Sort tab list
+ *
+ * @param array $input
+ * @param array $config
+ *
+ * @return array
+ */
+ protected function sortTabList($input, $config)
+ {
+ // prepare config
+ if (!$config || !is_array($config))
+ $config = [];
+ else
+ $config = array_flip($config);
+
+ // fill missing items in config
+ foreach (array_keys($input) as $key) {
+ if (!isset($config[$key]))
+ $config[$key] = count($config);
+ }
+
+ // do the sorting
+ uksort($input, function ($a, $b) use ($config) {
+ return $config[$a] - $config[$b];
+ });
+
+ return $input;
+ }
}
diff --git a/application/controllers/api/frontend/v1/stv/Favorites.php b/application/controllers/api/frontend/v1/stv/Favorites.php
index ca8b62da6..951eb01a4 100644
--- a/application/controllers/api/frontend/v1/stv/Favorites.php
+++ b/application/controllers/api/frontend/v1/stv/Favorites.php
@@ -60,17 +60,6 @@ class Favorites extends FHCAPI_Controller
$favorites = $this->input->post('favorites');
- $removed = [];
- while (strlen($favorites) > 64) {
- $favObj = json_decode($favorites);
- if (!$favObj->list)
- break;
- $removed[] = array_shift($favObj->list);
- $favorites = json_encode($favObj);
- }
- if ($removed)
- $this->addMeta('removed', $removed);
-
$result = $this->VariableModel->setVariable(getAuthUID(), 'stv_favorites', $favorites);
$this->getDataOrTerminateWithError($result);
diff --git a/application/controllers/api/frontend/v1/stv/Kontakt.php b/application/controllers/api/frontend/v1/stv/Kontakt.php
index 9b713b5f9..3a8268775 100644
--- a/application/controllers/api/frontend/v1/stv/Kontakt.php
+++ b/application/controllers/api/frontend/v1/stv/Kontakt.php
@@ -434,7 +434,10 @@ class Kontakt extends FHCAPI_Controller
$this->FirmaModel->addJoin('public.tbl_firma f', 'ON (f.firma_id = st.firma_id)', 'LEFT');
$this->KontakttypModel->addJoin('public.tbl_kontakttyp kt', 'ON (public.tbl_kontakt.kontakttyp = kt.kontakttyp)');
$result = $this->KontaktModel->loadWhere(
- array('person_id' => $person_id)
+ array(
+ 'person_id' => $person_id,
+ 'public.tbl_kontakt.kontakttyp !=' => 'hidden'
+ )
);
if (isError($result))
@@ -442,20 +445,18 @@ class Kontakt extends FHCAPI_Controller
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess((getData($result) ?: []));
+
}
public function getKontakttypen()
{
$this->load->model('person/Kontakttyp_model', 'KontakttypModel');
+ $this->KontakttypModel->addOrder('beschreibung', 'ASC');
+ $result = $this->KontakttypModel->loadWhere(array('kontakttyp !=' => 'hidden'));
- $result = $this->KontakttypModel->load();
- if (isError($result)) {
- $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
- }
- else
- {
- $this->terminateWithSuccess(getData($result) ?: []);
- }
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess($data);
}
public function loadContact()
diff --git a/application/controllers/api/frontend/v1/stv/Prestudent.php b/application/controllers/api/frontend/v1/stv/Prestudent.php
index 4d0aa5fe1..7dc607d1a 100644
--- a/application/controllers/api/frontend/v1/stv/Prestudent.php
+++ b/application/controllers/api/frontend/v1/stv/Prestudent.php
@@ -138,13 +138,24 @@ class Prestudent extends FHCAPI_Controller
{
$val = $this->input->post($prop, true);
- if ($val !== null || $prop === 'foerderrelevant') {
+ if ($val !== null) {
+ if(in_array($prop, ['dual', 'bismelden', 'foerderrelevant']))
+ {
+ $val = boolval($val);
+ }
+ elseif (
+ $val === ''
+ && in_array($prop, ['zgvnation', 'zgvmanation', 'zgvdoktornation', 'berufstaetigkeit_code', 'ausbildungcode'])
+ )
+ {
+ $val = null;
+ }
$update_prestudent[$prop] = $val;
}
// allowed to be null, but has to be in postparameter
if (
- in_array($prop, ['zgvdatum', 'zgvmadatum', 'zgvdoktordatum', 'zgv_code', 'zgvmas_code', 'zgvdoktor_code'])
+ in_array($prop, ['foerderrelevant', 'zgvdatum', 'zgvmadatum', 'zgvdoktordatum', 'zgv_code', 'zgvmas_code', 'zgvdoktor_code'])
&& !isset($update_prestudent[$prop])
&& array_key_exists($prop, $_POST)
)
diff --git a/application/controllers/api/frontend/v1/stv/Status.php b/application/controllers/api/frontend/v1/stv/Status.php
index 665fb620f..dc48a47ff 100644
--- a/application/controllers/api/frontend/v1/stv/Status.php
+++ b/application/controllers/api/frontend/v1/stv/Status.php
@@ -286,11 +286,11 @@ class Status extends FHCAPI_Controller
]);
$this->form_validation->set_rules('_default', '', [
- ['meldestichtag_not_exceeded', function () use ($datum, $isBerechtigtNoStudstatusCheck) {
+ ['meldestichtag_not_exceeded', function () use ($datum_string, $isBerechtigtNoStudstatusCheck) {
if ($isBerechtigtNoStudstatusCheck)
return true; // Skip if access right says so
- $result = $this->prestudentstatuschecklib->checkIfMeldestichtagErreicht($datum);
+ $result = $this->prestudentstatuschecklib->checkIfMeldestichtagErreicht($datum_string);
return !$this->getDataOrTerminateWithError($result);
}],
@@ -733,8 +733,9 @@ class Status extends FHCAPI_Controller
);
$result = $this->prestudentstatuschecklib->checkIfMeldestichtagErreicht($oldstatus->datum);
+ $isMeldestichtagErreicht = $this->getDataOrTerminateWithError($result);
- if (!$this->getDataOrTerminateWithError($result))
+ if ($isMeldestichtagErreicht)
$this->terminateWithError(
$this->p->t('lehre', 'error_dataVorMeldestichtag'),
self::ERROR_TYPE_GENERAL,
diff --git a/application/controllers/api/frontend/v1/stv/Student.php b/application/controllers/api/frontend/v1/stv/Student.php
index 4309e88a4..f2845572f 100644
--- a/application/controllers/api/frontend/v1/stv/Student.php
+++ b/application/controllers/api/frontend/v1/stv/Student.php
@@ -254,7 +254,6 @@ class Student extends FHCAPI_Controller
'gebdatum',
'gebort',
'geburtsnation',
- 'svnr',
'ersatzkennzeichen',
'staatsbuergerschaft',
'matr_nr',
@@ -277,7 +276,17 @@ class Student extends FHCAPI_Controller
$update_person = array();
foreach ($array_allowed_props_person as $prop) {
$val = $this->input->post($prop);
- if ($val !== null) {
+ if ($val === null)
+ {
+ continue;
+ }
+ if($prop == 'foto')
+ {
+ $fotoval = ($val == '') ? null : str_replace('data:image/jpeg;base64,', '', $val);
+ $update_person[$prop] = $fotoval;
+ }
+ else
+ {
$update_person[$prop] = $val;
}
}
diff --git a/application/controllers/api/frontend/v1/stv/Students.php b/application/controllers/api/frontend/v1/stv/Students.php
index 26b5000bb..9de0c29b1 100644
--- a/application/controllers/api/frontend/v1/stv/Students.php
+++ b/application/controllers/api/frontend/v1/stv/Students.php
@@ -761,7 +761,6 @@ class Students extends FHCAPI_Controller
$this->PrestudentModel->addSelect('wahlname');
$this->PrestudentModel->addSelect('vornamen');
$this->PrestudentModel->addSelect('titelpost');
- $this->PrestudentModel->addSelect('svnr');
$this->PrestudentModel->addSelect('ersatzkennzeichen');
$this->PrestudentModel->addSelect('gebdatum');
$this->PrestudentModel->addSelect('geschlecht');
diff --git a/application/controllers/api/frontend/v1/stv/Verband.php b/application/controllers/api/frontend/v1/stv/Verband.php
index 4060704de..6487b6263 100644
--- a/application/controllers/api/frontend/v1/stv/Verband.php
+++ b/application/controllers/api/frontend/v1/stv/Verband.php
@@ -188,6 +188,7 @@ class Verband extends FHCAPI_Controller
array_unshift($list, [
'name' => 'PreStudent',
'link' => $link . 'prestudent',
+ 'stg_kz' => (int)$studiengang_kz,
'children' => $this->getStdSem($link . 'prestudent/', $studiengang_kz)
]);
diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php
index 03a35445e..eaa207ff1 100644
--- a/application/controllers/system/infocenter/InfoCenter.php
+++ b/application/controllers/system/infocenter/InfoCenter.php
@@ -371,6 +371,8 @@ class InfoCenter extends Auth_Controller
$data[self::ORIGIN_PAGE] = $origin_page;
$data[self::PREV_FILTER_ID] = $this->input->get(self::PREV_FILTER_ID);
+ $data['studiensemester'] = $this->variablelib->getVar('infocenter_studiensemester');
+
$this->load->view('system/infocenter/infocenterDetails.php', $data);
}
diff --git a/application/core/Notiz_Controller.php b/application/core/Notiz_Controller.php
index c2bb03267..cfc54d5f5 100644
--- a/application/core/Notiz_Controller.php
+++ b/application/core/Notiz_Controller.php
@@ -393,10 +393,10 @@ abstract class Notiz_Controller extends FHCAPI_Controller
foreach ($result as $doc) {
$res = $this->dmslib->removeAll($doc->dms_id);
- if (isError($result))
+ if (isError($res))
{
$this->db->trans_rollback();
- $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
+ $this->terminateWithError(getError($res), self::ERROR_TYPE_GENERAL);
}
}
diff --git a/application/libraries/DmsLib.php b/application/libraries/DmsLib.php
index 774ebdc79..c6c16a866 100644
--- a/application/libraries/DmsLib.php
+++ b/application/libraries/DmsLib.php
@@ -670,7 +670,7 @@ class DmsLib
$fileObj = new stdClass();
$fileObj->filename = getData($result)[0]->filename;
$fileObj->file = DMS_PATH.getData($result)[0]->filename;
- $fileObj->name = DMS_PATH.getData($result)[0]->name; // original user filename
+ $fileObj->name = getData($result)[0]->name; // original user filename
$fileObj->mimetype = getData($result)[0]->mimetype;
return success($fileObj);
diff --git a/application/libraries/LektorLib.php b/application/libraries/LektorLib.php
index 44c71cdaa..e06e2b728 100644
--- a/application/libraries/LektorLib.php
+++ b/application/libraries/LektorLib.php
@@ -176,11 +176,11 @@ class LektorLib
if (!$echter_dv && (!$this->_ci->permissionlib->isBerechtigt('admin')))
{
if (!$this->LehrauftragAufFirma(isset($formData['mitarbeiter_uid']) ? $formData['mitarbeiter_uid'] : $mitarbeiter_uid))
- return error("ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\n Daten wurden NICHT gespeichert!\n\n");
+ return error("ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden NICHT gespeichert!\n\n");
}
else
{
- $warning .= "ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\n Daten wurden gespeichert!\n\n";
+ $warning .= "ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden gespeichert!\n\n";
}
$stunden_limit_result = $this->getStundenInstitut($mitarbeiter_uid, $lehreinheit->studiensemester_kurzbz, $oe_array);
@@ -190,7 +190,7 @@ class LektorLib
$stunden_limit_array = getData($stunden_limit_result);
foreach ($stunden_limit_array as $stunden_limit)
{
- $warning .= $stunden_limit->summe . ' Stunden' . $stunden_limit->bezeichnung;
+ $warning .= $stunden_limit->summe . ' Stunden ' . $stunden_limit->bezeichnung . "\n";
}
}
}
@@ -206,7 +206,7 @@ class LektorLib
$benutzer_aktiv = getData($benutzer_result)[0]->aktiv;
if (!$benutzer_aktiv)
- $warning .= "Achtung: Der/Die Benutzer*in ist inaktiv!\nBitte informieren Sie die Personalbteilung.\n\nDaten wurden gespeichert.\n\n";
+ $warning .= "Achtung: Der/Die Benutzer*in ist inaktiv!\nBitte informieren Sie die Personalbteilung.\nDaten wurden gespeichert.\n\n";
$updatableFields = array(
'semesterstunden',
@@ -236,9 +236,9 @@ class LektorLib
if (isError($result)) return $result;
- if ($warning !== '') return error($warning);
+ if ($warning !== '') return success(['warning' => $warning]);
- return success('Successfully updated Lehreinheit');
+ return success('Erfolgreich geupdated');
}
private function getMaxStunden($mitarbeiter_uid, $studiensemester_kurzbz, $studiengang_kz, $echter_dv)
@@ -280,7 +280,7 @@ class LektorLib
foreach ($stunden_limit_array as $stunden_limit)
{
- $error .= $stunden_limit->summe . ' Stunden' . $stunden_limit->bezeichnung;
+ $error .= $stunden_limit->summe . ' Stunden ' . $stunden_limit->bezeichnung . "\n";
}
}
return error($error);
diff --git a/application/libraries/ProfilLib.php b/application/libraries/ProfilLib.php
index 2a130d263..6e93a0943 100644
--- a/application/libraries/ProfilLib.php
+++ b/application/libraries/ProfilLib.php
@@ -214,7 +214,7 @@ class ProfilLib{
* @param integer $uid the userID used to get the kontakt information
* @return array all the kontakt information corresponding to a userID
*/
- private function getKontaktInfo($pid)
+ private function getKontaktInfo($pid, $includehidden=false)
{
$this->ci->load->model("person/Kontakt_model","KontaktModel");
$this->ci->KontaktModel->addSelect(['kontakttyp', 'kontakt_id', 'kontakt', 'tbl_kontakt.anmerkung', 'tbl_kontakt.zustellung']);
@@ -222,7 +222,13 @@ class ProfilLib{
$this->ci->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT');
$this->ci->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum');
- $kontakte_res = $this->ci->KontaktModel->loadWhere(['person_id' => $pid]);
+ $params = array('person_id' => $pid);
+ if(!$includehidden)
+ {
+ $params['kontakttyp <>'] = 'hidden';
+ }
+
+ $kontakte_res = $this->ci->KontaktModel->loadWhere($params);
if(isError($kontakte_res)){
return error(getData($kontakte_res));
}
@@ -303,10 +309,22 @@ class ProfilLib{
private function getBenutzerFunktion($uid)
{
$this->ci->load->model("person/Benutzerfunktion_model","BenutzerfunktionModel");
- $this->ci->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as Bezeichnung", "tbl_organisationseinheit.bezeichnung as Organisationseinheit", "datum_von as Gültig_von", "datum_bis as Gültig_bis", "wochenstunden as Wochenstunden"]);
+ $this->ci->BenutzerfunktionModel->addSelect([
+ "CASE WHEN (tbl_benutzerfunktion.bezeichnung IS NOT NULL AND tbl_benutzerfunktion.bezeichnung <> '' AND tbl_benutzerfunktion.bezeichnung <> tbl_funktion.beschreibung) THEN tbl_funktion.beschreibung || ' - ' || tbl_benutzerfunktion.bezeichnung ELSE tbl_funktion.beschreibung END as \"Bezeichnung\"",
+ "tbl_organisationseinheit.bezeichnung as Organisationseinheit",
+ "datum_von as Gültig_von",
+ "datum_bis as Gültig_bis",
+ "COALESCE(wochenstunden, '0'::numeric(5,2)) AS \"Wochenstunden\""
+ ]);
+ $this->ci->BenutzerfunktionModel->addJoin("tbl_funktion", "funktion_kurzbz");
$this->ci->BenutzerfunktionModel->addJoin("tbl_organisationseinheit", "oe_kurzbz");
- $benutzer_funktion_res = $this->ci->BenutzerfunktionModel->loadWhere(array('uid' => $uid));
+ $benutzer_funktion_res = $this->ci->BenutzerfunktionModel->loadWhere(
+ array(
+ 'uid' => $uid,
+ 'NOW()::date BETWEEN COALESCE(datum_von, \'1970-01-01\'::date) AND COALESCE(datum_bis, \'2170-12-01\'::date)' => null
+ )
+ );
if(isError($benutzer_funktion_res)){
return error(getData($benutzer_funktion_res));
}
diff --git a/application/libraries/StundenplanLib.php b/application/libraries/StundenplanLib.php
index 6d53a2e2e..7ed64da2c 100644
--- a/application/libraries/StundenplanLib.php
+++ b/application/libraries/StundenplanLib.php
@@ -229,9 +229,10 @@ class StundenplanLib
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
$is_mitarbeiter = getData($this->_ci->MitarbeiterModel->isMitarbeiter(getAuthUID()));
-
- if ($is_mitarbeiter) {
- $reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date, $ort_kurzbz);
+
+ if ($is_mitarbeiter && empty($ort_kurzbz)) {
+ // request for personal lvplan show only reservations of logged in user
+ $reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date);
} else {
// querying the reservierungen
$reservierungen = $this->_ci->ReservierungModel->getReservierungen($start_date, $end_date, $ort_kurzbz);
diff --git a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php
index 1aaafa471..c1238c13d 100644
--- a/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php
+++ b/application/libraries/vertragsbestandteil/GehaltsbestandteilLib.php
@@ -24,7 +24,6 @@ class GehaltsbestandteilLib
$this->CI = get_instance();
$this->CI->load->model('vertragsbestandteil/Gehaltsbestandteil_model',
'GehaltsbestandteilModel');
- $this->CI->load->library('extensions/FHC-Core-Personalverwaltung/abrechnung/GehaltsLib');
$this->GehaltsbestandteilModel = $this->CI->GehaltsbestandteilModel;
}
@@ -121,10 +120,6 @@ class GehaltsbestandteilLib
{
$this->setUIDtoPGSQL();
- // delete Gehaltsabrechnung
- $ret = $this->CI->gehaltslib->deleteAbrechnung($gehaltsbestandteil);
-
- //
$ret = $this->GehaltsbestandteilModel->delete($gehaltsbestandteil->getGehaltsbestandteil_id());
if (isError($ret))
diff --git a/application/models/education/Lehreinheit_model.php b/application/models/education/Lehreinheit_model.php
index 9b850f0d0..e52af4cba 100644
--- a/application/models/education/Lehreinheit_model.php
+++ b/application/models/education/Lehreinheit_model.php
@@ -33,6 +33,11 @@ class Lehreinheit_model extends DB_Model
{
$lehreinheiten = array();
+ $this->addSelect(
+ 'lehreinheit_id, lehrveranstaltung_id, studiensemester_kurzbz, lehrform_kurzbz,
+ stundenblockung, wochenrythmus, start_kw, raumtyp, raumtypalternativ,
+ sprache, lehre, unr, lvnr, lehrfach_id, gewicht'
+ );
$this->addOrder('lehreinheit_id');
$les = $this->loadWhere(
array('lehrveranstaltung_id' => $lehrveranstaltung_id,
diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php
index 997048972..3947378cf 100644
--- a/application/models/person/Person_model.php
+++ b/application/models/person/Person_model.php
@@ -307,72 +307,60 @@ class Person_model extends DB_Model
public function checkDuplicate($person_id)
{
- $qry = "SELECT person_id
- FROM public.tbl_prestudent p
- JOIN
- (
- SELECT DISTINCT ON(prestudent_id) *
- FROM public.tbl_prestudentstatus
- WHERE prestudent_id IN
- (
- SELECT prestudent_id
- FROM public.tbl_prestudent
- WHERE person_id IN
- (
- SELECT p2.person_id
- FROM public.tbl_person p
- JOIN public.tbl_person p2
- ON lower(p.vorname) = lower(p2.vorname)
- AND lower(p.nachname) = lower(p2.nachname)
- AND p.gebdatum = p2.gebdatum
- AND p.person_id = ?
- )
- )
- ORDER BY prestudent_id, datum DESC, insertamum DESC
- ) ps USING(prestudent_id)
- JOIN public.tbl_status USING(status_kurzbz)
+ $qry = "
+ WITH person AS (
+ SELECT *
+ FROM public.tbl_person
+ WHERE person_id = ?
+ ),
+ allePersonen AS (
+ SELECT p.person_id
+ FROM public.tbl_person p
+ JOIN person
+ ON lower(p.vorname) = lower(person.vorname)
+ AND lower(p.nachname) = lower(person.nachname)
+ AND p.gebdatum = person.gebdatum
+ ),
+ lastStatus AS (
+ SELECT DISTINCT ON (tbl_prestudentstatus.prestudent_id)
+ tbl_prestudentstatus.prestudent_id,
+ tbl_prestudentstatus.status_kurzbz,
+ tbl_prestudent.studiengang_kz,
+ tbl_prestudent.person_id
+ FROM public.tbl_prestudentstatus
+ JOIN public.tbl_prestudent USING (prestudent_id)
+ WHERE tbl_prestudent.person_id IN (SELECT person_id FROM allePersonen)
+ ORDER BY tbl_prestudentstatus.prestudent_id, tbl_prestudentstatus.datum DESC, tbl_prestudentstatus.insertamum DESC
+ ),
+ interessenten AS (
+ SELECT *
+ FROM lastStatus
WHERE status_kurzbz = 'Interessent'
- AND studiengang_kz IN
- (
- SELECT studiengang_kz
- FROM public.tbl_prestudent p
- JOIN
- (
- SELECT DISTINCT ON(prestudent_id) *
- FROM public.tbl_prestudentstatus
- WHERE prestudent_id IN
- (
- SELECT prestudent_id
- FROM public.tbl_prestudent
- WHERE person_id IN
- (
- SELECT p2.person_id
- FROM public.tbl_person p
- JOIN public.tbl_person p2
- ON lower(p.vorname) = lower(p2.vorname)
- AND lower(p.nachname) = lower(p2.nachname)
- AND p.gebdatum = p2.gebdatum
- AND p.person_id = ?
- )
- )
- ORDER BY prestudent_id, datum DESC, insertamum DESC
- ) ps USING(prestudent_id)
- JOIN public.tbl_status USING(status_kurzbz)
- WHERE status_kurzbz = 'Abbrecher'
- )
-
- UNION
-
+ ),
+ keineInteressenten AS (
+ SELECT *
+ FROM lastStatus
+ WHERE status_kurzbz != 'Interessent'
+ ),
+ doppeltePerson AS (
SELECT p2.person_id
- FROM tbl_person p1
- JOIN tbl_prestudent ps ON p1.person_id = ps.person_id
- INNER JOIN (
- SELECT vorname, nachname, gebdatum, person.person_id
- FROM tbl_person person
- JOIN tbl_prestudent sps ON person.person_id = sps.person_id
- ) p2
- ON (lower(p1.vorname) = lower(p2.vorname) AND lower(p1.nachname) = lower(p2.nachname) AND p1.gebdatum = p2.gebdatum)
- WHERE p1.person_id != p2.person_id AND (p1.person_id = ?)";
+ FROM public.tbl_person p1
+ JOIN public.tbl_prestudent ps1 ON ps1.person_id = p1.person_id
+ JOIN public.tbl_person p2
+ ON lower(p1.vorname) = lower(p2.vorname)
+ AND lower(p1.nachname) = lower(p2.nachname)
+ AND p1.gebdatum = p2.gebdatum
+ WHERE p1.person_id = ?
+ AND p1.person_id <> p2.person_id
+ )
+ SELECT DISTINCT(interessenten.person_id)
+ FROM interessenten
+ JOIN keineInteressenten
+ ON interessenten.studiengang_kz = keineInteressenten.studiengang_kz
+ WHERE interessenten.person_id = ?
+ UNION
+ SELECT DISTINCT person_id
+ FROM doppeltePerson";
return $this->execQuery($qry, array($person_id, $person_id, $person_id));
}
diff --git a/application/models/ressource/Reservierung_model.php b/application/models/ressource/Reservierung_model.php
index 789ff3d9c..0c391ea20 100644
--- a/application/models/ressource/Reservierung_model.php
+++ b/application/models/ressource/Reservierung_model.php
@@ -76,7 +76,7 @@ class Reservierung_model extends DB_Model
*
* @return stdClass
*/
- public function getReservierungenMitarbeiter($start_date, $end_date, $ort_kurzbz = null)
+ public function getReservierungenMitarbeiter($start_date, $end_date)
{
$raum_reservierungen_query = "SELECT res.*, beginn, ende,
@@ -89,7 +89,6 @@ class Reservierung_model extends DB_Model
JOIN lehre.tbl_stunde ON lehre.tbl_stunde.stunde = res.stunde
WHERE res.uid = ? AND datum >= ? AND datum <= ?";
-// $subquery = is_null($ort_kurzbz)? $lvplan_reservierungen_query:$raum_reservierungen_query;
$subquery = $raum_reservierungen_query;
diff --git a/application/views/system/infocenter/anmerkungenZurBewerbung.php b/application/views/system/infocenter/anmerkungenZurBewerbung.php
index ca012ff3e..3ffe5f9a2 100644
--- a/application/views/system/infocenter/anmerkungenZurBewerbung.php
+++ b/application/views/system/infocenter/anmerkungenZurBewerbung.php
@@ -18,6 +18,9 @@
kurzbzlang)) ?: print_r('(' . nl2br($notiz->kurzbzlang) . ') - ') ?>
text) ?>
+
+
+ |
diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php
index 51b913b6c..fb023c5fd 100644
--- a/application/views/system/infocenter/infocenterDetails.php
+++ b/application/views/system/infocenter/infocenterDetails.php
@@ -57,7 +57,7 @@
diff --git a/cis/infoterminal/index.php b/cis/infoterminal/index.php
index 1b4c7d637..04c591ee1 100644
--- a/cis/infoterminal/index.php
+++ b/cis/infoterminal/index.php
@@ -843,7 +843,6 @@ function meine_uid_informationen_detail($db,$uid,$count=0)
$aktiv=$db->db_result($erg,0,"aktiv");
- $svnr=$db->db_result($erg,0,"svnr");
$titelpre=$db->db_result($erg,0,"titelpre");
$titelpost=$db->db_result($erg,0,"titelpost");
diff --git a/cis/private/logout.php b/cis/private/logout.php
new file mode 100644
index 000000000..9c1cbeee6
--- /dev/null
+++ b/cis/private/logout.php
@@ -0,0 +1,34 @@
+
+
+
+
+
FH-Complete logout Basic Auth
+
+
+
+
+
+
+ benutzerfunktion_exists($user, 'lehrling', true))
+{
+ $activities[] = 'Berufsschule';
+}
+
$activities_str = "'".implode("','", $activities)."'";
// definiert bis zu welchem Datum die Eintragung nicht mehr möglich ist
@@ -690,7 +698,7 @@ echo '
function checkPausenblock()
{
var sel = $("#aktivitaet").val();
- var activities = ["Admin", "Lehre", "FuE", "Operativ", "Betrieb", "Design", "LVEntwicklung", "Weiterbildung", "FuEallg"];
+ var activities = ["Admin", "Lehre", "FuE", "Operativ", "Betrieb", "Design", "LVEntwicklung", "Weiterbildung", "FuEallg", "Berufsschule"];
if (activities.includes(sel))
showPausenblock();
else
diff --git a/content/dokumentenakt.pdf.php b/content/dokumentenakt.pdf.php
index a27b8d562..a737ee72d 100644
--- a/content/dokumentenakt.pdf.php
+++ b/content/dokumentenakt.pdf.php
@@ -307,8 +307,6 @@ foreach($prestudent_ids as $pid)
$nation->load($prestudent->zgvnation);
$zgvnation = $nation->kurztext;
- $svnr = ($prestudent->svnr == '')?($prestudent->ersatzkennzeichen != ''?'Ersatzkennzeichen: '.$prestudent->ersatzkennzeichen:''):$prestudent->svnr;
-
foreach($adresse->result as $row_adresse)
{
if($row_adresse->heimatadresse)
@@ -439,7 +437,6 @@ foreach($prestudent_ids as $pid)
'zustell_ort' => $zustellOrt,
'zustell_bundesland' => $zustellBundesland,
'geburtsnation' => $geburtsnation,
- 'svnr' => $svnr,
'staatsbuergerschaft' => $staatsbuergerschaft,
'geschlecht' => $prestudent->geschlecht,
'telefonnummer' => $telefonnummer,
diff --git a/content/statistik/studentenexportextended.xls.php b/content/statistik/studentenexportextended.xls.php
index 89acbe18f..5ab34d026 100644
--- a/content/statistik/studentenexportextended.xls.php
+++ b/content/statistik/studentenexportextended.xls.php
@@ -125,8 +125,6 @@ $worksheet->write($zeile, ++$i, "PERSONENKENNZEICHEN", $format_bold);
$maxlength[$i] = 19;
$worksheet->write($zeile, ++$i, "STAATSBÜRGERSCHAFT", $format_bold);
$maxlength[$i] = 16;
-$worksheet->write($zeile, ++$i, "SVNR", $format_bold);
-$maxlength[$i] = 4;
$worksheet->write($zeile, ++$i, "PERSON_ID", $format_bold);
$maxlength[$i] = 6;
$worksheet->write($zeile, ++$i, "ERSATZKENNZEICHEN", $format_bold);
@@ -396,12 +394,7 @@ function draw_content($row)
$worksheet->write($zeile, $i, $row->staatsbuergerschaft);
$i++;
- //SVNR
- if (mb_strlen($row->svnr) > $maxlength[$i])
- $maxlength[$i] = mb_strlen($row->svnr);
- $worksheet->write($zeile, $i, $row->svnr);
- $i++;
-
+
//Person_id
if (mb_strlen($row->person_id) > $maxlength[$i])
$maxlength[$i] = mb_strlen($row->person_id);
diff --git a/content/student/studentDBDML.php b/content/student/studentDBDML.php
index e1bcffd84..041af9c20 100644
--- a/content/student/studentDBDML.php
+++ b/content/student/studentDBDML.php
@@ -594,7 +594,6 @@ if(!$error)
$student->anmerkungen = $_POST['anmerkung'];
$student->homepage = $_POST['homepage'];
$student->matr_nr = $_POST['matr_nr'];
- $student->svnr = $_POST['svnr'];
$student->ersatzkennzeichen = $_POST['ersatzkennzeichen'];
$student->familienstand = $_POST['familienstand'];
$student->geschlecht = $_POST['geschlecht'];
@@ -746,7 +745,6 @@ if(!$error)
$person->gebzeit = $_POST['geburtszeit'];
$person->anmerkungen = $_POST['anmerkung'];
$person->homepage = $_POST['homepage'];
- $person->svnr = $_POST['svnr'];
$person->ersatzkennzeichen = $_POST['ersatzkennzeichen'];
$person->familienstand = $_POST['familienstand'];
$person->geschlecht = $_POST['geschlecht'];
diff --git a/content/student/studentdetailoverlay.xul.php b/content/student/studentdetailoverlay.xul.php
index 132667395..36740d209 100644
--- a/content/student/studentdetailoverlay.xul.php
+++ b/content/student/studentdetailoverlay.xul.php
@@ -134,8 +134,7 @@ echo '';
-
-
+
diff --git a/content/student/studentenoverlay.xul.php b/content/student/studentenoverlay.xul.php
index 739cde39c..809055c2e 100644
--- a/content/student/studentenoverlay.xul.php
+++ b/content/student/studentenoverlay.xul.php
@@ -284,10 +284,6 @@ else
class="sortDirectionIndicator"
sort="rdf:http://www.technikum-wien.at/student/rdf#titelpost" onclick="StudentTreeSort()"/>
-
-
@@ -445,7 +441,6 @@ else
-
diff --git a/content/student/studentoverlay.js.php b/content/student/studentoverlay.js.php
index d8cb1fc56..f64ed5f91 100644
--- a/content/student/studentoverlay.js.php
+++ b/content/student/studentoverlay.js.php
@@ -786,7 +786,6 @@ function StudentDetailReset()
document.getElementById('student-detail-textbox-geburtszeit').value='';
document.getElementById('student-detail-textbox-anmerkung').value='';
document.getElementById('student-detail-textbox-homepage').value='';
- document.getElementById('student-detail-textbox-svnr').value='';
document.getElementById('student-detail-textbox-ersatzkennzeichen').value='';
document.getElementById('student-detail-menulist-familienstand').value='l';
document.getElementById('student-detail-menulist-geschlecht').value='m';
@@ -819,7 +818,6 @@ function StudentDetailDisableFields(val)
document.getElementById('student-detail-textbox-geburtszeit').disabled=val;
document.getElementById('student-detail-textbox-anmerkung').disabled=val;
document.getElementById('student-detail-textbox-homepage').disabled=val;
- document.getElementById('student-detail-textbox-svnr').disabled=val;
document.getElementById('student-detail-textbox-ersatzkennzeichen').disabled=val;
document.getElementById('student-detail-menulist-familienstand').disabled=val;
document.getElementById('student-detail-menulist-geschlecht').disabled=val;
@@ -860,7 +858,6 @@ function StudentDetailSave()
geburtszeit = document.getElementById('student-detail-textbox-geburtszeit').value;
anmerkung = document.getElementById('student-detail-textbox-anmerkung').value;
homepage = document.getElementById('student-detail-textbox-homepage').value;
- svnr = document.getElementById('student-detail-textbox-svnr').value;
ersatzkennzeichen = document.getElementById('student-detail-textbox-ersatzkennzeichen').value;
familienstand = document.getElementById('student-detail-menulist-familienstand').value;
geschlecht = document.getElementById('student-detail-menulist-geschlecht').value;
@@ -919,7 +916,6 @@ function StudentDetailSave()
req.add('geburtszeit', geburtszeit);
req.add('anmerkung', anmerkung);
req.add('homepage', homepage);
- req.add('svnr', svnr);
req.add('ersatzkennzeichen', ersatzkennzeichen);
req.add('familienstand', familienstand);
req.add('geschlecht', geschlecht);
@@ -1167,7 +1163,6 @@ function StudentAuswahl()
geburtszeit=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#gebzeit" ));
anmerkung=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#anmerkungen" ));
homepage=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#homepage" ));
- svnr=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#svnr" ));
ersatzkennzeichen=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#ersatzkennzeichen" ));
familienstand=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#familienstand" ));
geschlecht=getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#geschlecht" ));
@@ -1211,7 +1206,6 @@ function StudentAuswahl()
document.getElementById('student-detail-textbox-geburtszeit').value=geburtszeit;
document.getElementById('student-detail-textbox-anmerkung').value=anmerkung;
document.getElementById('student-detail-textbox-homepage').value=homepage;
- document.getElementById('student-detail-textbox-svnr').value=svnr;
document.getElementById('student-detail-textbox-ersatzkennzeichen').value=ersatzkennzeichen;
document.getElementById('student-detail-menulist-familienstand').value=familienstand;
diff --git a/include/prestudent.class.php b/include/prestudent.class.php
index 06b974b1a..7317572ba 100644
--- a/include/prestudent.class.php
+++ b/include/prestudent.class.php
@@ -1051,7 +1051,6 @@ class prestudent extends person
//$ps->foto = $row->foto;
$ps->anmerkungen = $row->anmerkungen;
$ps->homepage = $row->homepage;
- $ps->svnr = $row->svnr;
$ps->ersatzkennzeichen = $row->ersatzkennzeichen;
$ps->familienstand = $row->familienstand;
$ps->geschlecht = $row->geschlecht;
diff --git a/include/student.class.php b/include/student.class.php
index cfea879a9..66154c3ca 100644
--- a/include/student.class.php
+++ b/include/student.class.php
@@ -294,7 +294,6 @@ class student extends benutzer
$l->gebort=$row->gebort;
$l->gebzeit=$row->gebzeit;
$l->familienstand = $row->familienstand;
- $l->svnr=$row->svnr;
$l->foto=$row->foto;
$l->anmerkungen=$row->anmerkung;
$l->aktiv=$this->db_parse_bool($row->aktiv);
@@ -649,7 +648,7 @@ class student extends benutzer
{
$sql_query = "SELECT
person_id, staatsbuergerschaft, geburtsnation, sprache, anrede, titelpost, titelpre,
- nachname, vorname, vornamen, gebdatum, gebort, gebzeit, anmerkung, homepage, svnr,
+ nachname, vorname, vornamen, gebdatum, gebort, gebzeit, anmerkung, homepage,
ersatzkennzeichen, familienstand, geschlecht, anzahlkinder, tbl_person.aktiv, kurzbeschreibung,
tbl_benutzer.aktiv as bnaktiv, tbl_student.studiengang_kz, tbl_student.semester, tbl_student.verband,
tbl_student.gruppe, tbl_student.prestudent_id, tbl_benutzer.uid
@@ -691,7 +690,6 @@ class student extends benutzer
$l->gebzeit = $row->gebzeit;
$l->anmerkungen = $row->anmerkung;
$l->homepage = $row->homepage;
- $l->svnr = $row->svnr;
$l->ersatzkennzeichen = $row->ersatzkennzeichen;
$l->familienstand = $row->familienstand;
$l->geschlecht = $row->geschlecht;
diff --git a/public/css/Lvverwaltung.css b/public/css/Lvverwaltung.css
index 38d74def4..6e0f4c760 100644
--- a/public/css/Lvverwaltung.css
+++ b/public/css/Lvverwaltung.css
@@ -28,3 +28,13 @@ textarea[name="anmerkung"] {
content: '\f073';
color: #f3c541;
}
+
+
+.modal-dialog.modal-xxl {
+ max-width: 95% !important;
+}
+
+.tabulator-menu .tabulator-menu-item.tabulator-menu-item-submenu:after
+{
+ border-color: black;
+}
diff --git a/public/css/Tabulator6.css b/public/css/Tabulator6.css
index 8be726544..7a66dd2f6 100644
--- a/public/css/Tabulator6.css
+++ b/public/css/Tabulator6.css
@@ -1 +1,153 @@
-@import '../../vendor/olifolkerd/tabulator6/dist/css/tabulator_simple.min.css';
\ No newline at end of file
+@import '../../vendor/olifolkerd/tabulator6/dist/css/tabulator_simple.min.css';
+.tabulator-row {
+ border-bottom: none;
+}
+.tabulator-row .tabulator-frozen,
+.tabulator-row .tabulator-cell {
+ border-bottom: 1px solid #dee2e6;
+}
+.tabulator-row.tabulator-row-even {
+ background-color: transparent;
+}
+.tabulator-headers .tabulator-frozen,
+.tabulator-row.tabulator-row-odd .tabulator-frozen,
+.tabulator-row.tabulator-row-odd .tabulator-cell {
+ background-color: #fff;
+}
+.tabulator-row.tabulator-row-even .tabulator-frozen,
+.tabulator-row.tabulator-row-even .tabulator-cell {
+ background-color: #f2f2f2;
+}
+.tabulator-row.tabulator-selectable:hover .tabulator-frozen,
+.tabulator-row.tabulator-selectable:hover .tabulator-cell {
+ background-color: #ececec;
+}
+.tabulator-row.tabulator-selected .tabulator-frozen,
+.tabulator-row.tabulator-selected .tabulator-cell {
+ background-color: #9abcea;
+}
+.tabulator-row.tabulator-selected:hover .tabulator-frozen,
+.tabulator-row.tabulator-selected:hover .tabulator-cell {
+ background-color: #769bcc;
+}
+.tabulator .tabulator-col-resize-handle:last-of-type {
+ z-index: 999999;
+}
+
+/* classes for rows that are not selectable in the tabulator, except for rows that are used for calculation */
+.tabulator-row.tabulator-unselectable:not(.tabulator-calcs) {
+ color: #adb5bd !important;
+ pointer-events: none !important;
+}
+
+.tabulator-row.tabulator-unselectable a {
+ pointer-events: auto !important;
+}
+
+/* using bootstrap background classes to style the background color of tabulator rows */
+/* bg-warning */
+/* odd-rows */
+.tabulator-headers .tabulator-frozen.bg-warning,
+.tabulator-row.tabulator-row-odd .tabulator-frozen.bg-warning,
+.tabulator-row.tabulator-row-odd .tabulator-cell.bg-warning {
+ background-color: #fcf8e3;
+
+}
+/* even-rows */
+.tabulator-headers .tabulator-frozen.bg-warning,
+.tabulator-row.tabulator-row-even .tabulator-frozen.bg-warning,
+.tabulator-row.tabulator-row-even .tabulator-cell.bg-warning {
+ background-color: #fcf8e3;
+
+}
+
+/* bg-success */
+/* odd-rows */
+.tabulator-headers .tabulator-frozen.bg-success,
+.tabulator-row.tabulator-row-odd .tabulator-frozen.bg-success,
+.tabulator-row.tabulator-row-odd .tabulator-cell.bg-success {
+ background-color: #dff0d8;
+
+}
+/* even-rows */
+.tabulator-headers .tabulator-frozen.bg-success,
+.tabulator-row.tabulator-row-even .tabulator-frozen.bg-success,
+.tabulator-row.tabulator-row-even .tabulator-cell.bg-success {
+ background-color: #dff0d8;
+
+}
+
+/* bg-info */
+/* odd-rows */
+.tabulator-headers .tabulator-frozen.bg-info,
+.tabulator-row.tabulator-row-odd .tabulator-frozen.bg-info,
+.tabulator-row.tabulator-row-odd .tabulator-cell.bg-info {
+ background-color: #d9edf7;
+
+}
+/* even-rows */
+.tabulator-headers .tabulator-frozen.bg-info,
+.tabulator-row.tabulator-row-even .tabulator-frozen.bg-info,
+.tabulator-row.tabulator-row-even .tabulator-cell.bg-info {
+ background-color: #d9edf7;
+
+}
+
+/* special bootstrap5 styling for tableWidget and their accordion-item ::after content */
+.accordion-button::after{
+ content:none !important;
+}
+
+
+.tabulator {
+ font-size: 1rem;
+}
+
+.tabulator-initialfontsize .tabulator {
+ font-size: 14px;
+}
+
+.tabulator-row.tabulator-unselectable .tabulator-cell {
+ pointer-events: all;
+}
+
+.tabulator-tooltip {
+ color: #fff;
+ background-color: #000;
+}
+
+.tabulator-row.tabulator-unselectable:not(.tabulator-calcs) {
+ color: #777 !important;
+}
+
+.tabulator-cell .btn {
+ padding: 0 .375rem;
+ font-size: calc(1rem - 2px / 1.5); /* substract border (2 x 1px) modified by the line-height (1.5) */
+ border-radius: .2rem;
+ vertical-align: baseline;
+}
+
+.tabulator-row.tabulator-selectable:focus {
+ box-shadow: 0 0 0 .24rem rgba(13,110,253,.25);
+ z-index: 1;
+ outline: 0;
+}
+
+.btn-select-col-selected
+{
+ background-color: #e6e6e6;
+}
+
+.accordion-item-dark, .accordion-item-dark:focus{
+ background-color:#CED4DA !important;
+ border-color:#ADB5BD !important;
+ box-shadow: none !important;
+}
+
+/**
+ * Make keyboard-focused list items look like the mouse-hovered list items
+ */
+.tabulator-edit-list .tabulator-edit-list-item.focused {
+ color: #fff;
+ background: #1d68cd;
+}
diff --git a/public/css/components/dashboard.css b/public/css/components/dashboard.css
index 8dc19128d..88d136b55 100644
--- a/public/css/components/dashboard.css
+++ b/public/css/components/dashboard.css
@@ -203,3 +203,14 @@
}
}
+
+.hiddenWidget{
+ background: var(--fhc-disabled-background);
+ opacity: 40%;
+}
+
+.hiddenWidget .card,
+.hiddenWidget .card-body,
+.hiddenWidget .card-body *{
+ background: inherit !important;
+}
diff --git a/public/css/theme/default.css b/public/css/theme/default.css
index ba6493542..a0f366174 100644
--- a/public/css/theme/default.css
+++ b/public/css/theme/default.css
@@ -89,7 +89,8 @@
--fhc-link: var(--fhc-blue-10);
/* disabled */
- --fhc-disabled: var(--fhc-gray-10);
+ --fhc-disabled: var(--fhc-gray-90);
+ --fhc-disabled-background: var(--fhc-gray-30);
/* status colors */
--fhc-danger: var(--fhc-red-10);
@@ -135,6 +136,7 @@
/* disabled */
--fhc-disabled: var(--fhc-gray-10);
+ --fhc-disabled-background: var(--fhc-gray-120);
/* status colors */
--fhc-danger: var(--fhc-red-10);
diff --git a/public/js/api/factory/ort.js b/public/js/api/factory/ort.js
index 90488df1b..2e06d6b71 100644
--- a/public/js/api/factory/ort.js
+++ b/public/js/api/factory/ort.js
@@ -22,5 +22,19 @@ export default {
url: '/api/frontend/v1/Ort/ContentID',
params: { ort_kurzbz: ort_kurbz }
};
+ },
+ getRooms(datum, von, bis, typ, personenanzahl = 0) {
+ return {
+ method: 'get',
+ url: '/api/frontend/v1/Ort/getRooms',
+ params: { datum, von, bis, typ, personenanzahl }
+ };
+ },
+ getRoomTypes() {
+ return {
+ method: 'get',
+ url: '/api/frontend/v1/Ort/getTypes',
+ params: { }
+ };
}
};
\ No newline at end of file
diff --git a/public/js/api/factory/profilUpdate.js b/public/js/api/factory/profilUpdate.js
index dfef399bf..553522d30 100644
--- a/public/js/api/factory/profilUpdate.js
+++ b/public/js/api/factory/profilUpdate.js
@@ -68,6 +68,13 @@ export default {
params: dms
};
},
+ getProfilUpdateWithPermission(filter) {
+ const url_filter = (filter !== '') ? '/' + encodeURIComponent(filter) : '';
+ return {
+ method: 'get',
+ url: '/api/frontend/v1/ProfilUpdate/getProfilUpdateWithPermission' + url_filter
+ };
+ },
getProfilRequestFiles(requestID) {
return {
method: 'get',
diff --git a/public/js/api/factory/routeinfo.js b/public/js/api/factory/routeinfo.js
new file mode 100644
index 000000000..9ec2ad2a0
--- /dev/null
+++ b/public/js/api/factory/routeinfo.js
@@ -0,0 +1,29 @@
+/**
+ * Copyright (C) 2025 fhcomplete.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+export default {
+ info(app, path) {
+ return {
+ method: 'post',
+ url: '/api/frontend/v1/RouteInfo/info',
+ params: {
+ app: app,
+ path: path
+ }
+ };
+ }
+};
\ No newline at end of file
diff --git a/public/js/apps/Cis.js b/public/js/apps/Cis.js
index 73703b42b..5b76c5721 100644
--- a/public/js/apps/Cis.js
+++ b/public/js/apps/Cis.js
@@ -50,7 +50,7 @@ const app = Vue.createApp({
defaultaction: {
type: "link",
renderif: function(data) {
- if(data.content_id === "N/A"){
+ if(data.content_id === null){
return false;
}
return true;
@@ -79,7 +79,7 @@ const app = Vue.createApp({
icon: "fas fa-info-circle",
type: "link",
renderif: function(data) {
- if(data.content_id === "N/A"){
+ if(data.content_id === null){
return false;
}
return true;
diff --git a/public/js/apps/Dashboard/Fhc.js b/public/js/apps/Dashboard/Fhc.js
index 473e1cf67..093ad815b 100644
--- a/public/js/apps/Dashboard/Fhc.js
+++ b/public/js/apps/Dashboard/Fhc.js
@@ -18,6 +18,7 @@ import DeadlineOverview from "../../components/Cis/Abgabetool/DeadlineOverview.j
import Studium from "../../components/Cis/Studium/Studium.js";
import ApiRenderers from '../../api/factory/renderers.js';
+import ApiRouteInfo from '../../api/factory/routeinfo.js';
const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
@@ -138,10 +139,10 @@ const router = VueRouter.createRouter({
props: true
},
{
- path: `/Cis/MyLv`,
+ path: `/Cis/MyLv/:studiensemester?`,
name: 'MyLv',
component: MylvStudent,
- props: true
+ props: true,
},
{
path: `/Cis/MyLv/Info/:studien_semester/:lehrveranstaltung_id`,
@@ -319,6 +320,7 @@ const app = Vue.createApp({
// kind of a bandaid for bad css on some pages to avoid horizontal scroll
setScrollbarWidth();
+
app.use(router);
app.use(primevue.config.default, {
zIndex: {
@@ -331,3 +333,7 @@ app.use(PluginsPhrasen);
app.use(Theme);
app.directive('contrast', contrast);
app.mount('#fhccontent');
+
+router.afterEach((to, from, failure) => {
+ app.config.globalProperties.$api.call(ApiRouteInfo.info('cis4', to.fullPath));
+});
\ No newline at end of file
diff --git a/public/js/components/Cis/Cms/Content.js b/public/js/components/Cis/Cms/Content.js
index 470a0fa62..355add08a 100644
--- a/public/js/components/Cis/Cms/Content.js
+++ b/public/js/components/Cis/Cms/Content.js
@@ -2,6 +2,8 @@ import raum_contentmittitel from './Content_types/Raum_contentmittitel.js'
import general from './Content_types/General.js'
import BsConfirm from "../../Bootstrap/Confirm.js";
import news_content from './Content_types/News_content.js';
+import iframe_content from './Content_types/Iframe_content.js';
+
import ApiCms from '../../../api/factory/cms.js';
export default {
@@ -24,42 +26,23 @@ export default {
raum_contentmittitel,
news_content,
general,
+ iframe_content
},
data() {
return {
+ content_type: null,
content: null,
content_id_internal: this.content_id
};
},
methods: {
fetchContent(){
- return this.$api
+ this.$api
.call(ApiCms.content(this.content_id_internal, this.version, this.sprache, this.sichtbar))
.then(res => {
- this.content = res.data.content;
- this.content_type = res.data.type;
-
- document.querySelectorAll("#cms [data-confirm]").forEach((el) => {
- el.addEventListener("click", (evt) => {
- evt.preventDefault();
- BsConfirm.popup(el.dataset.confirm)
- .then(() => {
- Axios.get(el.href)
- .then((res) => {
- // TODO(chris): check for success then show message and/or reload
- location = location;
- })
- .catch((err) => console.error("ERROR:", err));
- })
- .catch(() => {
- });
- });
- });
- document.querySelectorAll("#cms [data-href]").forEach((el) => {
- el.href = el.dataset.href.replace(
- /^ROOT\//,
- FHC_JS_DATA_STORAGE_OBJECT.app_root
- );
+ this.$nextTick(function() {
+ this.content = res.data.content;
+ this.content_type = res.data.type;
});
});
}
@@ -83,6 +66,8 @@ export default {
return "raum_contentmittitel";
case "news":
return "news_content";
+ case "iframe":
+ return "iframe_content";
default:
return "general";
};
@@ -91,8 +76,6 @@ export default {
created() {
this.fetchContent();
},
- mounted() {
- },
template: /*html*/ `
diff --git a/public/js/components/Cis/Cms/Content_types/General.js b/public/js/components/Cis/Cms/Content_types/General.js
index c57ccd8ca..cbc4224f9 100644
--- a/public/js/components/Cis/Cms/Content_types/General.js
+++ b/public/js/components/Cis/Cms/Content_types/General.js
@@ -57,65 +57,70 @@ export default {
p.style.setProperty('white-space', 'normal');
p.style.setProperty('max-width', '400px');
})
+ },
+ prepareContent() {
+ // replaces the tablesorter with the tabulator
+ let tables = Array.from(document.getElementsByClassName("tablesorter"));
+
+ tables.forEach((table, index) => {
+ this.sanitizeLegacyTables(table)
+
+ new Tabulator(table, {
+ index: index,
+ layout: "fitDataFill",
+
+ columnDefaults: {
+ formatter: "html",
+ resizable: true,
+ minWidth: "100px"
+ }
+ })
+ })
+
+ document.querySelectorAll("#cms [data-confirm]").forEach((el) => {
+ el.addEventListener("click", (evt) => {
+ evt.preventDefault();
+ BsConfirm.popup(el.dataset.confirm)
+ .then(() => {
+ Axios.get(el.href)
+ .then((res) => {
+ // TODO(chris): check for success then show message and/or reload
+ location = location;
+ })
+ .catch((err) => console.error("ERROR:", err));
+ })
+ .catch(() => {});
+ });
+ });
+ document.querySelectorAll("#cms [data-href]").forEach((el) => {
+ el.href = el.dataset.href.replace(
+ /^ROOT\//,
+ FHC_JS_DATA_STORAGE_OBJECT.app_root
+ );
+ });
+
+ document.querySelectorAll("[href]").forEach((element) => {
+ let orignal_href = element.getAttribute("href");
+ let new_href = replaceRelativeLegacyLink(orignal_href);
+ element.href = new_href;
+ });
+
+ document.querySelectorAll("[style*=background-color]").forEach((element) => {
+ if (element.style.backgroundColor == "rgb(255, 255, 255)"){
+ element.style.backgroundColor = "var(--fhc-background)";
+ }
+ if(element.querySelector("*[style*=background-color]")){
+ element.style.backgroundColor = "var(--fhc-tertiary)";
+ }
+ });
}
},
- mounted(){
- // replaces the tablesorter with the tabulator
- let tables = Array.from(document.getElementsByClassName("tablesorter"));
-
- tables.forEach((table, index) => {
- this.sanitizeLegacyTables(table)
-
- new Tabulator(table, {
- index: index,
- layout: "fitDataFill",
-
- columnDefaults: {
- formatter: "html",
- resizable: true,
- minWidth: "100px"
- }
- })
- })
-
- document.querySelectorAll("#cms [data-confirm]").forEach((el) => {
- el.addEventListener("click", (evt) => {
- evt.preventDefault();
- BsConfirm.popup(el.dataset.confirm)
- .then(() => {
- Axios.get(el.href)
- .then((res) => {
- // TODO(chris): check for success then show message and/or reload
- location = location;
- })
- .catch((err) => console.error("ERROR:", err));
- })
- .catch(() => {});
- });
- });
- document.querySelectorAll("#cms [data-href]").forEach((el) => {
- el.href = el.dataset.href.replace(
- /^ROOT\//,
- FHC_JS_DATA_STORAGE_OBJECT.app_root
- );
- });
-
- document.querySelectorAll("[href]").forEach((element) => {
- let orignal_href = element.getAttribute("href");
- let new_href = replaceRelativeLegacyLink(orignal_href);
- element.href = new_href;
- });
-
- document.querySelectorAll("[style*=background-color]").forEach((element) => {
- if (element.style.backgroundColor == "rgb(255, 255, 255)"){
- element.style.backgroundColor = "var(--fhc-background)";
- }
- if(element.querySelector("*[style*=background-color]")){
- element.style.backgroundColor = "var(--fhc-tertiary)";
- }
- });
-
- },
+ updated() {
+ this.prepareContent();
+ },
+ mounted(){
+ this.prepareContent();
+ },
template: /*html*/ `
diff --git a/public/js/components/Cis/Cms/Content_types/Iframe_content.js b/public/js/components/Cis/Cms/Content_types/Iframe_content.js
new file mode 100644
index 000000000..568cfaf03
--- /dev/null
+++ b/public/js/components/Cis/Cms/Content_types/Iframe_content.js
@@ -0,0 +1,31 @@
+import { replaceRelativeLegacyLink } from "../../../../helpers/LegacyLinkReplaceHelper.js";
+
+export default {
+ name: "iframe_content",
+ props: {
+ content: { type: String, required: true }
+ },
+ computed: {
+ srcUrl() {
+ const parser = new DOMParser()
+ const doc = parser.parseFromString(`
${this.content}
`, "text/html");
+ const iframe = doc.querySelector("iframe[src]");
+
+ if (!iframe)
+ return "";
+
+ let url = iframe.getAttribute("src") || "";
+ return replaceRelativeLegacyLink(url);
+ }
+ },
+ template: `
+
+
+
Keine URL gefunden.
+
+ `
+};
diff --git a/public/js/components/Cis/Cms/Content_types/News_content.js b/public/js/components/Cis/Cms/Content_types/News_content.js
index a4eacd332..a17e8592a 100644
--- a/public/js/components/Cis/Cms/Content_types/News_content.js
+++ b/public/js/components/Cis/Cms/Content_types/News_content.js
@@ -1,6 +1,6 @@
import { replaceRelativeLegacyLink } from "../../../../helpers/LegacyLinkReplaceHelper.js"
export default {
- name: "GeneralComponent",
+ name: "NewsContentType",
props:{
content:{
type:String,
diff --git a/public/js/components/Cis/Cms/Content_types/Raum_contentmittitel.js b/public/js/components/Cis/Cms/Content_types/Raum_contentmittitel.js
index d7b9ed956..8373b6ac9 100644
--- a/public/js/components/Cis/Cms/Content_types/Raum_contentmittitel.js
+++ b/public/js/components/Cis/Cms/Content_types/Raum_contentmittitel.js
@@ -12,7 +12,7 @@ export default {
required:true,
},
content_id:{
- type:Number,
+ type: [Number, String],
}
},
methods: {
@@ -129,7 +129,7 @@ export default {
template: /*html*/ `
-
![]()
+
Content was not found
`,
diff --git a/public/js/components/Cis/Mylv/LvMenu.js b/public/js/components/Cis/Mylv/LvMenu.js
index 88340f01b..ef820ebb0 100644
--- a/public/js/components/Cis/Mylv/LvMenu.js
+++ b/public/js/components/Cis/Mylv/LvMenu.js
@@ -43,6 +43,13 @@ export default {
return menuItem.c4_link ?? null;
}
},
+ getMenuName(menuItem) {
+ if(menuItem.phrase) {
+ return this.$p.t(menuItem.phrase)
+ } else {
+ return menuItem.name
+ }
+ }
},
template:/*html*/`
{{$p.t('lehre','lehrveranstaltungsUnavailable')}}
@@ -54,7 +61,7 @@ export default {
:disabled="c4_disabled(menuItem)" :data-bs-toggle="menuItem.c4_moodle_links?.length?'dropdown':null"
class="menu-entry p-2 w-100 text-wrap border border-1 rounded-3 d-flex flex-column align-items-center justify-content-center text-center text-decoration-none link h-100">
![]()
-
{{menuItem.name}}
+
{{ getMenuName(menuItem) }}
-
-
-
+
+
+
{{$p.t('profilUpdate','meldebestaetigung')}}*
+
+
+
+
`,
diff --git a/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/ImageUpload.js b/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/ImageUpload.js
index 672b4ce4a..2d2efb0fe 100644
--- a/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/ImageUpload.js
+++ b/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/ImageUpload.js
@@ -16,7 +16,7 @@ export default {
mixins: [BsModal],
props: {
titel: {
- type: Object,
+ type: String,
},
files: {
type: Array,
@@ -57,7 +57,7 @@ export default {
},
template: /*html*/`
-
+
{{$p.t('profilUpdate','profilBildUpdateMessage',[titel])}}
diff --git a/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/Status.js b/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/Status.js
index a0492a2da..d8c7637b3 100644
--- a/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/Status.js
+++ b/public/js/components/Cis/Profil/ProfilModal/EditProfilComponents/Status.js
@@ -112,14 +112,17 @@ export default {
{{topic}}
{{data.value}}
-
+
+
`,
};
diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js
index 88437a0f1..3f8e8380d 100644
--- a/public/js/components/Cis/Profil/StudentProfil.js
+++ b/public/js/components/Cis/Profil/StudentProfil.js
@@ -11,6 +11,7 @@ import FetchProfilUpdates from "./ProfilComponents/FetchProfilUpdates.js";
import EditProfil from "./ProfilModal/EditProfil.js";
import ApiProfilUpdate from '../../../api/factory/profilUpdate.js';
+import { dateFilter } from '../../../tabulator/filters/Dates.js';
export default {
components: {
@@ -39,7 +40,7 @@ export default {
persistence: {
columns: false
},
- height: 200,
+ minHeight: 200,
layout: "fitColumns",
columns: [{
title: Vue.computed(() => this.preloadedPhrasen.zutrittsGruppenPhrase),
@@ -51,7 +52,7 @@ export default {
persistence: {
columns: false
},
- height: 300,
+ minHeight: 300,
layout: "fitColumns",
responsiveLayout: "collapse",
responsiveLayoutCollapseUseFormatters: false,
@@ -85,9 +86,12 @@ export default {
{
title: Vue.computed(() =>this.preloadedPhrasen.ausgabedatum) ,
field: "Ausgegeben_am",
- headerFilter: true,
+ headerFilterFunc: 'dates',
+ headerFilter: dateFilter,
minWidth: 200,
- visible: true
+ visible: true,
+ formatter:"datetime",
+ formatterParams: this.datetimeFormatterParams()
},
],
},
@@ -133,11 +137,11 @@ export default {
this.$api
.call(ApiProfilUpdate.selectProfilRequest())
.then((request) => {
- if (!request.error && res) {
+ if (!request.error && request.data) {
this.data.profilUpdates = request.data;
this.data.profilUpdates.sort(this.sortProfilUpdates);
} else {
- console.error("Error when fetching profile updates: " + res.data);
+ console.error("Error when fetching profile updates: " + request);
}
})
.catch((err) => {
@@ -160,6 +164,15 @@ export default {
this.$refs.editModal.show();
});
},
+ datetimeFormatterParams: function() {
+ const params = {
+ inputFormat:"yyyy-MM-dd",
+ outputFormat:"dd.MM.yyyy",
+ invalidPlaceholder:"(invalid date)",
+ timezone:FHC_JS_DATA_STORAGE_OBJECT.timezone
+ };
+ return params;
+ }
},
computed: {
diff --git a/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js b/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js
index d9495f073..d23dcb1b8 100644
--- a/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js
+++ b/public/js/components/Cis/ProfilUpdate/AcceptDenyUpdate.js
@@ -188,16 +188,21 @@ export default {
{{data.requested_change.value}}
-
+
+
+
+
diff --git a/public/js/components/Cis/ProfilUpdate/ProfilUpdateView.js b/public/js/components/Cis/ProfilUpdate/ProfilUpdateView.js
index 483a4665c..3b056b042 100644
--- a/public/js/components/Cis/ProfilUpdate/ProfilUpdateView.js
+++ b/public/js/components/Cis/ProfilUpdate/ProfilUpdateView.js
@@ -31,10 +31,10 @@ export default {
Loading,
AcceptDenyUpdate,
},
- inject: ["profilUpdateTopic", "profilUpdateStates"],
+ inject: ["profilUpdateStates"],
props: {
id: {
- type: Number,
+ type: String,
},
},
data() {
@@ -44,51 +44,53 @@ export default {
modalData: null,
loading: false,
filter: "Pending",
- events: [],
profil_update_id: Number(this.id),
};
},
- computed:{
- profilUpdateOptions: function(){
- return {
- ajaxURL:
- FHC_JS_DATA_STORAGE_OBJECT.app_root +
- FHC_JS_DATA_STORAGE_OBJECT.ci_router +
- `/Cis/ProfilUpdate/`,
-
- ajaxURLGenerator: (url, config, params) => {
- //? this function needs to be an array function in order to access the this properties of the Vue component
-
- switch (this.filter) {
- case this.profilUpdateStates["Pending"]:
- return (
- url +
- `getProfilUpdateWithPermission/${this.profilUpdateStates["Pending"]}`
- );
- case this.profilUpdateStates["Accepted"]:
- return (
- url +
- `getProfilUpdateWithPermission/${this.profilUpdateStates["Accepted"]}`
- );
- case this.profilUpdateStates["Rejected"]:
- return (
- url +
- `getProfilUpdateWithPermission/${this.profilUpdateStates["Rejected"]}`
- );
- default:
- return url + `getProfilUpdateWithPermission`;
- }
- },
+ computed: {
+ profilUpdateEvents: function () {
+ return [
+ {
+ "event": "dataProcessed",
+ "handler": this.handleDataProcessed
+ }
+ ];
+ },
+ profilUpdateOptions: function () {
+ return {
+ ajaxURL: 'dummy',
+ ajaxRequestFunc: (url, config, params) => {
+ return this.$api.call(ApiProfilUpdate.getProfilUpdateWithPermission(params.filter));
+ },
+ ajaxParams: () => {
+ let filter = '';
+ switch (this.filter) {
+ case this.profilUpdateStates["Pending"]:
+ filter = this.profilUpdateStates["Pending"];
+ break;
+ case this.profilUpdateStates["Accepted"]:
+ filter = this.profilUpdateStates["Accepted"];
+ break;
+ case this.profilUpdateStates["Rejected"]:
+ filter = this.profilUpdateStates["Rejected"];
+ break;
+ default:
+ filter = '';
+ }
+ return {
+ "filter": filter
+ };
+ },
ajaxResponse: (url, params, response) => {
//url - the URL of the request
//params - the parameters passed with the request
//response - the JSON object returned in the body of the response.
//? sorts the response data from the backend
- if (response)
- response.sort((ele1, ele2) => sortProfilUpdates(ele1, ele2, this));
+ if (response?.data)
+ response.data.sort((ele1, ele2) => sortProfilUpdates(ele1, ele2, this));
- return response;
+ return response.data;
},
//? adds tooltip with the status message of a profil update request if its status is not pending
columnDefaults: {
@@ -356,7 +358,19 @@ export default {
this.$refs.UpdatesTable.tabulator.setData();
//? store the selected view in the session storage of the browser
sessionStorage.setItem("filter", event.target.value);
- },
+ },
+ handleDataProcessed: function () {
+ if (this.profil_update_id) {
+ const arrayRowData = this.$refs.UpdatesTable.tabulator
+ .getData()
+ .filter((row) => {
+ return row.profil_update_id === this.profil_update_id;
+ });
+ if (arrayRowData.length) {
+ this.showAcceptDenyModal(arrayRowData[0]);
+ }
+ }
+ }
},
watch: {
loading: function (newValue, oldValue) {
@@ -374,20 +388,7 @@ export default {
},
mounted() {
- //? opens the AcceptDenyUpdate Modal if a preselected profil_update_id was passed to the component (used for email links)
- if (this.profil_update_id) {
- this.$refs.UpdatesTable.tabulator.on("dataProcessed", () => {
- const arrayRowData = this.$refs.UpdatesTable.tabulator
- .getData()
- .filter((row) => {
- return row.profil_update_id === this.profil_update_id;
- });
- if (arrayRowData.length) {
- this.showAcceptDenyModal(arrayRowData[0]);
- }
- });
- }
-
+ //? opens the AcceptDenyUpdate Modal if a preselected profil_update_id was passed to the component (used for email links)
if (sessionStorage.getItem("filter")) {
this.filter = sessionStorage.getItem("filter");
}
@@ -409,7 +410,7 @@ export default {
-
+
`,
};
diff --git a/public/js/components/Cis/Raumsuche/Raumsuche.js b/public/js/components/Cis/Raumsuche/Raumsuche.js
index 3f66a5508..365da4911 100644
--- a/public/js/components/Cis/Raumsuche/Raumsuche.js
+++ b/public/js/components/Cis/Raumsuche/Raumsuche.js
@@ -1,6 +1,6 @@
import {CoreFilterCmpt} from "../../../components/filter/Filter.js";
import VueDatePicker from '../../vueDatepicker.js.php';
-
+import ApiOrt from '../../../api/factory/ort.js'
export const Raumsuche = {
name: "Raumsuche",
props: {
@@ -13,6 +13,8 @@ export const Raumsuche = {
},
data() {
return {
+ phrasenPromise: null,
+ phrasenResolved: false,
tabulatorUuid: Vue.ref(0),
tableBuiltResolve: null,
tableBuiltPromise: null,
@@ -54,8 +56,8 @@ export const Raumsuche = {
columns: [
{title: Vue.computed(() => this.$p.t('rauminfo/raum_kurzbz')), field: 'ort_kurzbz', widthGrow: 1},
{title: Vue.computed(() => this.$p.t('global/bezeichnung')), field: 'bezeichnung', widthGrow: 2},
- {title: Vue.computed(() => this.$p.t('global/nummer')), field: 'nummer', widthGrow: 1},
- {title: Vue.computed(() => this.$p.t('global/personen')), field: 'personen', widthGrow: 1},
+ {title: Vue.computed(() => this.$p.t('rauminfo/raumnummer')), field: 'nummer', widthGrow: 1},
+ {title: Vue.computed(() => this.$p.t('rauminfo/personcap')), field: 'personen', widthGrow: 1},
{title: Vue.computed(() => this.$p.t('rauminfo/rauminfo')),
field: 'linkInfo', formatter: this.linkFormatter, widthGrow: 1},
{title: Vue.computed(() => this.$p.t('rauminfo/roomReservations')),
@@ -68,17 +70,6 @@ export const Raumsuche = {
handler: async () => {
this.tableBuiltResolve()
}
- },
- {
- event: "cellClick",
- handler: async (e, cell) => {
-
- if((cell.column.field === 'linkInfo' || cell.column.field === 'linkRes') && cell.value){
- window.open(cell.value, '_blank');
- e.stopPropagation();
- }
-
- }
}
]};
},
@@ -132,7 +123,8 @@ export const Raumsuche = {
this.$refs.raumsucheTable.tabulator.setData(d);
},
loadRoomTypes() {
- this.$fhcApi.factory.ort.getRoomTypes().then(res => {
+ this.$api.call(ApiOrt.getRoomTypes())
+ .then(res => {
res?.data?.forEach(type => {
type.beschreibung = type.beschreibung.replace('&', '&')
})
@@ -141,7 +133,7 @@ export const Raumsuche = {
})
},
loadRooms() {
- this.$fhcApi.factory.ort.getRooms(this.datum.toISOString(), this.getTimeString(this.von), this.getTimeString(this.bis), this.selectedType?.raumtyp_kurzbz ?? '', this.anzahl)
+ this.$api.call(ApiOrt.getRooms(this.datum.toISOString(), this.getTimeString(this.von), this.getTimeString(this.bis), this.selectedType?.raumtyp_kurzbz ?? '', this.anzahl))
.then(res => {
if(res?.data?.retval) this.setupData(res.data.retval)
})
@@ -167,6 +159,7 @@ export const Raumsuche = {
return `${hours}:${minutes}`;
},
async setupMounted() {
+
this.tableBuiltPromise = new Promise(this.tableResolve)
await this.tableBuiltPromise
@@ -182,7 +175,7 @@ export const Raumsuche = {
if(this.$refs.raumsucheTable) {
this.$refs.raumsucheTable.$refs.table.style.setProperty('height', h+'px')
}
-
+
}
},
computed: {
@@ -191,7 +184,8 @@ export const Raumsuche = {
}
},
created() {
-
+ this.phrasenPromise = this.$p.loadCategory(['rauminfo', 'global'])
+ this.phrasenPromise.then(()=> {this.phrasenResolved = true})
},
mounted() {
this.setupMounted()
@@ -239,7 +233,7 @@ export const Raumsuche = {
-
+
-
-
+
+
-
+
0) {
if (this.event.lektor.length > 3) {
diff --git a/public/js/components/Dashboard/Item.js b/public/js/components/Dashboard/Item.js
index eccc8242e..d2ad4ae75 100644
--- a/public/js/components/Dashboard/Item.js
+++ b/public/js/components/Dashboard/Item.js
@@ -156,7 +156,7 @@ export default {
-
+
@@ -380,6 +381,7 @@ export default {
name="zgvmanation"
>
+
@@ -443,6 +445,7 @@ export default {
name="zgvdoktornation"
>
+
@@ -504,6 +507,7 @@ export default {
v-model="data.berufstaetigkeit_code"
name="berufstaetigkeit_code"
>
+
+
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Status/Dropdown.js b/public/js/components/Stv/Studentenverwaltung/Details/Status/Dropdown.js
index 8c2071c51..1f6f41900 100644
--- a/public/js/components/Stv/Studentenverwaltung/Details/Status/Dropdown.js
+++ b/public/js/components/Stv/Studentenverwaltung/Details/Status/Dropdown.js
@@ -151,7 +151,17 @@ export default {
ApiStvStatus.addStudent(prestudent_id, data),
{ errorHeader: prestudent_id }
]))
- .then(() => {
+ .then(result => {
+ const messagesSuccessful = result.filter(res => res.status == 'fulfilled');
+ if (messagesSuccessful.length) {
+ this.$fhcAlert.alertDefault(
+ 'info',
+ 'Feedback',
+ messagesSuccessful.length + " erfolgreiche Statusänderung(en) durchgeführt", // TODO(chris): translate
+ false,
+ true
+ );
+ }
this.$emit('reloadTable');
this.$reloadList();
});
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js b/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js
index edbd3b6ea..8b0252be8 100644
--- a/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js
+++ b/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js
@@ -205,7 +205,7 @@ export default{
];*/
},
template: `
-
+
{{ $p.t('lehre', statusNew ? 'status_new' : 'status_edit', prestudent) }}
diff --git a/public/js/components/Stv/Studentenverwaltung/List.js b/public/js/components/Stv/Studentenverwaltung/List.js
index 965395556..67cada523 100644
--- a/public/js/components/Stv/Studentenverwaltung/List.js
+++ b/public/js/components/Stv/Studentenverwaltung/List.js
@@ -50,7 +50,6 @@ export default {
{title:"Wahlname", field:"wahlname", visible:false, headerFilter: true},
{title:"Vornamen", field:"vornamen", visible:false, headerFilter: true},
{title:"TitelPost", field:"titelpost", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
- {title:"SVNR", field:"svnr", headerFilter: true},
{title:"Ersatzkennzeichen", field:"ersatzkennzeichen", headerFilter: true},
{title:"Geburtsdatum", field:"gebdatum", formatter:dateFormatter,
headerFilter: true, headerFilterFunc: function(headerValue, rowValue, rowData, filterParams) {
diff --git a/public/js/components/Stv/Studentenverwaltung/Verband.js b/public/js/components/Stv/Studentenverwaltung/Verband.js
index a31cc543a..3eea8d3d9 100644
--- a/public/js/components/Stv/Studentenverwaltung/Verband.js
+++ b/public/js/components/Stv/Studentenverwaltung/Verband.js
@@ -112,26 +112,14 @@ export default {
return cp;
},
- async filterFav() {
+ filterFav() {
this.favorites.on = !this.favorites.on;
this.$api
.call(this.endpoint.favorites.set(
JSON.stringify(this.favorites)
- ))
- .then(result => {
- if (result.meta?.removed) {
- this.favorites.list = this.favorites.list
- .filter(fav => !result.meta.removed.includes(fav));
- const items = result.meta.removed.map(
- rem => this.nodes.find(
- node => node.data.link == rem
- ).label
- ).join(',\n');
- this.$fhcAlert.alertWarning(this.$p.t('stv/warn_removed_favs', { items }));
- }
- });
+ ));
},
- async markFav(key) {
+ markFav(key) {
let index = this.favorites.list.indexOf(key.data.link + '');
if (index != -1) {
@@ -143,19 +131,7 @@ export default {
this.$api
.call(this.endpoint.favorites.set(
JSON.stringify(this.favorites)
- ))
- .then(result => {
- if (result.meta?.removed) {
- this.favorites.list = this.favorites.list
- .filter(fav => !result.meta.removed.includes(fav));
- const items = "\n" + result.meta.removed.map(
- rem => this.nodes.find(
- node => node.data.link == rem
- ).label
- ).join(",\n");
- this.$fhcAlert.alertWarning(this.$p.t('stv/warn_removed_favs', { items }));
- }
- });
+ ));
},
unsetFavFocus(e) {
if (e.target.dataset?.linkFavAdd !== undefined) {
@@ -190,6 +166,24 @@ export default {
if (!currentNode)
return;
+ const currentSelectedKey = Object.keys(this.selectedKey).find(Boolean);
+ if (currentSelectedKey) {
+ if (currentSelectedKey == currentKey)
+ return;
+ /**
+ * Do not select a new entry if the current is a child of the new one.
+ * This happens if a child entry of a new stg is selected and the router
+ * tries to select the stg root entry (because subtrees do not have
+ * routes yet)
+ */
+ const isChild = this.findNodeByKey(
+ currentSelectedKey,
+ currentNode.children
+ );
+ if (isChild)
+ return;
+ }
+
for (let i = 1; i < parts.length; i++)
{
this.expandedKeys[currentNode.key] = true;
diff --git a/public/js/components/filter/Filter.js b/public/js/components/filter/Filter.js
index 02f7bcfd0..815b70009 100644
--- a/public/js/components/filter/Filter.js
+++ b/public/js/components/filter/Filter.js
@@ -706,7 +706,7 @@ export const CoreFilterCmpt = {
{{ selectedData.length }} ausgewählt
- Mit {{ selectedData.length }} ausgewählten:
+ Mit {{ selectedData.length }} ausgewählten:
diff --git a/public/js/components/searchbar/result/template/action.js b/public/js/components/searchbar/result/template/action.js
index eb4b1db3a..fdcbfaee8 100644
--- a/public/js/components/searchbar/result/template/action.js
+++ b/public/js/components/searchbar/result/template/action.js
@@ -19,10 +19,24 @@ export default {
if (this.action.type === 'function')
this.action.action(this.res);
this.$emit('actionexecuted');
+ },
+ renderif: function() {
+ if(this.action?.renderif === undefined) {
+ return true;
+ }
+
+ return this.action.renderif(this.res);
}
},
template: `
+
{{ $p.t('search/action_default_label') }}
- `
+
+
+
+
+ {{ $p.t('search/action_default_label') }}
+
+ `
};
\ No newline at end of file
diff --git a/public/js/components/searchbar/result/template/actions.js b/public/js/components/searchbar/result/template/actions.js
index 726fef4dd..8bfd08420 100644
--- a/public/js/components/searchbar/result/template/actions.js
+++ b/public/js/components/searchbar/result/template/actions.js
@@ -10,11 +10,20 @@ export default {
res: Object,
actions: Array
},
+ methods: {
+ renderif: function(action) {
+ if(action?.renderif === undefined) {
+ return true;
+ }
+
+ return action.renderif(this.res);
+ }
+ },
template: `
+
{{ action.label }}
+
`
};
\ No newline at end of file
diff --git a/public/js/composables/GridLogic.js b/public/js/composables/GridLogic.js
index 93c662eb5..ff8ae0c39 100644
--- a/public/js/composables/GridLogic.js
+++ b/public/js/composables/GridLogic.js
@@ -116,7 +116,7 @@ class GridLogic {
prefer = DIR_RIGHT;
}
- const originalFrame = [...item.frame];
+ const originalFrame = Array.isArray(item.frame) ? [...item.frame] : [item.frame];
const currItem = {...item};
currItem.x = x;
@@ -146,6 +146,7 @@ class GridLogic {
}
}
replaceUpdate[item.index] = { index: item.index, x, y };
+
return replaceUpdate;
}
diff --git a/public/js/plugins/Api.js b/public/js/plugins/Api.js
index 43c2b3064..0b8e2fd17 100644
--- a/public/js/plugins/Api.js
+++ b/public/js/plugins/Api.js
@@ -10,7 +10,232 @@ export default {
if (!app.config.globalProperties.$fhcAlert)
app.use(FhcAlert);
- function _get_config(form, uri, data, config) {
+ const $fhcAlert = app.config.globalProperties.$fhcAlert;
+
+ function _send_array_or_object(errors, func) {
+ if (Array.isArray(errors))
+ errors.forEach(func);
+ else
+ Object.entries(errors).forEach(
+ ([title, errs]) => errs.forEach(
+ error => func(error, title)
+ )
+ );
+ }
+ let DEFAULT_ERROR_CONFIG = {
+ success: true,
+ fail: true,
+ combine: {
+ form: ['validation', 'general'],
+ toast: ['validation', 'general', 'not_found', 'site_failed']
+ },
+ handler: {
+ form(form, errors) {
+ form.clearValidation();
+ errors.forEach(err => form.setFeedback(
+ false,
+ err.messages || err.message
+ ));
+ },
+ async toast(errors) {
+ const $p = app.config.globalProperties.$p;
+ if (!$p)
+ return Promise.reject('Phrasen plugin not loaded!');
+
+ async function _format_toast(errors) {
+ errors = errors.reduce((result, err) => {
+ switch (err.type) {
+ case 'not_found':
+ case 'site_failed':
+ if (err.message)
+ result[err.message] = [err.url];
+ else
+ result._default = [err.url];
+ break;
+ case 'general':
+ if (!result._default)
+ result._default = [];
+ result._default.push(err.message);
+ break;
+ case 'validation':
+ Object.entries(err.messages)
+ .forEach(([field, msg]) => {
+ if (!result[field])
+ result[field] = [];
+ if (Array.isArray(msg))
+ result[field].push(...msg);
+ else
+ result[field].push(msg);
+ });
+ break;
+ }
+ return result;
+ }, {});
+ let counter = 0;
+ const msgs = await Promise.all(Object.entries(errors)
+ .sort((a, b) => ['_default'].indexOf(b[0]) - ['_default'].indexOf(a[0])) // sort _default first
+ .map(async ([field, msgs]) => {
+ if (field == '_default') {
+ await $p.loadCategory('dashboard');
+ const general = $p.t('dashboard/general');
+ field = '' + general + '';
+ } else {
+ field = '' + field + '';
+ }
+ counter += msgs.length;
+ return field
+ + ''
+ + msgs.join('')
+ + '';
+ }));
+ return {
+ counter,
+ msgs
+ }
+ }
+
+ let counter, msgs;
+ if (Array.isArray(errors)) {
+ ({ counter, msgs } = await _format_toast(errors));
+ } else {
+ ({ counter, msgs } = await Object.entries(errors)
+ .reduce(async (res, [title, errs]) => {
+ const result = await res;
+ const { counter, msgs } = await _format_toast(errs);
+ result.counter += counter;
+ result.msgs.push(''
+ + title
+ + ''
+ + msgs.join('')
+ + '
');
+ return result;
+ }, Promise.resolve({ counter: 0, msgs: []})));
+ }
+
+ await $p.loadCategory('ui');
+ const n_errors = $p.t('ui/n_errors', { n: counter });
+
+ $fhcAlert.alertDefault(
+ 'error',
+ n_errors,
+ '' + msgs.join('') + '
',
+ true,
+ true
+ );
+ },
+ php(errors) {
+ _send_array_or_object(errors, (error, title) => {
+ var message = '';
+ message += 'Message: ' + error.message + '\n\n';
+ message += 'Filename: ' + error.filename + '\n';
+ message += 'Line Number: ' + error.line + '\n';
+ if (error.backtrace && error.backtrace.length) {
+ message += '\nBacktrace: ';
+ error.backtrace.forEach(err => {
+ message += '\n\tFile: ' + err.file + '\n';
+ message += '\tLine: ' + err.line + '\n';
+ message += '\tFunction: ' + err.function + '\n';
+ });
+ }
+ switch (error.severity) {
+ case 'Warning':
+ case 'Core Warning':
+ case 'Compile Warning':
+ case 'User Warning':
+ if (title)
+ title += ': PHP ' + error.severity;
+ else
+ title = 'PHP ' + error.severity;
+ $fhcAlert.alertDefault('warn', title, message, true);
+ break;
+ case 'Notice':
+ case 'User Notice':
+ case 'Runtime Notice':
+ if (title)
+ title += ': PHP ' + error.severity;
+ else
+ title = 'PHP ' + error.severity;
+ $fhcAlert.alertDefault('info', title, message, true);
+ break;
+ default:
+ message = 'Type: PHP ' + error.severity + '\n\n' + message;
+ if (title)
+ message = title + '\n\n' + message;
+ $fhcAlert.alertSystemError(message);
+ break;
+ }
+ });
+ },
+ exception(errors) {
+ _send_array_or_object(errors, (error, title) => {
+ var message = '';
+ if (title)
+ message += title + '\n\n';
+ message += 'Type: ' + error.class + '\n\n';
+ message += 'Message: ' + error.message + '\n\n';
+ message += 'Filename: ' + error.filename + '\n';
+ message += 'Line Number: ' + error.line + '\n';
+ if (error.backtrace && error.backtrace.length) {
+ message += '\nBacktrace: ';
+ error.backtrace.forEach(err => {
+ message += '\n\tFile: ' + err.file + '\n';
+ message += '\tLine: ' + err.line + '\n';
+ message += '\tFunction: ' + err.function + '\n';
+ });
+ }
+ $fhcAlert.alertSystemError(message);
+ });
+ },
+ db(errors) {
+ _send_array_or_object(errors, (error, title) => {
+ var message = '';
+ if (title)
+ message += title + '\n\n';
+ if (error.heading !== undefined)
+ message += error.heading + '\n\n';
+ if (error.code !== undefined)
+ message += 'Code: ' + error.code + '\n\n';
+ if (error.sql !== undefined)
+ message += 'SQL: ' + error.sql + '\n\n';
+ if (error.message !== undefined)
+ message += 'Message: ' + error.message + '\n\n';
+ else if (error.messages !== undefined)
+ message += 'Messages: ' + error.messages.join('\n\t') + '\n\n';
+ if (error.filename !== undefined)
+ message += 'Filename: ' + error.filename + '\n';
+ if (error.line !== undefined)
+ message += 'Line Number: ' + error.line + '\n';
+
+ $fhcAlert.alertSystemError(message);
+ });
+ },
+ auth(errors) {
+ _send_array_or_object(errors, (error, title) => {
+ if (title)
+ title += ': ' + error.message;
+ else
+ title = error.message;
+
+ var message = '';
+ message += 'Controller name: ' + error.controller + '\n';
+ message += 'Method name: ' + error.method + '\n';
+ message += 'Required permissions: ' + error.required_permissions;
+
+ $fhcAlert.alertDefault(
+ 'error',
+ title,
+ message,
+ true
+ );
+ });
+ }
+ }
+ };
+
+ if (options?.errorHandling !== undefined)
+ DEFAULT_ERROR_CONFIG = _merge_error_config(options.errorHandling);
+
+ function get_config(form, uri, data, config) {
if (typeof form == 'string' && config === undefined) {
[uri, data, config] = [form, uri, data];
form = undefined;
@@ -40,10 +265,9 @@ export default {
return [uri, data, config];
}
-
- function _clean_return_value(response) {
+ function clean_return_value(response) {
if (typeof response.data === 'string' || response.data instanceof String)
- return _clean_return_value({ data: response });
+ return clean_return_value({ data: response });
const result = response.data;
delete response.data;
@@ -55,10 +279,111 @@ export default {
result.meta.response = response;
return result;
}
- const baseURL = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/";
+ function _merge_error_config(config) {
+ if (config === false || config === 'off')
+ return { ...DEFAULT_ERROR_CONFIG, success: false, fail: false };
+
+ if (!config || config === true)
+ return { ...DEFAULT_ERROR_CONFIG };
+
+ if (config === 'success')
+ return { ...DEFAULT_ERROR_CONFIG, fail: false };
+
+ if (config === 'fail')
+ return { ...DEFAULT_ERROR_CONFIG, success: false };
+
+ const { success, fail, handler, combine } = config;
+
+ config = { ...DEFAULT_ERROR_CONFIG };
+
+ Object.entries({ fail, success }).forEach(([key, value]) => {
+ if (value !== undefined)
+ config[key] = value;
+ });
+ Object.entries({ handler, combine }).forEach(([key, value]) => {
+ if (value !== undefined)
+ config[key] = { ...config[key], ...value };
+ });
+
+ return config;
+ }
+ function get_error_handler(config) {
+ const result = _merge_error_config(config?.errorHandling);
+
+ if (!config?.form) {
+ result.combine = { ...result.combine, form: [] };
+ } else {
+ const formHandler = result.handler.form;
+ result.handler = { ...result.handler, form: errors => formHandler(config.form, errors) };
+ }
+
+ return result;
+ }
+ function get_error_list(error) {
+ if (error.response) {
+ if (error.response.status == 404) {
+ return [{
+ type: 'not_found',
+ message: error.message,
+ url: error.request.responseURL
+ }];
+ } else {
+ return error.response.data.errors;
+ }
+ } else if (error.request) {
+ return [{
+ type: 'site_failed',
+ message: error.message,
+ url: error.request.responseURL
+ }];
+ } else {
+ return [{
+ type: 'script',
+ message: error.message
+ }];
+ }
+ }
+ function popHandleableErrors(errorHandling, errors) {
+ const result = {};
+ const copy = [];
+ while (errors.length)
+ copy.push(errors.pop());
+ for (var error of copy) {
+ let type = error.type;
+ let newType = null;
+ for (var t in errorHandling.combine) {
+ let newTypeCombinesType = errorHandling
+ .combine[t]
+ .includes(type);
+ let newTypeHasHandler = errorHandling.handler[t];
+ if (newTypeCombinesType && newTypeHasHandler) {
+ newType = t;
+ if (newType == 'form')
+ break;
+ }
+ }
+ if (newType)
+ type = newType;
+ const handler = errorHandling.handler[type];
+ if (handler) {
+ if (!result[type])
+ result[type] = [];
+ if (Array.isArray(error))
+ result[type].push(...error);
+ else
+ result[type].push(error);
+ continue;
+ }
+ errors.push(error);
+ }
+ return result;
+ }
+
const fhcApiAxios = axios.create({
timeout: 500000,
- baseURL: FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/"
+ baseURL: FHC_JS_DATA_STORAGE_OBJECT.app_root
+ + FHC_JS_DATA_STORAGE_OBJECT.ci_router
+ + "/"
});
fhcApiAxios.interceptors.request.use(config => {
@@ -100,57 +425,51 @@ export default {
return config;
});
- fhcApiAxios.interceptors.response.use(response => {
- if (response.config?.errorHandling == 'off'
- || response.config?.errorHandling === false
- || response.config?.errorHandling == 'fail')
- return _clean_return_value(response);
-
- // NOTE(chris): loop through errors
- if (response.data.errors)
- response.data.errors = response.data.errors.filter(
- err => (response.config[err.type + 'ErrorHandler'] || app.config.globalProperties.$api._defaultErrorHandlers[err.type])(err, response.config)
- );
-
- return _clean_return_value(response);
- }, error => {
- if (error.code == 'ERR_CANCELED')
- return Promise.reject({...{handled: true}, ...error});
-
- if (error.config?.errorHandling == 'off'
- || error.config?.errorHandling === false
- || error.config?.errorHandling == 'success')
- return Promise.reject(error);
-
- if (error.response) {
- if (error.response.status == 404) {
- app.config.globalProperties.$fhcAlert.alertDefault('error', error.message, error.request.responseURL, true);
- return Promise.reject({...{handled: true}, ...error});
- }
+ fhcApiAxios.interceptors.response.use(
+ response => {
+ if (response.config?.errorHandling == 'off'
+ || response.config?.errorHandling === false
+ || response.config?.errorHandling == 'fail')
+ return clean_return_value(response);
// NOTE(chris): loop through errors
- error.response.data.errors = error.response.data.errors.filter(
- err => (error.config[err.type + 'ErrorHandler'] || app.config.globalProperties.$api._defaultErrorHandlers[err.type])(err, error.config)
- );
- if (!error.response.data.errors.length)
- return Promise.reject({...{handled: true}, ...error});
- } else if (error.request) {
- app.config.globalProperties.$fhcAlert.alertDefault('error', error.message, error.request.responseURL);
- return Promise.reject({...{handled: true}, ...error});
- } else {
- app.config.globalProperties.$fhcAlert.alertError(error.message);
- return Promise.reject({...{handled: true}, ...error});
- }
+ if (response.data.errors)
+ response.data.errors = response.data.errors.filter(
+ err => (response.config[err.type + 'ErrorHandler'] || app.config.globalProperties.$api._defaultErrorHandlers[err.type])(err, response.config)
+ );
- return Promise.reject(error);
- });
+ return clean_return_value(response);
+ },
+ error => {
+ if (error.code == 'ERR_CANCELED')
+ return Promise.reject({ handled: true, ...error });
+
+ const errorConfig = get_error_handler(error.config);
+
+ if (!errorConfig.fail)
+ return Promise.reject(error);
+
+ const remaining = get_error_list(error);
+
+ const errors = popHandleableErrors(errorConfig, remaining);
+
+ for (var type in errors) {
+ errorConfig.handler[type](errors[type]);
+ }
+
+ if (remaining.length)
+ return Promise.reject(error);
+
+ return Promise.reject({ handled: true, ...error });
+ }
+ );
app.config.globalProperties.$api = {
getUri(url) {
return fhcApiAxios.getUri({url});
},
get(form, uri, params, config) {
- [uri, params, config] = _get_config(form, uri, params, config);
+ [uri, params, config] = get_config(form, uri, params, config);
if (params) {
if (config)
config.params = params;
@@ -160,82 +479,58 @@ export default {
return fhcApiAxios.get(uri, config);
},
post(form, uri, data, config) {
- [uri, data, config] = _get_config(form, uri, data, config);
+ [uri, data, config] = get_config(form, uri, data, config);
return fhcApiAxios.post(uri, data, config);
},
call(factory, configoverwrite, form) {
if (Array.isArray(factory)) {
- const $fhcAlert = app.config.globalProperties.$fhcAlert;
const $api = app.config.globalProperties.$api;
- Promise
+ return Promise
.allSettled(factory.map((config, index) => {
- if (Array.isArray(config))
- return $api.call(config[1], {
- errorHeader: config[0],
- errorHandling: false
- });
- else
- return $api.call(config, {
- errorHeader: '#' + index,
- errorHandling: false
- });
- }))
- .then(res => {
- // TODO(chris): obey form & configoverwrite
- let messagesError = [];
- let messagesSuccessful = [];
-
- res.forEach(result => {
- if (result.status === 'fulfilled') {
- //console.log(JSON.parse(result.value.data));
- const successTitle = "" + result.value.data + "";
- messagesSuccessful.push(successTitle + "ok");
- } else {
- const errorTitle = "" + result.reason.config.errorHeader + "";
- const errorMsg = JSON.parse(result.reason.request.response);
- const fullMessage = errorMsg.errors.map(error => {
- if (error.type == 'validation') {
- // TODO(chris): do we want the keys?
- return '' + Object.values(error.messages).join("") + '';
- }
- // TODO(chris): other types
- if (error.message)
- return '' + error.message + '';
- if (error.messages)
- return '' + error.messages.join("\n") + '';
- // TODO(chris): what to do here
- return '' + "Generic Error" + ''; // TODO(chris): translate
- }).join("\n");
- messagesError.push(errorTitle + fullMessage);
- }
+ if (!Array.isArray(config))
+ config = ['#' + index, config];
+ return $api.call(config[1], {
+ errorHeader: config[0],
+ errorHandling: false
});
+ }))
+ .then(result => {
+ const [ , , config ] = get_config(form, undefined, undefined, configoverwrite || {});
+ const errorConfig = get_error_handler(config);
- if (messagesError.length)
- {
- const test = document.createElement('b');
- $fhcAlert.alertDefault(
- 'error',
- messagesError.length + " Fehler", // TODO(chris): translate
- '' + messagesError.join("") + '
',
- true,
- true
- );
+ if (!errorConfig.success && !errorConfig.fail) {
+ return result;
}
- if (messagesSuccessful.length)
- {
- const test = document.createElement('b');
- $fhcAlert.alertDefault(
- 'info',
- 'Feedback',
- messagesSuccessful.length + " erfolgreiche Statusänderung(en) durchgeführt", // TODO(chris): translate
- false,
- true
- );
+
+ const typedErrors = {};
+ for (var res of result) {
+ const [ allowed, item ] = res.status === 'fulfilled'
+ ? [ errorConfig.success, res.value ]
+ : [ errorConfig.fail, res.reason ];
+ if (!allowed)
+ return;
+
+ const errors = popHandleableErrors(errorConfig, get_error_list(item));
+
+ for (var type in errors) {
+ if (!typedErrors[type])
+ typedErrors[type] = {
+ [item.config.errorHeader]: errors[type]
+ };
+ else
+ typedErrors[type][item.config.errorHeader] = errors[type];
+ }
+ };
+
+ for (var errType in typedErrors) {
+ errorConfig.handler[errType](typedErrors[errType]);
}
+
+ return result;
});
}
- let {method, url, params, config} = factory;
+ let { method, url, params, config } = factory;
if (configoverwrite !== undefined) {
config = configoverwrite;
}
@@ -251,141 +546,6 @@ export default {
} else {
console.error("FhcApi: method not allowed:", method);
}
- },
- _defaultErrorHandlers: {
- validation(error, config) {
- const $fhcAlert = app.config.globalProperties.$fhcAlert;
-
- if (config?.form) {
- config.form.clearValidation();
- config.form.setFeedback(false, error.messages);
- return false;
- }
- if (Array.isArray(error.messages)) {
- error.messages.forEach($fhcAlert.alertError);
- return false;
- } else if (typeof error.messages == 'object') {
- if (config?.errorHeader)
- Object.values(error.messages).forEach(
- value => $fhcAlert.alertDefault(
- 'error',
- Array.isArray(config.errorHeader) ? app.config.globalProperties.$p.t.apply(null, config.errorHeader) : config.errorHeader,
- value,
- true
- )
- );
- else
- Object.entries(error.messages).forEach(
- ([key, value]) => $fhcAlert.alertDefault('error', key, value, true)
- );
- return false;
- }
- return true;
- },
- general(error, config) {
- const $fhcAlert = app.config.globalProperties.$fhcAlert;
-
- if (config?.form)
- config.form.setFeedback(false, error.message);
- else if (config?.errorHeader)
- $fhcAlert.alertDefault(
- 'error',
- Array.isArray(config.errorHeader) ? app.config.globalProperties.$p.t.apply(null, config.errorHeader) : config.errorHeader,
- error.message,
- true
- );
- else
- $fhcAlert.alertError(error.message);
- },
- php(error) {
- const $fhcAlert = app.config.globalProperties.$fhcAlert;
-
- var message = '';
- message += 'Message: ' + error.message + '\n\n';
- message += 'Filename: ' + error.filename + '\n';
- message += 'Line Number: ' + error.line + '\n';
- if (error.backtrace && error.backtrace.length) {
- message += '\nBacktrace: ';
- error.backtrace.forEach(err => {
- message += '\n\tFile: ' + err.file + '\n';
- message += '\tLine: ' + err.line + '\n';
- message += '\tFunction: ' + err.function + '\n';
- });
- }
- switch (error.severity) {
- case 'Warning':
- case 'Core Warning':
- case 'Compile Warning':
- case 'User Warning':
- $fhcAlert.alertDefault('warn', 'PHP ' + error.severity, message, true);
- break;
- case 'Notice':
- case 'User Notice':
- case 'Runtime Notice':
- $fhcAlert.alertDefault('info', 'PHP ' + error.severity, message, true);
- break;
- default:
- message = 'Type: PHP ' + error.severity + '\n\n' + message;
- $fhcAlert.alertSystemError(message);
- break;
- }
- },
- exception(error) {
- const $fhcAlert = app.config.globalProperties.$fhcAlert;
-
- var message = '';
- message += 'Type: ' + error.class + '\n\n';
- message += 'Message: ' + error.message + '\n\n';
- message += 'Filename: ' + error.filename + '\n';
- message += 'Line Number: ' + error.line + '\n';
- if (error.backtrace && error.backtrace.length) {
- message += '\nBacktrace: ';
- error.backtrace.forEach(err => {
- message += '\n\tFile: ' + err.file + '\n';
- message += '\tLine: ' + err.line + '\n';
- message += '\tFunction: ' + err.function + '\n';
- });
- }
- $fhcAlert.alertSystemError(message);
- },
- db(error) {
- const $fhcAlert = app.config.globalProperties.$fhcAlert;
-
- var message = '';
- if (error.heading !== undefined)
- message += error.heading + '\n\n';
- if (error.code !== undefined)
- message += 'Code: ' + error.code + '\n\n';
- if (error.sql !== undefined)
- message += 'SQL: ' + error.sql + '\n\n';
- if (error.message !== undefined)
- message += 'Message: ' + error.message + '\n\n';
- else if (error.messages !== undefined)
- message += 'Messages: ' + error.messages.join('\n\t') + '\n\n';
- if (error.filename !== undefined)
- message += 'Filename: ' + error.filename + '\n';
- if (error.line !== undefined)
- message += 'Line Number: ' + error.line + '\n';
-
- $fhcAlert.alertSystemError(message);
- },
- auth(error, config) {
- const $fhcAlert = app.config.globalProperties.$fhcAlert;
-
- var message = '';
- message += 'Controller name: ' + error.controller + '\n';
- message += 'Method name: ' + error.method + '\n';
- message += 'Required permissions: ' + error.required_permissions;
- if (config?.errorHeader)
- $fhcAlert.alertDefault(
- 'error',
- Array.isArray(config.errorHeader) ? app.config.globalProperties.$p.t.apply(null, config.errorHeader) : config.errorHeader,
- error.message,
- true
- );
- else
- $fhcAlert.alertDefault('error', error.message, message);
- }
}
};
diff --git a/rdf/ausbildungsvertrag.xml.php b/rdf/ausbildungsvertrag.xml.php
index 293ee7959..56dfd95a4 100644
--- a/rdf/ausbildungsvertrag.xml.php
+++ b/rdf/ausbildungsvertrag.xml.php
@@ -123,8 +123,6 @@ foreach($uid_arr as $uid)
$studiengang_bezeichnung = empty($studiengangbezeichnung) ? $studiengang->bezeichnung : $studiengangbezeichnung;
$studiengang_bezeichnung_englisch = empty($studiengangbezeichnung_englisch) ? $studiengang->english : $studiengangbezeichnung_englisch;
- $svnr = ($student->svnr == '')?'Ersatzkennzeichen: '.$student->ersatzkennzeichen:$student->svnr;
-
//Wenn Lehrgang, dann Erhalter-KZ vor die Studiengangs-Kz hängen
if ($studiengang->studiengang_kz<0)
{
@@ -146,7 +144,6 @@ foreach($uid_arr as $uid)
echo "\t\t".$gebdatum."\n";
echo "\t\t".$student->gebort."\n";
echo "\t\t".$staatsbuergerschaft->langtext."\n";
- echo "\t\t".$svnr."\n";
echo "\t\t".trim($student->matrikelnr)."\n";
echo "\t\t".$db->convert_html_chars($studiengang_bezeichnung)."\n";
echo "\t\t".$db->convert_html_chars($studiengang_bezeichnung_englisch)."\n";
@@ -340,8 +337,6 @@ foreach($prestudent_arr as $prest_id)
$studiengang_bezeichnung = empty($studiengangbezeichnung) ? $studiengang->bezeichnung : $studiengangbezeichnung;
$studiengang_bezeichnung_englisch = empty($studiengangbezeichnung_englisch) ? $studiengang->english : $studiengangbezeichnung_englisch;
- $svnr = ($person->svnr == '')?($person->ersatzkennzeichen != ''?'Ersatzkennzeichen: '.$person->ersatzkennzeichen:''):$person->svnr;
-
//Wenn Lehrgang, dann Erhalter-KZ vor die Studiengangs-Kz hängen
if ($studiengang->studiengang_kz<0)
{
@@ -363,7 +358,6 @@ foreach($prestudent_arr as $prest_id)
echo "\t\t".$gebdatum."\n";
echo "\t\t".$person->gebort."\n";
echo "\t\t".$staatsbuergerschaft->langtext."\n";
- echo "\t\t".$svnr."\n";
echo "\t\t".$db->convert_html_chars($studiengang_bezeichnung)."\n";
echo "\t\t".$db->convert_html_chars($studiengang_bezeichnung_englisch)."\n";
echo "\t\t".$studiengang->kurzbzlang."\n";
diff --git a/rdf/student.rdf.php b/rdf/student.rdf.php
index 61c903bd6..439ded6ec 100644
--- a/rdf/student.rdf.php
+++ b/rdf/student.rdf.php
@@ -235,7 +235,6 @@ function draw_content_liste($row)
vorname.']]>
nachname.']]>
geschlecht.']]>
- '.($row->svnr==''?' ':'svnr.']]>').'
'.($row->ersatzkennzeichen==''?' ':'ersatzkennzeichen.']]>').'
convertISODate($row->gebdatum).']]>
gebdatum.']]>
@@ -349,7 +348,6 @@ function draw_content($row)
gebzeit.']]>
'.($row->anmerkungen==''?' ':'anmerkungen.']]>').'
anrede.']]>
- svnr.']]>
ersatzkennzeichen.']]>
familienstand.']]>
geschlecht.']]>
@@ -470,7 +468,6 @@ function draw_empty_content()
-
@@ -647,7 +644,7 @@ if($xmlformat=='rdf')
$sql_query="
SELECT
p.person_id, tbl_student.prestudent_id, tbl_benutzer.uid, titelpre, titelpost,vorname, wahlname, vornamen, geschlecht,
- nachname, gebdatum, tbl_prestudent.anmerkung,ersatzkennzeichen,svnr, tbl_student.matrikelnr, p.anmerkung as anmerkungen,
+ nachname, gebdatum, tbl_prestudent.anmerkung,ersatzkennzeichen, tbl_student.matrikelnr, p.anmerkung as anmerkungen,
tbl_studentlehrverband.semester, tbl_studentlehrverband.verband, tbl_studentlehrverband.gruppe,
tbl_student.studiengang_kz, aufmerksamdurch_kurzbz, mentor, public.tbl_benutzer.aktiv AS bnaktiv,
( SELECT kontakt
@@ -985,8 +982,7 @@ if($xmlformat=='rdf')
$qry .= " prestudent_id = ".$db->db_add_param($searchItems_string_orig).";";
else
$qry .= " matrikelnr = ".$db->db_add_param($searchItems_string_orig)." OR
- matr_nr = ".$db->db_add_param($searchItems_string_orig)." OR
- svnr = ".$db->db_add_param($searchItems_string_orig).";";
+ matr_nr = ".$db->db_add_param($searchItems_string_orig).";";
}
if($result = $db->db_query($qry))
{
@@ -1282,7 +1278,6 @@ else
anrede.']]>
geschlecht.']]>
- svnr.']]>
ersatzkennzeichen.']]>
familienstand.']]>
diff --git a/rdf/studienblatt.xml.php b/rdf/studienblatt.xml.php
index 3ee805c04..a9b78d968 100644
--- a/rdf/studienblatt.xml.php
+++ b/rdf/studienblatt.xml.php
@@ -105,9 +105,6 @@ foreach($uid_arr as $uid)
$staatsbuergerschaft = new nation();
$staatsbuergerschaft->load($student->staatsbuergerschaft);
-
- $svnr = ($student->svnr == '')?'Ersatzkennzeichen: '.$student->ersatzkennzeichen:$student->svnr;
-
$geschlecht_obj = new geschlecht();
$geschlecht_obj->load($student->geschlecht);
@@ -143,7 +140,6 @@ foreach($uid_arr as $uid)
echo "\t\t\n";
echo "\t\tgebort."]]>\n";
echo "\t\tlangtext."]]>\n";
- echo "\t\t\n";
echo "\t\tmatr_nr)."]]>\n";
echo "\t\tmatrikelnr)."]]>\n";
echo "\t\tstudiengangbezeichnung."]]>\n";
diff --git a/system/FHComplete-3.3.sql b/system/FHComplete-3.3.sql
index 170066a1e..18c9c2c3d 100644
--- a/system/FHComplete-3.3.sql
+++ b/system/FHComplete-3.3.sql
@@ -9755,7 +9755,7 @@ COMMENT ON TABLE public.tbl_tag IS 'Orders and Company Tags';
CREATE TABLE public.tbl_variable (
name character varying(64) NOT NULL,
uid character varying(32) NOT NULL,
- wert character varying(64)
+ wert text
);
diff --git a/system/dbupdate_3.4.php b/system/dbupdate_3.4.php
index a527e0e85..b76d8a34d 100644
--- a/system/dbupdate_3.4.php
+++ b/system/dbupdate_3.4.php
@@ -79,6 +79,10 @@ require_once('dbupdate_3.4/40314_electronic_onboarding_anbindung_ida.php');
require_once('dbupdate_3.4/25999_C4_dashboard.php');
require_once('dbupdate_3.4/61730_Dashboard_Anpassungen.php');
require_once('dbupdate_3.4/40128_search.php');
+require_once('dbupdate_3.4/63394_Variablenbeschraenkung.php');
+require_once('dbupdate_3.4/63436_cis4_iframe_component.php');
+require_once('dbupdate_3.4/60882_lehrfaecherverteilung_favorites.php');
+require_once('dbupdate_3.4/66982_berufsschule.php');
require_once('dbupdate_3.4/62063_lv_evaluierung.php');
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
diff --git a/system/dbupdate_3.4/63394_Variablenbeschraenkung.php b/system/dbupdate_3.4/63394_Variablenbeschraenkung.php
new file mode 100644
index 000000000..f6a75b5ef
--- /dev/null
+++ b/system/dbupdate_3.4/63394_Variablenbeschraenkung.php
@@ -0,0 +1,28 @@
+db_query("
+ SELECT data_type
+ FROM information_schema.columns
+ WHERE table_schema = 'public'
+ AND table_name = 'tbl_variable'
+ AND column_name = 'wert';
+")) {
+ if ($db->db_num_rows($result) == 1)
+ {
+ $data_type = $db->db_fetch_row($result)[0];
+
+ if (strtolower($data_type) != 'text')
+ {
+ $qry = "ALTER TABLE public.tbl_variable
+ ALTER COLUMN wert
+ TYPE TEXT;";
+
+ if (!$db->db_query($qry))
+ echo 'public.tbl_variable '.$db->db_last_error().'
';
+ else
+ echo 'public.tbl_variable: Change type of "wert" to TEXT
';
+ }
+ }
+}
diff --git a/system/dbupdate_3.4/63436_cis4_iframe_component.php b/system/dbupdate_3.4/63436_cis4_iframe_component.php
new file mode 100644
index 000000000..a5b3bbf7c
--- /dev/null
+++ b/system/dbupdate_3.4/63436_cis4_iframe_component.php
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+EOD;
+
+$xslt_xhtml= <<
+
+
+
+
+
+
+
+ Keine URL im Inhalt gefunden.
+
+
+
+
+EOD;
+
+$xslt_xhtml_c4= <<
+
+
+
+
+
+
+
+ Keine URL im Inhalt gefunden.
+
+
+
+
+EOD;
+
+
+if ($result = @$db->db_query("SELECT * FROM campus.tbl_template WHERE template_kurzbz='iframe'"))
+{
+ if ($db->db_num_rows($result) == 0)
+ {
+ $sql= <<db_query($sql))
+ {
+ echo 'campus.tbl_template: ' . $db->db_last_error() . '
';
+ }
+ else
+ {
+ echo ' campus.tbl_template: Template "iframe" hinzugefügt.
';
+ }
+
+ }
+}
diff --git a/system/dbupdate_3.4/66982_berufsschule.php b/system/dbupdate_3.4/66982_berufsschule.php
new file mode 100644
index 000000000..8cb45c781
--- /dev/null
+++ b/system/dbupdate_3.4/66982_berufsschule.php
@@ -0,0 +1,41 @@
+,
+ *
+ * Beschreibung:
+ * Aktivität Berufsschule für Zeitaufzeichnung
+ */
+if (! defined('DB_NAME')) exit('No direct script access allowed');
+
+// Add permission: basis/gehaelter
+if($result = @$db->db_query("SELECT 1 FROM fue.tbl_aktivitaet WHERE aktivitaet_kurzbz = 'Berufsschule';"))
+{
+ if($db->db_num_rows($result) == 0)
+ {
+ $qry = "INSERT INTO fue.tbl_aktivitaet(aktivitaet_kurzbz, beschreibung, sort) VALUES('Berufsschule', 'Berufsschule','5');";
+
+ if(!$db->db_query($qry))
+ {
+ echo 'fue.tbl_aktivitaet '.$db->db_last_error().'
';
+ }
+ else
+ {
+ echo 'fue.tbl_aktivitaet: Added Aktivitaet "berufsschule"
';
+ }
+ }
+}
diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php
index 935edccfe..91a5f12ee 100644
--- a/system/phrasesupdate.php
+++ b/system/phrasesupdate.php
@@ -50125,6 +50125,46 @@ I have been informed that I am under no obligation to consent to the transmissio
)
)
),
+ array(
+ 'app' => 'core',
+ 'category' => 'global',
+ 'phrase' => 'abschicken',
+ 'insertvon' => 'system',
+ 'phrases' => array(
+ array(
+ 'sprache' => 'German',
+ 'text' => 'Abschicken',
+ 'description' => '',
+ 'insertvon' => 'system'
+ ),
+ array(
+ 'sprache' => 'English',
+ 'text' => 'Submit',
+ 'description' => '',
+ 'insertvon' => 'system'
+ )
+ )
+ ),
+ array(
+ 'app' => 'core',
+ 'category' => 'global',
+ 'phrase' => 'zurueckZumStart',
+ 'insertvon' => 'system',
+ 'phrases' => array(
+ array(
+ 'sprache' => 'German',
+ 'text' => 'Zurück zum Start',
+ 'description' => '',
+ 'insertvon' => 'system'
+ ),
+ array(
+ 'sprache' => 'English',
+ 'text' => 'Back to Start',
+ 'description' => '',
+ 'insertvon' => 'system'
+ )
+ )
+ ),
// LVEVALUIERUNG ---------------------------------------------------------------------------------------------------
array(
'app' => 'lvevaluierung',
diff --git a/vilesci/personen/bankimport.php b/vilesci/personen/bankimport.php
new file mode 100644
index 000000000..dda6d029f
--- /dev/null
+++ b/vilesci/personen/bankimport.php
@@ -0,0 +1,343 @@
+getBerechtigungen($user);
+if (!$rechte->isBerechtigt("admin", null, "suid"))
+{
+ die("Sie haben keine Berechtigung für diese Seite");
+}
+
+// Variables declaration
+$logArray = array(); // Array for output messages
+$errorOccurred = false; // Error flag
+$dataPosted = false; // Post data flag
+$fileName = null;
+$fileTmpName = null;
+$fileMimeType = null;
+
+// Constants
+$L_CSV_N_COLS = 4; // Number of columns of the CSV file
+$L_ERROR = "Error";
+$L_WARNING = "Warning";
+$L_INFO = "Info";
+$L_LN_NOT_AVAILABLE = "N/A";
+
+/**
+ * Add an entry in $logArray
+ */
+function lAddToLogArray($code, $lineNumber, $msg)
+{
+ global $logArray, $errorOccurred, $L_ERROR;
+
+ if ($code == $L_ERROR)
+ {
+ $errorOccurred = true;
+ }
+
+ $log = new stdClass();
+ $log->code = $code;
+ $log->lineNumber = $lineNumber;
+ $log->msg = $msg;
+
+ array_push($logArray, $log);
+}
+
+
+
+// If data has been posted
+if (isset($_POST["submit"]))
+{
+ $dataPosted = true;
+
+ // Checks if a file was uploaded
+ if (!$errorOccurred && (!isset($_FILES) || !is_array($_FILES) || count($_FILES) == 0))
+ {
+ lAddToLogArray($L_ERROR, $L_LN_NOT_AVAILABLE, "No files have been uploaded");
+ }
+
+ // If the file is not present or it was not correctly uploaded
+ if (!$errorOccurred && (!isset($_FILES["csvFile"]) || $_FILES["csvFile"]["error"] != 0))
+ {
+ lAddToLogArray($L_ERROR, $L_LN_NOT_AVAILABLE, "An error has occurred while uploading the CSV file");
+ }
+ else // else save file attributes
+ {
+ $fileName = $_FILES["csvFile"]["name"];
+ $fileTmpName = $_FILES["csvFile"]["tmp_name"];
+ $fileMimeType = mime_content_type($_FILES["csvFile"]["tmp_name"]);
+ }
+
+ // Checks the file mime type
+ if (!$errorOccurred && ($fileMimeType != "text/plain"))
+ {
+ lAddToLogArray($L_ERROR, $L_LN_NOT_AVAILABLE, "The mime type of the uploaded file is not of the type text/plain");
+ }
+
+ // Opens the file in read mode
+ if (!$errorOccurred && (($fileHandle = fopen($fileTmpName, "r")) === false))
+ {
+ lAddToLogArray($L_ERROR, $L_LN_NOT_AVAILABLE, "An error has occurred while opening the uploaded file on read mode");
+ }
+}
+else // else no data has been posted
+{
+ $dataPosted = false;
+}
+
+// If everything is ok and data has been posted
+if (!$errorOccurred && $dataPosted)
+{
+ $fileRow = false; // Contains a single file row
+ $lineNumber = 0; // lines number counter
+
+ // Loops on file rows
+ do
+ {
+ $lineNumber++;
+ // Gets and parses a single row of the given file
+ $fileRow = fgetcsv($fileHandle, 9999, ";", "\"");
+ // If everything is ok
+ if ($fileRow != null && $fileRow !== false)
+ {
+ // Checks if the row has the right amount of columns
+ if (is_array($fileRow) && count($fileRow) == $L_CSV_N_COLS)
+ {
+ // Checks if character encoding is UTF-8
+ if (mb_detect_encoding(implode(";", $fileRow), "UTF-8", true))
+ {
+ $rowSurname = $fileRow[0];
+ $rowName = $fileRow[1];
+ $rowPersonID = $fileRow[2];
+ $rowIBAN = $fileRow[3];
+
+ // If this row is not the header
+ if (strtolower($rowSurname) != "nachname")
+ {
+ // Bankverbindung hinterlegen
+ $bank = new bankverbindung();
+ $found = false;
+ if($bank->load_pers($rowPersonID))
+ {
+ foreach($bank->result as $row_bank)
+ {
+ if(str_replace(' ', '', $row_bank->iban) == str_replace(' ', '', $rowIBAN))
+ {
+ lAddToLogArray(
+ $L_WARNING,
+ $lineNumber,
+ "Bank IBAN already found for PersonID ".$rowPersonID
+ );
+ $found = true;
+
+ // Update Datum aktualisieren damit Update in Fremdsystem getriggert wird
+ $row_bank->new=false;
+ $row_bank->updateamum = date('Y-m-d H:i:s');
+ $row_bank->updatevon = 'Bankimport';
+ if($row_bank->save())
+ {
+ lAddToLogArray(
+ $L_INFO,
+ $lineNumber,
+ "Bank Date Update for PersonID ".$rowPersonID
+ );
+ }
+ else
+ {
+ lAddToLogArray(
+ $L_WARNING,
+ $lineNumber,
+ "Bank Date Update Failed for PersonID ".$rowPersonID
+ );
+ }
+
+ break;
+ }
+ }
+ }
+
+ if(!$found)
+ {
+ $bank = new bankverbindung();
+ $bank->new = true;
+ $bank->iban = $rowIBAN;
+ $bank->person_id = $rowPersonID;
+ //$bank->bic = $rowBIC;
+ //$bank->name = $rowBank;
+ $bank->typ = 'p';
+ $bank->verrechnung = true;
+ $bank->insertamum = date('Y-m-d H:i:s');
+ $bank->insertvon = 'Bankimport';
+ $bank->updateamum = date('Y-m-d H:i:s');
+ $bank->updatevon = 'Bankimport';
+ if($bank->save())
+ {
+ lAddToLogArray(
+ $L_INFO,
+ $lineNumber,
+ "Bankdaten hinzugefügt"
+ );
+ }
+ else
+ {
+ lAddToLogArray(
+ $L_WARNING,
+ $lineNumber,
+ "Failed to Add Bankdata".$bank->errormsg
+ );
+ }
+ }
+ }
+ else
+ {
+ lAddToLogArray($L_WARNING, $lineNumber, "This file row has been discarted because it is the header");
+ }
+ }
+ else
+ {
+ lAddToLogArray($L_WARNING, $lineNumber, "This file row has been discarted because of invalid characters");
+ }
+ }
+ else
+ {
+ lAddToLogArray(
+ $L_WARNING,
+ $lineNumber,
+ "This file row has been discarted because it isn't well formatted and/or it hasn't " . $L_CSV_N_COLS . " columns"
+ );
+ }
+ }
+ else
+ {
+ // If it is not the end of the file, another error has occurred
+ if (!feof($fileHandle))
+ {
+ lAddToLogArray($L_ERROR, $lineNumber, "An error has occurred while parsing this row, procedure terminated");
+ }
+ }
+ }
+ while($fileRow);
+
+ // Close the file handler
+ fclose($fileHandle);
+}
+
+?>
+
+
+
+
+
+
+
+ Bank Data Import
+ Diese Seite dient dazu Bankdaten für Studierende per CSV Import ins System zu laden.
+
+
+
+
+
+
+
+ | Status |
+ Record |
+ Message |
+
+
+
+ %s
+ |
+
+ %s
+ |
+
+ %s
+ |
+ ";
+
+ foreach($logArray as $log)
+ {
+ $color = "green"; // great expectations
+ if ($log->code == $L_ERROR)
+ {
+ $color = "red";
+ }
+ else if ($log->code == $L_WARNING)
+ {
+ $color = "orange";
+ }
+
+ echo sprintf($tableRow, $color, $log->code, $log->lineNumber, $log->msg);
+ }
+ ?>
+
+
+
diff --git a/vilesci/personen/import/interessentenimport.php b/vilesci/personen/import/interessentenimport.php
index d1830eaeb..8734a1353 100644
--- a/vilesci/personen/import/interessentenimport.php
+++ b/vilesci/personen/import/interessentenimport.php
@@ -1167,8 +1167,7 @@ if ($where != '')
}
}
$status = mb_substr($status, 0, mb_strlen($status)-2);
-
- echo ' | '."$row->nachname | $row->vorname | $row->wahlname | $row->vornamen | $row->gebdatum | $row->svnr | ".($row->geschlecht=='m'?'männlich':'weiblich')." | ";
+ echo ' |
| '."$row->nachname | $row->vorname | $row->wahlname | $row->vornamen | $row->gebdatum | ".((strpos($status, 'Mitarbeiter') !== false) ? $row->svnr : '')." | ".($row->geschlecht=='m'?'männlich':'weiblich')." | ";
$qry_adr = "SELECT * FROM public.tbl_adresse WHERE person_id=".$db->db_add_param($row->person_id, FHC_INTEGER);
if ($result_adr = $db->db_query($qry_adr))
while ($row_adr = $db->db_fetch_object($result_adr))
diff --git a/vilesci/personen/personen_details.php b/vilesci/personen/personen_details.php
index d1dcd8815..b274558bd 100644
--- a/vilesci/personen/personen_details.php
+++ b/vilesci/personen/personen_details.php
@@ -125,6 +125,7 @@ $verband = (isset($_POST['verband'])?$_POST['verband']:'');
$gruppe = (isset($_POST['gruppe'])?$_POST['gruppe']:'');
$dms_id_lichtbild = '';
+$is_mitarbeiter = false;
if($uid!='')
{
$qry = "SELECT person_id, true as mitarbeiter FROM campus.vw_mitarbeiter WHERE uid=".$db->db_add_param($uid)."
@@ -144,7 +145,17 @@ if($uid!='')
else
die('Fehler beim Ermitteln der UID');
}
-
+else if ($person_id !='')
+{
+ $qry = "SELECT person_id, true as mitarbeiter FROM campus.vw_mitarbeiter WHERE person_id=".$db->db_add_param($person_id);
+ if($result = $db->db_query($qry))
+ {
+ if($row = $db->db_fetch_object($result))
+ {
+ $is_mitarbeiter = ($row->mitarbeiter=='t'?true:false);
+ }
+ }
+}
if(isset($_POST['saveperson']))
{
if(!$rechte->isBerechtigt('student/stammdaten', null, 'su') && !$rechte->isBerechtigt('mitarbeiter/stammdaten', null, 'su'))
@@ -163,7 +174,8 @@ if(isset($_POST['saveperson']))
$person->gebdatum = $geburtsdatum;
$person->gebort = $geburtsort;
$person->geburtsnation = $geburtsnation;
- $person->svnr = $svnr;
+ if ($is_mitarbeiter)
+ $person->svnr = $svnr;
$person->ersatzkennzeichen = $ersatzkennzeichen;
$person->gebzeit = $geburtszeit;
$person->staatsbuergerschaft = $staatsbuergerschaft;
@@ -332,7 +344,8 @@ if(!$error_person_save)
$geburtsdatum = $person->gebdatum;
$geburtsort = $person->gebort;
$geburtsnation = $person->geburtsnation;
- $svnr = $person->svnr;
+ if ($is_mitarbeiter)
+ $svnr = $person->svnr;
$ersatzkennzeichen = $person->ersatzkennzeichen;
$geburtszeit = $person->gebzeit;
$staatsbuergerschaft = $person->staatsbuergerschaft;
@@ -398,10 +411,16 @@ foreach ($nation->nation as $row_nation)
echo "
|
-
- | SVNR |
- |
- Ersatzkennzeichen |
+
";
+
+if ($is_mitarbeiter)
+{
+ echo "| SVNR |
+ | ";
+}
+
+echo
+ "Ersatzkennzeichen |
|
Geburtszeit |
|
diff --git a/vilesci/personen/preinteressent_anlegen.php b/vilesci/personen/preinteressent_anlegen.php
index 3ba5865d2..cc9ecbf53 100644
--- a/vilesci/personen/preinteressent_anlegen.php
+++ b/vilesci/personen/preinteressent_anlegen.php
@@ -140,7 +140,6 @@ function disablefields(obj)
document.getElementById('vorname').disabled=val;
document.getElementById('geschlecht').disabled=val;
document.getElementById('geburtsdatum').disabled=val;
- document.getElementById('svnr').disabled=val;
document.getElementById('ersatzkennzeichen').disabled=val;
//document.getElementById('adresse').disabled=val;
//document.getElementById('plz').disabled=val;
@@ -159,21 +158,6 @@ function disablefields(obj)
}
}
-function GeburtsdatumEintragen()
-{
- svnr = document.getElementById('svnr').value;
- gebdat = document.getElementById('geburtsdatum');
-
- if(svnr.length==10 && gebdat.value=='')
- {
- var tag = svnr.substr(4,2);
- var monat = svnr.substr(6,2);
- var jahr = svnr.substr(8,2);
-
- gebdat.value='19'+jahr+'-'+monat+'-'+tag;
- }
-}
-
function disablefields2(val)
{
document.getElementById('adresse').disabled=val;
@@ -368,7 +352,6 @@ $email = (isset($_REQUEST['email'])?$_REQUEST['email']:'');
$telefon = (isset($_REQUEST['telefon'])?$_REQUEST['telefon']:'');
$mobil = (isset($_REQUEST['mobil'])?$_REQUEST['mobil']:'');
$person_id = (isset($_REQUEST['person_id'])?$_REQUEST['person_id']:'');
-$svnr = (isset($_REQUEST['svnr'])?$_REQUEST['svnr']:'');
$ersatzkennzeichen = (isset($_REQUEST['ersatzkennzeichen'])?$_REQUEST['ersatzkennzeichen']:'');
$ueberschreiben = (isset($_REQUEST['ueberschreiben'])?$_REQUEST['ueberschreiben']:'');
@@ -413,7 +396,6 @@ if(isset($_POST['save']))
$person->geschlecht = $geschlecht;
$person->gebdatum = $datum_obj->formatDatum($geburtsdatum,'Y-m-d');
$person->staatsbuergerschaft = $nation;
- $person->svnr = $svnr;
$person->ersatzkennzeichen = $ersatzkennzeichen;
$person->aktiv = true;
$person->insertamum = date('Y-m-d H:i:s');
@@ -689,39 +671,38 @@ if($result = $db->db_query($qry))
}
echo '';
echo '
';
-echo '| SVNR | |
';
echo '| Ersatzkennzeichen | |
';
echo '| Geburtsdatum | (Format dd.mm.JJJJ) |
';
echo '| Geburtsort | |
';
-echo '| Geburtsnation | ';
+echo ' |
| Geburtsnation | ';
echo ' |
';
-echo '| Sprache | |