Compare commits

..

10 Commits

87 changed files with 9096 additions and 4180 deletions
@@ -1,161 +0,0 @@
<?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 (FAS) and the AntragLib (back-end)
* This controller works with calls on the HTTP GET or POST and the output is always RDF
*/
class Wiederholung extends Auth_Controller
{
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
parent::__construct([
'getLvs' => ['student/studierendenantrag:r', 'student/noten:r'],
'moveLvsToZeugnis' => ['student/studierendenantrag:w', 'student/noten:w']
]);
// Libraries
$this->load->library('AntragLib');
// Load language phrases
$this->loadPhrases([
'global',
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
public function getLvs($prestudent_id)
{
// header für no cache
$this->output->set_header("Cache-Control: no-cache");
$this->output->set_header("Cache-Control: post-check=0, pre-check=0", false);
$this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
$this->output->set_header("Pragma: no-cache");
$this->output->set_header("Content-type: application/xhtml+xml");
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
$sem_akt = $this->variablelib->getVar('semester_aktuell');
$result = $this->antraglib->getLvsForPrestudent($prestudent_id, $sem_akt);
$lvs = $this->getDataOrTerminateWithError($result) ?: [];
$rdf_url = 'http://www.technikum-wien.at/antragnote';
$this->load->view('lehre/Antrag/Wiederholung/getLvs.rdf.php', [
'url' => $rdf_url,
'lvs' => $lvs
]);
}
public function moveLvsToZeugnis()
{
$anzahl = $this->input->post('anzahl');
$student_uid = $this->input->post('student_uid');
$this->load->model('education/Studierendenantraglehrveranstaltung_model', 'StudierendenantraglehrveranstaltungModel');
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
$errormsg = array();
for($i=0; $i<$anzahl; $i++)
{
$id = $this->input->post('studierendenantrag_lehrveranstaltung_id_' . $i);
$result =$this->StudierendenantraglehrveranstaltungModel->load($id);
if(isError($result))
{
$errormsg[] = getError($result);
}
elseif(!hasData($result))
{
$errormsg[] = $this->p->t('studierendenantrag', 'error_no_lv_in_application');
}
else
{
$antragLv = getData($result)[0];
$result= $this->ZeugnisnoteModel->load([
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz
]);
if(isError($result))
{
$errormsg[] = getError($result);
}
else
{
if (hasData($result))
{
$result = $this->ZeugnisnoteModel->update(
[
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz
],
[
'note'=> $antragLv->note,
'uebernahmedatum' => date('c'),
'benotungsdatum' => $antragLv->insertamum,
'updateamum' => date('c'),
'bemerkung'=>$antragLv->anmerkung,
'updatevon'=>getAuthUID()
]
);
}
else
{
$result = $this->ZeugnisnoteModel->insert([
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz,
'note'=> $antragLv->note,
'uebernahmedatum' => date('c'),
'benotungsdatum' => $antragLv->insertamum,
'insertamum' => date('c'),
'bemerkung'=>$antragLv->anmerkung,
'insertvon'=>getAuthUID()
]);
}
if(isError($result))
{
$errormsg[] = getError($result);
}
}
}
}
if($errormsg)
$return = false;
else
$return = true;
$this->load->view('lehre/Antrag/Wiederholung/moveLvs.rdf.php', [
'return' => $return,
'errormsg' => $errormsg
]);
}
}
@@ -1,231 +0,0 @@
<?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 FilterCmptLib (back-end)
* Provides data to the ajax get calls about the filter component
* Listens to ajax post calls to change the filter data
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Filter extends FHCAPI_Controller
{
const FILTER_UNIQUE_ID = 'filterUniqueId'; // Name of the filter cmpt unique id (mandatory)
const FILTER_TYPE = 'filterType'; // The filter type (PHP filter definition) used (mandatory)
const FILTER_ID = 'filterId'; // The id of the used filter (optional)
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
// NOTE: FilterCmpt has its own permissions checks
parent::__construct([
'getFilter' => self::PERM_LOGGED,
'removeFilterField' => self::PERM_LOGGED,
'addFilterField' => self::PERM_LOGGED,
'applyFilterFields' => self::PERM_LOGGED,
'removeCustomFilter' => self::PERM_LOGGED,
'saveCustomFilter' => self::PERM_LOGGED,
'reloadDataset' => self::PERM_LOGGED
]);
// Loads the FiltersModel
$this->load->model('system/Filters_model', 'FiltersModel');
// Loads the FilterCmptLib with HTTP GET/POST parameters
$this->_startFilterCmptLib();
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Retrieves data about the current filter from the session and will be written on the output in JSON format
*/
public function getFilter()
{
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$session = $this->filtercmptlib->getSession();
if (is_object($session)) {
// If stdClass it is an retval object
$session = $this->getDataOrTerminateWithError($session);
}
$this->terminateWithSuccess($session);
}
/**
* Remove an applied filter (SQL where condition) from the current filter
*/
public function removeFilterField()
{
$this->form_validation->set_rules('filterField', 'filterField', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->removeFilterField($this->input->post('filterField'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Field removed');
}
/**
* Add a filter (SQL where clause) to be applied to the current filter
*/
public function addFilterField()
{
$this->form_validation->set_rules('filterField', 'filterField', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->addFilterField($this->input->post('filterField'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Field added');
}
/**
* Apply the filter changes
*/
public function applyFilterFields()
{
$this->form_validation->set_rules('filterFields', 'filterFields', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->applyFilterFields($this->input->post('filterFields'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Applied');
}
/**
* Save the current filter as a custom filter for this user with the given description
*/
public function saveCustomFilter()
{
$this->form_validation->set_rules('customFilterName', 'customFilterName', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->saveCustomFilter($this->input->post('customFilterName'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Saved');
}
/**
* Remove a custom filter by its filterId
*/
public function removeCustomFilter()
{
$this->form_validation->set_rules('filterId', 'filterId', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$result = $this->filtercmptlib->removeCustomFilter($this->input->post('filterId'));
if (!$result)
$this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess('Removed');
}
/**
* Reloads the dataset
*/
public function reloadDataset()
{
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$this->filtercmptlib->reloadDataset();
$this->terminateWithSuccess('Success');
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Loads the FilterCmptLib with the FILTER_UNIQUE_ID parameter
* If the parameter FILTER_UNIQUE_ID is not given then the execution of the controller is terminated and
* an error message is printed
*/
private function _startFilterCmptLib()
{
$filterUniqueId = null;
$filterType = null;
$filterId = null;
$validations = [
[
'field' => self::FILTER_UNIQUE_ID,
'label' => self::FILTER_UNIQUE_ID,
'rules' => 'required'
],
[
'field' => self::FILTER_TYPE,
'label' => self::FILTER_TYPE,
'rules' => 'required'
],
];
$this->load->library('form_validation');
if ($this->input->method() == 'get')
$this->form_validation->set_data($this->input->get());
$this->form_validation->set_rules($validations);
if ($this->form_validation->run()) {
$filterUniqueId = $this->input->post_get(self::FILTER_UNIQUE_ID);
$filterType = $this->input->post_get(self::FILTER_TYPE);
$filterId = $this->input->post_get(self::FILTER_ID);
// Loads the FilterCmptLib that contains all the used logic
$this->load->library(
'FilterCmptLib',
array(
'filterUniqueId' => $filterUniqueId,
'filterType' => $filterType,
'filterId' => $filterId
)
);
// Start the component
$this->filtercmptlib->start();
}
}
}
@@ -1,101 +0,0 @@
<?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 NavigationLib (back-end)
* Provides data to the ajax get calls about the filter
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Navigation extends FHCAPI_Controller
{
const NAVIGATION_PAGE_PARAM = 'navigation_page'; // Navigation page parameter name
/**
* Loads the NavigationLib where the used logic lies
*/
public function __construct()
{
parent::__construct([
'menu' => self::PERM_LOGGED,
'header' => self::PERM_LOGGED
]);
$this->_loadNavigationLib(); // Loads the NavigationLib with parameters
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* This function creates the left Menu for each Page
* @param NAVIGATION_PAGE_PARAM GET Parameter witch holds the currently called Page
* @return JSON object with the Menu Entries
*/
public function menu()
{
$menuArray = $this->navigationlib->getMenuArray($this->input->get(self::NAVIGATION_PAGE_PARAM));
$this->terminateWithSuccess($menuArray);
}
/**
* This function creates the Top Menu for each Page
* @param NAVIGATION_PAGE_PARAM GET Parameter witch holds the currently called Page
* @return JSON object with the Menu Entries
*/
public function header()
{
$headerArray = $this->navigationlib->getHeaderArray($this->input->get(self::NAVIGATION_PAGE_PARAM));
$this->terminateWithSuccess($headerArray);
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Loads the NavigationLib with the NAVIGATION_PAGE_PARAM parameter
* If the parameter NAVIGATION_PAGE_PARAM is not given then the execution of the controller is terminated and
* an error message is printed
*/
private function _loadNavigationLib()
{
// If the parameter NAVIGATION_PAGE_PARAM is present in the HTTP GET or POST
if (isset($_GET[self::NAVIGATION_PAGE_PARAM]) || isset($_POST[self::NAVIGATION_PAGE_PARAM]))
{
// If it is present in the HTTP GET
if (isset($_GET[self::NAVIGATION_PAGE_PARAM]))
{
$navigationPage = $this->input->get(self::NAVIGATION_PAGE_PARAM); // is retrieved from the HTTP GET
}
elseif (isset($_POST[self::NAVIGATION_PAGE_PARAM])) // Else if it is present in the HTTP POST
{
$navigationPage = $this->input->post(self::NAVIGATION_PAGE_PARAM); // is retrieved from the HTTP POST
}
// Loads the NavigationLib that contains all the used logic
$this->load->library('NavigationLib', array(self::NAVIGATION_PAGE_PARAM => $navigationPage));
}
else // Otherwise an error will be written in the output
{
show_error('Parameter "' . self::NAVIGATION_PAGE_PARAM . '" not provided!');
}
}
}
@@ -1,46 +0,0 @@
<?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 PhrasesLib (back-end)
* Provides data to the ajax get calls about the Phrasen plugin
* This controller works with JSON calls on the HTTP GET and the output is always JSON
*/
class Phrasen extends FHCAPI_Controller
{
public function __construct()
{
parent::__construct([
'loadModule' => self::PERM_ANONYMOUS
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* @param string $module
*/
public function loadModule($module)
{
$this->load->library('PhrasesLib', [$module], 'pj');
$this->terminateWithSuccess(json_decode($this->pj->getJSON()));
}
}
@@ -1,69 +0,0 @@
<?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 Searchbar extends FHCAPI_Controller
{
const SEARCHSTR_PARAM = 'searchstr';
const TYPES_PARAM = 'types';
/**
* Object initialization
*/
public function __construct()
{
// NOTE(chris): additional permission checks will be done in SearchBarLib
parent::__construct([
'search' => self::PERM_LOGGED
]);
// Load the library SearchBarLib
$this->load->library('SearchBarLib');
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Gets a JSON body via HTTP POST and provides the parameters
*/
public function search()
{
$this->load->library('form_validation');
// Checks if the searchstr and the types parameters are in the POSTed JSON
$this->form_validation->set_rules(self::SEARCHSTR_PARAM, null, 'required');
$this->form_validation->set_rules(self::TYPES_PARAM . '[]', null, 'required');
if (!$this->form_validation->run())
$this->terminateWithError(SearchBarLib::ERROR_WRONG_JSON, self::ERROR_TYPE_GENERAL);
// Convert to json the result from searchbarlib->search
$result = $this->searchbarlib->search($this->input->post(self::SEARCHSTR_PARAM), $this->input->post(self::TYPES_PARAM));
if (property_exists($result, 'error'))
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
$this->terminateWithSuccess($result);
}
}
@@ -1,187 +0,0 @@
<?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');
use \REST_Controller as REST_Controller;
use \Studierendenantrag_model as Studierendenantrag_model;
/**
* This controller operates between (interface) the JS (GUI) and the AntragLib (back-end)
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Abmeldung extends FHCAPI_Controller
{
/**
* Calls the parent's constructor and loads the AntragLib
*/
public function __construct()
{
parent::__construct([
'getDetailsForNewAntrag' => self::PERM_LOGGED,
'getDetailsForAntrag' => self::PERM_LOGGED,
'createAntrag' => self::PERM_LOGGED,
'cancelAntrag' => self::PERM_LOGGED
]);
// Libraries
$this->load->library('AntragLib');
// Load language phrases
$this->loadPhrases([
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Retrieves data of the current studiengang for the current user
*/
public function getDetailsForNewAntrag($prestudent_id)
{
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, true))
$this->terminateWithError('Forbidden', self::ERROR_TYPE_AUTH, REST_Controller::HTTP_FORBIDDEN);
$result = $this->antraglib->getPrestudentAbmeldeBerechtigt($prestudent_id);
$result = $this->getDataOrTerminateWithError($result);
if (!$result) {
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_no_student'),
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
} elseif ($result == -3) {
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_stg_blacklist'),
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
} elseif ($result == -1) {
$result = $this->antraglib->getDetailsForLastAntrag(
$prestudent_id,
[
Studierendenantrag_model::TYP_ABMELDUNG,
Studierendenantrag_model::TYP_ABMELDUNG_STGL
]
);
$data = $this->getDataOrTerminateWithError($result);
$data->canCancel = (
$data->status == Studierendenantragstatus_model::STATUS_CREATED &&
$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id)
);
$this->terminateWithSuccess($data);
}
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
public function getDetailsForAntrag($studierendenantrag_id)
{
if (!$this->antraglib->isEntitledToShowAntrag($studierendenantrag_id))
return show_404();
$result = $this->antraglib->getDetailsForAntrag($studierendenantrag_id);
$data = $this->getDataOrTerminateWithError($result);
if ($data->typ !== Studierendenantrag_model::TYP_ABMELDUNG_STGL && $data->typ !== Studierendenantrag_model::TYP_ABMELDUNG)
return show_404();
$data->canCancel = (
$data->status == Studierendenantragstatus_model::STATUS_CREATED &&
$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id)
);
$this->terminateWithSuccess($data);
}
public function createAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('studiensemester', 'Studiensemester', 'required');
$this->form_validation->set_rules('prestudent_id', 'Prestudent ID', 'required');
$this->form_validation->set_rules('grund', 'Grund', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$grund = $this->input->post('grund');
$studiensemester = $this->input->post('studiensemester');
$prestudent_id = $this->input->post('prestudent_id');
$result = $this->antraglib->getPrestudentAbmeldeBerechtigt($prestudent_id);
$result = $this->getDataOrTerminateWithError($result);
if (!$result)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_no_student'), self::ERROR_TYPE_GENERAL);
elseif ($result == -3)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_stg_blacklist'), self::ERROR_TYPE_GENERAL);
elseif ($result < 0)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_antrag_exists'), self::ERROR_TYPE_GENERAL);
$result = $this->antraglib->createAbmeldung($prestudent_id, $studiensemester, getAuthUID(), $grund);
$data = $this->getDataOrTerminateWithError($result);
$result = $this->antraglib->getDetailsForAntrag($data);
if (!hasData($result))
return $this->terminateWithSuccess(true);
$data = getData($result);
$data->canCancel = (boolean)$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id);
$this->terminateWithSuccess($data);
}
public function cancelAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('antrag_id', 'Antrag ID', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$antrag_id = $this->input->post('antrag_id');
if (!$this->antraglib->isEntitledToCancelAntrag($antrag_id))
$this->terminateWithError('Forbidden', self::ERROR_TYPE_AUTH, REST_Controller::HTTP_FORBIDDEN);
$result = $this->antraglib->cancelAntrag($antrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
$result = $this->antraglib->getDetailsForAntrag($antrag_id);
if (!hasData($result))
$this->terminateWithSuccess($antrag_id);
$data = getData($result);
$this->terminateWithSuccess($data);
}
}
@@ -1,428 +0,0 @@
<?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');
use \stdClass as stdClass;
use \Studierendenantrag_model as Studierendenantrag_model;
/**
* This controller operates between (interface) the JS (GUI) and the AntragLib (back-end)
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Leitung extends FHCAPI_Controller
{
/**
* Calls the parent's constructor and loads the AntragLib
*/
public function __construct()
{
parent::__construct([
'getActiveStgs' => ['student/antragfreigabe:r', 'student/studierendenantrag:r'],
'getAntraege' => ['student/antragfreigabe:r', 'student/studierendenantrag:r'],
'getHistory' => ['student/antragfreigabe:r', 'student/studierendenantrag:r'],
'getPrestudents' => 'student/studierendenantrag:w',
'approveAntrag' => 'student/antragfreigabe:w',
'rejectAntrag' => 'student/antragfreigabe:w',
'reopenAntrag' => 'student/studierendenantrag:w',
'pauseAntrag' => ['student/antragfreigabe:w', 'student/studierendenantrag:w'],
'unpauseAntrag' => ['student/antragfreigabe:w', 'student/studierendenantrag:w'],
'objectAntrag' => ['student/antragfreigabe:w', 'student/studierendenantrag:w'],
'approveObjection' => ['student/antragfreigabe:w', 'student/studierendenantrag:w'],
'denyObjection' => ['student/antragfreigabe:w', 'student/studierendenantrag:w']
]);
// Libraries
$this->load->library('AntragLib');
// Load language phrases
$this->loadPhrases([
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
public function getActiveStgs()
{
$studiengaenge = $this->permissionlib->getSTG_isEntitledFor('student/antragfreigabe') ?: [];
$studiengaenge = array_merge($studiengaenge, $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag') ?: []);
$result = $this->StudierendenantragModel->loadStgsWithAntraege($studiengaenge);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
public function getAntraege($studiengang = null, $extra = null)
{
if ($studiengang && $studiengang == 'todo') {
$studiengang = $extra;
$extra = true;
} else {
$extra = false;
}
$studiengaenge = $this->permissionlib->getSTG_isEntitledFor('student/antragfreigabe');
if(!is_array($studiengaenge))
$studiengaenge = [];
$stgsNeuanlage = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag');
if(!is_array($stgsNeuanlage))
$stgsNeuanlage = [];
$studiengaenge = array_unique(array_merge($studiengaenge, $stgsNeuanlage));
if ($studiengang) {
if (!in_array($studiengang, $studiengaenge))
$this->terminateWithError(
'Forbidden',
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
$studiengaenge = [$studiengang];
}
$antraege = [];
if ($studiengaenge) {
$result = $extra
? $this->StudierendenantragModel->loadActiveForStudiengaenge($studiengaenge)
: $this->StudierendenantragModel->loadForStudiengaenge($studiengaenge);
$antraege = $this->getDataOrTerminateWithError($result);
}
$this->terminateWithSuccess($antraege ?: []);
}
public function getHistory($studierendenantrag_id)
{
if (!$this->antraglib->isEntitledToSeeHistoryForAntrag($studierendenantrag_id))
$this->terminateWithError(
'Forbidden',
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
$result = $this->antraglib->getAntragHistory($studierendenantrag_id);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data ?: []);
}
public function getPrestudents()
{
$query = $this->input->post('query');
$studiengaenge = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag');
$result = $this->antraglib->getAktivePrestudentenInStgs($studiengaenge, $query);
$result = $this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($result ?: []);
}
public function approveAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToApproveAntrag', [$this->antraglib, 'isEntitledToApproveAntrag']],
],
[
'isEntitledToApproveAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
$this->form_validation->set_rules(
'typ',
'Typ',
'required|in_list[' . implode(',', [
Studierendenantrag_model::TYP_ABMELDUNG,
Studierendenantrag_model::TYP_ABMELDUNG_STGL,
Studierendenantrag_model::TYP_UNTERBRECHUNG,
Studierendenantrag_model::TYP_WIEDERHOLUNG
]) . ']'
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
switch ($this->input->post('typ')) {
case Studierendenantrag_model::TYP_ABMELDUNG:
case Studierendenantrag_model::TYP_ABMELDUNG_STGL:
$result = $this->antraglib->approveAbmeldung([$studierendenantrag_id], getAuthUID());
break;
case Studierendenantrag_model::TYP_UNTERBRECHUNG:
$result = $this->antraglib->approveUnterbrechung([$studierendenantrag_id], getAuthUID());
break;
case Studierendenantrag_model::TYP_WIEDERHOLUNG:
$result = $this->antraglib->approveWiederholung($studierendenantrag_id, getAuthUID());
break;
}
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function rejectAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToRejectAntrag', [$this->antraglib, 'isEntitledToRejectAntrag']],
],
[
'isEntitledToRejectAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
$this->form_validation->set_rules('grund', 'Grund', 'required');
$this->form_validation->set_rules(
'typ',
'Typ',
'required|in_list[' . implode(',', [
Studierendenantrag_model::TYP_UNTERBRECHUNG
]) . ']'
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$grund = $this->input->post('grund');
$result = $this->antraglib->rejectUnterbrechung([$studierendenantrag_id], getAuthUID(), $grund);
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function reopenAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToReopenAntrag', [$this->antraglib, 'isEntitledToReopenAntrag']],
],
[
'isEntitledToReopenAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
$this->form_validation->set_rules(
'typ',
'Typ',
'required|in_list[' . implode(',', [
Studierendenantrag_model::TYP_WIEDERHOLUNG
]) . ']'
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->reopenWiederholung($studierendenantrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function pauseAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToPauseAntrag', [$this->antraglib, 'isEntitledToPauseAntrag']],
['antragCanBeManualPaused', [$this->antraglib, 'antragCanBeManualPaused']]
],
[
'isEntitledToPauseAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'antragCanBeManualPaused' => $this->p->t(
'studierendenantrag',
'error_not_pauseable',
['id' => $this->input->post('studierendenantrag_id')]
)
]
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->pauseAntrag($studierendenantrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function unpauseAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToUnpauseAntrag', [$this->antraglib, 'isEntitledToUnpauseAntrag']],
['antragCanBeManualUnpaused', [$this->antraglib, 'antragCanBeManualUnpaused']]
],
[
'isEntitledToUnpauseAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'antragCanBeManualUnpaused' => $this->p->t(
'studierendenantrag',
'error_not_paused',
['id' => $this->input->post('studierendenantrag_id')]
)
]
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->unpauseAntrag($studierendenantrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function objectAntrag()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToObjectAntrag', [$this->antraglib, 'isEntitledToObjectAntrag']],
['canBeObjected', function ($a) {
return $this->antraglib->hasType($a, Studierendenantrag_model::TYP_ABMELDUNG_STGL);
}]
],
[
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'canBeObjected' => $this->p->t(
'studierendenantrag',
'error_no_objection'
)
]
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->objectAbmeldung($studierendenantrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function approveObjection()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToObjectAntrag', [$this->antraglib, 'isEntitledToObjectAntrag']],
['isObjected', function ($a) {
return $this->antraglib->hasStatus($a, Studierendenantragstatus_model::STATUS_OBJECTED);
}]
],
[
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'isObjected' => $this->p->t(
'studierendenantrag',
'error_not_objected'
)
]
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->cancelAntrag($studierendenantrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
public function denyObjection()
{
$this->load->library('form_validation');
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
['isEntitledToObjectAntrag', [$this->antraglib, 'isEntitledToObjectAntrag']],
['isObjected', function ($a) {
return $this->antraglib->hasStatus($a, Studierendenantragstatus_model::STATUS_OBJECTED);
}]
],
[
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'isObjected' => $this->p->t(
'studierendenantrag',
'error_not_objected'
)
]
);
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$grund = $this->input->post('grund');
$result = $this->antraglib->denyObjectionAbmeldung($studierendenantrag_id, getAuthUID(), $grund);
$this->getDataOrTerminateWithError($result);
return $this->terminateWithSuccess($studierendenantrag_id);
}
}
@@ -1,258 +0,0 @@
<?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');
use \REST_Controller as REST_Controller;
use \Studierendenantragstatus_model as Studierendenantragstatus_model;
/**
* This controller operates between (interface) the JS (GUI) and the AntragLib (back-end)
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*/
class Wiederholung extends FHCAPI_Controller
{
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
parent::__construct([
'getDetailsForNewAntrag' => self::PERM_LOGGED,
'createAntrag' => self::PERM_LOGGED,
'cancelAntrag' => self::PERM_LOGGED,
'getLvs' => self::PERM_LOGGED,
'saveLvs' => ['student/studierendenantrag:w']
]);
// Libraries
$this->load->library('AntragLib');
// Load language phrases
$this->loadPhrases([
'global',
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Retrieves data of the current studiengang for the current user
*/
public function getDetailsForNewAntrag($prestudent_id)
{
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, false))
$this->terminateWithError('Forbidden', self::ERROR_TYPE_AUTH, REST_Controller::HTTP_FORBIDDEN);
$result = $this->antraglib->getPrestudentWiederholungsBerechtigt($prestudent_id);
$result = $this->getDataOrTerminateWithError($result);
if (!$result) {
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_no_student_no_failed_exam'),
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
} elseif ($result == -1) {
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id, Studierendenantrag_model::TYP_WIEDERHOLUNG);
$data = $this->getDataOrTerminateWithError($result);
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id, $data->datum, $data->studiensemester_kurzbz);
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
$pruefungsdata = current(getData($result));
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
$data->pruefungsdatum = $pruefungsdata->datum;
$this->terminateWithSuccess($data);
} elseif ($result == -2) {
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id);
$result = $this->getDataOrTerminateWithError($result);
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_antrag_pending', [
'typ' => $this->p->t('studierendenantrag', 'antrag_typ_' . $result->typ)
]),
self::ERROR_TYPE_GENERAL,
REST_Controller::HTTP_BAD_REQUEST
);
} elseif ($result == -3) {
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_stg_blacklist'),
self::ERROR_TYPE_GENERAL,
REST_Controller::HTTP_BAD_REQUEST
);
}
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
$data = $this->getDataOrTerminateWithError($result);
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id);
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
$pruefungsdata = current(getData($result));
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
$data->pruefungsdatum = $pruefungsdata->datum;
$this->terminateWithSuccess($data);
}
public function createAntrag()
{
$this->createAntragWithStatus(true);
}
public function cancelAntrag()
{
$this->createAntragWithStatus(false);
}
protected function createAntragWithStatus($repeat)
{
$this->load->library('form_validation');
$this->form_validation->set_rules('prestudent_id', 'Prestudent ID', 'required');
$this->form_validation->set_rules('studiensemester', 'Studiensemester', 'required');
if (!$this->form_validation->run())
$this->terminateWithValidationErrors($this->form_validation->error_array());
$prestudent_id = $this->input->post('prestudent_id');
$studiensemester = $this->input->post('studiensemester');
$result = $this->antraglib->getPrestudentWiederholungsBerechtigt($prestudent_id);
$result = $this->getDataOrTerminateWithError($result);
if (!$result) {
$this->terminateWithError($this->p->t('studierendenantrag', 'error_no_student'), self::ERROR_TYPE_GENERAL);
} elseif ($result == -1) {
$result = $this->PrestudentstatusModel->getLastStatus($prestudent_id);
$result = $this->getDataOrTerminateWithError($result);
if (!$result)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_no_prestudentstatus', [
'prestudent_id' => $prestudent_id
]), self::ERROR_TYPE_GENERAL);
if (!in_array(current($result)->status_kurzbz, $this->config->item('antrag_prestudentstatus_whitelist')))
$this->terminateWithError($this->p->t('studierendenantrag', 'error_no_student'), self::ERROR_TYPE_GENERAL);
} elseif ($result == -2) {
$this->terminateWithError($this->p->t('studierendenantrag', 'error_antrag_exists'), self::ERROR_TYPE_GENERAL);
} elseif ($result == -3) {
$this->terminateWithError($this->p->t('studierendenantrag', 'error_stg_blacklist'), self::ERROR_TYPE_GENERAL);
}
$result = $this->antraglib->createWiederholung($prestudent_id, $studiensemester, getAuthUID(), $repeat);
$antragId = $this->getDataOrTerminateWithError($result);
$result = $this->antraglib->getDetailsForAntrag($antragId);
if (!hasData($result))
$this->terminateWithSuccess(true);
$data = getData($result);
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id);
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
$pruefungsdata = current(getData($result));
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
$data->pruefungsdatum = $pruefungsdata->datum;
$this->terminateWithSuccess($data);
}
public function getLvs($antrag_id)
{
$result = $this->antraglib->getLvsForAntrag($antrag_id);
if (isError($result)) {
$error = getError($result);
if ($error == 'Forbidden')
$this->terminateWithError(
$error,
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
$this->terminateWithError(
$error,
self::ERROR_TYPE_GENERAL
);
}
$lvs = getData($result);
$this->terminateWithSuccess($lvs);
}
public function saveLvs()
{
$forbiddenLvs = $this->input->post('forbiddenLvs');
$mandatoryLvs = $this->input->post('mandatoryLvs');
$antragsLvs = array_merge($forbiddenLvs, $mandatoryLvs);
if (!$antragsLvs)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_no_lv'), self::ERROR_TYPE_GENERAL);
$insert = array_map(function ($lv) {
return [
'studierendenantrag_id' => $lv['studierendenantrag_id'],
'lehrveranstaltung_id' => $lv['lehrveranstaltung_id'],
'note' => $lv['zugelassen']
? ($lv['zugelassen'] == 1 ? 0 : $this->config->item('wiederholung_note_angerechnet'))
: $this->config->item('wiederholung_note_nicht_zugelassen'),
'anmerkung' => $lv['anmerkung'],
'insertvon' => getAuthUID(),
'studiensemester_kurzbz' => $lv['studiensemester_kurzbz']
];
}, $antragsLvs);
$antrag_ids = array_unique(array_map(function ($lv) {
return $lv['studierendenantrag_id'];
}, $insert));
foreach ($antrag_ids as $antrag_id) {
$result = $this->StudierendenantragModel->loadIdAndStatusWhere([
'studierendenantrag_id' => $antrag_id
]);
$antrag = $this->getDataOrTerminateWithError($result);
if (!$antrag)
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_no_antrag_found', ['id' => $antrag_id]),
self::ERROR_TYPE_GENERAL
);
$antrag = current($antrag);
if ($antrag->status != Studierendenantragstatus_model::STATUS_CREATED
&& $antrag->status != Studierendenantragstatus_model::STATUS_LVSASSIGNED)
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_antrag_locked'),
self::ERROR_TYPE_GENERAL
);
}
$result = $this->antraglib->saveLvs($insert);
$data = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess($data);
}
}
@@ -0,0 +1,218 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \Studierendenantrag_model as Studierendenantrag_model;
/**
*
*/
class Abmeldung extends FHC_Controller
{
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
parent::__construct();
// Libraries
$this->load->library('AuthLib');
$this->load->library('AntragLib');
// Load language phrases
$this->loadPhrases([
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Retrieves data of the current studiengang for the current user
*/
public function getDetailsForNewAntrag($prestudent_id)
{
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, true)) {
$this->output->set_status_header(403);
return $this->outputJsonError('Forbidden');
}
$result = $this->antraglib->getPrestudentAbmeldeBerechtigt($prestudent_id);
if (isError($result)) {
$this->output->set_status_header(500);
return $this->outputJsonError(getError($result));
}
$result = $result->retval;
if (!$result) {
$this->output->set_status_header(403);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_student'));
}
elseif ($result == -3)
{
$this->output->set_status_header(403);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_stg_blacklist'));
}
elseif ($result == -1)
{
$result = $this->antraglib->getDetailsForLastAntrag(
$prestudent_id,
[
Studierendenantrag_model::TYP_ABMELDUNG,
Studierendenantrag_model::TYP_ABMELDUNG_STGL
]
);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$data = getData($result);
$data->canCancel = (
$data->status == Studierendenantragstatus_model::STATUS_CREATED &&
$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id)
);
return $this->outputJsonSuccess($data);
}
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$this->outputJsonSuccess(getData($result));
}
public function getDetailsForAntrag($studierendenantrag_id)
{
if (!$this->antraglib->isEntitledToShowAntrag($studierendenantrag_id)) return show_404();
$result = $this->antraglib->getDetailsForAntrag($studierendenantrag_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$data = getData($result);
if ($data->typ !== Studierendenantrag_model::TYP_ABMELDUNG_STGL && $data->typ !== Studierendenantrag_model::TYP_ABMELDUNG)
return show_404();
$data->canCancel = (
$data->status == Studierendenantragstatus_model::STATUS_CREATED &&
$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id)
);
$this->outputJsonSuccess($data);
}
public function createAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules('studiensemester', 'Studiensemester', 'required');
$this->form_validation->set_rules('prestudent_id', 'Prestudent ID', 'required');
$this->form_validation->set_rules('grund', 'Grund', 'required');
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$grund = $this->input->post('grund');
$studiensemester = $this->input->post('studiensemester');
$prestudent_id = $this->input->post('prestudent_id');
$result = $this->antraglib->getPrestudentAbmeldeBerechtigt($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(['db' => getError($result)]);
}
$result = $result->retval;
if (!$result)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_no_student')]);
}
elseif ($result == -3)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_stg_blacklist')]);
}
elseif ($result < 0)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_antrag_exists')]);
}
$result = $this->antraglib->createAbmeldung($prestudent_id, $studiensemester, getAuthUID(), $grund);
if (isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
$result = $this->antraglib->getDetailsForAntrag(getData($result));
if (!hasData($result))
return $this->outputJsonSuccess(true);
$data = getData($result);
$data->canCancel = (boolean)$this->antraglib->isEntitledToCancelAntrag($data->studierendenantrag_id);
$this->outputJsonSuccess($data);
}
public function cancelAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules('antrag_id', 'Antrag ID', 'required');
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$antrag_id = $this->input->post('antrag_id');
if(!$this->antraglib->isEntitledToCancelAntrag($antrag_id))
{
$this->output->set_status_header(403);
return $this->outputJsonError('Forbidden');
}
$result = $this->antraglib->cancelAntrag($antrag_id, getAuthUID());
if(isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
$result = $this->antraglib->getDetailsForAntrag($antrag_id);
if (!hasData($result))
return $this->outputJsonSuccess($antrag_id);
$this->outputJsonSuccess(getData($result));
}
public function getStudiengaengeAssistenz()
{
$this->load->library('PermissionLib');
$_POST = json_decode($this->input->raw_input_stream, true);
$query = $this->input->post('query');
$studiengaenge = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag');
$result = $this->antraglib->getAktivePrestudentenInStgs($studiengaenge, $query);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$result = getData($result);
if (!$result) {
return $this->outputJsonSuccess([]);
}
return $this->outputJsonSuccess($result);
}
}
@@ -0,0 +1,479 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \stdClass as stdClass;
/**
*
*/
class Leitung extends FHC_Controller
{
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
parent::__construct();
// Libraries
$this->load->library('AuthLib');
$this->load->library('AntragLib');
// Load language phrases
$this->loadPhrases([
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
public function getActiveStgs()
{
$studiengaenge = $this->permissionlib->getSTG_isEntitledFor('student/antragfreigabe') ?: [];
$studiengaenge = array_merge($studiengaenge, $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag') ?: []);
$result = $this->StudierendenantragModel->loadStgsWithAntraege($studiengaenge);
if (isError($result)) {
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
}
$this->outputJson($result);
}
public function getAntraege($studiengang = null, $extra = null)
{
if ($studiengang && $studiengang == 'todo') {
$studiengang = $extra;
$extra = true;
} else {
$extra = false;
}
if ($studiengang) {
$studiengaenge = [$studiengang];
} else {
$studiengaenge =$this->permissionlib->getSTG_isEntitledFor('student/antragfreigabe');
if(!is_array($studiengaenge))
$studiengaenge = [];
$stgsNeuanlage = $this->permissionlib->getSTG_isEntitledFor('student/studierendenantrag');
if(!is_array($stgsNeuanlage))
$stgsNeuanlage = [];
$studiengaenge = array_unique(array_merge($studiengaenge, $stgsNeuanlage));
}
$antraege = [];
if ($studiengaenge) {
$result = $extra
? $this->StudierendenantragModel->loadActiveForStudiengaenge($studiengaenge)
: $this->StudierendenantragModel->loadForStudiengaenge($studiengaenge);
if (isError($result)) {
$this->output->set_status_header(500);
return $this->outputJson('Internal Server Error');
}
if(hasData($result))
{
$antraege = getData($result);
}
}
$this->outputJson($antraege);
}
public function reopenAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToReopenAntrag',
[
'isEntitledToReopenAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->reopenWiederholung($studierendenantrag_id, getAuthUID());
if (isError($result))
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
$this->outputJsonSuccess($studierendenantrag_id);
}
public function pauseAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
[
'isEntitledToPauseAntrag',
[$this->antraglib, 'isEntitledToPauseAntrag']
],
[
'antragCanBeManualPaused',
[$this->antraglib, 'antragCanBeManualPaused']
]
],
[
'isEntitledToPauseAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'antragCanBeManualPaused' => $this->p->t(
'studierendenantrag',
'error_not_pauseable',
['id' => $this->input->post('studierendenantrag_id')]
)
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->pauseAntrag($studierendenantrag_id, getAuthUID());
if (isError($result))
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
$this->outputJsonSuccess($studierendenantrag_id);
}
public function unpauseAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
[
'required',
[
'isEntitledToUnpauseAntrag',
[$this->antraglib, 'isEntitledToUnpauseAntrag']
],
[
'antragCanBeManualUnpaused',
[$this->antraglib, 'antragCanBeManualUnpaused']
]
],
[
'isEntitledToUnpauseAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'antragCanBeManualUnpaused' => $this->p->t(
'studierendenantrag',
'error_not_paused',
['id' => $this->input->post('studierendenantrag_id')]
)
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->unpauseAntrag($studierendenantrag_id, getAuthUID());
if (isError($result))
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
$this->outputJsonSuccess($studierendenantrag_id);
}
public function objectAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToObjectAntrag|callback_canBeObjected',
[
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'canBeObjected' => $this->p->t('studierendenantrag', 'error_no_objection')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->objectAbmeldung($studierendenantrag_id, getAuthUID());
if (isError($result))
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
$this->outputJsonSuccess($studierendenantrag_id);
}
public function objectionDeny()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToObjectAntrag|callback_isObjected',
[
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'isObjected' => $this->p->t('studierendenantrag', 'error_not_objected')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$grund = $this->input->post('grund');
$result = $this->antraglib->denyObjectionAbmeldung($studierendenantrag_id, getAuthUID(), $grund);
if (isError($result))
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
$this->outputJsonSuccess($studierendenantrag_id);
}
public function objectionApprove()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToObjectAntrag|callback_isObjected',
[
'isEntitledToObjectAntrag' => $this->p->t('studierendenantrag', 'error_no_right'),
'isObjected' => $this->p->t('studierendenantrag', 'error_not_objected')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->cancelAntrag($studierendenantrag_id, getAuthUID());
if (isError($result))
return $this->outputJsonError(['studierendenantrag_id' => getError($result)]);
$this->outputJsonSuccess($studierendenantrag_id);
}
public function isEntitledToReopenAntrag($studierendenantrag_id)
{
return $this->antraglib->isEntitledToReopenAntrag($studierendenantrag_id);
}
public function isEntitledToObjectAntrag($studierendenantrag_id)
{
return $this->antraglib->isEntitledToObjectAntrag($studierendenantrag_id);
}
public function isEntitledToRejectAntrag($studierendenantrag_id)
{
return $this->antraglib->isEntitledToRejectAntrag($studierendenantrag_id);
}
public function canBeObjected($studierendenantrag_id)
{
return $this->antraglib->hasType($studierendenantrag_id, Studierendenantrag_model::TYP_ABMELDUNG_STGL);
}
public function isObjected($studierendenantrag_id)
{
return $this->antraglib->hasStatus($studierendenantrag_id, Studierendenantragstatus_model::STATUS_OBJECTED);
}
public function approveAbmeldung()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToApproveAntrag',
[
'isEntitledToApproveAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->approveAbmeldung([$studierendenantrag_id], getAuthUID());
if (isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
return $this->outputJsonSuccess($studierendenantrag_id);
}
public function approveAbmeldungStgl()
{
return $this->approveAbmeldung();
}
public function approveUnterbrechung()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToApproveAntrag',
[
'isEntitledToApproveAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->approveUnterbrechung([$studierendenantrag_id], getAuthUID());
if (isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
return $this->outputJsonSuccess($studierendenantrag_id);
}
public function rejectUnterbrechung()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToRejectAntrag',
[
'isEntitledToRejectAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
$this->form_validation->set_rules('grund', 'Grund', 'required');
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$grund = $this->input->post('grund');
$result = $this->antraglib->rejectUnterbrechung([$studierendenantrag_id], getAuthUID(), $grund);
if (isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
return $this->outputJsonSuccess($studierendenantrag_id);
}
public function approveWiederholung()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules(
'studierendenantrag_id',
'Studierenden Antrag',
'required|callback_isEntitledToApproveAntrag',
[
'isEntitledToApproveAntrag' => $this->p->t('studierendenantrag', 'error_no_right')
]
);
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$studierendenantrag_id = $this->input->post('studierendenantrag_id');
$result = $this->antraglib->approveWiederholung($studierendenantrag_id, getAuthUID());
if (isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
return $this->outputJsonSuccess($studierendenantrag_id);
}
public function isEntitledToApproveAntrag($studierendenantrag_id)
{
return $this->antraglib->isEntitledToApproveAntrag($studierendenantrag_id);
}
public function getHistory($studierendenantrag_id)
{
if (!$this->antraglib->isEntitledToSeeHistoryForAntrag($studierendenantrag_id)) {
$this->output->set_status_header(403);
return $this->outputJson('Forbidden');
}
$result = $this->antraglib->getAntragHistory($studierendenantrag_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$this->outputJsonSuccess(getData($result) ?: []);
}
}
@@ -1,20 +1,4 @@
<?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');
@@ -22,28 +6,23 @@ use \Studierendenantrag_model as Studierendenantrag_model;
use \DateTime as DateTime;
/**
* This controller operates between (interface) the JS (GUI) and the AntragLib (back-end)
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
*
*/
class Unterbrechung extends FHCAPI_Controller
class Unterbrechung extends FHC_Controller
{
/**
* Calls the parent's constructor and loads the AntragLib
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
parent::__construct([
'getDetailsForNewAntrag' => self::PERM_LOGGED,
'getDetailsForAntrag' => self::PERM_LOGGED,
'createAntrag' => self::PERM_LOGGED,
'cancelAntrag' => self::PERM_LOGGED
]);
parent::__construct();
// Configs
$this->load->config('studierendenantrag');
// Libraries
$this->load->library('AuthLib');
$this->load->library('AntragLib');
// Load language phrases
@@ -59,62 +38,74 @@ class Unterbrechung extends FHCAPI_Controller
public function getDetailsForNewAntrag($prestudent_id)
{
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, false))
$this->terminateWithError('Forbidden', self::ERROR_TYPE_AUTH, REST_Controller::HTTP_FORBIDDEN);
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, false)) {
$this->output->set_status_header(403);
return $this->outputJsonError('Forbidden');
}
$result = $this->antraglib->getPrestudentUnterbrechungsBerechtigt($prestudent_id);
$result = $this->getDataOrTerminateWithError($result);
if (isError($result)) {
$this->output->set_status_header(500);
return $this->outputJsonError(getError($result));
}
$result = $result->retval;
if (!$result) {
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_no_student'),
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
} elseif ($result == -1) {
$this->output->set_status_header(403);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_student'));
}
elseif ($result == -1)
{
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id, Studierendenantrag_model::TYP_UNTERBRECHUNG);
$data = $this->getDataOrTerminateWithError($result);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
return $this->terminateWithSuccess($data);
} elseif ($result == -2) {
return $this->outputJsonSuccess(getData($result));
}
elseif ($result == -2)
{
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$data = $this->getDataOrTerminateWithError($result);
return $this->terminateWithError($this->p->t('studierendenantrag', 'error_antrag_pending', [
$result = getData($result);
$this->output->set_status_header(400);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_antrag_pending', [
'typ' => $this->p->t('studierendenantrag', 'antrag_typ_' . $result->typ)
]));
} elseif ($result == -3) {
$this->terminateWithError(
$this->p->t('studierendenantrag', 'error_stg_blacklist'),
self::ERROR_TYPE_AUTH,
REST_Controller::HTTP_FORBIDDEN
);
}
elseif ($result == -3)
{
$this->output->set_status_header(403);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_stg_blacklist'));
}
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
$data = $this->getDataOrTerminateWithError($result);
$data = getData($result);
$data->studiensemester = $this->antraglib->getSemesterForUnterbrechung($prestudent_id, null);
$this->terminateWithSuccess($data);
$this->outputJsonSuccess($data);
}
public function getDetailsForAntrag($studierendenantrag_id)
{
if (!$this->antraglib->isEntitledToShowAntrag($studierendenantrag_id))
return show_404();
if (!$this->antraglib->isEntitledToShowAntrag($studierendenantrag_id)) return show_404();
$result = $this->antraglib->getDetailsForAntrag($studierendenantrag_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$data = $this->getDataOrTerminateWithError($result);
$data = getData($result);
if ($data->typ !== Studierendenantrag_model::TYP_UNTERBRECHUNG)
return show_404();
$this->terminateWithSuccess($data);
$this->outputJsonSuccess($data);
}
public function createAntrag()
@@ -134,8 +125,9 @@ class Unterbrechung extends FHCAPI_Controller
]
);
if (!$this->form_validation->run()) {
$this->terminateWithValidationErrors($this->form_validation->error_array());
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$grund = $this->input->post('grund');
@@ -145,17 +137,25 @@ class Unterbrechung extends FHCAPI_Controller
$dms_id = null;
$result = $this->antraglib->getPrestudentUnterbrechungsBerechtigt($prestudent_id, $studiensemester, $datum_wiedereinstieg);
$result = $this->getDataOrTerminateWithError($result);
if (isError($result)) {
return $this->outputJsonError(['db' => getError($result)]);
}
$result = $result->retval;
if (!$result)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_no_student'), self::ERROR_TYPE_GENERAL);
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_no_student')]);
}
elseif ($result == -3)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_stg_blacklist'), self::ERROR_TYPE_GENERAL);
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_stg_blacklist')]);
}
elseif ($result < 0)
$this->terminateWithError($this->p->t('studierendenantrag', 'error_antrag_exists'), self::ERROR_TYPE_GENERAL);
if (isset($_FILES['attachment']) && (!isset($_FILES['attachment']['error']) || $_FILES['attachment']['error'] != UPLOAD_ERR_NO_FILE)) {
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_antrag_exists')]);
}
if(isset($_FILES['attachment']) && (!isset($_FILES['attachment']['error']) || $_FILES['attachment']['error'] != UPLOAD_ERR_NO_FILE))
{
$this->load->library('DmsLib');
$dms = $this->config->item('unterbrechung_dms');
@@ -167,46 +167,53 @@ class Unterbrechung extends FHCAPI_Controller
$allowed_filetypes = $this->config->item('unterbrechung_dms_filetypes') ?: ['*'];
$result = $this->dmslib->upload($dms, 'attachment', $allowed_filetypes);
$data = $this->getDataOrTerminateWithError($result);
$dms_id = $data['dms_id'];
if(isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
$dms_id = getData($result)['dms_id'];
}
$result = $this->antraglib->createUnterbrechung($prestudent_id, $studiensemester, getAuthUID(), $grund, $datum_wiedereinstieg, $dms_id);
if(isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
$antragId = $this->getDataOrTerminateWithError($result);
$antragId = getData($result);
$result = $this->antraglib->getDetailsForAntrag($antragId);
if (!hasData($result))
$this->terminateWithSuccess($antragId);
$this->terminateWithSuccess(getData($result));
if(!hasData($result))
return $this->outputJsonSuccess($antragId);
$this->outputJsonSuccess(getData($result));
}
public function cancelAntrag()
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules('antrag_id', 'Antrag ID', 'required');
if (!$this->form_validation->run()) {
$this->terminateWithValidationErrors($this->form_validation->error_array());
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$antrag_id = $this->input->post('antrag_id');
$result = $this->antraglib->cancelAntrag($antrag_id, getAuthUID());
$this->getDataOrTerminateWithError($result);
if (isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
$result = $this->antraglib->getDetailsForAntrag($antrag_id);
if (!hasData($result))
return $this->terminateWithSuccess($antrag_id);
$this->terminateWithSuccess(getData($result));
return $this->outputJsonSuccess($antrag_id);
$this->outputJsonSuccess(getData($result));
}
public function isValidDate($date)
@@ -0,0 +1,384 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
use \REST_Controller as REST_Controller;
/**
*
*/
class Wiederholung extends FHC_Controller
{
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
parent::__construct();
// Configs
$this->load->config('studierendenantrag');
// Libraries
$this->load->library('AuthLib');
$this->load->library('PermissionLib');
$this->load->library('AntragLib');
$requiredPermissions = [
'saveLvs' => ['student/studierendenantrag:w'],
'getLvsAsRdf' => ['student/studierendenantrag:r', 'student/noten:r'],
'moveLvsToZeugnis' => ['student/studierendenantrag:w', 'student/noten:w']
];
if (isset($requiredPermissions[$this->router->method])) {
if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method)) {
$this->output->set_status_header(REST_Controller::HTTP_FORBIDDEN);
$this->outputJson('Forbidden');
exit;
}
}
// Load language phrases
$this->loadPhrases([
'global',
'studierendenantrag'
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Retrieves data of the current studiengang for the current user
*/
public function getDetailsForNewAntrag($prestudent_id)
{
if (!$this->antraglib->isEntitledToCreateAntragFor($prestudent_id, false)) {
$this->output->set_status_header(REST_Controller::HTTP_FORBIDDEN);
return $this->outputJsonError('Forbidden');
}
$result = $this->antraglib->getPrestudentWiederholungsBerechtigt($prestudent_id);
if (isError($result)) {
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
return $this->outputJsonError(getError($result));
}
$result = $result->retval;
if (!$result) {
$this->output->set_status_header(REST_Controller::HTTP_FORBIDDEN);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_student_no_failed_exam'));
}
elseif ($result == -1)
{
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id, Studierendenantrag_model::TYP_WIEDERHOLUNG);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$data = getData($result);
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id, $data->datum, $data->studiensemester_kurzbz);
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
$pruefungsdata = current(getData($result));
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
$data->pruefungsdatum = $pruefungsdata->datum;
return $this->outputJsonSuccess($data);
}
elseif ($result == -2)
{
$result = $this->antraglib->getDetailsForLastAntrag($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$result = getData($result);
$this->output->set_status_header(REST_Controller::HTTP_BAD_REQUEST);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_antrag_pending', [
'typ' => $this->p->t('studierendenantrag', 'antrag_typ_' . $result->typ)
]));
}
elseif ($result == -3)
{
$this->output->set_status_header(REST_Controller::HTTP_BAD_REQUEST);
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_stg_blacklist'));
}
$result = $this->antraglib->getDetailsForNewAntrag($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$data = getData($result);
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id);
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
$pruefungsdata = current(getData($result));
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
$data->pruefungsdatum = $pruefungsdata->datum;
$this->outputJsonSuccess($data);
}
public function createAntrag()
{
$this->createAntragWithStatus(true);
}
public function cancelAntrag()
{
$this->createAntragWithStatus(false);
}
protected function createAntragWithStatus($repeat)
{
$this->load->library('form_validation');
$_POST = json_decode($this->input->raw_input_stream, true);
$this->form_validation->set_rules('prestudent_id', 'Prestudent ID', 'required');
$this->form_validation->set_rules('studiensemester', 'Studiensemester', 'required');
if ($this->form_validation->run() == false)
{
return $this->outputJsonError($this->form_validation->error_array());
}
$prestudent_id = $this->input->post('prestudent_id');
$studiensemester = $this->input->post('studiensemester');
$result = $this->antraglib->getPrestudentWiederholungsBerechtigt($prestudent_id);
if (isError($result)) {
return $this->outputJsonError(['db' => getError($result)]);
}
$result = $result->retval;
if (!$result)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_no_student')]);
}
elseif ($result == -1)
{
$result = $this->PrestudentstatusModel->getLastStatus($prestudent_id);
if (isError($result))
return $this->outputJsonError(['db' => getError($result)]);
if (!hasData($result))
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_no_prestudentstatus', [
'prestudent_id' => $prestudent_id
])]);
if (!in_array(current(getData($result))->status_kurzbz, $this->config->item('antrag_prestudentstatus_whitelist')))
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_no_student')]);
}
elseif ($result == -2)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_antrag_exists')]);
}
elseif ($result == -3)
{
return $this->outputJsonError(['db' => $this->p->t('studierendenantrag', 'error_stg_blacklist')]);
}
$result = $this->antraglib->createWiederholung($prestudent_id, $studiensemester, getAuthUID(), $repeat);
if(isError($result))
{
return $this->outputJsonError(['db' => getError($result)]);
}
$antragId = getData($result);
$result = $this->antraglib->getDetailsForAntrag($antragId);
if(!hasData($result))
return $this->outputJsonSuccess(true);
$data = getData($result);
$result = $this->antraglib->getFailedExamForPrestudent($prestudent_id);
// NOTE(chris): error handling for this function should already happenden in antraglib->getPrestudentWiederholungsBerechtigt()
$pruefungsdata = current(getData($result));
$data->studiensemester_kurzbz = $pruefungsdata->studiensemester_kurzbz;
$data->lvbezeichnung = $pruefungsdata->lvbezeichnung;
$data->pruefungsdatum = $pruefungsdata->datum;
$this->outputJsonSuccess($data);
}
public function getLvs($antrag_id)
{
$result = $this->antraglib->getLvsForAntrag($antrag_id);
if (isError($result)) {
$error = getError($result);
if ($error == 'Forbidden')
$this->output->set_status_header(REST_Controller::HTTP_FORBIDDEN);
return $this->outputJsonError(getError($result));
}
$lvs = getData($result);
$this->outputJsonSuccess($lvs);
}
public function saveLvs()
{
$result = $this->getPostJSON();
$antragsLvs = array_merge($result->forbiddenLvs, $result->mandatoryLvs);
$insert = array_map(function ($lv) {
return [
'studierendenantrag_id' => $lv->studierendenantrag_id,
'lehrveranstaltung_id' => $lv->lehrveranstaltung_id,
'note' => $lv->zugelassen
? ($lv->zugelassen == 1 ? 0 : $this->config->item('wiederholung_note_angerechnet'))
: $this->config->item('wiederholung_note_nicht_zugelassen'),
'anmerkung' => $lv->anmerkung,
'insertvon' => getAuthUID(),
'studiensemester_kurzbz' => $lv->studiensemester_kurzbz
];
}, $antragsLvs);
$antrag_ids = array_unique(array_map(function ($lv) {
return $lv['studierendenantrag_id'];
}, $insert));
foreach ($antrag_ids as $antrag_id) {
$result = $this->StudierendenantragModel->loadIdAndStatusWhere([
'studierendenantrag_id' => $antrag_id
]);
if (isError($result))
return $this->outputJsonError(getError($result));
if (!hasData($result))
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_antrag_found', ['id' => $antrag_id]));
$antrag = current(getData($result));
if ($antrag->status != Studierendenantragstatus_model::STATUS_CREATED
&& $antrag->status != Studierendenantragstatus_model::STATUS_LVSASSIGNED)
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_antrag_locked'));
}
if(!$antragsLvs)
return $this->outputJsonError($this->p->t('studierendenantrag', 'error_no_lv'));
$result = $this->antraglib->saveLvs($insert);
if (isError($result))
return $this->outputJsonError(getError($result));
$this->outputJsonSuccess(getData($result));
}
public function getLvsAsRdf($prestudent_id)
{
// header für no cache
$this->output->set_header("Cache-Control: no-cache");
$this->output->set_header("Cache-Control: post-check=0, pre-check=0", false);
$this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
$this->output->set_header("Pragma: no-cache");
$this->output->set_header("Content-type: application/xhtml+xml");
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
$sem_akt = $this->variablelib->getVar('semester_aktuell');
$result = $this->antraglib->getLvsForPrestudent($prestudent_id, $sem_akt);
if (isError($result)) {
return $this->outputJsonError(getError($result));
}
$lvs = getData($result) ?: [];
$rdf_url = 'http://www.technikum-wien.at/antragnote';
$this->load->view('lehre/Antrag/Wiederholung/getLvs.rdf.php', [
'url' => $rdf_url,
'lvs' => $lvs
]);
}
public function moveLvsToZeugnis()
{
$anzahl = $this->input->post('anzahl');
$student_uid = $this->input->post('student_uid');
$this->load->model('education/Studierendenantraglehrveranstaltung_model', 'StudierendenantraglehrveranstaltungModel');
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
$errormsg = array();
for($i=0; $i<$anzahl; $i++)
{
$id = $this->input->post('studierendenantrag_lehrveranstaltung_id_' . $i);
$result =$this->StudierendenantraglehrveranstaltungModel->load($id);
if(isError($result))
{
$errormsg[] = getError($result);
}
elseif(!hasData($result))
{
$errormsg[] = $this->p->t('studierendenantrag', 'error_no_lv_in_application');
}
else
{
$antragLv = getData($result)[0];
$result= $this->ZeugnisnoteModel->load([
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz
]);
if(isError($result))
{
$errormsg[] = getError($result);
}
else
{
if (hasData($result))
{
$result = $this->ZeugnisnoteModel->update(
[
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz
],
[
'note'=> $antragLv->note,
'uebernahmedatum' => date('c'),
'benotungsdatum' => $antragLv->insertamum,
'updateamum' => date('c'),
'bemerkung'=>$antragLv->anmerkung,
'updatevon'=>getAuthUID()
]
);
}
else
{
$result = $this->ZeugnisnoteModel->insert([
'lehrveranstaltung_id'=> $antragLv->lehrveranstaltung_id,
'student_uid'=> $student_uid,
'studiensemester_kurzbz' => $antragLv->studiensemester_kurzbz,
'note'=> $antragLv->note,
'uebernahmedatum' => date('c'),
'benotungsdatum' => $antragLv->insertamum,
'insertamum' => date('c'),
'bemerkung'=>$antragLv->anmerkung,
'insertvon'=>getAuthUID()
]);
}
if(isError($result))
{
$errormsg[] = getError($result);
}
}
}
}
if($errormsg)
$return = false;
else
$return = true;
$this->load->view('lehre/Antrag/Wiederholung/moveLvs.rdf.php', [
'return' => $return,
'errormsg' => $errormsg
]);
}
}
@@ -9,7 +9,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
* NOTE: extends the FHC_Controller instead of the Auth_Controller because the FilterCmpt has its
* own permissions check
* TODO(chris): deprecated
*/
class Filter extends FHC_Controller
{
@@ -3,7 +3,7 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* TODO(chris): deprecated
*
*/
class Phrasen extends FHC_Controller
{
@@ -3,7 +3,7 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* TODO(chris): deprecated
*
*/
class SearchBar extends FHC_Controller
{
@@ -1023,7 +1023,7 @@ class ReihungstestJob extends JOB_Controller
{
$studiengang = $this->StudiengangModel->load($stg);
$mailcontent = '';
$content = false;
foreach ($orgform AS $art=>$value)
{
// Orgform nur dazu schreiben, wenn es mehr als Eine gibt
@@ -1044,7 +1044,6 @@ class ReihungstestJob extends JOB_Controller
$mailcontent .= '<tr><td style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px">'.$bewerber.'</td></tr>';
}
$mailcontent .= '</tbody></table><br><br>';
$content = true;
}
if (isset($value['AufnahmeHoeherePrio']) && !isEmptyArray($value['AufnahmeHoeherePrio']))
{
@@ -1059,7 +1058,6 @@ class ReihungstestJob extends JOB_Controller
$mailcontent .= '<tr><td style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px">'.$bewerber.'</td></tr>';
}
$mailcontent .= '</tbody></table>';
$content = true;
}
if (isset($value['AbgewiesenHoeherePrio']) && !isEmptyArray($value['AbgewiesenHoeherePrio']))
{
@@ -1073,7 +1071,6 @@ class ReihungstestJob extends JOB_Controller
$mailcontent .= '<tr><td style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px">'.$bewerber.'</td></tr>';
}
$mailcontent .= '</tbody></table>';
$content = true;
}
if ($bcc != '' && isset($value['AbgewiesenWeilBewerber']) && !isEmptyArray($value['AbgewiesenWeilBewerber']))
{
@@ -1088,14 +1085,13 @@ class ReihungstestJob extends JOB_Controller
$mailcontent .= '<tr><td style="font-family: verdana, sans-serif; border: 1px solid grey; padding: 3px">'.$bewerber.'</td></tr>';
}
$mailcontent .= '</tbody></table>';
$content = true;
}
}
$mailcontent_data_arr['table'] = $mailcontent;
// Send email in Sancho design
if (!isEmptyString($mailcontent) && $content === true)
if (!isEmptyString($mailcontent))
{
sendSanchoMail(
'Sancho_ReihungstestteilnehmerJob',
@@ -400,11 +400,6 @@ class MigrateContract extends CLI_Controller
*/
private function _addVertragsbestandteilZeitaufzeichnung(&$contracts, $dv, $row_verwendung)
{
if( is_null($row_verwendung->zeitaufzeichnungspflichtig) || is_null($row_verwendung->azgrelevant) )
{
return;
}
if (isset($contracts['dv'][$dv]['vbs']))
{
foreach ($contracts['dv'][$dv]['vbs'] as $index_vbs=>$row_vbs)
@@ -25,7 +25,6 @@ class MigrateHourlyRate extends CLI_Controller
public function index($user = null)
{
echo "Lehre Stundensaetze werden migriert.\n";
$mitarbeiterResult = $this->_getMitarbeiterStunden($user);
if (isError($mitarbeiterResult)) return $mitarbeiterResult;
if (!hasData($mitarbeiterResult)) return error('Keine Mitarbeiterstunden gefunden');
@@ -39,59 +38,20 @@ class MigrateHourlyRate extends CLI_Controller
if (isError($insertResult)) return $insertResult;
}
if( $this->checkIfSAPSyncTableExists() )
{
echo "SAP Sync Tabelle gefunden. SAP Stundensaetze werden migriert.\n";
$sapResult = $this->_getSapStunden($user);
if (isError($sapResult)) return $sapResult;
if (!hasData($sapResult)) return error('Keinen kalkulatorischen Stundensaetze gefunden');
$sapResult = $this->_getSapStunden($user);
if (isError($sapResult)) return $sapResult;
if (!hasData($sapResult)) return error('Keinen kalkulatorischen Stundensaetze gefunden');
$mitarbeiterArray = getData($sapResult);
$mitarbeiterArray = getData($sapResult);
foreach ($mitarbeiterArray as $mitarbeiter)
{
$this->_getUnternehmen($mitarbeiter);
$insertResult = $this->_addStundensatz($mitarbeiter, self::STUNDENSTAZTYP_KALKULATORISCH, date_format(date_create($mitarbeiter->beginn), 'Y-m-d'));
if (isError($insertResult)) return $insertResult;
}
}
else
foreach ($mitarbeiterArray as $mitarbeiter)
{
echo "SAP Sync Tabelle nicht gefunden. Ignoriere SAP Stundensaetze.\n";
$this->_getUnternehmen($mitarbeiter);
$insertResult = $this->_addStundensatz($mitarbeiter, self::STUNDENSTAZTYP_KALKULATORISCH, date_format(date_create($mitarbeiter->beginn), 'Y-m-d'));
if (isError($insertResult)) return $insertResult;
}
}
protected function checkIfSAPSyncTableExists()
{
$dbModel = new DB_Model();
$params = array(
DB_NAME,
'sync',
'tbl_sap_stundensatz'
);
$sql = "SELECT
1 AS exists
FROM
information_schema.tables
WHERE
table_catalog = ? AND
table_schema = ? AND
table_name = ?";
$res = $dbModel->execReadOnlyQuery($sql, $params);
if( hasData($res) )
{
return true;
}
else
{
return false;
}
}
private function _getSapStunden($user = null)
{
$dbModel = new DB_Model();
@@ -22,7 +22,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
* This controller operates between (interface) the JS (GUI) and the NavigationLib (back-end)
* Provides data to the ajax get calls about the filter
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
* TODO(chris): deprecated
*/
class Navigation extends FHC_Controller
{
+18 -61
View File
@@ -7,10 +7,6 @@ if (!defined('BASEPATH')) exit('No direct script access allowed');
*/
abstract class Auth_Controller extends FHC_Controller
{
// Special Permissions
const PERM_ANONYMOUS = 'anonymous'; // Everyone
const PERM_LOGGED = 'logged_in'; // Every registered user
/**
* Extends this controller if authentication is required
*/
@@ -18,41 +14,17 @@ abstract class Auth_Controller extends FHC_Controller
{
parent::__construct();
if (!is_array($requiredPermissions) || isEmptyArray($requiredPermissions))
show_error('The given permissions is not a valid array or it is an empty one');
if (!isset($requiredPermissions[$this->router->method]))
show_error('The given permission array does not contain the given method or is not correctly set');
$anonAllowed = false;
if ($requiredPermissions[$this->router->method] == self::PERM_ANONYMOUS)
$anonAllowed = true;
elseif (is_array($requiredPermissions[$this->router->method])
&& in_array(self::PERM_ANONYMOUS, $requiredPermissions[$this->router->method]))
$anonAllowed = true;
// Loads authentication library and starts authentication
$this->load->library('AuthLib');
if ($anonAllowed) {
// Loads authentication library without authentication
$this->load->library('AuthLib', [false]);
// Loads helper since it would only be called on authentication
$this->load->helper('hlp_authentication');
} else {
// Loads authentication library and starts authentication
$this->load->library('AuthLib');
// Checks if the caller is allowed to access to this content
$this->_isAllowed($requiredPermissions);
}
// Checks if the caller is allowed to access to this content
$this->_isAllowed($requiredPermissions);
}
/**
* Checks if the caller is allowed to access to this content with the given permissions
* If it is not allowed will set the HTTP header with code 401
* Wrapper for permissionlib->isEntitled
*
* @param array $requiredPermissions
* @return void
*/
private function _isAllowed($requiredPermissions)
{
@@ -62,43 +34,28 @@ abstract class Auth_Controller extends FHC_Controller
// Checks if this user is entitled to access to this content
if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method))
{
$this->_outputAuthError($requiredPermissions);
$this->output->set_status_header(REST_Controller::HTTP_UNAUTHORIZED); // set the HTTP header as unauthorized
$this->load->library('EPrintfLib'); // loads the EPrintfLib to format the output
// Prints the main error message
$this->eprintflib->printError('You are not allowed to access to this content');
// Prints the called controller name
$this->eprintflib->printInfo('Controller name: '.$this->router->class);
// Prints the called controller method name
$this->eprintflib->printInfo('Method name: '.$this->router->method);
// Prints the required permissions needed to access to this method
$this->eprintflib->printInfo('Required permissions: '.$this->_rpsToString($requiredPermissions, $this->router->method));
exit; // immediately terminate the execution
}
}
/**
* Outputs an error message and sets the HTTP Header.
* This function is protected so that it can be overwritten.
*
* @param array $requiredPermissions
* @return void
*/
protected function _outputAuthError($requiredPermissions)
{
$this->output->set_status_header(REST_Controller::HTTP_UNAUTHORIZED); // set the HTTP header as unauthorized
$this->load->library('EPrintfLib'); // loads the EPrintfLib to format the output
// Prints the main error message
$this->eprintflib->printError('You are not allowed to access to this content');
// Prints the called controller name
$this->eprintflib->printInfo('Controller name: '.$this->router->class);
// Prints the called controller method name
$this->eprintflib->printInfo('Method name: '.$this->router->method);
// Prints the required permissions needed to access to this method
$this->eprintflib->printInfo('Required permissions: '.$this->_rpsToString($requiredPermissions, $this->router->method));
}
/**
* Converts an array of permissions to a string that contains them as a comma separated list
* Ex: "<permission 1>, <permission 2>, <permission 3>"
*
* @param array $requiredPermissions
* @param string $method
* @return void
*/
final protected function _rpsToString($requiredPermissions, $method)
private function _rpsToString($requiredPermissions, $method)
{
$strRequiredPermissions = ''; // string that contains all the required permissions needed to access to this method
+71 -47
View File
@@ -5,7 +5,7 @@ if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Controller using JSON
*/
class FHCAPI_Controller extends Auth_Controller
class FHCAPI_Controller extends FHC_Controller
{
/**
@@ -19,13 +19,12 @@ class FHCAPI_Controller extends Auth_Controller
/**
* Error types
*/
const ERROR_TYPE_PHP = 'php';
const ERROR_TYPE_PHP = 'php'; // TODO(chris): php types from severity?
const ERROR_TYPE_EXCEPTION = 'exception';
const ERROR_TYPE_GENERAL = 'general';
const ERROR_TYPE_404 = '404';
const ERROR_TYPE_DB = 'db';
const ERROR_TYPE_VALIDATION = 'validation';
const ERROR_TYPE_AUTH = 'auth';
/**
* Return Object
@@ -46,6 +45,10 @@ class FHCAPI_Controller extends Auth_Controller
if (is_cli())
show_404();
parent::__construct();
$this->config->set_item('error_views_path', VIEWPATH.'errors'.DIRECTORY_SEPARATOR.'json'.DIRECTORY_SEPARATOR);
global $g_result;
$g_result = $this;
@@ -71,14 +74,18 @@ class FHCAPI_Controller extends Auth_Controller
}
}
#$this->returnObj['test'] = implode('/n', headers_list());
return json_encode($this->returnObj);
});
// NOTE(chris): overwrite error_views_path before constructor
load_class('Config')->set_item('error_views_path', VIEWPATH.'errors'.DIRECTORY_SEPARATOR.'json'.DIRECTORY_SEPARATOR);
// Load libraries
$this->load->library('AuthLib');
$this->load->library('PermissionLib');
// Checks if the caller is allowed to access to this content
$this->_isAllowed($requiredPermissions);
parent::__construct($requiredPermissions);
// For JSON Requests (as opposed to multipart/form-data) get the $_POST variable from the input stream instead
if ($this->input->get_request_header('Content-Type', true) == 'application/json')
$_POST = json_decode($this->security->xss_clean($this->input->raw_input_stream), true);
@@ -129,25 +136,15 @@ class FHCAPI_Controller extends Auth_Controller
$this->returnObj['data'] = $data;
}
/**
* @param string $key
* @param mixed $value
* @return void
*/
public function addMeta($key, $value)
{
if (!isset($this->returnObj['meta']))
$this->returnObj['meta'] = [];
$this->returnObj['meta'][$key] = $value;
}
/**
* @param string $status
* @return void
*/
public function setStatus($status)
{
$this->addMeta('status', $status);
if (!isset($this->returnObj['meta']))
$this->returnObj['meta'] = [];
$this->returnObj['meta']['status'] = $status;
}
@@ -155,17 +152,6 @@ class FHCAPI_Controller extends Auth_Controller
// Handle Output object - Shortcut functions
// ---------------------------------------------------------------
/**
* @param mixed $data (optional)
* @return void
*/
protected function terminateWithSuccess($data = null)
{
$this->setData($data);
$this->setStatus(self::STATUS_SUCCESS);
exit;
}
/**
* @param array $errors
* @return void
@@ -179,14 +165,24 @@ class FHCAPI_Controller extends Auth_Controller
}
/**
* @param array $error
* @param string $type (optional)
* @param integer $status (optional)
* @param mixed $data (optional)
* @return void
*/
protected function terminateWithError($error, $type = null, $status = REST_Controller::HTTP_INTERNAL_SERVER_ERROR)
protected function terminateWithSuccess($data = null)
{
$this->output->set_status_header($status);
$this->setData($data);
$this->setStatus(self::STATUS_SUCCESS);
exit;
}
/**
* @param array $error
* @param string $type (optional)
* @return void
*/
protected function terminateWithError($error, $type = null)
{
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
$this->addError($error, $type);
$this->setStatus(self::STATUS_ERROR);
exit;
@@ -197,35 +193,63 @@ class FHCAPI_Controller extends Auth_Controller
* @param string $errortype
* @return void
*/
protected function getDataOrTerminateWithError($result, $errortype = self::ERROR_TYPE_GENERAL)
protected function checkForErrors($result, $errortype = self::ERROR_TYPE_GENERAL)
{
// TODO(chris): IMPLEMENT!
if (isError($result)) {
$this->terminateWithError(getError($result), $errortype);
}
return $result->retval;
}
// TODO(chris): complete list
// ---------------------------------------------------------------
// Security
// ---------------------------------------------------------------
/**
* Outputs an error message and sets the HTTP Header.
* This overwrites the default behaviour to output a json object.
* Checks if the caller is allowed to access to this content with the given permissions
* If it is not allowed will set the HTTP header with code 401
* Wrapper for permissionlib->isEntitled
*
* @param array $requiredPermissions
* @return void
*/
protected function _outputAuthError($requiredPermissions)
protected function _isAllowed($requiredPermissions)
{
$this->output->set_status_header(isLogged() ? REST_Controller::HTTP_FORBIDDEN : REST_Controller::HTTP_UNAUTHORIZED);
// Checks if this user is entitled to access to this content
if (!$this->permissionlib->isEntitled($requiredPermissions, $this->router->method))
{
$this->output->set_status_header(isLogged() ? REST_Controller::HTTP_FORBIDDEN : REST_Controller::HTTP_UNAUTHORIZED);
$this->addError([
'message' => 'You are not allowed to access to this content',
'controller' => $this->router->class,
'method' => $this->router->method,
'required_permissions' => $this->_rpsToString($requiredPermissions, $this->router->method)
], self::ERROR_TYPE_AUTH);
$this->addError([
'message' => 'You are not allowed to access to this content',
'controller' => $this->router->class,
'method' => $this->router->method,
'required_permissions' => $this->_rpsToString($requiredPermissions, $this->router->method)
]);
exit; // immediately terminate the execution
}
}
/**
* Converts an array of permissions to a string that contains them as a comma separated list
* Ex: "<permission 1>, <permission 2>, <permission 3>"
*
* @param array $requiredPermissions
* @param string $method
* @return void
*/
protected function _rpsToString($requiredPermissions, $method)
{
if (!isset($requiredPermissions[$method]))
return '';
if (!is_array($requiredPermissions[$method]))
return $requiredPermissions[$method];
return implode(', ', $requiredPermissions[$method]);
}
}
+1 -1
View File
@@ -2058,7 +2058,7 @@ class AntragLib
*/
public function isEntitledToUnpauseAntrag($antrag_id)
{
return ($this->hasAccessToAntrag($antrag_id, 'student/antragfreigabe') || $this->hasAccessToAntrag($antrag_id, 'student/studierendenantrag'));
return $this->hasAccessToAntrag($antrag_id, 'student/studierendenantrag');
}
/**
+1 -15
View File
@@ -21,8 +21,6 @@ require_once(FHCPATH.'include/functions.inc.php');
require_once(FHCPATH.'include/wawi_kostenstelle.class.php');
require_once(FHCPATH.'include/benutzerberechtigung.class.php');
use \benutzerberechtigung as benutzerberechtigung;
class PermissionLib
{
// Available rights in the DB
@@ -67,10 +65,8 @@ class PermissionLib
if (!is_cli())
{
// API Caller rights initialization
$authObj = $this->_ci->authlib->getAuthObj();
self::$bb = new benutzerberechtigung();
if ($authObj)
self::$bb->getBerechtigungen($authObj->{AuthLib::AO_USERNAME});
self::$bb->getBerechtigungen(($this->_ci->authlib->getAuthObj())->{AuthLib::AO_USERNAME});
}
}
@@ -170,16 +166,6 @@ class PermissionLib
if ($checkPermissions === true) break;
}
}
elseif ($permissions[$pCounter] == Auth_Controller::PERM_ANONYMOUS)
{
$checkPermissions = true;
break;
}
elseif ($permissions[$pCounter] == Auth_Controller::PERM_LOGGED)
{
$checkPermissions = isLogged();
break;
}
else
{
show_error('The given permission does not use the correct format');
@@ -563,7 +563,7 @@ class Studiengang_model extends DB_Model
$this->addJoin('public.tbl_student stud', 'p.prestudent_id=stud.prestudent_id', 'LEFT');
$this->db->where_in($this->dbTable . '.studiengang_kz', $studiengang_kzs);
$this->db->where_in('ps.status_kurzbz', $this->config->item('antrag_prestudentstatus_whitelist_abmeldung'));
$this->db->where_in('ps.status_kurzbz', $this->config->item('antrag_prestudentstatus_whitelist'));
$this->db->where($this->dbTable . ".aktiv", true);
if ($not_antrag_typ !== null && is_array($not_antrag_typ)) {
@@ -11,7 +11,6 @@ $sitesettings = array(
'customJSModules' => array('public/js/apps/lehre/Antrag.js'),
'customCSSs' => array(
'public/css/Fhc.css',
'public/css/components/primevue.css',
'vendor/vuejs/vuedatepicker_css/main.css'
),
'customJSs' => array(
@@ -20,8 +20,7 @@ $sitesettings = array(
),
'customJSModules' => array('public/js/apps/lehre/Antrag/Leitung.js'),
'customCSSs' => array(
'public/css/Fhc.css',
'public/css/components/primevue.css',
'public/css/Fhc.css'
),
'customJSs' => array(
)
@@ -10,8 +10,7 @@ $sitesettings = array(
),
'customJSModules' => array('public/js/apps/lehre/Antrag/Student.js'),
'customCSSs' => array(
'public/css/Fhc.css',
'public/css/components/primevue.css',
'public/css/Fhc.css'
),
'customJSs' => array(
)
@@ -14,8 +14,6 @@ $sitesettings = array(
),
'customJSModules' => array('public/js/apps/lehre/Antrag/Lvzuweisung.js'),
'customCSSs' => array(
'public/css/Fhc.css',
'public/css/components/primevue.css',
),
'customJSs' => array(
)
@@ -32,7 +30,7 @@ $this->load->view(
<h1 class="h2"><?= $this->p->t('studierendenantrag', 'title_lvzuweisen', ['name' => $antrag->name]);?></h1>
</div>
<div class="fhc-container row mt-3">
<lv-zuweisung :antrag-id="<?= $antrag_id; ?>" initial-status-code="<?= $antrag->status; ?>" initial-status-msg="<?= $antrag->statustyp; ?>"<?= ($antrag->status != Studierendenantragstatus_model::STATUS_CREATED && $antrag->status != Studierendenantragstatus_model::STATUS_LVSASSIGNED) ? ' disabled' : ''; ?>></lv-zuweisung>
<lv-zuweisung antrag-id="<?= $antrag_id; ?>" initial-status-code="<?= $antrag->status; ?>" initial-status-msg="<?= $antrag->statustyp; ?>"<?= ($antrag->status != Studierendenantragstatus_model::STATUS_CREATED && $antrag->status != Studierendenantragstatus_model::STATUS_LVSASSIGNED) ? ' disabled' : ''; ?>></lv-zuweisung>
</div>
</div>
+9 -8
View File
@@ -1,12 +1,13 @@
<?php
$includesArray = array(
'title' => 'Test Search',
'jquery3' => true,
'bootstrap5' => true,
'fontawesome6' => true,
'tabulator5' => true,
'primevue3' => true,
'axios027' => true,
'tablesorter2' => true,
'vue3' => true,
'ajaxlib' => true,
'jqueryui1' => true,
'filtercomponent' => true,
'navigationcomponent' => true,
'phrases' => array(
@@ -16,8 +17,8 @@
'customCSSs' => array(
'public/css/components/verticalsplit.css',
'public/css/components/searchbar.css',
'public/css/components/primevue.css',
),
'customJSs' => array('vendor/axios/axios/axios.min.js'),
'customJSModules' => array('public/js/apps/TestSearch.js')
);
@@ -39,17 +40,17 @@
</div>
<div>
<core-searchbar :searchoptions="searchbaroptions" :searchfunction="searchfunction"></core-searchbar>
<searchbar :searchoptions="searchbaroptions" :searchfunction="searchfunction"></searchbar>
<core-verticalsplit>
<verticalsplit>
<template #top>
<core-searchbar :searchoptions="searchbaroptions" :searchfunction="searchfunctiondummy"></core-searchbar>
<searchbar :searchoptions="searchbaroptions" :searchfunction="searchfunctiondummy"></searchbar>
</template>
<template #bottom>
<!-- Filter component -->
<core-filter-cmpt filter-type="LogsViewer" @nw-new-entry="newSideMenuEntryHandler"></core-filter-cmpt>
</template>
</core-verticalsplit>
</verticalsplit>
</div>
</div>
+15 -16
View File
@@ -45,22 +45,25 @@ echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<link rel="stylesheet" href="../../../skin/tablesort.css" type="text/css"/>
<link rel="stylesheet" href="../../../skin/style.css.php" type="text/css">
<link rel="stylesheet" type="text/css" href="../../../skin/jquery-ui-1.9.2.custom.min.css">
<script type="text/javascript" src="../../../vendor/jquery/jquery1/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>';
const MOODLE_ADDON_KURZBZ = 'moodle';
<link rel="stylesheet" type="text/css" href="../../../skin/jquery-ui-1.9.2.custom.min.css">
<script type="text/javascript" src="../../../vendor/jquery/jquery1/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../../include/js/jquery.ui.datepicker.translation.js"></script>
<script type="text/javascript" src="../../../vendor/jquery/sizzle/sizzle.js"></script>';
// Load Addons to get Moodle_Path
$addon_obj = new addon();
// include moodle addon config if active
if ($addon_obj->checkActiveAddon(MOODLE_ADDON_KURZBZ) && file_exists('../../../addons/'.MOODLE_ADDON_KURZBZ.'/config.inc.php'))
if ($addon_obj->loadAddons())
{
include_once('../../../addons/'.MOODLE_ADDON_KURZBZ.'/config.inc.php');
if (count($addon_obj->result) > 0)
{
foreach ($addon_obj->result as $row)
{
if (file_exists('../../../addons/'.$row->kurzbz.'/config.inc.php'))
include_once('../../../addons/'.$row->kurzbz.'/config.inc.php');
}
}
}
echo '
@@ -114,7 +117,6 @@ echo '</SELECT>
<input type="submit" value="'.$p->t("services/filtern").'" />
</form>';
$servicekategorie_arr = $service->getKategorieArray();
if($oe_kurzbz!='')
{
@@ -132,7 +134,6 @@ echo '<table class="tablesorter" id="myTable">
<th>'.$p->t("global/bezeichnung").'</th>
<th>'.$p->t("services/leistung").'</th>
<th>'.$p->t("services/design").'</th>
<th>'.$p->t("services/kritikalitaet").'</th>
<th>'.$p->t("services/details").'</th>
</tr>
</thead>
@@ -158,8 +159,6 @@ foreach($service->result as $row)
echo '<td><nobr><a href="../profile/index.php?uid='.$row->design_uid.'">',$design,'</a></nobr></td>';
//echo '<td><nobr><a href="../profile/index.php?uid='.$row->betrieb_uid.'">',$betrieb,'</a></nobr></td>';
//echo '<td><nobr><a href="../profile/index.php?uid='.$row->operativ_uid.'">',$operativ,'</a></nobr></td>';
$title = (isset($servicekategorie_arr[$row->servicekategorie_kurzbz])?$servicekategorie_arr[$row->servicekategorie_kurzbz]:'');
echo '<td><span title="'.$service->convert_html_chars($title).'">',$title,'</span></td>';
echo '<td>'.($row->content_id!=''?'<a href="../../../cms/content.php?content_id='.$row->content_id.'">Details</a>':'');
if (defined("ADDON_MOODLE_PATH"))
echo ' '.($row->ext_id!=''?'<a href="'.ADDON_MOODLE_PATH.'course/view.php?id='.$row->ext_id.'" target="_blank">Beschreibung</a>':'');
+7 -4
View File
@@ -62,7 +62,7 @@
$stsem = $_GET['stsem'];
else
die($p->t('anwesenheitsliste/studiensemesterIstUngueltig'));
$covidhelper = new CovidHelper();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
@@ -114,6 +114,9 @@ $covidhelper = new CovidHelper();
echo "</table>";
$qry = "SELECT *, tbl_lehreinheitgruppe.studiengang_kz, tbl_lehreinheitgruppe.semester FROM lehre.tbl_lehreinheit JOIN lehre.tbl_lehreinheitgruppe USING(lehreinheit_id) JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
WHERE lehrveranstaltung_id='$lvid' AND studiensemester_kurzbz=".$db->db_add_param($stsem);
$qry = "SELECT *, tbl_lehreinheitgruppe.studiengang_kz, tbl_lehreinheitgruppe.semester ,tbl_lehreinheit.lehrform_kurzbz
FROM lehre.tbl_lehreinheit
JOIN lehre.tbl_lehreinheitgruppe USING(lehreinheit_id)
@@ -210,7 +213,7 @@ $covidhelper = new CovidHelper();
$covid_content = "<table border='0' cellspacing='0'><tr><td><h3>".$p->t('anwesenheitsliste/covidstatuslisten')."</h3></td></tr>".$covid_content."</table>";
else
$covid_content = ($covidhelper->isUdfDefined()) ? $p->t('anwesenheitsliste/keineStudentenVorhanden') : '';
if($aw_content!='')
$aw_content = "<table border='0' cellspacing='0'><tr><td><h3>".$p->t('anwesenheitsliste/anwesenheitslisten')."</h3></td></tr>".$aw_content."</table>";
else
@@ -238,9 +241,9 @@ $covidhelper = new CovidHelper();
{
$covid_content = '';
}
echo "<table cellpadding='0' cellspacing='0'>
<tr>
<td>$aw_content</td>
<td class=\"covidstatus\">$covid_content</td>
@@ -102,22 +102,6 @@ $noten_obj->getAll();
$sprachen = new sprache();
$sprachen->getAll(true);
$noten_array = array();
$js_noten='';
foreach ($noten_obj->result as $row)
{
$js_noten .= " noten_array['" . $row->note . "']='" . addslashes($row->bezeichnung) . "';\n";
$noten_array[$row->note]['bezeichnung'] = $row->bezeichnung;
$noten_array[$row->note]['positiv'] = $row->positiv;
$noten_array[$row->note]['aktiv'] = $row->aktiv;
$noten_array[$row->note]['lehre'] = $row->lehre;
$noten_array[$row->note]['lkt_ueberschreibbar'] = $row->lkt_ueberschreibbar;
$noten_array[$row->note]['anmerkung'] = $row->anmerkung;
foreach ($sprachen->result as $s)
$noten_array[$row->note]['bezeichnung_mehrsprachig'][$s->sprache] = $row->bezeichnung_mehrsprachig[$s->sprache];
}
$errormsg = '';
// eingetragene lv-gesamtnoten freigeben
@@ -342,7 +326,19 @@ echo '<!DOCTYPE HTML>
var noten_array = Array();
';
echo $js_noten;
$noten_array = array();
foreach ($noten_obj->result as $row)
{
echo " noten_array['" . $row->note . "']='" . addslashes($row->bezeichnung) . "';\n";
$noten_array[$row->note]['bezeichnung'] = $row->bezeichnung;
$noten_array[$row->note]['positiv'] = $row->positiv;
$noten_array[$row->note]['aktiv'] = $row->aktiv;
$noten_array[$row->note]['lehre'] = $row->lehre;
$noten_array[$row->note]['lkt_ueberschreibbar'] = $row->lkt_ueberschreibbar;
$noten_array[$row->note]['anmerkung'] = $row->anmerkung;
foreach ($sprachen->result as $s)
$noten_array[$row->note]['bezeichnung_mehrsprachig'][$s->sprache] = $row->bezeichnung_mehrsprachig[$s->sprache];
}
?>
@@ -810,16 +806,16 @@ echo $js_noten;
for(row in rows)
{
linenumber++;
if( rows[row] == '' )
if( rows[row] == '' )
{
//skip empty lines
continue;
}
zeile = rows[row].split(" ");
if( zeile.length < 2 )
{
alertMsg = alertMsg + "Zeile " + linenumber + ': '
alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ 'Zu wenig Paramter - 2 erforderlich. '
+ 'Die Zeile wurde uebersprungen.' + "\n\n";
continue;
@@ -921,36 +917,36 @@ echo $js_noten;
for(row in rows)
{
linenumber++;
if( rows[row] == '' )
if( rows[row] == '' )
{
//skip empty lines
continue;
}
zeile = rows[row].split(" ");
if( zeile.length < 3 )
{
alertMsg = alertMsg + "Zeile " + linenumber + ': '
alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ 'Zu wenig Paramter - 3 erforderlich. '
+ 'Die Zeile wurde uebersprungen.' + "\n\n";
continue;
}
if( zeile[1] == '' && zeile[2] == '' )
{
// ignore lines just copied from excel
// ignore lines just copied from excel
continue;
}
if( zeile[2] == '' )
if( zeile[2] == '' )
{
alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ "Die Note oder Punkte fehlen. "
+ "Die Zeile wurde uebersprungen. \n\n";
continue;
continue;
}
if (CIS_GESAMTNOTE_PUNKTE == false)
if (CIS_GESAMTNOTE_PUNKTE == false)
{
// check for valid grades
if (validGrades.indexOf(zeile[2]) === -1)
@@ -962,7 +958,7 @@ echo $js_noten;
}
}
if( !zeile[1].match(/[0-9]{2}\.[0-9]{2}\.[0-9]{4}/) )
if( !zeile[1].match(/[0-9]{2}\.[0-9]{2}\.[0-9]{4}/) )
{
alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ "Das Datum "+zeile[1]+" fehlt oder ist nicht zulaessig. "
@@ -251,7 +251,7 @@ else
// deshalb wird hier versucht eine passende Lehreinheit zu ermitteln.
$lehreinheit_id = getLehreinheit($db, $lvid, $student_uid, $stsem);
$response = savePruefung($lvid, $student_uid, $stsem, $lehreinheit_id, $datum, $typ, $note, $punkte);
$response = savePruefung($lvid, $student_uid, $stsem, $lehreinheit_id, $datum, $typ, $note);
echo $response;
}
else
+10 -11
View File
@@ -65,11 +65,6 @@ $xsl_stg_kz = 0;
$sign = false;
/* Signing on CIS disabled
if(isset($_GET['sign']))
$sign = true;
*/
// Direkte uebergabe des Studienganges dessen Vorlage verwendet werden soll
if (isset($_GET['xsl_stg_kz']))
$xsl_stg_kz = $_GET['xsl_stg_kz'];
@@ -303,18 +298,22 @@ if ((((isset($_GET["uid"]) && $user == $_GET["uid"])) || $rechte->isBerechtigt('
$dokument->setFilename($filename);
if (!$dokument->create($output))
die($dokument->errormsg);
if ($sign === true)
{
if (!$dokument->sign($user))
if ($dokument->sign($user))
{
$dokument->output();
}
else
{
echo $dokument->errormsg;
}
}
if (!$dokument->create($output))
die($dokument->errormsg);
$dokument->output();
else
$dokument->output();
$dokument->close();
}
else
+2
View File
@@ -1222,6 +1222,7 @@ if ($projekt->getProjekteMitarbeiter($user, true))
<td colspan="4"><SELECT name="projekt" id="projekt">
<OPTION value="">-- '.$p->t('zeitaufzeichnung/keineAuswahl').' --</OPTION>';
sort($projekt->result);
$projektfound = false;
foreach ($projekt->result as $row_projekt)
{
@@ -1975,6 +1976,7 @@ function getDataForProjectOverviewCSV($user)
}
}
sort($csvData);
//headers schreiben
$header = array('PROJEKT', 'PROJEKT KURZBEZEICHNUNG', 'PROJEKTPHASE', 'PROJEKTPHASEN ID', 'START', 'PROJEKT ENDE');
@@ -60,7 +60,7 @@ if (isset($_GET['uid']))
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
if ($rechte->isBerechtigt('admin') || $rechte->isBerechtigt('mitarbeiter/zeitsperre') || (in_array($_GET['uid'], $untergebenen_arr)))
if ($rechte->isBerechtigt('admin') || (in_array($_GET['uid'], $untergebenen_arr)))
{
$uid = $_GET['uid'];
}
+66 -262
View File
@@ -30,8 +30,6 @@ require_once('../../include/Excel/excel.php');
require_once('../../include/studiengang.class.php');
require_once('../../include/studiensemester.class.php');
require_once('../../include/mail.class.php');
require_once('../../include/benutzerfunktion.class.php');
require_once('../../include/organisationseinheit.class.php');
$stsem = new studiensemester();
@@ -98,11 +96,12 @@ $qry_stg = "SELECT distinct studiengang_kz, typ, kurzbz
SELECT
studiengang_kz
FROM
lehre.tbl_projektbetreuer JOIN lehre.tbl_projektarbeit ON tbl_projektbetreuer.projektarbeit_id=tbl_projektarbeit.projektarbeit_id
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id = tbl_projektarbeit.lehreinheit_id
JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id = tbl_lehreinheit.lehrveranstaltung_id
lehre.tbl_projektbetreuer, lehre.tbl_projektarbeit, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung
WHERE
lehre.tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
lehre.tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)." AND
tbl_projektbetreuer.projektarbeit_id=tbl_projektarbeit.projektarbeit_id AND
tbl_projektarbeit.lehreinheit_id = tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id
) as foo
JOIN public.tbl_studiengang USING (studiengang_kz)
";
@@ -125,10 +124,6 @@ $workbook->setCustomColor(10, 255, 186, 179);
$format_colored =& $workbook->addFormat();
$format_colored->setFgColor(10);
$workbook->setCustomColor(10, 238, 238, 0);
$oe_colored =& $workbook->addFormat();
$oe_colored->setFgColor(11);
$format_number_colored =& $workbook->addFormat();
$format_number_colored->setNumFormat('0,0.00');
//$format_number_colored->setNumFormat('0.00');
@@ -190,17 +185,6 @@ if ($result_stg = $db->db_query($qry_stg))
$gesamt->write($gesamtsheet_row, $i, "Gesamtstunden", $format_bold);
$worksheet->write(2, ++$i, "Gesamtkosten", $format_bold);
$gesamt->write($gesamtsheet_row, $i, "Gesamtkosten", $format_bold);
$worksheet->write(2, ++$i, "Gesamtstunden bestellt", $format_bold);
$gesamt->write($gesamtsheet_row, $i, "Gesamtstunden bestellt", $format_bold);
$worksheet->write(2, ++$i, "Gesamtkosten bestellt", $format_bold);
$gesamt->write($gesamtsheet_row, $i, "Gesamtkosten bestellt", $format_bold);
$worksheet->write(2, ++$i, "Gesamtstunden erteilt", $format_bold);
$gesamt->write($gesamtsheet_row, $i, "Gesamtstunden erteilt", $format_bold);
$worksheet->write(2, ++$i, "Gesamtkosten erteilt", $format_bold);
$gesamt->write($gesamtsheet_row, $i, "Gesamtkosten erteilt", $format_bold);
$worksheet->write(2, ++$i, "Gesamtstunden angenommen", $format_bold);
$gesamt->write($gesamtsheet_row, $i, "Gesamtstunden angenommen", $format_bold);
$worksheet->write(2, ++$i, "Gesamtkosten angenommen", $format_bold);
@@ -225,7 +209,7 @@ if ($result_stg = $db->db_query($qry_stg))
SELECT tbl_organisationseinheit.organisationseinheittyp_kurzbz || ' ' || tbl_organisationseinheit.bezeichnung
FROM PUBLIC.tbl_benutzerfunktion
JOIN PUBLIC.tbl_organisationseinheit USING (oe_kurzbz)
WHERE funktion_kurzbz = (CASE WHEN fixangestellt = true THEN 'kstzuordnung' ELSE 'oezuordnung' END)
WHERE funktion_kurzbz = 'oezuordnung'
AND (
datum_von IS NULL
OR datum_von <= now()
@@ -245,7 +229,7 @@ if ($result_stg = $db->db_query($qry_stg))
WHERE oe_kurzbz IN (
SELECT oe_kurzbz
FROM PUBLIC.tbl_benutzerfunktion
WHERE funktion_kurzbz = (CASE WHEN fixangestellt = true THEN 'kstzuordnung' ELSE 'oezuordnung' END)
WHERE funktion_kurzbz = 'oezuordnung'
AND (
datum_von IS NULL
OR datum_von <= now()
@@ -278,20 +262,26 @@ if ($result_stg = $db->db_query($qry_stg))
THEN 't'
ELSE 'f'
END AS geaendert,
(SELECT
ARRAY_TO_STRING(ARRAY_AGG(vertragsstatus_kurzbz), ',')
FROM
lehre.tbl_vertrag_vertragsstatus
WHERE
vertrag_id = tbl_lehreinheitmitarbeiter.vertrag_id
) as vertragsstatus
FROM lehre.tbl_lehreinheit
JOIN lehre.tbl_lehreinheitmitarbeiter ON tbl_lehreinheit.lehreinheit_id = tbl_lehreinheitmitarbeiter.lehreinheit_id
JOIN PUBLIC.tbl_mitarbeiter ON tbl_lehreinheitmitarbeiter.mitarbeiter_uid = tbl_mitarbeiter.mitarbeiter_uid
JOIN PUBLIC.tbl_benutzer ON tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid
JOIN PUBLIC.tbl_person ON tbl_person.person_id = tbl_benutzer.person_id
JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id = tbl_lehreinheit.lehrveranstaltung_id
WHERE studiengang_kz = ".$db->db_add_param($studiengang_kz)."
(SELECT
vertragsstatus_kurzbz
FROM
lehre.tbl_vertrag_vertragsstatus
WHERE
vertrag_id = tbl_lehreinheitmitarbeiter.vertrag_id
ORDER BY datum DESC
LIMIT 1) as vertragsstatus
FROM lehre.tbl_lehreinheit,
lehre.tbl_lehreinheitmitarbeiter,
PUBLIC.tbl_mitarbeiter,
PUBLIC.tbl_benutzer,
PUBLIC.tbl_person,
lehre.tbl_lehrveranstaltung
WHERE tbl_person.person_id = tbl_benutzer.person_id
AND tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid
AND tbl_lehreinheitmitarbeiter.mitarbeiter_uid = tbl_mitarbeiter.mitarbeiter_uid
AND tbl_lehreinheit.lehreinheit_id = tbl_lehreinheitmitarbeiter.lehreinheit_id
AND tbl_lehrveranstaltung.lehrveranstaltung_id = tbl_lehreinheit.lehrveranstaltung_id
AND studiengang_kz = ".$db->db_add_param($studiengang_kz)."
AND studiensemester_kurzbz = ".$db->db_add_param($semester_aktuell)."
AND tbl_lehreinheitmitarbeiter.semesterstunden <> 0
AND tbl_lehreinheitmitarbeiter.semesterstunden IS NOT NULL
@@ -312,7 +302,6 @@ if ($result_stg = $db->db_query($qry_stg))
$gesamtsheet_row++;
while ($row = $db->db_fetch_object($result))
{
$row->vertragsstatus = explode(',', $row->vertragsstatus);
//Gesamtstunden und Kosten ermitteln
if (array_key_exists($row->mitarbeiter_uid, $liste))
{
@@ -325,43 +314,13 @@ if ($result_stg = $db->db_query($qry_stg))
$liste[$row->mitarbeiter_uid]['gesamtkosten'] =
$liste[$row->mitarbeiter_uid]['gesamtkosten'] + ($row->semesterstunden * $row->stundensatz);
if (!isset($liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt']))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt'] = 0;
$liste[$row->mitarbeiter_uid]['gesamtkosten_bestellt'] = 0;
}
if (!isset($liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt']))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt'] = 0;
$liste[$row->mitarbeiter_uid]['gesamtkosten_erteilt'] = 0;
}
if (!isset($liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert']))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert'] = 0;
$liste[$row->mitarbeiter_uid]['gesamtkosten_akzeptiert'] = 0;
}
if (in_array('bestellt', $row->vertragsstatus))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt'] =
$liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt'] + $row->semesterstunden;
$liste[$row->mitarbeiter_uid]['gesamtkosten_bestellt'] =
$liste[$row->mitarbeiter_uid]['gesamtkosten_bestellt']
+ ($row->semesterstunden * $row->stundensatz);
}
if (in_array('erteilt', $row->vertragsstatus))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt'] =
$liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt'] + $row->semesterstunden;
$liste[$row->mitarbeiter_uid]['gesamtkosten_erteilt'] =
$liste[$row->mitarbeiter_uid]['gesamtkosten_erteilt']
+ ($row->semesterstunden * $row->stundensatz);
}
if (in_array('akzeptiert', $row->vertragsstatus))
if ($row->vertragsstatus == 'akzeptiert')
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert'] =
$liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert'] + $row->semesterstunden;
@@ -377,43 +336,13 @@ if ($result_stg = $db->db_query($qry_stg))
$liste[$row->mitarbeiter_uid]['gesamtstunden'] = $row->semesterstunden;
$liste[$row->mitarbeiter_uid]['gesamtkosten'] = $row->semesterstunden * $row->stundensatz;
if (!isset($liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt']))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt'] = 0;
$liste[$row->mitarbeiter_uid]['gesamtkosten_bestellt'] = 0;
}
if (!isset($liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt']))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt'] = 0;
$liste[$row->mitarbeiter_uid]['gesamtkosten_erteilt'] = 0;
}
if (!isset($liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert']))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert'] = 0;
$liste[$row->mitarbeiter_uid]['gesamtkosten_akzeptiert'] = 0;
}
if (in_array('bestellt', $row->vertragsstatus))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt'] =
$liste[$row->mitarbeiter_uid]['gesamtstunden_bestellt'] + $row->semesterstunden;
$liste[$row->mitarbeiter_uid]['gesamtkosten_bestellt'] =
$liste[$row->mitarbeiter_uid]['gesamtkosten_bestellt']
+ ($row->semesterstunden * $row->stundensatz);
}
if (in_array('erteilt', $row->vertragsstatus))
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt'] =
$liste[$row->mitarbeiter_uid]['gesamtstunden_erteilt'] + $row->semesterstunden;
$liste[$row->mitarbeiter_uid]['gesamtkosten_erteilt'] =
$liste[$row->mitarbeiter_uid]['gesamtkosten_erteilt']
+ ($row->semesterstunden * $row->stundensatz);
}
if (in_array('akzeptiert', $row->vertragsstatus))
if ($row->vertragsstatus == 'akzeptiert')
{
$liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert'] =
$liste[$row->mitarbeiter_uid]['gesamtstunden_akzeptiert'] + $row->semesterstunden;
@@ -427,20 +356,8 @@ if ($result_stg = $db->db_query($qry_stg))
$liste[$row->mitarbeiter_uid]['vorname'] = $row->vorname;
$liste[$row->mitarbeiter_uid]['nachname'] = $row->nachname;
$liste[$row->mitarbeiter_uid]['fixangestellt'] = $row->fixangestellt;
if (is_null($row->oezuordnung))
{
$oeInfos = getOe($row->mitarbeiter_uid, $row->fixangestellt);
$liste[$row->mitarbeiter_uid]['oezuordnung'] = $oeInfos['oezuordnung'];
$liste[$row->mitarbeiter_uid]['department'] = $oeInfos['department'];
$liste[$row->mitarbeiter_uid]['organisationgeaendert'] = $oeInfos['organisationgeaendert'];
}
else
{
$liste[$row->mitarbeiter_uid]['oezuordnung'] = $row->oezuordnung;
$liste[$row->mitarbeiter_uid]['department'] = $row->department;
}
$liste[$row->mitarbeiter_uid]['oezuordnung'] = $row->oezuordnung;
$liste[$row->mitarbeiter_uid]['department'] = $row->department;
$liste[$row->mitarbeiter_uid]['betreuergesamtstunden'] = 0;
$liste[$row->mitarbeiter_uid]['betreuergesamtkosten'] = 0;
if ($row->geaendert == 't')
@@ -458,7 +375,7 @@ if ($result_stg = $db->db_query($qry_stg))
public.tbl_benutzerfunktion
JOIN public.tbl_organisationseinheit USING (oe_kurzbz)
WHERE
funktion_kurzbz = (CASE WHEN fixangestellt = true THEN 'kstzuordnung' ELSE 'oezuordnung' END)
funktion_kurzbz='oezuordnung'
AND (datum_von IS NULL OR datum_von <= now())
AND (datum_bis IS NULL OR datum_bis >= now())
AND tbl_benutzerfunktion.uid = tbl_benutzer.uid
@@ -473,7 +390,7 @@ if ($result_stg = $db->db_query($qry_stg))
WHERE oe_kurzbz IN (
SELECT oe_kurzbz
FROM PUBLIC.tbl_benutzerfunktion
WHERE funktion_kurzbz = (CASE WHEN fixangestellt = true THEN 'kstzuordnung' ELSE 'oezuordnung' END)
WHERE funktion_kurzbz = 'oezuordnung'
AND (
datum_von IS NULL
OR datum_von <= now()
@@ -502,23 +419,27 @@ if ($result_stg = $db->db_query($qry_stg))
WHERE meine_oes.organisationseinheittyp_kurzbz = 'Department'
) AS department
FROM
lehre.tbl_projektbetreuer JOIN public.tbl_person ON tbl_projektbetreuer.person_id=tbl_person.person_id
JOIN public.tbl_benutzer ON tbl_benutzer.person_id=tbl_person.person_id
JOIN public.tbl_mitarbeiter ON tbl_mitarbeiter.mitarbeiter_uid=tbl_benutzer.uid
JOIN lehre.tbl_projektarbeit ON tbl_projektarbeit.projektarbeit_id=tbl_projektbetreuer.projektarbeit_id
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id=tbl_projektarbeit.lehreinheit_id
JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id = tbl_lehreinheit.lehrveranstaltung_id
lehre.tbl_projektbetreuer, public.tbl_person, public.tbl_benutzer,
public.tbl_mitarbeiter, lehre.tbl_projektarbeit, lehre.tbl_lehreinheit,
lehre.tbl_lehrveranstaltung
WHERE
tbl_projektbetreuer.person_id=tbl_person.person_id AND
tbl_person.person_id=tbl_benutzer.person_id AND
tbl_mitarbeiter.mitarbeiter_uid=tbl_benutzer.uid AND
tbl_projektarbeit.projektarbeit_id=tbl_projektbetreuer.projektarbeit_id AND
tbl_projektarbeit.lehreinheit_id=tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)." AND
tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id AND
tbl_lehrveranstaltung.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER)." AND
NOT EXISTS (SELECT
mitarbeiter_uid
FROM
lehre.tbl_lehreinheitmitarbeiter JOIN lehre.tbl_lehreinheit ON tbl_lehreinheitmitarbeiter.lehreinheit_id=tbl_lehreinheit.lehreinheit_id
JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id=tbl_lehreinheit.lehrveranstaltung_id
lehre.tbl_lehreinheitmitarbeiter, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung
WHERE
mitarbeiter_uid=tbl_benutzer.uid AND
tbl_lehrveranstaltung.lehrveranstaltung_id=tbl_lehreinheit.lehrveranstaltung_id AND
tbl_lehrveranstaltung.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER)." AND
tbl_lehreinheitmitarbeiter.lehreinheit_id=tbl_lehreinheit.lehreinheit_id AND
tbl_lehreinheitmitarbeiter.semesterstunden<>0 AND
tbl_lehreinheitmitarbeiter.semesterstunden is not null AND
EXISTS (
@@ -540,20 +461,8 @@ if ($result_stg = $db->db_query($qry_stg))
$liste[$row->uid]['vorname'] = $row->vorname;
$liste[$row->uid]['nachname'] = $row->nachname;
$liste[$row->uid]['fixangestellt'] = $row->fixangestellt;
if (is_null($row->oezuordnung))
{
$oeInfos = getOe($row->uid, $row->fixangestellt);
$liste[$row->uid]['oezuordnung'] = $oeInfos['oezuordnung'];
$liste[$row->uid]['department'] = $oeInfos['department'];
$liste[$row->uid]['organisationgeaendert'] = $oeInfos['organisationgeaendert'];
}
else
{
$liste[$row->uid]['oezuordnung'] = $row->oezuordnung;
$liste[$row->uid]['department'] = $row->department;
}
$liste[$row->uid]['oezuordnung'] = $row->oezuordnung;
$liste[$row->uid]['department'] = $row->department;
$liste[$row->uid]['geaendert'] = false;
$liste[$row->uid]['gesamtstunden'] = 0;
$liste[$row->uid]['gesamtkosten'] = 0;
@@ -579,29 +488,32 @@ if ($result_stg = $db->db_query($qry_stg))
ELSE
'f'
END as geaendert,
(SELECT
ARRAY_TO_STRING(ARRAY_AGG(vertragsstatus_kurzbz), ',')
(
SELECT
vertragsstatus_kurzbz
FROM
lehre.tbl_vertrag_vertragsstatus
WHERE
vertrag_id = tbl_projektbetreuer.vertrag_id
ORDER BY datum DESC
LIMIT 1
) as vertragsstatus
FROM
lehre.tbl_projektbetreuer JOIN public.tbl_benutzer ON tbl_projektbetreuer.person_id = tbl_benutzer.person_id
JOIN lehre.tbl_projektarbeit ON tbl_projektarbeit.projektarbeit_id = tbl_projektbetreuer.projektarbeit_id
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id = tbl_projektarbeit.lehreinheit_id
JOIN lehre.tbl_lehrveranstaltung ON tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id
JOIN campus.vw_student ON vw_student.uid = student_uid
FROM lehre.tbl_projektbetreuer, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung,
public.tbl_benutzer, lehre.tbl_projektarbeit, campus.vw_student
WHERE
tbl_benutzer.uid = ".$db->db_add_param($uid)."
tbl_projektbetreuer.person_id = tbl_benutzer.person_id
AND tbl_benutzer.uid = ".$db->db_add_param($uid)."
AND tbl_projektarbeit.projektarbeit_id = tbl_projektbetreuer.projektarbeit_id
AND student_uid = vw_student.uid
AND tbl_lehreinheit.lehreinheit_id = tbl_projektarbeit.lehreinheit_id
AND tbl_lehreinheit.studiensemester_kurzbz=".$db->db_add_param($semester_aktuell)."
AND tbl_lehreinheit.lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id
AND tbl_lehrveranstaltung.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER);
if ($result = $db->db_query($qry))
{
while ($row = $db->db_fetch_object($result))
{
$row->vertragsstatus = explode(',', $row->vertragsstatus);
$liste[$uid]['gesamtstunden'] = $liste[$uid]['gesamtstunden'] + $row->stunden;
$liste[$uid]['gesamtkosten'] =
$liste[$uid]['gesamtkosten'] + ($row->stunden * $row->stundensatz);
@@ -612,42 +524,13 @@ if ($result_stg = $db->db_query($qry_stg))
{
$liste[$uid]['geaendert'] = true;
}
if (!isset($liste[$uid]['gesamtstunden_bestellt']))
{
$liste[$uid]['gesamtstunden_bestellt'] = 0;
$liste[$uid]['gesamtkosten_bestellt'] = 0;
}
if (!isset($liste[$uid]['gesamtstunden_erteilt']))
{
$liste[$uid]['gesamtstunden_erteilt'] = 0;
$liste[$uid]['gesamtkosten_erteilt'] = 0;
}
if (!isset($liste[$uid]['gesamtstunden_akzeptiert']))
{
$liste[$uid]['gesamtstunden_akzeptiert'] = 0;
$liste[$uid]['gesamtkosten_akzeptiert'] = 0;
}
if (in_array('bestellt', $row->vertragsstatus))
{
$liste[$uid]['gesamtstunden_bestellt'] =
$liste[$uid]['gesamtstunden_bestellt'] + $row->stunden;
$liste[$uid]['gesamtkosten_bestellt'] =
$liste[$uid]['gesamtkosten_bestellt'] + ($row->stunden * $row->stundensatz);
}
if (in_array('erteilt', $row->vertragsstatus))
{
$liste[$uid]['gesamtstunden_erteilt'] =
$liste[$uid]['gesamtstunden_erteilt'] + $row->stunden;
$liste[$uid]['gesamtkosten_erteilt'] =
$liste[$uid]['gesamtkosten_erteilt'] + ($row->stunden * $row->stundensatz);
}
if (in_array('akzeptiert', $row->vertragsstatus))
if ($row->vertragsstatus == 'akzeptiert')
{
$liste[$uid]['gesamtstunden_akzeptiert'] =
$liste[$uid]['gesamtstunden_akzeptiert'] + $row->stunden;
@@ -675,20 +558,13 @@ if ($result_stg = $db->db_query($qry_stg))
if (isset($row['geaendert']) && $row['geaendert'] == true)
{
$format = $format_colored;
$formatOE = $format_colored;
$formatnb = $format_number_colored;
}
else
{
$format = $format_normal;
$formatOE = $format_normal;
$formatnb = $format_number;
}
if(isset($row['organisationgeaendert']) && $row['organisationgeaendert'] === true)
{
$formatOE = $oe_colored;
}
//Studiengang
$worksheet->write($zeile, $i, $studiengang->kuerzel, $format);
$gesamt->write($gesamtsheet_row, $i, $studiengang->kuerzel, $format);
@@ -708,11 +584,11 @@ if ($result_stg = $db->db_query($qry_stg))
$worksheet->write($zeile, ++$i, $row['fixangestellt'], $format);
$gesamt->write($gesamtsheet_row, $i, $row['fixangestellt'], $format);
//OE-Zuordnung
$worksheet->write($zeile, ++$i, $row['oezuordnung'], $formatOE);
$gesamt->write($gesamtsheet_row, $i, $row['oezuordnung'], $formatOE);
$worksheet->write($zeile, ++$i, $row['oezuordnung'], $format);
$gesamt->write($gesamtsheet_row, $i, $row['oezuordnung'], $format);
//Department der OE-Zuordnung
$worksheet->write($zeile, ++$i, $row['department'], $formatOE);
$gesamt->write($gesamtsheet_row, $i, $row['department'], $formatOE);
$worksheet->write($zeile, ++$i, $row['department'], $format);
$gesamt->write($gesamtsheet_row, $i, $row['department'], $format);
//LVStunden
$lvstunden = str_replace(', ', '.', $row['lvstunden']);
$worksheet->write($zeile, ++$i, $lvstunden, $format);
@@ -737,25 +613,6 @@ if ($result_stg = $db->db_query($qry_stg))
$gesamtkosten_row = str_replace(', ', '.', $row['gesamtkosten']);
$worksheet->writeNumber($zeile, ++$i, $gesamtkosten_row, $formatnb);
$gesamt->writeNumber($gesamtsheet_row, $i, $gesamtkosten_row, $formatnb);
//Gesamtstunden bestellt
$gesamtstunden_bestellt = str_replace(', ', '.', $row['gesamtstunden_bestellt']);
$worksheet->write($zeile, ++$i, $gesamtstunden_bestellt, $formatnb);
$gesamt->write($gesamtsheet_row, $i, $gesamtstunden_bestellt, $formatnb);
//Gesamtkosten bestellt
$gesamtkosten_bestellt_row = str_replace(', ', '.', $row['gesamtkosten_bestellt']);
$worksheet->writeNumber($zeile, ++$i, $gesamtkosten_bestellt_row, $formatnb);
$gesamt->writeNumber($gesamtsheet_row, $i, $gesamtkosten_bestellt_row, $formatnb);
//Gesamtstunden erteilt
$gesamtstunden_erteilt = str_replace(', ', '.', $row['gesamtstunden_erteilt']);
$worksheet->write($zeile, ++$i, $gesamtstunden_erteilt, $formatnb);
$gesamt->write($gesamtsheet_row, $i, $gesamtstunden_erteilt, $formatnb);
//Gesamtkosten erteilt
$gesamtkosten_erteilt_row = str_replace(', ', '.', $row['gesamtkosten_erteilt']);
$worksheet->writeNumber($zeile, ++$i, $gesamtkosten_erteilt_row, $formatnb);
$gesamt->writeNumber($gesamtsheet_row, $i, $gesamtkosten_erteilt_row, $formatnb);
//Gesamtstunden akzeptiert
$gesamtstunden_akzeptiert = str_replace(', ', '.', $row['gesamtstunden_akzeptiert']);
$worksheet->write($zeile, ++$i, $gesamtstunden_akzeptiert, $formatnb);
@@ -784,31 +641,11 @@ if ($result_stg = $db->db_query($qry_stg))
else
$liste_gesamt[$uid]['gesamtkosten'] = $row['gesamtkosten'];
if (isset($liste_gesamt[$uid]['gesamtstunden_bestellt']))
$liste_gesamt[$uid]['gesamtstunden_bestellt'] += $row['gesamtstunden_bestellt'];
else
$liste_gesamt[$uid]['gesamtstunden_bestellt'] = $row['gesamtstunden_bestellt'];
if (isset($liste_gesamt[$uid]['gesamtkosten_bestellt']))
$liste_gesamt[$uid]['gesamtkosten_bestellt'] += $row['gesamtkosten_bestellt'];
else
$liste_gesamt[$uid]['gesamtkosten_bestellt'] = $row['gesamtkosten_bestellt'];
if (isset($liste_gesamt[$uid]['gesamtstunden_erteilt']))
$liste_gesamt[$uid]['gesamtstunden_erteilt'] += $row['gesamtstunden_erteilt'];
else
$liste_gesamt[$uid]['gesamtstunden_erteilt'] = $row['gesamtstunden_erteilt'];
if (isset($liste_gesamt[$uid]['gesamtkosten_erteilt']))
$liste_gesamt[$uid]['gesamtkosten_erteilt'] += $row['gesamtkosten_erteilt'];
else
$liste_gesamt[$uid]['gesamtkosten_erteilt'] = $row['gesamtkosten_erteilt'];
if (isset($liste_gesamt[$uid]['gesamtstunden_akzeptiert']))
$liste_gesamt[$uid]['gesamtstunden_akzeptiert'] += $row['gesamtstunden_akzeptiert'];
else
$liste_gesamt[$uid]['gesamtstunden_akzeptiert'] = $row['gesamtstunden_akzeptiert'];
if (isset($liste_gesamt[$uid]['gesamtkosten_akzeptiert']))
$liste_gesamt[$uid]['gesamtkosten_akzeptiert'] += $row['gesamtkosten_akzeptiert'];
else
@@ -908,36 +745,3 @@ if ($result_stg = $db->db_query($qry_stg))
else
echo "Fehler beim Versenden der Lehrauftragsliste";
}
function getOe($mitarbeiter_uid, $fixangestellt)
{
$benutzerfunktion = new Benutzerfunktion();
$oe = new Organisationseinheit();
$benutzerfunktion->getBenutzerFunktionByUid($mitarbeiter_uid, $fixangestellt === 'Ja' ? 'kstzuordnung' : 'oezuordnung', date('Y-m-d'));
if (isset($benutzerfunktion->result[0]))
{
array_multisort(array_column($benutzerfunktion->result, 'datum_von'), SORT_ASC, $benutzerfunktion->result);
}
else
{
$benutzerfunktion->getBenutzerFunktionByUid($mitarbeiter_uid, $fixangestellt === 'Ja' ? 'kstzuordnung' : 'oezuordnung', null, date('Y-m-d'));
array_multisort(array_column($benutzerfunktion->result, 'datum_bis'), SORT_DESC, $benutzerfunktion->result);
}
if (!isset($benutzerfunktion->result[0]))
return array('oezuordnung' => '', 'department' => '', 'organisationgeaendert' => false);
$oe->load($benutzerfunktion->result[0]->oe_kurzbz);
$oezuordnung = $oe->organisationseinheittyp_kurzbz . ' ' . $oe->bezeichnung;
$oe_parents = $oe->getParents_withOEType($oe->oe_kurzbz);
if (is_array($oe_parents))
$department = ($oe_parents[array_search('Department', array_column($oe_parents, 'oe_typ_bezeichnung'))]->oe_bezeichnung);
else
$department = '';
return array('oezuordnung' => $oezuordnung, 'department' => $department, 'organisationgeaendert' => true);
}
+22 -87
View File
@@ -74,10 +74,7 @@ require_once('../../include/reihungstest.class.php');
require_once('../../include/studienplan.class.php');
require_once('../../include/mobilitaet.class.php');
require_once('../../include/studienordnung.class.php');
require_once('../../include/mitarbeiter.class.php');
require_once('../../include/bisverwendung.class.php');
require_once('../../include/bismeldestichtag.class.php');
require_once('../../include/stundensatz.class.php');
$user = get_uid();
$db = new basis_db();
@@ -4657,7 +4654,6 @@ if(!$error)
$errormsg = 'Fehlerhafte Parameteruebergabe';
}
}
elseif(isset($_POST['type']) && $_POST['type']=='getstundensatz')
{
if(isset($_POST['person_id']) && isset($_POST['studiensemester_kurzbz']))
@@ -4665,87 +4661,33 @@ if(!$error)
$studiensemester = new studiensemester();
if ($studiensemester->load($_POST['studiensemester_kurzbz']))
{
if (defined('FAS_LV_LEKTORINNENZUTEILUNG_FIXANGESTELLT_STUNDENSATZ')
&& !FAS_LV_LEKTORINNENZUTEILUNG_FIXANGESTELLT_STUNDENSATZ)
$qry = "SELECT ss.stundensatz
FROM hr.tbl_stundensatz ss
JOIN public.tbl_mitarbeiter ON ss.uid = tbl_mitarbeiter.mitarbeiter_uid
JOIN public.tbl_benutzer ON(tbl_benutzer.uid=tbl_mitarbeiter.mitarbeiter_uid)
WHERE person_id=".$db->db_add_param($_POST['person_id'], FHC_INTEGER) ."
AND stundensatztyp = ". $db->db_add_param('lehre') ."
AND gueltig_von <= ". $db->db_add_param($studiensemester->ende) ."
AND (gueltig_bis >= ". $db->db_add_param($studiensemester->start) ." OR gueltig_bis IS NULL)
ORDER BY gueltig_bis DESC NULLS FIRST, gueltig_von DESC NULLS LAST LIMIT 1
";
if($result = $db->db_query($qry))
{
// Mitarbeiter laden
$qry = "
SELECT
mitarbeiter_uid, fixangestellt
FROM
public.tbl_mitarbeiter
JOIN public.tbl_benutzer ON(tbl_benutzer.uid=tbl_mitarbeiter.mitarbeiter_uid)
WHERE
person_id=".$db->db_add_param($_POST['person_id'], FHC_INTEGER) ."
ORDER BY tbl_mitarbeiter.insertamum DESC NULLS LAST LIMIT 1
";
if($result = $db->db_query($qry))
if($row = $db->db_fetch_object($result))
{
if($row = $db->db_fetch_object($result))
{
$uid = $row->mitarbeiter_uid;
if($db->db_parse_bool($row->fixangestellt)==true)
{
// Fixangestellte haben keinen Stundensatz
$data = '';
$return = true;
}
else
{
// Stundensatz des Mitarbeiters laden
$stundensatz = new stundensatz();
if($stundensatz->getStundensatzDatum($uid, $studiensemester->start, $studiensemester->ende, 'lehre'))
{
$data = $stundensatz->stundensatz;
$return = true;
}
else
{
// Keine Stundensatz hinterlegt
$data = '0.00';
$return = true;
}
}
}
else
{
// Kein Mitarbeiter gefunden, kein Stundensatz
$data = '0.00';
$return = true;
}
$data = $row->stundensatz;
$return = true;
}
else
{
$data = '80.00';
$return = true;
}
}
else
{
$qry = "SELECT ss.stundensatz
FROM hr.tbl_stundensatz ss
JOIN public.tbl_mitarbeiter ON ss.uid = tbl_mitarbeiter.mitarbeiter_uid
JOIN public.tbl_benutzer ON(tbl_benutzer.uid=tbl_mitarbeiter.mitarbeiter_uid)
WHERE person_id=".$db->db_add_param($_POST['person_id'], FHC_INTEGER) ."
AND stundensatztyp = ". $db->db_add_param('lehre') ."
AND gueltig_von <= ". $db->db_add_param($studiensemester->ende) ."
AND (gueltig_bis >= ". $db->db_add_param($studiensemester->start) ." OR gueltig_bis IS NULL)
ORDER BY gueltig_bis DESC NULLS FIRST, gueltig_von DESC NULLS LAST LIMIT 1
";
if($result = $db->db_query($qry))
{
if($row = $db->db_fetch_object($result))
{
$data = $row->stundensatz;
$return = true;
}
else
{
$data = '80.00';
$return = true;
}
}
else
{
$return = false;
$errormsg = 'Unbekannter Fehler';
}
$return = false;
$errormsg = 'Unbekannter Fehler';
}
}
else
@@ -4753,15 +4695,8 @@ if(!$error)
$return = false;
$errormsg = 'Fehler beim Laden des Studiensemesters';
}
}
else
{
$data = '20.00'.$_POST['studiensemester_kurzbz'];
$return = true;
}
}
}
elseif(isset($_POST['type']) && $_POST['type']=='saveanrechnung')
{
$anrechnung = new anrechnung();
+2 -2
View File
@@ -1658,7 +1658,7 @@ function StudentAuswahl()
var antragnotentree = document.getElementById('student-antragnoten-tree');
url='<?php echo APP_ROOT;?>index.ci.php/api/frontend/fas/studstatus/Wiederholung/getLvs/'+prestudent_id+"?"+gettimestamp();
url='<?php echo APP_ROOT;?>index.ci.php/components/Antrag/Wiederholung/getLvsAsRdf/'+prestudent_id+"?"+gettimestamp();
try
{
@@ -4764,7 +4764,7 @@ function StudentNotenMoveFromAntrag()
var paramList= '';
var i = 0;
var url = '<?php echo APP_ROOT ?>index.ci.php/api/frontend/fas/studstatus/Wiederholung/moveLvsToZeugnis';
var url = '<?php echo APP_ROOT ?>index.ci.php/components/Antrag/Wiederholung/moveLvsToZeugnis';
var req = new phpRequest(url,'','');
for (var t = 0; t < numRanges; t++)
+4 -37
View File
@@ -393,7 +393,6 @@ function StudentProjektarbeitAuswahl()
anmerkung = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#anmerkung" ));
gesamtstunden = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#gesamtstunden" ));
final = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#final" ));
var lehreinheit_stsem = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#lehreinheit_stsem" ));
var stg_kz = document.getElementById('student-detail-menulist-studiengang_kz').value;
@@ -441,7 +440,6 @@ function StudentProjektarbeitAuswahl()
//Werte setzen
document.getElementById('student-projektarbeit-textbox-projektarbeit_id').value=projektarbeit_id;
document.getElementById('student-projektarbeit-textbox-lehreinheit_stsem').value=lehreinheit_stsem;
document.getElementById('student-projektarbeit-menulist-projekttyp').value=projekttyp_kurzbz;
document.getElementById('student-projektarbeit-menulist-lehrveranstaltung').value=lehrveranstaltung_id;
document.getElementById('student-projektarbeit-menulist-lehreinheit').value=lehreinheit_id;
@@ -651,8 +649,6 @@ function StudentProjektarbeitNeu()
document.getElementById('student-projektarbeit-checkbox-neu').checked=true;
document.getElementById('student-projektarbeit-textbox-projektarbeit_id').value='';
document.getElementById('student-projektarbeit-textbox-lehreinheit_stsem').value='';
StudentProjektarbeitResetFields();
StudentProjektarbeitDetailDisableFields(false);
StudentProjektbetreuerDisableFields(true);
@@ -876,7 +872,6 @@ function StudentProjektbetreuerAuswahl()
name = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#name" ));
punkte = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#punkte" ));
stunden = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#stunden" ));
stundensatz = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#stundensatz" ));
betreuerart_kurzbz = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#betreuerart_kurzbz" ));
person_nachname = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#person_nachname" ));
@@ -897,16 +892,6 @@ function StudentProjektbetreuerAuswahl()
document.getElementById('student-projektbetreuer-textbox-person_id').value=person_id;
document.getElementById('student-projektbetreuer-checkbox-neu').checked=false;
var lehreinheitstsem = document.getElementById('student-projektarbeit-textbox-lehreinheit_stsem').value;
var default_stundensatz = StudentProjektbetreuerLoadStundensatz(person_id, lehreinheitstsem);
if (default_stundensatz != '')
default_stundensatz = 'Stundensatz (Default '+default_stundensatz+'):';
else
default_stundensatz = 'Stundensatz';
document.getElementById('student-projektbetreuer-label-stundensatz').value= default_stundensatz;
var gesamtkosten = StudentProjektbetreuerGesamtkosten();
@@ -1186,9 +1171,7 @@ function StudentProjektbetreuerDetailReset()
document.getElementById('student-projektbetreuer-textbox-stunden').value='0.0';
document.getElementById('student-projektbetreuer-menulist-betreuerart').value='Begutachter';
}
document.getElementById('student-projektbetreuer-textbox-stundensatz').value='80.0';
document.getElementById('student-projektbetreuer-label-stundensatz').value= 'Stundensatz (Default 80.0):';
document.getElementById('student-projektbetreuer-menulist-person').value='';
}
@@ -1375,16 +1358,16 @@ function StudentProjektbetreuerLoeschen()
}
}
function StudentProjektbetreuerLoadStundensatz(person_id, studiensemester)
function StudentProjektbetreuerLoadMitarbeiterDaten()
{
var stundensatz='';
person_id = MenulistGetSelectedValue('student-projektbetreuer-menulist-person');
var url = '<?php echo APP_ROOT ?>content/student/studentDBDML.php';
var req = new phpRequest(url,'','');
req.add('type', 'getstundensatz');
req.add('person_id', person_id);
req.add('studiensemester_kurzbz', studiensemester)
req.add('studiensemester_kurzbz', getStudiensemester())
var response = req.executePOST();
@@ -1402,23 +1385,7 @@ function StudentProjektbetreuerLoadStundensatz(person_id, studiensemester)
stundensatz = val.dbdml_data
}
return stundensatz;
}
function StudentProjektbetreuerLoadMitarbeiterDaten()
{
var person_id = MenulistGetSelectedValue('student-projektbetreuer-menulist-person');
var lehreinheitstsem = document.getElementById('student-projektarbeit-textbox-lehreinheit_stsem').value;
var stundensatz = StudentProjektbetreuerLoadStundensatz(person_id, lehreinheitstsem);
if (stundensatz != '')
default_stundensatz = 'Stundensatz (Default '+stundensatz+'):';
else
default_stundensatz = 'Stundensatz';
document.getElementById('student-projektbetreuer-label-stundensatz').value = default_stundensatz;
document.getElementById('student-projektbetreuer-textbox-stundensatz').value = stundensatz;
document.getElementById('student-projektbetreuer-textbox-stundensatz').value=stundensatz;
}
// ****
@@ -171,11 +171,7 @@ $is_hidden = (!defined('FAS_STUDIERENDE_PROJEKTARBEIT_VERTRAGSDETAILS_ANZEIGEN')
<rows>
<row>
<label value="Projektarbeit ID" control="student-projektarbeit-textbox-projektarbeit_id"/>
<hbox>
<textbox id="student-projektarbeit-textbox-projektarbeit_id" readonly="true" maxlength="16" size="16"/>
<textbox id="student-projektarbeit-textbox-lehreinheit_stsem" hidden="true" readonly="true" maxlength="32" size="32"/>
</hbox>
<hbox><textbox id="student-projektarbeit-textbox-projektarbeit_id" readonly="true" maxlength="16" size="16"/></hbox>
</row>
<row>
<label value="Titel" control="student-projektarbeit-textbox-titel"/>
@@ -527,7 +523,7 @@ $is_hidden = (!defined('FAS_STUDIERENDE_PROJEKTARBEIT_VERTRAGSDETAILS_ANZEIGEN')
<textbox id="student-projektbetreuer-textbox-stunden" disabled="true" maxlength="8"/>
</row>
<row>
<label id="student-projektbetreuer-label-stundensatz" value="Stundensatz: " control="student-projektbetreuer-textbox-stundensatz"/>
<label value="Stundensatz" control="student-projektbetreuer-textbox-stundensatz"/>
<textbox id="student-projektbetreuer-textbox-stundensatz" disabled="true" maxlength="5"/>
</row>
<row hidden="true"><!-- Faktor wird nicht mehr benoetigt -->
-2
View File
@@ -413,8 +413,6 @@ class projekt extends basis_db
AND mitarbeiter_uid=" . $this->db_add_param($mitarbeiter_uid);
}
$qry .= ' ORDER BY titel';
if ($result = $this->db_query($qry))
{
while ($row = $this->db_fetch_object($result))
+2 -3
View File
@@ -190,7 +190,7 @@ class projektphase extends basis_db
if(!is_null($foreignkey))
$qry .= " and projektphase_fk is NULL";
$qry .= " ORDER BY tbl_projektphase.start, tbl_projektphase.bezeichnung, projektphase_fk DESC;";
$qry .= " ORDER BY start, projektphase_fk DESC;";
if($this->db_query($qry))
{
@@ -794,8 +794,7 @@ class projektphase extends basis_db
)
)
AND mitarbeiter_uid = ".$this->db_add_param($mitarbeiter_uid)."
AND tbl_projekt.projekt_kurzbz = ".$this->db_add_param($projekt_kurzbz). "
ORDER BY tbl_projektphase.start, tbl_projektphase.bezeichnung";
AND tbl_projekt.projekt_kurzbz = ".$this->db_add_param($projekt_kurzbz);
if($result = $this->db_query($qry))
{
-1
View File
@@ -120,7 +120,6 @@ $menu=array
'name'=>'Mitarbeiter','permissions'=>array('admin','mitarbeiter','support'),
'Übersicht'=>array('name'=>'Übersicht', 'link'=>'personen/lektor_uebersicht.php', 'target'=>'main'),
'Zeitsperren'=>array('name'=>'Zeitsperren/Urlaub', 'link'=>'personen/urlaubsverwaltung.php', 'target'=>'main','permissions'=>array('mitarbeiter/zeitsperre:begrenzt')),
'Projektexport'=>array('name'=>'Projektexport', 'link'=>'personen/projektexport.php', 'target'=>'main','permissions'=>array('mitarbeiter/zeitsperre')),
),
'Betriebsmittel'=>array('name'=>'Betriebsmittel', 'link'=>'stammdaten/betriebsmittel_frameset.php', 'target'=>'main','permissions'=>array('basis/betriebsmittel')),
'AnwesenheitslistenBarcode'=>array('name'=>'Anwesenheitslisten mit Barcodes', 'link'=>'personen/anwesenheitslisten_barcode.php', 'target'=>'main','permissions'=>array('basis/person')),
-1
View File
@@ -5,7 +5,6 @@ $this->phrasen['services/details']='Details';
$this->phrasen['services/filtern']='Filtern';
$this->phrasen['services/leistung']='Leistung';
$this->phrasen['services/design']='Verantwortlich';
$this->phrasen['services/kritikalitaet']='Kritikalität';
$this->phrasen['services/betrieb']='Betrieb';
$this->phrasen['services/operativ']='Operativ';
?>
+1 -2
View File
@@ -5,7 +5,6 @@ $this->phrasen['services/details']='Details';
$this->phrasen['services/filtern']='Filter';
$this->phrasen['services/leistung']='Service';
$this->phrasen['services/design']='Design';
$this->phrasen['services/kritikalitaet']='Criticality';
$this->phrasen['services/betrieb']='Running';
$this->phrasen['services/operativ']='Operating';
?>
?>
+6146
View File
File diff suppressed because it is too large Load Diff
+33
View File
@@ -0,0 +1,33 @@
{
"name": "fhc-core",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"build": "rollup -c",
"watch": "rollup --watch -c"
},
"dependencies": {
"@vuepic/vue-datepicker": "^7.2.0",
"axios": "^1.6.8",
"primevue": "^3.29.1",
"tabulator-tables": "^5.5.2",
"vue": "^3.3.8",
"vue-router": "^4.1.3"
},
"devDependencies": {
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-replace": "^5.0.5",
"@rollup/plugin-terser": "^0.4.4",
"babel-plugin-transform-class-properties": "^6.24.1",
"glob": "^10.3.10",
"node-sass": "^9.0.0",
"rollup": "^4.13.2",
"rollup-plugin-postcss": "^4.0.2",
"rollup-plugin-vue": "^6.0.0"
}
}
-30
View File
@@ -1,30 +0,0 @@
/**
* 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/>.
*/
import search from "./search.js";
import phrasen from "./phrasen.js";
import navigation from "./navigation.js";
import filter from "./filter.js";
import studstatus from "./studstatus.js";
export default {
search,
phrasen,
navigation,
filter,
studstatus
};
-89
View File
@@ -1,89 +0,0 @@
/**
* 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/>.
*/
export default {
saveCustomFilter(wsParams) {
return this.$fhcApi.post(
'/api/frontend/v1/filter/saveCustomFilter',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType,
customFilterName: wsParams.customFilterName
}
);
},
removeCustomFilter(wsParams) {
return this.$fhcApi.post(
'/api/frontend/v1/filter/removeCustomFilter',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType,
filterId: wsParams.filterId
}
);
},
applyFilterFields(wsParams) {
return this.$fhcApi.post(
'/api/frontend/v1/filter/applyFilterFields',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType,
filterFields: wsParams.filterFields
}
);
},
addFilterField(wsParams) {
return this.$fhcApi.post(
'/api/frontend/v1/filter/addFilterField',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType,
filterField: wsParams.filterField
}
);
},
removeFilterField(wsParams) {
return this.$fhcApi.post(
'/api/frontend/v1/filter/removeFilterField',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType,
filterField: wsParams.filterField
}
);
},
getFilterById(wsParams) {
return this.$fhcApi.get(
'/api/frontend/v1/filter/getFilter',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType,
filterId: wsParams.filterId
}
);
},
getFilter(wsParams) {
return this.$fhcApi.get(
'/api/frontend/v1/filter/getFilter',
{
filterUniqueId: wsParams.filterUniqueId,
filterType: wsParams.filterType
}
);
}
};
-32
View File
@@ -1,32 +0,0 @@
/**
* 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/>.
*/
export default {
getHeader(navigation_page) {
return this.$fhcApi.get(
'/api/frontend/v1/navigation/header',
{ navigation_page }
);
},
getMenu: function(navigation_page) {
return this.$fhcApi.get(
'/api/frontend/v1/navigation/menu',
{ navigation_page }
);
}
};
-22
View File
@@ -1,22 +0,0 @@
/**
* 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/>.
*/
export default {
loadCategory(category) {
return this.$fhcApi.get('/api/frontend/v1/phrasen/loadModule/' + category);
}
};
-27
View File
@@ -1,27 +0,0 @@
/**
* 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/>.
*/
export default {
search(searchsettings) {
const url = '/api/frontend/v1/searchbar/search';
return this.$fhcApi.post(url, searchsettings);
},
searchdummy(searchsettings) {
const url = 'public/js/apps/api/dummyapi.php/Search';
return this.$fhcApi.post(url, searchsettings);
}
};
-223
View File
@@ -1,223 +0,0 @@
/**
* 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/>.
*/
export default {
abmeldung: {
getDetails(antrag_id, prestudent_id) {
const url = '/api/frontend/v1/studstatus/abmeldung/'
+ (antrag_id !== undefined ? 'getDetailsForAntrag/' + antrag_id : 'getDetailsForNewAntrag/' + prestudent_id);
return this.$fhcApi.get(url);
},
create(stdsem, prestudent_id, grund) {
return this.$fhcApi.post('/api/frontend/v1/studstatus/abmeldung/createAntrag', {
studiensemester: stdsem,
prestudent_id,
grund
}, {
errorHandling: 'strict'
});
},
cancel(antrag_id) {
if (!Array.isArray(antrag_id))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/abmeldung/cancelAntrag',
{ antrag_id }
);
return Promise.allSettled(antrag_id.map(antrag => this.$fhcApi.post(
'/api/frontend/v1/studstatus/abmeldung/cancelAntrag',
{ antrag_id: antrag.studierendenantrag_id },
{ errorHeader: '#' + antrag.studierendenantrag_id }
)));
}
},
unterbrechung: {
getDetails(antrag_id, prestudent_id) {
const url = '/api/frontend/v1/studstatus/unterbrechung/'
+ (antrag_id !== undefined ? 'getDetailsForAntrag/' + antrag_id : 'getDetailsForNewAntrag/' + prestudent_id);
return this.$fhcApi.get(url);
},
create(studiensemester, prestudent_id, grund, datum_wiedereinstieg, attachment) {
return this.$fhcApi.post('/api/frontend/v1/studstatus/unterbrechung/createAntrag', {
studiensemester,
prestudent_id,
grund,
datum_wiedereinstieg,
attachment
}, {
errorHandling: 'strict'
});
},
cancel(antrag_id) {
return this.$fhcApi.post('/api/frontend/v1/studstatus/unterbrechung/cancelAntrag', {
antrag_id
}, {
errorHandling: 'strict'
});
}
},
wiederholung: {
getDetails(prestudent_id) {
const url = '/api/frontend/v1/studstatus/wiederholung/getDetailsForNewAntrag/' + prestudent_id;
return this.$fhcApi.get(url)
},
getLvs(antrag_id) {
const url = '/api/frontend/v1/studstatus/wiederholung/getLvs/' + antrag_id;
return this.$fhcApi.get(url)
},
create(prestudent_id, studiensemester) {
return this.$fhcApi.post('/api/frontend/v1/studstatus/wiederholung/createAntrag', {
prestudent_id,
studiensemester
}, {
errorHandling: 'strict'
});
},
cancel(prestudent_id, studiensemester) {
return this.$fhcApi.post('/api/frontend/v1/studstatus/wiederholung/cancelAntrag', {
prestudent_id,
studiensemester
}, {
errorHandling: 'strict'
});
},
saveLvs(forbiddenLvs, mandatoryLvs) {
return this.$fhcApi.post('/api/frontend/v1/studstatus/wiederholung/saveLvs', {
forbiddenLvs,
mandatoryLvs
});
}
},
leitung: {
getStgs() {
return this.$fhcApi.get('/api/frontend/v1/studstatus/leitung/getActiveStgs');
},
getAntraege(url, config, params) {
return this.$fhcApi
.get('/api/frontend/v1/studstatus/leitung/getAntraege/' + url)
.then(res => res.data); // Return data for tabulator
},
getHistory(antrag_id) {
return this.$fhcApi.get('/api/frontend/v1/studstatus/leitung/getHistory/' + antrag_id)
},
getPrestudents(query, signal) {
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/getPrestudents',
{ query },
{
signal: signal,
timeout: 30000
}
);
},
approve(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/approveAntrag',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/approveAntrag',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
reject(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/rejectAntrag',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/rejectAntrag',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
reopen(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/reopenAntrag',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/reopenAntrag',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
pause(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/pauseAntrag',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/pauseAntrag',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
unpause(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/unpauseAntrag',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/unpauseAntrag',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
object(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/objectAntrag',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/objectAntrag',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
approveObjection(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/approveObjection',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/approveObjection',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
},
denyObjection(antrag) {
if (!Array.isArray(antrag))
return this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/denyObjection',
antrag
);
return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
'/api/frontend/v1/studstatus/leitung/denyObjection',
a,
{ errorHeader: '#' + a.studierendenantrag_id }
)));
}
}
};
+192 -192
View File
@@ -1,195 +1,195 @@
import {CoreFilterCmpt} from '../components/filter/Filter.js';
import {CoreNavigationCmpt} from '../components/navigation/Navigation.js';
import CoreVerticalsplit from "../components/verticalsplit/verticalsplit.js";
import CoreSearchbar from "../components/searchbar/searchbar.js";
import FhcApi from "../plugin/FhcApi.js";
import verticalsplit from "../components/verticalsplit/verticalsplit.js";
import searchbar from "../components/searchbar/searchbar.js";
import fhcapifactory from "./api/fhcapifactory.js";
const app = Vue.createApp({
components: {
CoreNavigationCmpt,
CoreFilterCmpt,
CoreVerticalsplit,
CoreSearchbar
},
data() {
return {
title: "Test Search",
appSideMenuEntries: {},
searchbaroptions: {
types: [
"person",
"raum",
"mitarbeiter",
"student",
"prestudent",
"document",
"cms",
"organisationunit"
],
actions: {
person: {
defaultaction: {
type: "link",
action(data) {
//alert('person defaultaction ' + JSON.stringify(data));
//window.location.href = data.profil;
return data.profil;
}
},
childactions: [
{
label: "testchildaction1",
icon: "fas fa-check-circle",
type: "function",
action(data) {
alert('person testchildaction 01 ' + JSON.stringify(data));
}
},
{
label: "testchildaction2",
icon: "fas fa-file-csv",
type: "function",
action(data) {
alert('person testchildaction 02 ' + JSON.stringify(data));
}
}
]
},
raum: {
defaultaction: {
type: "function",
action(data) {
alert('raum defaultaction ' + JSON.stringify(data));
}
},
childactions: [
{
label: "Rauminformation",
icon: "fas fa-info-circle",
type: "link",
action(data) {
return data.infolink;
}
},
{
label: "Raumreservierung",
icon: "fas fa-bookmark",
type: "link",
action(data) {
return data.booklink;
}
}
]
},
employee: {
defaultaction: {
type: "function",
action(data) {
alert('employee defaultaction ' + JSON.stringify(data));
}
},
childactions: [
{
label: "testchildaction1",
icon: "fas fa-address-book",
type: "function",
action(data) {
alert('employee testchildaction 01 ' + JSON.stringify(data));
}
},
{
label: "testchildaction2",
icon: "fas fa-user-slash",
type: "function",
action(data) {
alert('employee testchildaction 02 ' + JSON.stringify(data));
}
},
{
label: "testchildaction3",
icon: "fas fa-bell",
type: "function",
action(data) {
alert('employee testchildaction 03 ' + JSON.stringify(data));
}
},
{
label: "testchildaction4",
icon: "fas fa-calculator",
type: "function",
action(data) {
alert('employee testchildaction 04 ' + JSON.stringify(data));
}
}
]
},
organisationunit: {
defaultaction: {
type: "function",
action(data) {
alert('organisationunit defaultaction ' + JSON.stringify(data));
}
},
childactions: []
}
}
},
searchbaroptions2: {
types: [
"raum",
"organisationunit"
],
actions: {
raum: {
defaultaction: {
type: "function",
action(data) {
alert('raum defaultaction ' + JSON.stringify(data));
}
},
childactions: [
{
label: "Rauminformation",
icon: "fas fa-info-circle",
type: "link",
action(data) {
return data.infolink;
}
},
{
label: "Raumreservierung",
icon: "fas fa-bookmark",
type: "link",
action(data) {
return data.booklink;
}
}
]
},
organisationunit: {
defaultaction: {
type: "function",
action(data) {
alert('organisationunit defaultaction ' + JSON.stringify(data));
}
},
childactions: []
}
}
}
};
},
methods: {
newSideMenuEntryHandler(payload) {
this.appSideMenuEntries = payload;
},
searchfunction(searchsettings) {
return this.$fhcApi.factory.search.search(searchsettings);
},
searchfunctiondummy(searchsettings) {
return this.$fhcApi.factory.search.searchdummy(searchsettings);
}
}
});
app.use(FhcApi)
app.mount('#main');
Vue.$fhcapi = fhcapifactory;
Vue.createApp({
"data": function() {
return {
"title": "Test Search",
"appSideMenuEntries": {},
"searchbaroptions": {
"types": [
"person",
"raum",
"mitarbeiter",
"student",
"prestudent",
"document",
"cms",
"organisationunit"
],
"actions": {
"person": {
"defaultaction": {
"type": "link",
"action": function(data) {
//alert('person defaultaction ' + JSON.stringify(data));
//window.location.href = data.profil;
return data.profil;
}
},
"childactions": [
{
"label": "testchildaction1",
"icon": "fas fa-check-circle",
"type": "function",
"action": function(data) {
alert('person testchildaction 01 ' + JSON.stringify(data));
}
},
{
"label": "testchildaction2",
"icon": "fas fa-file-csv",
"type": "function",
"action": function(data) {
alert('person testchildaction 02 ' + JSON.stringify(data));
}
}
]
},
"raum": {
"defaultaction": {
"type": "function",
"action": function(data) {
alert('raum defaultaction ' + JSON.stringify(data));
}
},
"childactions": [
{
"label": "Rauminformation",
"icon": "fas fa-info-circle",
"type": "link",
"action": function(data) {
return data.infolink;
}
},
{
"label": "Raumreservierung",
"icon": "fas fa-bookmark",
"type": "link",
"action": function(data) {
return data.booklink;
}
}
]
},
"employee": {
"defaultaction": {
"type": "function",
"action": function(data) {
alert('employee defaultaction ' + JSON.stringify(data));
}
},
"childactions": [
{
"label": "testchildaction1",
"icon": "fas fa-address-book",
"type": "function",
"action": function(data) {
alert('employee testchildaction 01 ' + JSON.stringify(data));
}
},
{
"label": "testchildaction2",
"icon": "fas fa-user-slash",
"type": "function",
"action": function(data) {
alert('employee testchildaction 02 ' + JSON.stringify(data));
}
},
{
"label": "testchildaction3",
"icon": "fas fa-bell",
"type": "function",
"action": function(data) {
alert('employee testchildaction 03 ' + JSON.stringify(data));
}
},
{
"label": "testchildaction4",
"icon": "fas fa-calculator",
"type": "function",
"action": function(data) {
alert('employee testchildaction 04 ' + JSON.stringify(data));
}
}
]
},
"organisationunit": {
"defaultaction": {
"type": "function",
"action": function(data) {
alert('organisationunit defaultaction ' + JSON.stringify(data));
}
},
"childactions": []
}
}
},
"searchbaroptions2": {
"types": [
"raum",
"organisationunit"
],
"actions": {
"raum": {
"defaultaction": {
"type": "function",
"action": function(data) {
alert('raum defaultaction ' + JSON.stringify(data));
}
},
"childactions": [
{
"label": "Rauminformation",
"icon": "fas fa-info-circle",
"type": "link",
"action": function(data) {
return data.infolink;
}
},
{
"label": "Raumreservierung",
"icon": "fas fa-bookmark",
"type": "link",
"action": function(data) {
return data.booklink;
}
}
]
},
"organisationunit": {
"defaultaction": {
"type": "function",
"action": function(data) {
alert('organisationunit defaultaction ' + JSON.stringify(data));
}
},
"childactions": []
}
}
}
};
},
"components": {
"CoreNavigationCmpt": CoreNavigationCmpt,
"CoreFilterCmpt": CoreFilterCmpt,
"verticalsplit": verticalsplit,
"searchbar": searchbar
},
"methods": {
"newSideMenuEntryHandler": function(payload) {
this.appSideMenuEntries = payload;
},
"searchfunction": function(searchsettings) {
return Vue.$fhcapi.Search.search(searchsettings);
},
"searchfunctiondummy": function(searchsettings) {
return Vue.$fhcapi.Search.searchdummy(searchsettings);
}
}
}).mount('#main');
+2
View File
@@ -1,10 +1,12 @@
import StudierendenantragAntrag from "../../components/Studierendenantrag/Antrag.js";
import StudierendenantragStatus from "../../components/Studierendenantrag/Status.js";
import StudierendenantragInfoblock from "../../components/Studierendenantrag/Infoblock.js";
import VueDatePicker from "../../components/vueDatepicker.js.php";
import Phrasen from '../../plugin/Phrasen.js';
const app = Vue.createApp({
components: {
VueDatePicker,
StudierendenantragAntrag,
StudierendenantragStatus,
StudierendenantragInfoblock
+1 -3
View File
@@ -99,10 +99,8 @@ export const CoreFetchCmpt = {
*
*/
errorHandler: function(error) {
if (error.response?.data?.retval)
if (error.response.data.retval)
this.setError(error.response.data.retval);
else if (error.data?.message)
this.setError(error.data.message);
else
this.setError(error.message);
},
+1 -2
View File
@@ -46,8 +46,7 @@ export default {
const factory = Object.create(Object.getPrototypeOf(this.$fhcApi.factory), Object.getOwnPropertyDescriptors(this.$fhcApi.factory));
factory.$fhcApi = {
get: this.get,
post: this.post,
_defaultErrorHandlers: this.$fhcApi._defaultErrorHandlers
post: this.post
};
return factory;
}
@@ -1,16 +1,10 @@
import {CoreFetchCmpt} from '../../Fetch.js';
import CoreForm from '../../Form/Form.js';
import FormValidation from '../../Form/Validation.js';
import FormInput from '../../Form/Input.js';
var _uuid = 0;
export default {
components: {
CoreFetchCmpt,
CoreForm,
FormValidation,
FormInput
CoreFetchCmpt
},
emits: [
'setInfos',
@@ -24,8 +18,9 @@ export default {
return {
data: null,
saving: false,
formData: {
grund: ''
errors: {
grund: [],
default: []
}
}
},
@@ -39,14 +34,24 @@ export default {
case 'Genehmigt': return 'success';
default: return 'warning';
}
},
loadUrl() {
if (this.studierendenantragId)
return '/components/Antrag/Abmeldung/getDetailsForAntrag/'+
this.studierendenantragId;
return '/components/Antrag/Abmeldung/getDetailsForNewAntrag/' +
this.prestudentId;
}
},
methods: {
load() {
return this.$fhcApi.factory
.studstatus.abmeldung.getDetails(this.studierendenantragId, this.prestudentId)
.then(result => {
this.data = result.data;
return axios.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
this.loadUrl
).then(
result => {
this.data = result.data.retval;
if (this.data.status) {
const msg = (this.data.status == 'Pause' && this.data.status_insertvon == "Studienabbruch") ? Vue.computed(() => {
let status = this.$p.t('studierendenantrag/status_stop');
@@ -58,8 +63,8 @@ export default {
});
}
return result;
})
.catch(this.$fhcAlert.handleSystemError);
}
);
},
createAntrag() {
bootstrap.Modal.getOrCreateInstance(this.$refs.modal).hide();
@@ -68,39 +73,52 @@ export default {
severity: 'warning'
});
this.saving = true;
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.abmeldung.create(
this.data.studiensemester_kurzbz,
this.data.prestudent_id,
this.formData.grund
)
.then(result => {
if (result.data === true)
document.location += "";
this.data = result.data;
if (this.data.status)
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
else
for(var k in this.errors)
this.errors[k] = [];
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Abmeldung/createAntrag/', {
studiensemester: this.data.studiensemester_kurzbz,
prestudent_id: this.data.prestudent_id,
grund: this.$refs.grund.value
}
).then(
result => {
if (result.data.error)
{
for (var k in result.data.retval)
{
if (this.errors[k] !== undefined)
this.errors[k].push(result.data.retval[k]);
else
this.errors.default.push(result.data.retval[k]);
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_open')})),
severity:'success'
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
}
else
{
if (result.data.retval === true)
document.location += "";
this.data = result.data.retval;
if (this.data.status) {
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
else
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_open')})),
severity:'success'
});
}
this.saving = false;
})
.catch(error => {
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
this.saving = false;
this.$fhcAlert.handleSystemError(error);
});
}
);
},
cancelAntrag() {
this.$emit('setStatus', {
@@ -108,37 +126,51 @@ export default {
severity: 'warning'
});
this.saving = true;
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.abmeldung.cancel(
this.data.studierendenantrag_id
)
.then(result => {
if (Number.isInteger(result.data))
document.location = document.location.replace(/abmeldung\/([0-9]*)\/[0-9]*[\/]?$/, 'abmeldung/$1') + "/" + result.data;
this.data = result.data;
if (this.data.status)
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
else
for(var k in this.errors)
this.errors[k] = [];
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Abmeldung/cancelAntrag/', {
antrag_id: this.data.studierendenantrag_id
}
).then(
result => {
if (result.data.error)
{
for (var k in result.data.retval)
{
if (this.errors[k] !== undefined)
this.errors[k].push(result.data.retval[k]);
else
this.errors.default.push(result.data.retval[k]);
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_cancelled')})),
severity: 'danger'
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity:'danger'
});
}
else
{
if (Number.isInteger(result.data.retval)) {
document.location = document.location.replace(/abmeldung\/([0-9]*)\/[0-9]*[\/]?$/, 'abmeldung/$1') + "/" + result.data.retval;
}
this.data = result.data.retval;
if (this.data.status) {
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
else
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_cancelled')})),
severity: 'danger'
});
}
this.saving = false;
})
.catch(error => {
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
this.saving = false;
this.$fhcAlert.handleSystemError(error);
});
}
);
}
},
created() {
@@ -147,9 +179,10 @@ export default {
template: `
<div class="studierendenantrag-form-abmeldung">
<core-fetch-cmpt :api-function="load">
<core-form ref="form" class="row">
<div class="row">
<div class="col-12">
<form-validation></form-validation>
<div v-for="error in errors.default" class="alert alert-danger" role="alert" v-html="error">
</div>
<table class="table">
<tr>
<th>{{$p.t('lehre', 'studiengang')}}</th>
@@ -186,16 +219,19 @@ export default {
<pre>{{data.grund}}</pre>
</div>
<div v-else class="col-sm-6 mb-3">
<form-input
type="textarea"
label="Grund:"
v-model="formData.grund"
name="grund"
<label :for="'studierendenantrag-form-abmeldung-' + uuid + '-grund'" class="form-label">Grund:</label>
<textarea
class="form-control"
:class="{'is-invalid': errors.grund.length}"
:id="'studierendenantrag-form-abmeldung-' + uuid + '-grund'"
rows="5"
:disabled="saving"
ref="grund"
required
>
</form-input>
></textarea>
<div v-if="errors.grund.length" class="invalid-feedback">
{{errors.grund.join(".")}}
</div>
</div>
<div class="col-12 text-end">
<button
@@ -250,13 +286,13 @@ export default {
</div>
</div>
</div>
</core-form>
</div>
<template v-slot:error="{errorMessage}">
<div class="alert alert-danger m-0" role="alert">
{{ errorMessage }}
</div>
</template>
</core-fetch-cmpt>
</div>`
</div>
`
}
@@ -1,16 +1,10 @@
import {CoreFetchCmpt} from '../../Fetch.js';
import CoreForm from '../../Form/Form.js';
import FormValidation from '../../Form/Validation.js';
import FormInput from '../../Form/Input.js';
var _uuid = 0;
export default {
components: {
CoreFetchCmpt,
CoreForm,
FormValidation,
FormInput
CoreFetchCmpt
},
emits: [
'setInfos',
@@ -24,8 +18,9 @@ export default {
return {
data: null,
saving: false,
formData: {
grund: ''
errors: {
grund: [],
default: []
}
}
},
@@ -40,14 +35,24 @@ export default {
case 'Abgemeldet': return 'success';
default: return 'warning';
}
},
loadUrl() {
if (this.studierendenantragId)
return '/components/Antrag/Abmeldung/getDetailsForAntrag/'+
this.studierendenantragId;
return '/components/Antrag/Abmeldung/getDetailsForNewAntrag/' +
this.prestudentId;
}
},
methods: {
load() {
return this.$fhcApi.factory
.studstatus.abmeldung.getDetails(this.studierendenantragId, this.prestudentId)
.then(result => {
this.data = result.data;
return axios.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
this.loadUrl
).then(
result => {
this.data = result.data.retval;
if (this.data.status) {
const msg = (this.data.status == 'Pause' && this.data.status_insertvon == "Studienabbruch") ? Vue.computed(() => {
let status = this.$p.t('studierendenantrag/status_stop');
@@ -59,7 +64,8 @@ export default {
});
}
return result;
});
}
);
},
createAntrag() {
bootstrap.Modal.getOrCreateInstance(this.$refs.modal).hide();
@@ -68,44 +74,63 @@ export default {
severity: 'warning'
});
this.saving = true;
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.abmeldung.create(
this.data.studiensemester_kurzbz,
this.data.prestudent_id,
this.formData.grund
)
.then(result => {
if (result.data === true)
document.location += "";
this.data = result.data;
if (this.data.status)
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
else
for(var k in this.errors)
this.errors[k] = [];
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Abmeldung/createAntrag/', {
studiensemester: this.data.studiensemester_kurzbz,
prestudent_id: this.data.prestudent_id,
grund: this.$refs.grund.value
}
).then(
result => {
if (result.data.error)
{
for (var k in result.data.retval)
{
if (this.errors[k] !== undefined)
this.errors[k].push(result.data.retval[k]);
else
this.errors.default.push(result.data.retval[k]);
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_open')})),
severity:'success'
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
}
else
{
if (result.data.retval === true)
document.location += "";
this.data = result.data.retval;
if (this.data.status) {
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
else
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_open')})),
severity:'success'
});
}
this.saving = false;
})
.catch(error => {
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
this.saving = false;
this.$fhcAlert.handleSystemError(error);
});
}
);
},
appendDropDownText(event) {
this.formData.grund = event.target.value
? this.$p.t('studierendenantrag', event.target.value)
: '';
appendDropDownText(event){
let templateText = this.$refs.grund;
if(event.target.value)
{
let templateT= this.$p.t('studierendenantrag', event.target.value);
templateText.value = templateT;
}
else
templateText.value = '';
},
},
created() {
@@ -114,9 +139,8 @@ export default {
template: `
<div class="studierendenantrag-form-abmeldung">
<core-fetch-cmpt :api-function="load">
<core-form ref="form" class="row">
<div class="row">
<div class="col-12">
<form-validation></form-validation>
<table class="table">
<tr>
<th>{{$p.t('lehre', 'studiengang')}}</th>
@@ -157,7 +181,8 @@ export default {
<div v-else class="col-sm-6 mb-3">
<label :for="'studierendenantrag-form-abmeldung-' + uuid + '-grund'" class="form-label">Grund:</label>
<div class="mb-2">
<select name="grundAv" class="form-select" @change="appendDropDownText">
<select name="grundAv" @change="appendDropDownText
($event)">
<option value="" > --- bitte auswählen, sofern zutreffend ---- </option>
<option value="textLong_NichtantrittStudium">{{$p.t('studierendenantrag', 'dropdown_NichtantrittStudium')}}
</option>
@@ -174,17 +199,19 @@ export default {
<option value="textLong_MissingZgv">{{$p.t('studierendenantrag', 'dropdown_MissingZgv')}}
</option>
</select>
</div>
<form-input
type="textarea"
v-model="formData.grund"
name="grund"
</div>
<textarea
class="form-control"
:class="{'is-invalid': errors.grund.length}"
:id="'studierendenantrag-form-abmeldung-' + uuid + '-grund'"
rows="5"
:disabled="saving"
ref="grund"
required
>
</form-input>
></textarea>
<div v-if="errors.grund.length" class="invalid-feedback">
{{errors.grund.join(".")}}
</div>
</div>
<div class="col-12 text-end">
@@ -230,7 +257,7 @@ export default {
</div>
</div>
</div>
</core-form>
</div>
<template v-slot:error="{errorMessage}">
<div class="alert alert-danger m-0" role="alert">
@@ -238,5 +265,6 @@ export default {
</div>
</template>
</core-fetch-cmpt>
</div>`
</div>
`
}
@@ -1,15 +1,12 @@
import {CoreFetchCmpt} from '../../Fetch.js';
import CoreForm from '../../Form/Form.js';
import FormValidation from '../../Form/Validation.js';
import FormInput from '../../Form/Input.js';
import VueDatepicker from '../../vueDatepicker.js.php';
var _uuid = 0;
export default {
components: {
CoreFetchCmpt,
CoreForm,
FormValidation,
FormInput
VueDatepicker
},
emits: [
'setInfos',
@@ -23,7 +20,12 @@ export default {
return {
data: null,
saving: false,
attachment: [],
errors: {
grund: [],
studiensemester: [],
datum_wiedereinstieg: [],
default: []
},
stsem: null,
currentWiedereinstieg: '',
siteUrl: FHC_JS_DATA_STORAGE_OBJECT.app_root +
@@ -43,6 +45,13 @@ export default {
default: return 'warning';
}
},
loadUrl() {
if (this.studierendenantragId)
return '/components/Antrag/Unterbrechung/getDetailsForAntrag/'+
this.studierendenantragId;
return '/components/Antrag/Unterbrechung/getDetailsForNewAntrag/' +
this.prestudentId;
},
datumWsFormatted() {
let datumUnformatted = '';
@@ -72,24 +81,26 @@ export default {
},
methods: {
load() {
return this.$fhcApi.factory
.studstatus.unterbrechung.getDetails(this.studierendenantragId, this.prestudentId)
.then(
result => {
this.data = result.data;
if (this.data.status) {
const msg = (this.data.status == 'Pause' && this.data.status_insertvon == "Studienabbruch") ? Vue.computed(() => {
let status = this.$p.t('studierendenantrag/status_stop');
return this.$p.t('studierendenantrag', 'status_x', {status});
}) : Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp}));
this.$emit("setStatus", {
msg,
severity: this.statusSeverity
});
}
return result;
return axios.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
this.loadUrl
).then(
result => {
this.data = result.data.retval;
if (this.data.status) {
const msg = (this.data.status == 'Pause' && this.data.status_insertvon == "Studienabbruch") ? Vue.computed(() => {
let status = this.$p.t('studierendenantrag/status_stop');
return this.$p.t('studierendenantrag', 'status_x', {status});
}) : Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp}));
this.$emit("setStatus", {
msg,
severity: this.statusSeverity
});
}
);
return result;
}
);
},
createAntrag() {
this.$emit('setStatus', {
@@ -97,41 +108,63 @@ export default {
severity: 'warning'
});
this.saving = true;
for(var k in this.errors)
this.errors[k] = [];
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.unterbrechung.create(
this.stsem !== null && this.data.studiensemester[this.stsem].studiensemester_kurzbz,
this.data.prestudent_id,
this.data.grund,
this.stsem !== null && this.currentWiedereinstieg,
this.attachment
)
.then(result => {
if (Number.isInteger(result.data))
document.location += "/" + result.data;
var formData = new FormData();
var attachment = this.$refs.attachment;
formData.append("attachment", attachment.files[0]);
formData.append("studiensemester", this.stsem !== null && this.data.studiensemester[this.stsem].studiensemester_kurzbz);
formData.append("prestudent_id", this.data.prestudent_id);
formData.append("grund", this.$refs.grund.value);
formData.append("datum_wiedereinstieg", this.stsem !== null && this.currentWiedereinstieg);
this.data = result.data;
if (this.data.status)
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
else
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Unterbrechung/createAntrag/',
formData,
{
headers: {
'Content-Type': 'multipart/form-data'
}
}
).then(
result => {
if (result.data.error)
{
for (var k in result.data.retval)
{
if (this.errors[k] !== undefined)
this.errors[k].push(result.data.retval[k]);
else
this.errors.default.push(result.data.retval[k]);
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_created')})),
severity: 'info'
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
}
else
{
if (Number.isInteger(result.data.retval))
document.location += "/" + result.data.retval;
this.data = result.data.retval;
if (this.data.status) {
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
else
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_created')})),
severity: 'info'
});
}
this.saving = false;
})
.catch(error => {
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
this.saving = false;
this.$fhcAlert.handleSystemError(error);
});
}
);
},
cancelAntrag() {
this.$emit('setStatus', {
@@ -139,45 +172,63 @@ export default {
severity: 'warning'
});
this.saving = true;
this.$refs.form.clearValidation();
this.$refs.form.factory
.studstatus.unterbrechung.cancel(
this.data.studierendenantrag_id
)
.then(result => {
if (Number.isInteger(result.data))
document.location = document.location.replace(/unterbrechung\/([0-9]*)\/[0-9]*[\/]?$/, 'unterbrechung/$1') + "/" + result.data;
this.data = result.data;
if (this.data.status)
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
else
for(var k in this.errors)
this.errors[k] = [];
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Unterbrechung/cancelAntrag/', {
antrag_id: this.data.studierendenantrag_id
}
).then(
result => {
if (result.data.error)
{
for (var k in result.data.retval)
{
if (this.errors[k] !== undefined)
this.errors[k].push(result.data.retval[k]);
else
this.errors.default.push(result.data.retval[k]);
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_cancelled')})),
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
}
else
{
if (Number.isInteger(result.data.retval)) {
document.location = document.location.replace(/unterbrechung\/([0-9]*)\/[0-9]*[\/]?$/, 'unterbrechung/$1') + "/" + result.data.retval;
}
this.data = result.data.retval;
if (this.data.status) {
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
else
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_cancelled')})),
severity: 'danger'
});
}
this.saving = false;
})
.catch(error => {
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
this.saving = false;
this.$fhcAlert.handleSystemError(error);
});
}
);
}
},
created() {
this.uuid = _uuid++;
},
template: `
<div class="studierendenantrag-form-unterbrechung">
<core-fetch-cmpt :api-function="load">
<core-form ref="form" class="row">
<div class="row">
<div class="col-12">
<form-validation></form-validation>
<div v-for="error in errors.default" class="alert alert-danger" role="alert" v-html="error">
</div>
<table class="table">
<tr>
<th>{{$p.t('lehre', 'studiengang')}}</th>
@@ -209,99 +260,93 @@ export default {
</div>
<div class="col-sm-6 mb-3">
<label :for="'studierendenantrag-form-abmeldung-' + uuid + '-stsem'" class="form-label">
{{$p.t('lehre', 'studiensemester')}}
</label>
<div v-if="data.studierendenantrag_id">
<label class="form-label">
{{$p.t('lehre', 'studiensemester')}}
</label>
<div>
{{data.studiensemester_kurzbz}}
{{data.studiensemester_kurzbz}}
</div>
<div v-else>
<select
class="form-select"
:class="{'is-invalid': errors.studiensemester.length}"
v-model="stsem"
required
:id="'studierendenantrag-form-abmeldung-' + uuid + '-stsem'"
@input="currentWiedereinstieg = ''"
>
<option v-for="(stsem, index) in data.studiensemester" :key="index" :value="index" :disabled="stsem.disabled">
{{stsem.studiensemester_kurzbz}}
</option>
</select>
<div v-if="errors.studiensemester.length" class="invalid-feedback">
{{errors.studiensemester.join(".")}}
</div>
</div>
<form-input
v-else
type="select"
v-model="stsem"
name="studiensemester"
:label="$p.t('lehre', 'studiensemester')"
required
@input="currentWiedereinstieg = ''"
>
<option v-for="(stsem, index) in data.studiensemester" :key="index" :value="index" :disabled="stsem.disabled">
{{stsem.studiensemester_kurzbz}}
</option>
</form-input>
</div>
<div class="col-sm-6 mb-3">
<label class="form-label">
{{$p.t('studierendenantrag', 'antrag_datum_wiedereinstieg')}}
</label>
<div v-if="data.studierendenantrag_id">
<label class="form-label">
{{$p.t('studierendenantrag', 'antrag_datum_wiedereinstieg')}}
</label>
<div>
{{datumWsFormatted}}
</div>
{{datumWsFormatted}}
</div>
<div v-else-if="stsem === null">
<select class="form-select" disabled>
<option selected>{{$p.t('ui/select_studiensemester')}}</option>
</select>
</div>
<div v-else>
<select v-model="currentWiedereinstieg" class="form-select">
<option v-for="sem in data.studiensemester[stsem].wiedereinstieg" :key="sem.studiensemester_kurzbz" :value="sem.start" :disabled="sem.disabled">
{{sem.studiensemester_kurzbz}}
</option>
</select>
</div>
<div v-if="errors.datum_wiedereinstieg.length" class="invalid-feedback d-block">
{{errors.datum_wiedereinstieg.join(".")}}
</div>
<form-input
v-else-if="stsem === null"
type="select"
:label="$p.t('studierendenantrag', 'antrag_datum_wiedereinstieg')"
modelValue=""
name="datum_wiedereinstieg"
disabled
>
<template #default>
<option value="" selected disabled hidden>{{$p.t('ui/select_studiensemester')}}</option>
</template>
</form-input>
<form-input
v-else
type="select"
:label="$p.t('studierendenantrag', 'antrag_datum_wiedereinstieg')"
v-model="currentWiedereinstieg"
name="datum_wiedereinstieg"
>
<option v-for="sem in data.studiensemester[stsem].wiedereinstieg" :key="sem.studiensemester_kurzbz" :value="sem.start" :disabled="sem.disabled">
{{sem.studiensemester_kurzbz}}
</option>
</form-input>
</div>
<div class="col-sm-6 mb-3">
<form-input
v-if="data.studierendenantrag_id"
type="textarea"
:label="$p.t('studierendenantrag', 'antrag_grund') + ':'"
v-model="data.grund"
name="grund"
<div v-if="data.studierendenantrag_id" class="mb-3">
<h5>{{$p.t('studierendenantrag', 'antrag_grund')}}:</h5>
<textarea class="form-control" rows="5" readonly>{{data.grund}}</textarea>
</div>
<div v-else class="col-sm-6 mb-3">
<label :for="'studierendenantrag-form-abmeldung-' + uuid + '-grund'" class="form-label">Grund:</label>
<textarea
class="form-control"
:class="{'is-invalid': errors.grund.length}"
:id="'studierendenantrag-form-abmeldung-' + uuid + '-grund'"
rows="5"
readonly
>
</form-input>
<form-input
v-else
ref="grund"
type="textarea"
:label="$p.t('studierendenantrag', 'antrag_grund') + ':'"
v-model="data.grund"
name="grund"
:disabled="saving"
rows="5"
ref="grund"
required
>
</form-input>
></textarea>
<div v-if="errors.grund.length" class="invalid-feedback">
{{errors.grund.join(".")}}
</div>
</div>
<div class="col-12 mb-3">
<div v-if="data.studierendenantrag_id">
<a v-if="data.dms_id" target="_blank" :href="siteUrl + '/lehre/Antrag/Attachment/Show/' + data.dms_id"> {{$p.t('studierendenantrag', 'antrag_dateianhaenge')}} </a>
<span v-else>{{$p.t('studierendenantrag', 'no_attachments')}}</span>
</div>
<form-input
v-else
ref="attachment"
type="uploadfile"
:label="$p.t('studierendenantrag', 'antrag_dateianhaenge')"
v-model="attachment"
name="attachment"
>
</form-input>
<div v-else>
<label
:for="'studierendenantrag-form-abmeldung-' + uuid + '-attachment'"
class="form-label">
{{$p.t('studierendenantrag', 'antrag_dateianhaenge')}}
</label>
<input
class="form-control"
type="file"
ref="attachment"
:id="'studierendenantrag-form-abmeldung-' + uuid + '-attachment'"
name="attachment">
</div>
</div>
<div class="col-12 text-end">
<button
@@ -323,12 +368,13 @@ export default {
{{$p.t('studierendenantrag', 'btn_cancel')}}
</button>
</div>
</core-form>
</div>
<template v-slot:error="{errorMessage}">
<div class="alert alert-danger m-0" role="alert">
{{ errorMessage }}
</div>
</template>
</core-fetch-cmpt>
</div>`
</div>
`
}
@@ -1,13 +1,12 @@
import {CoreFetchCmpt} from '../../Fetch.js';
import CoreForm from '../../Form/Form.js';
import FormValidation from '../../Form/Validation.js';
import VueDatepicker from '../../vueDatepicker.js.php';
var _uuid = 0;
export default {
components: {
CoreFetchCmpt,
CoreForm,
FormValidation
VueDatepicker
},
emits: [
'setInfos',
@@ -23,6 +22,12 @@ export default {
return {
data: null,
saving: false,
errors: {
grund: [],
default: []
},
siteUrl: FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router,
infos: []
}
},
@@ -40,6 +45,10 @@ export default {
default: return 'warning';
}
},
loadUrl() {
return '/components/Antrag/Wiederholung/getDetailsForNewAntrag/' +
this.prestudentId;
},
datumPruefungFormatted() {
if(!this.data.pruefungsdatum)
return '';
@@ -49,12 +58,13 @@ export default {
},
methods: {
load() {
return this.$fhcApi.factory
.studstatus.wiederholung.getDetails(
this.prestudentId
)
.then(result => {
this.data = result.data;
return axios.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
this.loadUrl
).then(
result => {
this.data = result.data.retval;
if (!this.data.status || this.data.status == 'ErsteAufforderungVersandt' || this.data.status == 'ZweiteAufforderungVersandt') {
this.data.status = 'Offen';
this.data.statustyp = this.$p.t('studierendenantrag', 'status_open');
@@ -69,7 +79,8 @@ export default {
severity: this.statusSeverity
});
return result;
});
}
);
},
createAntrag() {
this.createAntragWithStatus(true);
@@ -78,7 +89,7 @@ export default {
this.createAntragWithStatus(false);
},
createAntragWithStatus(repeat) {
let func = repeat ? 'create' : 'cancel';
let func = repeat ? 'createAntrag' : 'cancelAntrag';
let nextState = repeat ? 'Erstellt' : 'Verzichtet';
this.$emit('setStatus', {
@@ -86,36 +97,54 @@ export default {
severity: 'warning'
});
this.saving = true;
for(var k in this.errors)
this.errors[k] = [];
this.$refs.form.factory
.studstatus.wiederholung[func](
this.data.prestudent_id,
this.data.studiensemester_kurzbz
)
.then(result => {
if (result.data === true)
document.location += "";
this.data = result.data;
if (!this.data.status)
this.data.status = nextState;
this.$emit('update:status', this.data.status);
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Wiederholung/' + func + '/',
{
prestudent_id: this.data.prestudent_id,
studiensemester: this.data.studiensemester_kurzbz
}
).then(
result => {
if (result.data.error)
{
for (var k in result.data.retval)
{
if (this.errors[k] !== undefined)
this.errors[k].push(result.data.retval[k]);
else
this.errors.default.push(result.data.retval[k]);
}
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
}
else
{
if (result.data.retval === true)
document.location += "";
this.data = result.data.retval;
if (!this.data.status)
this.data.status = nextState;
this.$emit('update:status', this.data.status);
this.$emit("setStatus", {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
severity: this.statusSeverity
});
}
this.saving = false;
})
.catch(error => {
this.$emit('setStatus', {
msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
severity: 'danger'
});
this.saving = false;
this.$fhcAlert.handleSystemError(error);
});
}
);
}
},
created() {
this.uuid = _uuid++;
},
mounted() {
this.infos = [...Array(5).keys()].map(n => ({
body: Vue.computed(() => this.$p.t('studierendenantrag', 'infotext_Wiederholung_' + n))
@@ -125,9 +154,10 @@ export default {
template: `
<div class="studierendenantrag-form-wiederholung">
<core-fetch-cmpt :api-function="load">
<core-form ref="form" class="row">
<div class="row">
<div class="col-12">
<form-validation></form-validation>
<div v-for="error in errors.default" class="alert alert-danger" role="alert" v-html="error">
</div>
<table class="table">
<tr>
<th>{{$p.t('lehre', 'studiengang')}}</th>
@@ -176,7 +206,7 @@ export default {
{{$p.t('studierendenantrag/antrag_Wiederholung_button_no')}}
</button>-->
</div>
</core-form>
</div>
<template v-slot:error="{errorMessage}">
<div class="alert alert-danger m-0" role="alert">
{{ errorMessage }}
@@ -39,10 +39,15 @@ export default {
},
methods: {
loadFilter() {
this.$fhcApi.factory
.studstatus.leitung.getStgs()
.then(result => this.stgs = result.data)
.catch(this.$fhcAlert.handleSystemError);
axios.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/getActiveStgs'
).then(result => {
this.stgs = result.data.retval;
}).catch(error => {
console.error(error);
});
},
changeFilter(filter) {
this.filter = filter || undefined;
@@ -98,9 +103,21 @@ export default {
}
} else {
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.approve(oks)
.then(this.showResults);
axios
.all(
oks.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/approve' + antrag.typ,
{
studierendenantrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
}
},
actionReject(evt, gruende) {
@@ -130,38 +147,99 @@ export default {
.catch(() => {});
} else {
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.reject(gruende)
.then(this.showResults);
axios
.all(
gruende.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/reject' + antrag.typ,
{
studierendenantrag_id: antrag.studierendenantrag_id,
grund: antrag.grund
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
}
},
actionReopen(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.reopen(gruende)
.then(this.showResults);
axios
.all(
antraege.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/reopenAntrag/',
{
studierendenantrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
},
actionPause(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.pause(antraege)
.then(this.showResults);
axios
.all(
antraege.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/pauseAntrag/',
{
studierendenantrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
},
actionUnpause(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.unpause(antraege)
.then(this.showResults);
axios
.all(
antraege.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/unpauseAntrag/',
{
studierendenantrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
},
actionObject(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.object(antraege)
.then(this.showResults);
axios
.all(
antraege.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/objectAntrag/',
{
studierendenantrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
},
actionoObjectionDeny(evt, gruende) {
var antraege = evt || this.selectedData;
@@ -189,31 +267,84 @@ export default {
.catch(() => {});
} else {
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.denyObjection(gruende)
.then(this.showResults);
axios
.all(
gruende.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/objectionDeny/',
{
studierendenantrag_id: antrag.studierendenantrag_id,
grund: antrag.grund
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
}
},
actionObjectionApprove(evt, gruende) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.leitung.approveObjection(antraege)
.then(this.showResults);
axios
.all(
antraege.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/objectionApprove/',
{
studierendenantrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
},
actionCancel(evt) {
var antraege = evt || this.selectedData;
this.$refs.loader.show();
this.$fhcApi.factory
.studstatus.abmeldung.cancel(antraege)
.then(this.showResults);
axios
.all(
antraege.map(
antrag => axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Abmeldung/cancelAntrag/',
{
antrag_id: antrag.studierendenantrag_id
}
)
)
)
.then(this.showValidation)
.catch(this.showError);
},
showResults(results) {
let fulfilled = results.filter(res => res.status == 'fulfilled');
showValidation(results) {
var errors = results.filter(res => res.data.error);
this.$refs.loader.hide();
//fulfilled.forEach(a => this.$fhcAlert.alertDefault('success', '#' + a.value.data, 'Approved, ...'));
if (fulfilled.length)
this.reload();
if (errors.length) {
let errorMsg = errors.map(
error =>
'Antrag ' +
JSON.parse(error.config.data).studierendenantrag_id +
'\n' +
Object.values(error.data.retval).join('\n')
).join('\n');
BsAlert.popup(errorMsg, {dialogClass: 'alert alert-danger'});
}
this.reload();
},
showError(error) {
this.$refs.loader.hide();
let msg = error.response.data;
if (msg.replace(/^\s+/, '').substr(0, 9) == '<!DOCTYPE' || msg.replace(/^\s+/, '').substr(0, 4).toLowerCase() == '<div')
msg = error.message;
BsAlert.popup(msg, {dialogClass: 'alert alert-danger'});
}
},
created() {
@@ -35,32 +35,28 @@ export default {
});
},
loadData(evt) {
if( evt.query.length < 2 )
{
return false;
}
if (this.abortController instanceof AbortController
&& this.abortController.signal.aborted === false)
{
this.abortController.abort();
}
if (this.abortController)
this.abortController.abort();
this.abortController = new AbortController();
this.$fhcApi.factory
.studstatus.leitung.getPrestudents(evt.query, this.abortController.signal)
.then(result => {
this.data = result.data;
this.abortController = null;
})
.catch(error => {
if (this.abortController instanceof AbortController
&& this.abortController.signal.aborted === false)
{
this.abortController.abort();
}
this.$fhcAlert.handleSystemError(error);
});
axios.post(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Abmeldung/getStudiengaengeAssistenz/',
evt,
{
signal: this.abortController.signal
}
).then(
result => {
if (result.data.error) {
BsAlert.popup(result.data.retval, {dialogClass: 'alert alert-danger'});
} else {
this.data = result.data.retval;
}
return result;
}
).catch(() => {});
}
},
template: `
@@ -83,20 +79,15 @@ export default {
class="w-100"
v-model="student"
:suggestions="data"
option-label = "name"
optionLabel = "name"
@complete="loadData"
input-id="newAntragModalAutoComplete"
inputId="newAntragModalAutoComplete"
dropdown
dropdown-mode="current"
>
<template #option="slotProps">
<div :title="slotProps.option.prestudent_id">
{{slotProps.option.name}}
</div>
</template>
<template #empty>
<div class="text-muted px-3 py-2">
{{ $p.t('ui/keineEintraegeGefunden') }}
{{slotProps.option.name}}
</div>
</template>
</auto-complete>
@@ -36,17 +36,21 @@ export default {
},
methods: {
setlvs(param) {
this.repeat_last = !!param.repeat_last;
if (this.repeat_last) {
delete param.repeat_last;
if(param.error) {
this.$refs.fetchCompt.error = true;
this.$refs.fetchCompt.errorMessage = param.retval;
} else {
this.repeat_last = !!param.retval.repeat_last;
if (this.repeat_last) {
delete param.retval.repeat_last;
}
this.lvs = param.retval;
}
this.lvs = param;
},
loadlvs() {
if (!this.antragId)
return new Promise(() => {});
return this.$fhcApi.factory
.studstatus.wiederholung.getLvs(this.antragId);
return axios.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/Antrag/Wiederholung/getLvs/' + this.antragId);
},
submit(result) {
this.result = [result, this.check];
@@ -31,6 +31,9 @@ export default {
],
data() {
return {
ajaxUrl: FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/getAntraege/',
table: null,
lastHistoryClickedId: null,
historyData: [],
@@ -39,7 +42,7 @@ export default {
},
methods: {
reload(stg) {
this.table.setData('/' + (stg || ''));
this.table.setData(this.ajaxUrl + (stg || ''));
},
download() {
this.table.download("csv", "data.csv", {
@@ -50,12 +53,14 @@ export default {
getHistory() {
if (this.lastHistoryClickedId === null)
return null;
return this.$fhcApi.factory
.studstatus.leitung.getHistory(this.lastHistoryClickedId)
.then(res => {
this.historyData = res.data.sort((a, b) => a.insertamum > b.insertamum);
})
.catch(this.$fhcApi.handleSystemError);
return axios.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
'/components/Antrag/Leitung/getHistory/' +
this.lastHistoryClickedId
).then(res => {
this.historyData = res.data.retval.sort((a, b) => a.insertamum > b.insertamum);
});
},
getHistoryStatus(data, index) {
if (data.insertvon == 'Studienabbruch')
@@ -111,8 +116,7 @@ export default {
movableColumns: true,
height: '65vh',
layout: "fitDataFill",
ajaxURL: '/' + (this.filter || ''),
ajaxRequestFunc: this.$fhcApi.factory.studstatus.leitung.getAntraege,
ajaxURL: this.ajaxUrl + (this.filter || ''),
persistence: { // NOTE(chris): do not store column titles
sort: true, //persist column sorting
filter: true, //persist filters
@@ -56,19 +56,39 @@ export default {
anmerkung: lv.antrag_anmerkung || "",
studiensemester_kurzbz: this.lvs2sem
}));
this.$fhcApi.factory
.studstatus.wiederholung.saveLvs(forbiddenLvs, mandatoryLvs)
axios.post(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/Antrag/Wiederholung/saveLvs/', {forbiddenLvs, mandatoryLvs})
.then(response => {
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
this.statusCode = response.data[0].studierendenantrag_statustyp_kurzbz;
this.statusMsg = response.data[0].typ;
if(!response.data.error) {
this.addAlert('Speichern erfolgreich', 'alert-success');
this.statusCode = response.data.retval[0].studierendenantrag_statustyp_kurzbz;
this.statusMsg = response.data.retval[0].typ;
} else {
this.addAlert(response.data.retval.message || response.data.retval, 'alert-danger');
this.statusCode = 0;
this.statusMsg = 'Error';
}
this.isloading = false;
})
.catch(error => {
}).catch(error => {
this.addAlert(error.message, 'alert-danger');
this.statusCode = 0;
this.statusMsg = 'Error';
this.isloading = false;
}).finally(() => {
window.scrollTo(0, 0);
});
},
addAlert(text, type) {
const para = document.createElement("p");
para.innerText = text;
para.className = "alert " + type + " alert-dismissible fade show";
const btn = document.createElement("button");
btn.className = "btn-close";
btn.type = "button";
btn.setAttribute("aria-label", "Close");
btn.setAttribute("data-bs-dismiss", "alert");
para.appendChild(btn);
this.$refs.alertbox.appendChild(para);
}
},
created() {
@@ -76,141 +96,149 @@ export default {
this.statusMsg = this.initialStatusMsg;
},
mounted() {
this.$p
.loadCategory(['ui', 'lehre', 'studierendenantrag', 'global'])
.then(() => this.antragId)
.then(this.$fhcApi.factory.studstatus.wiederholung.getLvs)
.then(result => {
let res = {};
for (var k in result.data) {
if (k === 'repeat_last')
continue;
if (result.data[k] === null) {
const alert = document.createElement('div');
alert.innerHTML = this.$p.t('studierendenantrag', 'error_stg_last_semester');
alert.className = 'alert alert-warning';
alert.role = 'alert';
this.$refs["lvtable" + k.substr(0,1)].append(alert);
continue;
}
let lvs = result.data[k].reduce((obj,lv) => {
obj[lv.studienplan_lehrveranstaltung_id] = lv;
return obj;
}, {});
for (var lv of Object.values(lvs)) {
if (!lv.studienplan_lehrveranstaltung_id_parent)
continue;
if (!lvs[lv.studienplan_lehrveranstaltung_id_parent])
console.error('parent not available');
else {
if (!lvs[lv.studienplan_lehrveranstaltung_id_parent]._children)
lvs[lv.studienplan_lehrveranstaltung_id_parent]._children = [];
lvs[lv.studienplan_lehrveranstaltung_id_parent]._children.push(lv);
}
}
res[k] = Object.values(lvs).filter(lv => !lv.studienplan_lehrveranstaltung_id_parent);
let current = res[k];
let index = k.substr(0,1);
const options = {
data: current,
dataTree: true,
dataTreeStartExpanded: true, //start with an expanded tree
dataTreeChildIndent: 15,
layout: "fitDataStretch",
columns: [
{title: this.$p.t('ui', 'bezeichnung'), field: "bezeichnung"},
{title: this.$p.t('lehre','lehrform'), field: "lehrform_kurzbz"},
{title: "ECTS", field: "ects"},
{title: this.$p.t('lehre','note'), field: "note", formatter:(cell, formatterParams, onRendered) => cell.getValue() || "---"},
{
title: index == 1 && !result.data.repeat_last ? this.$p.t('studierendenantrag','lv_nicht_zulassen') : this.$p.t('studierendenantrag','lv_wiederholen'),
field: "antrag_zugelassen",
formatter: (cell, formatterParams, onRendered) => {
let data = cell.getData();
if (data._children || !data.zeugnis)
return "";
let input = document.createElement('input');
input.className = "form-check-input";
input.type = "checkbox";
input.role = "switch";
input.checked = cell.getValue();
input.addEventListener('input', () => {
lvs[data.studienplan_lehrveranstaltung_id].antrag_zugelassen = input.checked;
cell.getRow().reformat();
});
if (this.disabled) {
input.disabled = true;
}
let div = document.createElement('div');
div.className = 'form-check form-switch';
div.append(input);
return div;
}
},
{
title: this.$p.t('global','anmerkung'),
field: "antrag_anmerkung",
headerSort:false,
titleFormatter:(cell, formatterParams, onRendered)=>{
let link = document.createElement('a');
link.addEventListener('click', (e) => {
e.preventDefault();
});
link.href ="#";
link.title = this.$p.t('studierendenantrag','anmerkung_tooltip');
new bootstrap.Tooltip(link);
let tooltip = document.createElement('span');
tooltip.innerHTML = this.$p.t('global','anmerkung') + " ";
tooltip.append(link);
let icon = document.createElement('i');
link.append(icon);
icon.className = "fa fa-info-circle";
icon.setAttribute("aria-hidden", "true");
icon.style.minWidth = '1em';
return tooltip;
},
formatter: (cell, formatterParams, onRendered) => {
if (this.disabled) {
return cell.getValue() || "";
}
var data = cell.getData();
if (lvs[data.studienplan_lehrveranstaltung_id].antrag_zugelassen)
{
let input = document.createElement('input');
input.className = "form-control";
input.type = "text";
input.value = cell.getValue() || "";
input.addEventListener('input', () => {
lvs[data.studienplan_lehrveranstaltung_id].antrag_anmerkung = input.value;
});
return input;
}
else
{
return "";
}
}
}
]
};
var table = new Tabulator(this.$refs["lvtable" + k.substr(0,1)], options);
axios.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/Antrag/Wiederholung/getLvs/' + this.antragId).then(
result => {
if(result.data.error)
{
this.addAlert(result.data.retval, 'alert-danger');
this.isloading = true;
}
this.lvs = result.data;
})
.catch(error => {
this.$fhcAlert.handleSystemError(error);
this.isloading = true;
});
else
{
let res = {};
this.$p
.loadCategory(['ui', 'lehre', 'studierendenantrag', 'global'])
.then(() => {
for (var k in result.data.retval) {
if (k === 'repeat_last')
continue;
if (result.data.retval[k] === null) {
const alert = document.createElement('div');
alert.innerHTML = this.$p.t('studierendenantrag', 'error_stg_last_semester');
alert.className = 'alert alert-warning';
alert.role = 'alert';
this.$refs["lvtable" + k.substr(0,1)].append(alert);
continue;
}
let lvs = result.data.retval[k].reduce((obj,lv) => {
obj[lv.studienplan_lehrveranstaltung_id] = lv;
return obj;
}, {});
for (var lv of Object.values(lvs)) {
if (!lv.studienplan_lehrveranstaltung_id_parent)
continue;
if (!lvs[lv.studienplan_lehrveranstaltung_id_parent])
console.error('parent not available');
else {
if (!lvs[lv.studienplan_lehrveranstaltung_id_parent]._children)
lvs[lv.studienplan_lehrveranstaltung_id_parent]._children = [];
lvs[lv.studienplan_lehrveranstaltung_id_parent]._children.push(lv);
}
}
res[k] = Object.values(lvs).filter(lv => !lv.studienplan_lehrveranstaltung_id_parent);
let current = res[k];
let index = k.substr(0,1);
const options = {
data: current,
dataTree: true,
dataTreeStartExpanded: true, //start with an expanded tree
dataTreeChildIndent: 15,
layout: "fitDataStretch",
columns: [
{title: this.$p.t('ui', 'bezeichnung'), field: "bezeichnung"},
{title: this.$p.t('lehre','lehrform'), field: "lehrform_kurzbz"},
{title: "ECTS", field: "ects"},
{title: this.$p.t('lehre','note'), field: "note", formatter:(cell, formatterParams, onRendered)=>cell.getValue() || "---"},
{
title: index == 1 && !result.data.retval.repeat_last ? this.$p.t('studierendenantrag','lv_nicht_zulassen') : this.$p.t('studierendenantrag','lv_wiederholen'),
field: "antrag_zugelassen",
formatter: (cell, formatterParams, onRendered) => {
let data = cell.getData();
if(data._children || !data.zeugnis)
return "";
let input = document.createElement('input');
input.className = "form-check-input";
input.type = "checkbox";
input.role = "switch";
input.checked = cell.getValue();
input.addEventListener('input', () => {
lvs[data.studienplan_lehrveranstaltung_id].antrag_zugelassen = input.checked;
cell.getRow().reformat();
});
if (this.disabled) {
input.disabled = true;
}
let div = document.createElement('div');
div.className = 'form-check form-switch';
div.append(input);
return div;
}
},
{
title: this.$p.t('global','anmerkung'),
field: "antrag_anmerkung",
headerSort:false,
titleFormatter:(cell, formatterParams, onRendered)=>{
let link = document.createElement('a');
link.addEventListener('click', (e) => {
e.preventDefault();
});
link.href ="#";
link.title = this.$p.t('studierendenantrag','anmerkung_tooltip');
new bootstrap.Tooltip(link);
let tooltip = document.createElement('span');
tooltip.innerHTML = this.$p.t('global','anmerkung') + " ";
tooltip.append(link);
let icon = document.createElement('i');
link.append(icon);
icon.className = "fa fa-info-circle";
icon.setAttribute("aria-hidden", "true");
icon.style.minWidth = '1em';
return tooltip;
},
formatter: (cell, formatterParams, onRendered) => {
if (this.disabled) {
return cell.getValue() || "";
}
var data = cell.getData();
if (lvs[data.studienplan_lehrveranstaltung_id].antrag_zugelassen)
{
let input = document.createElement('input');
input.className = "form-control";
input.type = "text";
input.value = cell.getValue() || "";
input.addEventListener('input', () => {
lvs[data.studienplan_lehrveranstaltung_id].antrag_anmerkung = input.value;
});
return input;
}
else
{
return "";
}
}
}
]
};
var table = new Tabulator(this.$refs["lvtable" + k.substr(0,1)], options);
}
this.lvs = result.data.retval;
});
}
}
);
},
template: `
<div class="col-sm-10">
<div ref="alertbox"></div>
<span class="d-flex justify-content-between h4">
<span>{{lvs.repeat_last ? $p.t('studierendenantrag', 'title_lv_wiederholen') : $p.t('studierendenantrag', 'title_lv_nicht_zugelassen')}}</span>
<span>{{lvs1sem}}</span>
+28 -23
View File
@@ -1,3 +1,5 @@
import { markRaw, defineAsyncComponent } from 'vue';
import {CoreRESTClient} from '../RESTClient.js';
import accessibility from "../directives/accessibility.js";
export default {
@@ -11,7 +13,7 @@ export default {
],
props: {
config: {
type: [String, Array, Object, Promise],
type: [String, Object],
required: true
},
default: String,
@@ -55,37 +57,40 @@ export default {
initConfig(config) {
if (!config)
return;
if (config instanceof Promise)
return config
.then(result => result.data)
.then(this.initConfig)
.catch(this.$fhcAlert.handleSystemError);
if (typeof config === 'string' || config instanceof String)
return this.$fhcApi
.get(config)
.then(result => result.data)
return CoreRESTClient.get(config)
.then(result => CoreRESTClient.getData(result.data))
.then(this.initConfig)
.catch(this.$fhcAlert.handleSystemError);
const tabs = {};
function _addToTabs(key, item) {
if (!item.component)
return console.error('Component missing for ' + key);
if (Array.isArray(config)) {
config.forEach((item, key) => {
if (!item.component)
return console.error('Component missing for ' + key);
tabs[key] = {
component: Vue.markRaw(Vue.defineAsyncComponent(() => import(item.component))),
title: item.title || key,
config: item.config,
key
}
tabs[key] = {
component: markRaw(defineAsyncComponent(() => import(item.component))),
title: item.title || key,
config: item.config,
key
}
});
} else {
Object.entries(config).forEach(([key, item]) => {
if (!item.component)
return console.error('Component missing for ' + key);
tabs[key] = {
component: markRaw(defineAsyncComponent(() => import(item.component))),
title: item.title || key,
config: item.config,
key
}
});
}
if (Array.isArray(config))
config.forEach((item, key) => _addToTabs(key, item));
else
Object.entries(config).forEach(([key, item]) => _addToTabs(key, item));
if (this.current === null || !tabs[this.current]) {
if (tabs[this.default])
this.current = this.default;
+1 -1
View File
@@ -21,7 +21,7 @@ import {CoreRESTClient} from '../../RESTClient.js';
const CORE_FILTER_CMPT_TIMEOUT = 7000;
/**
* TODO(chris): deprecated
*
*/
export const CoreFilterAPIs = {
/**
+49 -38
View File
@@ -15,6 +15,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { TabulatorFull as Tabulator } from 'tabulator-tables';
import {CoreFilterAPIs} from './API.js';
import {CoreRESTClient} from '../../RESTClient.js';
import {CoreFetchCmpt} from '../../components/Fetch.js';
import FilterConfig from './Filter/Config.js';
import FilterColumns from './Filter/Columns.js';
@@ -250,12 +253,12 @@ export const CoreFilterCmpt = {
/**
*
*/
getFilter() {
getFilter: function() {
if (this.selectedFilter === null)
this.startFetchCmpt(this.$fhcApi.factory.filter.getFilter, null, this.render);
this.startFetchCmpt(CoreFilterAPIs.getFilter, null, this.render);
else
this.startFetchCmpt(
this.$fhcApi.factory.filter.getFilterById,
CoreFilterAPIs.getFilterById,
{
filterId: this.selectedFilter
},
@@ -265,47 +268,55 @@ export const CoreFilterCmpt = {
/**
*
*/
render(response) {
let data = response;
this.filterName = data.filterName;
this.dataset = data.dataset;
this.datasetMetadata = data.datasetMetadata;
render: function(response) {
this.fields = data.fields;
this.selectedFields = data.selectedFields;
this.notSelectedFields = this.fields.filter(x => this.selectedFields.indexOf(x) === -1);
this.filterFields = [];
for (let i = 0; i < data.datasetMetadata.length; i++)
if (CoreRESTClient.hasData(response))
{
for (let j = 0; j < data.filters.length; j++)
{
if (data.datasetMetadata[i].name == data.filters[j].name)
{
let filter = data.filters[j];
filter.type = data.datasetMetadata[i].type;
let data = CoreRESTClient.getData(response);
this.filterName = data.filterName;
this.dataset = data.dataset;
this.datasetMetadata = data.datasetMetadata;
this.filterFields.push(filter);
//break;
this.fields = data.fields;
this.selectedFields = data.selectedFields;
this.notSelectedFields = this.fields.filter(x => this.selectedFields.indexOf(x) === -1);
this.filterFields = [];
for (let i = 0; i < data.datasetMetadata.length; i++)
{
for (let j = 0; j < data.filters.length; j++)
{
if (data.datasetMetadata[i].name == data.filters[j].name)
{
let filter = data.filters[j];
filter.type = data.datasetMetadata[i].type;
this.filterFields.push(filter);
//break;
}
}
}
}
// If the side menu is active
if (this.sideMenu === true)
{
this.setSideMenu(data);
// If the side menu is active
if (this.sideMenu === true)
{
this.setSideMenu(data);
}
else // otherwise use the dropdown in the filter options
{
this.setDropDownMenu(data);
}
this.updateTabulator();
}
else // otherwise use the dropdown in the filter options
else
{
this.setDropDownMenu(data);
console.error(CoreRESTClient.getError(response));
}
this.updateTabulator();
},
/**
* Set the menu
*/
setSideMenu(data) {
setSideMenu: function(data) {
let filters = data.sideMenu.filters;
let personalFilters = data.sideMenu.personalFilters;
let filtersArray = [];
@@ -359,7 +370,7 @@ export const CoreFilterCmpt = {
/**
* Set the drop down menu
*/
setDropDownMenu(data) {
setDropDownMenu: function(data) {
let filters = data.sideMenu.filters;
let personalFilters = data.sideMenu.personalFilters;
let filtersArray = [];
@@ -395,7 +406,7 @@ export const CoreFilterCmpt = {
/**
* Used to start/refresh the FetchCmpt
*/
startFetchCmpt(apiFunction, apiFunctionParameters, dataFetchedCallback) {
startFetchCmpt: function(apiFunction, apiFunctionParameters, dataFetchedCallback) {
// Assign the function api of the FetchCmpt binded property
this.fetchCmptApiFunction = apiFunction;
@@ -421,11 +432,11 @@ export const CoreFilterCmpt = {
/**
*
*/
handlerSaveCustomFilter(customFilterName) {
handlerSaveCustomFilter: function(customFilterName) {
this.selectedFilter = null;
//
this.startFetchCmpt(
this.$fhcApi.factory.filter.saveCustomFilter,
CoreFilterAPIs.saveCustomFilter,
{
customFilterName
},
@@ -435,13 +446,13 @@ export const CoreFilterCmpt = {
/**
*
*/
handlerRemoveCustomFilter(event) {
handlerRemoveCustomFilter: function(event) {
let filterId = event.currentTarget.getAttribute("href").substring(1);
if (filterId === this.selectedFilter)
this.selectedFilter = null;
//
this.startFetchCmpt(
this.$fhcApi.factory.filter.removeCustomFilter,
CoreFilterAPIs.removeCustomFilter,
{
filterId: filterId
},
@@ -478,7 +489,7 @@ export const CoreFilterCmpt = {
applyFilterConfig(filterFields) {
this.selectedFilter = null;
this.startFetchCmpt(
this.$fhcApi.factory.filter.applyFilterFields,
CoreFilterAPIs.applyFilterFields,
{
filterFields
},
+1 -1
View File
@@ -21,7 +21,7 @@ import {CoreRESTClient} from '../../RESTClient.js';
const CORE_NAVIGATION_CMPT_TIMEOUT = 5000;
/**
* TODO(chris): deprecated
*
*/
export const CoreNavigationAPIs = {
/**
+24 -24
View File
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2024 fhcomplete.org
* Copyright (C) 2022 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
@@ -15,6 +15,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {CoreNavigationAPIs} from './API.js';
import {CoreRESTClient} from '../../RESTClient.js';
import {CoreFetchCmpt} from '../../components/Fetch.js';
/**
@@ -28,12 +30,12 @@ export const CoreNavigationCmpt = {
addHeaderMenuEntries: Object, // property used to add new header menu entries from another app/component
addSideMenuEntries: Object, // property used to add new side menu entries from another app/component
hideTopMenu: Boolean,
leftNavCssClasses: {
type: String,
default: 'navbar navbar-left-side'
}
leftNavCssClasses: {
type: String,
default: 'navbar navbar-left-side'
}
},
data() {
data: function() {
return {
headerMenu: {}, // header menu entries
sideMenu: {} // side menu entries
@@ -43,63 +45,61 @@ export const CoreNavigationCmpt = {
/**
*
*/
headerMenuEntries() {
headerMenuEntries: function() {
//
let hm = this.headerMenu ? {...this.headerMenu} : {};
if (this.headerMenu != null && this.addHeaderMenuEntries != null && Object.keys(this.addHeaderMenuEntries).length > 0)
{
hm[this.addHeaderMenuEntries.description] = this.addHeaderMenuEntries;
this.headerMenu[this.addHeaderMenuEntries.description] = this.addHeaderMenuEntries;
}
return hm;
return this.headerMenu;
},
/**
*
*/
sideMenuEntries() {
sideMenuEntries: function() {
//
let sm = this.sideMenu ? {...this.sideMenu} : {};
if (this.sideMenu != null && this.addSideMenuEntries != null && Object.keys(this.addSideMenuEntries).length > 0)
{
sm[this.addSideMenuEntries.description] = this.addSideMenuEntries;
this.sideMenu[this.addSideMenuEntries.description] = this.addSideMenuEntries;
}
return sm;
return this.sideMenu;
}
},
methods: {
/**
*
*/
getNavigationPage() {
getNavigationPage: function() {
return FHC_JS_DATA_STORAGE_OBJECT.called_path + "/" + FHC_JS_DATA_STORAGE_OBJECT.called_method;
},
/**
*
*/
fetchCmptApiFunctionHeader() {
return this.$fhcApi.factory.navigation.getHeader(this.getNavigationPage());
fetchCmptApiFunctionHeader: function() {
return CoreNavigationAPIs.getHeader(this.getNavigationPage());
},
/**
*
*/
fetchCmptApiFunctionSideMenu() {
return this.$fhcApi.factory.navigation.getMenu(this.getNavigationPage());
fetchCmptApiFunctionSideMenu: function() {
return CoreNavigationAPIs.getMenu(this.getNavigationPage());
},
/**
*
*/
fetchCmptDataFetchedHeader(data) {
this.headerMenu = data || {};
fetchCmptDataFetchedHeader: function(data) {
if (CoreRESTClient.hasData(data)) this.headerMenu = CoreRESTClient.getData(data);
},
/**
*
*/
fetchCmptDataFetchedMenu(data) {
this.sideMenu = data || {};
fetchCmptDataFetchedMenu: function(data) {
if (CoreRESTClient.hasData(data)) this.sideMenu = CoreRESTClient.getData(data);
},
/**
*
*/
getDataBsToggle(header) {
getDataBsToggle: function(header) {
return !header.children ? null : 'dropdown';
}
},
+7 -5
View File
@@ -1,3 +1,5 @@
import { ref, unref, triggerRef } from 'vue';
const categories = {};
const loadingModules = {};
@@ -12,8 +14,8 @@ function reloadRefs(category) {
while (loadingModules[category].length) {
var v = loadingModules[category].pop();
v[0].value = getValueForLoadedPhrase(category, v[1], v[2]);
Vue.triggerRef(v[0]);
/*Vue.unref(v);*/
triggerRef(v[0]);
/*unref(v);*/
}
}
function loadLazy(category, val, phrase, params) {
@@ -70,16 +72,16 @@ const phrasen = {
if (!categories[category] || Object.keys(categories[category]).length === 0) {
categories[category] = undefined;
let val = Vue.ref(initialval);
let val = ref(initialval);
loadLazy(category, val, phrase, params);
return val;
}
}
var result = getValueForLoadedPhrase(category, phrase, params);
return Vue.ref(result);
return ref(result);
},
t(category, phrase, params) {
return Vue.unref(this.t_ref(category, phrase, params));
return unref(this.t_ref(category, phrase, params));
}
};
+9 -5
View File
@@ -92,16 +92,24 @@
* @param mixed message
* @return void
*/
/*
import PvConfig from "../../../index.ci.php/public/js/components/primevue/config/config.esm.min.js";
import PvToast from "../../../index.ci.php/public/js/components/primevue/toast/toast.esm.min.js";
import PvConfirm from "../../../index.ci.php/public/js/components/primevue/confirmdialog/confirmdialog.esm.min.js";
import PvConfirmationService from "../../../index.ci.php/public/js/components/primevue/confirmationservice/confirmationservice.esm.min.js";
*/
import { createApp } from 'vue';
import PvConfig from 'primevue/config';
import PvToast from 'primevue/toast';
import PvConfirm from 'primevue/confirmdialog';
import PvConfirmationService from 'primevue/confirmationservice';
import {CoreRESTClient} from '../RESTClient.js';
const helperAppContainer = document.createElement('div');
const helperApp = Vue.createApp({
const helperApp = createApp({
components: {
PvToast,
PvConfirm
@@ -250,10 +258,6 @@ export default {
// Error is array of strings
if (Array.isArray(error) && error.every(err => typeof err === 'string'))
return error.every($fhcAlert.alertSystemError);
// Error has been handled already
if (error.hasOwnProperty('handled') && error.handled)
return;
// Error is object
if (typeof error === 'object' && error !== null) {
+19 -55
View File
@@ -1,5 +1,5 @@
import FhcAlert from './FhcAlert.js';
import FhcApiFactory from '../api/fhcapifactory.js';
import FhcApiFactory from '../apps/api/fhcapifactory.js';
export default {
@@ -100,13 +100,13 @@ export default {
// NOTE(chris): loop through errors
if (response.data.errors)
response.data.errors = response.data.errors.filter(
err => (response.config[err.type + 'ErrorHandler'] || app.config.globalProperties.$fhcApi._defaultErrorHandlers[err.type])(err, response.config)
err => (response.config[err.type + 'ErrorHandler'] || app.config.globalProperties.$fhcApi._defaultErrorHandlers[err.type])(err, response.config.form)
);
return _clean_return_value(response);
}, error => {
if (error.code == 'ERR_CANCELED')
return Promise.reject({...{handled: true}, ...error});
return new Promise(() => {});
if (error.config?.errorHandling == 'off'
|| error.config?.errorHandling === false
@@ -116,21 +116,21 @@ export default {
if (error.response) {
if (error.response.status == 404) {
app.config.globalProperties.$fhcAlert.alertDefault('error', error.message, error.request.responseURL, true);
return Promise.reject({...{handled: true}, ...error});
return new Promise(() => {});
}
// NOTE(chris): loop through errors
error.response.data.errors = error.response.data.errors.filter(
err => (error.config[err.type + 'ErrorHandler'] || app.config.globalProperties.$fhcApi._defaultErrorHandlers[err.type])(err, error.config)
err => (error.config[err.type + 'ErrorHandler'] || app.config.globalProperties.$fhcApi._defaultErrorHandlers[err.type])(err, error.config.form)
);
if (!error.response.data.errors.length)
return Promise.reject({...{handled: true}, ...error});
return new Promise(() => {});
} else if (error.request) {
app.config.globalProperties.$fhcAlert.alertDefault('error', error.message, error.request.responseURL);
return Promise.reject({...{handled: true}, ...error});
return new Promise(() => {});
} else {
app.config.globalProperties.$fhcAlert.alertError(error.message);
return Promise.reject({...{handled: true}, ...error});
return new Promise(() => {});
}
return Promise.reject(error);
@@ -152,47 +152,30 @@ export default {
return fhcApiAxios.post(uri, data, config);
},
_defaultErrorHandlers: {
validation(error, config) {
validation(error, form) {
const $fhcAlert = app.config.globalProperties.$fhcAlert;
if (config?.form) {
config.form.clearValidation();
config.form.setFeedback(false, error.messages);
if (form) {
form.clearValidation();
form.setFeedback(false, error.messages);
return false;
}
if (Array.isArray(error.messages)) {
error.messages.forEach($fhcAlert.alertError);
return false;
} else if (typeof error.messages == 'object') {
if (config?.errorHeader)
Object.values(error.messages).forEach(
value => $fhcAlert.alertDefault(
'error',
Array.isArray(config.errorHeader) ? app.config.globalProperties.$p.t.apply(null, config.errorHeader) : config.errorHeader,
value,
true
)
);
else
Object.entries(error.messages).forEach(
([key, value]) => $fhcAlert.alertDefault('error', key, value, true)
);
Object.entries(error.messages).forEach(
([key, value]) => $fhcAlert.alertDefault('error', key, value, true)
);
return false;
}
return true;
},
general(error, config) {
general(error, form) {
const $fhcAlert = app.config.globalProperties.$fhcAlert;
if (config?.form)
config.form.setFeedback(false, error.message);
else if (config?.errorHeader)
$fhcAlert.alertDefault(
'error',
Array.isArray(config.errorHeader) ? app.config.globalProperties.$p.t.apply(null, config.errorHeader) : config.errorHeader,
error.message,
true
);
if (form)
form.setFeedback(false, error.message);
else
$fhcAlert.alertError(error.message);
},
@@ -267,23 +250,6 @@ export default {
message += 'Line Number: ' + error.line + '\n';
$fhcAlert.alertSystemError(message);
},
auth(error, config) {
const $fhcAlert = app.config.globalProperties.$fhcAlert;
var message = '';
message += 'Controller name: ' + error.controller + '\n';
message += 'Method name: ' + error.method + '\n';
message += 'Required permissions: ' + error.required_permissions;
if (config?.errorHeader)
$fhcAlert.alertDefault(
'error',
Array.isArray(config.errorHeader) ? app.config.globalProperties.$p.t.apply(null, config.errorHeader) : config.errorHeader,
error.message,
true
);
else
$fhcAlert.alertDefault('error', error.message, message);
}
}
};
@@ -310,9 +276,7 @@ export default {
}
}
const mergedFhcApiFactory = options?.factory ? {...FhcApiFactory, ...options.factory} : FhcApiFactory;
app.config.globalProperties.$fhcApi.factory = new FhcApiFactoryWrapper(mergedFhcApiFactory);
app.config.globalProperties.$fhcApi.factory = new FhcApiFactoryWrapper(FhcApiFactory);
}
};
+13 -17
View File
@@ -1,6 +1,6 @@
import FhcApi from './FhcApi.js';
import { reactive, computed } from 'vue';
const categories = Vue.reactive({});
const categories = reactive({});
const loadingModules = {};
function extractCategory(obj, category) {
@@ -23,20 +23,21 @@ function getValueForLoadedPhrase(category, phrase, params) {
const phrasen = {
loadCategory(category) {
if (Array.isArray(category))
return Promise.all(category.map(this.config.globalProperties
.$p.loadCategory));
return Promise.all(category.map(cat => this.loadCategory(cat)));
if (!loadingModules[category])
loadingModules[category] = this.config.globalProperties
.$fhcApi.factory.phrasen.loadCategory(category)
.then(res => res?.data ? extractCategory(res.data, category) : {})
loadingModules[category] = axios
.get(FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/components/Phrasen/loadModule/' + category)
.then(res => {
categories[category] = res;
if (res.data.retval)
categories[category] = extractCategory(res.data.retval, category);
else
categories[category] = {};
});
return loadingModules[category];
},
t_ref(category, phrase, params) {
console.warn('deprecated');
return Vue.computed(() => this.t(category, phrase, params));
console.warn('depricated');
return computed(() => this.t(category, phrase, params));
},
t(category, phrase, params) {
if (params === undefined && (
@@ -50,7 +51,7 @@ const phrasen = {
console.error('invalid input', category, phrase, params);
return '';
}
let val = Vue.computed(() => {
let val = computed(() => {
if (!categories[category])
return '';
return getValueForLoadedPhrase(category, phrase, params);
@@ -63,11 +64,6 @@ const phrasen = {
export default {
install(app, options) {
app.use(FhcApi, options?.fhcApi || undefined);
app.config.globalProperties.$p = {
t: phrasen.t,
loadCategory: cat => phrasen.loadCategory.call(app, cat),
t_ref: phrasen.t_ref
};
app.config.globalProperties.$p = phrasen;
}
}
+20 -200
View File
@@ -34,22 +34,19 @@ require_once('../include/studiensemester.class.php');
require_once('../include/student.class.php');
require_once('../include/firma.class.php');
require_once('../include/note.class.php');
require_once('../include/studienplan.class.php');
require_once('../include/lehrveranstaltung.class.php');
require_once('../include/lehrform.class.php');
require_once('../include/sprache.class.php');
$datum = new datum();
$db = new basis_db();
if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
{
if(isset($_GET['uid']))
$uid = $_GET['uid'];
else
$uid = null;
$uid_arr = explode(";", $uid);
$uid_arr = explode(";",$uid);
echo "<?xml version='1.0' encoding='UTF-8' standalone='yes'?> ";
echo "<supplements>";
@@ -63,11 +60,9 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
vw_student.matrikelnr, vw_student.prestudent_id,
tbl_studiengang.bezeichnung, tbl_studiengang.english, tbl_studiengang.studiengang_kz,
tbl_studiengang.typ, tbl_studiengang.mischform, tbl_studiengang.max_semester,
tbl_studiengang.orgform_kurzbz, tbl_person.matr_nr
tbl_studiengang.orgform_kurzbz
FROM
campus.vw_student JOIN public.tbl_studiengang USING(studiengang_kz)
JOIN
public.tbl_person USING (person_id)
WHERE
uid = ".$db->db_add_param($uid_arr[$i]);
@@ -101,12 +96,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
echo ' <vornamen><![CDATA['.$row->vornamen.']]></vornamen>';
echo ' <name><![CDATA['.$row->vorname.' '.$row->nachname.']]></name>';
echo ' <geburtsdatum><![CDATA['.$datum->convertISODate($row->gebdatum).']]></geburtsdatum>';
//Print in Transcript of Record
echo ' <matrikelnummer>'.TRIM($row->matrikelnr).'</matrikelnummer>';
//Angaben zur Person /Information identifying the holder of the qualification
echo ' <matr_nr><![CDATA['.$row->matr_nr.']]></matr_nr>';
echo ' <studiengang_kz>'.$studiengang_kz.'</studiengang_kz>';
$prestudent = new prestudent($row->prestudent_id);
@@ -118,7 +108,6 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
{
$studiengangbezeichnung = $studienordnung->__get('studiengangbezeichnung');
$studiengangbezeichnung_englisch = $studienordnung->__get('studiengangbezeichnung_englisch');
$studienordnung_id =$studienordnung->__get('studienordnung_id');
}
}
$studiengang_bezeichnung = empty($studiengangbezeichnung) ? $row->bezeichnung : $studiengangbezeichnung;
@@ -126,7 +115,6 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
echo ' <studiengang_bezeichnung_deutsch><![CDATA['.$studiengang_bezeichnung.']]></studiengang_bezeichnung_deutsch>';
echo ' <studiengang_bezeichnung_englisch><![CDATA['.$studiengang_bezeichnung_englisch.']]></studiengang_bezeichnung_englisch>';
echo '<studienordnung_id>'.$studienordnung_id.'</studienordnung_id>';
$prestudent = new prestudent();
$prestudent->getFirstStatus($row->prestudent_id, 'Student');
@@ -138,12 +126,8 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
{
$angerechneteECTS=($semesterNumberStart-1)*30; // 30 ECTS pro Semester
echo ' <angerechnete_ects_quereinstieg>'.$angerechneteECTS.'</angerechnete_ects_quereinstieg>';
$end_semester_anrechnung = $semesterNumberStart - 1;
echo ' <start_semester_anrechnung_number>1</start_semester_anrechnung_number>';
echo ' <end_semester_anrechnung_number>'. $end_semester_anrechnung .'</end_semester_anrechnung_number>';
}
echo ' <start_semester>'.substr($prestudent->studiensemester_kurzbz, 2, 6).'</start_semester>';
echo ' <start_semester>'.substr($prestudent->studiensemester_kurzbz,2,6).'</start_semester>';
echo ' <start_semester_number>'.$prestudent->ausbildungssemester.'</start_semester_number>';
$prestudent->getLastStatus($row->prestudent_id, null);
$semesterNumberEnd = $prestudent->ausbildungssemester;
@@ -270,25 +254,6 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
break;
}
//Anforderungen durch Lernergebnisse des Studiums ersetzen
$addon_obj = new addon();
$addonStgAktiv = $addon_obj->checkActiveAddon("studiengangsverwaltung");
if($addonStgAktiv)
{
require_once('../addons/studiengangsverwaltung/include/qualifikationsziel.class.php');
$qualifikationsziel = new qualifikationsziel();
$qualifikationsziel->getAll($studienordnung_id);
if (isset($qualifikationsziel->result[0]))
{
$qualifikation_beschreibung = $qualifikationsziel->result[0]->data[1]->elements[0];
$qualifikation_beschreibung = json2odt($qualifikation_beschreibung);
echo "<lernergebnisse><![CDATA[$qualifikation_beschreibung]]></lernergebnisse>";
}
}
if($row->typ=='d')
{
echo ' <niveau_code>UNESCO ISCED 7</niveau_code>';
@@ -310,8 +275,8 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
echo ' <anforderungen_englisch><![CDATA[The program requires the positive completion of all courses (lectures, labs, seminars, project work, and integrated courses) to the extend of 30 ECTS per semester according to the curriculum. The program integrates technical, economical, management and personal study elements. The degree is awarded upon the successful completion of a Master´s Thesis and the final examination. The program (classification number '.$studiengang_kz.') is accredited by AQ Austria.]]></anforderungen_englisch>';
echo ' <zugangsberechtigung_deutsch><![CDATA[Der Abschluss des Masterstudiengangs berechtigt zu einem facheinschlägigen Doktoratsstudium an einer Universität (mit eventuellen Zusatzprüfungen).]]></zugangsberechtigung_deutsch>';
echo ' <zugangsberechtigung_englisch><![CDATA[The successful completion of the Master Degree Program qualifies the graduate to apply for admission to a relevant Doctoral Degree Program at a University (additional qualifying exams may be required). ]]></zugangsberechtigung_englisch>';
echo ' <niveau_deutsch>Masterstudium: UNESCO ISCED 7; Zuordnung nationaler Qualifikationsrahmen 7</niveau_deutsch>';
echo ' <niveau_englisch>Master degree program: UNESCO ISCED 7; Classification national qualification framework 7</niveau_englisch>';
echo ' <niveau_deutsch>Masterstudium (UNESCO ISCED 7)</niveau_deutsch>';
echo ' <niveau_englisch>Master degree program (UNESCO ISCED 7)</niveau_englisch>';
}
elseif($row->typ=='b')
{
@@ -322,8 +287,8 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
echo ' <anforderungen_englisch><![CDATA[The program requires the positive completion of all courses (lectures, labs, seminars, project work, and integrated courses) to the extend of 30 ECTS per semester according to the curriculum. The program integrates technical, economical, management and personal study elements. '.$anforderungen_praxiseng.' The degree is awarded upon the successful completion of 1 bachelor theses and the final examination. The program (classification number '.$studiengang_kz.') is accredited by AQ Austria.]]></anforderungen_englisch>';
echo ' <zugangsberechtigung_deutsch><![CDATA[Der Abschluss des Bachelorstudiengangs berechtigt zu einem facheinschlägigen Magister- bzw. Master-Studium an einer fachhochschulischen Einrichtung oder Universität (mit eventuellen Zusatzprüfungen).]]></zugangsberechtigung_deutsch>';
echo ' <zugangsberechtigung_englisch><![CDATA[The successful completion of the Bachelor Degree Program qualifies the graduate to apply for admission to a relevant Master Degree Program at a University of Applied Sciences or a University (additional qualifying exams may be required).]]></zugangsberechtigung_englisch>';
echo ' <niveau_deutsch>Bachelorstudium: UNESCO ISCED 6; Zuordnung nationaler Qualifikationsrahmen 6</niveau_deutsch>';
echo ' <niveau_englisch>Bachelor degree program: UNESCO ISCED 6; Classification national qualification framework 6</niveau_englisch>';
echo ' <niveau_deutsch>Bachelorstudium (UNESCO ISCED 6)</niveau_deutsch>';
echo ' <niveau_englisch>Bachelor degree program (UNESCO ISCED 6)</niveau_englisch>';
}
elseif($row->typ=='r')
{
@@ -364,9 +329,6 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
echo " <beurteilung_english>Not applicable within this curriculum.</beurteilung_english>";
}
echo " <zugangsber_reglementierte_berufe>Zugang zu reglementierten Berufen nach Maßgabe der berufsrechtlichen Vorschriften; Diplom im Sinne des Art.11 lit.c/d/e der Richtlinie 2005/36/EG über die Anerkennung von Berufsqualifikationen</zugangsber_reglementierte_berufe>";
echo " <zugangsber_reglementierte_berufe_englisch>Access to regulated professions according to professional regulations; diploma in the sense of Art.11 lit.(c)/(d)/(e) of directive 2005/36/EG</zugangsber_reglementierte_berufe_englisch>";
$qry = "SELECT * FROM lehre.tbl_akadgrad WHERE akadgrad_id=".$db->db_add_param($akadgrad_id);
$titel_de = '';
$titel_en = '';
@@ -449,7 +411,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
$abschlussbeurteilung='';
// Hole Datum der Sponsion -> wenn keine vorhanden nimm aktuelles datum
$qry = "SELECT
sponsion, tbl_abschlussbeurteilung.bezeichnung_english, datum, pruefungstyp_kurzbz, bezeichnung
sponsion, tbl_abschlussbeurteilung.bezeichnung_english, datum, pruefungstyp_kurzbz
FROM
lehre.tbl_abschlusspruefung
JOIN lehre.tbl_abschlussbeurteilung USING(abschlussbeurteilung_kurzbz)
@@ -469,13 +431,11 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
$sponsion_datum = $datum->formatDatum($row1->sponsion, 'd.m.Y');
$abschlusspruefungsdatum = $datum->formatDatum($row1->datum, 'd.m.Y');
$abschlussbeurteilung = $row1->bezeichnung_english;
$abschlussbeurteilung_deutsch = $row1->bezeichnung;
$pruefungstyp_kurzbz = $row1->pruefungstyp_kurzbz;
}
}
echo " <pruefungstyp_kurzbz>$pruefungstyp_kurzbz</pruefungstyp_kurzbz>";
echo " <abschlussbeurteilung>$abschlussbeurteilung</abschlussbeurteilung>";
echo " <abschlussbeurteilung_deutsch>$abschlussbeurteilung_deutsch</abschlussbeurteilung_deutsch>";
echo " <abschlusspruefungsdatum>$abschlusspruefungsdatum</abschlusspruefungsdatum>";
echo " <sponsion_datum>$sponsion_datum</sponsion_datum>";
@@ -618,41 +578,6 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
$ects_total = 0;
$ects_total_positiv = 0;
//Anrechnung Quereinsteiger
echo ' <anrechnungen>';
//Version Studienordnung
if($semesterNumberStart>1)
{
$maxSemester = $semesterNumberStart;
$summe_ects_orgform = 0;
$summe_sws_orgform = 0;
for($j = 1; $j <$maxSemester; $j++)
{
$summe_ects_semester = 0;
$summe_sws_semester = 0;
echo ' <stosemester>';
echo ' <stosemester_nr><![CDATA['.$j.']]></stosemester_nr>';
$lv = new lehrveranstaltung();
$lv->loadLehrveranstaltungStudienplan($studienplan_id, $j);
$tree = $lv->getLehrveranstaltungTree();
printLehrveranstaltungTree($tree);
//if ($lv->lehrtyp_kurzbz!='modul')
// $summe += $lv->ects;
echo ' <lv_summe_ects_semester><![CDATA['.$summe_ects_semester.']]></lv_summe_ects_semester>';
echo ' <lv_summe_sws_semester><![CDATA['.round($summe_sws_semester, 2).']]></lv_summe_sws_semester>';
$summe_ects_orgform += $summe_ects_semester;
$summe_sws_orgform += $summe_sws_semester;
echo '</stosemester>';
}
}
echo ' </anrechnungen>';
echo "<studiensemester>";
for($start = $semesterNumberStart; $start <= $semesterNumberEnd; $start++)
{
@@ -690,16 +615,16 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
// Array der Semester
$aktuellesSemester = $semester_kurzbz;
$semester = mb_substr($semester_kurzbz[0], 0, 2);
$year = mb_substr($semester_kurzbz[0], 2, 4);
$semester = mb_substr($semester_kurzbz[0],0,2);
$year = mb_substr($semester_kurzbz[0], 2,4);
if($semester == 'SS')
$semester_kurzbz = 'Summer Semester '.$year;
elseif($semester == 'WS')
else if($semester == 'WS')
{
$helpyear = mb_substr($year, 2, 2);
$helpyear = mb_substr($year, 2,2);
$helpyear +=1;
$helpyear = sprintf("%02d", $helpyear);
$helpyear = sprintf("%02d",$helpyear);
$semester_kurzbz = 'Winter Semester '.$year.'/'.$helpyear;
}
@@ -838,12 +763,11 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
if($result_lehrform = $db->db_query($qry_lehrform))
{
while($row_lehrform = $db->db_fetch_object($result_lehrform))
{
if($y != 0)
$lehrform_kurzbz = $lehrform_kurzbz.', '.$row_lehrform->lehrform_kurzbz;
else
$lehrform_kurzbz = $row_lehrform->lehrform_kurzbz;
$y++;
{ if($y != 0)
$lehrform_kurzbz = $lehrform_kurzbz.', '.$row_lehrform->lehrform_kurzbz;
else
$lehrform_kurzbz = $row_lehrform->lehrform_kurzbz;
$y++;
}
}
$arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['lehrform_kurzbz']= $lehrform_kurzbz;
@@ -867,7 +791,7 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml")
}
$datum = new datum();
$benotungsdatum = $datum->formatDatum($benotungsdatum, 'd/m/Y');
$benotungsdatum = $datum->formatDatum($benotungsdatum,'d/m/Y');
$arrayLvAusbildungssemester[$row_stud->lehrveranstaltung_id]['benotungsdatum']= $benotungsdatum;
$bezeichnung_englisch = $row_stud->bezeichnung_english;
@@ -1128,108 +1052,4 @@ function checkNote($note_alt, $note_neu)
return false;
}
//Funktionen für Andruck Studienordnung
function cmp($a, $b)
{
return strcmp($a->bezeichnung, $b->bezeichnung);
}
//newline \n durch string '\n' ersetzen (für Qualifikationsziele)
function json2odt($str)
{
$str = str_replace(array("\r\n", "\r", "\n"), '\n', $str);
return $str;
}
function printLehrveranstaltungTree($tree)
{
global $summe_ects_semester, $summe_sws_semester;
usort($tree, "cmp");
foreach($tree as $lv)
{
if ($lv->export)
{
$db = new basis_db();
$lv_alvs = new lehrveranstaltung();
if(!$alvs = $lv_alvs->getALVS($lv->lehrveranstaltung_id, $lv->semester))
$alvs = '';
//Semesterwochen zum berechnen der SWS ermitteln
$qry = ' SELECT
wochen
FROM
public.tbl_semesterwochen
WHERE
studiengang_kz='.$lv->studiengang_kz.'
AND
semester='.$lv->semester;
if($wochen_stg = $db->db_query($qry))
{
if($db->db_num_rows($wochen_stg)==1)
{
$row_wochen = $db->db_fetch_object($wochen_stg);
$wochen = $row_wochen->wochen;
}
else
$wochen = '15';
}
if ($lv->semesterstunden!='')
$sws = ($lv->semesterstunden / $wochen);
else
$sws = 0;
//Bezeichnung der Lehrform
$lehrform_kurzbz = new lehrform();
$lehrform_kurzbz->load($lv->lehrform_kurzbz);
//Klasse "sprache" instanzieren, um anschließend die Sprache(e.g. "German") in der richtigen Sprache zu bekommen("Deutsch")
$sp = new sprache();
echo ' <lehrveranstaltung>';
echo ' <lv_semester><![CDATA['.$lv->semester.']]></lv_semester>';
echo ' <lv_lehrtyp_kurzbz><![CDATA['.$lv->lehrtyp_kurzbz.']]></lv_lehrtyp_kurzbz>';
echo ' <lv_bezeichnung><![CDATA['.$lv->bezeichnung.']]></lv_bezeichnung>';
echo ' <lv_bezeichnung_en><![CDATA['.$lv->bezeichnung_english.']]></lv_bezeichnung_en>';
echo ' <lv_kurzbz><![CDATA['.$lv->kurzbz.']]></lv_kurzbz>';
echo ' <lv_lehrform_kurzbz><![CDATA['.$lv->lehrform_kurzbz.']]></lv_lehrform_kurzbz>';
echo ' <lv_lehrform_langbz><![CDATA['.$lehrform_kurzbz->bezeichnung.']]></lv_lehrform_langbz>';
echo ' <lv_gruppen><![CDATA[]]></lv_gruppen>';
echo ' <lv_ects><![CDATA['.$lv->ects.']]></lv_ects>';
echo ' <lv_semesterstunden><![CDATA['.$lv->semesterstunden.']]></lv_semesterstunden>';
echo ' <lv_sws><![CDATA['.$lv->sws.']]></lv_sws>';
echo ' <lv_lvs><![CDATA['.$lv->lvs.']]></lv_lvs>';
echo ' <lv_pflicht><![CDATA['.$lv->stpllv_pflicht.']]></lv_pflicht>';
echo ' <lv_studplan><![CDATA['.$lv->export.']]></lv_studplan>';
echo ' <lv_gen><![CDATA['.$lv->genehmigung.']]></lv_gen>';
echo ' <lv_anmerkung><![CDATA['.clearHtmlTags($lv->anmerkung).']]></lv_anmerkung>';
echo ' <lv_sprache><![CDATA['.$sp->getBezeichnung($lv->sprache, constant("DEFAULT_LANGUAGE")).']]></lv_sprache>';
//Wenn Modul verpflichtend und alle Childs frei wählbar, soll Modul für ects gezählt werden
$allChildsFree = true;
foreach ($lv->childs as $child)
{
if($child->stpllv_pflicht)
{
$allChildsFree = false;
}
}
if(($lv->lehrtyp_kurzbz!='modul' && $lv->stpllv_pflicht) || ($allChildsFree && $lv->lehrtyp_kurzbz=='modul' && $lv->stpllv_pflicht))
{
$summe_ects_semester += $lv->ects;
$summe_sws_semester += $sws;
}
// Darunterliegende LVs/Module
if(isset($lv->childs) && count($lv->childs)>0)
{
echo '<singlelehrveranstaltungen>';
printLehrveranstaltungTree($lv->childs, count($lv->childs));
echo '</singlelehrveranstaltungen>';
}
echo '</lehrveranstaltung>';
}
}
}
?>
+25
View File
@@ -0,0 +1,25 @@
***NVM installieren***
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
oder
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
***Node.js installieren***
nvm install --lts
***package.json***
npm install
***Rollup build***
einmalig:
npm run build
als watch bei Änderungen:
npm run watch
+99
View File
@@ -0,0 +1,99 @@
import babel from '@rollup/plugin-babel';
import nodeResolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import vue from "rollup-plugin-vue";
import { globSync } from 'glob';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import postcss from 'rollup-plugin-postcss';
import replace from '@rollup/plugin-replace';
import alias from '@rollup/plugin-alias';
import { existsSync } from 'node:fs';
import terser from '@rollup/plugin-terser';
import json from '@rollup/plugin-json';
function FhcResolver () {
return {
name: 'fhc-resolver', // this name will show up in logs and errors
resolveId ( source, importer, options ) {
if( source.includes('.php') ) {
return false;
}
//console.log('source: ' + source + ' options.isEntry: ' + options.isEntry + ' importer: ' + importer);
if(importer !== undefined && !options.isEntry && !path.isAbsolute(source)) {
let tmp = path.dirname(importer);
if( importer.includes('/application/') ) {
tmp = tmp.replace(/public\/js\//, 'js/').replace(/\/application\//, '/public/');
}
const resolved = path.resolve(tmp, source);
//console.log(resolved);
if( existsSync(resolved) ) {
return resolved
}
}
return null; // other ids should be handled as usually
}
};
}
export default {
input: Object.fromEntries(
globSync('public/**/js/apps/**/*.js', {follow: true, realpath: true}).map(file => {
if( path.dirname(file).includes('/dist/') || path.dirname(file).includes('/apps/vbform') ) {
return null;
}
// This remove `src/` as well as the file extension from each
// file, so e.g. src/nested/foo.js becomes nested/foo
return [path.relative(
'',
file.slice(0, file.length - path.extname(file).length)
).replace(/public\//, 'public/dist/'),
// This expands the relative paths to absolute paths, so e.g.
// src/nested/foo becomes /project/src/nested/foo.js
fileURLToPath(new URL(file, import.meta.url))]
}).filter(Boolean)
),
plugins: [
alias({
entries: {
vue: 'vue/dist/vue.esm-bundler.js'
}
}),
nodeResolve({
preferBuiltins: true,
moduleDirectories: ['node_modules'],
modulePaths: globSync('application/extensions/*/node_modules', {follow: true, realpath: true}).map(file =>
fileURLToPath(new URL(file, import.meta.url))
),
}),
FhcResolver(),
replace({
preventAssignment: true,
'process.env.NODE_ENV': JSON.stringify( 'production' ),
}),
commonjs(),
vue(),
json(),
babel({
babelHelpers: 'bundled',
plugins: ['transform-class-properties']
}),
postcss({
extract: false,
modules: true,
use: ['sass'],
}),
terser()
],
watch: {
buildDelay: 500
},
output: {
preserveModules: false,
sourcemap: true,
format: 'es',
dir: './',
//manualChunks: {}
chunkFileNames: 'public/dist/js/includes/[name]-[hash].js'
}
};
+106
View File
@@ -0,0 +1,106 @@
import babel from '@rollup/plugin-babel';
import nodeResolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import vue from "rollup-plugin-vue";
import { globSync } from 'glob';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import postcss from 'rollup-plugin-postcss';
import replace from '@rollup/plugin-replace';
import alias from '@rollup/plugin-alias';
import { existsSync } from 'node:fs';
import terser from '@rollup/plugin-terser';
import json from '@rollup/plugin-json';
function FhcResolver () {
return {
name: 'fhc-resolver', // this name will show up in logs and errors
resolveId ( source, importer, options ) {
if( source.includes('.php') ) {
return false;
}
//console.log('source: ' + source + ' options.isEntry: ' + options.isEntry + ' importer: ' + importer);
if(importer !== undefined && !options.isEntry && !path.isAbsolute(source)) {
let tmp = path.dirname(importer);
if( importer.includes('/application/') ) {
tmp = tmp.replace(/public\/js\//, 'js/').replace(/\/application\//, '/public/');
}
const resolved = path.resolve(tmp, source);
//console.log(resolved);
if( existsSync(resolved) ) {
return resolved
}
}
return null; // other ids should be handled as usually
}
};
}
const useplugins = [
alias({
entries: {
vue: 'vue/dist/vue.esm-bundler.js',
}
}),
commonjs(),
nodeResolve({
module: true,
jsnext: true,
preferBuiltins: true,
browser: true,
moduleDirectories: ['node_modules'],
modulePaths: globSync('application/extensions/*/node_modules', {follow: true, realpath: true}).map(file =>
fileURLToPath(new URL(file, import.meta.url))
),
}),
json({
compact: true
}),
FhcResolver(),
replace({
preventAssignment: true,
'process.env.NODE_ENV': JSON.stringify( 'production' ),
}),
vue(),
babel({
babelHelpers: 'bundled',
plugins: ['transform-class-properties'],
}),
/*
postcss({
extract: false,
modules: true,
use: ['sass'],
}),
*/
terser()
];
export default globSync('public/**/js/apps/**/*.js', {follow: true, realpath: true}).map(file => {
if( path.dirname(file).includes('/dist/') || path.dirname(file).includes('/apps/vbform') ) {
return null;
}
let tmp = fileURLToPath(new URL(file, import.meta.url));
let cssfile = path.basename(tmp.replace(/\.js/, '.css'));
console.log('cssfile: ' + cssfile);
let cssplugin = [
postcss({
extract: cssfile,
minimize: true,
sourceMap: true
})
];
return {
input: tmp,
plugins: [...useplugins, ...cssplugin],
watch: {
buildDelay: 500
},
output: {
preserveModules: false,
sourcemap: true,
format: 'es',
file: tmp.replace(/public\//, 'public/dist/'),
}
}
}).filter(Boolean);
-1
View File
@@ -54,7 +54,6 @@ require_once('dbupdate_3.4/21620_neues_feld_zum_erfassen_des_ESI.php');
require_once('dbupdate_3.4/36530_bis_internationsalisierung_codextabelle_neuerungen.php');
require_once('dbupdate_3.4/34543_ux_template.php');
require_once('dbupdate_3.4/17513_Entwicklungsteam.php');
require_once('dbupdate_3.4/39982_insertvon_updatevon_in_system_tbl_benutzerrolle.php');
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
@@ -1,170 +0,0 @@
<?php
if (! defined('DB_NAME')) exit('No direct script access allowed');
if($result = @$db->db_query("SELECT character_maximum_length FROM information_schema.columns WHERE column_name='insertvon' AND table_name='tbl_benutzerrolle' AND table_schema='system' AND character_maximum_length = 16;"))
{
if ($db->db_num_rows($result) === 1)
{
$second_result = @$db->db_query("SELECT view_definition FROM information_schema.views WHERE table_schema='system' AND table_name='vw_berechtigung_nichtrekursiv'");
if ($db->db_num_rows($second_result) === 1)
{
$qry = "DROP VIEW system.vw_berechtigung;
DROP VIEW system.vw_berechtigung_nichtrekursiv;";
if(!$db->db_query($qry))
echo '<strong>system.vw_berechtigung:'.$db->db_last_error().'</strong><br>';
else
{
$qry = "ALTER TABLE system.tbl_benutzerrolle
ALTER COLUMN insertvon TYPE varchar(32),
ALTER COLUMN updatevon TYPE varchar(32);";
if(!$db->db_query($qry))
echo '<strong>system.tbl_benutzerrolle: '.$db->db_last_error().'</strong><br>';
else
{
echo 'system.tbl_benutzerrolle: Spalte insertvon, updatevon auf 32 Zeichen verlaengert<br>';
$qry = "
CREATE OR REPLACE VIEW system.vw_berechtigung_nichtrekursiv AS
SELECT
uid, berechtigung_kurzbz,
-- art zusammenfassung und nur die nehmen die gleich sind
CASE WHEN length(art)>length(art1) THEN art1 ELSE art END as art,
oe_kurzbz, kostenstelle_id
FROM
(
-- Normal
SELECT
benutzerberechtigung_id, tbl_benutzerrolle.uid, tbl_benutzerrolle.funktion_kurzbz,
tbl_benutzerrolle.rolle_kurzbz, tbl_benutzerrolle.berechtigung_kurzbz, tbl_benutzerrolle.art, tbl_benutzerrolle.art art1,
tbl_benutzerrolle.oe_kurzbz, tbl_benutzerrolle.studiensemester_kurzbz, tbl_benutzerrolle.start,
tbl_benutzerrolle.ende, tbl_benutzerrolle.negativ, tbl_benutzerrolle.updateamum, tbl_benutzerrolle.updatevon,
tbl_benutzerrolle.insertamum, tbl_benutzerrolle.insertvon,tbl_benutzerrolle.kostenstelle_id,tbl_benutzerrolle.anmerkung
FROM
system.tbl_benutzerrolle JOIN system.tbl_berechtigung USING(berechtigung_kurzbz)
-- Rollen
UNION
SELECT
benutzerberechtigung_id, tbl_benutzerrolle.uid, tbl_benutzerrolle.funktion_kurzbz,
tbl_benutzerrolle.rolle_kurzbz, tbl_berechtigung.berechtigung_kurzbz, tbl_benutzerrolle.art, tbl_rolleberechtigung.art art1,
tbl_benutzerrolle.oe_kurzbz, tbl_benutzerrolle.studiensemester_kurzbz, tbl_benutzerrolle.start,
tbl_benutzerrolle.ende, tbl_benutzerrolle.negativ, tbl_benutzerrolle.updateamum, tbl_benutzerrolle.updatevon,
tbl_benutzerrolle.insertamum, tbl_benutzerrolle.insertvon,tbl_benutzerrolle.kostenstelle_id,tbl_benutzerrolle.anmerkung
FROM
system.tbl_benutzerrolle JOIN system.tbl_rolle USING(rolle_kurzbz)
JOIN system.tbl_rolleberechtigung USING(rolle_kurzbz)
JOIN system.tbl_berechtigung ON(tbl_rolleberechtigung.berechtigung_kurzbz=tbl_berechtigung.berechtigung_kurzbz)
-- Funktionen
UNION
SELECT
benutzerberechtigung_id, tbl_benutzerfunktion.uid, tbl_benutzerrolle.funktion_kurzbz,
tbl_benutzerrolle.rolle_kurzbz, tbl_benutzerrolle.berechtigung_kurzbz, tbl_benutzerrolle.art, tbl_benutzerrolle.art art1,
tbl_benutzerfunktion.oe_kurzbz, tbl_benutzerrolle.studiensemester_kurzbz, tbl_benutzerrolle.start,
tbl_benutzerrolle.ende, tbl_benutzerrolle.negativ, tbl_benutzerrolle.updateamum, tbl_benutzerrolle.updatevon,
tbl_benutzerrolle.insertamum, tbl_benutzerrolle.insertvon,tbl_benutzerrolle.kostenstelle_id,tbl_benutzerrolle.anmerkung
FROM
system.tbl_benutzerrolle JOIN public.tbl_benutzerfunktion USING(funktion_kurzbz)
WHERE
(tbl_benutzerfunktion.datum_von IS NULL OR tbl_benutzerfunktion.datum_von<=now())
AND (tbl_benutzerfunktion.datum_bis IS NULL OR tbl_benutzerfunktion.datum_bis>=now())
-- Funktion Mitarbeiter
UNION
SELECT
benutzerberechtigung_id, vw_mitarbeiter.uid, tbl_benutzerrolle.funktion_kurzbz,
tbl_benutzerrolle.rolle_kurzbz, tbl_benutzerrolle.berechtigung_kurzbz, tbl_benutzerrolle.art, tbl_benutzerrolle.art art1,
tbl_benutzerrolle.oe_kurzbz, tbl_benutzerrolle.studiensemester_kurzbz, tbl_benutzerrolle.start,
tbl_benutzerrolle.ende, tbl_benutzerrolle.negativ, tbl_benutzerrolle.updateamum, tbl_benutzerrolle.updatevon,
tbl_benutzerrolle.insertamum, tbl_benutzerrolle.insertvon,tbl_benutzerrolle.kostenstelle_id,tbl_benutzerrolle.anmerkung
FROM
system.tbl_benutzerrolle, campus.vw_mitarbeiter
WHERE
tbl_benutzerrolle.funktion_kurzbz='Mitarbeiter' and vw_mitarbeiter.aktiv
-- Funktion Student
UNION
SELECT
benutzerberechtigung_id, vw_student.uid, tbl_benutzerrolle.funktion_kurzbz,
tbl_benutzerrolle.rolle_kurzbz, tbl_benutzerrolle.berechtigung_kurzbz, tbl_benutzerrolle.art, tbl_benutzerrolle.art art1,
tbl_benutzerrolle.oe_kurzbz, tbl_benutzerrolle.studiensemester_kurzbz, tbl_benutzerrolle.start,
tbl_benutzerrolle.ende, tbl_benutzerrolle.negativ, tbl_benutzerrolle.updateamum, tbl_benutzerrolle.updatevon,
tbl_benutzerrolle.insertamum, tbl_benutzerrolle.insertvon,tbl_benutzerrolle.kostenstelle_id,tbl_benutzerrolle.anmerkung
FROM
system.tbl_benutzerrolle, campus.vw_student
WHERE
tbl_benutzerrolle.funktion_kurzbz='Student' and vw_student.aktiv
) as a
JOIN public.tbl_benutzer USING(uid)
WHERE
-- Datumsgrenzen beruecksichtigen
tbl_benutzer.aktiv = true
AND (a.start<=now() OR a.start is null)
AND (a.ende>=now() OR a.ende is null)
-- Neagtiv Rechte entfernen
AND not negativ
AND NOT EXISTS(SELECT
1
FROM
system.tbl_benutzerrolle JOIN system.tbl_berechtigung USING(berechtigung_kurzbz) WHERE uid=a.uid AND berechtigung_kurzbz=a.berechtigung_kurzbz AND negativ);
GRANT SELECT ON system.vw_berechtigung_nichtrekursiv TO web;
GRANT SELECT ON system.vw_berechtigung_nichtrekursiv TO vilesci;
CREATE OR REPLACE VIEW system.vw_berechtigung AS
WITH RECURSIVE oes(oe_kurzbz, pfad) as
(
SELECT
oe_kurzbz, '/' || oe_kurzbz::text as pfad FROM public.tbl_organisationseinheit
WHERE
oe_parent_kurzbz is null AND aktiv = true
UNION ALL
SELECT
o.oe_kurzbz, COALESCE(oes.pfad,'') || '/' || COALESCE(o.oe_kurzbz,'') as pfad
FROM
public.tbl_organisationseinheit o, oes
WHERE
o.oe_parent_kurzbz=oes.oe_kurzbz and aktiv = true
)
SELECT
uid, berechtigung_kurzbz, art, oes.oe_kurzbz, kostenstelle_id
FROM
system.vw_berechtigung_nichtrekursiv, oes
WHERE
(oes.pfad || '/' like '%/' || vw_berechtigung_nichtrekursiv.oe_kurzbz || '/%'
OR (vw_berechtigung_nichtrekursiv.oe_kurzbz is null AND kostenstelle_id is null))
UNION
SELECT
uid, berechtigung_kurzbz, art, null::varchar(32), kostenstelle_id
FROM
system.vw_berechtigung_nichtrekursiv
WHERE
kostenstelle_id is not null;
GRANT SELECT ON system.vw_berechtigung TO web;
GRANT SELECT ON system.vw_berechtigung TO vilesci;
";
if(!$db->db_query($qry))
echo '<strong>system.vw_berechtigung_nichtrekursiv:'.$db->db_last_error().'</strong><br>';
}
}
}
else
{
$qry = "ALTER TABLE system.tbl_benutzerrolle
ALTER COLUMN insertvon TYPE varchar(32),
ALTER COLUMN updatevon TYPE varchar(32);";
if(!$db->db_query($qry))
echo '<strong>system.tbl_benutzerrolle: '.$db->db_last_error().'</strong><br>';
else
echo 'system.tbl_benutzerrolle: Spalte insertvon, updatevon auf 32 Zeichen verlaengert<br>';
}
}
}
-60
View File
@@ -19947,26 +19947,6 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'suche',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Suche',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Search',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'studierendenantrag',
@@ -22931,46 +22911,6 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'person',
'phrase' => 'maennlich',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Männlich',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Male',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'person',
'phrase' => 'weiblich',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Weiblich',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Female',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'person',
+1 -1
View File
@@ -48,7 +48,7 @@ foreach ($cj->result as $cronjob)
if($cronjob->execute())
{
echo "\n".date('d.m.Y H:i:s').' '.$cronjob->titel.'('.$cronjob->cronjob_id.') executed<br>'."\n";
echo implode("\n",$cronjob->output);
echo implode($cronjob->output,"\n");
}
else
{
-152
View File
@@ -1,152 +0,0 @@
<?php
/* Copyright (C) 2024 Technikum-Wien
*
* 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 2 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, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
*/
/**
*
* Export von Projektlisten für HR
*/
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../include/zeitsperre.class.php');
require_once('../../include/person.class.php');
require_once('../../include/benutzer.class.php');
require_once('../../include/mitarbeiter.class.php');
require_once('../../include/datum.class.php');
require_once('../../include/benutzerberechtigung.class.php');
require_once('../../include/benutzerfunktion.class.php');
if (!$db = new basis_db())
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
$user = get_uid();
$datum = new datum();
//Rechte Pruefen
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($user);
if(!$rechte->isBerechtigt('mitarbeiter/zeitsperre'))
die($rechte->errormsg);
//Kopfzeile
echo '<html>
<head>
<title>Zeitsperren (Urlaube) der MitarbeiterInnen</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
<link rel="stylesheet" href="../../skin/jquery-ui-1.9.2.custom.min.css" type="text/css">';
include('../../include/meta/jquery.php');
include('../../include/meta/jquery-tablesorter.php');
echo ' <script type="text/javascript" src="../../include/js/jquery.ui.datepicker.translation.js"></script>
<script type="text/javascript" src="../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script language="Javascript">
$(document).ready(function()
{
$("#ma_name").autocomplete({
source: "../../cis/private/tools/zeitaufzeichnung_autocomplete.php?autocomplete=kunde",
minLength:2,
response: function(event, ui)
{
//Value und Label fuer die Anzeige setzen
for(i in ui.content)
{
ui.content[i].value=ui.content[i].uid;
ui.content[i].label=ui.content[i].vorname+" "+ui.content[i].nachname+" ("+ui.content[i].uid+")";
}
},
select: function(event, ui)
{
//Ausgeaehlte Ressource zuweisen und Textfeld wieder leeren
$("#ma_name").val(ui.item.uid);
}
});
$("#t1").tablesorter(
{
sortList: [[3,1]],
widgets: [\'zebra\', \'filter\'],
headers : { 3 : { sorter: "shortDate", dateFormat: "ddmmyyyy" },4 : { sorter: "shortDate", dateFormat: "ddmmyyyy" } }
});
$( ".datepicker_datum" ).datepicker({
changeMonth: true,
changeYear: true,
dateFormat: "dd.mm.yy",
});
})
</script>
</head>
<body class="Background_main">
<h2>Projektexport</h2>
Wähle einen Mitarbeiter und einen Zeitraum um die Projektliste für diesen Monat zu erstellen.<br /><br />
';
$redirect = basename($_SERVER['REQUEST_URI'], '?' . $_SERVER['QUERY_STRING']);
echo '<form accept-charset="UTF-8" action="../../cis/private/tools/zeitaufzeichnung_projektliste.php" method="GET" taget="_blank">
<table>
<tr>
<td>
User
</td>
<td>
<input type="text" id="ma_name" name="uid">
</td>
</tr>
<tr>
<td>Monat</td>
<td>
<select name="projexpmonat" >
<option value="1">Jänner</option>
<option value="2">Februar</option>
<option value="3">März</option>
<option value="4">April</option>
<option value="5">Mai</option>
<option value="6">Juni</option>
<option value="7">Juli</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">Oktober</option>
<option value="11">November</option>
<option value="12">Dezember</option>
</select>
</td>
</tr>
<tr>
<td>Jahr</td>
<td>
<input type="text" name="projexpjahr" value="'.date('Y').'" size="4"/>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Export" name="export">
</td>
</tr>
</table>
</form>';
echo '</body></html>';
?>
+1 -1
View File
@@ -218,7 +218,7 @@ $datum_obj = new datum();
echo ' <td><textarea name="beschreibung" cols="60" rows="5">'.htmlspecialchars($service->beschreibung).'</textarea></td>';
echo '</tr>';
echo '<tr>';
echo ' <td>Kritikalität&nbsp;</td>';
echo ' <td>Kategorie&nbsp;</td>';
echo ' <td>';
echo '<SELECT name="servicekategorie_kurzbz">';
echo '<OPTION value="">-- keine Auswahl --</OPTION>';
+1 -1
View File
@@ -126,7 +126,7 @@ echo '<table class="tablesorter" id="myTable">
<th>Bezeichnung</th>
<th>Beschreibung</th>
<th>Organisationseinheit</th>
<th>Kritikalität</th>
<th>Kategorie</th>
<th>Content ID</th>
<th>Design</th>
<th>Betrieb</th>