diff --git a/application/config/routes.php b/application/config/routes.php index da3a45f03..b4ce2ed4a 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -75,16 +75,16 @@ $route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout/outgoing'] = 'api/ $route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/inout/gemeinsamestudien'] = 'api/frontend/v1/stv/Students/getGemeinsamestudien'; // (studiengang_kz)/prestudent[/(studiensemester_kurzbz)[/(filter)[/(otherfilter)]]] -$route['api/frontend/v1/stv/[sS]tudents/(:num)/prestudent'] = 'api/frontend/v1/stv/Students/getPrestudents/$1'; -$route['api/frontend/v1/stv/[sS]tudents/(:num)/prestudent/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2'; -$route['api/frontend/v1/stv/[sS]tudents/(:num)/prestudent/([WS]S[0-9]{4})/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2/$3'; -$route['api/frontend/v1/stv/[sS]tudents/(:num)/prestudent/([WS]S[0-9]{4})/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2/$4'; +$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent'] = 'api/frontend/v1/stv/Students/getPrestudents/$1'; +$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2'; +$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent/([WS]S[0-9]{4})/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2/$3'; +$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/prestudent/([WS]S[0-9]{4})/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudents/$1/$2/$4'; // (studiengang_kz)/(orgform)/prestudent[/(studiensemester_kurzbz)[/(filter)[/(otherfilter)]]] -$route['api/frontend/v1/stv/[sS]tudents/(:num)/([A-Z]{2,3})/prestudent'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2'; -$route['api/frontend/v1/stv/[sS]tudents/(:num)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3'; -$route['api/frontend/v1/stv/[sS]tudents/(:num)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3/$4'; -$route['api/frontend/v1/stv/[sS]tudents/(:num)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3/$5'; +$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2'; +$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3'; +$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3/$4'; +$route['api/frontend/v1/stv/[sS]tudents/(-?[0-9]+)/([A-Z]{2,3})/prestudent/([WS]S[0-9]{4})/(:any)/(:any)'] = 'api/frontend/v1/stv/Students/getPrestudentsOrgform/$1/$2/$3/$5'; // (studiensemester_kurzbz)/(studiengang_kz)/(semester)/grp/(gruppe) $route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/(-?[0-9]+)/(:num)/grp/(:any)'] = 'api/frontend/v1/stv/Students/getStudentsSpezialgruppe/$1/$2/$3/$4'; @@ -111,23 +111,26 @@ $route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/prestudent/(:num)'] = 'a // // (studiensemester_kurzbz)/person/(person_id) $route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/person/(:num)'] = 'api/frontend/v1/stv/Students/getPerson/$1/$2'; -// load routes from extensions -$subdir = 'application/config/extensions'; -$dirlist = scandir($subdir); +// load routes from extensions, also look for environment-specific configs +$subdirs = ['application/config/extensions', 'application/config/' . ENVIRONMENT . '/extensions']; -if ($dirlist) +foreach($subdirs as $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/stv.php b/application/config/stv.php index aa885c9e1..675899108 100644 --- a/application/config/stv.php +++ b/application/config/stv.php @@ -58,6 +58,10 @@ $config['tabs'] = //if true, Anrechnungen can be added and edited in tab Anrechnungen 'editableAnrechnungen' => false, ], + 'notes' => [ + //if true, the count of Messages will be shown in the header of the Tab Messages + 'showCountNotes' => true + ] ]; // List of fields to show when ZGV_DOKTOR_ANZEIGEN is defined diff --git a/application/controllers/api/frontend/v1/LvMenu.php b/application/controllers/api/frontend/v1/LvMenu.php index 393c4d5c3..2a305dbb5 100644 --- a/application/controllers/api/frontend/v1/LvMenu.php +++ b/application/controllers/api/frontend/v1/LvMenu.php @@ -269,6 +269,8 @@ class LvMenu extends FHCAPI_Controller 'lehrfach_id'=>$lehrfach_id, 'lektor_der_lv'=>$lektor_der_lv, 'lehrfach_oe_kurzbz_arr'=>$lehrfach_oe_kurzbz_arr, + 'permissionLib' => &$this->PermissionLib, + 'phrasesLib' => &$this->PhrasesLib ]; Events::trigger('lvMenuBuild', diff --git a/application/controllers/api/frontend/v1/betriebsmittel/BetriebsmittelP.php b/application/controllers/api/frontend/v1/betriebsmittel/BetriebsmittelP.php index 05d7c66c2..7486f44f0 100644 --- a/application/controllers/api/frontend/v1/betriebsmittel/BetriebsmittelP.php +++ b/application/controllers/api/frontend/v1/betriebsmittel/BetriebsmittelP.php @@ -60,7 +60,11 @@ class BetriebsmittelP extends FHCAPI_Controller public function getAllBetriebsmittel($type_id, $id) { - $result = $this->BetriebsmittelpersonModel->getBetriebsmittelData($id, $type_id); + $betriebsmitteltypes = null; + if ($this->input->get('betriebsmitteltypes') !== null && !isEmptyArray($this->input->get('betriebsmitteltypes'))) + $betriebsmitteltypes = $this->input->get('betriebsmitteltypes'); + + $result = $this->BetriebsmittelpersonModel->getBetriebsmittelData($id, $type_id, $betriebsmitteltypes); if (isError($result)) { $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); @@ -370,6 +374,12 @@ class BetriebsmittelP extends FHCAPI_Controller $this->load->model('ressource/Betriebsmitteltyp_model', 'BetriebsmitteltypModel'); $this->BetriebsmitteltypModel->addOrder('beschreibung', 'ASC'); + + if ($this->input->get('betriebsmitteltypes') !== null && !isEmptyArray($this->input->get('betriebsmitteltypes'))) + { + $this->BetriebsmitteltypModel->db->where_in('betriebsmitteltyp', $this->input->get('betriebsmitteltypes')); + } + $result = $this->BetriebsmitteltypModel->load(); // load All if (isError($result)) { diff --git a/application/controllers/api/frontend/v1/messages/Messages.php b/application/controllers/api/frontend/v1/messages/Messages.php index dbc11735a..fa6748f6a 100644 --- a/application/controllers/api/frontend/v1/messages/Messages.php +++ b/application/controllers/api/frontend/v1/messages/Messages.php @@ -418,6 +418,10 @@ class Messages extends FHCAPI_Controller } $data = $this->getDataOrTerminateWithError($result); + if (count($data) < 1) + { + $this->terminateWithError('Error: Messages API no person_id found.'); + } $person = current($data); return $person->person_id; @@ -432,8 +436,12 @@ class Messages extends FHCAPI_Controller ); $data = $this->getDataOrTerminateWithError($result); + if (count($data) < 1) + { + $this->terminateWithError('Error: Messages API no prestudent_id found.'); + } $student = current($data); - // $this->terminateWithError($student->prestudent_id, self::ERROR_TYPE_GENERAL); + return $student->prestudent_id; } diff --git a/application/controllers/api/frontend/v1/notiz/NotizPerson.php b/application/controllers/api/frontend/v1/notiz/NotizPerson.php index cb9d31024..23a8fd199 100644 --- a/application/controllers/api/frontend/v1/notiz/NotizPerson.php +++ b/application/controllers/api/frontend/v1/notiz/NotizPerson.php @@ -18,6 +18,7 @@ class NotizPerson extends Notiz_Controller 'loadDokumente' => ['admin:r', 'assistenz:r'], 'getMitarbeiter' => ['admin:r', 'assistenz:r'], 'isBerechtigt' => ['admin:r', 'assistenz:r'], + 'getCountNotes' => ['admin:r', 'assistenz:r'], ]); } diff --git a/application/controllers/api/frontend/v1/stv/Config.php b/application/controllers/api/frontend/v1/stv/Config.php index adf9f729e..2fb436384 100644 --- a/application/controllers/api/frontend/v1/stv/Config.php +++ b/application/controllers/api/frontend/v1/stv/Config.php @@ -62,10 +62,15 @@ class Config extends FHCAPI_Controller 'component' => './Stv/Studentenverwaltung/Details/Details.js', 'config' => $config['details'] ]; + $result['notes'] = [ 'title' => $this->p->t('stv', 'tab_notes'), - 'component' => './Stv/Studentenverwaltung/Details/Notizen.js' + 'component' => './Stv/Studentenverwaltung/Details/Notizen.js', + 'config' => $config['notes'], + 'showSuffix' => ($config['notes']['showCountNotes'] ?? false), + 'suffixhelper' => APP_ROOT . 'public/js/helpers/Stv/Studentenverwaltung/Details/Notizen/NotizenSuffixHelper.js' ]; + $result['contact'] = [ 'title' => $this->p->t('stv', 'tab_contact'), 'component' => './Stv/Studentenverwaltung/Details/Kontakt.js', diff --git a/application/controllers/api/frontend/v1/stv/Favorites.php b/application/controllers/api/frontend/v1/stv/Favorites.php index b8fe6f3d7..ca8b62da6 100644 --- a/application/controllers/api/frontend/v1/stv/Favorites.php +++ b/application/controllers/api/frontend/v1/stv/Favorites.php @@ -35,8 +35,6 @@ class Favorites extends FHCAPI_Controller // Load models $this->load->model('system/Variable_model', 'VariableModel'); - - // TODO(chris): variable table might be to small to store favorites! } public function index() @@ -62,6 +60,17 @@ 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/Notiz.php b/application/controllers/api/frontend/v1/stv/Notiz.php index 19e568f33..ba7cd1928 100644 --- a/application/controllers/api/frontend/v1/stv/Notiz.php +++ b/application/controllers/api/frontend/v1/stv/Notiz.php @@ -16,7 +16,8 @@ class Notiz extends Notiz_Controller 'updateNotiz' => ['admin:rw', 'assistenz:rw'], // TODO(manu): self::PERM_LOGGED 'deleteNotiz' => ['admin:r', 'assistenz:r'], 'loadDokumente' => ['admin:r', 'assistenz:r'], - 'getMitarbeiter' => ['admin:r', 'assistenz:r'] + 'getMitarbeiter' => ['admin:r', 'assistenz:r'], + 'getCountNotes' => ['admin:r', 'assistenz:r'], ]); //Load Models diff --git a/application/controllers/api/frontend/v1/stv/Status.php b/application/controllers/api/frontend/v1/stv/Status.php index 629d5512a..665fb620f 100644 --- a/application/controllers/api/frontend/v1/stv/Status.php +++ b/application/controllers/api/frontend/v1/stv/Status.php @@ -24,7 +24,6 @@ class Status extends FHCAPI_Controller 'updateStatus' => ['admin:rw', 'assistenz:rw'], 'advanceStatus' => ['admin:rw', 'assistenz:rw'], 'confirmStatus' => ['admin:rw', 'assistenz:rw'], - ]); //Load Models @@ -440,9 +439,10 @@ class Status extends FHCAPI_Controller ]); if (!$this->form_validation->run()) + { $this->terminateWithValidationErrors($this->form_validation->error_array()); + } - $this->load->library('PrestudentLib'); $this->db->trans_start(); @@ -628,8 +628,9 @@ class Status extends FHCAPI_Controller ]); if (!$this->form_validation->run()) + { $this->terminateWithValidationErrors($this->form_validation->error_array()); - + } // Start DB transaction $this->db->trans_start(); diff --git a/application/controllers/api/frontend/v1/stv/Student.php b/application/controllers/api/frontend/v1/stv/Student.php index ac09f39bb..4309e88a4 100644 --- a/application/controllers/api/frontend/v1/stv/Student.php +++ b/application/controllers/api/frontend/v1/stv/Student.php @@ -106,6 +106,7 @@ class Student extends FHCAPI_Controller $this->PrestudentModel->addSelect('p.staatsbuergerschaft'); $this->PrestudentModel->addSelect('p.matr_nr'); $this->PrestudentModel->addSelect('p.anrede'); + $this->PrestudentModel->addSelect('p.zugangscode'); if (defined('ACTIVE_ADDONS') && strpos(ACTIVE_ADDONS, 'bewerbung') !== false) { $this->PrestudentModel->addSelect( @@ -693,7 +694,7 @@ class Student extends FHCAPI_Controller return $result; }*/ - $this->terminateWithSuccess(true); + return success(true); } public function requiredIfNotPersonId($value) @@ -709,4 +710,9 @@ class Student extends FHCAPI_Controller return true; return !!$value; } + + public function isValidDate($value) + { + return isValidDate($value); + } } diff --git a/application/controllers/codex/UHSTAT1.php b/application/controllers/codex/UHSTAT1.php index ff59ef41a..c1d4d0abf 100644 --- a/application/controllers/codex/UHSTAT1.php +++ b/application/controllers/codex/UHSTAT1.php @@ -11,6 +11,7 @@ class UHSTAT1 extends FHC_Controller const CODEX_UNKNOWN_YEAR = 9999; const CODEX_UNKNOWN_NATION = 'XXX'; const CODEX_UNKNOWN_BILDUNGMAX = 999; + const CODEX_EXCLUDED_NATIONS = ['ZZZ']; const LOWER_BOUNDARY_YEARS = 160; const UPPER_BOUNDARY_YEARS = 20; @@ -32,8 +33,7 @@ class UHSTAT1 extends FHC_Controller $this->load->library('PermissionLib'); // load models - $this->load->model('codex/Oehbeitrag_model', 'OehbeitragModel'); - $this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel'); + $this->load->model('person/Benutzer_model', 'BenutzerModel'); $this->load->model('system/Sprache_model', 'SpracheModel'); $this->load->model('codex/Abschluss_model', 'AbschlussModel'); $this->load->model('codex/Uhstat1daten_model', 'Uhstat1datenModel'); @@ -104,7 +104,7 @@ class UHSTAT1 extends FHC_Controller { $saved = false; - $person_id = $this->_getValidPersonId('sui'); + $person_id = $this->_getUHSTATPersonId('sui'); $this->form_validation->set_error_delimiters('', ''); @@ -245,7 +245,7 @@ class UHSTAT1 extends FHC_Controller // uhstat data can only be deleted with permission if (!$this->_checkPermission('suid')) show_error('no permission'); - $person_id = $this->_getValidPersonId('suid'); + $person_id = $this->_getUHSTATPersonId('suid'); $uhstat1datenRes = $this->Uhstat1datenModel->delete( array('person_id' => $person_id) @@ -287,13 +287,17 @@ class UHSTAT1 extends FHC_Controller */ private function _getFormMetaData() { - $person_id = $this->_getValidPersonId('s'); + $person_id = $this->_getUHSTATPersonId('s'); // read only display param $readOnly = $this->input->get('readOnly'); - // depending on permissions, editing or deleting is possible - $editPermission = $this->_checkPermission('sui'); + // checking permissions for form + + // saving is possible if there permission or student log in (but not from application tool) + $savePermission = $this->_checkPermission('sui') || ($this->_getUserPersonId() && !$this->_getApplicationToolPersonId()); + + // deleting only possible with permission $deletePermission = $this->_checkPermission('suid'); $languageIdx = $this->_getLanguageIndex(); @@ -304,7 +308,7 @@ class UHSTAT1 extends FHC_Controller 'abschluss_nicht_oesterreich' => array(), 'jahre' => array(), 'person_id' => $person_id, - 'editPermission' => $editPermission, + 'savePermission' => $savePermission, 'deletePermission' => $deletePermission, 'readOnly' => $readOnly ); @@ -336,15 +340,19 @@ class UHSTAT1 extends FHC_Controller if (hasData($nationRes)) { + $dropdownNations = []; $nations = getData($nationRes); - // put austria in beginning of selection foreach ($nations as $nation) { - if ($nation->nation_code == self::CODEX_OESTERREICH) array_unshift($nations, $nation); + // put austria in beginning of selection + if ($nation->nation_code == self::CODEX_OESTERREICH) + array_unshift($dropdownNations, $nation); + elseif (!in_array($nation->nation_code, self::CODEX_EXCLUDED_NATIONS)) // add nation if not excluded + $dropdownNations[] = $nation; } - $formMetaData['nation'] = $nations; + $formMetaData['nation'] = $dropdownNations; } // get abschluss list @@ -386,7 +394,7 @@ class UHSTAT1 extends FHC_Controller */ private function _getUHSTAT1Data() { - $person_id = $this->_getValidPersonId('s'); + $person_id = $this->_getUHSTATPersonId('s'); $this->Uhstat1datenModel->addSelect( implode(', ', array_keys($this->_uhstat1Fields)) @@ -417,29 +425,70 @@ class UHSTAT1 extends FHC_Controller } /** - * Gets Id of person having permissions to manage UHSTAT1 data. - * Can be passed as parameter or be in session. + * Gets Id of person, for which UHSTAT1 data is edited. + * Can be passed as parameter, id of logged in person, or be in session. + * @param berechtigungsArt type of permission (suid) * @return int person_id */ - private function _getValidPersonId($berechtigungsArt) + private function _getUHSTATPersonId($berechtigungsArt) { // if coming from bewerbungstool - person id is in session (person must be logged in bewerbungstool) + $applicationToolPersonId = $this->_getApplicationToolPersonId(); + if (isset($applicationToolPersonId) && is_numeric($applicationToolPersonId)) return $applicationToolPersonId; + + // if successfully logged in + $loggedInPersonId = $this->_getUserPersonId(); + if (isset($loggedInPersonId) && is_numeric($loggedInPersonId)) + { + // if person id passed directly... + $person_id = $this->input->post('person_id'); + if (!isset($person_id)) $person_id = $this->input->get('person_id'); + + if (isset($person_id)) + { + if (!is_numeric($person_id)) show_error("invalid person id"); + // ...check if there is a permission for editing UHSTAT1 data + if ($this->_checkPermission($berechtigungsArt)) return $person_id; + } + + // if no id passed, use logged in person id + return $loggedInPersonId; + } + + show_error("No permission"); + } + + /** + * Gets person Id if there is a application tool login. + * @return person Id or null + */ + private function _getApplicationToolPersonId() + { + // if coming from aplication tool - person id is in session (person must be logged in bewerbungstool) if (isset($_SESSION[self::PERSON_ID_SESSION_INDEX]) && is_numeric($_SESSION[self::PERSON_ID_SESSION_INDEX]) && isset($_SESSION[self::LOGIN_SESSION_INDEX]) ) return $_SESSION[self::PERSON_ID_SESSION_INDEX]; - // if person id passed directly... - $person_id = $this->input->post('person_id'); - if (!isset($person_id)) $person_id = $this->input->get('person_id'); + return null; + } - if (!isset($person_id) || !is_numeric($person_id)) show_error("invalid person id"); - - // ...check if there is a permission for editing UHSTAT1 data - if ($this->_checkPermission($berechtigungsArt)) return $person_id; - - show_error("No permission"); + /** + * Gets person Id if there is a user login. + * @return person Id or null + */ + private function _getUserPersonId() + { + $loggedInPersonId = getAuthPersonId(); + if (isset($loggedInPersonId) && is_numeric($loggedInPersonId)) + { + // check if the the user is a student and if the benutzer is active + $this->BenutzerModel->addSelect('1'); + $res = $this->BenutzerModel->loadWhere(["public.tbl_benutzer.person_id" => $loggedInPersonId, "public.tbl_benutzer.aktiv" => TRUE]); + if (hasData($res)) return $loggedInPersonId; + } + return null; } /** diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 57aca0876..1fc49c72f 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -1275,7 +1275,6 @@ class InfoCenter extends Auth_Controller 'nachname' => $this->input->post('nachname'), 'titelpost' => isEmptyString($this->input->post('titelpost')) ? null : $this->input->post('titelpost'), 'gebdatum' => isEmptyString($this->input->post('gebdatum')) ? null : date("Y-m-d", strtotime($this->input->post('gebdatum'))), - 'svnr' => isEmptyString($this->input->post('svnr')) ? null : $this->input->post('svnr'), 'staatsbuergerschaft' => isEmptyString($this->input->post('buergerschaft')) ? null : $this->input->post('buergerschaft'), 'geschlecht' => $this->input->post('geschlecht'), 'geburtsnation' => isEmptyString($this->input->post('gebnation')) ? null : $this->input->post('gebnation'), @@ -1816,7 +1815,7 @@ class InfoCenter extends Auth_Controller } /** - * Loads all necessary Person data: Stammdaten (name, svnr, contact, ...), Dokumente, Logs and Notizen + * Loads all necessary Person data: Stammdaten (name, contact, ...), Dokumente, Logs and Notizen * @param $person_id * @return array */ diff --git a/application/core/Notiz_Controller.php b/application/core/Notiz_Controller.php index 472ac7669..c2bb03267 100644 --- a/application/core/Notiz_Controller.php +++ b/application/core/Notiz_Controller.php @@ -21,6 +21,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller 'loadDokumente' => self::DEFAULT_PERMISSION_R, 'getMitarbeiter' => self::DEFAULT_PERMISSION_R, 'isBerechtigt' => self::DEFAULT_PERMISSION_R, + 'getCountNotes' => self::DEFAULT_PERMISSION_R, ]; if(!is_array($permissions)) @@ -459,4 +460,20 @@ abstract class Notiz_Controller extends FHCAPI_Controller return $this->terminateWithSuccess($result); } + public function getCountNotes($person_id) + { + $this->NotizzuordnungModel->addSelect('COUNT(*) AS anzahl', false); + + $result = $this->NotizzuordnungModel->loadWhere( + array('person_id' => $person_id) + ); + + if (isError($result)) { + $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + } + + $anzahl = current(getData($result)); + return $this->terminateWithSuccess($anzahl->anzahl ?: 0); + } + } \ No newline at end of file diff --git a/application/libraries/PhrasesLib.php b/application/libraries/PhrasesLib.php index ecd8094d6..647bf7074 100644 --- a/application/libraries/PhrasesLib.php +++ b/application/libraries/PhrasesLib.php @@ -122,6 +122,7 @@ class PhrasesLib $tmpText = substr($tmpText, 0, strlen($tmpText) - 4); } } + $tmpText = str_replace(['', ''], '', $tmpText); $result->retval[$i]->text = $tmpText; } diff --git a/application/models/ressource/Betriebsmittelperson_model.php b/application/models/ressource/Betriebsmittelperson_model.php index 6da9a384d..219af51b8 100644 --- a/application/models/ressource/Betriebsmittelperson_model.php +++ b/application/models/ressource/Betriebsmittelperson_model.php @@ -97,7 +97,7 @@ class Betriebsmittelperson_model extends DB_Model return $this->loadWhere($condition); } - public function getBetriebsmittelData($id, $type_id) + public function getBetriebsmittelData($id, $type_id, $betriesmitteltypes = null) { switch ($type_id) { case 'person_id': @@ -113,6 +113,15 @@ class Betriebsmittelperson_model extends DB_Model return error("ID nicht gültig"); } + $cond .= " = ? "; + $params[] = $id; + + if ($betriesmitteltypes && !isEmptyArray($betriesmitteltypes)) + { + $cond .= " AND bm.betriebsmitteltyp IN ?"; + $params[] = $betriesmitteltypes; + } + $query = " SELECT bm.nummer, bmp.person_id, bm.betriebsmitteltyp, bmp.anmerkung as anmerkung, @@ -126,9 +135,9 @@ class Betriebsmittelperson_model extends DB_Model JOIN wawi.tbl_betriebsmittel bm ON (bmp.betriebsmittel_id = bm.betriebsmittel_id) WHERE - " . $cond . " = ? "; + " . $cond; - return $this->execQuery($query, array($id)); + return $this->execQuery($query, $params); } /** diff --git a/application/views/codex/uhstat1.php b/application/views/codex/uhstat1.php index a255781f1..cb2f219f8 100644 --- a/application/views/codex/uhstat1.php +++ b/application/views/codex/uhstat1.php @@ -26,7 +26,7 @@ $vater_bildungsstaat = isset($uhstatData->vater_bildungsstaat) ? $uhstatData->va $vater_bildungmax = isset($uhstatData->vater_bildungmax) ? $uhstatData->vater_bildungmax : set_value('vater_bildungmax'); $readOnly = isset($formMetaData['readOnly']); $disabled = $readOnly ? ' disabled' : ''; -$editPermission = isset($formMetaData['editPermission']) && $formMetaData['editPermission'] === true; +$savePermission = isset($formMetaData['savePermission']) && $formMetaData['savePermission'] === true; $deletePermission = isset($formMetaData['deletePermission']) && $formMetaData['deletePermission'] === true; $saved = isset($saved) && $saved === true; ?> @@ -51,7 +51,7 @@ $saved = isset($saved) && $saved === true; p->t('uhstat', 'uhstat1EinleitungSvnrtext') ?>


- +
@@ -288,7 +288,7 @@ $saved = isset($saved) && $saved === true;
- +
diff --git a/application/views/system/infocenter/stammdaten.php b/application/views/system/infocenter/stammdaten.php index f143c9c03..f852e9ace 100644 --- a/application/views/system/infocenter/stammdaten.php +++ b/application/views/system/infocenter/stammdaten.php @@ -32,12 +32,6 @@
gebdatum), 'd.m.Y') ?>
- - p->t('person','svnr')) ?> - -
svnr ?>
- - p->t('person','staatsbuergerschaft')) ?> diff --git a/cis/private/profile/zeitsperre_resturlaub.php b/cis/private/profile/zeitsperre_resturlaub.php index ffd179401..1b6546d41 100644 --- a/cis/private/profile/zeitsperre_resturlaub.php +++ b/cis/private/profile/zeitsperre_resturlaub.php @@ -285,15 +285,16 @@ function showHideBezeichnungDropDown() if (dd.options[dd.selectedIndex].value == 'DienstV') { var str = ''; sp.innerHTML = str; diff --git a/content/student/studentoverlay.js.php b/content/student/studentoverlay.js.php index d2030f493..d8cb1fc56 100644 --- a/content/student/studentoverlay.js.php +++ b/content/student/studentoverlay.js.php @@ -3553,6 +3553,15 @@ function StudentZeugnisDokumentArchivieren() xml = 'abschlussdokument_lehrgaenge.xml.php'; break; + case 'microcredentialzertifikat_1': + case 'microcredentialzertifikat_2': + case 'microcredentialzertifikat_3': + case 'microcredential_1': + case 'microcredential_2': + case 'microcredential_3': + xml = 'microcredential.xml.php'; + break; + default: alert('Das Archivieren fuer diesen Dokumenttyp wird derzeit nicht unterstuetzt'); return @@ -4783,7 +4792,7 @@ function StudentNotenMoveFromAntrag() var uid = document.getElementById('student-detail-textbox-uid').value; req.add('student_uid', uid); - + var txt = "?"; for(var q in req.parms) { txt = txt+'&'+req.parms[q].name+'='+encodeURIComponent(req.parms[q].value); diff --git a/include/tw/cis_menu_lv.inc.php b/include/tw/cis_menu_lv.inc.php index 73a347dc3..29ba54724 100644 --- a/include/tw/cis_menu_lv.inc.php +++ b/include/tw/cis_menu_lv.inc.php @@ -244,10 +244,10 @@ function checkZeilenUmbruch() if(defined('CIS_LEHRVERANSTALTUNG_ANWESENHEIT_ANZEIGEN') && CIS_LEHRVERANSTALTUNG_ANWESENHEIT_ANZEIGEN && $angemeldet && (!defined('CIS_LEHRVERANSTALTUNG_ANWESENHEIT_ANZEIGEN_STG') || in_array($lv->studiengang_kz, unserialize(CIS_LEHRVERANSTALTUNG_ANWESENHEIT_ANZEIGEN_STG))) && (!defined('CIS_LEHRVERANSTALTUNG_ANWESENHEIT_ANZEIGEN_LVA') || in_array($lv->lehrveranstaltung_id, unserialize(CIS_LEHRVERANSTALTUNG_ANWESENHEIT_ANZEIGEN_LVA))) - && ($rechte->isBerechtigt('extension/anw_ent_admin') - || $rechte->isBerechtigt('extension/anwesenheit_lektor') - || $rechte->isBerechtigt('extension/anwesenheit_student') - || $rechte->isBerechtigt('extension/anwesenheit_admin'))) + && ($rechte->isBerechtigt('extension/anw_r_ent_assistenz') + || $rechte->isBerechtigt('extension/anw_r_lektor') + || $rechte->isBerechtigt('extension/anw_r_student') + || $rechte->isBerechtigt('extension/anw_r_full_assistenz'))) { $link=''; $text=''; diff --git a/public/css/components/primevue.css b/public/css/components/primevue.css index fbbae4e58..5949d6ecc 100644 --- a/public/css/components/primevue.css +++ b/public/css/components/primevue.css @@ -3973,6 +3973,10 @@ border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; } +.p-tabview-panel .btn-close, +.p-tabview-panel .carousel-indicators [data-bs-target] { + box-sizing: content-box; +} .p-toolbar { background: #efefef; diff --git a/public/js/api/factory/betriebsmittel/person.js b/public/js/api/factory/betriebsmittel/person.js index 912a5df31..504e755b6 100644 --- a/public/js/api/factory/betriebsmittel/person.js +++ b/public/js/api/factory/betriebsmittel/person.js @@ -16,10 +16,13 @@ */ export default { - getAllBetriebsmittel(type, id) { + getAllBetriebsmittel(type, id, betriebsmitteltypes) { return { method: 'get', - url: 'api/frontend/v1/betriebsmittel/betriebsmittelP/getAllBetriebsmittel/' + type + '/' + id + url: 'api/frontend/v1/betriebsmittel/betriebsmittelP/getAllBetriebsmittel/' + type + '/' + id, + params: { + betriebsmitteltypes + } }; }, addNewBetriebsmittel(person_id, params) { @@ -48,10 +51,13 @@ export default { url: 'api/frontend/v1/betriebsmittel/betriebsmittelP/deleteBetriebsmittel/' + betriebsmittelperson_id }; }, - getTypenBetriebsmittel() { + getTypenBetriebsmittel(betriebsmitteltypes) { return { method: 'get', - url: 'api/frontend/v1/betriebsmittel/betriebsmittelP/getTypenBetriebsmittel/' + url: 'api/frontend/v1/betriebsmittel/betriebsmittelP/getTypenBetriebsmittel/', + params: { + betriebsmitteltypes + } }; }, loadInventarliste(query) { diff --git a/public/js/api/factory/notiz/person.js b/public/js/api/factory/notiz/person.js index 33b572d1a..c75e79acf 100644 --- a/public/js/api/factory/notiz/person.js +++ b/public/js/api/factory/notiz/person.js @@ -83,5 +83,11 @@ export default { method: 'get', url: 'api/frontend/v1/notiz/notizPerson/isBerechtigt/' }; + }, + getCountNotes(person_id){ + return { + method: 'get', + url: 'api/frontend/v1/notiz/notizPerson/getCountNotes/' + person_id + }; } }; diff --git a/public/js/components/Betriebsmittel/Betriebsmittel.js b/public/js/components/Betriebsmittel/Betriebsmittel.js index 6d976a1fa..148d7a83c 100644 --- a/public/js/components/Betriebsmittel/Betriebsmittel.js +++ b/public/js/components/Betriebsmittel/Betriebsmittel.js @@ -29,14 +29,24 @@ export default { uid: { type: [Number, String], required: true - } + }, + /** List of types to allow for creation */ + betriebsmittelTypes: { + type: Array, + default: null + }, + /** + * If true: only show the types specified in 'betriebsmittelTypes'. + * If false: show all available types. + */ + filterByProvidedTypes: Boolean }, data() { return { tabulatorOptions: { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call( - this.endpoint.getAllBetriebsmittel(this.typeId, this.id) + this.endpoint.getAllBetriebsmittel(this.typeId, this.id, (this.filterByProvidedTypes ? this.betriebsmittelTypes : null)) ), ajaxResponse: (url, params, response) => response.data, columns: [ @@ -294,7 +304,7 @@ export default { }, created() { return this.$api - .call(this.endpoint.getTypenBetriebsmittel()) + .call(this.endpoint.getTypenBetriebsmittel(this.betriebsmittelTypes)) .then(result => { this.listBetriebsmitteltyp = result.data; }) diff --git a/public/js/components/Bootstrap/Modal.js b/public/js/components/Bootstrap/Modal.js index af81e469f..a84d9d8d7 100644 --- a/public/js/components/Bootstrap/Modal.js +++ b/public/js/components/Bootstrap/Modal.js @@ -3,7 +3,8 @@ export default { name: 'BootstrapModal', data: () => ({ - modal: null + modal: null, + fullscreen: false }), props: { backdrop: { @@ -34,6 +35,10 @@ export default { footerClass: { type: [String,Array,Object], default: '' + }, + allowFullscreenExpand: { + type: Boolean, + default: false } }, emits: [ @@ -58,6 +63,9 @@ export default { }, toggle() { return this.modal.toggle(); + }, + toggleFullscreen() { + this.fullscreen = !this.fullscreen } }, mounted() { @@ -122,13 +130,18 @@ export default { }); }); }, - template: `