mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-23 15:09:37 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 48b836c466 | |||
| 363cb90019 | |||
| eca9b22f7d | |||
| 667726e23b | |||
| f3f960ccc4 | |||
| 86b4ffabc4 | |||
| 081703e0f8 | |||
| 05814383d4 | |||
| a44d0f65b3 | |||
| fe507e4185 |
@@ -45,6 +45,14 @@ $config['navigation_header'] = array(
|
||||
'expand' => true,
|
||||
'sort' => 30,
|
||||
'requiredPermissions' => 'admin:w'
|
||||
),
|
||||
'roomManagerOverview' => array(
|
||||
'link' => site_url('RoomManager'),
|
||||
'icon' => '',
|
||||
'description' => 'Raumverwaltung',
|
||||
'expand' => true,
|
||||
'sort' => 40,
|
||||
'requiredPermissions' => 'basis/ort:r'
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -383,3 +391,12 @@ $config['navigation_menu']['apps'] = [
|
||||
'requiredPermissions' => array('lehre/lehrauftrag_bestellen:r', 'lehre/lehrauftrag_erteilen:r')
|
||||
]
|
||||
];
|
||||
|
||||
$config['navigation_menu']['RoomManager/index'] = array(
|
||||
'lvTemplateUebersicht' => array(
|
||||
'link' => site_url('RoomManager'),
|
||||
'description' => 'Raumverwaltung übersicht',
|
||||
'icon' => '',
|
||||
'sort' => 1
|
||||
)
|
||||
);
|
||||
@@ -122,6 +122,8 @@ $route['api/frontend/v1/stv/[sS]tudents/([WS]S[0-9]{4})/person/(:num)'] = 'api/f
|
||||
// load routes from extensions, also look for environment-specific configs
|
||||
$subdirs = ['application/config/extensions', 'application/config/' . ENVIRONMENT . '/extensions'];
|
||||
|
||||
$route['RoomManager/.*'] = 'RoomManager/index';
|
||||
|
||||
foreach($subdirs as $subdir)
|
||||
{
|
||||
if(is_dir($subdir))
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*/
|
||||
class RoomManager extends Auth_Controller
|
||||
{
|
||||
private $_uid; // uid of the logged user
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => array('basis/ort:r')
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->library('AuthLib');
|
||||
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'ui',
|
||||
'global',
|
||||
'person',
|
||||
'abschlusspruefung',
|
||||
'password',
|
||||
'lehre'
|
||||
)
|
||||
);
|
||||
|
||||
$this->_setAuthUID();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function index()
|
||||
{
|
||||
return $this->load->view('room_manager/index', [
|
||||
'permissions' => [
|
||||
'basis/ort_w' => $this->permissionlib->isBerechtigt('basis/ort', 'suid'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Retrieve the UID of the logged user and checks if it is valid
|
||||
*/
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid) show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -31,21 +31,180 @@ class Ort extends FHCAPI_Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// NOTE(chris): additional permission checks will be done in SearchBarLib
|
||||
parent::__construct([
|
||||
'getAllRooms' => array('basis/ort:r'),
|
||||
'getRooms' => self::PERM_LOGGED,
|
||||
'getTypes' => self::PERM_LOGGED,
|
||||
'ContentID' => self::PERM_LOGGED,
|
||||
'getOrtKurzbzContent' => self::PERM_LOGGED,
|
||||
'getRooms' => self::PERM_LOGGED,
|
||||
'getTypes' => self::PERM_LOGGED
|
||||
'getRoom' => self::PERM_LOGGED,
|
||||
'createRoom' => array('basis/ort:rw'),
|
||||
'updateRoom' => array('basis/ort:rw'),
|
||||
'deleteRoom' => array('basis/ort:rw'),
|
||||
]);
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('requests/RoomRequest');
|
||||
|
||||
$this->load->model('ressource/Ort_model', 'OrtModel');
|
||||
$this->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
|
||||
$this->config->load('raumsuche');
|
||||
|
||||
$this->loadPhrases([
|
||||
'global',
|
||||
'ui',
|
||||
'lehre',
|
||||
'gruppenmanagement',
|
||||
'person',
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getAllRooms()
|
||||
{
|
||||
$paginationSize = $this->input->get('pagination[size]', TRUE);
|
||||
$paginationPage = $this->input->get('pagination[page]', TRUE);
|
||||
|
||||
$filter = $this->input->get('filter', TRUE);
|
||||
|
||||
$filterData = [];
|
||||
|
||||
|
||||
$query = "SELECT
|
||||
COUNT(*) OVER() AS full_count,
|
||||
public.tbl_ort.*,
|
||||
org.bezeichnung as org_bezeichnung,
|
||||
org.organisationseinheittyp_kurzbz as org_organisationseinheittyp_kurzbz
|
||||
FROM public.tbl_ort
|
||||
LEFT JOIN public.tbl_ort as pr ON pr.ort_kurzbz = public.tbl_ort.parent_ort_kurzbz
|
||||
LEFT JOIN public.tbl_organisationseinheit as org ON org.oe_kurzbz = public.tbl_ort.oe_kurzbz";
|
||||
|
||||
|
||||
$queryWhereFragments = [];
|
||||
|
||||
$searchableIdAttributes = ['standort_id', 'gebteil', 'oe_kurzbz'];
|
||||
$searchableTextAttributes = ['ort_kurzbz', 'parent_ort_kurzbz', 'bezeichnung', 'planbezeichnung', 'oe_bezeichnung'];
|
||||
$searchableBooleanAttributes = ['lehre', 'reservieren', 'aktiv'];
|
||||
$searchableNumericAttributes = ['max_person', 'arbeitsplaetze', 'kosten', 'stockwerk'];
|
||||
$searchableNumericSpanAttributes = ['m2'];
|
||||
$searchableCustomAttributes = [
|
||||
[
|
||||
'raw_sql_fragment' => "CONCAT(public.tbl_ort.ort_kurzbz, ' - ', public.tbl_ort.bezeichnung)",
|
||||
'filter_parameter' => 'ort_kurzbz_bezeichnung_concat',
|
||||
],
|
||||
[
|
||||
'raw_sql_fragment' => "CONCAT('[', org.organisationseinheittyp_kurzbz, '] ', org.bezeichnung)",
|
||||
'filter_parameter' => 'org_organisationseinheittyp_kurzbz_org_bezeichnung_concat',
|
||||
]
|
||||
];
|
||||
|
||||
foreach ($searchableIdAttributes as $attribute) {
|
||||
if (isset($filter[$attribute]) && $filter[$attribute] !== '') {
|
||||
$queryWhereFragments[] = "public.tbl_ort.$attribute = ?";
|
||||
$filterData[] = trim($filter[$attribute]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($searchableTextAttributes as $attribute) {
|
||||
$tableAttribute = "public.tbl_ort.$attribute";
|
||||
if ($attribute === 'oe_bezeichnung') {
|
||||
$tableAttribute = "org.bezeichnung";
|
||||
}
|
||||
if (isset($filter[$attribute]) && $filter[$attribute] !== '') {
|
||||
$queryWhereFragments[] = "$tableAttribute ILIKE ?";
|
||||
$filterData[] = '%' . trim($filter[$attribute]) . '%';
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($searchableBooleanAttributes as $attribute) {
|
||||
if (isset($filter[$attribute]) && $filter[$attribute] !== '') {
|
||||
$queryWhereFragments[] = "public.tbl_ort.$attribute = ?";
|
||||
$filterData[] = $filter[$attribute] === 'true' ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($searchableNumericAttributes as $attribute) {
|
||||
if (isset($filter[$attribute]) && $filter[$attribute] !== '') {
|
||||
$queryWhereFragments[] = "public.tbl_ort.$attribute = ?";
|
||||
$filterData[] = trim($filter[$attribute]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($searchableNumericSpanAttributes as $attribute) {
|
||||
if (isset($filter[$attribute]) && $filter[$attribute] !== '') {
|
||||
$queryWhereFragments[] = "public.tbl_ort.$attribute >= ? AND public.tbl_ort.$attribute <= ?";
|
||||
$filterData[] = trim($filter[$attribute]) - 1;
|
||||
$filterData[] = trim($filter[$attribute]) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($searchableCustomAttributes as $customAttribute) {
|
||||
if (isset($filter[$customAttribute['filter_parameter']]) && $filter[$customAttribute['filter_parameter']] !== '') {
|
||||
$queryWhereFragments[] = $customAttribute['raw_sql_fragment'] . " ILIKE ?";
|
||||
$filterData[] = '%' . trim($filter[$customAttribute['filter_parameter']]) . '%';
|
||||
}
|
||||
}
|
||||
|
||||
if (count($queryWhereFragments) > 0) {
|
||||
$query .= ' WHERE ' . implode(' AND ', $queryWhereFragments);
|
||||
}
|
||||
|
||||
$sortableAttributes = ['ort_kurzbz', 'bezeichnung', 'planbezeichnung', 'max_person', 'arbeitsplaetze', 'm2', 'lehre', 'reservieren', 'aktiv', 'stockwerk', 'kosten', 'parent_ort_kurzbz', 'org_bezeichnung'];
|
||||
$sortableConcatAttributes = [
|
||||
[
|
||||
'raw_sql_fragment' => "CONCAT('[', org.organisationseinheittyp_kurzbz, '] ', org.bezeichnung)",
|
||||
'sort_parameter' => 'org_organisationseinheittyp_kurzbz_org_bezeichnung_concat',
|
||||
]
|
||||
];
|
||||
$sorter = $this->input->get('sort', TRUE);
|
||||
|
||||
foreach ($sortableAttributes as $attribute) {
|
||||
if (isset($sorter[$attribute]) && in_array(strtolower($sorter[$attribute]), ['asc', 'desc'])) {
|
||||
if ($attribute === 'org_bezeichnung') {
|
||||
$query .= " ORDER BY org.bezeichnung " . strtoupper($sorter[$attribute]);
|
||||
} else {
|
||||
$query .= " ORDER BY public.tbl_ort.$attribute " . strtoupper($sorter[$attribute]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($sortableConcatAttributes as $customAttribute) {
|
||||
if (isset($sorter[$customAttribute['sort_parameter']]) && in_array(strtolower($sorter[$customAttribute['sort_parameter']]), ['asc', 'desc'])) {
|
||||
$query .= " ORDER BY " . $customAttribute['raw_sql_fragment'] . " " . strtoupper($sorter[$customAttribute['sort_parameter']]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($sorter)) {
|
||||
$query .= ' ORDER BY public.tbl_ort.ort_kurzbz ASC';
|
||||
}
|
||||
|
||||
if ($paginationSize && $paginationPage) {
|
||||
$query .= " LIMIT ? OFFSET ?";
|
||||
}
|
||||
|
||||
$queryData = array_merge($filterData);
|
||||
if ($paginationSize && $paginationPage) {
|
||||
$queryData = array_merge($filterData, [$paginationSize, ($paginationPage - 1) * $paginationSize]);
|
||||
}
|
||||
|
||||
$result = $this->OrtModel->execReadOnlyQuery($query, $queryData);
|
||||
|
||||
$queryData = hasData($result) ? getData($result) : [];
|
||||
|
||||
if ($paginationSize && $paginationPage) {
|
||||
$totalItems = count($queryData) > 0 ? $queryData[0]->full_count : 0;
|
||||
$pageCount = ceil($totalItems / $paginationSize);
|
||||
$this->addTabulatorPaginationData($pageCount);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($queryData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves all Ort entries filtered by the provided parameters
|
||||
*/
|
||||
@@ -54,7 +213,7 @@ class Ort extends FHCAPI_Controller
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('datum','Datum','required');
|
||||
$this->form_validation->set_rules('von','Uhrzeit Von','required|regex_match[/^[0-9]{2}:[0-9]{2}$/]');
|
||||
$this->form_validation->set_rules('von','Uhrzeit Von','required|regexresponse_match[/^[0-9]{2}:[0-9]{2}$/]');
|
||||
$this->form_validation->set_rules('bis','Uhrzeit Bis','required|regex_match[/^[0-9]{2}:[0-9]{2}$/]');
|
||||
if($this->form_validation->run() == FALSE) {
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
@@ -66,7 +225,6 @@ class Ort extends FHCAPI_Controller
|
||||
$typ = $this->input->get('typ', TRUE);
|
||||
$personenanzahl = $this->input->get('personenanzahl', TRUE);
|
||||
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID())->retval;
|
||||
|
||||
@@ -100,8 +258,7 @@ class Ort extends FHCAPI_Controller
|
||||
)
|
||||
";
|
||||
$params = array_merge($params, [$datum, $vonStunde, $bisStunde, $datum, $vonStunde, $bisStunde]);
|
||||
// $this->addMeta('qry', $qry);
|
||||
// $this->addMeta('params', $params);
|
||||
|
||||
$result = $this->OrtModel->execReadOnlyQuery($qry, $params);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
@@ -174,5 +331,161 @@ class Ort extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess($content);
|
||||
}
|
||||
|
||||
public function getRoom($ort_kurzbz)
|
||||
{
|
||||
$result = $this->OrtModel->load($ort_kurzbz);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = hasData($result) ? current(getData($result)) : null;
|
||||
|
||||
return $this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function createRoom()
|
||||
{
|
||||
|
||||
if (!$this->roomrequest->validate()) {
|
||||
$this->terminateWithValidationErrors($this->roomrequest->errors());
|
||||
return;
|
||||
}
|
||||
|
||||
$this->db->trans_start();
|
||||
|
||||
$data = [
|
||||
"parent_ort_kurzbz" => $this->input->post('parent_ort_kurzbz'),
|
||||
"oe_kurzbz" => $this->input->post('oe_kurzbz'),
|
||||
"content_id" => !empty($this->input->post('content_id')) ? $this->input->post('content_id') : null,
|
||||
"standort_id" => $this->input->post('standort_id'),
|
||||
"ort_kurzbz" => $this->input->post('ort_kurzbz'),
|
||||
"bezeichnung" => $this->input->post('bezeichnung'),
|
||||
"planbezeichnung" => $this->input->post('planbezeichnung'),
|
||||
"aktiv" => $this->input->post('aktiv') ? true : false,
|
||||
"lehre" => $this->input->post('lehre') ? true : false,
|
||||
"reservieren" => $this->input->post('reservieren') ? true : false,
|
||||
"max_person" => $this->input->post('max_person'),
|
||||
"stockwerk" => $this->input->post('stockwerk'),
|
||||
"lageplan" => $this->input->post('lageplan'),
|
||||
"dislozierung" => $this->input->post('dislozierung'),
|
||||
"kosten" => $this->input->post('kosten'),
|
||||
"ausstattung" => $this->input->post('ausstattung'),
|
||||
"telefonklappe" => $this->input->post('telefonklappe'),
|
||||
"m2" => $this->input->post('m2'),
|
||||
"gebteil" => $this->input->post('gebteil'),
|
||||
"arbeitsplaetze" => $this->input->post('arbeitsplaetze'),
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUid(),
|
||||
'updateamum' => date('c'),
|
||||
'updatevon' => getAuthUid()
|
||||
];
|
||||
|
||||
$this->OrtModel->db->set($data);
|
||||
$result = $this->OrtModel->db->insert($this->OrtModel->getDbTable());
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
|
||||
return $this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function updateRoom($ort_kurzbz)
|
||||
{
|
||||
if (!$this->roomrequest->validate("update")) {
|
||||
$this->terminateWithValidationErrors($this->roomrequest->errors());
|
||||
return;
|
||||
}
|
||||
|
||||
$this->db->trans_start();
|
||||
|
||||
$fields = [
|
||||
"parent_ort_kurzbz",
|
||||
"oe_kurzbz",
|
||||
"content_id",
|
||||
"standort_id",
|
||||
"bezeichnung",
|
||||
"planbezeichnung",
|
||||
"aktiv",
|
||||
"lehre",
|
||||
"reservieren",
|
||||
"max_person",
|
||||
"stockwerk",
|
||||
"lageplan",
|
||||
"dislozierung",
|
||||
"kosten",
|
||||
"ausstattung",
|
||||
"telefonklappe",
|
||||
"m2",
|
||||
"gebteil",
|
||||
"arbeitsplaetze"
|
||||
];
|
||||
|
||||
foreach ($fields as $field) {
|
||||
if (array_key_exists($field, $this->input->post())) {
|
||||
$data[$field] = $this->input->post($field);
|
||||
}
|
||||
}
|
||||
|
||||
$data['updateamum'] = date('c');
|
||||
$data['updatevon'] = getAuthUid();
|
||||
|
||||
$this->OrtModel->db->set($data);
|
||||
$this->OrtModel->db->where('ort_kurzbz', $ort_kurzbz);
|
||||
$result = $this->OrtModel->db->update($this->OrtModel->getDbTable());
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
|
||||
return $this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function deleteRoom($ort_kurzbz)
|
||||
{
|
||||
|
||||
$this->db->trans_start();
|
||||
|
||||
$reservationsQuery = "SELECT COUNT(*) FROM campus.tbl_reservierung WHERE ort_kurzbz = ?";
|
||||
$reservationsResult = $this->OrtModel->execReadOnlyQuery($reservationsQuery, [$ort_kurzbz]);
|
||||
if (isError($reservationsResult)) {
|
||||
$this->terminateWithError(getError($reservationsResult), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$reservationsCount = hasData($reservationsResult) ? getData($reservationsResult)[0]->count : 0;
|
||||
if ($reservationsCount > 0) {
|
||||
$this->terminateWithError($this->p->t('ui', 'error_existingReservationsForRoomsUponDeletion'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$softwareImageOrtQuery = "SELECT COUNT(*) FROM extension.tbl_softwareimage_ort WHERE ort_kurzbz = ?";
|
||||
$softwareImageOrtResult = $this->OrtModel->db->query($softwareImageOrtQuery, [$ort_kurzbz]);
|
||||
if ($softwareImageOrtResult === false) {
|
||||
$this->terminateWithError($this->p->t('ui', 'error_existingSoftwareImageForRoomTypeUponDeletion'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$softwareImageOrtCount = $softwareImageOrtResult->row()->count;
|
||||
if ($softwareImageOrtCount > 0) {
|
||||
$this->terminateWithError($this->p->t('ui', 'error_existingSoftwareImageForRoomTypeUponDeletion'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$subRoomsCountQuery = "SELECT COUNT(*) FROM public.tbl_ort WHERE parent_ort_kurzbz = ?";
|
||||
$subRoomsCountQuery = $this->OrtModel->execReadOnlyQuery($subRoomsCountQuery, [$ort_kurzbz]);
|
||||
$subRoomsCount = hasData($subRoomsCountQuery) ? getData($subRoomsCountQuery)[0]->count : 0;
|
||||
if ($subRoomsCount > 0) {
|
||||
$this->terminateWithError($this->p->t('ui', 'error_existingSubRoomsForRoomUponDeletion'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->OrtModel->delete([
|
||||
"ort_kurzbz" => $ort_kurzbz
|
||||
]);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->db->trans_complete();
|
||||
|
||||
return $this->terminateWithSuccess(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end)
|
||||
* Provides data to the ajax get calls about the searchbar component
|
||||
* This controller works with JSON calls on the HTTP GET and the output is always JSON
|
||||
*/
|
||||
class RoomToRoomTypeApi extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// NOTE(chris): additional permission checks will be done in SearchBarLib
|
||||
parent::__construct([
|
||||
'getRoomToRoomTypeRelationsByRoomShortCode' => array('basis/ort:r'),
|
||||
'createRoomToRoomTypeRelation' => array('basis/ort:rw'),
|
||||
'deleteRoomToRoomTypeRelation' => array('basis/ort:rw'),
|
||||
]);
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->load->model('ressource/Ortraumtyp_model', 'OrtRoomTypeModel');
|
||||
|
||||
$this->loadPhrases([
|
||||
'global',
|
||||
'ui',
|
||||
'lehre'
|
||||
]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function getRoomToRoomTypeRelationsByRoomShortCode($roomShortCode) {
|
||||
$this->OrtRoomTypeModel->db->select('public.tbl_ortraumtyp.*, public.tbl_raumtyp.beschreibung as raumtyp_beschreibung');
|
||||
$this->OrtRoomTypeModel->db->join('public.tbl_raumtyp', 'public.tbl_raumtyp.raumtyp_kurzbz = public.tbl_ortraumtyp.raumtyp_kurzbz', 'left');
|
||||
$this->OrtRoomTypeModel->db->order_by('hierarchie', 'ASC');
|
||||
$result = $this->OrtRoomTypeModel->loadWhere(['ort_kurzbz' => $roomShortCode]);
|
||||
|
||||
return $this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function createRoomToRoomTypeRelation() {
|
||||
$this->form_validation->set_rules('roomShortCode', 'roomShortCode', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'kurzbz')])
|
||||
]);
|
||||
$this->form_validation->set_rules('roomTypeShortCode', 'roomTypeShortCode', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'kurzbz')])
|
||||
]);
|
||||
$this->form_validation->set_rules('hierarchy', 'hierarchy', 'required|integer', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('ui', 'hierarchy')]),
|
||||
'integer' => $this->p->t('ui', 'error_fieldInteger', ['field' => $this->p->t('ui', 'hierarchy')])
|
||||
]);
|
||||
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$existingRelationResponse = $this->OrtRoomTypeModel->loadWhere([
|
||||
'ort_kurzbz' => $this->input->post('roomShortCode'),
|
||||
'hierarchie' => $this->input->post('hierarchy'),
|
||||
]);
|
||||
if (hasData($existingRelationResponse)) {
|
||||
$this->terminateWithError($this->p->t('ui', 'error_roomToRoomTypeRelationAlreadyExists'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$data = [
|
||||
'ort_kurzbz' => $this->input->post('roomShortCode'),
|
||||
'raumtyp_kurzbz' => $this->input->post('roomTypeShortCode'),
|
||||
'hierarchie' => $this->input->post('hierarchy'),
|
||||
];
|
||||
|
||||
$this->OrtRoomTypeModel->db->set($data);
|
||||
$result = $this->OrtRoomTypeModel->db->insert($this->OrtRoomTypeModel->getDbTable());
|
||||
|
||||
if ($result === false) {
|
||||
return $this->terminateWithError($this->OrtRoomTypeModel->getLastError());
|
||||
}
|
||||
|
||||
return $this->terminateWithSuccess(['message' => 'Room to Room Type relation created successfully.']);
|
||||
}
|
||||
|
||||
public function deleteRoomToRoomTypeRelation() {
|
||||
$this->form_validation->set_rules('roomShortCode', 'roomShortCode', 'required');
|
||||
$this->form_validation->set_rules('roomTypeShortCode', 'roomTypeShortCode', 'required');
|
||||
$this->form_validation->set_rules('hierarchy', 'hierarchy', 'required|integer');
|
||||
|
||||
if ($this->form_validation->run() === false) {
|
||||
return $this->terminateWithError(validation_errors());
|
||||
}
|
||||
|
||||
$result = $this->OrtRoomTypeModel->db->delete($this->OrtRoomTypeModel->getDbTable(), [
|
||||
'ort_kurzbz' => $this->input->post('roomShortCode'),
|
||||
'raumtyp_kurzbz' => $this->input->post('roomTypeShortCode'),
|
||||
'hierarchie' => $this->input->post('hierarchy'),
|
||||
]);
|
||||
|
||||
if ($result === false) {
|
||||
return $this->terminateWithError($this->OrtRoomTypeModel->getLastError());
|
||||
}
|
||||
|
||||
return $this->terminateWithSuccess(['message' => 'Room to Room Type relation deleted successfully.']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end)
|
||||
* Provides data to the ajax get calls about the searchbar component
|
||||
* This controller works with JSON calls on the HTTP GET and the output is always JSON
|
||||
*/
|
||||
class RoomTypeApi extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getAllRoomTypes' => array('basis/ort:r'),
|
||||
'createRoomType' => array('basis/ort:rw'),
|
||||
]);
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->load->model('ressource/Raumtyp_model', 'RoomTypeModel');
|
||||
|
||||
$this->loadPhrases([
|
||||
'global',
|
||||
'ui',
|
||||
'lehre'
|
||||
]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function getAllRoomTypes() {
|
||||
$this->RoomTypeModel->addOrder('raumtyp_kurzbz', 'ASC');
|
||||
$result = $this->RoomTypeModel->load();
|
||||
|
||||
return $this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
|
||||
public function createRoomType() {
|
||||
$this->form_validation->set_rules('kurzbezeichnung', 'kurzbezeichnung', 'required|max_length[255]|is_unique[tbl_raumtyp.raumtyp_kurzbz]', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'kurzbz')]),
|
||||
'is_unique' => $this->p->t('ui', 'error_fieldUnique', ['field' => $this->p->t('lehre', 'kurzbz')]),
|
||||
]);
|
||||
$this->form_validation->set_rules('beschreibung', 'beschreibung', 'max_length[255]');
|
||||
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$data = [
|
||||
'raumtyp_kurzbz' => $this->input->post('kurzbezeichnung'),
|
||||
'beschreibung' => $this->input->post('beschreibung'),
|
||||
];
|
||||
|
||||
$this->RoomTypeModel->db->set($data);
|
||||
$result = $this->RoomTypeModel->db->insert($this->RoomTypeModel->getDbTable());
|
||||
|
||||
if ($result === false) {
|
||||
return $this->terminateWithError($this->RoomTypeModel->getLastError());
|
||||
}
|
||||
|
||||
return $this->terminateWithSuccess();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
class LocationApi extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getLocationsByCompanyType'=> self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->load->model('organisation/standort_model', 'StandortModel');
|
||||
|
||||
$this->loadPhrases([
|
||||
'global',
|
||||
'ui',
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function getLocationsByCompanyType() {
|
||||
$companyType = $this->input->get('companyType');
|
||||
if (!isset($companyType)) {
|
||||
$this->terminateWithError('companyType parameter is required', REST_Controller::HTTP_BAD_REQUEST);
|
||||
return;
|
||||
}
|
||||
|
||||
$result = $this->StandortModel->getByCompanyType($companyType);
|
||||
|
||||
return $this->terminateWithSuccess($this->getDataOrTerminateWithError($result));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
class OrganizationalUnitApi extends FHCAPI_Controller
|
||||
{
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getAllOrganizationalUnits'=> array('basis/organisationseinheit:r'),
|
||||
]);
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
|
||||
$this->loadPhrases([
|
||||
'global'
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getAllOrganizationalUnits()
|
||||
{
|
||||
$entitledOrganizationalUnitsShortCodes = $this->permissionlib->getOE_isEntitledFor('basis/organisationseinheit');
|
||||
|
||||
$this->OrganisationseinheitModel->db->where_in('oe_kurzbz', $entitledOrganizationalUnitsShortCodes);
|
||||
$result = $this->OrganisationseinheitModel->load();
|
||||
|
||||
$organization_units_result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($organization_units_result);
|
||||
}
|
||||
}
|
||||
@@ -78,32 +78,52 @@ class Dokumente extends FHCAPI_Controller
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingValue', ['value' => 'Studiengang_kz']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$resultPreDoc = $this->_getPrestudentDokumente($prestudent_id);
|
||||
|
||||
$arrayAccepted = [];
|
||||
$person_id = $this->_getPersonId($prestudent_id);
|
||||
|
||||
$mergedArray = [];
|
||||
$docNames = array_map(function ($item) {
|
||||
return $item->dokument_kurzbz;
|
||||
}, $resultPreDoc);
|
||||
|
||||
foreach ($resultPreDoc as $pre)
|
||||
foreach($docNames as $doc)
|
||||
{
|
||||
$result = $this->AkteModel->getAktenFAS($person_id, $pre->dokument_kurzbz, $studiengang_kz, $prestudent_id, true);
|
||||
$result = $this->AkteModel->getAktenFAS($person_id, $doc, $studiengang_kz, $prestudent_id, true);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
|
||||
}
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach (getData($result) as $doc)
|
||||
$data = getData($result);
|
||||
foreach ($data as $value)
|
||||
{
|
||||
$merged = clone $doc;
|
||||
$merged->docdatum = $pre->docdatum;
|
||||
$merged->insertvonma = $pre->insertvonma;
|
||||
$merged->bezeichnung = $pre->bezeichnung;
|
||||
$mergedArray[] = $merged;
|
||||
array_push($arrayAccepted, $value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mergedArray[] = $pre;
|
||||
}
|
||||
|
||||
//Mapping with document_kurzbz
|
||||
$preDocMap = [];
|
||||
foreach ($resultPreDoc as $pre) {
|
||||
$preDocMap[$pre->dokument_kurzbz] = $pre;
|
||||
}
|
||||
|
||||
$mergedArray = [];
|
||||
foreach ($arrayAccepted as $doc) {
|
||||
$merged = clone $doc;
|
||||
|
||||
if (isset($preDocMap[$doc->dokument_kurzbz])) {
|
||||
$merged->docdatum = $preDocMap[$doc->dokument_kurzbz]->docdatum;
|
||||
$merged->insertvonma = $preDocMap[$doc->dokument_kurzbz]->insertvonma;
|
||||
$merged->bezeichnung = $preDocMap[$doc->dokument_kurzbz]->bezeichnung;
|
||||
} else {
|
||||
$merged->akzeptiertdatum = null;
|
||||
$merged->akzeptiertvon = null;
|
||||
}
|
||||
|
||||
$mergedArray[] = $merged;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($mergedArray);
|
||||
|
||||
@@ -48,8 +48,7 @@ class Konto extends FHCAPI_Controller
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'konto',
|
||||
'lehre'
|
||||
'konto'
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -113,7 +112,7 @@ class Konto extends FHCAPI_Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getBuchungstypen($studiensemester_kurzbz = null)
|
||||
public function getBuchungstypen()
|
||||
{
|
||||
$this->load->model('crm/Buchungstyp_model', 'BuchungstypModel');
|
||||
|
||||
@@ -123,7 +122,6 @@ class Konto extends FHCAPI_Controller
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->_getOEHBeitrag($data, $studiensemester_kurzbz);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -496,43 +494,4 @@ class Konto extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
|
||||
private function _getOEHBeitrag(&$data, $studiensemester_kurzbz = null)
|
||||
{
|
||||
if (is_null($studiensemester_kurzbz))
|
||||
{
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$studiensemester_akt = $this->variablelib->getVar('semester_aktuell');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
if ($this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
$studiensemester_akt = $studiensemester_kurzbz;
|
||||
else
|
||||
$this->terminateWithError($this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$this->load->model('codex/Oehbeitrag_model', 'OehbeitragModel');
|
||||
$oehBeitrag = $this->OehbeitragModel->getByStudiensemester($studiensemester_akt);
|
||||
|
||||
$oehStandardbetrag = null;
|
||||
if (hasData($oehBeitrag))
|
||||
{
|
||||
$oeh = getData($oehBeitrag)[0];
|
||||
$summe = ($oeh->studierendenbeitrag + $oeh->versicherung) * -1;
|
||||
$oehStandardbetrag = number_format((float)$summe, 2, '.', '');
|
||||
}
|
||||
|
||||
if ($oehStandardbetrag !== null)
|
||||
{
|
||||
$data = array_map(function ($buchungstyp) use ($oehStandardbetrag) {
|
||||
if (isset($buchungstyp->buchungstyp_kurzbz) && (strtolower($buchungstyp->buchungstyp_kurzbz) === 'oeh'))
|
||||
{
|
||||
$buchungstyp->standardbetrag = $oehStandardbetrag;
|
||||
}
|
||||
return $buchungstyp;
|
||||
}, $data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,9 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
*/
|
||||
class Students extends FHCAPI_Controller
|
||||
{
|
||||
private $allowedStgs = [];
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$permissions = [];
|
||||
@@ -32,17 +35,16 @@ class Students extends FHCAPI_Controller
|
||||
$permissions[$router->method] = ['admin:r', 'assistenz:r'];
|
||||
parent::__construct($permissions);
|
||||
|
||||
$allowedStgs = $this->permissionlib->getSTG_isEntitledFor('admin') ?: [];
|
||||
$allowedStgs = array_merge($allowedStgs, $this->permissionlib->getSTG_isEntitledFor('assistenz') ?: []);
|
||||
$this->allowedStgs = $this->permissionlib->getSTG_isEntitledFor('admin') ?: [];
|
||||
$this->allowedStgs = array_merge($this->allowedStgs, $this->permissionlib->getSTG_isEntitledFor('assistenz') ?: []);
|
||||
|
||||
if (!$allowedStgs) {
|
||||
if (!$this->allowedStgs) {
|
||||
$this->_outputAuthError([$router->method => ['admin:r', 'assistenz:r']]);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('PhrasesLib');
|
||||
$this->load->library('stv/StudentListLib', ['allowedStgs' => $allowedStgs]);
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'lehre'
|
||||
@@ -109,19 +111,23 @@ class Students extends FHCAPI_Controller
|
||||
]);
|
||||
|
||||
|
||||
$this->studentlistlib->addJoin(
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
|
||||
$this->PrestudentModel->addJoin(
|
||||
"(
|
||||
SELECT prestudent_id
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE status_kurzbz = 'Incoming'
|
||||
AND studiensemester_kurzbz = " . $this->PrestudentModel->escape($studiensemester_kurzbz) . "
|
||||
) test",
|
||||
"prestudent_id",
|
||||
"",
|
||||
"start"
|
||||
"prestudent_id"
|
||||
);
|
||||
|
||||
$this->studentlistlib->addSelect("COALESCE(
|
||||
|
||||
$this->prepareQuery($studiensemester_kurzbz);
|
||||
|
||||
$this->PrestudentModel->addSelect("COALESCE(
|
||||
v.semester::text,
|
||||
CASE
|
||||
WHEN pls.status_kurzbz IN ('Aufgenommener', 'Bewerber', 'Wartender', 'interessent')
|
||||
@@ -129,13 +135,16 @@ class Students extends FHCAPI_Controller
|
||||
ELSE ''::text
|
||||
END
|
||||
) AS semester", false);
|
||||
$this->studentlistlib->addSelect("COALESCE(v.verband::text, ''::text) AS verband");
|
||||
$this->studentlistlib->addSelect("COALESCE(v.gruppe::text, ''::text) AS gruppe");
|
||||
|
||||
$this->PrestudentModel->addSelect("COALESCE(v.verband::text, ''::text)");
|
||||
$this->PrestudentModel->addSelect("COALESCE(v.gruppe::text, ''::text)");
|
||||
|
||||
$this->addSelectPrioRel();
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->PrestudentModel->load();
|
||||
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -155,7 +164,10 @@ class Students extends FHCAPI_Controller
|
||||
]);
|
||||
|
||||
|
||||
$this->studentlistlib->addJoin(
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
|
||||
$this->PrestudentModel->addJoin(
|
||||
"(
|
||||
SELECT prestudent_id
|
||||
FROM bis.tbl_bisio bis
|
||||
@@ -175,12 +187,14 @@ class Students extends FHCAPI_Controller
|
||||
) AND stdsem.studiensemester_kurzbz = " . $this->PrestudentModel->escape($studiensemester_kurzbz) . "
|
||||
GROUP BY prestudent_id
|
||||
) test",
|
||||
"prestudent_id",
|
||||
"",
|
||||
"start"
|
||||
"prestudent_id"
|
||||
);
|
||||
|
||||
$this->studentlistlib->addSelect("COALESCE(
|
||||
|
||||
$this->prepareQuery($studiensemester_kurzbz);
|
||||
|
||||
|
||||
$this->PrestudentModel->addSelect("COALESCE(
|
||||
v.semester::text,
|
||||
CASE
|
||||
WHEN pls.status_kurzbz IN ('Aufgenommener', 'Bewerber', 'Wartender', 'interessent')
|
||||
@@ -188,13 +202,16 @@ class Students extends FHCAPI_Controller
|
||||
ELSE ''::text
|
||||
END
|
||||
) AS semester", false);
|
||||
$this->studentlistlib->addSelect("COALESCE(v.verband::text, ''::text) AS verband");
|
||||
$this->studentlistlib->addSelect("COALESCE(v.gruppe::text, ''::text) AS gruppe");
|
||||
$this->PrestudentModel->addSelect("COALESCE(v.verband::text, ''::text)");
|
||||
$this->PrestudentModel->addSelect("COALESCE(v.gruppe::text, ''::text)");
|
||||
|
||||
$this->addSelectPrioRel();
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->PrestudentModel->load();
|
||||
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -214,18 +231,23 @@ class Students extends FHCAPI_Controller
|
||||
]);
|
||||
|
||||
|
||||
$this->studentlistlib->addJoin(
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
|
||||
$this->PrestudentModel->addJoin(
|
||||
"(
|
||||
SELECT prestudent_id
|
||||
FROM bis.tbl_mobilitaet
|
||||
WHERE studiensemester_kurzbz = " . $this->PrestudentModel->escape($studiensemester_kurzbz) . "
|
||||
) bis",
|
||||
"prestudent_id",
|
||||
"",
|
||||
"start"
|
||||
"prestudent_id"
|
||||
);
|
||||
|
||||
$this->studentlistlib->addSelect("COALESCE(
|
||||
|
||||
$this->prepareQuery($studiensemester_kurzbz);
|
||||
|
||||
|
||||
$this->PrestudentModel->addSelect("COALESCE(
|
||||
v.semester::text,
|
||||
CASE
|
||||
WHEN pls.status_kurzbz IN ('Aufgenommener', 'Bewerber', 'Wartender', 'interessent')
|
||||
@@ -233,13 +255,16 @@ class Students extends FHCAPI_Controller
|
||||
ELSE ''::text
|
||||
END
|
||||
) AS semester", false);
|
||||
$this->studentlistlib->addSelect("COALESCE(v.verband::text, ''::text) AS verband");
|
||||
$this->studentlistlib->addSelect("COALESCE(v.gruppe::text, ''::text) AS gruppe");
|
||||
$this->PrestudentModel->addSelect("COALESCE(v.verband::text, ''::text)");
|
||||
$this->PrestudentModel->addSelect("COALESCE(v.gruppe::text, ''::text)");
|
||||
|
||||
$this->addSelectPrioRel();
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->PrestudentModel->load();
|
||||
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -288,6 +313,8 @@ class Students extends FHCAPI_Controller
|
||||
*/
|
||||
protected function fetchPrestudents($studiengang_kz, $studiensemester_kurzbz = null, $filter = null, $orgform_kurzbz = null)
|
||||
{
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$stdsemEsc = $studiensemester_kurzbz ? $this->PrestudentModel->escape($studiensemester_kurzbz) : 'NULL';
|
||||
|
||||
$selectRT = "
|
||||
@@ -304,38 +331,38 @@ class Students extends FHCAPI_Controller
|
||||
AND r.studiensemester_kurzbz=" . $stdsemEsc;
|
||||
|
||||
|
||||
$this->studentlistlib->addWhere('tbl_prestudent.studiengang_kz', $studiengang_kz);
|
||||
$where = ['tbl_prestudent.studiengang_kz' => $studiengang_kz];
|
||||
|
||||
if ($orgform_kurzbz) {
|
||||
$this->studentlistlib->addWhere('ps.orgform_kurzbz', $orgform_kurzbz);
|
||||
$where['ps.orgform_kurzbz'] = $orgform_kurzbz;
|
||||
}
|
||||
|
||||
switch ($filter) {
|
||||
case "interessenten":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Interessent');
|
||||
$where['ps.status_kurzbz'] = 'Interessent';
|
||||
break;
|
||||
case "bewerbungnichtabgeschickt":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Interessent');
|
||||
$this->studentlistlib->addWhere('ps.bewerbung_abgeschicktamum IS NULL');
|
||||
$where['ps.status_kurzbz'] = 'Interessent';
|
||||
$where['ps.bewerbung_abgeschicktamum'] = null;
|
||||
break;
|
||||
case "bewerbungabgeschickt":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Interessent');
|
||||
$this->studentlistlib->addWhere('ps.bewerbung_abgeschicktamum IS NOT NULL');
|
||||
$this->studentlistlib->addWhere('ps.bestaetigtam IS NULL');
|
||||
$where['ps.status_kurzbz'] = 'Interessent';
|
||||
$where['ps.bewerbung_abgeschicktamum IS NOT NULL'] = null;
|
||||
$where['ps.bestaetigtam'] = null;
|
||||
break;
|
||||
case "statusbestaetigt":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Interessent');
|
||||
$this->studentlistlib->addWhere('ps.bestaetigtam IS NOT NULL');
|
||||
$where['ps.status_kurzbz'] = 'Interessent';
|
||||
$where['ps.bestaetigtam IS NOT NULL'] = null;
|
||||
break;
|
||||
case "statusbestaetigtrtnichtangemeldet":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Interessent');
|
||||
$this->studentlistlib->addWhere('ps.bestaetigtam IS NOT NULL');
|
||||
$this->studentlistlib->addWhere('NOT EXISTS(' . $selectRT . ')', null, false);
|
||||
$where['ps.status_kurzbz'] = 'Interessent';
|
||||
$where['ps.bestaetigtam IS NOT NULL'] = null;
|
||||
$this->PrestudentModel->db->where('NOT EXISTS(' . $selectRT . ')', null, false);
|
||||
break;
|
||||
case "statusbestaetigtrtangemeldet":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Interessent');
|
||||
$this->studentlistlib->addWhere('ps.bestaetigtam IS NOT NULL');
|
||||
$this->studentlistlib->addWhere('EXISTS(' . $selectRT . ')', null, false);
|
||||
$where['ps.status_kurzbz'] = 'Interessent';
|
||||
$where['ps.bestaetigtam IS NOT NULL'] = null;
|
||||
$this->PrestudentModel->db->where('EXISTS(' . $selectRT . ')', null, false);
|
||||
break;
|
||||
case "zgv":
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
@@ -347,69 +374,69 @@ class Students extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess([]);
|
||||
$stg = current($stg);
|
||||
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Interessent');
|
||||
$where['ps.status_kurzbz'] = 'Interessent';
|
||||
|
||||
if ($stg->typ == 'm') {
|
||||
$this->studentlistlib->addWhere('zgvmas_code IS NOT NULL');
|
||||
$where['zgvmas_code IS NOT NULL'] = null;
|
||||
if (defined('ZGV_ERFUELLT_ANZEIGEN') && ZGV_ERFUELLT_ANZEIGEN)
|
||||
$this->studentlistlib->addWhere('zgvmas_erfuellt', true);
|
||||
$where['zgvmas_erfuellt'] = true;
|
||||
} elseif ($stg->typ == 'p') {
|
||||
$this->studentlistlib->addWhere('zgvdoktor_code IS NOT NULL');
|
||||
$where['zgvdoktor_code IS NOT NULL'] = null;
|
||||
if (defined('ZGV_DOKTOR_ANZEIGEN') && ZGV_DOKTOR_ANZEIGEN)
|
||||
$this->studentlistlib->addWhere('zgvdoktor_erfuellt', true);
|
||||
$where['zgvdoktor_erfuellt'] = true;
|
||||
} else {
|
||||
$this->studentlistlib->addWhere('zgv_code IS NOT NULL');
|
||||
$where['zgv_code IS NOT NULL'] = null;
|
||||
if (defined('ZGV_ERFUELLT_ANZEIGEN') && ZGV_ERFUELLT_ANZEIGEN)
|
||||
$this->studentlistlib->addWhere('zgv_erfuellt', true);
|
||||
$where['zgv_erfuellt'] = true;
|
||||
}
|
||||
break;
|
||||
case "reihungstestangemeldet":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Interessent');
|
||||
$this->studentlistlib->addWhere('EXISTS(' . $selectRT . ')', null, false);
|
||||
$where['ps.status_kurzbz'] = 'Interessent';
|
||||
$this->PrestudentModel->db->where('EXISTS(' . $selectRT . ')', null, false);
|
||||
break;
|
||||
case "reihungstestnichtangemeldet":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Interessent');
|
||||
$this->studentlistlib->addWhere('NOT EXISTS(' . $selectRT . ')', null, false);
|
||||
$where['ps.status_kurzbz'] = 'Interessent';
|
||||
$this->PrestudentModel->db->where('NOT EXISTS(' . $selectRT . ')', null, false);
|
||||
break;
|
||||
case "bewerber":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Bewerber');
|
||||
$where['ps.status_kurzbz'] = 'Bewerber';
|
||||
break;
|
||||
case "bewerberrtnichtangemeldet":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Bewerber');
|
||||
$this->studentlistlib->addWhere('NOT EXISTS(' . $selectRT . ')', null, false);
|
||||
$where['ps.status_kurzbz'] = 'Bewerber';
|
||||
$this->PrestudentModel->db->where('NOT EXISTS(' . $selectRT . ')', null, false);
|
||||
break;
|
||||
case "bewerberrtangemeldet":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Bewerber');
|
||||
$this->studentlistlib->addWhere('EXISTS(' . $selectRT . ')', null, false);
|
||||
$where['ps.status_kurzbz'] = 'Bewerber';
|
||||
$this->PrestudentModel->db->where('EXISTS(' . $selectRT . ')', null, false);
|
||||
break;
|
||||
case "bewerberrtangemeldetteilgenommen":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Bewerber');
|
||||
$this->studentlistlib->addWhere('EXISTS(' . $selectRT . ')', null, false);
|
||||
$this->studentlistlib->addWhere('reihungstestangetreten', true);
|
||||
$where['ps.status_kurzbz'] = 'Bewerber';
|
||||
$this->PrestudentModel->db->where('EXISTS(' . $selectRT . ')', null, false);
|
||||
$where['reihungstestangetreten'] = true;
|
||||
break;
|
||||
case "bewerberrtangemeldetnichtteilgenommen":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Bewerber');
|
||||
$this->studentlistlib->addWhere('EXISTS(' . $selectRT . ')', null, false);
|
||||
$this->studentlistlib->addWhere('reihungstestangetreten', false);
|
||||
$where['ps.status_kurzbz'] = 'Bewerber';
|
||||
$this->PrestudentModel->db->where('EXISTS(' . $selectRT . ')', null, false);
|
||||
$where['reihungstestangetreten'] = false;
|
||||
break;
|
||||
case "aufgenommen":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Aufgenommener');
|
||||
$where['ps.status_kurzbz'] = 'Aufgenommener';
|
||||
break;
|
||||
case "warteliste":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Wartender');
|
||||
$where['ps.status_kurzbz'] = 'Wartender';
|
||||
break;
|
||||
case "absage":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Abgewiesener');
|
||||
$where['ps.status_kurzbz'] = 'Abgewiesener';
|
||||
break;
|
||||
case "incoming":
|
||||
// NOTE(chris): in FAS it was not filtered for studiengang_kz
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Incoming');
|
||||
$where['ps.status_kurzbz'] = 'Incoming';
|
||||
break;
|
||||
case "absolvent":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Absolvent');
|
||||
$where['ps.status_kurzbz'] = 'Absolvent';
|
||||
break;
|
||||
case "diplomand":
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', 'Diplomand');
|
||||
$where['ps.status_kurzbz'] = 'Diplomand';
|
||||
break;
|
||||
default:
|
||||
if (!$studiensemester_kurzbz) {
|
||||
@@ -417,9 +444,9 @@ class Students extends FHCAPI_Controller
|
||||
* show all prestudents in this stg who don't have a status
|
||||
* $orgform_kurzbz does not change the results since orgform is stored in the status table
|
||||
*/
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz IS NULL');
|
||||
$where['ps.status_kurzbz'] = null;
|
||||
} else {
|
||||
$this->studentlistlib->addWhere('ps.status_kurzbz', [
|
||||
$this->PrestudentModel->db->where_in('ps.status_kurzbz', [
|
||||
'Interessent',
|
||||
'Bewerber',
|
||||
'Aufgenommener',
|
||||
@@ -430,19 +457,21 @@ class Students extends FHCAPI_Controller
|
||||
break;
|
||||
}
|
||||
|
||||
$this->studentlistlib->addSelect("
|
||||
$this->prepareQuery($studiensemester_kurzbz);
|
||||
|
||||
$this->PrestudentModel->addSelect("
|
||||
CASE
|
||||
WHEN pls.status_kurzbz IN ('Aufgenommener', 'Bewerber', 'Wartender', 'interessent')
|
||||
THEN ps.ausbildungssemester::text
|
||||
ELSE ''::text
|
||||
END AS semester", false);
|
||||
$this->studentlistlib->addSelect("'' AS verband");
|
||||
$this->studentlistlib->addSelect("'' AS gruppe");
|
||||
|
||||
$this->PrestudentModel->addSelect("'' AS verband");
|
||||
$this->PrestudentModel->addSelect("'' AS gruppe");
|
||||
$this->addSelectPrioRel();
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
$result = $this->PrestudentModel->loadWhere($where);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -545,6 +574,7 @@ class Students extends FHCAPI_Controller
|
||||
$gruppe_kurzbz = null,
|
||||
$orgform_kurzbz = null
|
||||
) {
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
if (!$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
@@ -552,29 +582,34 @@ class Students extends FHCAPI_Controller
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
// NOTE(chris): overwrite 'LEFT JOIN' with 'JOIN'
|
||||
$this->studentlistlib->addJoin("public.tbl_student s", "prestudent_id");
|
||||
$this->prepareQuery($studiensemester_kurzbz, '');
|
||||
|
||||
$this->studentlistlib->addSelect("'' AS priorisierung_relativ");
|
||||
$this->PrestudentModel->addSelect('v.semester');
|
||||
$this->PrestudentModel->addSelect('v.verband');
|
||||
$this->PrestudentModel->addSelect('v.gruppe');
|
||||
$this->PrestudentModel->addSelect("'' AS priorisierung_relativ");
|
||||
|
||||
|
||||
$where = [];
|
||||
|
||||
if ($gruppe_kurzbz !== null) {
|
||||
$this->studentlistlib->addJoin('public.tbl_benutzergruppe g', 'uid', '', 'after_b');
|
||||
$this->studentlistlib->addWhere('g.gruppe_kurzbz', $gruppe_kurzbz);
|
||||
$this->studentlistlib->addWhere('g.studiensemester_kurzbz', $studiensemester_kurzbz);
|
||||
$this->PrestudentModel->addJoin('public.tbl_benutzergruppe g', 'uid');
|
||||
$where['g.gruppe_kurzbz'] = $gruppe_kurzbz;
|
||||
$where['g.studiensemester_kurzbz'] = $studiensemester_kurzbz;
|
||||
} else {
|
||||
$this->studentlistlib->addWhere('v.studiengang_kz', $studiengang_kz);
|
||||
$where['v.studiengang_kz'] = $studiengang_kz;
|
||||
|
||||
if ($semester !== null)
|
||||
$this->studentlistlib->addWhere('v.semester', $semester);
|
||||
$where['v.semester'] = $semester;
|
||||
|
||||
if ($verband !== null)
|
||||
$this->studentlistlib->addWhere('v.verband', $verband);
|
||||
$where['v.verband'] = $verband;
|
||||
|
||||
if ($gruppe !== null)
|
||||
$this->studentlistlib->addWhere('v.gruppe', $gruppe);
|
||||
$where['v.gruppe'] = $gruppe;
|
||||
|
||||
if (!$verband && !$gruppe && $orgform_kurzbz !== null) {
|
||||
$this->studentlistlib->addWhere(
|
||||
$this->PrestudentModel->db->where(
|
||||
"(
|
||||
SELECT orgform_kurzbz
|
||||
FROM public.tbl_prestudentstatus
|
||||
@@ -588,10 +623,9 @@ class Students extends FHCAPI_Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
$result = $this->PrestudentModel->loadWhere($where);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -618,8 +652,11 @@ class Students extends FHCAPI_Controller
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
|
||||
$this->studentlistlib->addSelect("COALESCE(
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->prepareQuery($studiensemester_kurzbz);
|
||||
|
||||
$this->PrestudentModel->addSelect("COALESCE(
|
||||
v.semester::text,
|
||||
CASE
|
||||
WHEN pls.status_kurzbz IN ('Aufgenommener', 'Bewerber', 'Wartender', 'interessent')
|
||||
@@ -627,15 +664,16 @@ class Students extends FHCAPI_Controller
|
||||
ELSE ''::text
|
||||
END
|
||||
) AS semester", false);
|
||||
$this->studentlistlib->addSelect("COALESCE(v.verband::text, ''::text) AS verband");
|
||||
$this->studentlistlib->addSelect("COALESCE(v.gruppe::text, ''::text) AS gruppe");
|
||||
|
||||
$this->studentlistlib->addWhere('tbl_prestudent.prestudent_id', $prestudent_id);
|
||||
$this->PrestudentModel->addSelect("COALESCE(v.verband::text, ''::text)");
|
||||
$this->PrestudentModel->addSelect("COALESCE(v.gruppe::text, ''::text)");
|
||||
|
||||
$this->addSelectPrioRel();
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
$result = $this->PrestudentModel->loadWhere([
|
||||
'tbl_prestudent.prestudent_id' => $prestudent_id
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -662,13 +700,23 @@ class Students extends FHCAPI_Controller
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->prepareQuery($studiensemester_kurzbz);
|
||||
|
||||
$this->PrestudentModel->addSelect('v.semester');
|
||||
$this->PrestudentModel->addSelect('v.verband');
|
||||
$this->PrestudentModel->addSelect('v.gruppe');
|
||||
|
||||
$this->addSelectPrioRel();
|
||||
|
||||
|
||||
$this->studentlistlib->addWhere('s.student_uid', $student_uid);
|
||||
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
$result = $this->PrestudentModel->loadWhere([
|
||||
's.student_uid' => $student_uid
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -696,13 +744,21 @@ class Students extends FHCAPI_Controller
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->studentlistlib->addWhere('p.person_id', $person_id);
|
||||
$this->prepareQuery($studiensemester_kurzbz);
|
||||
|
||||
$this->PrestudentModel->addSelect('v.semester');
|
||||
$this->PrestudentModel->addSelect('v.verband');
|
||||
$this->PrestudentModel->addSelect('v.gruppe');
|
||||
|
||||
$this->addSelectPrioRel();
|
||||
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
$result = $this->PrestudentModel->loadWhere([
|
||||
'p.person_id' => $person_id
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
@@ -734,8 +790,29 @@ class Students extends FHCAPI_Controller
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->prepareQuery($studiensemester_kurzbz);
|
||||
|
||||
$this->PrestudentModel->addSelect("COALESCE(v.semester::text, CASE WHEN public.get_rolle_prestudent(tbl_prestudent.prestudent_id, NULL) IN ('Aufgenommener', 'Bewerber', 'Wartender', 'interessent') THEN public.get_absem_prestudent(tbl_prestudent.prestudent_id, NULL)::text ELSE ''::text END) AS semester", false);
|
||||
$this->PrestudentModel->addSelect('v.verband');
|
||||
$this->PrestudentModel->addSelect('v.gruppe');
|
||||
|
||||
//add status per semester
|
||||
$this->PrestudentModel->addSelect(
|
||||
"public.get_rolle_prestudent(public.tbl_prestudent.prestudent_id, "
|
||||
. $this->PrestudentModel->escape($studiensemester_kurzbz)
|
||||
. ") AS statusofsemester"
|
||||
);
|
||||
|
||||
$this->addSelectPrioRel();
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$prestudent_ids = [];
|
||||
$student_uids = [];
|
||||
$this->addMeta('data', $data);
|
||||
foreach ($data as $row) {
|
||||
$dataset = json_decode($row->data);
|
||||
if ($row->type == 'prestudent') {
|
||||
@@ -745,38 +822,197 @@ class Students extends FHCAPI_Controller
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$this->studentlistlib->addSelect("COALESCE(
|
||||
v.semester::text,
|
||||
CASE
|
||||
WHEN public.get_rolle_prestudent(tbl_prestudent.prestudent_id, NULL) IN ('Aufgenommener', 'Bewerber', 'Wartender', 'interessent')
|
||||
THEN public.get_absem_prestudent(tbl_prestudent.prestudent_id, NULL)::text
|
||||
ELSE ''::text
|
||||
END
|
||||
) AS semester", false);
|
||||
|
||||
|
||||
if ($prestudent_ids && $student_uids) {
|
||||
$this->studentlistlib->addWhere('tbl_prestudent.prestudent_id', $prestudent_ids);
|
||||
$this->studentlistlib->addOrWhere('s.student_uid', $student_uids);
|
||||
$this->PrestudentModel->db->where_in('tbl_prestudent.prestudent_id', $prestudent_ids);
|
||||
$this->PrestudentModel->db->or_where_in('s.student_uid', $student_uids);
|
||||
} elseif ($prestudent_ids) {
|
||||
$this->studentlistlib->addWhere('tbl_prestudent.prestudent_id', $prestudent_ids);
|
||||
$this->PrestudentModel->db->where_in('tbl_prestudent.prestudent_id', $prestudent_ids);
|
||||
} elseif ($student_uids) {
|
||||
$this->studentlistlib->addWhere('s.student_uid', $student_uids);
|
||||
$this->PrestudentModel->db->where_in('s.student_uid', $student_uids);
|
||||
} else {
|
||||
$this->terminateWithSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->studentlistlib->execute($studiensemester_kurzbz);
|
||||
$result = $this->PrestudentModel->load();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string|null $studiensemester_kurzbz
|
||||
* @param string $type
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function prepareQuery($studiensemester_kurzbz, $type = 'LEFT')
|
||||
{
|
||||
$stdsemEsc = $studiensemester_kurzbz ? $this->PrestudentModel->escape($studiensemester_kurzbz) : 'NULL';
|
||||
|
||||
$this->load->config('stv');
|
||||
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
{
|
||||
$tags = $this->config->item('stv_prestudent_tags');
|
||||
|
||||
$whereTags = '';
|
||||
if (is_array($tags) && !isEmptyArray($tags)) {
|
||||
$tags = array_keys($tags);
|
||||
|
||||
foreach ($tags as $key => $tag) {
|
||||
$tags[$key] = $this->db->escape($tag);
|
||||
}
|
||||
$whereTags = " AND nt.typ_kurzbz IN (" . implode(",", $tags) . ")";
|
||||
}
|
||||
$subQueryTag = "
|
||||
(
|
||||
SELECT
|
||||
tag.prestudent_id,
|
||||
COALESCE(json_agg(tag ORDER BY tag.done), '[]'::json) AS tags
|
||||
FROM (
|
||||
SELECT DISTINCT ON (n.notiz_id)
|
||||
n.notiz_id AS id,
|
||||
nt.typ_kurzbz,
|
||||
array_to_json(nt.bezeichnung_mehrsprachig)->>0 AS beschreibung,
|
||||
n.text AS notiz,
|
||||
nt.style,
|
||||
n.erledigt AS done,
|
||||
nz.prestudent_id
|
||||
FROM public.tbl_notizzuordnung AS nz
|
||||
JOIN public.tbl_notiz AS n ON nz.notiz_id = n.notiz_id
|
||||
JOIN public.tbl_notiz_typ AS nt ON n.typ = nt.typ_kurzbz "
|
||||
. $whereTags .
|
||||
"
|
||||
) AS tag
|
||||
GROUP BY tag.prestudent_id
|
||||
) AS tag_data_agg
|
||||
";
|
||||
}
|
||||
|
||||
$this->PrestudentModel->addJoin('public.tbl_studiengang stg', 'studiengang_kz', 'LEFT');
|
||||
$this->PrestudentModel->addJoin('public.tbl_person p', 'person_id');
|
||||
$this->PrestudentModel->addJoin('public.tbl_student s', 'prestudent_id', $type);
|
||||
$this->PrestudentModel->addJoin('public.tbl_prestudentstatus pls', '
|
||||
pls.status_kurzbz=public.get_rolle_prestudent(tbl_prestudent.prestudent_id, NULL)
|
||||
AND pls.prestudent_id=tbl_prestudent.prestudent_id
|
||||
AND pls.studiensemester_kurzbz=public.get_stdsem_prestudent(tbl_prestudent.prestudent_id, NULL)
|
||||
AND pls.ausbildungssemester=public.get_absem_prestudent(tbl_prestudent.prestudent_id, NULL)', 'LEFT');
|
||||
$this->PrestudentModel->addJoin('lehre.tbl_studienplan sp', 'studienplan_id', 'LEFT');
|
||||
$this->PrestudentModel->addJoin('public.tbl_benutzer b', 's.student_uid=b.uid', 'LEFT');
|
||||
$this->PrestudentModel->addJoin(
|
||||
'public.tbl_studentlehrverband v',
|
||||
'v.student_uid=s.student_uid AND v.studiensemester_kurzbz' . ($studiensemester_kurzbz ? '=' . $stdsemEsc : ' IS NULL'),
|
||||
$type
|
||||
);
|
||||
$this->PrestudentModel->addJoin('public.tbl_prestudentstatus ps', '
|
||||
ps.status_kurzbz=public.get_rolle_prestudent(tbl_prestudent.prestudent_id, ' . $stdsemEsc . ')
|
||||
AND ps.prestudent_id=tbl_prestudent.prestudent_id
|
||||
AND ps.studiensemester_kurzbz=public.get_stdsem_prestudent(tbl_prestudent.prestudent_id, ' . $stdsemEsc . ')
|
||||
AND ps.ausbildungssemester=public.get_absem_prestudent(tbl_prestudent.prestudent_id, ' . $stdsemEsc . ')', 'LEFT');
|
||||
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
{
|
||||
$this->PrestudentModel->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT');
|
||||
}
|
||||
|
||||
|
||||
$this->PrestudentModel->addSelect("b.uid");
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
{
|
||||
$this->PrestudentModel->addSelect('tag_data_agg.tags');
|
||||
}
|
||||
$this->PrestudentModel->addSelect('titelpre');
|
||||
$this->PrestudentModel->addSelect('nachname');
|
||||
$this->PrestudentModel->addSelect('vorname');
|
||||
$this->PrestudentModel->addSelect('wahlname');
|
||||
$this->PrestudentModel->addSelect('vornamen');
|
||||
$this->PrestudentModel->addSelect('titelpost');
|
||||
$this->PrestudentModel->addSelect('ersatzkennzeichen');
|
||||
$this->PrestudentModel->addSelect('gebdatum');
|
||||
$this->PrestudentModel->addSelect('geschlecht');
|
||||
$this->PrestudentModel->addSelect('foto');
|
||||
$this->PrestudentModel->addSelect('foto_sperre');
|
||||
|
||||
// semester
|
||||
// verband
|
||||
// gruppe
|
||||
|
||||
//add status per semester
|
||||
$this->PrestudentModel->addSelect(
|
||||
"public.get_rolle_prestudent(public.tbl_prestudent.prestudent_id, "
|
||||
. $this->PrestudentModel->escape($studiensemester_kurzbz)
|
||||
. ") AS statusofsemester"
|
||||
);
|
||||
|
||||
$this->PrestudentModel->addSelect('UPPER(stg.typ || stg.kurzbz) AS studiengang');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.studiengang_kz');
|
||||
$this->PrestudentModel->addSelect('stg.bezeichnung AS stg_bezeichnung');
|
||||
$this->PrestudentModel->addSelect("s.matrikelnr");
|
||||
$this->PrestudentModel->addSelect('p.person_id');
|
||||
$this->PrestudentModel->addSelect('pls.status_kurzbz AS status');
|
||||
$this->PrestudentModel->addSelect('pls.datum AS status_datum');
|
||||
$this->PrestudentModel->addSelect('pls.bestaetigtam AS status_bestaetigung');
|
||||
$this->PrestudentModel->addSelect(
|
||||
"(SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp='email' AND person_id=p.person_id AND zustellung LIMIT 1) AS mail_privat",
|
||||
false
|
||||
);
|
||||
$this->PrestudentModel->addSelect("
|
||||
CASE WHEN b.uid IS NOT NULL AND b.uid<>''
|
||||
THEN CONCAT(b.uid, '@', " . $this->PrestudentModel->escape(DOMAIN) . ")
|
||||
ELSE '' END AS mail_intern", false);
|
||||
$this->PrestudentModel->addSelect('p.anmerkung AS anmerkungen');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.anmerkung');
|
||||
$this->PrestudentModel->addSelect('pls.orgform_kurzbz');
|
||||
$this->PrestudentModel->addSelect('aufmerksamdurch_kurzbz');
|
||||
$this->PrestudentModel->addSelect(
|
||||
"(SELECT rt_gesamtpunkte AS punkte FROM public.tbl_prestudent WHERE prestudent_id=ps.prestudent_id) AS punkte",
|
||||
false
|
||||
);
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.aufnahmegruppe_kurzbz');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.dual');
|
||||
$this->PrestudentModel->addSelect('p.matr_nr');
|
||||
$this->PrestudentModel->addSelect('sp.bezeichnung AS studienplan_bezeichnung');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.prestudent_id');
|
||||
|
||||
// priorisierung_relativ
|
||||
|
||||
$this->PrestudentModel->addSelect('mentor');
|
||||
$this->PrestudentModel->addSelect('b.aktiv AS bnaktiv');
|
||||
$this->PrestudentModel->addSelect('unruly');
|
||||
|
||||
$this->PrestudentModel->db->where_in('tbl_prestudent.studiengang_kz', $this->allowedStgs);
|
||||
|
||||
$this->PrestudentModel->addOrder('nachname');
|
||||
$this->PrestudentModel->addOrder('vorname');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function addSelectPrioRel()
|
||||
{
|
||||
$this->PrestudentModel->addSelect("(
|
||||
SELECT count(*)
|
||||
FROM (
|
||||
SELECT *, public.get_rolle_prestudent(pss.prestudent_id, NULL) AS laststatus
|
||||
FROM public.tbl_prestudent pss
|
||||
JOIN public.tbl_prestudentstatus USING (prestudent_id)
|
||||
WHERE person_id = p.person_id
|
||||
AND studiensemester_kurzbz = (
|
||||
SELECT studiensemester_kurzbz
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id = tbl_prestudent.prestudent_id
|
||||
AND status_kurzbz = 'Interessent'
|
||||
LIMIT 1
|
||||
)
|
||||
AND status_kurzbz = 'Interessent'
|
||||
) prest
|
||||
WHERE laststatus NOT IN ('Abbrecher', 'Abgewiesener', 'Absolvent')
|
||||
AND priorisierung <= tbl_prestudent.priorisierung
|
||||
) || ' (' || COALESCE(tbl_prestudent.priorisierung::text, ' '::text) || ')' AS priorisierung_relativ", false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds additional filters to the query
|
||||
*
|
||||
|
||||
@@ -154,6 +154,11 @@ class FHCAPI_Controller extends Auth_Controller
|
||||
$this->returnObj['meta'][$key] = $value;
|
||||
}
|
||||
|
||||
public function addTabulatorPaginationData($lastPage = 1)
|
||||
{
|
||||
$this->returnObj['last_page'] = $lastPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @return mixed
|
||||
|
||||
@@ -417,7 +417,6 @@ abstract class Notiz_Controller extends FHCAPI_Controller
|
||||
$notiz_id = $this->input->post('notiz_id');
|
||||
|
||||
$this->NotizModel->addSelect('campus.tbl_dms_version.*');
|
||||
$this->NotizModel->addSelect($this->NotizModel->escape(base_url('content/notizdokdownload.php?id=')) . ' || public.tbl_notiz_dokument.dms_id AS preview');
|
||||
|
||||
$this->NotizModel->addJoin('public.tbl_notiz_dokument', 'ON (public.tbl_notiz_dokument.notiz_id = public.tbl_notiz.notiz_id)');
|
||||
$this->NotizModel->addJoin('campus.tbl_dms_version', 'ON (public.tbl_notiz_dokument.dms_id = campus.tbl_dms_version.dms_id)');
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-Helper
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2022 fhcomplete.net
|
||||
* @license GPLv3
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class CustomFormValidationLib extends CI_Form_validation
|
||||
{
|
||||
public function __construct($rules = array())
|
||||
{
|
||||
parent::__construct($rules);
|
||||
|
||||
$this->_ci =& get_instance();
|
||||
}
|
||||
|
||||
function explicit_integer($value)
|
||||
{
|
||||
if ($value === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($value === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (filter_var($value, FILTER_VALIDATE_INT) !== false) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function explicit_numeric($value)
|
||||
{
|
||||
if ($value === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($value === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (is_numeric($value)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function explicit_boolean($value)
|
||||
{
|
||||
if ($value === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($value === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($value === 'true' || $value === 'false' || $value === true || $value === false || $value === 1 || $value === 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function does_exist($value, $params)
|
||||
{
|
||||
if ($value === null ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($value === '') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$parts = explode('.', $params);
|
||||
if (count($parts) !== 3) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$subDatabase = $parts[0];
|
||||
$table = $parts[1];
|
||||
$field = $parts[2];
|
||||
|
||||
$result = $this->_ci->db->select('COUNT(*) as count')
|
||||
->from("$subDatabase.$table")
|
||||
->where($field, $value)
|
||||
->get();
|
||||
|
||||
if ($result === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $result->row()->count > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class RoomRequest
|
||||
{
|
||||
protected $_ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->library('CustomFormValidationLib');
|
||||
}
|
||||
|
||||
public function validate($method = 'create')
|
||||
{
|
||||
if ($method === 'create') {
|
||||
$this->_ci->customformvalidationlib->set_rules('ort_kurzbz', 'kurzbezeichnung', 'required|is_unique[tbl_ort.ort_kurzbz]|max_length[16]|regex_match[/^[a-zA-Z0-9_.]+$/]', [
|
||||
'required' => $this->_ci->p->t('ui', 'error_fieldRequired', ['field' => $this->_ci->p->t('gruppenmanagement', 'kurzbezeichnung')]),
|
||||
'is_unique' => $this->_ci->p->t('ui', 'error_fieldUnique', ['field' => $this->_ci->p->t('gruppenmanagement', 'kurzbezeichnung')]),
|
||||
'max_length' => $this->_ci->p->t('ui', 'error_fieldMaxLength', ['field' => $this->_ci->p->t('gruppenmanagement', 'kurzbezeichnung'), 'max' => 16]),
|
||||
'regex_match' => $this->_ci->p->t('ui', 'error_fieldInvalidFormat', ['field' => $this->_ci->p->t('gruppenmanagement', 'kurzbezeichnung')])
|
||||
]);
|
||||
}
|
||||
|
||||
$this->_ci->customformvalidationlib->set_rules('parent_ort_kurzbz', 'parent_ort_kurzbz', 'does_exist[public.tbl_ort.ort_kurzbz]|max_length[16]', [
|
||||
'does_exist' => $this->_ci->p->t('ui', 'error_entryDoesExists', ['entry' => $this->_ci->p->t('ui', 'parentRoom')]),
|
||||
'max_length' => $this->_ci->p->t('ui', 'error_fieldMaxLength', ['field' => $this->_ci->p->t('ui', 'parentRoom'), 'max' => 16])
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('oe_kurzbz', 'oe_kurzbz', 'does_exist[public.tbl_organisationseinheit.oe_kurzbz]|max_length[32]', [
|
||||
'does_exist' => $this->_ci->p->t('ui', 'error_entryDoesExists', ['entry' => $this->_ci->p->t('lehre', 'organisationseinheit')]),
|
||||
'max_length' => $this->_ci->p->t('ui', 'error_fieldMaxLength', ['field' => $this->_ci->p->t('lehre', 'organisationseinheit'), 'max' => 32])
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('standort_id', 'standort_id', 'explicit_integer|does_exist[public.tbl_standort.standort_id]', [
|
||||
'does_exist' => $this->_ci->p->t('ui', 'error_entryDoesExists', ['entry' => $this->_ci->p->t('person', 'standort')]),
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('content_id', 'content_id', 'explicit_integer|does_exist[campus.tbl_content.content_id]', [
|
||||
'explicit_integer' => $this->_ci->p->t('ui', 'error_fieldInteger', ['field' => $this->_ci->p->t('ui', 'contentId')]),
|
||||
'does_exist' => $this->_ci->p->t('ui', 'error_entryDoesExists', ['entry' => $this->_ci->p->t('ui', 'contentId')])
|
||||
]);
|
||||
|
||||
$this->_ci->customformvalidationlib->set_rules('lehre', 'lehre', 'explicit_boolean', [
|
||||
'explicit_boolean' => $this->_ci->p->t('ui', 'error_fieldBoolean', ['field' => $this->_ci->p->t('ui', 'lehre')])
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('reservieren', 'reservieren', 'explicit_boolean', [
|
||||
'explicit_boolean' => $this->_ci->p->t('ui', 'error_fieldBoolean', ['field' => $this->_ci->p->t('ui', 'reservieren')])
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('aktiv', 'aktiv', 'explicit_boolean', [
|
||||
'explicit_boolean' => $this->_ci->p->t('ui', 'error_fieldBoolean', ['field' => $this->_ci->p->t('person', 'aktiv')])
|
||||
]);
|
||||
|
||||
$this->_ci->customformvalidationlib->set_rules('bezeichnung', 'bezeichnung', 'max_length[64]', [
|
||||
'max_length' => $this->_ci->p->t('ui', 'error_fieldMaxLength', ['field' => $this->_ci->p->t('ui', 'bezeichnung'), 'max' => 64])
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('planbezeichnung', 'planbezeichnung', 'max_length[8]', [
|
||||
'max_length' => $this->_ci->p->t('ui', 'error_fieldMaxLength', ['field' => $this->_ci->p->t('ui', 'planbezeichnung'), 'max' => 8])
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('max_person', 'maxPerson', 'explicit_integer', [
|
||||
'explicit_integer' => $this->_ci->p->t('ui', 'error_fieldInteger', ['field' => $this->_ci->p->t('ui', 'maxPersons')])
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('stockwerk', 'stockwerk', 'explicit_integer', [
|
||||
'explicit_integer' => $this->_ci->p->t('ui', 'error_fieldInteger', ['field' => $this->_ci->p->t('ui', 'stockwerk')])
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('m2', 'm2', 'explicit_numeric', [
|
||||
'explicit_numeric' => $this->_ci->p->t('ui', 'error_fieldNumeric', ['field' => $this->_ci->p->t('ui', 'quadratmeter')])
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('dislozierung', 'dislozierung', 'explicit_numeric', [
|
||||
'explicit_numeric' => $this->_ci->p->t('ui', 'error_fieldNumeric', ['field' => $this->_ci->p->t('ui', 'dislozierung')])
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('kosten', 'kosten', 'explicit_numeric', [
|
||||
'explicit_numeric' => $this->_ci->p->t('ui', 'error_fieldNumeric', ['field' => $this->_ci->p->t('ui', 'kosten')])
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('telefonklappe', 'telefonklappe', 'max_length[8]', [
|
||||
'max_length' => $this->_ci->p->t('ui', 'error_fieldMaxLength', ['field' => $this->_ci->p->t('person', 'telefonklappe'), 'max' => 8])
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('gebteil', 'gebteil', 'max_length[32]', [
|
||||
'max_length' => $this->_ci->p->t('ui', 'error_fieldMaxLength', ['field' => $this->_ci->p->t('ui', 'gebaudeteil'), 'max' => 32])
|
||||
]);
|
||||
$this->_ci->customformvalidationlib->set_rules('arbeitsplaetze', 'arbeitsplaetze', 'explicit_integer', [
|
||||
'explicit_integer' => $this->_ci->p->t('ui', 'error_fieldInteger', ['field' => $this->_ci->p->t('ui', 'arbeitsplaetze')])
|
||||
]);
|
||||
|
||||
return $this->_ci->customformvalidationlib->run();
|
||||
}
|
||||
|
||||
public function errors()
|
||||
{
|
||||
return $this->_ci->customformvalidationlib->error_array();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,363 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This generates a list of students and or prestudents used for Studierendenverwaltung
|
||||
*/
|
||||
class StudentListLib
|
||||
{
|
||||
private $_ci; // Code igniter instance
|
||||
|
||||
private $_allowedStgs = [];
|
||||
private $_selects = [];
|
||||
private $_joins = [];
|
||||
|
||||
/**
|
||||
* Gets the CI instance, loads model and prepares default values
|
||||
*
|
||||
* @param array $params
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($params = null)
|
||||
{
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
if (isset($params['allowedStgs']))
|
||||
$this->_allowedStgs = $params['allowedStgs'];
|
||||
|
||||
// Add default SELECTs
|
||||
$this->addSelect("b.uid");
|
||||
if (defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
$this->addSelect('tag_data_agg.tags');
|
||||
$this->addSelect('titelpre');
|
||||
$this->addSelect('nachname');
|
||||
$this->addSelect('vorname');
|
||||
$this->addSelect('wahlname');
|
||||
$this->addSelect('vornamen');
|
||||
$this->addSelect('titelpost');
|
||||
$this->addSelect('ersatzkennzeichen');
|
||||
$this->addSelect('gebdatum');
|
||||
$this->addSelect('geschlecht');
|
||||
$this->addSelect('foto');
|
||||
$this->addSelect('foto_sperre');
|
||||
$this->addSelect('v.semester');
|
||||
$this->addSelect('v.verband');
|
||||
$this->addSelect('v.gruppe');
|
||||
$this->addSelect("statusofsemester"); // Will be replaced later
|
||||
$this->addSelect('UPPER(stg.typ || stg.kurzbz) AS studiengang');
|
||||
$this->addSelect('tbl_prestudent.studiengang_kz');
|
||||
$this->addSelect('stg.bezeichnung AS stg_bezeichnung');
|
||||
$this->addSelect("s.matrikelnr");
|
||||
$this->addSelect('p.person_id');
|
||||
$this->addSelect('pls.status_kurzbz AS status');
|
||||
$this->addSelect('pls.datum AS status_datum');
|
||||
$this->addSelect('pls.bestaetigtam AS status_bestaetigung');
|
||||
$this->addSelect(
|
||||
"(SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp='email' AND person_id=p.person_id AND zustellung LIMIT 1) AS mail_privat",
|
||||
false
|
||||
);
|
||||
$this->addSelect("
|
||||
CASE WHEN b.uid IS NOT NULL AND b.uid<>''
|
||||
THEN CONCAT(b.uid, '@', " . $this->_ci->PrestudentModel->escape(DOMAIN) . ")
|
||||
ELSE '' END AS mail_intern", false);
|
||||
$this->addSelect('p.anmerkung AS anmerkungen');
|
||||
$this->addSelect('tbl_prestudent.anmerkung');
|
||||
$this->addSelect('pls.orgform_kurzbz');
|
||||
$this->addSelect('aufmerksamdurch_kurzbz');
|
||||
$this->addSelect(
|
||||
"(SELECT rt_gesamtpunkte AS punkte FROM public.tbl_prestudent WHERE prestudent_id=ps.prestudent_id) AS punkte",
|
||||
false
|
||||
);
|
||||
$this->addSelect('tbl_prestudent.aufnahmegruppe_kurzbz');
|
||||
$this->addSelect('tbl_prestudent.dual');
|
||||
$this->addSelect('p.matr_nr');
|
||||
$this->addSelect('sp.bezeichnung AS studienplan_bezeichnung');
|
||||
$this->addSelect('tbl_prestudent.prestudent_id');
|
||||
$this->addSelect("(
|
||||
SELECT count(*)
|
||||
FROM (
|
||||
SELECT *, public.get_rolle_prestudent(pss.prestudent_id, NULL) AS laststatus
|
||||
FROM public.tbl_prestudent pss
|
||||
JOIN public.tbl_prestudentstatus USING (prestudent_id)
|
||||
WHERE person_id = p.person_id
|
||||
AND studiensemester_kurzbz = (
|
||||
SELECT studiensemester_kurzbz
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id = tbl_prestudent.prestudent_id
|
||||
AND status_kurzbz = 'Interessent'
|
||||
LIMIT 1
|
||||
)
|
||||
AND status_kurzbz = 'Interessent'
|
||||
) prest
|
||||
WHERE laststatus NOT IN ('Abbrecher', 'Abgewiesener', 'Absolvent')
|
||||
AND priorisierung <= tbl_prestudent.priorisierung
|
||||
) || ' (' || COALESCE(tbl_prestudent.priorisierung::text, ' '::text) || ')' AS priorisierung_relativ", false); // TODO(chris): overwrite in fetchStudents
|
||||
$this->addSelect('mentor');
|
||||
$this->addSelect('b.aktiv AS bnaktiv');
|
||||
$this->addSelect('unruly');
|
||||
|
||||
// Add default JOINs
|
||||
$this->addJoin('public.tbl_studiengang stg', 'studiengang_kz', 'LEFT');
|
||||
$this->addJoin('public.tbl_person p', 'person_id');
|
||||
$this->addJoin('public.tbl_student s', 'prestudent_id', 'LEFT'); // TODO(chris): overwrite in fetchStudents
|
||||
$this->addJoin('public.tbl_prestudentstatus pls', '
|
||||
pls.status_kurzbz=public.get_rolle_prestudent(tbl_prestudent.prestudent_id, NULL)
|
||||
AND pls.prestudent_id=tbl_prestudent.prestudent_id
|
||||
AND pls.studiensemester_kurzbz=public.get_stdsem_prestudent(tbl_prestudent.prestudent_id, NULL)
|
||||
AND pls.ausbildungssemester=public.get_absem_prestudent(tbl_prestudent.prestudent_id, NULL)', 'LEFT');
|
||||
$this->addJoin('lehre.tbl_studienplan sp', 'studienplan_id', 'LEFT');
|
||||
$this->addJoin('public.tbl_benutzer b', 's.student_uid=b.uid', 'LEFT');
|
||||
$this->addJoin("v", "", ""); // Will be replaced later
|
||||
$this->addJoin("ps", "", ""); // Will be replaced later
|
||||
if (defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED) {
|
||||
$this->_ci->load->config('stv');
|
||||
$tags = $this->_ci->config->item('stv_prestudent_tags');
|
||||
|
||||
$whereTags = '';
|
||||
if (is_array($tags) && !isEmptyArray($tags)) {
|
||||
$tags = array_keys($tags);
|
||||
|
||||
foreach ($tags as $key => $tag) {
|
||||
$tags[$key] = $this->_ci->PrestudentModel->escape($tag);
|
||||
}
|
||||
$whereTags = " AND nt.typ_kurzbz IN (" . implode(",", $tags) . ")";
|
||||
}
|
||||
$subQueryTag = "(
|
||||
SELECT
|
||||
tag.prestudent_id,
|
||||
COALESCE(json_agg(tag ORDER BY tag.done), '[]'::json) AS tags
|
||||
FROM (
|
||||
SELECT DISTINCT ON (n.notiz_id)
|
||||
n.notiz_id AS id,
|
||||
nt.typ_kurzbz,
|
||||
array_to_json(nt.bezeichnung_mehrsprachig)->>0 AS beschreibung,
|
||||
n.text AS notiz,
|
||||
nt.style,
|
||||
n.erledigt AS done,
|
||||
nz.prestudent_id
|
||||
FROM public.tbl_notizzuordnung AS nz
|
||||
JOIN public.tbl_notiz AS n ON nz.notiz_id = n.notiz_id
|
||||
JOIN public.tbl_notiz_typ AS nt ON n.typ = nt.typ_kurzbz " . $whereTags . "
|
||||
) AS tag
|
||||
GROUP BY tag.prestudent_id
|
||||
) AS tag_data_agg";
|
||||
|
||||
$this->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT');
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Adds a SELECT statement to the query.
|
||||
*
|
||||
* @param string|array $select
|
||||
* @param boolean $escape (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addSelect($select, $escape = true)
|
||||
{
|
||||
if (is_array($select)) {
|
||||
foreach ($select as $s)
|
||||
$this->addSelect($s, $escape);
|
||||
return;
|
||||
}
|
||||
$alias = $this->getAliasFromSelect($select);
|
||||
$this->_selects[$alias] = [$select, $escape];
|
||||
}
|
||||
|
||||
/**
|
||||
* Joins a table to the query.
|
||||
*
|
||||
* @param string $table
|
||||
* @param string $cond
|
||||
* @param string $type (optional)
|
||||
* @param string $position (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addJoin($table, $cond, $type = '', $position = 'end')
|
||||
{
|
||||
$alias = $this->getAliasFromTable($table);
|
||||
|
||||
if ($position == 'end') {
|
||||
return $this->_joins[$alias] = [$table, $cond, $type];
|
||||
}
|
||||
|
||||
if ($position == 'start') {
|
||||
return $this->_joins = [$alias => [$table, $cond, $type]] + $this->_joins;
|
||||
}
|
||||
|
||||
if (substr($position, 0, 7) == 'before_') {
|
||||
$ref = substr($position, 7);
|
||||
$index = 0;
|
||||
} elseif (substr($position, 0, 6) == 'after_') {
|
||||
$ref = substr($position, 6);
|
||||
$index = 1;
|
||||
} else {
|
||||
return $this->addJoin($table, $cond, $type);
|
||||
}
|
||||
if (!isset($this->_joins[$ref]))
|
||||
return $this->addJoin($table, $cond, $type);
|
||||
|
||||
$key_indeces = array_flip(array_keys($this->_joins));
|
||||
$index += $key_indeces[$ref];
|
||||
|
||||
if (!$index)
|
||||
return $this->addJoin($table, $cond, $type, 'start');
|
||||
|
||||
$front_part = array_slice($this->_joins, 0, $index, true);
|
||||
$back_part = array_slice($this->_joins, $index, null, true);
|
||||
|
||||
if (isset($front_part[$alias])) {
|
||||
unset($front_part[$alias]);
|
||||
}
|
||||
|
||||
$this->_joins = $front_part + [$alias => [$table, $cond, $type]] + $back_part;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a WHERE clause to the query.
|
||||
*
|
||||
* @param string|array $key
|
||||
* @param string|array $value
|
||||
* @param boolean $escape
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addWhere($key, $value = null, $escape = true)
|
||||
{
|
||||
if (!is_array($key) && is_array($value)) {
|
||||
$this->_ci->PrestudentModel->db->where_in($key, $value, $escape);
|
||||
} else {
|
||||
$this->_ci->PrestudentModel->db->where($key, $value, $escape);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a OR WHERE clause to the query.
|
||||
*
|
||||
* @param string|array $key
|
||||
* @param string|array $value
|
||||
* @param boolean $escape
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addOrWhere($key, $value = null, $escape = true)
|
||||
{
|
||||
if (!is_array($key) && is_array($value)) {
|
||||
$this->_ci->PrestudentModel->db->or_where_in($key, $value, $escape);
|
||||
} else {
|
||||
$this->_ci->PrestudentModel->db->or_where($key, $value, $escape);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates the query and executes it.
|
||||
*
|
||||
* @param string|null $studiensemester_kurzbz
|
||||
*
|
||||
* @return stdClass result of the query
|
||||
*/
|
||||
public function execute($studiensemester_kurzbz)
|
||||
{
|
||||
$stdsemEsc = $studiensemester_kurzbz ? $this->_ci->PrestudentModel->escape($studiensemester_kurzbz) : 'NULL';
|
||||
|
||||
|
||||
$this->addSelect(
|
||||
"public.get_rolle_prestudent(
|
||||
public.tbl_prestudent.prestudent_id,
|
||||
" . $this->_ci->PrestudentModel->escape($studiensemester_kurzbz) . "
|
||||
) AS statusofsemester"
|
||||
);
|
||||
$this->addJoin(
|
||||
'public.tbl_studentlehrverband v',
|
||||
'v.student_uid=s.student_uid AND v.studiensemester_kurzbz' . ($studiensemester_kurzbz ? '=' . $stdsemEsc : ' IS NULL'),
|
||||
'LEFT'
|
||||
);
|
||||
$this->addJoin(
|
||||
'public.tbl_prestudentstatus ps',
|
||||
'ps.status_kurzbz=public.get_rolle_prestudent(tbl_prestudent.prestudent_id, ' . $stdsemEsc . ')
|
||||
AND ps.prestudent_id=tbl_prestudent.prestudent_id
|
||||
AND ps.studiensemester_kurzbz=public.get_stdsem_prestudent(tbl_prestudent.prestudent_id, ' . $stdsemEsc . ')
|
||||
AND ps.ausbildungssemester=public.get_absem_prestudent(tbl_prestudent.prestudent_id, ' . $stdsemEsc . ')
|
||||
',
|
||||
'LEFT'
|
||||
);
|
||||
|
||||
$this->addWhere('tbl_prestudent.studiengang_kz', $this->_allowedStgs);
|
||||
|
||||
foreach ($this->_joins as $join)
|
||||
$this->_ci->PrestudentModel->addJoin($join[0], $join[1], $join[2]);
|
||||
|
||||
foreach ($this->_selects as $select)
|
||||
$this->_ci->PrestudentModel->addSelect($select[0], $select[1]);
|
||||
|
||||
$this->_ci->PrestudentModel->addOrder('nachname');
|
||||
$this->_ci->PrestudentModel->addOrder('vorname');
|
||||
|
||||
return $this->_ci->PrestudentModel->load();
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Protected methods
|
||||
|
||||
/**
|
||||
* Get alias of a table or select statement
|
||||
*
|
||||
* @param string $select
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
final protected function getAliasFromSelect($select)
|
||||
{
|
||||
if (strpos($select, ' ') !== false) {
|
||||
return trim(strrchr($select, ' '));
|
||||
}
|
||||
|
||||
if (strpos($select, '.') !== false) {
|
||||
return substr(strrchr($select, '.'), 1);
|
||||
}
|
||||
|
||||
return $select;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get alias of a table or select statement
|
||||
*
|
||||
* @param string|array $table
|
||||
*
|
||||
* @return string|array
|
||||
*/
|
||||
final protected function getAliasFromTable($table)
|
||||
{
|
||||
if (strpos($table, ' ') !== false) {
|
||||
return trim(strrchr($table, ' '));
|
||||
}
|
||||
|
||||
return $table;
|
||||
}
|
||||
}
|
||||
@@ -40,9 +40,7 @@ abstract class AbstractBestandteil implements IValidation
|
||||
|
||||
if( is_bool($new_value) && ($old_value !== $new_value) ) {
|
||||
$this->modifiedcolumns[$columnname] = $columnname;
|
||||
} else if(is_null($old_value) xor is_null($new_value)) {
|
||||
$this->modifiedcolumns[$columnname] = $columnname;
|
||||
} else if($old_value != $new_value) {
|
||||
} else if($old_value != $new_value) {
|
||||
$this->modifiedcolumns[$columnname] = $columnname;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,25 +137,19 @@ EOTXT;
|
||||
return parent::__toString() . $txt;
|
||||
}
|
||||
|
||||
public function validate()
|
||||
/* public function validate()
|
||||
{
|
||||
$value = $this->vordienstzeit;
|
||||
|
||||
if ($value === null || $value === '') {
|
||||
$result = null; // allow null value
|
||||
} else {
|
||||
$result = filter_var($value, FILTER_VALIDATE_INT, [
|
||||
'options' => [
|
||||
'min_range' => 0,
|
||||
'max_range' => 100
|
||||
]
|
||||
]);
|
||||
|
||||
if ($result === false) {
|
||||
$this->validationerrors[] = 'Vordienstjahre muss eine ganze Zahl (0 bis 100) enthalten oder leer sein.';
|
||||
}
|
||||
if( !(filter_var($this->tage, FILTER_VALIDATE_INT,
|
||||
array(
|
||||
'options' => array(
|
||||
'min_range' => 1,
|
||||
'max_range' => 50
|
||||
)
|
||||
)
|
||||
)) ) {
|
||||
$this->validationerrors[] = 'Urlaubsanspruch muss eine Tagesanzahl im Bereich 1 bis 50 sein.';
|
||||
}
|
||||
|
||||
return parent::validate();
|
||||
}
|
||||
} */
|
||||
}
|
||||
|
||||
@@ -35,5 +35,15 @@ class Standort_model extends DB_Model
|
||||
|
||||
return $this->loadWhere(array("firma_id" => $firma_id));
|
||||
}
|
||||
|
||||
public function getByCompanyType($companyType)
|
||||
{
|
||||
$query = "SELECT s.* FROM public.tbl_standort s
|
||||
JOIN public.tbl_firma f ON s.firma_id = f.firma_id
|
||||
JOIN public.tbl_adresse a ON s.adresse_id = a.adresse_id
|
||||
WHERE f.firmentyp_kurzbz = ?;";
|
||||
|
||||
return $this->execReadOnlyQuery($query, [$companyType]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
$includesArray = array(
|
||||
'title' => ucfirst($this->p->t('ui', 'roomManagerPageTitle')),
|
||||
'vue3' => true,
|
||||
'axios027' => true,
|
||||
'bootstrap5' => true,
|
||||
'tabulator5' => true,
|
||||
'fontawesome6' => true,
|
||||
'primevue3' => true,
|
||||
'navigationcomponent' => true,
|
||||
'filtercomponent' => true,
|
||||
'vuedatepicker11' => true,
|
||||
'customJSs' => array(
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
),
|
||||
'customJSModules' => array(
|
||||
'public/js/apps/RoomManagerApp.js'
|
||||
),
|
||||
'customCSSs' => array(
|
||||
'public/css/components/primevue.css',
|
||||
'public/css/components/verticalsplit.css',
|
||||
'public/extensions/FHC-Core-Developer/css/FhcMain.css',
|
||||
'public/css/components/calendar.css',
|
||||
'public/css/components/vue-datepicker.css',
|
||||
'public/css/roomManagerOverview.css'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->view('templates/FHC-Header', $includesArray);
|
||||
?>
|
||||
|
||||
<div id="main">
|
||||
<core-navigation-cmpt></core-navigation-cmpt>
|
||||
<router-view
|
||||
cis-root="<?= CIS_ROOT; ?>"
|
||||
:permissions="<?= htmlspecialchars(json_encode($permissions)); ?>"
|
||||
>
|
||||
</router-view>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer', $includesArray); ?>
|
||||
@@ -315,15 +315,22 @@
|
||||
WHERE tpl.app = '.$APP.'
|
||||
) pl USING(person_id)
|
||||
LEFT JOIN (
|
||||
SELECT DISTINCT ON (tbl_rueckstellung.person_id)
|
||||
SELECT
|
||||
tbl_rueckstellung.person_id,
|
||||
tbl_rueckstellung.datum_bis,
|
||||
tbl_rueckstellung.status_kurzbz,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung
|
||||
FROM public.tbl_rueckstellung
|
||||
JOIN public.tbl_rueckstellung_status USING(status_kurzbz)
|
||||
WHERE tbl_rueckstellung.datum_bis >= NOW()
|
||||
ORDER BY tbl_rueckstellung.person_id, tbl_rueckstellung.datum_bis DESC
|
||||
JOIN public.tbl_person sp ON tbl_rueckstellung.person_id = sp.person_id
|
||||
WHERE tbl_rueckstellung.rueckstellung_id =
|
||||
(
|
||||
SELECT srueck.rueckstellung_id
|
||||
FROM public.tbl_rueckstellung srueck
|
||||
WHERE srueck.person_id = tbl_rueckstellung.person_id
|
||||
AND datum_bis >= NOW()
|
||||
ORDER BY srueck.datum_bis DESC LIMIT 1
|
||||
)
|
||||
) rueck ON rueck.person_id = p.person_id
|
||||
WHERE
|
||||
EXISTS (
|
||||
|
||||
@@ -24,15 +24,22 @@ $query = '
|
||||
WHERE tpl.app = '.$APP.'
|
||||
) pl ON p.person_id = pl.person_id
|
||||
LEFT JOIN (
|
||||
SELECT DISTINCT ON (tbl_rueckstellung.person_id)
|
||||
SELECT
|
||||
tbl_rueckstellung.person_id,
|
||||
tbl_rueckstellung.datum_bis,
|
||||
tbl_rueckstellung.status_kurzbz,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung
|
||||
FROM public.tbl_rueckstellung
|
||||
JOIN public.tbl_rueckstellung_status USING(status_kurzbz)
|
||||
WHERE tbl_rueckstellung.datum_bis >= NOW()
|
||||
ORDER BY tbl_rueckstellung.person_id, tbl_rueckstellung.datum_bis DESC
|
||||
JOIN public.tbl_rueckstellung_status USING(status_kurzbz)
|
||||
JOIN public.tbl_person sp ON tbl_rueckstellung.person_id = sp.person_id
|
||||
WHERE tbl_rueckstellung.rueckstellung_id =
|
||||
(
|
||||
SELECT srueck.rueckstellung_id
|
||||
FROM public.tbl_rueckstellung srueck
|
||||
WHERE srueck.person_id = tbl_rueckstellung.person_id
|
||||
AND datum_bis >= NOW()
|
||||
ORDER BY srueck.datum_bis DESC LIMIT 1
|
||||
)
|
||||
) rueck ON rueck.person_id = p.person_id
|
||||
WHERE p.person_id NOT IN (SELECT person_id FROM public.tbl_prestudent)';
|
||||
|
||||
|
||||
+11
-75
@@ -80,17 +80,9 @@ echo '
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
|
||||
<link rel="stylesheet" href="../../vendor/components/jqueryui/themes/base/jquery-ui.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../vendor/twbs/bootstrap3/dist/css/bootstrap.min.css" type="text/css"/>
|
||||
<link href="../../skin/style.css.php" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.ui-dialog-titlebar-close
|
||||
{
|
||||
visibility: hidden !important;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="../../vendor/components/jquery/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../vendor/components/jqueryui/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="../../vendor/twbs/bootstrap3/dist/js/bootstrap.min.js"></script>
|
||||
<script language="Javascript" type="text/javascript">
|
||||
//<![CDATA[
|
||||
@@ -139,78 +131,22 @@ echo '
|
||||
}
|
||||
}
|
||||
|
||||
function GebietStarten(bezeichnung, stunde, minute, sekunde, gebiet_id)
|
||||
function GebietStarten(bezeichnung,stunde,minute,sekunde,gebiet_id)
|
||||
{
|
||||
let message = <?php echo "'".$p->t('testtool/okKlickenUmZuStarten')."'"?> + ' ' + stunde + 'h ' + minute + 'm ' + sekunde + 's';
|
||||
let title = <?php echo "'".$p->t('testtool/startGebiet')."'"?>;
|
||||
let abbrechen = <?php echo "'".$p->t('testtool/abbrechen')."'"?>;
|
||||
|
||||
if ($('#gebiet-dialog').length === 0)
|
||||
{
|
||||
$('body').append(
|
||||
'<div id="gebiet-dialog" title="' + title + '">' +
|
||||
'<p id="gebiet-dialog-msg">' + message + '</p>' +
|
||||
'</div>'
|
||||
);
|
||||
var check = confirm(<?php echo "'".$p->t('testtool/okKlickenUmZuStarten')."'"?>+' '+stunde+'h '+minute+'m '+sekunde+'s');
|
||||
if (check == true) {
|
||||
var sprache_user = <?php echo "'".$sprache_user."'"?>;
|
||||
document.location.href = 'frage.php?gebiet_id='+gebiet_id+'&start=true';
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
|
||||
$('#gebiet-dialog').dialog({
|
||||
modal: true,
|
||||
width: 400,
|
||||
resizable: false,
|
||||
buttons: [
|
||||
{
|
||||
text: 'OK',
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
document.location.href = 'frage.php?gebiet_id=' + gebiet_id + '&start=true';
|
||||
}
|
||||
},
|
||||
{
|
||||
text: abbrechen,
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
let letzteFrageBestaetigt = false;
|
||||
|
||||
function letzteFrage()
|
||||
{
|
||||
if (letzteFrageBestaetigt)
|
||||
return true;
|
||||
|
||||
let message = <?php echo "'".$p->t("testtool/alleFragenBeantwortet")."'"?>;
|
||||
|
||||
if ($('#fertig-dialog').length === 0)
|
||||
{
|
||||
$('body').append(
|
||||
'<div id="fertig-dialog">' +
|
||||
'<p>' + message + '</p>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
$('#fertig-dialog').dialog({
|
||||
modal: true,
|
||||
width: 400,
|
||||
resizable: false,
|
||||
buttons: [
|
||||
{
|
||||
text: 'OK',
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
letzteFrageBestaetigt = true;
|
||||
$('[name="submitantwort"]').click();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
return false;
|
||||
alert(<?php echo "'".$p->t("testtool/alleFragenBeantwortet")."'"?>);
|
||||
return true;
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
@@ -711,7 +647,7 @@ if($frage->frage_id!='')
|
||||
}
|
||||
|
||||
$letzte = $frage->getNextFrage($gebiet_id, $_SESSION['pruefling_id'], $frage_id, $demo);
|
||||
echo "<form action=\"$PHP_SELF?gebiet_id=$gebiet_id&frage_id=$frage->frage_id\" method=\"POST\" ".(!$letzte && !$levelgebiet?"onsubmit=\"return letzteFrage()\"":"").">";
|
||||
echo "<form action=\"$PHP_SELF?gebiet_id=$gebiet_id&frage_id=$frage->frage_id\" method=\"POST\" ".(!$letzte && !$levelgebiet?"onsubmit=\"letzteFrage()\"":"").">";
|
||||
echo '
|
||||
<div class="row text-center">
|
||||
<table class="table" style="width: 600px; margin-left: auto; margin-right: auto;">
|
||||
|
||||
@@ -44,27 +44,6 @@ if (isset($_GET['sprache_user']) && !empty($_GET['sprache_user']))
|
||||
$sprache_user = (isset($_SESSION['sprache_user']) && !empty($_SESSION['sprache_user'])) ? $_SESSION['sprache_user'] : DEFAULT_LANGUAGE;
|
||||
$p = new phrasen($sprache_user);
|
||||
|
||||
$showInfo = false;
|
||||
if (isset($_SESSION['alleGebiete']))
|
||||
{
|
||||
$alleGebiete = array_map('intval', $_SESSION['alleGebiete']);
|
||||
$pruefling_id = $_SESSION['pruefling_id'];
|
||||
|
||||
$qry = "SELECT COUNT(DISTINCT gebiet_id) as anzahl
|
||||
FROM testtool.tbl_pruefling_frage
|
||||
JOIN testtool.tbl_frage USING(frage_id)
|
||||
WHERE gebiet_id IN (". implode(',', $alleGebiete) .")
|
||||
AND pruefling_id = ". $pruefling_id ."
|
||||
";
|
||||
|
||||
$result = $db->db_query($qry);
|
||||
$anzahlGebiete = $db->db_fetch_object($result);
|
||||
|
||||
|
||||
if ((int)$anzahlGebiete->anzahl === count($alleGebiete))
|
||||
$showInfo = true;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
@@ -90,7 +69,6 @@ if (isset($_SESSION['alleGebiete']))
|
||||
<body>
|
||||
<br><br><br><br><br>
|
||||
<center><h2><?php echo $p->t('testtool/zeitAbgelaufen');?></h2>
|
||||
<h3><?php echo ($showInfo ? ($p->t('testtool/alleGebietGestartet') . "<br />" . $p->t('testtool/alleGebieteGestartetInfo')) : ''); ?></h3>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+2
-11
@@ -142,9 +142,7 @@ if (isset($_REQUEST['prestudent']))
|
||||
}
|
||||
if ($reihungstest_id != '' && $rt->load($reihungstest_id))
|
||||
{
|
||||
$pruefling_exist = new Pruefling();
|
||||
$alreadyInRT = $pruefling_exist->personAlreadyInRT($ps->person_id, $rt->reihungstest_id, $ps->prestudent_id);
|
||||
if ($rt->freigeschaltet && !$alreadyInRT)
|
||||
if ($rt->freigeschaltet)
|
||||
{
|
||||
// regenerate Session ID after Login
|
||||
session_regenerate_id();
|
||||
@@ -284,14 +282,7 @@ if (isset($_REQUEST['prestudent']))
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($alreadyInRT)
|
||||
{
|
||||
$alertmsg .= '<div class="alert alert-danger">'.$p->t('testtool/reihungstestNichtRegistriert').'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$alertmsg .= '<div class="alert alert-danger">'.$p->t('testtool/reihungstestNichtFreigeschalten').'</div>';
|
||||
}
|
||||
$alertmsg .= '<div class="alert alert-danger">'.$p->t('testtool/reihungstestNichtFreigeschalten').'</div>';
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -187,7 +187,6 @@ else if (isset($_SESSION['pruefling_id']))
|
||||
}
|
||||
|
||||
$qry .= "
|
||||
AND ps_status.bewerbung_abgeschicktamum IS NOT NULL
|
||||
|
||||
/* Order to get last semester when using distinct on */
|
||||
ORDER BY
|
||||
@@ -406,29 +405,6 @@ else if (isset($_SESSION['pruefling_id']))
|
||||
echo '</table>';
|
||||
}
|
||||
|
||||
if (isset($_SESSION['pruefling_id']) && !empty($_SESSION['alleGebiete']))
|
||||
{
|
||||
$alleGebiete = array_map('intval', $_SESSION['alleGebiete']);
|
||||
$pruefling_id = (int)$_SESSION['pruefling_id'];
|
||||
|
||||
$qry = "SELECT COUNT(DISTINCT gebiet_id) AS anzahl
|
||||
FROM testtool.tbl_pruefling_frage
|
||||
JOIN testtool.tbl_frage USING(frage_id)
|
||||
WHERE gebiet_id IN (". implode(',', $alleGebiete) .")
|
||||
AND pruefling_id = ". $pruefling_id;
|
||||
|
||||
$result_check = $db->db_query($qry);
|
||||
$row_check = $db->db_fetch_object($result_check);
|
||||
|
||||
if ((int)$row_check->anzahl === count($alleGebiete))
|
||||
{
|
||||
echo '<tr><td>
|
||||
<div class="alert alert-success small" style="margin-left: 20px; width: 170px; margin-top: 3px;" role="alert">
|
||||
<strong>'.$p->t('testtool/alleGebietGestartet').'</strong>
|
||||
</div>
|
||||
</td></tr>';
|
||||
}
|
||||
}
|
||||
// Link zum Logout
|
||||
|
||||
echo '<tr><td class="ItemTesttool" style="margin-left: 20px;" nowrap>
|
||||
|
||||
@@ -95,37 +95,37 @@ foreach ($result_student as $row)
|
||||
if ($uids == '')
|
||||
die('Es befinden sich keine Studierende in diesem Semester');
|
||||
|
||||
$qry = "SELECT
|
||||
lehrveranstaltung_id, bezeichnung, studiengang_kz, semester, ects
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung
|
||||
WHERE
|
||||
lehrveranstaltung_id IN (
|
||||
SELECT
|
||||
DISTINCT lehrveranstaltung_id
|
||||
FROM
|
||||
campus.vw_student_lehrveranstaltung
|
||||
JOIN public.tbl_studentlehrverband ON(student_uid = uid)
|
||||
WHERE
|
||||
tbl_studentlehrverband.studiengang_kz = ".$db->db_add_param($studiengang_kz, FHC_INTEGER)."
|
||||
AND tbl_studentlehrverband.semester = ".$db->db_add_param($semester, FHC_INTEGER)."
|
||||
AND vw_student_lehrveranstaltung.studiensemester_kurzbz = ".$db->db_add_param($semester_aktuell)."
|
||||
AND vw_student_lehrveranstaltung.studiensemester_kurzbz = tbl_studentlehrverband.studiensemester_kurzbz
|
||||
$qry = "SELECT
|
||||
lehrveranstaltung_id, bezeichnung, studiengang_kz, semester, ects
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung
|
||||
WHERE
|
||||
lehrveranstaltung_id IN
|
||||
(
|
||||
SELECT
|
||||
distinct lehrveranstaltung_id
|
||||
FROM
|
||||
campus.vw_student_lehrveranstaltung, public.tbl_studentlehrverband
|
||||
WHERE
|
||||
tbl_studentlehrverband.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER)." AND
|
||||
tbl_studentlehrverband.semester=".$db->db_add_param($semester, FHC_INTEGER)." AND
|
||||
vw_student_lehrveranstaltung.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)." AND
|
||||
uid=student_uid AND
|
||||
vw_student_lehrveranstaltung.studiensemester_kurzbz=tbl_studentlehrverband.studiensemester_kurzbz
|
||||
)
|
||||
AND studiengang_kz != 0
|
||||
AND studiengang_kz<>0
|
||||
AND zeugnis
|
||||
UNION
|
||||
SELECT
|
||||
lehrveranstaltung_id, bezeichnung, studiengang_kz, semester, ects
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung
|
||||
JOIN lehre.tbl_zeugnisnote USING(lehrveranstaltung_id)
|
||||
WHERE
|
||||
tbl_lehrveranstaltung.studiengang_kz = ".$db->db_add_param($studiengang_kz, FHC_INTEGER)."
|
||||
AND tbl_zeugnisnote.student_uid IN ($uids)
|
||||
AND tbl_zeugnisnote.studiensemester_kurzbz = ".$db->db_add_param($semester_aktuell)."
|
||||
AND zeugnis
|
||||
ORDER BY bezeichnung";
|
||||
UNION
|
||||
SELECT
|
||||
lehrveranstaltung_id, bezeichnung, studiengang_kz, semester, ects
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung JOIN lehre.tbl_zeugnisnote USING(lehrveranstaltung_id)
|
||||
WHERE
|
||||
tbl_lehrveranstaltung.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER)." AND
|
||||
tbl_zeugnisnote.student_uid in($uids) AND
|
||||
tbl_zeugnisnote.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)." AND
|
||||
zeugnis
|
||||
ORDER BY bezeichnung";
|
||||
|
||||
if (!$result_lva = $db->db_query($qry))
|
||||
die('Fehler beim Ermitteln der Lehrveranstaltungen');
|
||||
@@ -338,10 +338,6 @@ if ($typ == 'xls')
|
||||
}
|
||||
$anzahl_lvspalten = $spalte - 2;
|
||||
|
||||
$worksheet->write($zeile, ++$spalte, 'ECTS Summe zugeteilt', $format_bold);
|
||||
$maxlength[$spalte] = 20;
|
||||
$worksheet->write($zeile, ++$spalte, 'ECTS Summe gewichtet', $format_bold);
|
||||
$maxlength[$spalte] = 20;
|
||||
$worksheet->write($zeile, ++$spalte, 'Notendurchschnitt', $format_bold);
|
||||
$maxlength[$spalte] = 15;
|
||||
$worksheet->write($zeile, ++$spalte, "Gewichteter\nNotendurchschnitt", $format_bold_wrap);
|
||||
@@ -376,12 +372,9 @@ if ($typ == 'xls')
|
||||
$worksheet->write($zeile, ++$spalte, $row_student->gruppe, $format_bold_left);
|
||||
$worksheet->write($zeile, ++$spalte, $row_student->matrikelnr, $format_bold);
|
||||
|
||||
// Alle Zeugnisnoten des Studierenden holen
|
||||
//Alle Zeugnisnoten des Studierenden holen
|
||||
$noten = array();
|
||||
$qry = "SELECT lehrveranstaltung_id, note
|
||||
FROM lehre.tbl_zeugnisnote
|
||||
WHERE student_uid = ".$db->db_add_param($row_student->uid)."
|
||||
AND studiensemester_kurzbz = ".$db->db_add_param($semester_aktuell);
|
||||
$qry = "SELECT * FROM lehre.tbl_zeugnisnote WHERE student_uid=".$db->db_add_param($row_student->uid)." AND studiensemester_kurzbz=".$db->db_add_param($semester_aktuell);
|
||||
if ($result = $db->db_query($qry))
|
||||
while ($row = $db->db_fetch_object($result))
|
||||
$noten[$row->lehrveranstaltung_id] = $row->note;
|
||||
@@ -389,16 +382,15 @@ if ($typ == 'xls')
|
||||
//Zu jeder Lehrveranstaltungsnote Prüfungstyp (Anzahl der Antritte) holen
|
||||
$pruefungstypen = array();
|
||||
$qry = "SELECT tbl_lehrveranstaltung.lehrveranstaltung_id, pruefungstyp_kurzbz, sort, datum
|
||||
FROM
|
||||
lehre.tbl_pruefung
|
||||
JOIN
|
||||
lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
JOIN
|
||||
lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
WHERE
|
||||
student_uid = ".$db->db_add_param($row_student->uid)."
|
||||
AND studiensemester_kurzbz = ".$db->db_add_param($semester_aktuell)."
|
||||
ORDER BY lehrveranstaltung_id, sort, datum";
|
||||
FROM
|
||||
lehre.tbl_pruefung
|
||||
JOIN
|
||||
lehre.tbl_lehreinheit using(lehreinheit_id)
|
||||
JOIN
|
||||
lehre.tbl_lehrveranstaltung using(lehrveranstaltung_id)
|
||||
WHERE
|
||||
student_uid=".$db->db_add_param($row_student->uid)." AND studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
|
||||
ORDER BY lehrveranstaltung_id, sort, datum";
|
||||
if ($result = $db->db_query($qry))
|
||||
{
|
||||
while ($row = $db->db_fetch_object($result))
|
||||
@@ -407,14 +399,15 @@ if ($typ == 'xls')
|
||||
}
|
||||
}
|
||||
|
||||
// Alle LVs holen zu denen der Studierende zugeteilt ist
|
||||
//Alle LVs holen zu denen der Studierende zugeteilt ist
|
||||
$zugeteilte_lvs = array();
|
||||
$qry = "SELECT DISTINCT lehrveranstaltung_id
|
||||
FROM
|
||||
campus.vw_student_lehrveranstaltung
|
||||
WHERE
|
||||
uid = ".$db->db_add_param($row_student->uid)."
|
||||
AND studiensemester_kurzbz = ".$db->db_add_param($semester_aktuell);
|
||||
$qry = "SELECT distinct lehrveranstaltung_id
|
||||
FROM
|
||||
campus.vw_student_lehrveranstaltung
|
||||
WHERE
|
||||
uid=".$db->db_add_param($row_student->uid)." AND
|
||||
studiensemester_kurzbz=".$db->db_add_param($semester_aktuell);
|
||||
|
||||
if ($result = $db->db_query($qry))
|
||||
while ($row = $db->db_fetch_object($result))
|
||||
$zugeteilte_lvs[] = $row->lehrveranstaltung_id;
|
||||
@@ -423,20 +416,17 @@ if ($typ == 'xls')
|
||||
$summe = 0;
|
||||
$rowcount = 0;
|
||||
$summeects = 0;
|
||||
$total_ects = 0;
|
||||
$gewichtetenote = 0;
|
||||
|
||||
while ($rowcount < $db->db_num_rows($result_lva))
|
||||
{
|
||||
$row_lva = $db->db_fetch_object($result_lva, $rowcount);
|
||||
$rowcount++;
|
||||
|
||||
//wenn es eine Note gibt
|
||||
if (isset($noten[$row_lva->lehrveranstaltung_id]))
|
||||
{
|
||||
$note = $noten[$row_lva->lehrveranstaltung_id];
|
||||
$format = 0;
|
||||
$total_ects += $row_lva->ects;
|
||||
|
||||
//wenn für die LV der Studierende eine Nachprüfung hat (z.B. 2 Termin, kommissionelle...)
|
||||
if (isset($pruefungstypen[$row_lva->lehrveranstaltung_id]))
|
||||
@@ -482,7 +472,6 @@ if ($typ == 'xls')
|
||||
//Keine Note fuer diese LV vorhanden
|
||||
if (in_array($row_lva->lehrveranstaltung_id, $zugeteilte_lvs))
|
||||
{
|
||||
$total_ects += $row_lva->ects;
|
||||
$worksheet->write($zeile, ++$spalte, '', $format_colored_nichteingetragen);
|
||||
}
|
||||
else
|
||||
@@ -500,8 +489,6 @@ if ($typ == 'xls')
|
||||
if ($summeects != 0)
|
||||
$gewichtetenote /= $summeects;
|
||||
|
||||
$worksheet->write($zeile, ++$spalte, sprintf("%.2f", $total_ects), $format_number);
|
||||
$worksheet->write($zeile, ++$spalte, sprintf("%.2f", $summeects), $format_number);
|
||||
$worksheet->write($zeile, ++$spalte, sprintf("%.2f", $schnitt), $format_number);
|
||||
$worksheet->write($zeile, ++$spalte, sprintf("%.2f", $gewichtetenote), $format_number);
|
||||
if ($gewichtetenote != 0)
|
||||
@@ -542,8 +529,6 @@ if ($typ == 'xls')
|
||||
$schnitt = $summe_schnitt / $anzahl_schnitt;
|
||||
else
|
||||
$schnitt = 0;
|
||||
$worksheet->write($zeile, ++$spalte, '-', $format_bold_center);
|
||||
$worksheet->write($zeile, ++$spalte, '-', $format_bold_center);
|
||||
$worksheet->write($zeile, ++$spalte, sprintf("%.2f", $schnitt), $format_number);
|
||||
if ($anzahlgewichtet != 0)
|
||||
$summegewichtet = $summegewichtet / $anzahlgewichtet;
|
||||
|
||||
+1
-49
@@ -25,7 +25,6 @@
|
||||
*/
|
||||
require_once(dirname(__FILE__).'/basis_db.class.php');
|
||||
require_once(dirname(__FILE__).'/'.EXT_FKT_PATH.'/generateZahlungsreferenz.inc.php');
|
||||
require_once(dirname(__FILE__).'/variable.class.php');
|
||||
|
||||
class konto extends basis_db
|
||||
{
|
||||
@@ -433,8 +432,6 @@ class konto extends basis_db
|
||||
|
||||
$qry.=" ORDER BY beschreibung";
|
||||
|
||||
$oehBeitrag = $this->_getOEHBeitrag();
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
@@ -443,15 +440,7 @@ class konto extends basis_db
|
||||
|
||||
$typ->buchungstyp_kurzbz = $row->buchungstyp_kurzbz;
|
||||
$typ->beschreibung = $row->beschreibung;
|
||||
if (strtolower($typ->buchungstyp_kurzbz) === 'oeh' && $oehBeitrag)
|
||||
{
|
||||
$typ->standardbetrag = $oehBeitrag;
|
||||
}
|
||||
else
|
||||
{
|
||||
$typ->standardbetrag = $row->standardbetrag;
|
||||
}
|
||||
|
||||
$typ->standardbetrag = $row->standardbetrag;
|
||||
$typ->standardtext = $row->standardtext;
|
||||
$typ->credit_points = $row->credit_points;
|
||||
$typ->aktiv = $this->db_parse_bool($row->aktiv);
|
||||
@@ -1001,43 +990,6 @@ class konto extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function _getOEHBeitrag()
|
||||
{
|
||||
if(!is_user_logged_in())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$variablen_obj = new variable();
|
||||
$variablen_obj->loadVariables(get_uid());
|
||||
|
||||
$qry = "WITH semstart AS (
|
||||
SELECT start FROM public.tbl_studiensemester
|
||||
WHERE studiensemester_kurzbz = '". $this->db_escape($variablen_obj->variable->semester_aktuell) . "'
|
||||
)
|
||||
SELECT * FROM bis.tbl_oehbeitrag oehb
|
||||
JOIN public.tbl_studiensemester semvon ON oehb.von_studiensemester_kurzbz = semvon.studiensemester_kurzbz
|
||||
LEFT JOIN public.tbl_studiensemester sembis ON oehb.bis_studiensemester_kurzbz = sembis.studiensemester_kurzbz
|
||||
JOIN semstart ON semstart.start::date >= semvon.start::date AND (sembis.studiensemester_kurzbz IS NULL OR semstart.start::date <= sembis.start::date)
|
||||
ORDER BY semvon.start
|
||||
LIMIT 1";
|
||||
|
||||
if ($this->db_query($qry))
|
||||
{
|
||||
if($row = $this->db_fetch_object())
|
||||
{
|
||||
$summe = ($row->studierendenbeitrag + $row->versicherung) * -1;
|
||||
return number_format((float)$summe, 2, '.', '');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler bei der Abfrage aufgetreten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
+15
-5
@@ -54,7 +54,7 @@ class ort extends basis_db
|
||||
public $m2; // numeric(8,2)
|
||||
public $gebteil; // varchar(32)
|
||||
public $arbeitsplaetze; // integer
|
||||
|
||||
public $parent_ort_kurzbz; // varchar(16)
|
||||
public $ort_kurzbz_old; // string
|
||||
|
||||
/**
|
||||
@@ -117,6 +117,7 @@ class ort extends basis_db
|
||||
$ort_obj->oe_kurzbz = $row->oe_kurzbz;
|
||||
$ort_obj->gebteil = $row->gebteil;
|
||||
$ort_obj->arbeitsplaetze = $row->arbeitsplaetze;
|
||||
$ort_obj->parent_ort_kurzbz = $row->parent_ort_kurzbz;
|
||||
$this->result[] = $ort_obj;
|
||||
}
|
||||
return true;
|
||||
@@ -185,6 +186,7 @@ class ort extends basis_db
|
||||
$ort_obj->oe_kurzbz = $row->oe_kurzbz;
|
||||
$ort_obj->gebteil = $row->gebteil;
|
||||
$ort_obj->arbeitsplaetze = $row->arbeitsplaetze;
|
||||
$ort_obj->parent_ort_kurzbz = $row->parent_ort_kurzbz;
|
||||
$this->result[] = $ort_obj;
|
||||
}
|
||||
return true;
|
||||
@@ -232,6 +234,7 @@ class ort extends basis_db
|
||||
$this->oe_kurzbz = $row->oe_kurzbz;
|
||||
$this->m2 = $row->m2;
|
||||
$this->arbeitsplaetze = $row->arbeitsplaetze;
|
||||
$this->parent_ort_kurzbz = $row->parent_ort_kurzbz;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -287,7 +290,7 @@ class ort extends basis_db
|
||||
{
|
||||
//Neuen Datensatz anlegen
|
||||
$qry = 'INSERT INTO public.tbl_ort (ort_kurzbz, bezeichnung, planbezeichnung, max_person, aktiv, lehre, reservieren, lageplan,
|
||||
dislozierung, kosten, stockwerk, standort_id, telefonklappe, insertamum, insertvon, updateamum, updatevon, content_id,ausstattung,m2,gebteil,oe_kurzbz,arbeitsplaetze) VALUES ('.
|
||||
dislozierung, kosten, stockwerk, standort_id, telefonklappe, insertamum, insertvon, updateamum, updatevon, content_id,ausstattung,m2,gebteil,oe_kurzbz,arbeitsplaetze,parent_ort_kurzbz) VALUES ('.
|
||||
$this->db_add_param($this->ort_kurzbz).', '.
|
||||
$this->db_add_param($this->bezeichnung).', '.
|
||||
$this->db_add_param($this->planbezeichnung).', '.
|
||||
@@ -310,7 +313,8 @@ class ort extends basis_db
|
||||
$this->db_add_param($this->m2).','.
|
||||
$this->db_add_param($this->gebteil).','.
|
||||
$this->db_add_param($this->oe_kurzbz).','.
|
||||
$this->db_add_param($this->arbeitsplaetze).');';
|
||||
$this->db_add_param($this->arbeitsplaetze).','.
|
||||
$this->db_add_param($this->parent_ort_kurzbz).');';
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -337,7 +341,8 @@ class ort extends basis_db
|
||||
'm2='.$this->db_add_param($this->m2).', '.
|
||||
'gebteil='.$this->db_add_param($this->gebteil).', '.
|
||||
'oe_kurzbz='.$this->db_add_param($this->oe_kurzbz).', '.
|
||||
'arbeitsplaetze='.$this->db_add_param($this->arbeitsplaetze).' '.
|
||||
'arbeitsplaetze='.$this->db_add_param($this->arbeitsplaetze).', '.
|
||||
'parent_ort_kurzbz='.$this->db_add_param($this->parent_ort_kurzbz).' '.
|
||||
'WHERE ort_kurzbz = '.$this->db_add_param(($this->ort_kurzbz_old!='')?$this->ort_kurzbz_old:$this->ort_kurzbz).';';
|
||||
}
|
||||
|
||||
@@ -455,7 +460,8 @@ class ort extends basis_db
|
||||
$ort_obj->gebteil = $row->gebteil;
|
||||
$ort_obj->oe_kurzbz = $row->oe_kurzbz;
|
||||
$ort_obj->arbeitsplaetze = $row->arbeitsplaetze;
|
||||
|
||||
$ort_obj->parent_ort_kurzbz = $row->parent_ort_kurzbz;
|
||||
|
||||
$this->result[] = $ort_obj;
|
||||
}
|
||||
return true;
|
||||
@@ -523,6 +529,7 @@ class ort extends basis_db
|
||||
$ort_obj->gebteil = $row->gebteil;
|
||||
$ort_obj->oe_kurzbz = $row->oe_kurzbz;
|
||||
$ort_obj->arbeitsplaetze = $row->arbeitsplaetze;
|
||||
$ort_obj->parent_ort_kurzbz = $row->parent_ort_kurzbz;
|
||||
|
||||
$this->result[] = $ort_obj;
|
||||
}
|
||||
@@ -577,6 +584,8 @@ class ort extends basis_db
|
||||
$ort_obj->oe_kurzbz = $row->oe_kurzbz;
|
||||
$ort_obj->gebteil = $row->gebteil;
|
||||
$ort_obj->arbeitsplaetze = $row->arbeitsplaetze;
|
||||
$ort_obj->parent_ort_kurzbz = $row->parent_ort_kurzbz;
|
||||
|
||||
$this->result[] = $ort_obj;
|
||||
}
|
||||
return true;
|
||||
@@ -634,6 +643,7 @@ class ort extends basis_db
|
||||
$ort_obj->oe_kurzbz = $row->oe_kurzbz;
|
||||
$ort_obj->gebteil = $row->gebteil;
|
||||
$ort_obj->arbeitsplaetze = $row->arbeitsplaetze;
|
||||
$ort_obj->parent_ort_kurzbz = $row->parent_ort_kurzbz;
|
||||
$this->result[] = $ort_obj;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -584,32 +584,6 @@ class pruefling extends basis_db
|
||||
|
||||
$qry .= " LIMIT 1";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
if ($this->db_num_rows($result) == 0)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler bei einer Abfrage';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function personAlreadyInRT($person_id, $reihungstest_id, $prestudent_id)
|
||||
{
|
||||
$qry = "SELECT tbl_prestudent.prestudent_id
|
||||
FROM public.tbl_rt_person
|
||||
JOIN public.tbl_prestudent ON tbl_prestudent.person_id = tbl_rt_person.person_id
|
||||
JOIN public.tbl_prestudentstatus ON tbl_prestudent.prestudent_id = tbl_prestudentstatus.prestudent_id AND status_kurzbz = 'Bewerber'
|
||||
AND tbl_prestudentstatus.studienplan_id = tbl_rt_person.studienplan_id
|
||||
WHERE tbl_rt_person.person_id = " . $this->db_add_param($person_id) . "
|
||||
AND tbl_rt_person.rt_id = " . $this->db_add_param($reihungstest_id) . "
|
||||
AND tbl_prestudent.prestudent_id != " . $this->db_add_param($prestudent_id) . "
|
||||
AND get_rolle_prestudent(tbl_prestudent.prestudent_id, NULL) = 'Bewerber'
|
||||
LIMIT 1";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
if ($this->db_num_rows($result) == 0)
|
||||
|
||||
@@ -17,7 +17,6 @@ $this->phrasen['testtool/basic']='Basic';
|
||||
$this->phrasen['testtool/basisgebiete']='Basisgebiete';
|
||||
$this->phrasen['testtool/semester']='Semester';
|
||||
$this->phrasen['testtool/reihungstestNichtFreigeschalten']='Der zuteilte Reihungstest ist noch nicht freigeschaltet';
|
||||
$this->phrasen['testtool/reihungstestNichtRegistriert']='Sie sind für den Reihungstest nicht registriert';
|
||||
$this->phrasen['testtool/reihungstestKannNichtGeladenWerden']='Der Reihungstest dem Sie zugeteilt sind, kann nicht geladen werden. Melden Sie sich bitte bei der Reihungstestaufsicht.';
|
||||
$this->phrasen['testtool/geburtsdatumStimmtNichtUeberein']='Ihr Geburtsdatum stimmt nicht mit unseren Daten überein. Bitte wenden Sie sich an die Aufsichtsperson';
|
||||
$this->phrasen['testtool/home']='Home';
|
||||
@@ -32,14 +31,10 @@ $this->phrasen['testtool/keineAntwort']='Keine Antwort';
|
||||
$this->phrasen['testtool/speichernUndWeiter']='Speichern und weiter';
|
||||
$this->phrasen['testtool/alleFragenBeantwortet']='GLÜCKWUNSCH! \n\nSie haben alle Fragen in der zur Verfügung stehenden Zeit beantwortet. \nNutzen Sie die verbleibende Zeit, um Ihre Antworten zu kontrollieren oder fahren Sie mit dem nächsten Teilgebiet fort.';
|
||||
$this->phrasen['testtool/zeitAbgelaufen']='Die Maximalzeit für dieses Gebiet ist abgelaufen, oder alle Fragen wurden beantwortet';
|
||||
$this->phrasen['testtool/alleGebietGestartet']='Sie haben alle Gebiete bearbeitet.';
|
||||
$this->phrasen['testtool/alleGebieteGestartetInfo']='Sie können sich nun ausloggen und den Browser schließen.';
|
||||
$this->phrasen['testtool/spracheDerTestfragen']='Gewünschte Sprache der Testfragen';
|
||||
$this->phrasen['testtool/einleitung']='Einleitung';
|
||||
$this->phrasen['testtool/blaettern']='Blättern';
|
||||
$this->phrasen['testtool/demo']='Demobeispiel ansehen';
|
||||
$this->phrasen['testtool/abbrechen']='Abbrechen';
|
||||
$this->phrasen['testtool/startGebiet']='Gebiet starten';
|
||||
$this->phrasen['testtool/okKlickenUmZuStarten']='Klicken Sie OK um dieses Gebiet zu starten. \nSie haben für die Bearbeitung ein Zeitlimit von';
|
||||
$this->phrasen['testtool/bitteZuerstAnmelden']='Bitte zuerst anmelden!';
|
||||
$this->phrasen['testtool/fehlerBeimGenerierenDesFragenpools']='Fehler beim generieren des Fragenpools';
|
||||
|
||||
@@ -17,7 +17,6 @@ $this->phrasen['testtool/basic']='Basic';
|
||||
$this->phrasen['testtool/basisgebiete']='Basic test';
|
||||
$this->phrasen['testtool/semester']='Semester';
|
||||
$this->phrasen['testtool/reihungstestNichtFreigeschalten']='The entrance examination assigned has not yet been activated.';
|
||||
$this->phrasen['testtool/reihungstestNichtRegistriert']='You are not registered for the placement test.';
|
||||
$this->phrasen['testtool/reihungstestKannNichtGeladenWerden']='The placement test you are assigned to could not be loaded. Please contact the placement test supervisior.';
|
||||
$this->phrasen['testtool/geburtsdatumStimmtNichtUeberein']='Your date of birth does not correspond to the data we have. Please speak to the supervisor. ';
|
||||
$this->phrasen['testtool/home']='Home';
|
||||
@@ -32,14 +31,10 @@ $this->phrasen['testtool/keineAntwort']='No Answer';
|
||||
$this->phrasen['testtool/speichernUndWeiter']='Save and next';
|
||||
$this->phrasen['testtool/alleFragenBeantwortet']='CONGRATULATIONS!\n\nYou have answered all the questions in the time allowed.\n Use the remaining time to check your answers or continue to the next section.';
|
||||
$this->phrasen['testtool/zeitAbgelaufen']='The time for this part has expired or you have answered all the questions.';
|
||||
$this->phrasen['testtool/alleGebietGestartet']='You have worked on all sections.';
|
||||
$this->phrasen['testtool/alleGebieteGestartetInfo']='You can now log out and close the browser.';
|
||||
$this->phrasen['testtool/spracheDerTestfragen']='Desired language of questions';
|
||||
$this->phrasen['testtool/einleitung']='Introduction';
|
||||
$this->phrasen['testtool/blaettern']='Browse';
|
||||
$this->phrasen['testtool/demo']='See an example';
|
||||
$this->phrasen['testtool/abbrechen']='Cancel';
|
||||
$this->phrasen['testtool/startGebiet']='Start the section';
|
||||
$this->phrasen['testtool/okKlickenUmZuStarten']='Click OK to start this section. \nYou have a timelimit of';
|
||||
$this->phrasen['testtool/bitteZuerstAnmelden']='Please log in first!';
|
||||
$this->phrasen['testtool/fehlerBeimGenerierenDesFragenpools']='Error in generating the pool of questions.';
|
||||
|
||||
@@ -197,6 +197,10 @@ html.fs_huge {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
.tiny-90 div.tox.tox-tinymce {
|
||||
height: 90% !important;
|
||||
}
|
||||
|
||||
/* slim begin */
|
||||
.stv .form-label {
|
||||
margin-bottom: .15rem;
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
html {
|
||||
font-size: .75em;
|
||||
}
|
||||
|
||||
nav.navbar.navbar-header,
|
||||
nav.navbar.navbar-left-side {
|
||||
font-size: 18px
|
||||
}
|
||||
|
||||
nav.navbar.navbar-left-side {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
/* Relative sizing inside navbar */
|
||||
nav.navbar .nav-item {
|
||||
font-size: 18px
|
||||
}
|
||||
|
||||
nav.navbar .navbar-brand-icon {
|
||||
font-size: 16px
|
||||
}
|
||||
|
||||
nav.navbar .left-side-menu-link-entry {
|
||||
font-size: 14px !important;
|
||||
}
|
||||
|
||||
nav.navbar .nav-link {
|
||||
font-size: 18px;
|
||||
padding-top: 15px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
nav.navbar .dropdown-menu {
|
||||
padding: 8px 0px;
|
||||
}
|
||||
|
||||
nav.navbar .dropdown-item {
|
||||
font-size: 16px;
|
||||
padding: 4px 16px;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
export default {
|
||||
getLocationsByCompanyType(companyType) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/organisation/LocationApi/getLocationsByCompanyType',
|
||||
params: { companyType }
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
export default {
|
||||
getAllOrganizationalUnits() {
|
||||
return {
|
||||
method: "get",
|
||||
url: "api/frontend/v1/organisation/organizationalUnitApi/getAllOrganizationalUnits",
|
||||
};
|
||||
},
|
||||
}
|
||||
@@ -16,11 +16,52 @@
|
||||
*/
|
||||
|
||||
export default {
|
||||
getContentID(ort_kurbz) {
|
||||
getAllRooms(params) {
|
||||
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/Ort/getAllRooms',
|
||||
params: {
|
||||
"filter[oe_kurzbz]" : params?.organizationalUnitShortCode,
|
||||
"filter[standort_id]" : params?.locationId,
|
||||
"filter[gebteil]" : params?.buildingComponent,
|
||||
"filter[lehre]" : params?.isForTrainingProgram,
|
||||
"filter[reservieren]" : params?.isReservationNeeded,
|
||||
"filter[aktiv]" : params?.isActive,
|
||||
"filter[ort_kurzbz]" : params?.shortCode,
|
||||
"filter[bezeichnung]" : params?.description,
|
||||
"filter[planbezeichnung]" : params?.planDescription,
|
||||
"filter[max_person]" : params?.maxPersons,
|
||||
"filter[arbeitsplaetze]" : params?.workplace,
|
||||
"filter[m2]" : params?.squareMeters,
|
||||
"filter[org_organisationseinheittyp_kurzbz_org_bezeichnung_concat]" : params?.orgUnitConcatDescription,
|
||||
"filter[kosten]" : params?.costs,
|
||||
"filter[stockwerk]" : params?.floor,
|
||||
"filter[parent_ort_kurzbz]" : params?.parentRoomShortCode,
|
||||
"filter[ort_kurzbz_bezeichnung_concat]" : params?.ort_kurzbz_bezeichnung_concat,
|
||||
"sort[ort_kurzbz]" : params?.sort?.ort_kurzbz,
|
||||
"sort[bezeichnung]" : params?.sort?.bezeichnung,
|
||||
"sort[planbezeichnung]" : params?.sort?.planbezeichnung,
|
||||
"sort[max_person]" : params?.sort?.max_person,
|
||||
"sort[arbeitsplaetze]" : params?.sort?.arbeitsplaetze,
|
||||
"sort[m2]" : params?.sort?.m2,
|
||||
"sort[org_organisationseinheittyp_kurzbz_org_bezeichnung_concat]" : params?.sort?.org_organisationseinheittyp_kurzbz_org_bezeichnung_concat,
|
||||
"sort[lehre]" : params?.sort?.lehre,
|
||||
"sort[reservieren]" : params?.sort?.reservieren,
|
||||
"sort[aktiv]" : params?.sort?.aktiv,
|
||||
"sort[kosten]" : params?.sort?.kosten,
|
||||
"sort[stockwerk]" : params?.sort?.stockwerk,
|
||||
"sort[parent_ort_kurzbz]" : params?.sort?.parent_ort_kurzbz,
|
||||
"pagination[page]" : params?.pagination?.page,
|
||||
"pagination[size]" : params?.pagination?.size,
|
||||
}
|
||||
}
|
||||
},
|
||||
getContentID(ort_kurzbz) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/Ort/ContentID',
|
||||
params: { ort_kurzbz: ort_kurbz }
|
||||
params: { ort_kurzbz: ort_kurzbz }
|
||||
};
|
||||
},
|
||||
getRooms(datum, von, bis, typ, personenanzahl = 0) {
|
||||
@@ -30,11 +71,37 @@ export default {
|
||||
params: { datum, von, bis, typ, personenanzahl }
|
||||
};
|
||||
},
|
||||
getRoom(ort_kurzbz) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/Ort/getRoom/' + ort_kurzbz,
|
||||
};
|
||||
},
|
||||
getRoomTypes() {
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/Ort/getTypes',
|
||||
params: { }
|
||||
};
|
||||
},
|
||||
createRoom(roomData) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/Ort/createRoom',
|
||||
params: roomData
|
||||
}
|
||||
},
|
||||
updateRoom(roomId, roomData) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/Ort/updateRoom/' + roomId,
|
||||
params: roomData
|
||||
}
|
||||
},
|
||||
deleteRoom(ort_kurzbz) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/Ort/deleteRoom/' + ort_kurzbz,
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export default {
|
||||
getRoomToRoomTypeRelationsByRoomShortCode(roomShortCode) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: `api/frontend/v1/RoomToRoomTypeApi/getRoomToRoomTypeRelationsByRoomShortCode/${roomShortCode}`,
|
||||
}
|
||||
},
|
||||
createRoomToRoomTypeRelation(roomShortCode, roomTypeShortCode, hierarchy) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: `api/frontend/v1/RoomToRoomTypeApi/createRoomToRoomTypeRelation`,
|
||||
params: {
|
||||
roomShortCode,
|
||||
roomTypeShortCode,
|
||||
hierarchy
|
||||
},
|
||||
}
|
||||
},
|
||||
deleteRoomToRoomTypeRelation(roomShortCode, roomTypeShortCode, hierarchy) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: `api/frontend/v1/RoomToRoomTypeApi/deleteRoomToRoomTypeRelation`,
|
||||
params: {
|
||||
roomShortCode,
|
||||
roomTypeShortCode,
|
||||
hierarchy
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
/**
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
export default {
|
||||
getAllRoomTypes() {
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/RoomTypeApi/getAllRoomTypes',
|
||||
}
|
||||
},
|
||||
createRoomType(roomTypeData) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/RoomTypeApi/createRoomType',
|
||||
params: roomTypeData,
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -38,10 +38,6 @@ export default {
|
||||
};
|
||||
},
|
||||
insert(params) {
|
||||
if(params.betrag)
|
||||
{
|
||||
params.betrag = params.betrag.replace(',', '.');
|
||||
}
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/stv/konto/insert',
|
||||
@@ -56,10 +52,6 @@ export default {
|
||||
};
|
||||
},
|
||||
edit(params) {
|
||||
if(params.betrag)
|
||||
{
|
||||
params.betrag = params.betrag.replace(',', '.');
|
||||
}
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/stv/konto/update',
|
||||
@@ -73,14 +65,10 @@ export default {
|
||||
params: { buchungsnr }
|
||||
};
|
||||
},
|
||||
getBuchungstypen(studiensemester_kurzbz) {
|
||||
let url = 'api/frontend/v1/stv/konto/getBuchungstypen'
|
||||
if (!!studiensemester_kurzbz)
|
||||
url = url + '/' + encodeURIComponent(studiensemester_kurzbz);
|
||||
|
||||
getBuchungstypen() {
|
||||
return {
|
||||
method: 'get',
|
||||
url: url
|
||||
url: 'api/frontend/v1/stv/konto/getBuchungstypen'
|
||||
};
|
||||
},
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,57 @@
|
||||
/**
|
||||
* Copyright (C) 2023 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import RoomManagerOverview from "../components/RoomManager/RoomManagerOverview.js";
|
||||
import {CoreNavigationCmpt} from '../components/navigation/Navigation.js';
|
||||
|
||||
import FhcAlert from "../plugins/FhcAlert.js";
|
||||
import Phrasen from "../plugins/Phrasen.js";
|
||||
import FhcApi from "../plugins/Api.js";
|
||||
|
||||
import {capitalize} from "../helpers/StringHelpers.js";
|
||||
|
||||
const ciPath =
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, "") +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router;
|
||||
|
||||
const router = VueRouter.createRouter({
|
||||
history: VueRouter.createWebHistory(),
|
||||
routes: [
|
||||
{
|
||||
name: "overview",
|
||||
path: `/${ciPath}/RoomManager`,
|
||||
component: RoomManagerOverview,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const app = Vue.createApp({
|
||||
components: {
|
||||
RoomManagerOverview,
|
||||
CoreNavigationCmpt
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
app.config.globalProperties.$capitalize = capitalize;
|
||||
|
||||
app.use(router)
|
||||
.use(primevue.config.default, { zIndex: { overlay: 9999 } })
|
||||
.use(FhcAlert)
|
||||
.use(Phrasen)
|
||||
.use(FhcApi)
|
||||
.mount("#main");
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
const vm = this;
|
||||
tinymce.init({
|
||||
target: this.$refs.editor.$refs.input, //Important: not selector: to enable multiple import of component
|
||||
min_height: 300,
|
||||
//height: 800,
|
||||
//plugins: ['lists'],
|
||||
toolbar: 'styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | link',
|
||||
plugins: 'link',
|
||||
@@ -313,7 +313,7 @@ export default {
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-8">
|
||||
<form-form class="row g-3 mt-2 align-content-start" ref="formMessage">
|
||||
<form-form class="row g-3 mt-2 h-100" ref="formMessage">
|
||||
|
||||
<div class="row mb-3">
|
||||
|
||||
@@ -338,7 +338,7 @@ export default {
|
||||
</div>
|
||||
|
||||
<!--Tiny MCE-->
|
||||
<div class="row mb-3 tiny-90">
|
||||
<div class="row mb-3 h-100 tiny-90">
|
||||
<form-input
|
||||
ref="editor"
|
||||
:label="$p.t('global','nachricht') + ' *'"
|
||||
|
||||
@@ -62,7 +62,7 @@ export default {
|
||||
const vm = this;
|
||||
tinymce.init({
|
||||
target: this.$refs.editor.$refs.input, //Important: not selector: to enable multiple import of component
|
||||
min_height: 300,
|
||||
//height: 800,
|
||||
//plugins: ['lists'],
|
||||
toolbar: 'styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | link',
|
||||
plugins: 'link',
|
||||
|
||||
@@ -30,7 +30,6 @@ export default {
|
||||
personId: null,
|
||||
layoutColumnsOnNewData: false,
|
||||
height: '400',
|
||||
arePhrasesLoaded: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -196,7 +195,7 @@ export default {
|
||||
],
|
||||
formatter: (cell, formatterParams) => {
|
||||
const key = formatterParams[cell.getValue()];
|
||||
return this.$p?.t?.('messages', key) || key;
|
||||
return this.$p.t('messages', key);
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -306,6 +305,8 @@ export default {
|
||||
{
|
||||
event: 'tableBuilt',
|
||||
handler: async() => {
|
||||
await this.$p.loadCategory(['global', 'person', 'stv', 'messages', 'ui', 'notiz']);
|
||||
|
||||
const setHeader = (field, text) => {
|
||||
const col = this.$refs.table.tabulator.getColumn(field);
|
||||
if (!col) return;
|
||||
@@ -356,12 +357,6 @@ export default {
|
||||
});*/
|
||||
},
|
||||
created(){
|
||||
this.$p
|
||||
.loadCategory(['global', 'person', 'stv', 'messages', 'ui', 'notiz'])
|
||||
.then(() => {
|
||||
this.arePhrasesLoaded = true;
|
||||
});
|
||||
|
||||
if(this.typeId != 'person_id' && Array.isArray(this.id) && this.id.length === 1) {
|
||||
const params = {
|
||||
id: this.id,
|
||||
@@ -386,7 +381,6 @@ export default {
|
||||
<!--table-->
|
||||
<div class="col-sm-6 pt-1">
|
||||
<core-filter-cmpt
|
||||
v-if="arePhrasesLoaded"
|
||||
ref="table"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
@@ -419,7 +413,6 @@ export default {
|
||||
<div class="col-sm-12 pt-6">
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
v-if="arePhrasesLoaded"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
table-only
|
||||
|
||||
@@ -0,0 +1,562 @@
|
||||
import ApiRoom from "../../../js/api/factory/ort.js";
|
||||
import ApiLocation from "../../../js/api/factory/location.js";
|
||||
import ApiOrganizationalUnit from "../../../js/api/factory/organizationalUnit.js";
|
||||
|
||||
import BsModal from "../Bootstrap/Modal.js";
|
||||
import CoreForm from "../Form/Form.js";
|
||||
import FormInput from "../Form/Input.js";
|
||||
|
||||
export default {
|
||||
name: "RoomFormModal",
|
||||
components: {
|
||||
BsModal,
|
||||
CoreForm,
|
||||
FormInput,
|
||||
},
|
||||
props: {
|
||||
isVisible: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
editedRoomShortCode: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
emits: ["hideBsModal", "roomCreated", "roomUpdated"],
|
||||
watch: {
|
||||
isVisible(newValue) {
|
||||
if (newValue) {
|
||||
this.$refs.roomFormModal.show();
|
||||
} else {
|
||||
this.$refs.roomFormModal.hide();
|
||||
}
|
||||
},
|
||||
editedRoomShortCode(newValue) {
|
||||
if (newValue) {
|
||||
this.editRoom(newValue);
|
||||
} else {
|
||||
this.resetRoomForm();
|
||||
}
|
||||
},
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
isEditInProgress: false,
|
||||
organizationalUnits: [],
|
||||
filteredOrganizationalUnits: [],
|
||||
locations: [],
|
||||
rooms: [],
|
||||
filteredRooms: [],
|
||||
editedRoom: null,
|
||||
roomFormData: {
|
||||
aktiv: true,
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
dropdownParsedOrganizationalUnits() {
|
||||
return this.organizationalUnits.map((unit) => {
|
||||
return {
|
||||
label: `${unit.bezeichnung} (${unit.organisationseinheittyp_kurzbz})`,
|
||||
value: unit.oe_kurzbz,
|
||||
};
|
||||
});
|
||||
},
|
||||
dropdownParsedRooms() {
|
||||
return this.rooms.map((room) => {
|
||||
let label = room.ort_kurzbz;
|
||||
if (room.bezeichnung && room.bezeichnung !== '') {
|
||||
label += ` - ${room.bezeichnung}`;
|
||||
}
|
||||
|
||||
return {
|
||||
label,
|
||||
value: room.ort_kurzbz,
|
||||
};
|
||||
});
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
filterOrganizationalUnits(event) {
|
||||
let defaultItem = {
|
||||
label: this.$p.t("ui", "dropdownEmptyOption"),
|
||||
value: null,
|
||||
};
|
||||
|
||||
const query = event.query.toLowerCase();
|
||||
if (!query) {
|
||||
return (this.filteredOrganizationalUnits = [
|
||||
defaultItem,
|
||||
...this.dropdownParsedOrganizationalUnits,
|
||||
]);
|
||||
}
|
||||
|
||||
return (this.filteredOrganizationalUnits = [defaultItem].concat(
|
||||
this.dropdownParsedOrganizationalUnits.filter((unit) => {
|
||||
return unit.label.toLowerCase().includes(query);
|
||||
}),
|
||||
));
|
||||
},
|
||||
async filterRooms(event) {
|
||||
this.rooms = await this.fetchRooms(event.query);
|
||||
|
||||
let defaultItem = {
|
||||
label: this.$p.t("ui", "dropdownEmptyOption"),
|
||||
value: null,
|
||||
};
|
||||
|
||||
const query = event.query.toLowerCase();
|
||||
if (!query) {
|
||||
return (this.filteredRooms = [
|
||||
defaultItem,
|
||||
...this.dropdownParsedRooms,
|
||||
]);
|
||||
}
|
||||
|
||||
return (this.filteredRooms = [defaultItem]
|
||||
.concat(this.dropdownParsedRooms)
|
||||
.filter((room) => {
|
||||
return room.label?.toLowerCase().includes(query);
|
||||
}));
|
||||
},
|
||||
createRoom() {
|
||||
return this.$refs.roomForm
|
||||
.call(ApiRoom.createRoom(this.getApiCallParsedRoomFormData()))
|
||||
.then((response) => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t("ui", "successSave"));
|
||||
this.$emit("roomCreated");
|
||||
this.resetRoomForm();
|
||||
this.hideRoomFormModal();
|
||||
});
|
||||
},
|
||||
async editRoom(roomShortCode) {
|
||||
let getLocationsResponse = await this.$api.call(
|
||||
ApiRoom.getRoom(roomShortCode),
|
||||
);
|
||||
if (getLocationsResponse.meta.status === "success") {
|
||||
this.editedRoom = getLocationsResponse.data;
|
||||
} else {
|
||||
this.$fhcAlert.alertError(this.$p.t("ui", "errorLoadingRoomData"));
|
||||
return;
|
||||
}
|
||||
|
||||
this.isEditInProgress = true;
|
||||
|
||||
let orgUnitData = null;
|
||||
let orgUnit = this.organizationalUnits.find(
|
||||
(unit) => unit.oe_kurzbz === this.editedRoom.oe_kurzbz,
|
||||
);
|
||||
if (orgUnit) {
|
||||
orgUnitData = {
|
||||
label: `${orgUnit.bezeichnung} (${orgUnit.organisationseinheittyp_kurzbz})`,
|
||||
value: orgUnit.oe_kurzbz,
|
||||
};
|
||||
}
|
||||
|
||||
let potentialParentRooms = await this.fetchRooms(
|
||||
this.editedRoom.parent_ort_kurzbz,
|
||||
);
|
||||
|
||||
let parentRoomData = null;
|
||||
let parentRoom = potentialParentRooms.find(
|
||||
(room) => room.ort_kurzbz === this.editedRoom.parent_ort_kurzbz,
|
||||
);
|
||||
if (parentRoom) {
|
||||
this.rooms.push(parentRoom);
|
||||
let label = parentRoom.ort_kurzbz;
|
||||
if (parentRoom.bezeichnung && parentRoom.bezeichnung !== '') {
|
||||
label += ` - ${parentRoom.bezeichnung}`;
|
||||
}
|
||||
|
||||
parentRoomData = {
|
||||
label,
|
||||
value: parentRoom.ort_kurzbz,
|
||||
};
|
||||
}
|
||||
|
||||
this.roomFormData = {
|
||||
parentRoom: parentRoomData,
|
||||
locationId: this.editedRoom.standort_id,
|
||||
organizationalUnit: orgUnitData,
|
||||
contentId: this.editedRoom.content_id,
|
||||
kurzbezeichnung: this.editedRoom.ort_kurzbz,
|
||||
bezeichnung: this.editedRoom.bezeichnung,
|
||||
planbezeichnung: this.editedRoom.planbezeichnung,
|
||||
aktiv: this.editedRoom.aktiv,
|
||||
lehre: this.editedRoom.lehre,
|
||||
reservieren: this.editedRoom.reservieren,
|
||||
maxPerson: this.editedRoom.max_person,
|
||||
stockwerk: this.editedRoom.stockwerk,
|
||||
lageplan: this.editedRoom.lageplan,
|
||||
dislozierung: this.editedRoom.dislozierung,
|
||||
kosten: this.editedRoom.kosten,
|
||||
ausstattung: this.editedRoom.ausstattung,
|
||||
telefonklappe: this.editedRoom.telefonklappe,
|
||||
quadratmeter: this.editedRoom.m2,
|
||||
gebaudeteil: this.editedRoom.gebteil,
|
||||
arbeitsplaetze: this.editedRoom.arbeitsplaetze,
|
||||
};
|
||||
|
||||
this.$refs.roomFormModal.show();
|
||||
},
|
||||
updateRoom() {
|
||||
return this.$refs.roomForm
|
||||
.call(
|
||||
ApiRoom.updateRoom(
|
||||
this.editedRoom.ort_kurzbz,
|
||||
this.getApiCallParsedRoomFormData(),
|
||||
),
|
||||
)
|
||||
.then((response) => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t("ui", "successSave"));
|
||||
this.$emit("roomUpdated");
|
||||
this.resetRoomForm();
|
||||
this.hideRoomFormModal();
|
||||
});
|
||||
},
|
||||
getApiCallParsedRoomFormData() {
|
||||
return {
|
||||
parent_ort_kurzbz: this.roomFormData.parentRoom?.value,
|
||||
standort_id: this.roomFormData.locationId,
|
||||
oe_kurzbz:
|
||||
this.roomFormData.organizationalUnit?.value !== ""
|
||||
? this.roomFormData.organizationalUnit?.value
|
||||
: null,
|
||||
content_id:
|
||||
this.roomFormData.contentId !== ""
|
||||
? this.roomFormData.contentId
|
||||
: null,
|
||||
ort_kurzbz: this.roomFormData.kurzbezeichnung,
|
||||
bezeichnung: this.roomFormData.bezeichnung,
|
||||
planbezeichnung: this.roomFormData.planbezeichnung,
|
||||
aktiv: this.roomFormData.aktiv,
|
||||
lehre: this.roomFormData.lehre,
|
||||
reservieren: this.roomFormData.reservieren,
|
||||
max_person:
|
||||
this.roomFormData.maxPerson !== ""
|
||||
? this.roomFormData.maxPerson
|
||||
: null,
|
||||
stockwerk:
|
||||
this.roomFormData.stockwerk !== ""
|
||||
? this.roomFormData.stockwerk
|
||||
: null,
|
||||
lageplan: this.roomFormData.lageplan,
|
||||
dislozierung:
|
||||
this.roomFormData.dislozierung === ""
|
||||
? null
|
||||
: this.roomFormData.dislozierung,
|
||||
kosten:
|
||||
this.roomFormData.kosten !== "" ? this.roomFormData.kosten : null,
|
||||
ausstattung: this.roomFormData.ausstattung,
|
||||
telefonklappe: this.roomFormData.telefonklappe,
|
||||
m2:
|
||||
this.roomFormData.quadratmeter !== ""
|
||||
? this.roomFormData.quadratmeter
|
||||
: null,
|
||||
gebteil: this.roomFormData.gebaudeteil,
|
||||
arbeitsplaetze:
|
||||
this.roomFormData.arbeitsplaetze !== ""
|
||||
? this.roomFormData.arbeitsplaetze
|
||||
: null,
|
||||
};
|
||||
},
|
||||
hideRoomFormModal() {
|
||||
this.$refs.roomFormModal.hide();
|
||||
this.$emit("hideBsModal");
|
||||
this.resetRoomForm();
|
||||
},
|
||||
resetRoomForm() {
|
||||
this.$refs.roomForm.clearValidation();
|
||||
this.isEditInProgress = false;
|
||||
this.editedRoom = null;
|
||||
this.roomFormData = {
|
||||
aktiv: true,
|
||||
};
|
||||
},
|
||||
async fetchRooms(roomSearchTerm = "") {
|
||||
let getRoomsResponse = await this.$api.call(
|
||||
ApiRoom.getAllRooms({
|
||||
ort_kurzbz_bezeichnung_concat: roomSearchTerm,
|
||||
pagination: {
|
||||
page: 1,
|
||||
size: 100,
|
||||
},
|
||||
}),
|
||||
);
|
||||
if (getRoomsResponse.meta.status === "success") {
|
||||
return getRoomsResponse.data;
|
||||
} else {
|
||||
this.$fhcAlert.alertError(this.$p.t("ui", "errorLoadingRooms"));
|
||||
}
|
||||
|
||||
return [];
|
||||
},
|
||||
setDefaultLocationOption() {
|
||||
this.locations.unshift({
|
||||
standort_id: null,
|
||||
bezeichnung: this.$p.t("ui", "dropdownEmptyOption"),
|
||||
});
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
let getLocationsResponse = await this.$api.call(
|
||||
ApiLocation.getLocationsByCompanyType("Intern"),
|
||||
);
|
||||
if (getLocationsResponse.meta.status === "success") {
|
||||
this.locations = getLocationsResponse.data;
|
||||
} else {
|
||||
this.$fhcAlert.alertError(this.$p.t("ui", "errorLoadingLocations"));
|
||||
}
|
||||
|
||||
let getAllOrganizationalUnitsResponse = await this.$api.call(
|
||||
ApiOrganizationalUnit.getAllOrganizationalUnits(),
|
||||
);
|
||||
if (getAllOrganizationalUnitsResponse.meta.status === "success") {
|
||||
this.organizationalUnits = getAllOrganizationalUnitsResponse.data.sort(
|
||||
(a, b) => a.bezeichnung.localeCompare(b.bezeichnung),
|
||||
);
|
||||
} else {
|
||||
this.$fhcAlert.alertError(
|
||||
this.$p.t("ui", "errorLoadingOrganizationalUnits"),
|
||||
);
|
||||
}
|
||||
|
||||
this.rooms = await this.fetchRooms();
|
||||
},
|
||||
mounted() {
|
||||
this.$p
|
||||
.loadCategory([
|
||||
"global",
|
||||
"lehre",
|
||||
"ui",
|
||||
"gruppenmanagement",
|
||||
"core",
|
||||
"person",
|
||||
])
|
||||
.then(() => {
|
||||
this.phrasesLoaded = true;
|
||||
this.setDefaultLocationOption();
|
||||
});
|
||||
},
|
||||
template: /* html */ `
|
||||
<bs-modal ref="roomFormModal" size="sm" @hideBsModal="() => { $emit('hideBsModal'); resetRoomForm(); }" class="modal-lg">
|
||||
<template #title>
|
||||
<p v-if="!editedRoom" class="fw-bold mt-3">{{$capitalize($p.t('ui', 'createRoomModalTitle'))}}</p>
|
||||
<p v-else class="fw-bold mt-3">{{$capitalize($p.t('ui', 'editRoomModalTitle'))}}</p>
|
||||
</template>
|
||||
<template #default>
|
||||
<core-form ref="roomForm" class="row g-3 pb-3">
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
v-model="roomFormData.parentRoom"
|
||||
:label="$capitalize($p.t('ui/parentRoom'))"
|
||||
:suggestions="filteredRooms"
|
||||
:optionValue="(option) => option.value"
|
||||
:optionLabel="(option) => option.label"
|
||||
:delay="500"
|
||||
@complete="filterRooms"
|
||||
dropdown
|
||||
forceSelection
|
||||
type="autocomplete"
|
||||
name="parent_ort_kurzbz"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<form-input
|
||||
v-model="roomFormData.organizationalUnit"
|
||||
:label="$capitalize($p.t('lehre/organisationseinheit'))"
|
||||
:suggestions="filteredOrganizationalUnits"
|
||||
:optionValue="(option) => option.value"
|
||||
:optionLabel="(option) => option.label"
|
||||
@complete="filterOrganizationalUnits"
|
||||
dropdown
|
||||
forceSelection
|
||||
type="autocomplete"
|
||||
name="oe_kurzbz"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="col">
|
||||
<form-input
|
||||
v-model="roomFormData.locationId"
|
||||
:label="$capitalize($p.t('person/standort'))"
|
||||
type="select"
|
||||
id="location"
|
||||
name="standort_id"
|
||||
>
|
||||
<option
|
||||
v-for="location in locations"
|
||||
:key="location.standort_id"
|
||||
:value="location.standort_id"
|
||||
>
|
||||
{{location.bezeichnung}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<form-input
|
||||
v-model="roomFormData.lehre"
|
||||
:label="$capitalize($p.t('ui', 'lehre'))"
|
||||
type="checkbox"
|
||||
name="lehre"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="col">
|
||||
<form-input
|
||||
v-model="roomFormData.reservieren"
|
||||
:label="$capitalize($p.t('ui', 'reservieren'))"
|
||||
type="checkbox"
|
||||
name="reservieren"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="col">
|
||||
<form-input
|
||||
v-model="roomFormData.aktiv"
|
||||
:label="$capitalize($p.t('person', 'aktiv'))"
|
||||
type="checkbox"
|
||||
name="aktiv"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if='!this.editedRoom' class="row mb-3">
|
||||
<form-input
|
||||
v-model="roomFormData.kurzbezeichnung"
|
||||
:label="$capitalize($p.t('gruppenmanagement', 'kurzbezeichnung'))"
|
||||
type="text"
|
||||
name="ort_kurzbz"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
v-model="roomFormData.bezeichnung"
|
||||
:label="$capitalize($p.t('ui', 'bezeichnung'))"
|
||||
type="text"
|
||||
name="bezeichnung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
v-model="roomFormData.planbezeichnung"
|
||||
:label="$capitalize($p.t('ui', 'planbezeichnung'))"
|
||||
type="text"
|
||||
name="planbezeichnung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<form-input
|
||||
v-model.number="roomFormData.maxPerson"
|
||||
:label="$capitalize($p.t('ui', 'maxPersons'))"
|
||||
name="max_person"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="col">
|
||||
<form-input
|
||||
v-model.number="roomFormData.stockwerk"
|
||||
:label="$capitalize($p.t('ui', 'stockwerk'))"
|
||||
name="stockwerk"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="col">
|
||||
<form-input
|
||||
v-model.number="roomFormData.quadratmeter"
|
||||
:label="$capitalize($p.t('ui', 'quadratmeter'))"
|
||||
name="m2"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class='col'>
|
||||
<form-input
|
||||
v-model="roomFormData.telefonklappe"
|
||||
:label="$capitalize($p.t('person', 'telefonklappe'))"
|
||||
name="telefonklappe"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class='col'>
|
||||
<form-input
|
||||
v-model.number="roomFormData.arbeitsplaetze"
|
||||
:label="$capitalize($p.t('ui', 'arbeitsplaetze'))"
|
||||
name="arbeitsplaetze"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class='col'>
|
||||
<form-input
|
||||
v-model="roomFormData.kosten"
|
||||
:label="$capitalize($p.t('ui', 'kosten'))"
|
||||
type="text"
|
||||
name="kosten"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class='col'>
|
||||
<form-input
|
||||
v-model="roomFormData.gebaudeteil"
|
||||
:label="$capitalize($p.t('ui', 'gebaudeteil'))"
|
||||
type="text"
|
||||
name="gebteil"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class='col'>
|
||||
<form-input
|
||||
v-model.number="roomFormData.contentId"
|
||||
:label="$capitalize($p.t('ui', 'contentId'))"
|
||||
name="content_id"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class='col'>
|
||||
<form-input
|
||||
v-model.number="roomFormData.dislozierung"
|
||||
:label="$capitalize($p.t('ui', 'dislozierung'))"
|
||||
name="dislozierung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
v-model="roomFormData.lageplan"
|
||||
:label="$capitalize($p.t('ui', 'lageplan'))"
|
||||
type="textarea"
|
||||
name="lageplan"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
v-model="roomFormData.ausstattung"
|
||||
:label="$capitalize($p.t('ui', 'ausstattung'))"
|
||||
type="textarea"
|
||||
name="ausstattung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-end gap-2">
|
||||
<button type="button" class="btn btn-secondary" @click="hideRoomFormModal">{{$p.t('ui', 'abbrechen')}}</button>
|
||||
<button type="button" class="btn btn-primary" @click="isEditInProgress ? updateRoom() : createRoom()">{{$p.t('ui', 'speichern')}}</button>
|
||||
</div>
|
||||
</core-form>
|
||||
</template>
|
||||
</bs-modal>
|
||||
`,
|
||||
};
|
||||
@@ -0,0 +1,707 @@
|
||||
import ApiRoom from "../../../js/api/factory/ort.js";
|
||||
import ApiLocation from "../../../js/api/factory/location.js";
|
||||
import ApiOrganizationalUnit from "../../../js/api/factory/organizationalUnit.js";
|
||||
|
||||
import { CoreFilterCmpt } from "../filter/Filter.js";
|
||||
import CoreForm from "../Form/Form.js";
|
||||
import FormInput from "../Form/Input.js";
|
||||
import RoomFormModal from "./RoomFormModal.js";
|
||||
import RoomTypeFormModal from "./RoomTypeFormModal.js";
|
||||
|
||||
export default {
|
||||
name: "RoomManagerOverview",
|
||||
components: {
|
||||
CoreFilterCmpt,
|
||||
CoreForm,
|
||||
FormInput,
|
||||
RoomFormModal,
|
||||
RoomTypeFormModal,
|
||||
},
|
||||
props: {
|
||||
permissions: Object,
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
cisRoot: this.cisRoot,
|
||||
hasBasisOrtWPermission: this.permissions["basis/ort_w"] || false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
filterData: {
|
||||
handler(newValue) {
|
||||
this.reloadTableData();
|
||||
},
|
||||
deep: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
phrasesLoaded: false,
|
||||
filterData: {
|
||||
locationId: null,
|
||||
organizationalUnit: null,
|
||||
buildingComponent: null,
|
||||
isForTrainingProgram: null,
|
||||
isReservationNeeded: null,
|
||||
isActive: null,
|
||||
},
|
||||
locations: [],
|
||||
organizationalUnits: [],
|
||||
filteredOrganizationalUnits: [],
|
||||
buildingComponents: [
|
||||
{
|
||||
label: "A",
|
||||
value: "A",
|
||||
},
|
||||
{
|
||||
label: "B",
|
||||
value: "B",
|
||||
},
|
||||
{
|
||||
label: "C",
|
||||
value: "C",
|
||||
},
|
||||
{
|
||||
label: "D",
|
||||
value: "D",
|
||||
},
|
||||
{
|
||||
label: "E",
|
||||
value: "E",
|
||||
},
|
||||
{
|
||||
label: "F",
|
||||
value: "F",
|
||||
},
|
||||
],
|
||||
isRoomFormModalVisible: false,
|
||||
isRoomTypeFormModalVisible: false,
|
||||
editedRoomShortCode: null,
|
||||
editedRoomForRoomTypeManagement: null,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
hasBasisOrtWPermission() {
|
||||
return this.permissions["basis/ort_w"] || false;
|
||||
},
|
||||
tabulatorOptions() {
|
||||
const options = {
|
||||
ajaxURL: "dummy",
|
||||
ajaxRequestFunc: async (url, config, params) => {
|
||||
let shortCodeFilter = params?.filter?.find(
|
||||
(filter) => filter.field === "ort_kurzbz",
|
||||
);
|
||||
let descriptionFilter = params?.filter?.find(
|
||||
(filter) => filter.field === "bezeichnung",
|
||||
);
|
||||
let planDescriptionFilter = params?.filter?.find(
|
||||
(filter) => filter.field === "planbezeichnung",
|
||||
);
|
||||
let maxPersonsFilter = params?.filter?.find(
|
||||
(filter) => filter.field === "max_person",
|
||||
);
|
||||
let workplaceFilter = params?.filter?.find(
|
||||
(filter) => filter.field === "arbeitsplaetze",
|
||||
);
|
||||
let squareMetersFilter = params?.filter?.find(
|
||||
(filter) => filter.field === "m2",
|
||||
);
|
||||
let orgUnitConcatFilter = params?.filter?.find(
|
||||
(filter) => filter.field === "org_organisationseinheittyp_kurzbz_org_bezeichnung_concat",
|
||||
);
|
||||
let isForTrainingProgramFilter = params?.filter?.find(
|
||||
(filter) => filter.field === "lehre",
|
||||
);
|
||||
let reservationNeededFilter = params?.filter?.find(
|
||||
(filter) => filter.field === "reservieren",
|
||||
);
|
||||
let isActiveFilter = params?.filter?.find(
|
||||
(filter) => filter.field === "aktiv",
|
||||
);
|
||||
let costsFilter = params?.filter?.find(
|
||||
(filter) => filter.field === "kosten",
|
||||
);
|
||||
let floorFilter = params?.filter?.find(
|
||||
(filter) => filter.field === "stockwerk",
|
||||
);
|
||||
let parentRoomFilter = params?.filter?.find(
|
||||
(filter) => filter.field === "parent_ort_kurzbz",
|
||||
);
|
||||
|
||||
let isForTrainingProgramValue = null;
|
||||
if (this.filterData.isForTrainingProgram === true) {
|
||||
isForTrainingProgramValue = true;
|
||||
} else {
|
||||
if (isForTrainingProgramFilter?.value === true) {
|
||||
isForTrainingProgramValue = true;
|
||||
} else if (isForTrainingProgramFilter?.value === false) {
|
||||
isForTrainingProgramValue = false;
|
||||
}
|
||||
}
|
||||
|
||||
let reservationNeededValue = null;
|
||||
if (this.filterData.isReservationNeeded === true) {
|
||||
reservationNeededValue = true;
|
||||
} else {
|
||||
if (reservationNeededFilter?.value === true) {
|
||||
reservationNeededValue = true;
|
||||
} else if (reservationNeededFilter?.value === false) {
|
||||
reservationNeededValue = false;
|
||||
}
|
||||
}
|
||||
|
||||
let isActiveValue = null;
|
||||
if (this.filterData.isActive === true) {
|
||||
isActiveValue = true;
|
||||
} else {
|
||||
if (isActiveFilter?.value === true) {
|
||||
isActiveValue = true;
|
||||
} else if (isActiveFilter?.value === false) {
|
||||
isActiveValue = false;
|
||||
}
|
||||
}
|
||||
|
||||
let shortCodeSorter = params?.sort?.find((sort) => sort.field === "ort_kurzbz");
|
||||
let descriptionSorter = params?.sort?.find((sort) => sort.field === "bezeichnung");
|
||||
let planDescriptionSorter = params?.sort?.find((sort) => sort.field === "planbezeichnung");
|
||||
let maxPersonsSorter = params?.sort?.find((sort) => sort.field === "max_person");
|
||||
let workplaceSorter = params?.sort?.find((sort) => sort.field === "arbeitsplaetze");
|
||||
let squareMetersSorter = params?.sort?.find((sort) => sort.field === "m2");
|
||||
let orgUnitConcatSorter = params?.sort?.find((sort) => sort.field === "org_organisationseinheittyp_kurzbz_org_bezeichnung_concat");
|
||||
let lehreSorter = params?.sort?.find((sort) => sort.field === "lehre");
|
||||
let reservierenSorter = params?.sort?.find((sort) => sort.field === "reservieren");
|
||||
let aktivSorter = params?.sort?.find((sort) => sort.field === "aktiv");
|
||||
let costsSorter = params?.sort?.find((sort) => sort.field === "kosten");
|
||||
let floorSorter = params?.sort?.find((sort) => sort.field === "stockwerk");
|
||||
let parentRoomSorter = params?.sort?.find((sort) => sort.field === "parent_ort_kurzbz");
|
||||
|
||||
return this.$api.call(
|
||||
ApiRoom.getAllRooms({
|
||||
organizationalUnitShortCode:
|
||||
this.filterData.organizationalUnit?.value,
|
||||
locationId: this.filterData.locationId,
|
||||
buildingComponent: this.filterData.buildingComponent,
|
||||
isForTrainingProgram: isForTrainingProgramValue,
|
||||
isReservationNeeded: reservationNeededValue,
|
||||
isActive: isActiveValue,
|
||||
shortCode: shortCodeFilter?.value,
|
||||
description: descriptionFilter?.value,
|
||||
planDescription: planDescriptionFilter?.value,
|
||||
maxPersons: maxPersonsFilter?.value,
|
||||
workplace: workplaceFilter?.value,
|
||||
squareMeters: squareMetersFilter?.value,
|
||||
orgUnitConcatDescription: orgUnitConcatFilter?.value,
|
||||
costs: costsFilter?.value,
|
||||
floor: floorFilter?.value,
|
||||
parentRoomShortCode: parentRoomFilter?.value,
|
||||
sort: {
|
||||
ort_kurzbz: shortCodeSorter?.dir,
|
||||
bezeichnung: descriptionSorter?.dir,
|
||||
planbezeichnung: planDescriptionSorter?.dir,
|
||||
max_person: maxPersonsSorter?.dir,
|
||||
arbeitsplaetze: workplaceSorter?.dir,
|
||||
m2: squareMetersSorter?.dir,
|
||||
org_organisationseinheittyp_kurzbz_org_bezeichnung_concat: orgUnitConcatSorter?.dir,
|
||||
lehre: lehreSorter?.dir,
|
||||
reservieren: reservierenSorter?.dir,
|
||||
aktiv: aktivSorter?.dir,
|
||||
kosten: costsSorter?.dir,
|
||||
stockwerk: floorSorter?.dir,
|
||||
parent_ort_kurzbz: parentRoomSorter?.dir,
|
||||
},
|
||||
pagination: {
|
||||
page: params.page,
|
||||
size: params.size,
|
||||
},
|
||||
}),
|
||||
);
|
||||
},
|
||||
ajaxResponse: (url, params, response) => response,
|
||||
persistenceID: "room_manager_overview_table",
|
||||
selectableRows: true,
|
||||
index: "ort_kurzbz",
|
||||
columns: [
|
||||
{
|
||||
title: this.$capitalize(
|
||||
this.$p.t("gruppenmanagement", "kurzbezeichnung"),
|
||||
),
|
||||
field: "ort_kurzbz",
|
||||
headerFilter: true,
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(
|
||||
this.$p.t("gruppenmanagement", "bezeichnung"),
|
||||
),
|
||||
field: "bezeichnung",
|
||||
headerFilter: true,
|
||||
width: 200,
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("ui", "planbezeichnung")),
|
||||
field: "planbezeichnung",
|
||||
headerFilter: true,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("ui", "maxPersons")),
|
||||
field: "max_person",
|
||||
headerFilter: true,
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("ui", "arbeitsplaetze")),
|
||||
field: "arbeitsplaetze",
|
||||
headerFilter: true,
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("ui", "quadratmeter")),
|
||||
field: "m2",
|
||||
headerFilter: true,
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("lehre", "organisationseinheit")),
|
||||
field: "org_organisationseinheittyp_kurzbz_org_bezeichnung_concat",
|
||||
formatter: function (cell) {
|
||||
let data = cell.getRow().getData();
|
||||
let value = null;
|
||||
if (data.org_organisationseinheittyp_kurzbz) {
|
||||
value = `[${data.org_organisationseinheittyp_kurzbz}]`;
|
||||
}
|
||||
if (data.org_bezeichnung) {
|
||||
value += ` ${data.org_bezeichnung}`;
|
||||
}
|
||||
|
||||
return value;
|
||||
},
|
||||
sorter: function (a, b, aRow, bRow, column, dir, sorterParams) {
|
||||
let aData = aRow.getData();
|
||||
let bData = bRow.getData();
|
||||
|
||||
let aFull = (
|
||||
aData.org_organisationseinheittyp_kurzbz +
|
||||
" " +
|
||||
aData.org_bezeichnung
|
||||
).toLowerCase().trim();
|
||||
let bFull = (
|
||||
bData.org_organisationseinheittyp_kurzbz +
|
||||
" " +
|
||||
bData.org_bezeichnung
|
||||
).toLowerCase().trim();
|
||||
|
||||
return aFull.localeCompare(bFull);
|
||||
},
|
||||
headerFilter: true,
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("ui", "lehre")),
|
||||
field: "lehre",
|
||||
headerFilter: true,
|
||||
headerFilterParams: {
|
||||
tristate: true,
|
||||
elementAttributes: { value: "true" },
|
||||
},
|
||||
formatter: "tickCross",
|
||||
hozAlign: "center",
|
||||
formatterParams: {
|
||||
tickElement: '<i class="fa fa-check text-success"></i>',
|
||||
crossElement: '<i class="fa fa-xmark text-danger"></i>',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("ui", "reservieren")),
|
||||
field: "reservieren",
|
||||
headerFilter: true,
|
||||
headerFilterParams: {
|
||||
tristate: true,
|
||||
elementAttributes: { value: "true" },
|
||||
},
|
||||
formatter: "tickCross",
|
||||
hozAlign: "center",
|
||||
formatterParams: {
|
||||
tickElement: '<i class="fa fa-check text-success"></i>',
|
||||
crossElement: '<i class="fa fa-xmark text-danger"></i>',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("gruppenmanagement", "aktiv")),
|
||||
field: "aktiv",
|
||||
headerFilter: true,
|
||||
headerFilterParams: {
|
||||
tristate: true,
|
||||
elementAttributes: { value: "true" },
|
||||
},
|
||||
formatter: "tickCross",
|
||||
hozAlign: "center",
|
||||
formatterParams: {
|
||||
tickElement: '<i class="fa fa-check text-success"></i>',
|
||||
crossElement: '<i class="fa fa-xmark text-danger"></i>',
|
||||
},
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("ui", "kosten")),
|
||||
field: "kosten",
|
||||
headerFilter: true,
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("ui", "stockwerk")),
|
||||
field: "stockwerk",
|
||||
headerFilter: true,
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("ui", "parentRoom")),
|
||||
field: "parent_ort_kurzbz",
|
||||
headerFilter: true,
|
||||
width_: 120,
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("global", "actions")),
|
||||
field: "actions",
|
||||
width: 120,
|
||||
formatter: (cell, formatterParams, onRendered) => {
|
||||
let container = document.createElement("div");
|
||||
container.className = "d-flex gap-2 justify-content-center";
|
||||
|
||||
let roomTypeBtn = document.createElement("button");
|
||||
roomTypeBtn.className = "btn btn-outline-secondary btn-action";
|
||||
roomTypeBtn.innerHTML = '<i class="fa fa-layer-group"></i>';
|
||||
roomTypeBtn.title = this.$capitalize(
|
||||
this.$p.t("ui", "btn_editRoomType"),
|
||||
);
|
||||
roomTypeBtn.addEventListener("click", (event) =>
|
||||
this.editRoomType(cell.getData().ort_kurzbz),
|
||||
);
|
||||
|
||||
if (!this.hasBasisOrtWPermission) {
|
||||
container.append(roomTypeBtn);
|
||||
return container;
|
||||
}
|
||||
|
||||
let button = document.createElement("button");
|
||||
|
||||
button = document.createElement("button");
|
||||
button.className = "btn btn-outline-secondary btn-action";
|
||||
button.innerHTML = '<i class="fa fa-edit"></i>';
|
||||
button.title = this.$capitalize(this.$p.t("ui", "btn_editRoom"));
|
||||
button.addEventListener("click", (event) =>
|
||||
this.editRoom(cell.getData().ort_kurzbz),
|
||||
);
|
||||
container.append(button);
|
||||
|
||||
container.append(roomTypeBtn);
|
||||
|
||||
button = document.createElement("button");
|
||||
button.className =
|
||||
"btn btn-outline-secondary btn-action bg-danger";
|
||||
button.innerHTML = '<i class="fa fa-xmark text-white"></i>';
|
||||
button.title = this.$capitalize(
|
||||
this.$p.t("ui", "btn_deleteRoom"),
|
||||
);
|
||||
button.addEventListener("click", () => {
|
||||
let isDeletionConfirmed = confirm(
|
||||
this.$p.t("ui", "deleteRoomConfirmation"),
|
||||
);
|
||||
if (!isDeletionConfirmed) return;
|
||||
|
||||
this.deleteRoom(cell.getData().ort_kurzbz);
|
||||
});
|
||||
container.append(button);
|
||||
|
||||
return container;
|
||||
},
|
||||
frozen: true,
|
||||
},
|
||||
],
|
||||
layout: "fitColumns",
|
||||
pagination: true,
|
||||
paginationMode: "remote",
|
||||
paginationSize: 100,
|
||||
maxHeight: "700px",
|
||||
filterMode: "remote",
|
||||
sortMode: "remote",
|
||||
};
|
||||
return options;
|
||||
},
|
||||
tabulatorEvents() {
|
||||
const events = [
|
||||
{
|
||||
event: "renderComplete",
|
||||
handler: async () => {},
|
||||
},
|
||||
{
|
||||
event: "cellClick",
|
||||
handler: async (e, cell) => {
|
||||
let updateableFieldsByClick = ["lehre", "reservieren", "aktiv"];
|
||||
for (let field of updateableFieldsByClick) {
|
||||
if (cell.getField() === field) {
|
||||
let updatedValue = !cell.getValue();
|
||||
this.$refs.roomManagerOverviewTable.tabulator.updateData([
|
||||
{
|
||||
ort_kurzbz: cell.getData().ort_kurzbz,
|
||||
[field]: updatedValue,
|
||||
},
|
||||
]);
|
||||
this.partialRoomUpdate(
|
||||
cell.getData().ort_kurzbz,
|
||||
field,
|
||||
updatedValue,
|
||||
);
|
||||
this.$refs.roomManagerOverviewTable.tabulator.replaceData("/");
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
];
|
||||
return events;
|
||||
},
|
||||
dropdownParsedOrganizationalUnits() {
|
||||
return this.organizationalUnits
|
||||
.map((unit) => {
|
||||
return {
|
||||
label: `[${unit.organisationseinheittyp_kurzbz}] ${unit.bezeichnung}`,
|
||||
value: unit.oe_kurzbz,
|
||||
};
|
||||
})
|
||||
.sort((a, b) => a.label.localeCompare(b.label));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
filterOrganizationalUnits(event) {
|
||||
let defaultItem = {
|
||||
label: this.$p.t("ui", "dropdownEmptyOption"),
|
||||
value: null,
|
||||
};
|
||||
|
||||
const query = event.query.toLowerCase();
|
||||
if (!query) {
|
||||
return (this.filteredOrganizationalUnits = [
|
||||
defaultItem,
|
||||
...this.dropdownParsedOrganizationalUnits,
|
||||
]);
|
||||
}
|
||||
|
||||
return (this.filteredOrganizationalUnits = [defaultItem]
|
||||
.concat(this.dropdownParsedOrganizationalUnits)
|
||||
.filter((unit) => {
|
||||
return unit.label.toLowerCase().includes(query);
|
||||
}));
|
||||
},
|
||||
showRoomFormModal() {
|
||||
this.isRoomFormModalVisible = true;
|
||||
},
|
||||
editRoom(roomShortCode) {
|
||||
this.editedRoomShortCode = roomShortCode;
|
||||
},
|
||||
deleteRoom(roomShortCode) {
|
||||
this.$api
|
||||
.call(ApiRoom.deleteRoom(roomShortCode))
|
||||
.then((response) => {
|
||||
if (response.meta.status === "success") {
|
||||
this.reloadTableData();
|
||||
this.$fhcAlert.alertSuccess(
|
||||
this.$p.t("ui", "roomDeletedSuccessfully"),
|
||||
);
|
||||
} else {
|
||||
this.reloadTableData();
|
||||
this.$fhcAlert.alertError(this.$p.t("ui", "errorDeletingRoom"));
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$fhcAlert.alertError(this.$p.t("ui", "errorDeletingRoom"));
|
||||
});
|
||||
},
|
||||
showRoomTypeFormModal() {
|
||||
this.isRoomTypeFormModalVisible = true;
|
||||
},
|
||||
editRoomType(roomShortCode) {
|
||||
this.editedRoomForRoomTypeManagement = roomShortCode;
|
||||
},
|
||||
async reloadTableData() {
|
||||
this.$refs.roomManagerOverviewTable.tabulator.replaceData("/");
|
||||
},
|
||||
handleRoomUpdated() {
|
||||
this.editedRoomShortCode = null;
|
||||
this.reloadTableData();
|
||||
},
|
||||
async partialRoomUpdate(roomShortCode, attribute, value) {
|
||||
let response = await this.$api.call(
|
||||
ApiRoom.updateRoom(roomShortCode, {
|
||||
[attribute]: value,
|
||||
}),
|
||||
);
|
||||
if (response.meta.status === "success") {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t("ui", "successUpdate"));
|
||||
this.reloadTableData();
|
||||
} else {
|
||||
this.$fhcAlert.alertError(this.$p.t("ui", "errorUpdatingRoom"));
|
||||
}
|
||||
},
|
||||
setDefaultBuildingComponentOption() {
|
||||
this.buildingComponents.unshift({
|
||||
label: this.$p.t("ui", "dropdownEmptyOption"),
|
||||
value: null,
|
||||
});
|
||||
},
|
||||
setDefaultLocationOption() {
|
||||
this.locations.unshift({
|
||||
standort_id: null,
|
||||
bezeichnung: this.$p.t("ui", "dropdownEmptyOption"),
|
||||
});
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
let getLocationsResponse = await this.$api.call(
|
||||
ApiLocation.getLocationsByCompanyType("Intern"),
|
||||
);
|
||||
if (getLocationsResponse.meta.status === "success") {
|
||||
this.locations = getLocationsResponse.data;
|
||||
} else {
|
||||
this.$fhcAlert.alertError(this.$p.t("ui", "errorLoadingLocations"));
|
||||
}
|
||||
|
||||
let getAllOrganizationalUnitsResponse = await this.$api.call(
|
||||
ApiOrganizationalUnit.getAllOrganizationalUnits(),
|
||||
);
|
||||
if (getAllOrganizationalUnitsResponse.meta.status === "success") {
|
||||
this.organizationalUnits = getAllOrganizationalUnitsResponse.data.sort(
|
||||
(a, b) => a.bezeichnung.localeCompare(b.bezeichnung),
|
||||
);
|
||||
} else {
|
||||
this.$fhcAlert.alertError(
|
||||
this.$p.t("ui", "errorLoadingOrganizationalUnits"),
|
||||
);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$p
|
||||
.loadCategory([
|
||||
"global",
|
||||
"lehre",
|
||||
"ui",
|
||||
"gruppenmanagement",
|
||||
"core",
|
||||
"person",
|
||||
])
|
||||
.then(() => {
|
||||
this.phrasesLoaded = true;
|
||||
this.setDefaultBuildingComponentOption();
|
||||
this.setDefaultLocationOption();
|
||||
});
|
||||
},
|
||||
template: /* html */ `
|
||||
<div class="container mt-4">
|
||||
<h1 class='mb-5'>{{ $capitalize($p.t("ui", "roomManagerOverviewHeading")) }}</h1>
|
||||
<div v-if="hasBasisOrtWPermission" class="row mb-3">
|
||||
<div class="col d-flex justify-content-between">
|
||||
<a class="btn btn-primary mb-3" @click="showRoomFormModal">{{$capitalize($p.t('ui', 'addRoomButton'))}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<core-filter-cmpt
|
||||
v-if="phrasesLoaded"
|
||||
ref="roomManagerOverviewTable"
|
||||
table-only
|
||||
:side-menu="false"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
>
|
||||
<template #search>
|
||||
<slot name="filterzuruecksetzen">
|
||||
<core-form class="d-flex flex-column flex-md-row align-items-md-end gap-3">
|
||||
<div>
|
||||
<form-input
|
||||
:label="$capitalize($p.t('lehre/organisationseinheit'))"
|
||||
:suggestions="filteredOrganizationalUnits"
|
||||
:optionValue="(option) => option.value"
|
||||
:optionLabel="(option) => option.label"
|
||||
@complete="filterOrganizationalUnits"
|
||||
@itemSelect="(option) => { filterData.organizationalUnit = option.value; }"
|
||||
dropdown
|
||||
forceSelection
|
||||
type="autocomplete"
|
||||
name="organizationalUnitShortCode"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div>
|
||||
<form-input
|
||||
v-model="filterData.locationId"
|
||||
:label="$capitalize($p.t('person', 'standort'))"
|
||||
type="select"
|
||||
id="location"
|
||||
name="location"
|
||||
>
|
||||
<option
|
||||
v-for="location in locations"
|
||||
:key="location.standort_id"
|
||||
:value="location.standort_id"
|
||||
>
|
||||
{{location.bezeichnung}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
<div>
|
||||
<form-input
|
||||
v-model="filterData.buildingComponent"
|
||||
:label="$capitalize($p.t('ui', 'buildingComponent'))"
|
||||
type="select"
|
||||
id="buildingComponent"
|
||||
name="buildingComponent"
|
||||
>
|
||||
<option
|
||||
v-for="component in buildingComponents"
|
||||
:key="component"
|
||||
:value="component.value"
|
||||
>
|
||||
{{component.label}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
<div>
|
||||
<form-input
|
||||
v-model="filterData.isForTrainingProgram"
|
||||
:label="$capitalize($p.t('ui', 'lehre'))"
|
||||
type="checkbox"
|
||||
name="filterIsForTrainingProgram"
|
||||
dropdown
|
||||
></form-input>
|
||||
</div>
|
||||
<div>
|
||||
<form-input
|
||||
v-model="filterData.isReservationNeeded"
|
||||
:label="$capitalize($p.t('ui', 'reservieren'))"
|
||||
type="checkbox"
|
||||
name="filterIsReservationNeeded"
|
||||
dropdown
|
||||
></form-input>
|
||||
</div>
|
||||
<div>
|
||||
<form-input
|
||||
v-model="filterData.isActive"
|
||||
:label="$capitalize($p.t('person', 'aktiv'))"
|
||||
type="checkbox"
|
||||
name="filterIsActive"
|
||||
dropdown
|
||||
></form-input>
|
||||
</div>
|
||||
</core-form>
|
||||
</slot>
|
||||
</template>
|
||||
</core-filter-cmpt>
|
||||
<room-form-modal
|
||||
:isVisible="isRoomFormModalVisible"
|
||||
:editedRoomShortCode="editedRoomShortCode"
|
||||
@hideBsModal="() => { isRoomFormModalVisible = false; editedRoomShortCode = null; }"
|
||||
@roomCreated="handleRoomUpdated"
|
||||
@roomUpdated="handleRoomUpdated"
|
||||
/>
|
||||
<room-type-form-modal
|
||||
:isVisible="isRoomTypeFormModalVisible"
|
||||
:editedRoomShortCode="editedRoomForRoomTypeManagement"
|
||||
@hideBsModal="() => { isRoomTypeFormModalVisible = false; editedRoomForRoomTypeManagement = null; }"
|
||||
/>
|
||||
</div>
|
||||
`,
|
||||
};
|
||||
@@ -0,0 +1,369 @@
|
||||
import ApiRoomType from "../../../js/api/factory/roomType.js";
|
||||
import ApiRoomToRoomType from "../../../js/api/factory/roomToRoomType.js";
|
||||
|
||||
import { CoreFilterCmpt } from "../filter/Filter.js";
|
||||
|
||||
import BsModal from "../Bootstrap/Modal.js";
|
||||
import CoreForm from "../Form/Form.js";
|
||||
import FormInput from "../Form/Input.js";
|
||||
|
||||
export default {
|
||||
name: "RoomTypeFormModal",
|
||||
components: {
|
||||
BsModal,
|
||||
CoreForm,
|
||||
FormInput,
|
||||
CoreFilterCmpt,
|
||||
},
|
||||
inject: ["hasBasisOrtWPermission"],
|
||||
props: {
|
||||
isVisible: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
editedRoomShortCode: {
|
||||
type: String,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
emits: [
|
||||
"hideBsModal",
|
||||
"roomTypeCreated",
|
||||
"roomToRoomTypeCreated",
|
||||
"roomToRoomTypeDeleted",
|
||||
],
|
||||
watch: {
|
||||
isVisible(newValue) {
|
||||
if (newValue) {
|
||||
this.$refs.roomTypeFormModal.show();
|
||||
} else {
|
||||
this.$refs.roomTypeFormModal.hide();
|
||||
}
|
||||
},
|
||||
async editedRoomShortCode(newValue) {
|
||||
if (newValue) {
|
||||
await this.$refs.roomTypesTable.reloadTable();
|
||||
this.$refs.roomTypeFormModal.show();
|
||||
} else {
|
||||
this.resetRoomTypeForm();
|
||||
}
|
||||
},
|
||||
},
|
||||
data: () => {
|
||||
return {
|
||||
phrasesLoaded: false,
|
||||
isEditInProgress: false,
|
||||
editedRoom: null,
|
||||
isRoomTypeFormVisible: false,
|
||||
roomTypeFormData: {
|
||||
aktiv: true,
|
||||
},
|
||||
roomToRoomTypeFormData: {},
|
||||
roomTypes: [],
|
||||
filteredRoomTypes: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
tabulatorOptions() {
|
||||
const options = {
|
||||
ajaxURL: "dummy",
|
||||
ajaxRequestFunc: async () =>
|
||||
this.$api.call(
|
||||
ApiRoomToRoomType.getRoomToRoomTypeRelationsByRoomShortCode(
|
||||
this.editedRoomShortCode,
|
||||
),
|
||||
),
|
||||
ajaxResponse: (url, params, response) => response.data,
|
||||
persistenceID: "room_type_assignment_table",
|
||||
selectableRows: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("ui", "roomType")),
|
||||
field: "raumtyp_kurzbz",
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("ui", "hierarchy")),
|
||||
field: "hierarchie",
|
||||
width: 50,
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("gruppenmanagement", "beschreibung")),
|
||||
field: "raumtyp_beschreibung",
|
||||
},
|
||||
{
|
||||
title: this.$capitalize(this.$p.t("global", "actions")),
|
||||
field: "actions",
|
||||
width: 50,
|
||||
formatter: (cell, formatterParams, onRendered) => {
|
||||
if (!this.hasBasisOrtWPermission) return "";
|
||||
|
||||
let container = document.createElement("div");
|
||||
container.className = "d-flex justify-content-center";
|
||||
|
||||
let button = document.createElement("button");
|
||||
|
||||
button = document.createElement("button");
|
||||
button.className =
|
||||
"btn btn-outline-secondary btn-action bg-danger";
|
||||
button.innerHTML = '<i class="fa fa-xmark text-white"></i>';
|
||||
button.title = this.$p.t(
|
||||
"ui",
|
||||
"btn_deleteRoomToRoomTypeRelation",
|
||||
);
|
||||
button.addEventListener("click", () => {
|
||||
let isDeletionConfirmed = confirm(
|
||||
this.$p.t("ui", "deleteRoomToRoomTypeRelationConfirmation"),
|
||||
);
|
||||
if (!isDeletionConfirmed) return;
|
||||
|
||||
this.deleteRoomToRoomTypeRelation(
|
||||
cell.getData().ort_kurzbz,
|
||||
cell.getData().raumtyp_kurzbz,
|
||||
cell.getData().hierarchie,
|
||||
);
|
||||
});
|
||||
container.append(button);
|
||||
|
||||
return container;
|
||||
},
|
||||
frozen: true,
|
||||
visible: this.hasBasisOrtWPermission,
|
||||
},
|
||||
],
|
||||
layout: "fitColumns",
|
||||
};
|
||||
return options;
|
||||
},
|
||||
tabulatorEvents() {
|
||||
const events = [
|
||||
{
|
||||
event: "renderComplete",
|
||||
handler: async () => {},
|
||||
},
|
||||
];
|
||||
return events;
|
||||
},
|
||||
dropdownParsedRoomTypes() {
|
||||
return this.roomTypes.map((roomType) => {
|
||||
return {
|
||||
label: `${roomType.raumtyp_kurzbz} - ${roomType.beschreibung}`,
|
||||
value: roomType.raumtyp_kurzbz,
|
||||
};
|
||||
});
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
filterRoomTypes(event) {
|
||||
let defaultItem = {
|
||||
label: this.$p.t("ui", "dropdownEmptyOption"),
|
||||
value: null,
|
||||
};
|
||||
|
||||
const query = event.query.toLowerCase();
|
||||
if (!query) {
|
||||
return (this.filteredRoomTypes = [
|
||||
defaultItem,
|
||||
...this.dropdownParsedRoomTypes,
|
||||
]);
|
||||
}
|
||||
|
||||
return (this.filteredRoomTypes = [defaultItem]
|
||||
.concat(this.dropdownParsedRoomTypes)
|
||||
.filter((roomType) => {
|
||||
return roomType.label?.toLowerCase().includes(query);
|
||||
}));
|
||||
},
|
||||
createRoomType() {
|
||||
return this.$refs.roomTypeForm
|
||||
.call(
|
||||
ApiRoomType.createRoomType({
|
||||
kurzbezeichnung: this.roomTypeFormData.shortCode,
|
||||
beschreibung: this.roomTypeFormData.description,
|
||||
}),
|
||||
)
|
||||
.then((response) => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t("ui", "successSave"));
|
||||
this.$emit("roomTypeCreated");
|
||||
this.resetRoomTypeForm();
|
||||
this.isRoomTypeFormVisible = false;
|
||||
this.fetchRoomTypes();
|
||||
});
|
||||
},
|
||||
createRoomToRoomTypeRelation() {
|
||||
return this.$refs.roomToRoomTypeForm
|
||||
.call(
|
||||
ApiRoomToRoomType.createRoomToRoomTypeRelation(
|
||||
this.editedRoomShortCode,
|
||||
this.roomToRoomTypeFormData.roomType?.value,
|
||||
this.roomToRoomTypeFormData.hierarchy,
|
||||
),
|
||||
)
|
||||
.then((response) => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t("ui", "successSave"));
|
||||
this.$emit("roomToRoomTypeCreated");
|
||||
this.resetRoomTypeForm();
|
||||
this.$refs.roomTypesTable.tabulator.replaceData("/");
|
||||
});
|
||||
},
|
||||
deleteRoomToRoomTypeRelation(roomShortCode, roomTypeShortCode, hierarchy) {
|
||||
return this.$api
|
||||
.call(
|
||||
ApiRoomToRoomType.deleteRoomToRoomTypeRelation(
|
||||
roomShortCode,
|
||||
roomTypeShortCode,
|
||||
hierarchy
|
||||
),
|
||||
)
|
||||
.then((response) => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t("ui", "successDelete"));
|
||||
this.$emit("roomToRoomTypeDeleted");
|
||||
this.resetRoomTypeForm();
|
||||
this.$refs.roomTypesTable.tabulator.replaceData("/");
|
||||
});
|
||||
},
|
||||
hideRoomTypeFormModal() {
|
||||
this.$refs.roomTypeFormModal.hide();
|
||||
this.$emit("hideBsModal");
|
||||
this.resetRoomTypeForm();
|
||||
},
|
||||
resetRoomTypeForm() {
|
||||
this.$refs.roomTypeForm?.clearValidation();
|
||||
|
||||
this.isEditInProgress = false;
|
||||
this.isRoomTypeFormVisible = false;
|
||||
|
||||
this.editedRoom = null;
|
||||
this.roomTypeFormData = {
|
||||
aktiv: true,
|
||||
};
|
||||
},
|
||||
async fetchRoomTypes() {
|
||||
let getRoomTypesResponse = await this.$api.call(
|
||||
ApiRoomType.getAllRoomTypes(),
|
||||
);
|
||||
if (getRoomTypesResponse.meta.status === "success") {
|
||||
this.roomTypes = getRoomTypesResponse.data;
|
||||
} else {
|
||||
this.$fhcAlert.alertError(this.$p.t("ui", "errorLoadingRoomTypes"));
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.fetchRoomTypes();
|
||||
|
||||
this.$p
|
||||
.loadCategory(["global", "lehre", "ui", "gruppenmanagement", "core", "person"])
|
||||
.then(() => {
|
||||
this.phrasesLoaded = true;
|
||||
});
|
||||
},
|
||||
template: /* html */ `
|
||||
<bs-modal
|
||||
ref="roomTypeFormModal"
|
||||
:bodyClass="'pt-4'"
|
||||
@hideBsModal="() => { $emit('hideBsModal'); resetRoomTypeForm(); }"
|
||||
size="sm"
|
||||
class="modal-lg"
|
||||
>
|
||||
<template #title>
|
||||
<p class="fw-bold mt-3">{{$capitalize($p.t('ui', 'assignRoomTypeToRoomModalTitle'))}}</p>
|
||||
</template>
|
||||
<template #default>
|
||||
<div class="d-flex justify-content-end mb-1">
|
||||
<a
|
||||
v-if="!isRoomTypeFormVisible && hasBasisOrtWPermission"
|
||||
:title='$capitalize($p.t("ui", "createRoomType"))'
|
||||
@click.prevent="isRoomTypeFormVisible = !isRoomTypeFormVisible"
|
||||
href="#"
|
||||
class="btn btn-primary rounded-circle">
|
||||
<i
|
||||
class="fa fa-plus"
|
||||
></i>
|
||||
</a>
|
||||
</div>
|
||||
<div v-if="isRoomTypeFormVisible && hasBasisOrtWPermission" class="row g-3 pb-3">
|
||||
<core-form ref="roomTypeForm">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<p class="fw-bold">{{$capitalize($p.t('ui', 'createRoomTypeFormTitle'))}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<form-input
|
||||
v-model="roomTypeFormData.shortCode"
|
||||
:label="$capitalize($p.t('gruppenmanagement', 'kurzbezeichnung'))"
|
||||
type="text"
|
||||
name="kurzbezeichnung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="col">
|
||||
<form-input
|
||||
v-model="roomTypeFormData.description"
|
||||
:label="$capitalize($p.t('gruppenmanagement', 'beschreibung'))"
|
||||
type="text"
|
||||
name="beschreibung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col d-flex justify-content-end gap-2">
|
||||
<button type="button" class="btn btn-secondary" @click="isRoomTypeFormVisible = false">{{$p.t('ui', 'abbrechen')}}</button>
|
||||
<button type="button" class="btn btn-primary" @click="createRoomType()">{{$p.t('ui', 'speichern')}}</button>
|
||||
</div>
|
||||
</core-form>
|
||||
</div>
|
||||
<div v-if="!isRoomTypeFormVisible && hasBasisOrtWPermission" class="row g-3 pb-3">
|
||||
<core-form ref="roomToRoomTypeForm">
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<form-input
|
||||
v-model="roomToRoomTypeFormData.roomType"
|
||||
:label="$capitalize($p.t('ui/roomType'))"
|
||||
:suggestions="filteredRoomTypes"
|
||||
:optionValue="(option) => option.value"
|
||||
:optionLabel="(option) => option.label"
|
||||
@complete="filterRoomTypes"
|
||||
dropdown
|
||||
forceSelection
|
||||
type="autocomplete"
|
||||
name="roomTypeShortCode"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="col">
|
||||
<form-input
|
||||
v-model="roomToRoomTypeFormData.hierarchy"
|
||||
:label="$capitalize($p.t('ui', 'hierarchy'))"
|
||||
type="number"
|
||||
name="hierarchy"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="col justify-content-end align-items-end d-flex">
|
||||
<button type="button" class="btn btn-primary" @click="createRoomToRoomTypeRelation()">{{$p.t('ui', 'speichern')}}</button>
|
||||
</div>
|
||||
</div>
|
||||
</core-form>
|
||||
</div>
|
||||
<hr v-if="hasBasisOrtWPermission" class="mb-3 mt-0" />
|
||||
<div class="row my-1">
|
||||
<div class="col">
|
||||
<p class="fw-bold">{{$capitalize($p.t('ui', 'assignedRoomTypesTitle'))}}</p>
|
||||
</div>
|
||||
</div>
|
||||
<core-filter-cmpt
|
||||
v-if="phrasesLoaded"
|
||||
ref="roomTypesTable"
|
||||
table-only
|
||||
:side-menu="false"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
>
|
||||
</core-filter-cmpt>
|
||||
</template>
|
||||
</bs-modal>
|
||||
`,
|
||||
};
|
||||
@@ -83,8 +83,6 @@ export default {
|
||||
});
|
||||
},
|
||||
open() {
|
||||
|
||||
this.getBuchungstypen(this.currentSemester);
|
||||
this.data = {
|
||||
buchungstyp_kurzbz: '',
|
||||
betrag: '-0.00',
|
||||
@@ -107,7 +105,7 @@ export default {
|
||||
const text = typ.standardtext || '';
|
||||
const creditpoints = typ.credit_points || '';
|
||||
|
||||
if (!this.data.betrag || this.data.betrag == '-0.00' || this.data.betrag !== amount)
|
||||
if (!this.data.betrag || this.data.betrag == '-0.00')
|
||||
this.data.betrag = amount;
|
||||
|
||||
if (!this.data.buchungstext)
|
||||
@@ -115,18 +113,7 @@ export default {
|
||||
|
||||
if (this.config.showCreditpoints && (this.data.credit_points == '0.00' || this.data.credit_points === null))
|
||||
this.data.credit_points = creditpoints;
|
||||
},
|
||||
getBuchungstypen(studiensemester_kurzbz)
|
||||
{
|
||||
this.$api
|
||||
.call(ApiKonto.getBuchungstypen(studiensemester_kurzbz))
|
||||
.then(result => {
|
||||
this.lists.buchungstypen = result.data;
|
||||
if (this.data.buchungstyp_kurzbz)
|
||||
this.checkDefaultBetrag(this.data.buchungstyp_kurzbz);
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<core-form ref="form" class="stv-details-konto-edit" @submit.prevent="save">
|
||||
@@ -179,7 +166,6 @@ export default {
|
||||
<form-input
|
||||
type="select"
|
||||
v-model="data.studiensemester_kurzbz"
|
||||
@change="getBuchungstypen(data.studiensemester_kurzbz)"
|
||||
name="studiensemester_kurzbz"
|
||||
:label="$p.t('lehre/studiensemester')"
|
||||
>
|
||||
|
||||
@@ -41,8 +41,8 @@ export default {
|
||||
),
|
||||
ajaxResponse: (url, params, response) => response.data,
|
||||
columns: [
|
||||
{title: "Typ", field: "type", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title: "Betrag", field: "betrag", headerFilter: true,
|
||||
{title: "Typ", field: "type"},
|
||||
{title: "Betrag", field: "betrag",
|
||||
formatter: function(cell) {
|
||||
let value = cell.getValue();
|
||||
if (value == null) {
|
||||
@@ -51,14 +51,14 @@ export default {
|
||||
return parseFloat(value).toFixed(2);
|
||||
}
|
||||
},
|
||||
{title: "Bezeichnung", field: "bezeichnung", headerFilter: true},
|
||||
{title: "Studiensemester", field: "studiensemester_kurzbz", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title: "Pruefung_id", field: "pruefung_id", visible: false, headerFilter: true},
|
||||
{title: "mitarbeiter_uid", field: "mitarbeiter_uid", visible: false, headerFilter: true},
|
||||
{title: "projektarbeit_id", field: "projektarbeit_id", visible: false, headerFilter: true},
|
||||
{title: "lehreinheit_id", field: "lehreinheit_id", visible: true, headerFilter: true},
|
||||
{title: "betreuerart_kurzbz", field: "betreuerart_kurzbz", visible: false, headerFilter: true},
|
||||
{title: "vertrag_id", field: "vertrag_id", visible: false, headerFilter: true}, //just for testing
|
||||
{title: "Bezeichnung", field: "bezeichnung"},
|
||||
{title: "Studiensemester", field: "studiensemester_kurzbz"},
|
||||
{title: "Pruefung_id", field: "pruefung_id", visible: false},
|
||||
{title: "mitarbeiter_uid", field: "mitarbeiter_uid", visible: false},
|
||||
{title: "projektarbeit_id", field: "projektarbeit_id", visible: false},
|
||||
{title: "lehreinheit_id", field: "lehreinheit_id", visible: true},
|
||||
{title: "betreuerart_kurzbz", field: "betreuerart_kurzbz", visible: false},
|
||||
{title: "vertrag_id", field: "vertrag_id", visible: false}, //just for testing
|
||||
{
|
||||
title: 'Aktionen', field: 'actions',
|
||||
minWidth: 50,
|
||||
@@ -110,10 +110,10 @@ export default {
|
||||
],
|
||||
layout: 'fitColumns',
|
||||
layoutColumnsOnNewData: false,
|
||||
height: '250',
|
||||
height: '200',
|
||||
selectableRowsRangeMode: 'click',
|
||||
selectableRows: true,
|
||||
persistenceID: 'core-contracts-details-2026050501'
|
||||
persistenceID: 'core-contracts-details-2026021701'
|
||||
},
|
||||
tabulatorEvents: [
|
||||
{
|
||||
@@ -137,7 +137,7 @@ export default {
|
||||
|
||||
setHeader('type', this.$p.t('global', 'typ'));
|
||||
setHeader('bezeichnung', this.$p.t('ui', 'bezeichnung'));
|
||||
setHeader('lehreinheit_id', this.$p.t('lehre', 'lehreinheit_id'));
|
||||
setHeader('lehreinheit_id', this.$p.t('ui', 'lehreinheit_id'));
|
||||
setHeader('betrag', this.$p.t('ui', 'betrag'));
|
||||
setHeader('studiensemester_kurzbz', this.$p.t('lehre', 'studiensemester'));
|
||||
setHeader('mitarbeiter_uid', this.$p.t('ui', 'mitarbeiter_uid'));
|
||||
|
||||
@@ -47,13 +47,12 @@ export default {
|
||||
this.endpoint.getStatiOfContract(this.person_id, this.vertrag_id)
|
||||
),
|
||||
ajaxResponse: (url, params, response) => response.data,
|
||||
persistenceID: 'core-contracts-status-2026050501',
|
||||
persistenceID: 'core-contracts-status-2026021701',
|
||||
columns: [
|
||||
{title: "Status", field: "bezeichnung", headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title: "Status", field: "bezeichnung"},
|
||||
{
|
||||
title: "Datum",
|
||||
field: "datum",
|
||||
headerFilter: true,
|
||||
formatter: function (cell) {
|
||||
const dateStr = cell.getValue();
|
||||
const date = new Date(dateStr); // Convert to Date object
|
||||
@@ -67,15 +66,14 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
{title: "vertrag_id", field: "vertrag_id", visible: false, headerFilter: true},
|
||||
{title: "Vertragsstatus", field: "vertragsstatus_kurzbz", visible: false, headerFilter: true},
|
||||
{title: "User", field: "mitarbeiter_uid", visible: false, headerFilter: true},
|
||||
{title: "insertvon", field: "insertvon", visible: false, headerFilter: true},
|
||||
{title: "vertrag_id", field: "vertrag_id", visible: false},
|
||||
{title: "Vertragsstatus", field: "vertragsstatus_kurzbz", visible: false},
|
||||
{title: "User", field: "mitarbeiter_uid", visible: false},
|
||||
{title: "insertvon", field: "insertvon", visible: false},
|
||||
{
|
||||
title: "insertamum",
|
||||
field: "insertamum",
|
||||
visible: false,
|
||||
headerFilter: true,
|
||||
formatter: function (cell) {
|
||||
const dateStr = cell.getValue();
|
||||
const date = new Date(dateStr);
|
||||
@@ -89,12 +87,11 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
{title: "updatevon", field: "updatevon", visible: false, headerFilter: true},
|
||||
{title: "updatevon", field: "updatevon", visible: false},
|
||||
{
|
||||
title: "updateamum",
|
||||
field: "updateamum",
|
||||
visible: false,
|
||||
headerFilter: true,
|
||||
formatter: function (cell) {
|
||||
const dateStr = cell.getValue();
|
||||
const date = new Date(dateStr);
|
||||
@@ -151,7 +148,7 @@ export default {
|
||||
],
|
||||
layout: 'fitColumns',
|
||||
layoutColumnsOnNewData: false,
|
||||
height: '250',
|
||||
height: '200',
|
||||
selectableRowsRangeMode: 'click',
|
||||
selectableRows: true,
|
||||
},
|
||||
|
||||
@@ -30,11 +30,10 @@ export default {
|
||||
),
|
||||
ajaxResponse: (url, params, response) => response.data,
|
||||
columns: [
|
||||
{title: "Typ", field: "type", width: 100, headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title: "Typ", field: "type", width: 100},
|
||||
{
|
||||
title: "Betrag",
|
||||
field: "betrag1",
|
||||
headerFilter: true,
|
||||
formatter: function(cell) {
|
||||
let value = cell.getValue();
|
||||
if (value == null) {
|
||||
@@ -42,29 +41,28 @@ export default {
|
||||
}
|
||||
return parseFloat(value).toFixed(2);
|
||||
}},
|
||||
{title: "Bezeichnung", field: "bezeichnung", width: 150, headerFilter: true},
|
||||
{title: "Studiensemester", field: "studiensemester_kurzbz", width: 160, headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title: "mitarbeiter_uid", field: "mitarbeiter_uid", visible: false, headerFilter: true},
|
||||
{title: "projektarbeit_id", field: "projektarbeit_id", visible: false, headerFilter: true},
|
||||
{title: "lehreinheit_id", field: "lehreinheit_id", visible: true, headerFilter: true},
|
||||
{title: "betreuerart_kurzbz", field: "betreuerart_kurzbz", visible: false, headerFilter: true},
|
||||
{title: "Vertragsstunden", field: "vertragsstunden", visible: false, headerFilter: true},
|
||||
{title: "vertrag_id", field: "vertrag_id", visible: false, headerFilter: true}, //just for testing
|
||||
{title: "Bezeichnung", field: "bezeichnung", width: 150},
|
||||
{title: "Studiensemester", field: "studiensemester_kurzbz", width: 160},
|
||||
{title: "mitarbeiter_uid", field: "mitarbeiter_uid", visible: false},
|
||||
{title: "projektarbeit_id", field: "projektarbeit_id", visible: false},
|
||||
{title: "lehreinheit_id", field: "lehreinheit_id", visible: true},
|
||||
{title: "betreuerart_kurzbz", field: "betreuerart_kurzbz", visible: false},
|
||||
{title: "Vertragsstunden", field: "vertragsstunden", visible: false},
|
||||
{title: "vertrag_id", field: "vertrag_id", visible: false}, //just for testing
|
||||
{
|
||||
title: "VertragsstundenStudiensemester",
|
||||
field: "vertragsstunden_studiensemester_kurzbz",
|
||||
visible: false,
|
||||
headerFilter: true
|
||||
visible: false
|
||||
},
|
||||
],
|
||||
layout: 'fitColumns',
|
||||
layoutColumnsOnNewData: false,
|
||||
height: 250,
|
||||
height: 150,
|
||||
selectableRowsRangeMode: 'click',
|
||||
selectableRows: true,
|
||||
selectableRowsRollingSelection: false, //only allow multiselect with STRG
|
||||
index: "lehreinheit_id",
|
||||
persistenceID: 'core-contracts-unassigned-2026050501'
|
||||
persistenceID: 'core-contracts-unassigned-2026021701'
|
||||
},
|
||||
tabulatorEvents: [
|
||||
{
|
||||
@@ -102,7 +100,7 @@ export default {
|
||||
|
||||
setHeader('type', this.$p.t('global', 'typ'));
|
||||
setHeader('bezeichnung', this.$p.t('ui', 'bezeichnung'));
|
||||
setHeader('lehreinheit_id', this.$p.t('lehre', 'lehreinheit_id'));
|
||||
setHeader('lehreinheit_id', this.$p.t('ui', 'lehreinheit_id'));
|
||||
setHeader('betrag1', this.$p.t('ui', 'betrag'));
|
||||
setHeader('studiensemester_kurzbz', this.$p.t('lehre', 'studiensemester'));
|
||||
setHeader('mitarbeiter_uid', this.$p.t('ui', 'mitarbeiter_uid'));
|
||||
|
||||
@@ -20,6 +20,9 @@ export default {
|
||||
ContractStati
|
||||
},
|
||||
inject: {
|
||||
/* cisRoot: {
|
||||
from: 'cisRoot'
|
||||
},*/
|
||||
hasSchreibrechte: {
|
||||
from: 'hasSchreibrechte',
|
||||
default: false
|
||||
@@ -51,9 +54,9 @@ export default {
|
||||
),
|
||||
ajaxResponse: (url, params, response) => response.data,
|
||||
columns: [
|
||||
{title: "Bezeichnung", field: "bezeichnung", width: 300, headerFilter: true},
|
||||
{title: "Bezeichnung", field: "bezeichnung", width: 300},
|
||||
{
|
||||
title: "Betrag", field: "betrag", width: 100, headerFilter: true,
|
||||
title: "Betrag", field: "betrag", width: 100,
|
||||
formatter: function (cell) {
|
||||
let value = cell.getValue();
|
||||
|
||||
@@ -63,13 +66,12 @@ export default {
|
||||
return parseFloat(value).toFixed(2);
|
||||
}
|
||||
},
|
||||
{title: "Vertragstyp", field: "vertragstyp_bezeichnung", width: 125, headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title: "Status", field: "status", width: 100, headerFilter: "list", headerFilterParams: {valuesLookup:true, listOnEmpty:true, autocomplete:true, sort:"asc"}},
|
||||
{title: "Vertragstyp", field: "vertragstyp_bezeichnung", width: 125},
|
||||
{title: "Status", field: "status", width: 100},
|
||||
{
|
||||
title: "Vertragsdatum",
|
||||
field: "vertragsdatum",
|
||||
width: 128,
|
||||
headerFilter: true,
|
||||
formatter: function (cell) {
|
||||
const dateStr = cell.getValue();
|
||||
const date = new Date(dateStr);
|
||||
@@ -80,11 +82,11 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
{title: "VertragId", field: "vertrag_id", visible: false, headerFilter: true},
|
||||
{title: "Vertragsstunden", field: "vertragsstunden", visible: false, headerFilter: true},
|
||||
{title: "VertragsstundenStudiensemester", field: "vertragsstunden_studiensemester_kurzbz", visible: false, headerFilter: true},
|
||||
{title: "Anmerkung", field: "anmerkung", visible: false, headerFilter: true},
|
||||
{title: "isAbgerechnet", field: "isabgerechnet", visible: false, headerFilter: true},
|
||||
{title: "VertragId", field: "vertrag_id", visible: false},
|
||||
{title: "Vertragsstunden", field: "vertragsstunden", visible: false},
|
||||
{title: "VertragsstundenStudiensemester", field: "vertragsstunden_studiensemester_kurzbz", visible: false},
|
||||
{title: "Anmerkung", field: "anmerkung", visible: false},
|
||||
{title: "isAbgerechnet", field: "isabgerechnet", visible: false},
|
||||
{
|
||||
title: 'Aktionen', field: 'actions',
|
||||
minWidth: 150,
|
||||
@@ -138,13 +140,11 @@ export default {
|
||||
columns: true,
|
||||
filter: false //to avoids js errors
|
||||
},
|
||||
persistenceID: 'core-contracts-2026050501',
|
||||
persistenceID: 'core-contracts-2026021701',
|
||||
};
|
||||
return options;
|
||||
},
|
||||
tabulatorEvents() {
|
||||
const vm = this;
|
||||
|
||||
const events = [
|
||||
{
|
||||
event: 'tableBuilt',
|
||||
@@ -177,11 +177,28 @@ export default {
|
||||
setHeader('actions', this.$p.t('global', 'aktionen'));
|
||||
}
|
||||
},
|
||||
/* {
|
||||
//is just enabled for ADDON Injection KU: MultiprintHonorarvertrag
|
||||
//(maybe enable also for ADDON FH Burgenland: MultiAccept later)
|
||||
event: 'rowClick',
|
||||
handler: (e, row) => {
|
||||
if (this.dataPrintHonorar != null && this.dataPrintHonorar.multiselect != null) {
|
||||
const selectedContract = row.getData().vertrag_id;
|
||||
const status = row.getData().status;
|
||||
const bezeichnung = row.getData().bezeichnung;
|
||||
|
||||
this.toggleRowClick(selectedContract, status, bezeichnung);
|
||||
}
|
||||
}
|
||||
},*/
|
||||
{
|
||||
event: 'rowClick',
|
||||
handler: function (e, row) {
|
||||
handler: (e, row) => {
|
||||
if (!this.dataPrintHonorar?.multiselect) return;
|
||||
|
||||
const { vertrag_id, status, bezeichnung, vertragstyp_bezeichnung } = row.getData();
|
||||
vm.toggleRowClick(e, vertrag_id, status, bezeichnung, vertragstyp_bezeichnung);
|
||||
|
||||
this.toggleRowClick(e, vertrag_id, status, bezeichnung, vertragstyp_bezeichnung);
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -225,6 +242,8 @@ export default {
|
||||
person_id() {
|
||||
this.$refs.table.reloadTable();
|
||||
this.arraySelectedContracts = [];
|
||||
/* if(this.dataPrintHonorar?.multiselect)
|
||||
this.dataPrintHonorar.multiselect = [];*/
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
@@ -251,6 +270,7 @@ export default {
|
||||
)
|
||||
.then(result => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
|
||||
//window.scrollTo(0, 0);
|
||||
this.reload();
|
||||
this.contractSelected.vertrag_id = null;
|
||||
})
|
||||
@@ -498,9 +518,19 @@ export default {
|
||||
'content/pdfExport.php?xml=' + this.dataPrintHonorar.xml + '&xsl=' + this.dataPrintHonorar.xsl + '&mitarbeiter_uid=' + this.mitarbeiter_uid + vertragString + '&output=pdf&uid=' + this.mitarbeiter_uid;
|
||||
window.open(linkToPdf, '_blank');
|
||||
},
|
||||
/* toggleRowClick(contractId, status, bezeichnung) {
|
||||
const index = this.arraySelectedContracts.findIndex(
|
||||
([id]) => id === contractId
|
||||
);
|
||||
if (index !== -1) {
|
||||
this.arraySelectedContracts.splice(index, 1);
|
||||
} else {
|
||||
this.arraySelectedContracts.push([contractId, status, bezeichnung]);
|
||||
}
|
||||
},*/
|
||||
toggleRowClick(event, vertrag_id, status, bezeichnung, vertragstyp_bezeichnung) {
|
||||
if (!this.dataPrintHonorar?.multiselect) return;
|
||||
|
||||
const isMulti = this.dataPrintHonorar?.multiselect === true;
|
||||
const isCtrl = event.ctrlKey || event.metaKey;
|
||||
|
||||
const entry = {
|
||||
@@ -510,29 +540,28 @@ export default {
|
||||
vertragstyp_bezeichnung
|
||||
};
|
||||
|
||||
// allow MultiSelect just in case event multiActionPrintHonorarvertrag
|
||||
const allowMultiClick = isMulti && isCtrl;
|
||||
|
||||
if (!allowMultiClick) {
|
||||
// Single click
|
||||
if (!isCtrl) {
|
||||
this.arraySelectedContracts = [entry];
|
||||
|
||||
//just mark last selected row as selected
|
||||
this.$refs.table.tabulator.deselectRow();
|
||||
this.$refs.table.tabulator.selectRow(vertrag_id);
|
||||
return;
|
||||
}
|
||||
|
||||
// CTRL / CMD → toggle
|
||||
const index = this.arraySelectedContracts.findIndex(
|
||||
e => e.vertrag_id === vertrag_id
|
||||
);
|
||||
|
||||
if (index === -1) {
|
||||
this.arraySelectedContracts.push(entry);
|
||||
//this.arraySelectedContracts.push([entry.vertrag_id, entry.status, entry.bezeichnung, entry.vertragstyp_bezeichnung]);
|
||||
} else {
|
||||
this.arraySelectedContracts.splice(index, 1);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
/* clearSelection(){
|
||||
this.arraySelectedContracts = [];
|
||||
this.$refs.table.tabulator.deselectRow();
|
||||
}*/
|
||||
},
|
||||
created() {
|
||||
Promise.all([
|
||||
@@ -558,6 +587,88 @@ export default {
|
||||
});
|
||||
this.getFormattedDate();
|
||||
},
|
||||
/*
|
||||
TODO(Manu) delete after check
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="DatePicker"
|
||||
:label="$p.t('vertrag/datum_vertrag')"
|
||||
name="vertragsdatum"
|
||||
v-model="formData.vertragsdatum"
|
||||
auto-apply
|
||||
:enable-time-picker="false"
|
||||
format="dd.MM.yyyy"
|
||||
preview-format="dd.MM.yyyy"
|
||||
:teleport="true"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="text"
|
||||
:label="$p.t('ui/bezeichnung')"
|
||||
name="bezeichnung"
|
||||
v-model="formData.bezeichnung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="select"
|
||||
:label="$p.t('global/typ')"
|
||||
v-model="formData.vertragstyp_kurzbz"
|
||||
name="vertragstyp_kurzbz"
|
||||
>
|
||||
<option :value="null">-- {{$p.t('fehlermonitoring', 'keineAuswahl')}} --</option>
|
||||
<option
|
||||
v-for="entry in listContractTypes"
|
||||
:key="entry.vertragstyp_kurzbz"
|
||||
:value="entry.vertragstyp_kurzbz"
|
||||
>
|
||||
{{entry.bezeichnung}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
:label="$p.t('ui/betrag')"
|
||||
name="betrag"
|
||||
v-model="formData.betrag"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3" v-if="!statusNew">
|
||||
<form-input
|
||||
type="text"
|
||||
:label="$p.t('ui/stunden') + ' (' + $p.t('vertrag/vertrag_urfassung')+ ')'"
|
||||
name="vertragsstunden"
|
||||
v-model="formData.vertragsstunden"
|
||||
disabled
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3" v-if="!statusNew">
|
||||
<form-input
|
||||
type="text"
|
||||
:label="$p.t('lehre/studiensemester') + ' (' + $p.t('vertrag/vertrag_urfassung')+ ')'"
|
||||
name="vertragsstunden_studiensemester_kurzbz"
|
||||
v-model="formData.vertragsstunden_studiensemester_kurzbz"
|
||||
disabled
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
type="textarea"
|
||||
:label="$p.t('global/anmerkung')"
|
||||
name="anmerkung"
|
||||
v-model="formData.anmerkung"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
*/
|
||||
template: `
|
||||
<div class="core-contracts h-100 d-flex flex-column">
|
||||
|
||||
|
||||
@@ -705,72 +705,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
}
|
||||
echo ' </anrechnungen>';
|
||||
|
||||
//Berufliche Kompetenzen
|
||||
$studienplan = new studienplan();
|
||||
$studienplan->loadStudienplan($studienplan_id);
|
||||
$regelstudiendauer = $studienplan->regelstudiendauer;
|
||||
$studienplan_ects = $studienplan->ects_stpl;
|
||||
$ects_berufliche_kompetenzen = 0;
|
||||
|
||||
//bei masterlehrgängen und $studienplan_ects >= 120 ECTS: Andruck der beruflichen Kompetenzen, wenn die Lv angerechnet wurde
|
||||
//TODO(Manu) check if rule still valid
|
||||
if ($row->typ == 'l' && $regelstudiendauer >= 4)
|
||||
{
|
||||
$ects_berufliche_kompetenzen = 0;
|
||||
echo '<berufliche_kompetenzen>';
|
||||
echo '<header_berufliche_kompetenz>Validierung von beruflich erworbenen Kompetenzen</header_berufliche_kompetenz>';
|
||||
|
||||
$qry_sem_0="
|
||||
SELECT
|
||||
lehrveranstaltung_id,
|
||||
lehrform_kurzbz,
|
||||
sws,
|
||||
lehre.tbl_lehrveranstaltung.bezeichnung,
|
||||
bezeichnung_english,
|
||||
ects,
|
||||
benotungsdatum,
|
||||
note,
|
||||
positiv,
|
||||
offiziell,
|
||||
note.anmerkung
|
||||
FROM
|
||||
lehre.tbl_zeugnisnote zeugnis
|
||||
JOIN lehre.tbl_note note USING(note)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
JOIN public.tbl_student student USING(student_uid)
|
||||
WHERE
|
||||
student_uid =".$db->db_add_param($uid_arr[$i])."
|
||||
AND
|
||||
lehre.tbl_lehrveranstaltung.semester = '0'
|
||||
";
|
||||
|
||||
if($result_sem_0 = $db->db_query($qry_sem_0))
|
||||
{
|
||||
while ($row_sem_0 = $db->db_fetch_object($result_sem_0))
|
||||
{
|
||||
$benotungsdatum = $datum->formatDatum($row_sem_0->benotungsdatum, 'd/m/Y');
|
||||
$note = $db->db_parse_bool($row_sem_0->offiziell) ? $row_sem_0->anmerkung : $row_sem_0->note;
|
||||
$ects_berufliche_kompetenzen += $row_sem_0->ects;
|
||||
|
||||
echo '<lv_sem0>
|
||||
<lv_id>' . $row_sem_0->lehrveranstaltung_id . '</lv_id>
|
||||
<lehrform_kurzbz>' . $row_sem_0->lehrform_kurzbz . '</lehrform_kurzbz>
|
||||
<bezeichnung><![CDATA[' . $row_sem_0->bezeichnung . ']]></bezeichnung>
|
||||
<bezeichnung_englisch><![CDATA[' . $row_sem_0->bezeichnung_english . ']]></bezeichnung_englisch>
|
||||
<sws_lv>'.$row_sem_0->sws.'</sws_lv>
|
||||
<ects>'.$row_sem_0->ects.'</ects>
|
||||
<note_positiv>'.$db->db_parse_bool($row_sem_0->positiv).'</note_positiv>
|
||||
<note>'.$note.'</note>
|
||||
<benotungsdatum>'.$benotungsdatum.'</benotungsdatum>
|
||||
</lv_sem0>';
|
||||
}
|
||||
}
|
||||
echo '<ects_berufliche_kompetenz>'.$ects_berufliche_kompetenzen.'</ects_berufliche_kompetenz>';
|
||||
echo '</berufliche_kompetenzen>';
|
||||
}
|
||||
|
||||
echo "<studiensemester>";
|
||||
|
||||
for($start = $semesterNumberStart; $start <= $semesterNumberEnd; $start++)
|
||||
{
|
||||
$semester_ects = 0;
|
||||
@@ -793,7 +728,6 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
AND zeugnis = true
|
||||
AND status.ausbildungssemester = ".$db->db_add_param($start)."
|
||||
AND status.status_kurzbz NOT IN('Unterbrecher', 'Interessent','Bewerber','Aufgenommener','Abgewiesener','Wartender')
|
||||
--AND lehre.tbl_lehrveranstaltung.semester != '0'
|
||||
ORDER BY datum ASC";
|
||||
|
||||
$semester_kurzbz = array();
|
||||
@@ -842,7 +776,6 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
WHERE
|
||||
student_uid = ".$db->db_add_param($uid_arr[$i])."
|
||||
AND zeugnis = true
|
||||
AND lehre.tbl_lehrveranstaltung.semester != '0'
|
||||
AND studiensemester_kurzbz in (".$sqlStudent->implode4SQL($aktuellesSemester).")";
|
||||
|
||||
if (defined('ZEUGNISNOTE_NICHT_ANZEIGEN'))
|
||||
@@ -1201,19 +1134,10 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo '<ects_gesamt>'.$semester_ects.'</ects_gesamt>';
|
||||
echo '<ects_gesamt_positiv>'.$semester_ects_positiv.'</ects_gesamt_positiv>';
|
||||
echo "</semesters>";
|
||||
}
|
||||
|
||||
//TODO(Manu) check if rule still valid
|
||||
if ($row->typ == 'l' && $regelstudiendauer >= 4)
|
||||
{
|
||||
$ects_total += $ects_berufliche_kompetenzen;
|
||||
$ects_total_positiv += $ects_berufliche_kompetenzen;
|
||||
}
|
||||
|
||||
echo "</studiensemester>";
|
||||
echo " <ects_total>$ects_total</ects_total>";
|
||||
echo " <ects_total_positiv>$ects_total_positiv</ects_total_positiv>";
|
||||
|
||||
@@ -94,8 +94,7 @@ require_once('dbupdate_3.4/71399_dashboard_update_widget_paths.php');
|
||||
require_once('dbupdate_3.4/71645_studvw_messagetab_ladezeit.php');
|
||||
require_once('dbupdate_3.4/71566_studienordnungsdokument_neuer_organisationseinheitstyp_programm.php');
|
||||
require_once('dbupdate_3.4/70376_lohnguide.php');
|
||||
require_once('dbupdate_3.4/75888_reihungstest_mehrfachdurchfuehrung.php');
|
||||
|
||||
require_once('dbupdate_3.4/76663_tempus_rekursive_raum_struktur.php');
|
||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
|
||||
|
||||
|
||||
@@ -264,8 +264,8 @@ CREATE TABLE IF NOT EXISTS hr.tbl_vertragsbestandteil_lohnguide (
|
||||
stellenbezeichnung varchar(255),
|
||||
fachrichtung_kurzbz character varying(32) NOT NULL,
|
||||
modellstelle_kurzbz character varying(32) NOT NULL,
|
||||
kommentar_person text,
|
||||
kommentar_modellstelle text,
|
||||
kommentar_person varchar(255),
|
||||
kommentar_modellstelle varchar(255),
|
||||
CONSTRAINT tbl_vertragsbestandteil_lohnguide_pk PRIMARY KEY (vertragsbestandteil_id),
|
||||
CONSTRAINT tbl_vertragsbestandteil_fk FOREIGN KEY (vertragsbestandteil_id) REFERENCES hr.tbl_vertragsbestandteil (vertragsbestandteil_id) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE,
|
||||
CONSTRAINT tbl_vertragsbestandteil_lohnguide_fachrichtung_fk FOREIGN KEY (fachrichtung_kurzbz) REFERENCES hr.tbl_lohnguide_fachrichtung (fachrichtung_kurzbz) MATCH FULL ON DELETE RESTRICT ON UPDATE CASCADE,
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
if ($result = $db->db_query("SELECT * FROM pg_class WHERE relname='idx_tbl_benutzerfunktion_uid'"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "CREATE INDEX idx_tbl_benutzerfunktion_uid ON public.tbl_benutzerfunktion USING btree (uid)";
|
||||
|
||||
if (! $db->db_query($qry))
|
||||
echo '<strong>idx_tbl_benutzerfunktion_uid: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo 'Index idx_tbl_benutzerfunktion_uid angelegt<br>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
if(!$result = @$db->db_query("SELECT parent_ort_kurzbz FROM public.tbl_ort LIMIT 1;"))
|
||||
{
|
||||
$qry = 'ALTER TABLE public.tbl_ort ADD COLUMN parent_ort_kurzbz VARCHAR(16);';
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_ort: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo ' public.tbl_ort: parent_ort_kurzbz added successfully.<br>';
|
||||
}
|
||||
|
||||
$result = $db->db_query("SELECT constraint_name FROM information_schema.table_constraints
|
||||
WHERE table_name='tbl_ort' AND constraint_type='FOREIGN KEY' AND constraint_name='fk_parent_ort_kurzbz'");
|
||||
if($db->db_num_rows($result)==0)
|
||||
{
|
||||
$qry = "ALTER TABLE public.tbl_ort ADD CONSTRAINT fk_parent_ort_kurzbz FOREIGN KEY(parent_ort_kurzbz) REFERENCES public.tbl_ort(ort_kurzbz);";
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_ort: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>Added foreign key constraint fk_parent_ort_kurzbz to public.tbl_ort';
|
||||
}
|
||||
+1068
-1
File diff suppressed because it is too large
Load Diff
@@ -67,6 +67,7 @@
|
||||
$gebteil='';
|
||||
$m2='';
|
||||
$arbeitsplaetze='';
|
||||
$parent_ort_kurzbz = '';
|
||||
|
||||
$neu = "true";
|
||||
|
||||
@@ -93,6 +94,7 @@
|
||||
$oe_kurzbz = $_POST["oe_kurzbz"];
|
||||
$gebteil = $_POST["gebteil"];
|
||||
$arbeitsplaetze = $_POST["arbeitsplaetze"];
|
||||
$parent_ort_kurzbz = $_POST["parent_ort_kurzbz"];
|
||||
|
||||
$sg_update = new ort();
|
||||
$sg_update->ort_kurzbz = $ort_kurzbz;
|
||||
@@ -115,6 +117,7 @@
|
||||
$sg_update->gebteil = $gebteil;
|
||||
$sg_update->oe_kurzbz = $oe_kurzbz;
|
||||
$sg_update->arbeitsplaetze = $arbeitsplaetze;
|
||||
$sg_update->parent_ort_kurzbz = $parent_ort_kurzbz;
|
||||
$sg_update->updateamum = date('Y-m-d H:i:s');
|
||||
$sg_update->updatevon = $user;
|
||||
|
||||
@@ -161,6 +164,7 @@
|
||||
$m2 = $sg->m2;
|
||||
$oe_kurzbz = $sg->oe_kurzbz;
|
||||
$arbeitsplaetze = $sg->arbeitsplaetze;
|
||||
$parent_ort_kurzbz = $sg->parent_ort_kurzbz;
|
||||
$neu = "false";
|
||||
}
|
||||
|
||||
@@ -402,6 +406,8 @@
|
||||
<td><input class="detail" type="text" name="telefonklappe" size="3" maxlength="8" value="'.$telefonklappe.'" onchange="submitable()"></td>
|
||||
<td>Anz. Arbeitsplätze</td>
|
||||
<td><input class="detail" type="text" name="arbeitsplaetze" size="3" maxlength="8" value="'.$arbeitsplaetze.'" onchange="submitable()"></td>
|
||||
<td>Parent Raum Kurzbz</td>
|
||||
<td><input type="text" name="parent_ort_kurzbz" size="10" onchange="submitable()" value="'.$parent_ort_kurzbz.'" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">Lageplan</td>
|
||||
|
||||
@@ -244,6 +244,7 @@ if (isset($_GET['sendform']))
|
||||
<th>Aktiv</th>
|
||||
<th>Kosten</th>
|
||||
<th>Stockwerk</th>
|
||||
<th>Parent Ort Kurzbz</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
@@ -287,6 +288,7 @@ if (isset($_GET['sendform']))
|
||||
|
||||
$htmlstr .= " <td>".$twraum->kosten."</td>\n";
|
||||
$htmlstr .= " <td>".$twraum->stockwerk."</td>\n";
|
||||
$htmlstr .= " <td><a href='raum_details.php?ort_kurzbz=".$twraum->parent_ort_kurzbz."' target='detail_raum'>".$twraum->parent_ort_kurzbz."</a></td>\n";
|
||||
|
||||
$htmlstr .= " </tr>\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user