mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Merge branch 'master' into feature-69877/StudVw_Status_GrundAndAnmerkungEditable
This commit is contained in:
@@ -88,9 +88,14 @@ if (!defined('ZGV_DOKTOR_ANZEIGEN') || !ZGV_DOKTOR_ANZEIGEN) {
|
||||
);
|
||||
}
|
||||
|
||||
$config['tabs']['projektarbeit']['defaultProjektbetreuerStunden'] = '4.0';
|
||||
$config['tabs']['projektarbeit']['defaultProjektbetreuerStundenDiplom'] = '5.0';
|
||||
$config['tabs']['projektarbeit']['lvLektroinnenzuteilungFixangestelltStundensatz'] = true;
|
||||
$config['tabs']['projektarbeit']['defaultProjektbetreuerStunden'] =
|
||||
defined('FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_BACHELOR')
|
||||
? FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_BACHELOR
|
||||
: '0.0';
|
||||
$config['tabs']['projektarbeit']['defaultProjektbetreuerStundenDiplom'] =
|
||||
defined('FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_MASTER')
|
||||
? FAS_STUDIERENDE_PROJEKTARBEIT_DEFAULT_BETREUER_STUNDEN_MASTER
|
||||
: '0.0';
|
||||
$config['tabs']['projektarbeit']['defaultProjektbetreuerStundensatz'] = '80.0';
|
||||
|
||||
$config['student_tab_order'] = [
|
||||
@@ -119,6 +124,7 @@ $config['student_tab_order'] = [
|
||||
$config['students_tab_order'] = [
|
||||
'banking',
|
||||
'status',
|
||||
'messages',
|
||||
'groups',
|
||||
'finalexam',
|
||||
'combinePeople',
|
||||
|
||||
@@ -20,11 +20,18 @@ class NeueNachricht extends Auth_Controller
|
||||
*/
|
||||
public function _remap()
|
||||
{
|
||||
$typeid = $this->input->post('typeid');
|
||||
$ids = ($this->input->post('ids') && strpos($this->input->post('ids'), ','))
|
||||
? explode(',', $this->input->post('ids'))
|
||||
: $this->input->post('ids');
|
||||
|
||||
//now working
|
||||
$this->load->view('Nachrichten', [
|
||||
'permissions' => [
|
||||
'assistenz_schreibrechte' => $this->permissionlib->isBerechtigt('assistenz','suid'),
|
||||
]
|
||||
],
|
||||
'ids' => $ids,
|
||||
'typeid' => $typeid
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,6 +442,10 @@ class Documents extends FHCAPI_Controller
|
||||
'betreuerart_kurzbz',
|
||||
'studiensemester_kurzbz'
|
||||
] as $key) {
|
||||
if (in_array($xsl, array('Ausbildungsver', 'AusbVerEng')) && $key === 'uid')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$value = $this->input->post_get($key);
|
||||
if ($value !== null)
|
||||
$params .= '&' . $key . '=' . urlencode($value);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Messages extends FHCAPI_Controller
|
||||
@@ -14,6 +13,7 @@ class Messages extends FHCAPI_Controller
|
||||
'getMsgVarsPrestudent' => ['admin:r', 'assistenz:r'],
|
||||
'getMsgVarsLoggedInUser' => ['admin:r', 'assistenz:r'],
|
||||
'getNameOfDefaultRecipient' => ['admin:r', 'assistenz:r'],
|
||||
'getNameOfDefaultRecipients' => ['admin:r', 'assistenz:r'],
|
||||
'sendMessage' => ['admin:r', 'assistenz:r'],
|
||||
'deleteMessage' => ['admin:r', 'assistenz:r'],
|
||||
'getDataVorlage' => ['admin:r', 'assistenz:r'],
|
||||
@@ -21,6 +21,7 @@ class Messages extends FHCAPI_Controller
|
||||
'getReplyData' => ['admin:r', 'assistenz:r'],
|
||||
'getPersonId' => ['admin:r', 'assistenz:r'],
|
||||
'getUid' => ['admin:r', 'assistenz:r'],
|
||||
'getUids' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
//Load Models
|
||||
@@ -37,7 +38,7 @@ class Messages extends FHCAPI_Controller
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui'
|
||||
'ui', 'messages'
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -101,22 +102,49 @@ class Messages extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($vorlage);
|
||||
}
|
||||
|
||||
public function getMessageVarsPerson($id, $typeId)
|
||||
public function getMessageVarsPerson($typeId)
|
||||
{
|
||||
$person_id = ($typeId == 'mitarbeiter_uid') ? $this->_getPersonId($id, $typeId) : $id;
|
||||
$result = $this->MessageModel->getMsgVarsDataByPersonId($person_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$ids = $this->input->post('ids');
|
||||
$messageVarsPerson = [];
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$person_id = ($typeId == 'mitarbeiter_uid') ? $this->_getPersonId($id, $typeId) : $id;
|
||||
$result = $this->MessageModel->getMsgVarsDataByPersonId($person_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$messageVarsPerson[] = current($data);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($messageVarsPerson);
|
||||
}
|
||||
|
||||
public function getMsgVarsPrestudent($id, $typeId)
|
||||
public function getMsgVarsPrestudent($typeId)
|
||||
{
|
||||
$prestudent_id = ($typeId == 'uid') ? $this->_getPrestudentIdFromUid($id) : $id;
|
||||
$result = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudent_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$ids = $this->input->post('ids');
|
||||
if(!is_array($ids)) {
|
||||
$ids = array($ids);
|
||||
}
|
||||
$messageVarsPrestudent = [];
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
if($typeId == 'uid')
|
||||
{
|
||||
$prestudent_ids = [];
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$prestudent_ids[] = $this->_getPrestudentIdFromUid($id);
|
||||
}
|
||||
}
|
||||
else
|
||||
$prestudent_ids = $ids;
|
||||
|
||||
foreach ($prestudent_ids as $prestudent_id)
|
||||
{
|
||||
$result = $this->MessageModel->getMsgVarsDataByPrestudentId($prestudent_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$messageVarsPrestudent[] = current($data);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($messageVarsPrestudent);
|
||||
}
|
||||
|
||||
public function getMsgVarsLoggedInUser()
|
||||
@@ -127,27 +155,45 @@ class Messages extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getNameOfDefaultRecipient($id, $type_id)
|
||||
public function getNameOfDefaultRecipients($type_id)
|
||||
{
|
||||
$id = ($type_id != 'person_id') ? $this->_getPersonId($id, $type_id) : $id;
|
||||
$ids = $this->input->post('ids');
|
||||
if(!is_array($ids)) {
|
||||
$ids = array($ids);
|
||||
}
|
||||
$recipients = [];
|
||||
|
||||
if (empty($ids)) {
|
||||
|
||||
throw new InvalidArgumentException($this->p->t('ui', 'errorMissingOrInvalidParameters', ['parameter'=> 'Id(s)']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
if($type_id != 'person_id'){
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$person_id = $this->_getPersonId($id, $type_id);
|
||||
$result = $this->PersonModel->load($person_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$name = current($data);
|
||||
$recipients[$id] = $name->vorname . " " . $name->nachname;
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach ($ids as $id) {
|
||||
$result = $this->PersonModel->load($id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$name = current($data);
|
||||
$recipients[$id] = $name->vorname . " " . $name->nachname;
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->PersonModel->load($id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$name = current($data);
|
||||
|
||||
$this->terminateWithSuccess($name->vorname . " " . $name->nachname );
|
||||
$this->terminateWithSuccess($recipients);
|
||||
}
|
||||
|
||||
public function sendMessage($recipient_id)
|
||||
public function sendMessage($typeId)
|
||||
{
|
||||
//has to be uid
|
||||
// $this->terminateWithError("uid", $recipient_id, self::ERROR_TYPE_GENERAL);
|
||||
|
||||
//default setting
|
||||
$receiversPersonId = $this->_getPersonId($recipient_id, 'uid');
|
||||
|
||||
$resultReturn = [];
|
||||
$uid = getAuthUID();
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$result = $this->BenutzerModel->loadWhere(
|
||||
@@ -185,47 +231,61 @@ class Messages extends FHCAPI_Controller
|
||||
$body = $this->input->post('body');
|
||||
$relationmessage_id = $this->input->post('relationmessage_id');
|
||||
|
||||
$typeId = $this->input->post('type_id');
|
||||
$id = $this->input->post('id');
|
||||
|
||||
if($typeId == 'uid')
|
||||
if (isset($_POST['ids']))
|
||||
{
|
||||
$prestudent_id = $this-> _getPrestudentIdFromUid($id);
|
||||
|
||||
//parseMessagetext for variables Prestudent
|
||||
$result = $this->MessagesModel->parseMessageTextPrestudent($prestudent_id, $body);
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
if($typeId == 'mitarbeiter_uid')
|
||||
{
|
||||
$person_id = $this->_getPersonId($id, $typeId);
|
||||
|
||||
$result = $this->MessagesModel->parseMessageTextPerson($person_id, $body);
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithError($bodyParsed, self::ERROR_TYPE_GENERAL);
|
||||
|
||||
}
|
||||
elseif($typeId == 'person_id')
|
||||
{
|
||||
$result = $this->MessagesModel->parseMessageTextPerson($id, $body);
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
elseif($typeId == 'prestudent_id')
|
||||
{
|
||||
$result = $this->MessagesModel->parseMessageTextPrestudent($id, $body);
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithError("type_id " . $typeId . " not valid", self::ERROR_TYPE_GENERAL);
|
||||
$ids = json_decode($_POST['ids']);
|
||||
unset($_POST['ids']);
|
||||
foreach ($data as $k => $v) {
|
||||
$_POST[$k] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->messagelib->sendMessageUser($receiversPersonId, $subject, $bodyParsed, $benutzer->person_id, null, $relationmessage_id);
|
||||
if (!is_array($ids)) {
|
||||
$ids = [$ids];
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$receiversPersonId = $typeId == "person_id" ? $id : $this->_getPersonId($id, $typeId);
|
||||
|
||||
if($typeId == 'uid')
|
||||
{
|
||||
$prestudent_id = $this-> _getPrestudentIdFromUid($id);
|
||||
|
||||
$result = $this->MessagesModel->parseMessageTextPrestudent($prestudent_id, $body);
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
if($typeId == 'mitarbeiter_uid')
|
||||
{
|
||||
$person_id = $this->_getPersonId($id, $typeId);
|
||||
|
||||
$result = $this->MessagesModel->parseMessageTextPerson($person_id, $body);
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
elseif($typeId == 'person_id')
|
||||
{
|
||||
$result = $this->MessagesModel->parseMessageTextPerson($id, $body);
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
elseif($typeId == 'prestudent_id')
|
||||
{
|
||||
$result = $this->MessagesModel->parseMessageTextPrestudent($id, $body);
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $typeId]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result =$this->messagelib->sendMessageUser($receiversPersonId, $subject, $bodyParsed, $benutzer->person_id, null, $relationmessage_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$resultReturn[] = current($data);
|
||||
|
||||
}
|
||||
$this->terminateWithSuccess($resultReturn);
|
||||
}
|
||||
|
||||
public function getPreviewText($id, $type_id)
|
||||
public function getPreviewText($type_id)
|
||||
{
|
||||
if (isset($_POST['data']))
|
||||
{
|
||||
@@ -233,39 +293,60 @@ class Messages extends FHCAPI_Controller
|
||||
unset($_POST['data']);
|
||||
}
|
||||
else
|
||||
$this->terminateWithError("Textbody missing ", self::ERROR_TYPE_GENERAL);
|
||||
$this->terminateWithError($this->p->t('messages', 'errorMissingOrInvalidParameters', ['parameter'=> "Textbody"]), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
switch($type_id)
|
||||
if (isset($_POST['ids']))
|
||||
{
|
||||
case 'uid':
|
||||
$prestudent_id = $this->_getPrestudentIdFromUid($id);
|
||||
$result = $this->MessagesModel->parseMessageTextPrestudent($prestudent_id, $data);
|
||||
break;
|
||||
case 'prestudent_id':
|
||||
$result = $this->MessagesModel->parseMessageTextPrestudent($id, $data);
|
||||
break;
|
||||
case 'person_id':
|
||||
$result = $this->MessagesModel->parseMessageTextPerson($id, $data);
|
||||
break;
|
||||
case 'mitarbeiter_uid':
|
||||
{
|
||||
$person_id = $this->_getPersonId($id, $type_id);
|
||||
$result = $this->MessagesModel->parseMessageTextPerson($person_id, $data);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$this->terminateWithError("MESSAGES::getPreviewText logic for type_id " . $type_id . " not defined yet", self::ERROR_TYPE_GENERAL);
|
||||
break;
|
||||
$ids = json_decode($_POST['ids']);
|
||||
if(!is_array($ids))
|
||||
{
|
||||
$ids = array($ids);
|
||||
}
|
||||
unset($_POST['ids']);
|
||||
}
|
||||
else
|
||||
$this->terminateWithError($this->p->t('ui', 'errorMissingOrInvalidParameters', ['parameter'=> 'Id(s)']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$bodyParsed = $this->getDataOrTerminateWithError($result);
|
||||
$bodyParsed = [];
|
||||
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
switch($type_id)
|
||||
{
|
||||
case 'uid':
|
||||
$prestudent_id = $this->_getPrestudentIdFromUid($id);
|
||||
$result = $this->MessagesModel->parseMessageTextPrestudent($prestudent_id, $data);
|
||||
$bodyParsed[$id] = $this->getDataOrTerminateWithError($result);
|
||||
break;
|
||||
case 'prestudent_id':
|
||||
$result = $this->MessagesModel->parseMessageTextPrestudent($id, $data);
|
||||
$bodyParsed[$id] = $this->getDataOrTerminateWithError($result);
|
||||
break;
|
||||
case 'person_id':
|
||||
$result = $this->MessagesModel->parseMessageTextPerson($id, $data);
|
||||
$bodyParsed[$id] = $this->getDataOrTerminateWithError($result);
|
||||
break;
|
||||
case 'mitarbeiter_uid':
|
||||
{
|
||||
$person_id = $this->_getPersonId($id, $type_id);
|
||||
$result = $this->MessagesModel->parseMessageTextPerson($person_id, $data);
|
||||
$bodyParsed[$id] = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $type_id]), self::ERROR_TYPE_GENERAL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($bodyParsed);
|
||||
}
|
||||
|
||||
public function getReplyData($messageId)
|
||||
{
|
||||
//TODO(Manu) validation of messageId: if number
|
||||
if (!is_numeric($messageId)) {
|
||||
$this->terminateWithError($this->p->t('ui', 'error_valueNotNumeric', ['value'=> 'Message ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$this->MessageModel->addSelect('public.tbl_msg_message.*');
|
||||
$this->MessageModel->addSelect('r.*');
|
||||
@@ -288,7 +369,6 @@ class Messages extends FHCAPI_Controller
|
||||
$replyBody = $this->_getReplyBody($body, $dataMessage[0]->nachname, $dataMessage[0]->vorname, $dataMessage[0]->insertamum);
|
||||
|
||||
$dataMessage[0]->replyBody = $replyBody;
|
||||
$dataMessage[0]->rest = "Help Manu";
|
||||
$dataMessage[0]->replySubject = $prefix . $subject;
|
||||
|
||||
$this->terminateWithSuccess($dataMessage);
|
||||
@@ -336,6 +416,11 @@ class Messages extends FHCAPI_Controller
|
||||
['prestudent_id' => $id]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $typeId]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$person = current($data);
|
||||
@@ -343,8 +428,11 @@ class Messages extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($person->person_id);
|
||||
}
|
||||
|
||||
public function getUid($id, $typeId)
|
||||
public function getUids($typeId)
|
||||
{
|
||||
$ids = $this->input->post('ids');
|
||||
$benutzerIds = [];
|
||||
|
||||
if (!$typeId)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Type ID']), self::ERROR_TYPE_GENERAL);
|
||||
@@ -352,39 +440,50 @@ class Messages extends FHCAPI_Controller
|
||||
elseif ($typeId == 'person_id')
|
||||
{
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$result = $this->BenutzerModel->loadWhere(
|
||||
['person_id' => $id]
|
||||
);
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$result = $this->BenutzerModel->loadWhere(
|
||||
['person_id' => $id]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$benutzer = current($data);
|
||||
|
||||
$benutzerIds[$id] = $benutzer->uid;
|
||||
}
|
||||
}
|
||||
elseif($typeId == 'prestudent_id')
|
||||
{
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$result = $this->PrestudentModel->loadWhere(
|
||||
['prestudent_id' => $id]
|
||||
);
|
||||
foreach ($ids as $id)
|
||||
{
|
||||
$result = $this->PrestudentModel->loadWhere(
|
||||
['prestudent_id' => $id]
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$person = current($data);
|
||||
$person_id = $person->person_id;
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$person = current($data);
|
||||
$person_id = $person->person_id;
|
||||
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$result = $this->BenutzerModel->loadWhere(
|
||||
['person_id' => $person_id]
|
||||
);
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$result = $this->BenutzerModel->loadWhere(
|
||||
['person_id' => $person_id]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$benutzer = current($data);
|
||||
|
||||
$benutzerIds[$id] = $benutzer->uid;
|
||||
}
|
||||
}
|
||||
elseif($typeId == 'uid' || $typeId == 'mitarbeiter_uid')
|
||||
{
|
||||
$this->terminateWithSuccess($id);
|
||||
$this->terminateWithSuccess($ids);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithError("MESSAGES::getUID logic for type_id " . $typeId . " not defined yet", self::ERROR_TYPE_GENERAL);
|
||||
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $typeId]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$benutzer = current($data);
|
||||
|
||||
$this->terminateWithSuccess($benutzer->uid);
|
||||
$this->terminateWithSuccess($benutzerIds);
|
||||
}
|
||||
|
||||
private function _getPersonId($id, $typeId)
|
||||
@@ -403,11 +502,16 @@ class Messages extends FHCAPI_Controller
|
||||
['prestudent_id' => $id]
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithError($this->p->t('messages', 'error_missingLogic', ['type'=> $typeId]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
if (count($data) < 1)
|
||||
{
|
||||
$this->terminateWithError('Error: Messages API no person_id found.');
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Person ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$person = current($data);
|
||||
|
||||
@@ -416,7 +520,6 @@ class Messages extends FHCAPI_Controller
|
||||
|
||||
private function _getPrestudentIdFromUid($uid)
|
||||
{
|
||||
// $this->terminateWithError($uid, self::ERROR_TYPE_GENERAL);
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$result = $this->StudentModel->loadWhere(
|
||||
['student_uid' => $uid]
|
||||
@@ -425,7 +528,7 @@ class Messages extends FHCAPI_Controller
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
if (count($data) < 1)
|
||||
{
|
||||
$this->terminateWithError('Error: Messages API no prestudent_id found.');
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$student = current($data);
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Studienplan extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// TODO(chris): access!
|
||||
parent::__construct([
|
||||
'getBySemester' => self::PERM_LOGGED
|
||||
]);
|
||||
}
|
||||
|
||||
public function getBySemester()
|
||||
{
|
||||
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$studiensemester_kurzbz = $this->input->get('studiensemester_kurzbz');
|
||||
$ausbildungssemester = $this->input->get('ausbildungssemester') ?: null;
|
||||
$orgform_kurzbz = $this->input->get('orgform_kurzbz') ?: null;
|
||||
|
||||
if (!$studiengang_kz || !is_numeric($studiengang_kz))
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Studiengangskennzahl']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (!$studiensemester_kurzbz)
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Studiensemester']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (isset($ausbildungssemester) && !is_numeric($ausbildungssemester))
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Ausbildungssemester']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
//~ $this->load->library('form_validation');
|
||||
|
||||
//~ $this->form_validation->set_rules('studiengang_kz', 'StudiengangKz', 'required|numeric');
|
||||
//~ $this->form_validation->set_rules('studiensemester_kurzbz', 'StudiensemesterKurbz', 'required');
|
||||
//~ $this->form_validation->set_rules('ausbildungssemester', 'Ausbildungssemester', 'numeric');
|
||||
|
||||
//~ if (!$this->form_validation->run())
|
||||
//~ {
|
||||
//~ $this->addMeta('fail2', 'fail2');
|
||||
//~ return $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
//~ }
|
||||
|
||||
|
||||
$this->addMeta('stg_kz', $studiengang_kz);
|
||||
$this->addMeta('sem', $studiensemester_kurzbz);
|
||||
$this->addMeta('sem2', $ausbildungssemester);
|
||||
$this->addMeta('org', $orgform_kurzbz);
|
||||
|
||||
$result = $this->StudienplanModel->getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $ausbildungssemester, $orgform_kurzbz);
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
$this->terminateWithSuccess(hasData($result) ? getData($result) : []);
|
||||
}
|
||||
}
|
||||
@@ -365,7 +365,6 @@ class Config extends FHCAPI_Controller
|
||||
$result['messages'] = [
|
||||
'title' => $this->p->t('stv', 'tab_messages'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Messages.js'),
|
||||
'showOnlyWithUid' => true
|
||||
];
|
||||
|
||||
$result['grades'] = [
|
||||
@@ -515,6 +514,11 @@ class Config extends FHCAPI_Controller
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Kontaktieren.js'),
|
||||
];
|
||||
|
||||
$result['messages'] = [
|
||||
'title' => $this->p->t('stv', 'tab_messages'),
|
||||
'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/Messages.js'),
|
||||
];
|
||||
|
||||
Events::trigger('stv_conf_students', function & () use (&$result) {
|
||||
return $result;
|
||||
});
|
||||
|
||||
@@ -590,8 +590,8 @@ class Dokumente extends FHCAPI_Controller
|
||||
|
||||
$documents = [
|
||||
buildDropdownEntryPrintArray("accountinfo", "Accountinfoblatt", "xml=accountinfoblatt.xml.php&xsl=AccountInfo&output=pdf", $uid, 10, null),
|
||||
buildDropdownEntryPrintArray("ausbildungsvertrag", "Ausbildungsvertrag", "xml=ausbildungsvertrag.xml.php&xsl=Ausbildungsver&output=pdf", $uid, 20, null),
|
||||
buildDropdownEntryPrintArray("ausbildungsvertrag_en", "Ausbildungsvertrag Zweisprachig", "xml=ausbildungsvertrag.xml.php&xsl=AusbVerEng&output=pdf", $uid, 21, null),
|
||||
buildDropdownEntryPrintArray("ausbildungsvertrag", "Ausbildungsvertrag", "xml=ausbildungsvertrag.xml.php&xsl=Ausbildungsver&output=pdf&prestudent_id=$prestudent_id", null,20, null),
|
||||
buildDropdownEntryPrintArray("ausbildungsvertrag_en", "Ausbildungsvertrag Zweisprachig", "xml=ausbildungsvertrag.xml.php&xsl=AusbVerEng&output=pdf&prestudent_id=$prestudent_id", null,21, null),
|
||||
|
||||
buildDropdownEntryPrintArray("bescheid", "Bescheid (nur Voransicht)", "xml=abschlusspruefung.rdf.php&xsl_stg_kz=$studiengang_kz&xsl=Bescheid&output=pdf", $uid, 25, null),
|
||||
buildDropdownEntryPrintArray("diplomasupp", "Diploma Supplement (nur Voransicht)", "xml=diplomasupplement.xml.php&xsl_stg_kz=$studiengang_kz&xsl=DiplSupplement&output=pdf", $uid, 26, null),
|
||||
|
||||
@@ -17,7 +17,8 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
'getTypenProjektarbeit' => ['admin:r', 'assistenz:r'],
|
||||
'getFirmen' => ['admin:r', 'assistenz:r'],
|
||||
'getLehrveranstaltungen' => ['admin:r', 'assistenz:r'],
|
||||
'getNoten' => ['admin:r', 'assistenz:r']
|
||||
'getNoten' => ['admin:r', 'assistenz:r'],
|
||||
'getStudiensemester' => ['admin:r', 'assistenz:r']
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
@@ -40,11 +41,15 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('education/Note_model', 'NoteModel');
|
||||
$this->load->model('education/Projektbetreuer_model', 'BetreuerModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
// load libraries
|
||||
$this->load->library('PermissionLib');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get projekt works for a uid.
|
||||
*/
|
||||
public function getProjektarbeit()
|
||||
{
|
||||
$student_uid = $this->input->get('uid');
|
||||
@@ -53,10 +58,7 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
|
||||
$result = $this->ProjektarbeitModel->getProjektarbeit($student_uid);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (!hasData($result)) $this->terminateWithSuccess([]);
|
||||
|
||||
@@ -79,6 +81,9 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($projektarbeiten);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load a single Projektarbeit by id.
|
||||
*/
|
||||
public function loadProjektarbeit()
|
||||
{
|
||||
$projektarbeit_id = $this->input->get('projektarbeit_id');
|
||||
@@ -101,6 +106,9 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess(current($data));
|
||||
}
|
||||
|
||||
/**
|
||||
* Inwert a Projektarbeit.
|
||||
*/
|
||||
public function insertProjektarbeit()
|
||||
{
|
||||
$student_uid = $this->input->post('uid');
|
||||
@@ -128,6 +136,9 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a Projektarbeit by ID.
|
||||
*/
|
||||
public function updateProjektarbeit()
|
||||
{
|
||||
$projektarbeit_id = $this->input->post('projektarbeit_id');
|
||||
@@ -157,6 +168,9 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Projektarbeit by ID after validation.
|
||||
*/
|
||||
public function deleteProjektarbeit()
|
||||
{
|
||||
$projektarbeit_id = $this->input->post('projektarbeit_id');
|
||||
@@ -185,6 +199,9 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
return $this->terminateWithSuccess(current(getData($result)) ? : null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all active projekt work types.
|
||||
*/
|
||||
public function getTypenProjektarbeit()
|
||||
{
|
||||
$result = $this->ProjekttypModel->loadWhere(['aktiv' => true]);
|
||||
@@ -194,6 +211,9 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
return $this->terminateWithSuccess(hasData($result) ? getData($result) : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets companies by search string.
|
||||
*/
|
||||
public function getFirmen()
|
||||
{
|
||||
$searchString = $this->input->get('searchString');
|
||||
@@ -208,6 +228,9 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
return $this->terminateWithSuccess(hasData($result) ? getData($result) : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Lehrveranstaltungen by params, incling lehreinheiten for a specific Studiensemester..
|
||||
*/
|
||||
public function getLehrveranstaltungen()
|
||||
{
|
||||
$student_uid = $this->input->get('student_uid');
|
||||
@@ -218,6 +241,7 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
if (!isset($student_uid)) $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Student UID']), self::ERROR_TYPE_GENERAL);
|
||||
if (!isset($studiensemester_kurzbz)) $this->terminateWithError('Studiensemster missing', self::ERROR_TYPE_GENERAL);
|
||||
|
||||
// get Lvs
|
||||
$lvsResult = $this->LehrveranstaltungModel->getLvsForProjektarbeit($student_uid, $studiengang_kz, $additional_lehrveranstaltung_id);
|
||||
|
||||
if (isError($lvsResult)) return $this->terminateWithError($lvsResult, self::ERROR_TYPE_GENERAL);
|
||||
@@ -226,6 +250,7 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
|
||||
foreach ($lvs as $lv)
|
||||
{
|
||||
// add Lehreinheiten for each Lv for the semester
|
||||
$lehreinheiten = $this->LehreinheitModel->getLesForLv(
|
||||
$lv->lehrveranstaltung_id, $studiensemester_kurzbz
|
||||
);
|
||||
@@ -250,6 +275,9 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
return $this->terminateWithSuccess($lvs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all noten.
|
||||
*/
|
||||
public function getNoten()
|
||||
{
|
||||
$result = $this->NoteModel->load();
|
||||
@@ -260,9 +288,22 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return object success or error
|
||||
* Get all Studiensemester, sorted.
|
||||
*/
|
||||
public function getStudiensemester()
|
||||
{
|
||||
$this->StudiensemesterModel->addOrder('start', 'DESC');
|
||||
$result = $this->StudiensemesterModel->load();
|
||||
|
||||
if (isError($result)) return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
return $this->terminateWithSuccess(hasData($result) ? getData($result) : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate Projektarbeit data.
|
||||
* @param formData
|
||||
* @return bool true if data valid
|
||||
*/
|
||||
private function _validate($formData)
|
||||
{
|
||||
@@ -293,9 +334,9 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return object success or error
|
||||
* Extract Projektarbeit data from passed form data.
|
||||
* @param formData
|
||||
* @return array
|
||||
*/
|
||||
private function _getProjektarbeitArr($formData)
|
||||
{
|
||||
@@ -317,9 +358,9 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return object success or error
|
||||
* Check if deletion of a Projektarbeit is possible.
|
||||
* @param $projektarbeit_id
|
||||
* @return object success if deletion possible, error otherwise.
|
||||
*/
|
||||
private function _validateDelete($projektarbeit_id)
|
||||
{
|
||||
@@ -340,6 +381,11 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks permissions for a student.
|
||||
* @param $student_uid
|
||||
* @return bool true if authorized
|
||||
*/
|
||||
private function _hasBerechtigungForStudent($student_uid)
|
||||
{
|
||||
if (!$student_uid)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
use CI3_Events as Events;
|
||||
use \CI3_Events as Events;
|
||||
|
||||
class Projektbetreuer extends FHCAPI_Controller
|
||||
{
|
||||
@@ -43,6 +43,9 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
$this->load->library('PermissionLib');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Projektbetreuer data for a Projektarbeit.
|
||||
*/
|
||||
public function getProjektbetreuer()
|
||||
{
|
||||
$projektarbeit_id = $this->input->get('projektarbeit_id');
|
||||
@@ -50,21 +53,30 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
if (!isset($projektarbeit_id))
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Projektarbeit ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->ProjektbetreuerModel->addSelect(
|
||||
'projektarbeit_id, person_id, nachname, vorname, note, punkte, round(stunden, 1) AS stunden,
|
||||
stundensatz, betreuerart_kurzbz, vertrag_id, titelpre, titelpost'
|
||||
);
|
||||
$this->ProjektbetreuerModel->addSelect("CASE
|
||||
WHEN EXISTS
|
||||
(SELECT 1 FROM public.tbl_benutzer JOIN public.tbl_mitarbeiter ON(uid=mitarbeiter_uid) WHERE person_id=pers.person_id)
|
||||
THEN 'Mitarbeiter'
|
||||
WHEN EXISTS
|
||||
(SELECT 1 FROM public.tbl_benutzer JOIN public.tbl_student ON(uid=student_uid) WHERE person_id=pers.person_id)
|
||||
THEN 'Student'
|
||||
ELSE 'Person'
|
||||
END AS status");
|
||||
$this->ProjektbetreuerModel->addJoin('public.tbl_person pers', 'person_id');
|
||||
$result = $this->ProjektbetreuerModel->loadWhere(['projektarbeit_id' => $projektarbeit_id]);
|
||||
$qry = "
|
||||
SELECT * FROM (
|
||||
SELECT
|
||||
projektarbeit_id, person_id, nachname, vorname, note, punkte, round(stunden, 1) AS stunden,
|
||||
stundensatz, betreuerart_kurzbz, vertrag_id, titelpre, titelpost,
|
||||
CASE
|
||||
WHEN EXISTS
|
||||
(SELECT 1 FROM public.tbl_benutzer JOIN public.tbl_mitarbeiter ON(uid=mitarbeiter_uid) WHERE person_id=pers.person_id)
|
||||
THEN 'Mitarbeiter'
|
||||
WHEN EXISTS
|
||||
(SELECT 1 FROM public.tbl_benutzer JOIN public.tbl_student ON(uid=student_uid) WHERE person_id=pers.person_id)
|
||||
THEN 'Student'
|
||||
ELSE 'Person'
|
||||
END AS status
|
||||
FROM
|
||||
lehre.tbl_projektbetreuer
|
||||
JOIN public.tbl_person pers USING (person_id)
|
||||
WHERE
|
||||
projektarbeit_id = ?
|
||||
) betreuer
|
||||
ORDER BY
|
||||
CASE WHEN status = 'Mitarbeiter' THEN 0 WHEN status = 'Person' THEN 1 ELSE 2 END";
|
||||
|
||||
$result = $this->ProjektbetreuerModel->execReadOnlyQuery($qry, [$projektarbeit_id]);
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
@@ -86,6 +98,7 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
//~ }
|
||||
//~ }
|
||||
|
||||
// add thesis download link (from external extension)
|
||||
foreach ($projektbetreuer as $pb)
|
||||
{
|
||||
$downloadLink = null;
|
||||
@@ -104,6 +117,9 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($this->_addFullNameToBetreuer($projektbetreuer));
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves (adds or updates) a single Projektbetreuer for a Projektarbeit.
|
||||
*/
|
||||
public function saveProjektbetreuer()
|
||||
{
|
||||
$projektarbeit_id = $this->input->post('projektarbeit_id');
|
||||
@@ -118,14 +134,36 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
|
||||
if ($this->_validate($projektbetreuer) == false) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// check if assessor has already been assigned
|
||||
if (isset($projektbetreuer['person_id']))
|
||||
{
|
||||
$this->ProjektbetreuerModel->addSelect('1');
|
||||
$betreuerRes = $this->ProjektbetreuerModel->loadWhere(
|
||||
[
|
||||
'person_id' => $projektbetreuer['person_id'],
|
||||
'projektarbeit_id' => $projektbetreuer['projektarbeit_id'],
|
||||
'betreuerart_kurzbz' => $projektbetreuer['betreuerart_kurzbz']
|
||||
]
|
||||
);
|
||||
|
||||
if (hasData($betreuerRes)
|
||||
&& (!isset($projektbetreuer['person_id_old']) || $projektbetreuer['person_id'] != $projektbetreuer['person_id_old'])) {
|
||||
return $this->terminateWithError($this->p->t('projektarbeit', 'betreuerZugewiesen'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
|
||||
$result = null;
|
||||
|
||||
$stunden = isset($projektbetreuer['stunden']) && !isEmptyString($projektbetreuer['stunden']) ? $projektbetreuer['stunden'] : null;
|
||||
$stundensatz =
|
||||
isset($projektbetreuer['stundensatz']) && !isEmptyString($projektbetreuer['stundensatz']) ? $projektbetreuer['stundensatz'] : null;
|
||||
|
||||
$betreuer = [
|
||||
'projektarbeit_id' => $projektarbeit_id,
|
||||
'person_id' => $projektbetreuer['person_id'],
|
||||
'note' => $projektbetreuer['note'],
|
||||
'stunden' => $projektbetreuer['stunden'],
|
||||
'stundensatz' => $projektbetreuer['stundensatz'],
|
||||
'stunden' => $stunden,
|
||||
'stundensatz' => $stundensatz,
|
||||
'betreuerart_kurzbz' => $projektbetreuer['betreuerart_kurzbz']
|
||||
];
|
||||
|
||||
@@ -152,6 +190,9 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess(hasData($result) ? getData($result) : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a Projektbetreuer assignment to a Projektarbeit.
|
||||
*/
|
||||
public function deleteProjektbetreuer()
|
||||
{
|
||||
$projektarbeit_id = $this->input->post('projektarbeit_id');
|
||||
@@ -159,21 +200,44 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
$betreuerart_kurzbz = $this->input->post('betreuerart_kurzbz');
|
||||
|
||||
if (!isset($projektarbeit_id) || !is_numeric($projektarbeit_id))
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> $this->p->t('projektarbeit', 'projektarbeit').' ID'], self::ERROR_TYPE_GENERAL));
|
||||
{
|
||||
return $this->terminateWithError(
|
||||
$this->p->t('ui', 'error_missingId', ['id'=> $this->p->t('projektarbeit', 'projektarbeit').' ID'], self::ERROR_TYPE_GENERAL)
|
||||
);
|
||||
}
|
||||
|
||||
if (!isset($person_id) || !is_numeric($person_id))
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Person ID'], self::ERROR_TYPE_GENERAL));
|
||||
|
||||
if (!isset($betreuerart_kurzbz))
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> $this->p->t('projektarbeit', 'betreuerart')], self::ERROR_TYPE_GENERAL));
|
||||
{
|
||||
return $this->terminateWithError(
|
||||
$this->p->t('ui', 'error_missingId', ['id'=> $this->p->t('projektarbeit', 'betreuerart')], self::ERROR_TYPE_GENERAL)
|
||||
);
|
||||
}
|
||||
|
||||
// check permission
|
||||
if (!$this->ProjektarbeitModel->hasBerechtigungForProjektarbeit($projektarbeit_id))
|
||||
return $this->_outputAuthError([$this->router->method => ['admin:rw', 'assistenz:rw']]);
|
||||
|
||||
$validate = $this->_validateDelete($projektarbeit_id, $person_id);
|
||||
$validate = $this->_validateDelete($projektarbeit_id, $person_id, $betreuerart_kurzbz);
|
||||
|
||||
if (isError($validate)) return $this->terminateWithError(getError($validate), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
// check if there is a Projektarbeitsbeurteilung - if yes, it is handled (possibly deleted) by external extension.
|
||||
$beurteilungDeleteSuccess = true;
|
||||
|
||||
Events::trigger(
|
||||
'projektarbeitsbeurteilung_delete',
|
||||
$projektarbeit_id,
|
||||
function ($value) use (&$beurteilungDeleteSuccess) {
|
||||
$beurteilungDeleteSuccess = $value;
|
||||
}
|
||||
);
|
||||
|
||||
// if there is still a Beurteilung, Projektarbeit cannot be deleted - return with error
|
||||
if (!$beurteilungDeleteSuccess) return $this->terminateWithError($this->p->t('projektarbeit', 'error_paarbeitHatBeurteilung'));
|
||||
|
||||
$result = $this->ProjektbetreuerModel->delete(
|
||||
['projektarbeit_id' => $projektarbeit_id, 'person_id' => $person_id, 'betreuerart_kurzbz' => $betreuerart_kurzbz]
|
||||
);
|
||||
@@ -185,9 +249,12 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
return $this->terminateWithSuccess(current(getData($result)) ? : null);
|
||||
return $this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all active Betreuerarten.
|
||||
*/
|
||||
public function getBetreuerarten()
|
||||
{
|
||||
$result = $this->BetreuerartModel->loadWhere(['aktiv' => true]);
|
||||
@@ -197,6 +264,9 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
return $this->terminateWithSuccess(hasData($result) ? getData($result) : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Noten.
|
||||
*/
|
||||
public function getNoten()
|
||||
{
|
||||
$result = $this->NoteModel->load();
|
||||
@@ -206,6 +276,9 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
return $this->terminateWithSuccess(hasData($result) ? getData($result) : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get default Stundensätze for an employee in a semester.
|
||||
*/
|
||||
public function getDefaultStundensaetze()
|
||||
{
|
||||
$person_id = $this->input->get('person_id');
|
||||
@@ -216,6 +289,9 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
return $this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Projektbetreuer by search string.
|
||||
*/
|
||||
public function getProjektbetreuerBySearchQuery()
|
||||
{
|
||||
$searchString = $this->input->get('searchString');
|
||||
@@ -227,9 +303,23 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
|
||||
if (isError($result)) return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
return $this->terminateWithSuccess(hasData($result) ? $this->_addFullNameToBetreuer(getData($result)) : []);
|
||||
if (!hasData($result)) $this->terminateWithSuccess([]);
|
||||
|
||||
$persons = $this->_addFullNameToBetreuer(getData($result));
|
||||
|
||||
// sort persons by type (employees first)
|
||||
usort($persons, function ($a, $b) {
|
||||
$statusRanks = ['Mitarbeiter' => 0, 'Person' => 1, 'Student' => 2];
|
||||
return (isset($statusRanks[$a->status]) ? $statusRanks[$a->status] : count($statusRanks) + 1)
|
||||
- (isset($statusRanks[$b->status]) ? $statusRanks[$b->status] : count($statusRanks) + 1);
|
||||
});
|
||||
|
||||
return $this->terminateWithSuccess($persons);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get person info by Id.
|
||||
*/
|
||||
public function getPerson()
|
||||
{
|
||||
$person_id = $this->input->get('person_id');
|
||||
@@ -255,9 +345,7 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return object success or error
|
||||
* Validate list of Projektbetreuer.
|
||||
*/
|
||||
public function validateProjektbetreuer()
|
||||
{
|
||||
@@ -277,9 +365,9 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return object success or error
|
||||
* Validation funciton for checking Projektbetreuer input.
|
||||
* @param $formData Betreuer data
|
||||
* @return bool true when data is valid
|
||||
*/
|
||||
private function _validate($formData)
|
||||
{
|
||||
@@ -306,26 +394,32 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return object success or error
|
||||
* Check possibility of deletion of a Projektbetreuer.
|
||||
* @param projektarbeit_id
|
||||
* @param person_id
|
||||
* @param betreuerart_kurzbz
|
||||
* @return object success when delete possible, error otherwise
|
||||
*/
|
||||
private function _validateDelete($projektarbeit_id, $person_id)
|
||||
private function _validateDelete($projektarbeit_id, $person_id, $betreuerart_kurzbz)
|
||||
{
|
||||
// check if contract exists
|
||||
$this->ProjektbetreuerModel->addSelect('vertrag_id');
|
||||
$result = $this->ProjektbetreuerModel->loadWhere(['projektarbeit_id' => $projektarbeit_id, 'person_id' => $person_id]);
|
||||
$result = $this->ProjektbetreuerModel->loadWhere(
|
||||
['projektarbeit_id' => $projektarbeit_id, 'person_id' => $person_id, 'betreuerart_kurzbz' => $betreuerart_kurzbz]
|
||||
);
|
||||
|
||||
if (isError($result)) return $result;
|
||||
|
||||
// if contract exists, no deletion is possible
|
||||
if (hasData($result) && getData($result)[0]->vertrag_id != null) return error($this->p->t('projektarbeit', 'error_betreuerHatVertrag'));
|
||||
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return object success or error
|
||||
* Add full name to array with Betreuer.
|
||||
* @param $betreuerArr
|
||||
* @return array including Betreuer with their full names
|
||||
*/
|
||||
private function _addFullNameToBetreuer($betreuerArr)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ class Student extends FHCAPI_Controller
|
||||
'get' => ['admin:r', 'assistenz:r'],
|
||||
'save' => ['admin:rw', 'assistenz:rw'],
|
||||
'saveStudent' => ['admin:rw', 'assistenz:rw'],
|
||||
'check' => ['admin:rw', 'assistenz:rw'],
|
||||
'getPerson' => ['admin:rw', 'assistenz:rw'],
|
||||
'add' => ['admin:rw', 'assistenz:rw'] // TODO(chris): extra permissions
|
||||
]);
|
||||
|
||||
@@ -159,9 +159,9 @@ class Student extends FHCAPI_Controller
|
||||
'LEFT');*/
|
||||
|
||||
$result = $this->PrestudentModel->loadWhere(['tbl_prestudent.prestudent_id' => $prestudent_id]);
|
||||
|
||||
|
||||
$student = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
|
||||
if (!$student)
|
||||
return show_404();
|
||||
|
||||
@@ -221,7 +221,7 @@ class Student extends FHCAPI_Controller
|
||||
]);
|
||||
|
||||
$this->load->library('UDFLib');
|
||||
|
||||
|
||||
$result = $this->udflib->getCiValidations($this->PersonModel, $this->input->post());
|
||||
|
||||
$udf_field_validations = $this->getDataOrTerminateWithError($result);
|
||||
@@ -232,7 +232,7 @@ class Student extends FHCAPI_Controller
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$result = $this->StudentModel->loadWhere(['prestudent_id' => $prestudent_id]);
|
||||
|
||||
|
||||
$student = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$uid = $student ? current($student)->student_uid : null;
|
||||
@@ -245,7 +245,6 @@ class Student extends FHCAPI_Controller
|
||||
|
||||
$person_id = $person ? current($person)->person_id : null;
|
||||
|
||||
|
||||
$array_allowed_props_lehrverband = ['verband', 'semester', 'gruppe'];
|
||||
$update_lehrverband = array();
|
||||
foreach ($array_allowed_props_lehrverband as $prop) {
|
||||
@@ -305,7 +304,7 @@ class Student extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
$array_allowed_props_student = ['matrikelnr'];
|
||||
if($this->isLaufendesSemester($studiensemester_kurzbz))
|
||||
if($this->isLaufendesSemester($studiensemester_kurzbz))
|
||||
{
|
||||
$array_allowed_props_student = ['matrikelnr', 'verband', 'semester', 'gruppe'];
|
||||
}
|
||||
@@ -462,7 +461,7 @@ class Student extends FHCAPI_Controller
|
||||
return $this->save($student->prestudent_id, $studiensemester_kurzbz);
|
||||
}
|
||||
|
||||
public function check()
|
||||
public function getPerson()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
@@ -480,21 +479,55 @@ class Student extends FHCAPI_Controller
|
||||
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
$this->PersonModel->addSelect(
|
||||
'person_id, vorname, nachname, vornamen, wahlname, gebdatum, staatsbuergerschaft, geburtsnation, sprache, anrede,
|
||||
titelpost, titelpre, gebort, gebzeit, homepage, geschlecht, matr_nr,
|
||||
aktiv, unruly, tbl_geschlecht.bezeichnung_mehrsprachig AS geschlecht_bezeichnung'
|
||||
);
|
||||
$this->PersonModel->addJoin('public.tbl_geschlecht', 'geschlecht');
|
||||
|
||||
if ($gebdatum)
|
||||
$this->PersonModel->db->where('gebdatum', (new DateTime($gebdatum))->format('Y-m-d'));
|
||||
if ($vorname && $nachname) {
|
||||
$this->PersonModel->db->or_group_start();
|
||||
$this->PersonModel->db->where('LOWER(nachname)', 'LOWER(' . $this->PersonModel->db->escape($nachname) . ')', false);
|
||||
$this->PersonModel->db->where('LOWER(vorname)', 'LOWER(' . $this->PersonModel->db->escape($vorname) . ')', false);
|
||||
$this->PersonModel->db->where('LOWER(nachname)', 'LOWER(' . $this->PersonModel->db->escape(trim($nachname)) . ')', false);
|
||||
$this->PersonModel->db->where('LOWER(vorname)', 'LOWER(' . $this->PersonModel->db->escape(trim($vorname)) . ')', false);
|
||||
$this->PersonModel->db->group_end();
|
||||
} elseif ($nachname) {
|
||||
$this->PersonModel->db->or_where('LOWER(nachname)', 'LOWER(' . $this->PersonModel->escape($nachname) . ')', false);
|
||||
$this->PersonModel->db->or_where('LOWER(nachname)', 'LOWER(' . $this->PersonModel->escape(trim($nachname)) . ')', false);
|
||||
}
|
||||
|
||||
$result = $this->PersonModel->load();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
|
||||
foreach ($data as $person)
|
||||
{
|
||||
// get adresses
|
||||
$langIdx = $this->_getLanguageIndex() - 1;
|
||||
$person->geschlecht_bezeichnung = isset($person->geschlecht_bezeichnung[$langIdx]) ? $person->geschlecht_bezeichnung[$langIdx] : '';
|
||||
|
||||
// get Adresse
|
||||
$this->AdresseModel->addOrder('heimatadresse', 'DESC');
|
||||
$this->AdresseModel->addOrder('zustelladresse', 'DESC');
|
||||
$this->AdresseModel->addOrder('adresse_id', 'DESC');
|
||||
$result = $this->AdresseModel->loadWhere(['person_id' => $person->person_id]);
|
||||
|
||||
$adressen = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$person->adressen = $adressen;
|
||||
|
||||
// get status
|
||||
$result = $this->PrestudentstatusModel->getLastStatusPerson($person->person_id);
|
||||
|
||||
$status = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$person->status = $status;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -508,71 +541,52 @@ class Student extends FHCAPI_Controller
|
||||
$_POST['ausbildungssemester'] = 0;
|
||||
}
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->_validate();
|
||||
|
||||
$this->form_validation->set_rules('nachname', 'Nachname', 'callback_requiredIfNotPersonId', [
|
||||
'requiredIfNotPersonId' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'nachname')])
|
||||
]);
|
||||
$this->form_validation->set_rules('geschlecht', 'Geschlecht', 'callback_requiredIfNotPersonId', [
|
||||
'requiredIfNotPersonId' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'geschlecht')])
|
||||
]);
|
||||
$this->form_validation->set_rules('gebdatum', 'Geburtsdatum', ['isValidDate', function($value) { return isValidDate($value); }], [
|
||||
'isValidDate' => $this->p->t('ui', 'error_invalid_date')
|
||||
]);
|
||||
$this->form_validation->set_rules('address[func]', 'Address', 'required|integer|less_than[2]|greater_than[-2]');
|
||||
$this->form_validation->set_rules('address[plz]', 'PLZ', 'callback_requiredIfAddressFunc', [
|
||||
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'plz')])
|
||||
]);
|
||||
$this->form_validation->set_rules('address[gemeinde]', 'Gemeinde', 'callback_requiredIfAddressFunc', [
|
||||
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'gemeinde')])
|
||||
]);
|
||||
$this->form_validation->set_rules('address[ort]', 'Ort', 'callback_requiredIfAddressFunc', [
|
||||
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'ort')])
|
||||
]);
|
||||
$this->form_validation->set_rules('address[address]', 'Adresse', 'callback_requiredIfAddressFunc', [
|
||||
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'adresse')])
|
||||
]);
|
||||
$this->form_validation->set_rules('email', 'E-Mail', 'valid_email');
|
||||
$this->form_validation->set_rules('studiengang_kz', 'Studiengang', 'callback_requiredIfStudentFunc', [
|
||||
'requiredIfStudentFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'studiengang')])
|
||||
]);
|
||||
$this->form_validation->set_rules('studiensemester_kurzbz', 'Studiensemester', 'callback_requiredIfStudentFunc', [
|
||||
'requiredIfStudentFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'studiensemester')])
|
||||
]);
|
||||
$this->form_validation->set_rules('ausbildungssemester', 'Ausbildungssemester', 'callback_requiredIfStudentFunc|integer|less_than[9]|greater_than[-1]', [
|
||||
'requiredIfStudentFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'ausbildungssemester')])
|
||||
]);
|
||||
// TODO(chris): validate studienplan with studiengang, semester and orgform?
|
||||
// TODO(chris): validate person_id, studiengang_kz, studiensemester_kurzbz, orgform_kurzbz, nation, gemeinde, ort, geschlecht?
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// TODO(chris): This should be in a library
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$this->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
|
||||
|
||||
$this->db->trans_start();
|
||||
$this->load->library('PrestudentLib');
|
||||
|
||||
$result = $this->addInteressent();
|
||||
$errors = [];
|
||||
$person_id = null;
|
||||
|
||||
$this->db->trans_complete();
|
||||
$this->db->trans_begin();
|
||||
|
||||
if ($this->db->trans_status() === FALSE)
|
||||
$this->terminateWithError('TODO(chris): TEXT', self::ERROR_TYPE_GENERAL);
|
||||
$result = $this->_addPerson();
|
||||
if (isError($result)) $errors[] = getError($result);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
if (hasData($result))
|
||||
{
|
||||
$person_id = getData($result);
|
||||
$result = $this->_addAdresse($person_id);
|
||||
if (isError($result)) $errors[] = getError($result);
|
||||
$result = $this->_addKontakt($person_id);
|
||||
if (isError($result)) $errors[] = getError($result);
|
||||
if (!$this->input->post('personOnly')) $result = $this->_addFirstPrestudentstatus($person_id);
|
||||
if (isError($result)) $errors[] = getError($result);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
if ($this->db->trans_status() === FALSE || !isEmptyArray($errors))
|
||||
{
|
||||
$this->db->trans_rollback();
|
||||
$this->terminateWithError(isEmptyArray($errors) ? $this->p->t('stv', 'error_add_student') : $errors);
|
||||
}
|
||||
$this->db->trans_commit();
|
||||
|
||||
$this->terminateWithSuccess($person_id);
|
||||
}
|
||||
|
||||
protected function addInteressent()
|
||||
private function _addPerson()
|
||||
{
|
||||
// Person anlegen wenn nötig
|
||||
$person_id = $this->input->post('person_id');
|
||||
if (!$person_id) {
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
|
||||
|
||||
$data = [
|
||||
'nachname' => $this->input->post('nachname'),
|
||||
'insertamum' => date('c'),
|
||||
@@ -595,19 +609,25 @@ class Student extends FHCAPI_Controller
|
||||
if ($this->input->post('geschlecht'))
|
||||
$data['geschlecht'] = $this->input->post('geschlecht');
|
||||
if ($this->input->post('gebdatum'))
|
||||
$data['gebdatum'] = (new DateTime($this->input->post('datum_obj')))->format('Y-m-d');
|
||||
$data['gebdatum'] = (new DateTime($this->input->post('gebdatum')))->format('Y-m-d');
|
||||
if ($this->input->post('geburtsnation'))
|
||||
$data['geburtsnation'] = $this->input->post('geburtsnation');
|
||||
if ($this->input->post('staatsbuergerschaft'))
|
||||
$data['staatsbuergerschaft'] = $this->input->post('staatsbuergerschaft');
|
||||
|
||||
$result = $this->PersonModel->insert($data);
|
||||
$person_id = $this->getDataOrTerminateWithError($result);
|
||||
return $this->PersonModel->insert($data);
|
||||
}
|
||||
|
||||
// Addresse anlegen
|
||||
$anlegen = $this->input->post('address[func]');
|
||||
if ($anlegen) {
|
||||
return success($person_id);
|
||||
}
|
||||
|
||||
private function _addAdresse($person_id)
|
||||
{
|
||||
// Addresse anlegen?
|
||||
$anlegen = $this->input->post('address[checked]');
|
||||
if ($anlegen === true)
|
||||
{
|
||||
// Adresse laden
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
|
||||
$data = [
|
||||
@@ -619,52 +639,45 @@ class Student extends FHCAPI_Controller
|
||||
'typ' => 'h',
|
||||
'zustelladresse' => true,
|
||||
];
|
||||
if ($anlegen < 0) { // Überschreiben
|
||||
|
||||
$this->AdresseModel->addSelect('adresse_id');
|
||||
$this->AdresseModel->addJoin('public.tbl_adressentyp', 'typ = adressentyp_kurzbz');
|
||||
$this->AdresseModel->addOrder('zustelladresse', 'DESC');
|
||||
$this->AdresseModel->addOrder('sort');
|
||||
$result = $this->AdresseModel->loadWhere([
|
||||
'person_id' => $person_id
|
||||
]);
|
||||
$address = $this->getDataOrTerminateWithError($result);
|
||||
if ($address) {
|
||||
$address = current($address);
|
||||
|
||||
$data['updateamum'] = date('c');
|
||||
$data['updatevon'] = getAuthUID();
|
||||
if (isError($result)) return $result;
|
||||
|
||||
// wenn neue Adresse, heimatadresse setzen
|
||||
if (!hasData($result)) $data['heimatadresse'] = true;
|
||||
|
||||
$result = $this->AdresseModel->update($address->adresse_id, $data);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
} else {
|
||||
//Wenn keine Adrese vorhanden ist dann eine neue Anlegen
|
||||
$anlegen = 1;
|
||||
$data['heimatadresse'] = true;
|
||||
}
|
||||
}
|
||||
if ($anlegen > 0) {
|
||||
$data['person_id'] = $person_id;
|
||||
$data['insertamum'] = date('c');
|
||||
$data['insertvon'] = getAuthUID();
|
||||
if (!isset($data['heimatadresse']))
|
||||
$data['heimatadresse'] = !$this->input->post('person_id');
|
||||
|
||||
$result = $this->AdresseModel->insert($data);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
|
||||
return $this->AdresseModel->insert($data);
|
||||
}
|
||||
|
||||
|
||||
return success(null);
|
||||
}
|
||||
|
||||
private function _addKontakt($person_id)
|
||||
{
|
||||
// Kontaktdaten
|
||||
$kontaktdaten = [];
|
||||
foreach (['email', 'telefon', 'mobil'] as $k) {
|
||||
|
||||
foreach (['email', 'telefon', 'mobil'] as $k)
|
||||
{
|
||||
$v = $this->input->post($k);
|
||||
if ($v)
|
||||
$kontaktdaten[$k] = $v;
|
||||
}
|
||||
if (count($kontaktdaten)) {
|
||||
|
||||
if (count($kontaktdaten))
|
||||
{
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
|
||||
foreach ($kontaktdaten as $typ => $kontakt) {
|
||||
foreach ($kontaktdaten as $typ => $kontakt)
|
||||
{
|
||||
$data = [
|
||||
'person_id' => $person_id,
|
||||
'kontakttyp' => $typ,
|
||||
@@ -674,87 +687,70 @@ class Student extends FHCAPI_Controller
|
||||
'insertvon' => getAuthUID()
|
||||
];
|
||||
$result = $this->KontaktModel->insert($data);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
if (isError($result)) return $result;
|
||||
}
|
||||
}
|
||||
return success(null);
|
||||
}
|
||||
|
||||
$personOnly = $anlegen = $this->input->post('personOnly');
|
||||
private function _addFirstPrestudentstatus($person_id)
|
||||
{
|
||||
// Prestudent anlegen
|
||||
|
||||
if (!$personOnly)
|
||||
// Anmerkung with Ausbildungsart
|
||||
$studiengang_kz = $this->input->post('studiengang_kz');
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
|
||||
$ausbildungsart = $this->input->post('ausbildungsart');
|
||||
$anmerkung = $this->input->post('anmerkungen');
|
||||
$foerderrelevant = null;
|
||||
if ($ausbildungsart)
|
||||
$anmerkung .= ' Ausbildungsart:' . $ausbildungsart;
|
||||
|
||||
// Incomings und ausserordentliche sind bei Meldung nicht förderrelevant
|
||||
$incoming = $this->input->post('incoming');
|
||||
if ($incoming || substr($studiengang_kz, 0, 1) == '9')
|
||||
$foerderrelevant = false;
|
||||
|
||||
// Prestudent speichern
|
||||
$result = $this->prestudentlib->setPrestudent(
|
||||
$person_id,
|
||||
$studiengang_kz,
|
||||
$this->input->post('letzteausbildung'),
|
||||
$anmerkung,
|
||||
$foerderrelevant
|
||||
);
|
||||
if (isError($result)) return $result;
|
||||
if (!hasData($result)) return error('Error when adding prestudent');
|
||||
|
||||
$prestudent_id = getData($result);
|
||||
|
||||
// wenn Incoming, Incoming Daten hinzufügen
|
||||
if ($incoming)
|
||||
{
|
||||
// Prestudent anlegen
|
||||
$data = [
|
||||
'aufmerksamdurch_kurzbz' => 'k.A.',
|
||||
'person_id' => $person_id,
|
||||
'studiengang_kz' => $this->input->post('studiengang_kz'),
|
||||
'ausbildungcode' => $this->input->post('letzteausbildung'),
|
||||
'anmerkung' => $this->input->post('anmerkungen'),
|
||||
'reihungstestangetreten' => false,
|
||||
'bismelden' => true
|
||||
];
|
||||
$ausbildungsart = $this->input->post('ausbildungsart');
|
||||
if ($ausbildungsart)
|
||||
$data['anmerkung'] .= ' Ausbildungsart:' . $ausbildungsart;
|
||||
// Incomings und ausserordentliche sind bei Meldung nicht förderrelevant
|
||||
$incoming = $this->input->post('incoming');
|
||||
if ($incoming || substr($data['studiengang_kz'], 0, 1) == '9')
|
||||
$data['foerderrelevant'] = false;
|
||||
// Wenn die Person schon im System erfasst ist, dann die ZGV des Datensatzes uebernehmen
|
||||
$this->PrestudentModel->addOrder('zgvmas_code');
|
||||
$this->PrestudentModel->addOrder('zgv_code', 'DESC');
|
||||
$this->PrestudentModel->addLimit(1);
|
||||
$result = $this->PrestudentModel->loadWhere([
|
||||
'person_id' => $person_id
|
||||
]);
|
||||
$prestudent = $this->getDataOrTerminateWithError($result);
|
||||
if ($prestudent) {
|
||||
$prestudent = current($prestudent);
|
||||
if ($prestudent->zgv_code) {
|
||||
$data['zgv_code'] = $prestudent->zgv_code;
|
||||
$data['zgvort'] = $prestudent->zgvort;
|
||||
$data['zgvdatum'] = $prestudent->zgvdatum;
|
||||
|
||||
$data['zgvmas_code'] = $prestudent->zgvmas_code;
|
||||
$data['zgvmaort'] = $prestudent->zgvmaort;
|
||||
$data['zgvmadatum'] = $prestudent->zgvmadatum;
|
||||
}
|
||||
}
|
||||
// Prestudent speichern
|
||||
$result = $this->PrestudentModel->insert($data);
|
||||
$prestudent_id = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
// Prestudent Rolle Anlegen
|
||||
$data = [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => $incoming ? 'Incoming' : 'Interessent',
|
||||
'studiensemester_kurzbz' => $this->input->post('studiensemester_kurzbz'),
|
||||
'ausbildungssemester' => $this->input->post('ausbildungssemester') ?: 0,
|
||||
'orgform_kurzbz' => $this->input->post('orgform_kurzbz') ?: null,
|
||||
'studienplan_id' => $this->input->post('studienplan_id') ?: null,
|
||||
'datum' => date('Y-m-d'),
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID()
|
||||
];
|
||||
$result = $this->PrestudentstatusModel->insert($data);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
if ($incoming) {
|
||||
// TODO(chris): IMPLEMENT!
|
||||
//Matrikelnummer und UID generieren
|
||||
//Benutzerdatensatz anlegen
|
||||
//Studentendatensatz anlegen
|
||||
//StudentLehrverband anlegen
|
||||
}
|
||||
$statusResult = $this->prestudentlib->setFirstIncoming(
|
||||
$prestudent_id,
|
||||
$studiengang_kz,
|
||||
$studiensemester_kurzbz,
|
||||
$this->input->post('orgform_kurzbz'),
|
||||
$this->input->post('studienplan_id')
|
||||
);
|
||||
}
|
||||
// TODO(chris): DEBUG
|
||||
/*$result = $this->PrestudentModel->loadWhere([
|
||||
'pestudent_id' => 1
|
||||
]);
|
||||
if (isError($result)) {
|
||||
return $result;
|
||||
}*/
|
||||
else
|
||||
{
|
||||
// Prestudent Rolle Anlegen
|
||||
$statusResult = $this->prestudentlib->setFirstStatus(
|
||||
$prestudent_id,
|
||||
$this->PrestudentstatusModel::STATUS_INTERESSENT,
|
||||
$studiensemester_kurzbz,
|
||||
$this->input->post('ausbildungssemester'),
|
||||
$this->input->post('orgform_kurzbz'),
|
||||
$this->input->post('studienplan_id')
|
||||
);
|
||||
}
|
||||
if (!hasData($statusResult)) return error('error when adding status');
|
||||
if (isError($statusResult)) return $statusResult;
|
||||
|
||||
return success($person_id);
|
||||
return success($prestudent_id);
|
||||
}
|
||||
|
||||
public function requiredIfNotPersonId($value)
|
||||
@@ -766,20 +762,84 @@ class Student extends FHCAPI_Controller
|
||||
|
||||
public function requiredIfAddressFunc($value)
|
||||
{
|
||||
if (!$_POST['address']['func'] || $_POST['address']['func'] == 0)
|
||||
if (!isset($_POST['address']['checked']) || !$_POST['address']['checked'])
|
||||
return true;
|
||||
return !!$value;
|
||||
}
|
||||
|
||||
public function requiredIfStudentFunc($value)
|
||||
{
|
||||
if ($_POST['personOnly'])
|
||||
if (isset($_POST['personOnly']) && $_POST['personOnly'])
|
||||
return true;
|
||||
return !!$value;
|
||||
}
|
||||
|
||||
public function isValidDate($value)
|
||||
public function requiredIfStudentAndNotIncomingFunc($value)
|
||||
{
|
||||
return isValidDate($value);
|
||||
if ((isset($_POST['incoming']) && $_POST['incoming']) || $this->requiredIfStudentFunc($value))
|
||||
return true;
|
||||
return !!$value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates input data. Terminates with validation errors, if invalid.
|
||||
*/
|
||||
private function _validate()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('nachname', 'Nachname', 'callback_requiredIfNotPersonId', [
|
||||
'requiredIfNotPersonId' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'nachname')])
|
||||
]);
|
||||
$this->form_validation->set_rules('geschlecht', 'Geschlecht', 'callback_requiredIfNotPersonId', [
|
||||
'requiredIfNotPersonId' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'geschlecht')])
|
||||
]);
|
||||
$this->form_validation->set_rules('gebdatum', 'Geburtsdatum', ['isValidDate', function($value) { return isValidDate($value); }], [
|
||||
'isValidDate' => $this->p->t('ui', 'error_invalid_date')
|
||||
]);
|
||||
//$this->form_validation->set_rules('address[checked]', 'Address', 'required');
|
||||
$this->form_validation->set_rules('address[plz]', 'PLZ', 'callback_requiredIfAddressFunc', [
|
||||
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'plz')])
|
||||
]);
|
||||
$this->form_validation->set_rules('address[gemeinde]', 'Gemeinde', 'callback_requiredIfAddressFunc', [
|
||||
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'gemeinde')])
|
||||
]);
|
||||
$this->form_validation->set_rules('address[ort]', 'Ort', 'callback_requiredIfAddressFunc', [
|
||||
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'ort')])
|
||||
]);
|
||||
$this->form_validation->set_rules('address[address]', 'Adresse', 'callback_requiredIfAddressFunc', [
|
||||
'requiredIfAddressFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('person', 'adresse')])
|
||||
]);
|
||||
$this->form_validation->set_rules('email', 'E-Mail', 'valid_email');
|
||||
$this->form_validation->set_rules('studiengang_kz', 'Studiengang', 'callback_requiredIfStudentFunc', [
|
||||
'requiredIfStudentFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'studiengang')])
|
||||
]);
|
||||
$this->form_validation->set_rules('studiensemester_kurzbz', 'Studiensemester', 'callback_requiredIfStudentFunc', [
|
||||
'requiredIfStudentFunc' => $this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'studiensemester')])
|
||||
]);
|
||||
$this->form_validation->set_rules(
|
||||
'ausbildungssemester',
|
||||
'Ausbildungssemester',
|
||||
'callback_requiredIfStudentAndNotIncomingFunc|integer|less_than[9]|greater_than[-1]',
|
||||
[
|
||||
'requiredIfStudentAndNotIncomingFunc' =>
|
||||
$this->p->t('ui', 'error_fieldRequired', ['field' => $this->p->t('lehre', 'ausbildungssemester')]),
|
||||
]
|
||||
);
|
||||
// TODO(chris): validate studienplan with studiengang, semester and orgform?
|
||||
// TODO(chris): validate person_id, studiengang_kz, studiensemester_kurzbz, orgform_kurzbz, nation, gemeinde, ort, geschlecht?
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
private function _getLanguageIndex()
|
||||
{
|
||||
$this->load->model('system/Sprache_model', 'SpracheModel');
|
||||
$this->SpracheModel->addSelect('index');
|
||||
$result = $this->SpracheModel->loadWhere(array('sprache' => getUserLanguage()));
|
||||
$this->addMeta('lang', getUserLanguage());
|
||||
|
||||
return hasData($result) ? getData($result)[0]->index : 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,89 @@ class PrestudentLib
|
||||
$this->_ci->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets initial prestudent entry, no status yet.
|
||||
* @return object success or error
|
||||
*/
|
||||
public function setPrestudent(
|
||||
$person_id,
|
||||
$studiengang_kz,
|
||||
$ausbildungscode,
|
||||
$anmerkung,
|
||||
$foerderrelevant
|
||||
)
|
||||
{
|
||||
// Prestudent anlegen
|
||||
$data = [
|
||||
'aufmerksamdurch_kurzbz' => 'k.A.',
|
||||
'person_id' => $person_id,
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'ausbildungcode' => $ausbildungscode,
|
||||
'anmerkung' => $anmerkung,
|
||||
'reihungstestangetreten' => false,
|
||||
'bismelden' => true,
|
||||
'foerderrelevant' => $foerderrelevant,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID()
|
||||
];
|
||||
|
||||
// Wenn die Person schon im System erfasst ist, dann die ZGV des Datensatzes uebernehmen
|
||||
$this->_ci->PrestudentModel->addSelect('public.tbl_prestudent.*, public.tbl_person.vorname, public.tbl_person.nachname');
|
||||
$this->_ci->PrestudentModel->addJoin('public.tbl_person', 'person_id');
|
||||
$this->_ci->PrestudentModel->addOrder('zgvmas_code');
|
||||
$this->_ci->PrestudentModel->addOrder('zgv_code', 'DESC');
|
||||
$this->_ci->PrestudentModel->addLimit(1);
|
||||
$result = $this->_ci->PrestudentModel->loadWhere([
|
||||
'person_id' => $person_id
|
||||
]);
|
||||
|
||||
if (isError($result)) return $result;
|
||||
|
||||
if (hasData($result)) {
|
||||
$prestudent = getData($result)[0];
|
||||
if ($prestudent->zgv_code) {
|
||||
$data['zgv_code'] = $prestudent->zgv_code;
|
||||
$data['zgvort'] = $prestudent->zgvort;
|
||||
$data['zgvdatum'] = $prestudent->zgvdatum;
|
||||
|
||||
$data['zgvmas_code'] = $prestudent->zgvmas_code;
|
||||
$data['zgvmaort'] = $prestudent->zgvmaort;
|
||||
$data['zgvmadatum'] = $prestudent->zgvmadatum;
|
||||
}
|
||||
}
|
||||
// Prestudent speichern
|
||||
return $this->_ci->PrestudentModel->insert($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets first status of a prestudent.!
|
||||
* @return object success or error
|
||||
*/
|
||||
public function setFirstStatus(
|
||||
$prestudent_id,
|
||||
$status_kurzbz,
|
||||
$studiensemester_kurzbz,
|
||||
$ausbildungssemester = null,
|
||||
$orgform_kurzbz = null,
|
||||
$studienplan_id = null
|
||||
)
|
||||
{
|
||||
// Prestudent Rolle Anlegen
|
||||
$data = [
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'status_kurzbz' => $status_kurzbz,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'ausbildungssemester' => $ausbildungssemester ?: 0,
|
||||
'orgform_kurzbz' => $orgform_kurzbz ?: null,
|
||||
'studienplan_id' => $studienplan_id ?: null,
|
||||
'datum' => date('Y-m-d'),
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID()
|
||||
];
|
||||
|
||||
return $this->_ci->PrestudentstatusModel->insert($data);
|
||||
}
|
||||
|
||||
public function setAbbrecher(
|
||||
$prestudent_id,
|
||||
$studiensemester_kurzbz,
|
||||
@@ -889,6 +972,155 @@ class PrestudentLib
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an incoming, saves necessary data for an incoming.
|
||||
* @param $prestudent_id existing prestudent, for which incoming entry is created
|
||||
* @param $studiengang_kz Studiengang assigned to incoming
|
||||
* @param $studiensemester_kurzbz start semester for incoming
|
||||
* @return object success if incoming successfully saved, or error
|
||||
*/
|
||||
public function setFirstIncoming($prestudent_id, $studiengang_kz, $studiensemester_kurzbz, $orgform_kurzbz, $studienplan_id)
|
||||
{
|
||||
// Verband and Ausbildungssemester for incoming
|
||||
$authUID = getAuthUID();
|
||||
$incomingVerband = 'I';
|
||||
$incomingAusbildungssemester = '0';
|
||||
|
||||
// get prestudent
|
||||
$this->_ci->PrestudentModel->addJoin('public.tbl_person p', 'person_id');
|
||||
$this->_ci->PrestudentModel->addJoin('public.tbl_studiengang stg', 'studiengang_kz');
|
||||
$result = $this->_ci->PrestudentModel->load($prestudent_id);
|
||||
|
||||
if (isError($result)) return $result;
|
||||
if (!hasData($result)) return error('No prestudent');
|
||||
|
||||
$student_data = getData($result)[0];
|
||||
|
||||
$result = $this->setFirstStatus(
|
||||
$prestudent_id,
|
||||
$this->_ci->PrestudentstatusModel::STATUS_INCOMING,
|
||||
$studiensemester_kurzbz,
|
||||
$incomingAusbildungssemester,
|
||||
$orgform_kurzbz,
|
||||
$studienplan_id
|
||||
);
|
||||
if (isError($result)) return $result;
|
||||
if (!hasData($result)) return error('Error when adding prestudentstatus');
|
||||
|
||||
// generate Personenkennzeichen
|
||||
$result = $this->_ci->StudentModel->generateMatrikelnummer2($studiengang_kz, $studiensemester_kurzbz);
|
||||
if (isError($result)) return $result;
|
||||
if (!hasData($result)) return error('No personenkennzeichen could be generated');
|
||||
|
||||
$personenkennzeichen = getData($result);
|
||||
|
||||
$jahr = mb_substr($personenkennzeichen, 0, 2);
|
||||
$stg = mb_substr($personenkennzeichen, 3, 4);
|
||||
|
||||
$nachname_clean = mb_strtolower(sanitizeProblemChars($student_data->nachname));
|
||||
$vorname_clean = mb_strtolower(sanitizeProblemChars($student_data->vorname));
|
||||
$nachname_clean = str_replace(' ','_', $nachname_clean);
|
||||
$vorname_clean = str_replace(' ','_', $vorname_clean);
|
||||
|
||||
// get Studiengang data
|
||||
$result = $this->_ci->StudiengangModel->load(ltrim($stg, '0'));
|
||||
if (isError($result)) return $result;
|
||||
if (!hasData($result)) return error('No Studiengang');
|
||||
|
||||
$stgObj = getData($result)[0];
|
||||
|
||||
// gernerate uid
|
||||
$result = $this->_ci->StudentModel->generateUID($stgObj->kurzbz, $jahr, $stgObj->typ, $personenkennzeichen, $vorname_clean, $nachname_clean);
|
||||
if (isError($result)) return $result;
|
||||
if (!hasData($result)) return error("UID could not be generated");
|
||||
$uid = getData($result);
|
||||
|
||||
//Benutzerdatensatz anlegen
|
||||
$benutzer = [
|
||||
'uid' => $uid,
|
||||
'person_id' => $student_data->person_id,
|
||||
'aktiv' => true,
|
||||
'aktivierungscode' => $this->_ci->BenutzerModel->generateActivationkey()
|
||||
];
|
||||
|
||||
// Generate Alias
|
||||
$alias = '';
|
||||
if (!defined('GENERATE_ALIAS_STUDENT') || GENERATE_ALIAS_STUDENT === true)
|
||||
{
|
||||
$result = $this->_ci->BenutzerModel->generateAliasFromName($student_data->vorname, $student_data->nachname);
|
||||
if (isError($result))
|
||||
return $result;
|
||||
$alias = getData($result);
|
||||
}
|
||||
|
||||
$benutzer['alias'] = $alias;
|
||||
$benutzer['insertamum'] = date('Y-m-d H:i:s');
|
||||
$benutzer['insertvon'] = $authUID;
|
||||
|
||||
$result = $this->_ci->BenutzerModel->insert($benutzer);
|
||||
|
||||
if (isError($result)) return $result;
|
||||
|
||||
// Studentendatensatz anlegen
|
||||
$student = [
|
||||
'student_uid' => $uid,
|
||||
'matrikelnr' => $personenkennzeichen,
|
||||
'prestudent_id' => $prestudent_id,
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'semester' => $incomingAusbildungssemester,
|
||||
'verband' => $incomingVerband,
|
||||
'gruppe' => ' '
|
||||
];
|
||||
|
||||
$result = $this->_ci->LehrverbandModel->loadWhere([
|
||||
'studiengang_kz' => $student['studiengang_kz'],
|
||||
'semester' => $student['semester'],
|
||||
'verband' => $student['verband'],
|
||||
'gruppe' => $student['gruppe']
|
||||
]);
|
||||
|
||||
if (isError($result)) return $result;
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
// Add Lehrverband if it does not exist
|
||||
$result = $this->_ci->LehrverbandModel->insert([
|
||||
'studiengang_kz' => $student_data->studiengang_kz,
|
||||
'semester' => $student['semester'],
|
||||
'verband' => $student['verband'],
|
||||
'gruppe' => $student['gruppe'],
|
||||
'bezeichnung' => 'Incoming',
|
||||
'aktiv' => true
|
||||
]);
|
||||
|
||||
if (isError($result)) return $result;
|
||||
}
|
||||
|
||||
// add student
|
||||
$student['insertamum'] = date('Y-m-d H:i:s');
|
||||
$student['insertvon'] = $authUID;
|
||||
|
||||
$result = $this->_ci->StudentModel->insert($student);
|
||||
if (isError($result)) return $result;
|
||||
|
||||
// Add Studentlehrverband
|
||||
$result = $this->_ci->StudentlehrverbandModel->insert([
|
||||
'student_uid' => $uid,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'studiengang_kz' => $student_data->studiengang_kz,
|
||||
'semester' => $incomingAusbildungssemester,
|
||||
'verband' => $incomingVerband,
|
||||
'gruppe' => ' ',
|
||||
'insertamum' => date('Y-m-d H:i:s'),
|
||||
'insertvon' => $authUID
|
||||
]);
|
||||
|
||||
if (isError($result))
|
||||
return $result;
|
||||
|
||||
return success($prestudent_id);
|
||||
}
|
||||
|
||||
protected function setBasic($authUID, $now, $status_kurzbz, $prestudent_id, $studiensemester_kurzbz, $ausbildungssemester, $statusgrund_id = null)
|
||||
{
|
||||
$result = $this->_ci->PrestudentstatusModel->getLastStatus($prestudent_id);
|
||||
|
||||
@@ -290,7 +290,11 @@ class Prestudentstatus_model extends DB_Model
|
||||
*/
|
||||
public function getLastStatusPerson($person_id, $studiensemester_kurzbz = null)
|
||||
{
|
||||
$query = 'SELECT *
|
||||
$query = 'SELECT p.*, ps.*, s.*,
|
||||
stg.kurzbz AS studiengang_kurzbz, stg.kurzbzlang AS studiengang_kurzbzlang,
|
||||
UPPER(typ::varchar(1) || kurzbz) AS studiengang_kuerzel,
|
||||
stg.typ AS studiengang_typ, stg.bezeichnung AS studiengang_bezeichnung, stg.english AS studiengang_bezeichnung_english,
|
||||
stg.orgform_kurzbz AS studiengang_orgform
|
||||
FROM public.tbl_prestudent p
|
||||
JOIN (
|
||||
SELECT DISTINCT ON(prestudent_id) *
|
||||
@@ -298,7 +302,8 @@ class Prestudentstatus_model extends DB_Model
|
||||
WHERE prestudent_id IN (SELECT prestudent_id FROM public.tbl_prestudent WHERE person_id = ?)
|
||||
ORDER BY prestudent_id, datum desc, insertamum desc
|
||||
) ps USING(prestudent_id)
|
||||
JOIN public.tbl_status USING(status_kurzbz)';
|
||||
JOIN public.tbl_status s USING(status_kurzbz)
|
||||
JOIN public.tbl_studiengang stg USING (studiengang_kz)';
|
||||
|
||||
$parametersArray = array($person_id);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class Student_model extends DB_Model
|
||||
$this->addSelect('1');
|
||||
|
||||
$result = $this->loadWhere(array('student_uid' => $uid));
|
||||
|
||||
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
@@ -169,7 +169,7 @@ class Student_model extends DB_Model
|
||||
|
||||
$max = 0;
|
||||
if ($matrikelnrres && hasData($matrikelnrres)) {
|
||||
$max = mb_substr($matrikelnrres->retval[0]->matrikelnr, 7);
|
||||
$max = mb_substr(getData($matrikelnrres)[0]->matrikelnr, 7);
|
||||
if (!is_numeric($max)) {
|
||||
$max = (int)$max;
|
||||
}
|
||||
|
||||
@@ -24,17 +24,28 @@ class Projektarbeit_model extends DB_Model
|
||||
public function getProjektarbeit($student_uid, $studiengang_kz = null, $studiensemester_kurzbz = null, $projekttyp = null, $final = null)
|
||||
{
|
||||
$qry = "SELECT
|
||||
tbl_projektarbeit.*, tbl_projekttyp.bezeichnung,
|
||||
pa.*, tbl_projekttyp.bezeichnung,
|
||||
tbl_lehreinheit.studiensemester_kurzbz, tbl_lehrveranstaltung.lehrveranstaltung_id,
|
||||
tbl_firma.name AS firma_name
|
||||
tbl_firma.name AS firma_name,
|
||||
(
|
||||
SELECT
|
||||
STRING_AGG(trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')), ', ')
|
||||
FROM
|
||||
lehre.tbl_projektbetreuer
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
WHERE
|
||||
projektarbeit_id = pa.projektarbeit_id
|
||||
AND student_uid = pa.student_uid
|
||||
GROUP BY projektarbeit_id
|
||||
) AS projektbetreuer
|
||||
FROM
|
||||
lehre.tbl_projektarbeit
|
||||
lehre.tbl_projektarbeit pa
|
||||
JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
|
||||
JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_firma USING (firma_id)
|
||||
WHERE
|
||||
tbl_projektarbeit.student_uid = ?";
|
||||
pa.student_uid = ?";
|
||||
|
||||
$params = array($student_uid);
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ class Stundensatz_model extends DB_Model
|
||||
{
|
||||
$this->load->config('stv');
|
||||
|
||||
$useFixangestelltStundensatz = $this->config->item('tabs')['projektarbeit']['lvLektroinnenzuteilungFixangestelltStundensatz'];
|
||||
$defaultStundensatz = $this->config->item('tabs')['projektarbeit']['defaultProjektbetreuerStundensatz'];
|
||||
|
||||
$stundensatz = '';
|
||||
@@ -63,7 +62,7 @@ class Stundensatz_model extends DB_Model
|
||||
{
|
||||
$studiensemester = getData($result)[0];
|
||||
|
||||
if (isset($useFixangestelltStundensatz) && !$useFixangestelltStundensatz)
|
||||
if (defined('FAS_LV_LEKTORINNENZUTEILUNG_FIXANGESTELLT_STUNDENSATZ') && !FAS_LV_LEKTORINNENZUTEILUNG_FIXANGESTELLT_STUNDENSATZ)
|
||||
{
|
||||
// load Mitarbeiter
|
||||
$params = [$person_id];
|
||||
@@ -83,19 +82,30 @@ class Stundensatz_model extends DB_Model
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach (getData($result) as $ma)
|
||||
{
|
||||
if (!$ma->fixangestellt)
|
||||
{
|
||||
$stundensatzRes = $this->getStundensatzByDatum(
|
||||
$ma->mitarbeiter_uid, $studiensemester->start, $studiensemester->ende, 'lehre'
|
||||
);
|
||||
$ma = getData($result)[0];
|
||||
|
||||
if (hasData($stundensatzRes))
|
||||
$stundensatz = getData($stundensatzRes)[0]->stundensatz;
|
||||
else
|
||||
$stundensatz = '0.00';
|
||||
}
|
||||
$this->load->model('vertragsbestandteil/Dienstverhaeltnis_model','DienstverhaeltnisModel');
|
||||
$echterdv_result = $this->DienstverhaeltnisModel->existsDienstverhaeltnis(
|
||||
$ma->mitarbeiter_uid,
|
||||
$studiensemester->start,
|
||||
$studiensemester->ende,
|
||||
'echterdv'
|
||||
);
|
||||
|
||||
if (hasData($echterdv_result))
|
||||
{
|
||||
$stundensatz = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stundensatzRes = $this->getStundensatzByDatum(
|
||||
$ma->mitarbeiter_uid, $studiensemester->start, $studiensemester->ende, 'lehre'
|
||||
);
|
||||
|
||||
if (hasData($stundensatzRes))
|
||||
$stundensatz = getData($stundensatzRes)[0]->stundensatz;
|
||||
else
|
||||
$stundensatz = '0.00';
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -40,6 +40,10 @@ $configArray = [
|
||||
cis-root="<?= CIS_ROOT; ?>"
|
||||
:permissions="<?= htmlspecialchars(json_encode($permissions)); ?>"
|
||||
:config="<?= htmlspecialchars(json_encode($configArray)); ?>"
|
||||
<?php if($ids !== null && $typeid !== null) { ?>
|
||||
:id ="<?= htmlspecialchars(json_encode($ids)); ?>"
|
||||
type-id ="<?= htmlspecialchars($typeid); ?>"
|
||||
<?php } ?>
|
||||
>
|
||||
</router-view>
|
||||
</div>
|
||||
|
||||
@@ -38,16 +38,18 @@ export default {
|
||||
url: 'api/frontend/v1/messages/messages/getMsgVarsLoggedInUser/'
|
||||
};
|
||||
},
|
||||
getMessageVarsPerson(userParams){
|
||||
getMessageVarsPerson(ids, type_id){
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/messages/messages/getMessageVarsPerson/' + userParams.id + '/' + userParams.type_id
|
||||
url: 'api/frontend/v1/messages/messages/getMessageVarsPerson/' + type_id,
|
||||
params: {ids}
|
||||
};
|
||||
},
|
||||
getMsgVarsPrestudent(userParams){
|
||||
getMsgVarsPrestudent(ids, type_id){
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/messages/messages/getMsgVarsPrestudent/' + userParams.id + '/' + userParams.type_id
|
||||
url: 'api/frontend/v1/messages/messages/getMsgVarsPrestudent/' + type_id,
|
||||
params: {ids}
|
||||
};
|
||||
},
|
||||
getPersonId(params){
|
||||
@@ -56,28 +58,23 @@ export default {
|
||||
url: 'api/frontend/v1/messages/messages/getPersonId/' + params.id + '/' + params.type_id
|
||||
};
|
||||
},
|
||||
getUid(userParams){
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/messages/messages/getUid/' + userParams.id + '/' + userParams.type_id
|
||||
};
|
||||
},
|
||||
getDataVorlage(vorlage_kurzbz){
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/messages/messages/getDataVorlage/' + vorlage_kurzbz
|
||||
};
|
||||
},
|
||||
getNameOfDefaultRecipient(params){
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/messages/messages/getNameOfDefaultRecipient/' + params.id + '/' + params.type_id
|
||||
};
|
||||
},
|
||||
getPreviewText(userParams, params){
|
||||
getNameOfDefaultRecipients(ids, type_id){
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/messages/messages/getPreviewText/' + userParams.id + '/' + userParams.type_id,
|
||||
url: 'api/frontend/v1/messages/messages/getNameOfDefaultRecipients/' + type_id,
|
||||
params: {ids}
|
||||
};
|
||||
},
|
||||
getPreviewText(type_id, params){
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/messages/messages/getPreviewText/' + type_id,
|
||||
params
|
||||
};
|
||||
},
|
||||
@@ -87,17 +84,10 @@ export default {
|
||||
url: 'api/frontend/v1/messages/messages/getReplyData/' + messageId
|
||||
};
|
||||
},
|
||||
sendMessageFromModalContext(id, params) {
|
||||
sendMessage(type_id, params) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/messages/messages/sendMessage/' + id,
|
||||
params
|
||||
};
|
||||
},
|
||||
sendMessage(id, params) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/messages/messages/sendMessage/' + id,
|
||||
url: 'api/frontend/v1/messages/messages/sendMessage/' + type_id,
|
||||
params
|
||||
};
|
||||
},
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
export default {
|
||||
|
||||
getStudienplaeneBySemester(studiengang_kz, studiensemester_kurzbz, ausbildungssemester, orgform_kurzbz)
|
||||
{
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/organisation/studienplan/getBySemester',
|
||||
params: { studiengang_kz, studiensemester_kurzbz, ausbildungssemester, orgform_kurzbz },
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
export default {
|
||||
|
||||
getAll(order = null, start = null)
|
||||
{
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/organisation/studiensemester/getAll',
|
||||
params: { order, start }
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ export default {
|
||||
deleteMobilityPurpose(params) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/stv/mobility/deleteMobilityPurpose/',
|
||||
url: 'api/frontend/v1/stv/mobility/deleteMobilityPurpose/' + params.bisio_id,
|
||||
params
|
||||
};
|
||||
},
|
||||
|
||||
@@ -49,6 +49,12 @@ export default {
|
||||
url: 'api/frontend/v1/stv/projektarbeit/getNoten'
|
||||
};
|
||||
},
|
||||
getStudiensemester() {
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/stv/projektarbeit/getStudiensemester'
|
||||
};
|
||||
},
|
||||
loadProjektarbeit(projektarbeit_id) {
|
||||
return {
|
||||
method: 'get',
|
||||
|
||||
@@ -60,10 +60,10 @@ export default {
|
||||
url: 'api/frontend/v1/stv/students/' + relative_path
|
||||
};
|
||||
},
|
||||
check(params) {
|
||||
getPerson(params) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/stv/student/check',
|
||||
url: 'api/frontend/v1/stv/student/getPerson',
|
||||
params
|
||||
};
|
||||
},
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import NewMessage from "../components/Messages/Details/NewMessage/NewDiv.js";
|
||||
|
||||
import Phrasen from "../plugin/Phrasen.js";
|
||||
import Phrasen from "../plugins/Phrasen.js";
|
||||
|
||||
const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
|
||||
|
||||
const router = VueRouter.createRouter({
|
||||
history: VueRouter.createWebHistory(),
|
||||
routes: [
|
||||
{ path: `/${ciPath}/NeueNachricht/:id/:typeId`, component: NewMessage },
|
||||
{ path: `/${ciPath}/NeueNachricht/:id/:typeId/:messageId`, component: NewMessage },
|
||||
{ path: `/${ciPath}/NeueNachricht`, component: NewMessage, props: true },
|
||||
{ path: `/${ciPath}/NeueNachricht/:id/:typeId`, component: NewMessage, props: true },
|
||||
{ path: `/${ciPath}/NeueNachricht/:id/:typeId/:messageId`, component: NewMessage, props: true },
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ import FormInput from '../../../Form/Input.js';
|
||||
import ListBox from "../../../../../../index.ci.php/public/js/components/primevue/listbox/listbox.esm.min.js";
|
||||
import DropdownComponent from "../../../VorlagenDropdown/VorlagenDropdown.js";
|
||||
|
||||
import ApiMessages from '../../../../api/factory/messages/messages.js';
|
||||
|
||||
export default {
|
||||
name: "ModalNewMessages",
|
||||
components: {
|
||||
@@ -14,13 +16,9 @@ export default {
|
||||
ListBox
|
||||
},
|
||||
props: {
|
||||
endpoint: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
typeId: String,
|
||||
id: {
|
||||
type: [Number, String],
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
messageId: {
|
||||
@@ -43,6 +41,8 @@ export default {
|
||||
vorlagen: [],
|
||||
recipientsArray: [],
|
||||
defaultRecipient: null,
|
||||
defaultRecipients: [],
|
||||
defaultRecipientString: null,
|
||||
editor: null,
|
||||
fieldsUser: [],
|
||||
fieldsPerson: [],
|
||||
@@ -56,7 +56,6 @@ export default {
|
||||
previewText: null,
|
||||
previewBody: "",
|
||||
replyData: null,
|
||||
uid: null,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -111,34 +110,28 @@ export default {
|
||||
},
|
||||
sendMessage() {
|
||||
const data = new FormData();
|
||||
const params = {
|
||||
id: this.id,
|
||||
type_id: this.typeId
|
||||
};
|
||||
const merged = {
|
||||
...this.formData,
|
||||
...params
|
||||
};
|
||||
data.append('data', JSON.stringify(merged));
|
||||
data.append('data', JSON.stringify(this.formData));
|
||||
data.append('ids', JSON.stringify(this.id));
|
||||
|
||||
return this.$refs.formMessage
|
||||
.call(this.endpoint.sendMessageFromModalContext(this.uid, data))
|
||||
.call(ApiMessages.sendMessage(this.typeId, data))
|
||||
.then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSent'));
|
||||
this.hideModal('modalNewMessage');
|
||||
this.resetForm();
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
//this.resetForm();
|
||||
//closeModal
|
||||
//closewindwo
|
||||
|
||||
//just emit if no multitasking
|
||||
if(this.id.length == 1){
|
||||
this.$emit('reloadTable');
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
getDataVorlage(vorlage_kurzbz){
|
||||
return this.$api
|
||||
.call(this.endpoint.getDataVorlage(vorlage_kurzbz))
|
||||
.call(ApiMessages.getDataVorlage(vorlage_kurzbz))
|
||||
.then(response => {
|
||||
this.formData.body = response.data.text;
|
||||
this.formData.subject = response.data.subject;
|
||||
@@ -146,17 +139,17 @@ export default {
|
||||
},
|
||||
getPreviewText(){
|
||||
const data = new FormData();
|
||||
|
||||
data.append('data', JSON.stringify(this.formData.body));
|
||||
data.append('ids', JSON.stringify(this.id));
|
||||
|
||||
return this.$api
|
||||
.call(this.endpoint.getPreviewText({
|
||||
id: this.id,
|
||||
type_id: this.typeId}, data))
|
||||
.call(ApiMessages.getPreviewText(
|
||||
this.typeId, data))
|
||||
.then(response => {
|
||||
this.previewText = response.data;
|
||||
const previews = response.data;
|
||||
this.previewText = previews[this.defaultRecipient];
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
//this.resetForm();
|
||||
//closeModal
|
||||
//closewindwo
|
||||
});
|
||||
@@ -171,7 +164,7 @@ export default {
|
||||
this.editor.save();
|
||||
|
||||
} else {
|
||||
console.error("Editor instance is not available.");
|
||||
console.error(this.$p.t('messages', 'errorEditorNotAvailable'));
|
||||
}
|
||||
},
|
||||
resetForm(){
|
||||
@@ -180,6 +173,7 @@ export default {
|
||||
body: null,
|
||||
subject: null,
|
||||
};
|
||||
|
||||
this.$emit('resetMessageId');
|
||||
|
||||
if (this.editor) {
|
||||
@@ -201,18 +195,6 @@ export default {
|
||||
this.previewBody = this.previewText;
|
||||
});
|
||||
},
|
||||
getUid(id, typeId){
|
||||
const params = {
|
||||
id: id,
|
||||
type_id: typeId
|
||||
};
|
||||
this.$api
|
||||
.call(this.endpoint.getUid(params))
|
||||
.then(result => {
|
||||
this.uid = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
show(){
|
||||
this.$refs.modalNewMessage.show();
|
||||
},
|
||||
@@ -245,7 +227,7 @@ export default {
|
||||
if (!newMessageId) return;
|
||||
|
||||
try {
|
||||
const result = await this.$api.call(this.endpoint.getReplyData(newMessageId));
|
||||
const result = await this.$api.call(ApiMessages.getReplyData(newMessageId));
|
||||
this.replyData = result.data;
|
||||
|
||||
if (this.replyData.length > 0) {
|
||||
@@ -260,15 +242,9 @@ export default {
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.getUid(this.id, this.typeId);
|
||||
|
||||
if(this.typeId == 'person_id' || this.typeId == 'mitarbeiter_uid'){
|
||||
const params = {
|
||||
id: this.id,
|
||||
type_id: this.typeId
|
||||
};
|
||||
this.$api
|
||||
.call(this.endpoint.getMessageVarsPerson(params))
|
||||
.call(ApiMessages.getMessageVarsPerson(this.id, this.typeId))
|
||||
.then(result => {
|
||||
this.fieldsPerson = result.data;
|
||||
const person = this.fieldsPerson[0];
|
||||
@@ -281,12 +257,8 @@ export default {
|
||||
}
|
||||
|
||||
if(this.typeId == 'prestudent_id' || this.typeId == 'uid'){
|
||||
const params = {
|
||||
id: this.id,
|
||||
type_id: this.typeId
|
||||
};
|
||||
this.$api
|
||||
.call(this.endpoint.getMsgVarsPrestudent(params))
|
||||
.call(ApiMessages.getMsgVarsPrestudent(this.id, this.typeId))
|
||||
.then(result => {
|
||||
this.fieldsPrestudent = result.data;
|
||||
const prestudent = this.fieldsPrestudent[0];
|
||||
@@ -299,7 +271,7 @@ export default {
|
||||
}
|
||||
|
||||
this.$api
|
||||
.call(this.endpoint.getMsgVarsLoggedInUser())
|
||||
.call(ApiMessages.getMsgVarsLoggedInUser())
|
||||
.then(result => {
|
||||
this.fieldsUser = result.data;
|
||||
const user = this.fieldsUser;
|
||||
@@ -311,21 +283,18 @@ export default {
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
this.$api
|
||||
.call(this.endpoint.getNameOfDefaultRecipient({
|
||||
id: this.id,
|
||||
type_id: this.typeId}))
|
||||
.call(ApiMessages.getNameOfDefaultRecipients(this.id, this.typeId))
|
||||
.then(result => {
|
||||
this.defaultRecipient = result.data;
|
||||
this.recipientsArray.push({
|
||||
'uid': this.uid,
|
||||
'details': this.defaultRecipient});
|
||||
this.defaultRecipients = result.data;
|
||||
this.defaultRecipientString = Object.values(this.defaultRecipients).join("; ");
|
||||
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
//case of reply
|
||||
if(this.messageId) {
|
||||
this.$api
|
||||
.call(this.endpoint.getReplyData(this.messageId))
|
||||
.call(ApiMessages.getReplyData(this.messageId))
|
||||
.then(result => {
|
||||
this.replyData = result.data;
|
||||
this.formData.subject = this.replyData[0].replySubject;
|
||||
@@ -381,7 +350,7 @@ export default {
|
||||
type="text"
|
||||
name="recipient"
|
||||
:label="$p.t('messages/recipient')"
|
||||
v-model="defaultRecipient"
|
||||
v-model="defaultRecipientString"
|
||||
disabled
|
||||
>
|
||||
</form-input>
|
||||
@@ -502,17 +471,17 @@ export default {
|
||||
>
|
||||
<option :value="null">{{ $p.t('messages', 'recipient') }}...</option>
|
||||
<option
|
||||
v-for="recipient in recipientsArray"
|
||||
:key="recipient.uid"
|
||||
:value="recipient.uid"
|
||||
>{{recipient.details}}
|
||||
v-for="(name, id) in defaultRecipients"
|
||||
:key="id"
|
||||
:value="Number(id)"
|
||||
> {{name}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2 mt-4">
|
||||
<br>
|
||||
<button type="button" class="btn btn-secondary" @click="showPreview()">{{ $p.t('ui', 'btnAktualisieren') }}</button>
|
||||
<button type="button" class="btn btn-secondary" @click="showPreview(defaultRecipient)">{{ $p.t('ui', 'btnAktualisieren') }}</button>
|
||||
</div>
|
||||
</form-form>
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import FormForm from '../../../Form/Form.js';
|
||||
import FormInput from '../../../Form/Input.js';
|
||||
import ListBox from "../../../../../../index.ci.php/public/js/components/primevue/listbox/listbox.esm.min.js";
|
||||
import DropdownComponent from '../../../VorlagenDropdown/VorlagenDropdown.js';
|
||||
import ApiMessages from "../../../../api/factory/messages/messages.js"; //props not working with route
|
||||
|
||||
export default {
|
||||
name: "ComponentNewMessages",
|
||||
@@ -12,33 +13,17 @@ export default {
|
||||
DropdownComponent,
|
||||
},
|
||||
props: {
|
||||
endpoint: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
openMode: String,
|
||||
tempTypeId: String,
|
||||
tempId: {
|
||||
type: [Number, String],
|
||||
typeId: String,
|
||||
id: {
|
||||
type: Array,
|
||||
required: false
|
||||
},
|
||||
tempMessageId: {
|
||||
messageId: {
|
||||
type: Number,
|
||||
required: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
//params with routes for new tab and new window AND props for inSamePage
|
||||
id(){
|
||||
return this.$props.tempId || this.$route.params.id;
|
||||
},
|
||||
typeId(){
|
||||
return this.$props.tempTypeId || this.$route.params.typeId;
|
||||
},
|
||||
messageId(){
|
||||
return this.$props.tempMessageId ||this.$route.params.messageId;
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
formData: {
|
||||
@@ -53,6 +38,8 @@ export default {
|
||||
vorlagen: [],
|
||||
recipientsArray: [],
|
||||
defaultRecipient: null,
|
||||
defaultRecipients: [],
|
||||
defaultRecipientString: null,
|
||||
editor: null,
|
||||
isVisible: false,
|
||||
fieldsUser: [],
|
||||
@@ -67,8 +54,7 @@ export default {
|
||||
previewText: null,
|
||||
previewBody: "",
|
||||
replyData: null,
|
||||
uid: null,
|
||||
messageSent: false
|
||||
messageSent: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -106,19 +92,11 @@ export default {
|
||||
},
|
||||
sendMessage() {
|
||||
const data = new FormData();
|
||||
data.append('data', JSON.stringify(this.formData));
|
||||
data.append('ids', JSON.stringify(this.id));
|
||||
|
||||
const params = {
|
||||
id: this.id,
|
||||
type_id: this.typeId
|
||||
};
|
||||
|
||||
const merged = {
|
||||
...this.formData,
|
||||
...params
|
||||
};
|
||||
data.append('data', JSON.stringify(merged));
|
||||
return this.$api
|
||||
.call(this.endpoint.sendMessage(this.uid, data))
|
||||
.call(ApiMessages.sendMessage(this.typeId, data))
|
||||
.then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSent'));
|
||||
this.hideTemplate();
|
||||
@@ -126,11 +104,7 @@ export default {
|
||||
this.messageSent = true;
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
//TODO(Manu) hier route definieren für openmode in Tab, Page?
|
||||
// ist kein child sondern mit route aufgerufen
|
||||
//würde allerdings neues fenster aktualisiert öffnen, altes bleibt ohne reload gleich
|
||||
//Reload vorheriges tab???
|
||||
if(this.openMode == "inSamePage"){
|
||||
if(this.openMode == "inSamePage" && this.id.length == 1 ){
|
||||
this.$emit('reloadTable');
|
||||
}
|
||||
}
|
||||
@@ -138,25 +112,29 @@ export default {
|
||||
},
|
||||
getDataVorlage(vorlage_kurzbz){
|
||||
return this.$api
|
||||
.call(this.endpoint.getDataVorlage(vorlage_kurzbz))
|
||||
.call(ApiMessages.getDataVorlage(vorlage_kurzbz))
|
||||
.then(response => {
|
||||
this.formData.body = response.data.text;
|
||||
this.formData.subject = response.data.subject;
|
||||
}).catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
getPreviewText(id, typeId){
|
||||
getPreviewText(){
|
||||
console.log("subj" + this.formData.subject);
|
||||
const data = new FormData();
|
||||
|
||||
data.append('data', JSON.stringify(this.formData.body));
|
||||
data.append('ids', JSON.stringify(this.id));
|
||||
|
||||
console.log("subj" + this.formData.subject);
|
||||
|
||||
return this.$api
|
||||
.call(this.endpoint.getPreviewText({
|
||||
id: this.id,
|
||||
type_id: this.typeId}, data))
|
||||
.call(ApiMessages.getPreviewText(
|
||||
this.typeId, data))
|
||||
.then(response => {
|
||||
this.previewText = response.data;
|
||||
const previews = response.data;
|
||||
this.previewText = previews[this.defaultRecipient];
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
//this.resetForm();
|
||||
});
|
||||
},
|
||||
insertVariable(selectedItem){
|
||||
@@ -169,7 +147,7 @@ export default {
|
||||
this.editor.save();
|
||||
|
||||
} else {
|
||||
console.error("Editor instance is not available.");
|
||||
console.error(this.$p.t('messages', 'errorEditorNotAvailable'));
|
||||
}
|
||||
},
|
||||
resetForm(){
|
||||
@@ -177,11 +155,13 @@ export default {
|
||||
vorlage_kurzbz: null,
|
||||
body: null,
|
||||
subject: null,
|
||||
recipient: null,
|
||||
selectedValue: null
|
||||
};
|
||||
if (this.editor) {
|
||||
this.editor.setContent("");
|
||||
}
|
||||
this.$refs.dropdownComp.setValue(null);
|
||||
// this.$refs.dropdownComp.setValue(null);
|
||||
|
||||
this.previewBody = null;
|
||||
|
||||
@@ -199,23 +179,25 @@ export default {
|
||||
this.isVisible = false;
|
||||
},
|
||||
showTemplate(){
|
||||
if (this.openMode == "inSamePage")
|
||||
if (this.openMode == "inSamePage") {
|
||||
this.isVisible = true;
|
||||
//to enable send newMessage after sentMessage
|
||||
this.messageSent = false;
|
||||
}
|
||||
},
|
||||
showPreview(id, typeId){
|
||||
this.getPreviewText(id, typeId).then(() => {
|
||||
showPreview(){
|
||||
this.getPreviewText().then(() => {
|
||||
this.previewBody = this.previewText;
|
||||
});
|
||||
},
|
||||
getUid(id, typeId){
|
||||
const params = {
|
||||
id: id,
|
||||
type_id: typeId
|
||||
};
|
||||
loadReplyData(messageId){
|
||||
this.$api
|
||||
.call(this.endpoint.getUid(params))
|
||||
.call(ApiMessages.getReplyData(messageId))
|
||||
.then(result => {
|
||||
this.uid = result.data;
|
||||
this.replyData = result.data;
|
||||
this.formData.subject = this.replyData[0].replySubject;
|
||||
this.formData.body = this.replyData[0].replyBody;
|
||||
this.formData.relationmessage_id = messageId;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
}
|
||||
@@ -242,38 +224,43 @@ export default {
|
||||
},
|
||||
},
|
||||
created(){
|
||||
this.getUid(this.id, this.typeId);
|
||||
const missingparamsmsgs = [];
|
||||
if(!this.typeId)
|
||||
{
|
||||
missingparamsmsgs.push(this.$p.t('messages', 'errorMissingOrInvalidParameterRecipientTypeId'));
|
||||
}
|
||||
|
||||
if (['person_id', 'mitarbeiter_uid'].includes(this.typeId)){
|
||||
const params = {
|
||||
id: this.id,
|
||||
type_id: this.typeId
|
||||
};
|
||||
if(!this.id || this.id.length < 1)
|
||||
{
|
||||
missingparamsmsgs.push(this.$p.t('messages', 'errorMissingOrInvalidParameterRecipientIds'));
|
||||
}
|
||||
|
||||
this.$api
|
||||
.call(this.endpoint.getMessageVarsPerson(params))
|
||||
.then(result => {
|
||||
this.fieldsPerson = result.data;
|
||||
const person = this.fieldsPerson[0];
|
||||
this.itemsPerson = Object.entries(person).map(([key, value]) => ({
|
||||
label: key.toLowerCase(),
|
||||
value: '{' + key.toLowerCase() + '}'
|
||||
}));
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
}
|
||||
if(missingparamsmsgs.length > 0)
|
||||
{
|
||||
this.$fhcAlert.alertMultiple(missingparamsmsgs, 'warn', 'Warning', true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (['prestudent_id', 'uid'].includes(this.typeId)){
|
||||
const params = {
|
||||
id: this.id,
|
||||
type_id: this.typeId
|
||||
};
|
||||
if(this.typeId == 'person_id' || this.typeId == 'mitarbeiter_uid'){
|
||||
this.$api
|
||||
.call(this.endpoint.getMsgVarsPrestudent(params))
|
||||
.call(ApiMessages.getMessageVarsPerson(this.id, this.typeId))
|
||||
.then(result => {
|
||||
this.fieldsPerson = result.data;
|
||||
const person = this.fieldsPerson[0];
|
||||
this.itemsPerson = Object.entries(person).map(([key, value]) => ({
|
||||
label: key.toLowerCase(),
|
||||
value: '{' + key.toLowerCase() + '}'
|
||||
}));
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
}
|
||||
|
||||
if(this.typeId == 'prestudent_id' || this.typeId == 'uid'){
|
||||
this.$api
|
||||
.call(ApiMessages.getMsgVarsPrestudent(this.id, this.typeId))
|
||||
.then(result => {
|
||||
this.fieldsPrestudent = result.data;
|
||||
const prestudent = this.fieldsPrestudent[0];
|
||||
|
||||
this.itemsPrestudent = Object.entries(prestudent).map(([key, value]) => ({
|
||||
label: key.toLowerCase(),
|
||||
value: '{' + key.toLowerCase() + '}'
|
||||
@@ -283,7 +270,7 @@ export default {
|
||||
}
|
||||
|
||||
this.$api
|
||||
.call(this.endpoint.getMsgVarsLoggedInUser())
|
||||
.call(ApiMessages.getMsgVarsLoggedInUser())
|
||||
.then(result => {
|
||||
this.fieldsUser = result.data;
|
||||
const user = this.fieldsUser;
|
||||
@@ -295,28 +282,26 @@ export default {
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
this.$api
|
||||
.call(this.endpoint.getNameOfDefaultRecipient({
|
||||
id: this.id,
|
||||
type_id: this.typeId}))
|
||||
.call(ApiMessages.getNameOfDefaultRecipients(this.id, this.typeId))
|
||||
.then(result => {
|
||||
this.defaultRecipient = result.data;
|
||||
this.recipientsArray.push({
|
||||
'uid': this.uid,
|
||||
'details': this.defaultRecipient});
|
||||
this.defaultRecipients = result.data;
|
||||
this.defaultRecipientString = Object.values(this.defaultRecipients).join("; ");
|
||||
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
//case of reply
|
||||
if(this.messageId != null) {
|
||||
this.$api
|
||||
.call(this.endpoint.getReplyData(this.messageId))
|
||||
this.loadReplyData(this.messageId);
|
||||
/* this.$api
|
||||
.call(ApiMessages.getReplyData(this.messageId))
|
||||
.then(result => {
|
||||
this.replyData = result.data;
|
||||
this.formData.subject = this.replyData[0].replySubject;
|
||||
this.formData.body = this.replyData[0].replyBody;
|
||||
this.formData.relationmessage_id = this.messageId;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
.catch(this.$fhcAlert.handleSystemError);*/
|
||||
}
|
||||
|
||||
},
|
||||
@@ -330,7 +315,7 @@ export default {
|
||||
|
||||
<div class="messages-detail-newmessage-newdiv">
|
||||
<!--new page-->
|
||||
<div v-if="!messageSent" class="overflow-auto m-3">
|
||||
<div v-if="!messageSent" ref="divNewMessage" class="overflow-auto m-3">
|
||||
<h4>{{ $p.t('messages', 'neueNachricht') }}</h4>
|
||||
|
||||
<div class="row">
|
||||
@@ -343,7 +328,7 @@ export default {
|
||||
type="text"
|
||||
name="recipient"
|
||||
:label="$p.t('messages/recipient')"
|
||||
v-model="defaultRecipient"
|
||||
v-model="defaultRecipientString"
|
||||
disabled
|
||||
>
|
||||
</form-input>
|
||||
@@ -472,18 +457,18 @@ export default {
|
||||
v-model="defaultRecipient"
|
||||
>
|
||||
<option :value="null">{{ $p.t('messages', 'recipient') }}...</option>
|
||||
<option
|
||||
v-for="recipient in recipientsArray"
|
||||
:key="recipient.uid"
|
||||
:value="recipient.uid"
|
||||
>{{recipient.details}}
|
||||
<option
|
||||
v-for="(name, id) in defaultRecipients"
|
||||
:key="id"
|
||||
:value="Number(id)"
|
||||
> {{name}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2 mt-4">
|
||||
<br>
|
||||
<button type="button" class="btn btn-secondary" @click="showPreview(id, typeId)">{{ $p.t('ui', 'btnAktualisieren') }}</button>
|
||||
<button type="button" class="btn btn-secondary" @click="showPreview(defaultRecipient)">{{ $p.t('ui', 'btnAktualisieren') }}</button>
|
||||
</div>
|
||||
</form-form>
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import {CoreFilterCmpt} from "../../filter/Filter.js";
|
||||
import FormForm from '../../Form/Form.js';
|
||||
|
||||
import ApiMessages from "../../../api/factory/messages/messages.js"
|
||||
|
||||
export default {
|
||||
name: "TableMessages",
|
||||
components: {
|
||||
@@ -13,13 +15,9 @@ export default {
|
||||
},
|
||||
},
|
||||
props: {
|
||||
endpoint: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
typeId: String,
|
||||
id: {
|
||||
type: [Number, String],
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
messageLayout: String,
|
||||
@@ -38,12 +36,13 @@ export default {
|
||||
},
|
||||
ajaxResponse: (url, params, response) => this.buildTreemap(response),
|
||||
columns: [
|
||||
{title: "subject", field: "subject"},
|
||||
{title: "body", field: "body", formatter: "html", visible: false},
|
||||
{title: "message_id", field: "message_id", visible: false},
|
||||
{title: "subject", field: "subject", headerFilter: true},
|
||||
{title: "body", field: "body", formatter: "html", visible: false, headerFilter: true},
|
||||
{title: "message_id", field: "message_id", visible: false, headerFilter: true},
|
||||
{
|
||||
title: "Datum",
|
||||
field: "insertamum",
|
||||
headerFilter: true,
|
||||
formatter: function (cell) {
|
||||
const dateStr = cell.getValue();
|
||||
const date = new Date(dateStr); // Convert to Date object
|
||||
@@ -55,16 +54,28 @@ export default {
|
||||
minute: "2-digit",
|
||||
hour12: false
|
||||
});
|
||||
},
|
||||
headerFilterFunc(headerValue, rowValue) {
|
||||
const matches = headerValue.match(/^(([0-9]{2})\.)?([0-9]{2})\.([0-9]{4})?$/);
|
||||
let comparestr = headerValue;
|
||||
if(matches !== null) {
|
||||
const year = (matches[4] !== undefined) ? matches[4] : '';
|
||||
const month = matches[3];
|
||||
const day = (matches[2] !== undefined) ? matches[2] : '';
|
||||
comparestr = year + '-' + month + '-' + day;
|
||||
}
|
||||
return rowValue.match(comparestr);
|
||||
}
|
||||
},
|
||||
{title: "sender", field: "sender"},
|
||||
{title: "recipient", field: "recipient"},
|
||||
{title: "senderId", field: "sender_id"},
|
||||
{title: "recipientId", field: "recipient_id"},
|
||||
{title: "Relationmessage ID", field: "relationmessage_id"},
|
||||
{title: "sender", field: "sender", headerFilter: true},
|
||||
{title: "recipient", field: "recipient", headerFilter: true},
|
||||
{title: "senderId", field: "sender_id", headerFilter: true},
|
||||
{title: "recipientId", field: "recipient_id", headerFilter: true},
|
||||
{title: "Relationmessage ID", field: "relationmessage_id", headerFilter: true},
|
||||
{
|
||||
title: "Status",
|
||||
field: "status",
|
||||
headerFilter: true,
|
||||
formatterParams: [
|
||||
"unread",
|
||||
"read",
|
||||
@@ -73,11 +84,12 @@ export default {
|
||||
],
|
||||
formatter: (cell, formatterParams) => {
|
||||
return formatterParams[cell.getValue()];
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "letzte Änderung",
|
||||
field: "statusdatum",
|
||||
headerFilter: true,
|
||||
formatter: function (cell) {
|
||||
const dateStr = cell.getValue();
|
||||
const date = new Date(dateStr); // Convert to Date object
|
||||
@@ -89,6 +101,17 @@ export default {
|
||||
minute: "2-digit",
|
||||
hour12: false
|
||||
});
|
||||
},
|
||||
headerFilterFunc(headerValue, rowValue) {
|
||||
const matches = headerValue.match(/^(([0-9]{2})\.)?([0-9]{2})\.([0-9]{4})?$/);
|
||||
let comparestr = headerValue;
|
||||
if(matches !== null) {
|
||||
const year = (matches[4] !== undefined) ? matches[4] : '';
|
||||
const month = matches[3];
|
||||
const day = (matches[2] !== undefined) ? matches[2] : '';
|
||||
comparestr = year + '-' + month + '-' + day;
|
||||
}
|
||||
return rowValue.match(comparestr);
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -256,7 +279,7 @@ export default {
|
||||
},
|
||||
deleteMessage(message_id){
|
||||
return this.$api
|
||||
.call(this.endpoint.deleteMessage(message_id))
|
||||
.call(ApiMessages.deleteMessage(message_id))
|
||||
.then(response => {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete'));
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
@@ -322,7 +345,7 @@ export default {
|
||||
},
|
||||
loadAjaxCall(url, config, params){
|
||||
return this.$api.call(
|
||||
this.endpoint.getMessages(params)
|
||||
ApiMessages.getMessages(params)
|
||||
);
|
||||
}
|
||||
},
|
||||
@@ -347,13 +370,13 @@ export default {
|
||||
});*/
|
||||
},
|
||||
created(){
|
||||
if(this.typeId != 'person_id') {
|
||||
if(this.typeId != 'person_id' && Array.isArray(this.id) && this.id.length === 1) {
|
||||
const params = {
|
||||
id: this.id,
|
||||
type_id: this.typeId
|
||||
};
|
||||
this.$api
|
||||
.call(this.endpoint.getPersonId(params))
|
||||
.call(ApiMessages.getPersonId(params))
|
||||
.then(result => {
|
||||
this.personId = result.data;
|
||||
})
|
||||
|
||||
@@ -14,10 +14,6 @@ export default {
|
||||
}
|
||||
},
|
||||
props: {
|
||||
endpoint: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
typeId: {
|
||||
type: String,
|
||||
required: true,
|
||||
@@ -31,7 +27,7 @@ export default {
|
||||
}
|
||||
},
|
||||
id: {
|
||||
type: [Number, String],
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
showTable: Boolean,
|
||||
@@ -65,6 +61,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getControllerUrl() {
|
||||
return FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/NeueNachricht';
|
||||
},
|
||||
reloadTable(){
|
||||
this.$refs.templateTableMessage.reload();
|
||||
},
|
||||
@@ -77,44 +76,65 @@ export default {
|
||||
this.openInNewTab(id, typeId, messageId);
|
||||
}
|
||||
else if (this.openMode == "modal"){
|
||||
if(!messageId)
|
||||
this.$refs.modalMsg.resetForm();
|
||||
this.$refs.modalMsg.show();
|
||||
}
|
||||
else if (this.openMode == "inSamePage"){
|
||||
console.log("in same Page");
|
||||
this.isVisibleDiv = true;
|
||||
if(messageId)
|
||||
this.$refs.templateNewDivMessage.loadReplyData(messageId);
|
||||
else
|
||||
this.$refs.templateNewDivMessage.resetForm();
|
||||
|
||||
this.$refs.templateNewDivMessage.showTemplate();
|
||||
}
|
||||
else
|
||||
console.log("no valid openMode");
|
||||
},
|
||||
openInNewTab(id, typeId, messageId= null){
|
||||
openInNewTab(id, typeId, messageId=null){
|
||||
if(id.length > 1)
|
||||
{
|
||||
this.$refs['newMsgForm'].submit();
|
||||
return;
|
||||
}
|
||||
|
||||
let path = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
|
||||
let path = this.getControllerUrl();
|
||||
|
||||
if (messageId){
|
||||
path += "/NeueNachricht/" + id + "/" + typeId + "/" + messageId;
|
||||
path += "/" + encodeURIComponent(id) + "/" + encodeURIComponent(typeId) + "/" + encodeURIComponent(messageId);
|
||||
}
|
||||
|
||||
else {
|
||||
path += "/NeueNachricht/" + id + "/" + typeId;
|
||||
path += "/" + encodeURIComponent(id) + "/" + encodeURIComponent(typeId);
|
||||
}
|
||||
|
||||
const newTab = window.open(path, "_blank");
|
||||
},
|
||||
openInNewWindow(id, typeId, messageId){
|
||||
let path = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
|
||||
|
||||
if (messageId){
|
||||
path += "/NeueNachricht/" + id + "/" + typeId + "/" + messageId;
|
||||
}
|
||||
|
||||
else {
|
||||
path += "/NeueNachricht/" + id + "/" + typeId;
|
||||
}
|
||||
|
||||
const width = Math.round(window.innerWidth * 0.75);
|
||||
const height = Math.round(window.innerHeight * 0.75);
|
||||
const left = Math.round((window.innerWidth - width) / 2);
|
||||
const top = Math.round((window.innerHeight - height) / 2);
|
||||
|
||||
if(id.length > 1)
|
||||
{
|
||||
const newWindow = window.open('', "NewMsgWindow", `width=${width},height=${height},left=${left},top=${top}`);
|
||||
this.$refs['newMsgForm'].submit();
|
||||
return;
|
||||
}
|
||||
|
||||
let path = this.getControllerUrl();
|
||||
|
||||
if (messageId){
|
||||
path += "/" + encodeURIComponent(id) + "/" + encodeURIComponent(typeId) + "/" + encodeURIComponent(messageId);
|
||||
}
|
||||
|
||||
else {
|
||||
path += "/" + encodeURIComponent(id) + "/" + encodeURIComponent(typeId);
|
||||
}
|
||||
|
||||
const newWindow = window.open(path, "_blank", `width=${width},height=${height},left=${left},top=${top}`);
|
||||
},
|
||||
resetMessageId(){
|
||||
@@ -124,13 +144,21 @@ export default {
|
||||
},
|
||||
template: `
|
||||
<div class="core-messages h-100 pb-3">
|
||||
<!-- TODO(bh) set target _self for debugging post but _blank for newTab -->
|
||||
<form ref="newMsgForm"
|
||||
method="post"
|
||||
:action="getControllerUrl()"
|
||||
:target="(openMode === 'window') ? 'NewMsgWindow' : '_blank'"
|
||||
>
|
||||
<input type="hidden" name="typeid" :value="typeId">
|
||||
<input type="hidden" name="ids" :value="id">
|
||||
</form>
|
||||
|
||||
<message-modal
|
||||
ref="modalMsg"
|
||||
:type-id="typeId"
|
||||
:id="id"
|
||||
:message-id="messageId"
|
||||
:endpoint="endpoint"
|
||||
:openMode="openMode"
|
||||
@reloadTable="reloadTable"
|
||||
@resetMessageId="resetMessageId"
|
||||
@@ -138,26 +166,23 @@ export default {
|
||||
</message-modal>
|
||||
|
||||
<!--in same page-->
|
||||
<div v-if="isVisibleDiv" class="overflow-auto m-3" style="max-height: 500px; border: 1px solid #ccc;">
|
||||
<div v-show="isVisibleDiv" class="overflow-auto m-3" style="max-height: 500px; border: 1px solid #ccc;">
|
||||
<form-only
|
||||
ref="templateNewMessage"
|
||||
:temp-type-id="typeId"
|
||||
:temp-id="id"
|
||||
:temp-message-id="messageId"
|
||||
:endpoint="endpoint"
|
||||
ref="templateNewDivMessage"
|
||||
:type-id="typeId"
|
||||
:id="id"
|
||||
:message-id="messageId"
|
||||
:openMode="openMode"
|
||||
@reloadTable="reloadTable"
|
||||
>
|
||||
</form-only>
|
||||
</div>
|
||||
|
||||
|
||||
<div v-if="showTable">
|
||||
|
||||
<div v-if="showTable && id.length==1">
|
||||
<table-messages
|
||||
ref="templateTableMessage"
|
||||
:type-id="typeId"
|
||||
:id="id"
|
||||
:endpoint="endpoint"
|
||||
:messageLayout="messageLayout"
|
||||
:openMode="openMode"
|
||||
@newMessage="handleMessage"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import CoreMessages from "../../../Messages/Messages.js";
|
||||
import ApiMessages from "../../../../api/factory/messages/messages.js";
|
||||
//import ApiMessages from "../../../../api/factory/messages/messages.js";
|
||||
|
||||
export default {
|
||||
name: "TabMessages",
|
||||
@@ -11,29 +11,50 @@ export default {
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
endpoint: ApiMessages
|
||||
//endpoint: ApiMessages
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
prestudent_ids() {
|
||||
if (this.modelValue.prestudent_id)
|
||||
{
|
||||
return [this.modelValue.prestudent_id];
|
||||
}
|
||||
return this.modelValue.map(e => e.prestudent_id);
|
||||
},
|
||||
person_ids() {
|
||||
if (this.modelValue.person_id)
|
||||
{
|
||||
return [this.modelValue.person_id];
|
||||
}
|
||||
return this.modelValue.map(e => e.person_id);
|
||||
},
|
||||
},
|
||||
template: `
|
||||
<div class="stv-details-messages h-100 pb-3 overflow-hidden">
|
||||
|
||||
<template v-if="modelValue.prestudent_id">
|
||||
<core-messages
|
||||
ref="formc"
|
||||
:endpoint="endpoint"
|
||||
type-id="prestudent_id"
|
||||
:id="modelValue.prestudent_id"
|
||||
messageLayout="twoColumnsTableLeft"
|
||||
open-mode="modal"
|
||||
show-table
|
||||
>
|
||||
</core-messages>
|
||||
</template>
|
||||
<template v-else>
|
||||
<h3><strong>No valid prestudent_id!</strong></h3>
|
||||
<p>{{modelValue.anmerkungen}}</p>
|
||||
</template>
|
||||
|
||||
<template v-if="prestudent_ids">
|
||||
<core-messages
|
||||
ref="formc"
|
||||
type-id="prestudent_id"
|
||||
:id="prestudent_ids"
|
||||
messageLayout="twoColumnsTableLeft"
|
||||
open-mode="modal"
|
||||
show-table
|
||||
>
|
||||
</core-messages>
|
||||
</template>
|
||||
<template v-else >
|
||||
<core-messages
|
||||
ref="formc"
|
||||
type-id="person_id"
|
||||
:id="person_ids"
|
||||
messageLayout="twoColumnsTableLeft"
|
||||
open-mode="modal"
|
||||
show-table
|
||||
>
|
||||
</core-messages>
|
||||
</template>
|
||||
</div>
|
||||
`
|
||||
};
|
||||
@@ -169,6 +169,11 @@ export default {
|
||||
{
|
||||
this.localData.push(newEntry);
|
||||
|
||||
// reload tabulator mit tabulator method
|
||||
if (this.$refs.table?.tabulator) {
|
||||
this.$refs.table.tabulator.replaceData(this.localData);
|
||||
}
|
||||
|
||||
this.$emit('setMobilityPurposeToNewMobility', {
|
||||
zweck_code: this.formData.zweck_code,
|
||||
});
|
||||
@@ -198,7 +203,6 @@ export default {
|
||||
<br>
|
||||
|
||||
<div class="override_filtercmpt_actions_style">
|
||||
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
|
||||
@@ -157,6 +157,11 @@ export default {
|
||||
{
|
||||
this.localData.push(newEntry);
|
||||
|
||||
// reload tabulator mit tabulator method
|
||||
if (this.$refs.table?.tabulator) {
|
||||
this.$refs.table.tabulator.replaceData(this.localData);
|
||||
}
|
||||
|
||||
this.$emit('setMobilitySupportToNewMobility', {
|
||||
aufenthaltfoerderung_code: this.formData.aufenthaltfoerderung_code,
|
||||
});
|
||||
|
||||
@@ -69,10 +69,13 @@ export default {
|
||||
final: true,
|
||||
anmerkung: null
|
||||
},
|
||||
studiensemester: null,
|
||||
arrTypen: [],
|
||||
arrFirmen: [],
|
||||
arrLvs: [],
|
||||
arrNoten: [],
|
||||
arrStudiensemester: [],
|
||||
additional_lehrveranstaltung_id: null,
|
||||
filteredFirmen: [],
|
||||
abortController: {
|
||||
firma: null
|
||||
@@ -103,7 +106,11 @@ export default {
|
||||
this.formData.anmerkung = null;
|
||||
this.$refs.formDetails.clearValidation();
|
||||
},
|
||||
getFormData(statusNew, studiensemester_kurzbz, additional_lehrveranstaltung_id) {
|
||||
getFormData(newProjektarbeit, studiensemester_kurzbz, additional_lehrveranstaltung_id) {
|
||||
|
||||
this.additional_lehrveranstaltung_id = additional_lehrveranstaltung_id;
|
||||
this.studiensemester = studiensemester_kurzbz || this.defaultSemester;
|
||||
this.newProjektarbeit = newProjektarbeit;
|
||||
|
||||
this.$api
|
||||
.call(ApiStvProjektarbeit.getTypenProjektarbeit())
|
||||
@@ -112,18 +119,7 @@ export default {
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
this.$api
|
||||
.call(ApiStvProjektarbeit.getLehrveranstaltungen(
|
||||
this.student.uid,
|
||||
statusNew ? this.student.studiengang_kz : null,
|
||||
studiensemester_kurzbz ?? this.defaultSemester,
|
||||
additional_lehrveranstaltung_id
|
||||
))
|
||||
.then(result => {
|
||||
this.arrLvs = result.data
|
||||
}
|
||||
)
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
this.getLehrveranstaltungen();
|
||||
|
||||
this.$api
|
||||
.call(ApiStvProjektarbeit.getNoten())
|
||||
@@ -132,7 +128,14 @@ export default {
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
if (statusNew) this.resetForm();
|
||||
this.$api
|
||||
.call(ApiStvProjektarbeit.getStudiensemester())
|
||||
.then(result => {
|
||||
this.arrStudiensemester = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
if (this.newProjektarbeit) this.resetForm();
|
||||
},
|
||||
loadProjektarbeit(projektarbeit_id) {
|
||||
|
||||
@@ -178,9 +181,30 @@ export default {
|
||||
this.filteredFirmen = result.data;
|
||||
});
|
||||
},
|
||||
getLehrveranstaltungen() {
|
||||
return this.$api
|
||||
.call(ApiStvProjektarbeit.getLehrveranstaltungen(
|
||||
this.student.uid,
|
||||
this.newProjektarbeit ? this.student.studiengang_kz : null,
|
||||
this.studiensemester,
|
||||
this.additional_lehrveranstaltung_id
|
||||
))
|
||||
.then(result => {
|
||||
this.arrLvs = result.data
|
||||
}
|
||||
)
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
lvChanged(event) {
|
||||
this.formData.lehreinheit_id = null;
|
||||
},
|
||||
studiensemesterChanged() {
|
||||
this.formData.lehreinheit_id = null;
|
||||
this.getLehrveranstaltungen();
|
||||
},
|
||||
gesperrtBisChanged(newSperrdatum) {
|
||||
this.formData.freigegeben = newSperrdatum == null || newSperrdatum == '';
|
||||
},
|
||||
// enrich and modify data before sending
|
||||
getPreparedFormData() {
|
||||
let preparedFormData = JSON.parse(JSON.stringify(this.formData)); // deep copy
|
||||
@@ -281,7 +305,7 @@ export default {
|
||||
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
container-class="stv-details-projektarbeit-lv"
|
||||
container-class="stv-details-projektarbeit-lv col-10"
|
||||
:label="$p.t('projektarbeit', 'lehrveranstaltung')"
|
||||
type="select"
|
||||
v-model="formData.lehrveranstaltung_id"
|
||||
@@ -297,6 +321,23 @@ export default {
|
||||
{{lv.bezeichnung + (lv.orgform_kurzbz ? ' ' + lv.orgform_kurzbz : '') + ' (' + lv.semester + ' Sem) ID: ' + lv.lehrveranstaltung_id}}
|
||||
</option>
|
||||
</form-input>
|
||||
<form-input
|
||||
container-class="col-2"
|
||||
:label="$p.t('lehre', 'studiensemester')"
|
||||
type="select"
|
||||
v-model="studiensemester"
|
||||
name="studiensemester"
|
||||
@change="studiensemesterChanged"
|
||||
>
|
||||
<option :value="null"> -- {{$p.t('fehlermonitoring', 'keineAuswahl')}} -- </option>
|
||||
<option
|
||||
v-for="sem in arrStudiensemester"
|
||||
:key="sem.studiensemester_kurzbz"
|
||||
:value="sem.studiensemester_kurzbz"
|
||||
>
|
||||
{{sem.studiensemester_kurzbz}}
|
||||
</option>
|
||||
</form-input>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
@@ -362,6 +403,7 @@ export default {
|
||||
format="dd.MM.yyyy"
|
||||
model-type="yyyy-MM-dd"
|
||||
name="gesperrtbis"
|
||||
@update:model-value="gesperrtBisChanged"
|
||||
>
|
||||
</form-input>
|
||||
<div class="col-4">
|
||||
|
||||
+20
-3
@@ -47,16 +47,25 @@ export default {
|
||||
{
|
||||
event: 'tableBuilt',
|
||||
handler: async() => {
|
||||
await this.$p.loadCategory(['global', 'person', 'stv', 'ui', 'projektarbeit']);
|
||||
await this.$p.loadCategory(['global', 'person', 'lehre', 'stv', 'ui', 'projektarbeit']);
|
||||
|
||||
let cm = this.$refs.table.tabulator.columnManager;
|
||||
|
||||
cm.getColumnByField('projekttyp_kurzbz').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'typ_kurzbz')
|
||||
});
|
||||
cm.getColumnByField('bezeichnung').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'typ')
|
||||
});
|
||||
cm.getColumnByField('studiensemester_kurzbz').component.updateDefinition({
|
||||
title: this.$p.t('lehre', 'studiensemester')
|
||||
});
|
||||
cm.getColumnByField('titel').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'titel')
|
||||
});
|
||||
cm.getColumnByField('note').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'gesamtnote')
|
||||
});
|
||||
cm.getColumnByField('beginn').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'beginn')
|
||||
});
|
||||
@@ -78,6 +87,12 @@ export default {
|
||||
cm.getColumnByField('firma_id').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'firmaId')
|
||||
});
|
||||
cm.getColumnByField('abgabedatum').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'abgabeEndupload')
|
||||
});
|
||||
cm.getColumnByField('actions').component.updateDefinition({
|
||||
title: this.$p.t('global', 'aktionen')
|
||||
});
|
||||
}
|
||||
},
|
||||
],
|
||||
@@ -101,6 +116,7 @@ export default {
|
||||
{title: "Typ Kurzbz", field: "projekttyp_kurzbz", visible: false},
|
||||
{title: "Studiensemester", field: "studiensemester_kurzbz"},
|
||||
{title: "Titel", field: "titel"},
|
||||
{title: "Gesamtnote", field: "note"},
|
||||
{
|
||||
title: "Abgabe Enduplad",
|
||||
field: "abgabedatum",
|
||||
@@ -183,6 +199,7 @@ export default {
|
||||
{title: "Anmerkung", field: "anmerkung", visible: false},
|
||||
{title: "Lehreinheit ID", field: "lehreinheit_id", visible: false},
|
||||
{title: "Student UID", field: "student_uid", visible: false},
|
||||
{title: "Projektbetreuer", field: "projektbetreuer"},
|
||||
{
|
||||
title:"Final",
|
||||
field:"final",
|
||||
@@ -258,7 +275,7 @@ export default {
|
||||
this.statusNew = true;
|
||||
this.editedProjektarbeit = null;
|
||||
this.toggleMenu('details');
|
||||
this.$refs.projektarbeitDetails.getFormData(this.statusNew);
|
||||
this.$refs.projektarbeitDetails.getFormData(this.statusNew, null, null);
|
||||
this.$refs.projektarbeitModal.show();
|
||||
},
|
||||
actionEditProjektarbeit() {
|
||||
@@ -388,7 +405,7 @@ export default {
|
||||
<div class="tab-pane fade show" :class="activeTab == 'betreuer' ? 'active' : ''" id="betreuer" role="tabpanel" aria-labelledby="betreuer-tab">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<projektbetreuer ref="projektbetreuer" :config="config"></projektbetreuer>
|
||||
<projektbetreuer ref="projektbetreuer" :config="config" @betreuer-saved="reload"></projektbetreuer>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+96
-57
@@ -20,6 +20,7 @@ export default {
|
||||
Contact,
|
||||
Vertrag
|
||||
},
|
||||
emits: ['betreuerSaved'],
|
||||
provide() {
|
||||
return {
|
||||
configShowVertragsdetails: this.config.showVertragsdetails
|
||||
@@ -115,7 +116,7 @@ export default {
|
||||
frozen: true
|
||||
},
|
||||
],
|
||||
layout: 'fitDataStretchFrozen',
|
||||
layout: 'fitData',
|
||||
layoutColumnsOnNewData: false,
|
||||
height: 'auto',
|
||||
minHeight: '100',
|
||||
@@ -125,13 +126,49 @@ export default {
|
||||
persistence:{
|
||||
columns: true, //persist column layout
|
||||
},
|
||||
persistenceID: 'stv-details-projektbetreuer-2025112401'
|
||||
persistenceID: 'stv-details-projektbetreuer-2025121201'
|
||||
},
|
||||
tabulatorEvents: [
|
||||
{
|
||||
event: 'tableBuilt',
|
||||
handler: async() => {
|
||||
await this.$p.loadCategory(['global', 'person', 'stv', 'projektarbeit', 'ui']);
|
||||
await this.$p.loadCategory(['global', 'person', 'lehre', 'stv', 'projektarbeit', 'ui']);
|
||||
|
||||
let cm = this.$refs.projektbetreuerTable.tabulator.columnManager;
|
||||
|
||||
cm.getColumnByField('nachname').component.updateDefinition({
|
||||
title: this.$p.t('person', 'nachname')
|
||||
});
|
||||
cm.getColumnByField('vorname').component.updateDefinition({
|
||||
title: this.$p.t('person', 'vorname')
|
||||
});
|
||||
cm.getColumnByField('note').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'note')
|
||||
});
|
||||
cm.getColumnByField('punkte').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'punkte')
|
||||
});
|
||||
cm.getColumnByField('stunden').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'stunden')
|
||||
});
|
||||
cm.getColumnByField('stundensatz').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'stundensatz')
|
||||
});
|
||||
cm.getColumnByField('betreuerart_kurzbz').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'betreuerart_kurzbz')
|
||||
});
|
||||
cm.getColumnByField('person_id').component.updateDefinition({
|
||||
title: this.$p.t('person', 'person_id')
|
||||
});
|
||||
cm.getColumnByField('vertrag_id').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'vertrag_id')
|
||||
});
|
||||
cm.getColumnByField('projektarbeit_id').component.updateDefinition({
|
||||
title: this.$p.t('projektarbeit', 'projektarbeit_id')
|
||||
});
|
||||
cm.getColumnByField('actions').component.updateDefinition({
|
||||
title: this.$p.t('global', 'actions')
|
||||
});
|
||||
|
||||
// Force layout recalculation for handling overflow text
|
||||
this.$refs.projektbetreuerTable.tabulator.redraw(true);
|
||||
@@ -152,6 +189,7 @@ export default {
|
||||
stunden: null,
|
||||
stundensatz: null
|
||||
},
|
||||
defaultStundensatz: null,
|
||||
newMode: false,
|
||||
editMode: false,
|
||||
initialFormData: null,
|
||||
@@ -171,53 +209,49 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
actionNewProjektbetreuer() {
|
||||
this.resetForm();
|
||||
this.newMode = !this.newMode;
|
||||
this.editMode = false;
|
||||
this.resetForm();
|
||||
this.defaultStundensatz = this.config.defaultProjektbetreuerStundensatz;
|
||||
this.captureFormData();
|
||||
},
|
||||
actionEditProjektbetreuer(projektarbeit_id, person_id, betreuerart_kurzbz) {
|
||||
this.editMode = true;
|
||||
this.newMode = false;
|
||||
this.$api
|
||||
.call(ApiStvProjektbetreuer.getDefaultStundensaetze(person_id, this.studiensemester_kurzbz))
|
||||
.then(result => {
|
||||
this.resetForm();
|
||||
this.resetForm();
|
||||
this.getDefaultStundensaetze(person_id).finally(() => {
|
||||
|
||||
// get betreuer from tabulator list
|
||||
let projektbetreuerListe = this.$refs.projektbetreuerTable.tabulator.getData();
|
||||
const idx = projektbetreuerListe.findIndex(
|
||||
betr =>
|
||||
betr.person_id === person_id &&
|
||||
betr.projektarbeit_id === projektarbeit_id &&
|
||||
betr.betreuerart_kurzbz === betreuerart_kurzbz
|
||||
);
|
||||
// get betreuer from tabulator list
|
||||
let projektbetreuerListe = this.$refs.projektbetreuerTable.tabulator.getData();
|
||||
const idx = projektbetreuerListe.findIndex(
|
||||
betr =>
|
||||
betr.person_id === person_id &&
|
||||
betr.projektarbeit_id === projektarbeit_id &&
|
||||
betr.betreuerart_kurzbz === betreuerart_kurzbz
|
||||
);
|
||||
|
||||
if (idx >= 0) { // if betreuer found
|
||||
if (idx >= 0) { // if betreuer found
|
||||
|
||||
// set currently edited betreuer (deep copy)
|
||||
this.formData = JSON.parse(JSON.stringify(projektbetreuerListe[idx]));
|
||||
// set currently edited betreuer (deep copy)
|
||||
this.formData = JSON.parse(JSON.stringify(projektbetreuerListe[idx]));
|
||||
|
||||
// set download link
|
||||
if (this.formData.beurteilungDownloadLink !== null) this.beurteilungDownloadLink = this.formData.beurteilungDownloadLink;
|
||||
// set download link
|
||||
if (this.formData.beurteilungDownloadLink !== null) this.beurteilungDownloadLink = this.formData.beurteilungDownloadLink;
|
||||
|
||||
// set betreuer for autocomplete field
|
||||
this.autocompleteSelectedBetreuer = {
|
||||
person_id: this.formData.person_id,
|
||||
name: this.formData.name,
|
||||
vorname: this.formData.vorname,
|
||||
nachname: this.formData.nachname,
|
||||
vertrag_id: this.formData.vertrag_id
|
||||
};
|
||||
}
|
||||
// set betreuer for autocomplete field
|
||||
this.autocompleteSelectedBetreuer = {
|
||||
person_id: this.formData.person_id,
|
||||
name: this.formData.name,
|
||||
vorname: this.formData.vorname,
|
||||
nachname: this.formData.nachname,
|
||||
vertrag_id: this.formData.vertrag_id
|
||||
};
|
||||
}
|
||||
|
||||
// set default stundensatz (if no other is set yet)
|
||||
if (this.formData.stundensatz == null) this.formData.stundensatz = result.data;
|
||||
// capture initial form data for detecting changes
|
||||
this.captureFormData();
|
||||
});
|
||||
|
||||
// capture initial form data for detecting changes
|
||||
this.captureFormData();
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
actionDeleteProjektbetreuer(betreuer_id, projektarbeit_id, person_id, betreuerart_kurzbz) {
|
||||
this.$fhcAlert
|
||||
@@ -239,6 +273,7 @@ export default {
|
||||
// default Stundensätze from config
|
||||
this.defaultFormDataValues.stunden = this.getDefaultStunden(projekttyp_kurzbz);
|
||||
this.defaultFormDataValues.stundensatz = this.config.defaultProjektbetreuerStundensatz;
|
||||
this.defaultStundensatz = this.config.defaultProjektbetreuerStundensatz;
|
||||
|
||||
// get other initial data
|
||||
this.$api
|
||||
@@ -271,7 +306,7 @@ export default {
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
} else {
|
||||
this.emptyBetreuer();
|
||||
this.emptyBetreuerList();
|
||||
}
|
||||
},
|
||||
saveProjektbetreuer() {
|
||||
@@ -282,6 +317,7 @@ export default {
|
||||
this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave'));
|
||||
this.getProjektbetreuer(this.projektarbeit_id, this.studiensemester_kurzbz);
|
||||
this.resetModes();
|
||||
this.$emit('betreuerSaved');
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
@@ -297,11 +333,12 @@ export default {
|
||||
this.filteredBetreuer = result.data;
|
||||
});
|
||||
},
|
||||
emptyBetreuer() {
|
||||
emptyBetreuerList() {
|
||||
this.$refs.projektbetreuerTable.tabulator.clearData();
|
||||
},
|
||||
resetForm() {
|
||||
this.formData = this.getDefaultFormData();
|
||||
const defaultFormData = this.getDefaultFormData();
|
||||
this.formData = defaultFormData;
|
||||
if (this.beurteilungDownloadLink !== null) this.beurteilungDownloadLink = '';
|
||||
this.autocompleteSelectedBetreuer = null;
|
||||
this.initialFormData = null;
|
||||
@@ -360,28 +397,24 @@ export default {
|
||||
},
|
||||
setDefaultStunden(projekttyp_kurzbz) {
|
||||
this.projekttyp_kurzbz = projekttyp_kurzbz;
|
||||
// if form data has not already been modified by user, set the default stunden
|
||||
if (!this.formDataModified()) {
|
||||
// set default stunden if not in edit mode (so hours of editen person are not overwritten)
|
||||
if (!this.editMode)
|
||||
{
|
||||
let defaultStunden = this.getDefaultStunden(projekttyp_kurzbz);
|
||||
// adapt initial form data so it does not count as modified
|
||||
if (this.initialFormData) this.initialFormData.stunden = defaultStunden;
|
||||
// set default Stunden
|
||||
this.formData.stunden = defaultStunden;
|
||||
}
|
||||
},
|
||||
// check if form data has been modified since initial data has been captured
|
||||
formDataModified() {
|
||||
if (this.autocompleteSelectedBetreuer != null) return true;
|
||||
|
||||
for (const prop in this.initialFormData) {
|
||||
if (typeof this.formData[prop] == 'undefined') return true;
|
||||
if (this.formData[prop] != this.initialFormData[prop]) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
getDefaultStundensaetze(person_id) {
|
||||
return this.$api
|
||||
.call(ApiStvProjektbetreuer.getDefaultStundensaetze(person_id, this.studiensemester_kurzbz))
|
||||
.then(result => {
|
||||
// set default stundensatz (if no other is set yet)
|
||||
this.defaultStundensatz = result.data;
|
||||
this.formData.stundensatz = result.data;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
actionNewPerson() {
|
||||
this.$refs.newPersonModal.reset();
|
||||
this.$refs.newPersonModal.open();
|
||||
},
|
||||
actionKontaktdatenBearbeiten() {
|
||||
@@ -395,12 +428,16 @@ export default {
|
||||
.then(response => {
|
||||
// set the new person in Betreuer autocomplete field
|
||||
this.autocompleteSelectedBetreuer = response.data;
|
||||
this.getDefaultStundensaetze(this.autocompleteSelectedBetreuer.person_id);
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError)
|
||||
},
|
||||
// disable fields which are dependent on Vertrag status
|
||||
disableVertragFields(statusAkzeptiert) {
|
||||
this.vertragFieldsDisabled = statusAkzeptiert;
|
||||
},
|
||||
onBetreuerSelected(ev) {
|
||||
this.getDefaultStundensaetze(ev.value.person_id);
|
||||
}
|
||||
},
|
||||
template: `
|
||||
@@ -422,7 +459,7 @@ export default {
|
||||
>
|
||||
</core-filter-cmpt>
|
||||
|
||||
<form-form ref="formProjektbetreuer" v-show="betreuerFormOpened" @submit.prevent>
|
||||
<form-form ref="formProjektbetreuer" v-show="betreuerFormOpened" class="mt-3" @submit.prevent >
|
||||
<div class="row mb-3">
|
||||
<form-input
|
||||
container-class="stv-details-projektarbeit-betreuer"
|
||||
@@ -433,6 +470,8 @@ export default {
|
||||
name="person_id"
|
||||
:suggestions="filteredBetreuer"
|
||||
@complete="searchBetreuer"
|
||||
@item-select="onBetreuerSelected"
|
||||
@option-select="onBetreuerSelected"
|
||||
:min-length="3"
|
||||
:disabled="vertragFieldsDisabled"
|
||||
>
|
||||
@@ -502,7 +541,7 @@ export default {
|
||||
container-class="stv-details-projektarbeit-stundensatz"
|
||||
type="text"
|
||||
name="stundensatz"
|
||||
:label="$p.t('projektarbeit', 'stundensatz')"
|
||||
:label="$p.t('projektarbeit', 'stundensatz') + (defaultStundensatz ? ' (Default ' + defaultStundensatz + ')' : '')"
|
||||
:disabled="vertragFieldsDisabled"
|
||||
v-model="formData.stundensatz"
|
||||
>
|
||||
|
||||
@@ -495,9 +495,7 @@ export default {
|
||||
:side-menu="false"
|
||||
reload
|
||||
:download="downloadConfig"
|
||||
` + /* TODO(chris): Ausgeblendet für Testing
|
||||
new-btn-show
|
||||
*/`
|
||||
:new-btn-label="$p.t('stv/action_new')"
|
||||
@click:new="actionNewPrestudent"
|
||||
@table-built="translateTabulator"
|
||||
|
||||
@@ -6,13 +6,18 @@ import FormInput from '../../../Form/Input.js';
|
||||
import accessibility from '../../../../directives/accessibility.js';
|
||||
|
||||
import ApiStvStudents from '../../../../api/factory/stv/students.js';
|
||||
import ApiStvAddress from '../../../../api/factory/stv/kontakt/address.js';
|
||||
import ApiStudiensemester from '../../../../api/factory/studiensemester.js';
|
||||
import ApiStudienplan from '../../../../api/factory/studienplan.js';
|
||||
|
||||
var _uuid = 0;
|
||||
const FORMDATA_DEFAULT = {
|
||||
address: {
|
||||
func: 1,
|
||||
checked: true,
|
||||
nation: 'A'
|
||||
},
|
||||
vorname: '',
|
||||
nachname: '',
|
||||
geburtsnation: 'A',
|
||||
staatsbuergerschaft: 'A',
|
||||
ausbildungssemester: 1,
|
||||
@@ -35,14 +40,14 @@ export default {
|
||||
],
|
||||
emits: ['saved'],
|
||||
props: {
|
||||
personOnly: Boolean,
|
||||
personOnly: Boolean,
|
||||
studiengangKz: Number,
|
||||
studiensemesterKurzbz: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
places: [],
|
||||
formData: FORMDATA_DEFAULT,
|
||||
formData: null,
|
||||
suggestions: {},
|
||||
person: null,
|
||||
semester: [],
|
||||
@@ -60,7 +65,7 @@ export default {
|
||||
return this.formData;
|
||||
},
|
||||
orte() {
|
||||
return this.places.filter(ort => ort.name == this.formData.address.gemeinde);
|
||||
return this.places.filter(ort => ort.name == this.formData?.address.gemeinde);
|
||||
},
|
||||
gemeinden() {
|
||||
return Object.values(this.places.reduce((res,place) => {
|
||||
@@ -70,7 +75,7 @@ export default {
|
||||
},
|
||||
formDataStg: {
|
||||
get() {
|
||||
return this.formData.studiengang_kz !== undefined ? this.formData.studiengang_kz : this.studiengangKz;
|
||||
return this.formData?.studiengang_kz !== undefined ? this.formData?.studiengang_kz : this.studiengangKz;
|
||||
},
|
||||
set(v) {
|
||||
this.formData.studiengang_kz = v;
|
||||
@@ -78,7 +83,7 @@ export default {
|
||||
},
|
||||
formDataSem: {
|
||||
get() {
|
||||
return this.formData.studiensemester_kurzbz !== undefined ? this.formData.studiensemester_kurzbz : this.studiensemesterKurzbz;
|
||||
return this.formData?.studiensemester_kurzbz !== undefined ? this.formData?.studiensemester_kurzbz : this.studiensemesterKurzbz;
|
||||
},
|
||||
set(v) {
|
||||
this.formData.studiensemester_kurzbz = v;
|
||||
@@ -98,10 +103,10 @@ export default {
|
||||
this.$refs.modal.show();
|
||||
},
|
||||
reset() {
|
||||
this.formData = FORMDATA_DEFAULT;
|
||||
this.formData = JSON.parse(JSON.stringify(FORMDATA_DEFAULT));
|
||||
this.person = null;
|
||||
this.suggestions = [];
|
||||
this.$refs.form.clearValidation();
|
||||
if (this.$refs.form) this.$refs.form.clearValidation();
|
||||
},
|
||||
loadSuggestions() {
|
||||
if (this.abortController.suggestions)
|
||||
@@ -112,10 +117,10 @@ export default {
|
||||
this.abortController.suggestions = new AbortController();
|
||||
|
||||
this.$api
|
||||
.call(ApiStvStudents.check({
|
||||
vorname: this.formData.vorname,
|
||||
nachname: this.formData.nachname,
|
||||
gebdatum: this.formData.gebdatum
|
||||
.call(ApiStvStudents.getPerson({
|
||||
vorname: this.formData?.vorname,
|
||||
nachname: this.formData?.nachname,
|
||||
gebdatum: this.formData?.gebdatum
|
||||
}), {
|
||||
signal: this.abortController.suggestions.signal
|
||||
})
|
||||
@@ -134,41 +139,40 @@ export default {
|
||||
loadPlaces() {
|
||||
if (this.abortController.places)
|
||||
this.abortController.places.abort();
|
||||
if (this.formData.address.nation != 'A' || !this.formData.address.plz)
|
||||
if (this.formData?.address?.nation != 'A' || !this?.formData?.address?.plz)
|
||||
return;
|
||||
|
||||
this.abortController.places = new AbortController();
|
||||
this.$refs.form
|
||||
.get(
|
||||
'api/frontend/v1/stv/address/getPlaces/' + this.formData.address.plz,
|
||||
undefined,
|
||||
{
|
||||
signal: this.abortController.places.signal
|
||||
}
|
||||
)
|
||||
.then(result => {
|
||||
this.places = result.data
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.code != "ERR_CANCELED")
|
||||
window.setTimeout(this.loadPlaces, 100);
|
||||
else
|
||||
this.$fhcAlert.handleSystemError(error);
|
||||
});
|
||||
this.$refs.form.call(
|
||||
ApiStvAddress.getPlaces(this.formData?.address.plz)
|
||||
//~ undefined,
|
||||
//~ {
|
||||
//~ signal: this.abortController.places.signal
|
||||
//~ }
|
||||
)
|
||||
.then(result => {
|
||||
this.places = result.data
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.code != "ERR_CANCELED")
|
||||
window.setTimeout(this.loadPlaces, 100);
|
||||
else
|
||||
this.$fhcAlert.handleSystemError(error);
|
||||
});
|
||||
},
|
||||
loadStudienplaene() {
|
||||
if (this.formDataStg)
|
||||
CoreRESTClient
|
||||
.post('components/stv/studienplan/get', {
|
||||
studiengang_kz: this.formDataStg,
|
||||
studiensemester_kurzbz: this.formDataSem,
|
||||
ausbildungssemester: this.formData.ausbildungssemester,
|
||||
orgform_kurzbz: this.formData.orgform_kurzbz
|
||||
})
|
||||
.then(result => CoreRESTClient.getData(result.data) || [])
|
||||
if (this.formDataStg) {
|
||||
this.$api
|
||||
.call(ApiStudienplan.getStudienplaeneBySemester(
|
||||
this.formDataStg,
|
||||
this.formDataSem,
|
||||
this.formData?.ausbildungssemester,
|
||||
this.formData?.orgform_kurzbz
|
||||
))
|
||||
.then(result => result.data || [])
|
||||
.then(result => {
|
||||
this.studienplaene = result;
|
||||
if (this.formData.studienplan_id !== '' && !this.studienplaene.filter(plan => plan.studienplan_id == this.formData.studienplan_id).length)
|
||||
if (this.formData?.studienplan_id !== '' && !this.studienplaene.filter(plan => plan.studienplan_id == this.formData?.studienplan_id).length)
|
||||
this.formData.studienplan_id = '';
|
||||
})
|
||||
.catch(error => {
|
||||
@@ -179,12 +183,13 @@ export default {
|
||||
if (error.code != "ERR_CANCELED")
|
||||
window.setTimeout(this.loadStudienplaene, 100);
|
||||
})
|
||||
}
|
||||
},
|
||||
changeAddressNation(e) {
|
||||
if (this.formData['geburtsnation'] == this.formData['address']['nation'])
|
||||
this.formData['geburtsnation'] = e.target.value;
|
||||
if (this.formData['staatsbuergerschaft'] == this.formData['address']['nation'])
|
||||
this.formData['staatsbuergerschaft'] = e.target.value;
|
||||
if (this.formData.geburtsnation == this.formData?.address.nation)
|
||||
this.formData.geburtsnation = e.target.value;
|
||||
if (this.formData.staatsbuergerschaft == this.formData?.address.nation)
|
||||
this.formData.staatsbuergerschaft = e.target.value;
|
||||
this.loadPlaces();
|
||||
},
|
||||
send(e) {
|
||||
@@ -213,29 +218,38 @@ export default {
|
||||
setPerson(suggestion)
|
||||
{
|
||||
this.person = suggestion;
|
||||
this.formData.address.func = -1;
|
||||
this.formData.address.checked = false;
|
||||
},
|
||||
dateFormatter(val)
|
||||
{
|
||||
if (!val)
|
||||
return '';
|
||||
let date = new Date(val);
|
||||
return date.toLocaleDateString('de-AT', {
|
||||
"day": "2-digit",
|
||||
"month": "2-digit",
|
||||
"year": "numeric"
|
||||
});
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.uuid = _uuid++;
|
||||
CoreRESTClient
|
||||
.get('components/stv/Studiensemester')
|
||||
.then(result => CoreRESTClient.getData(result.data) || [])
|
||||
.then(result => {
|
||||
this.semester = result;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
this.reset();
|
||||
this.$api.call(ApiStudiensemester.getAll())
|
||||
.then(result => result.data || [])
|
||||
.then(result => {
|
||||
this.semester = result;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
template: `
|
||||
<fhc-form ref="form" class="stv-list-new" @submit.prevent="send">
|
||||
<bs-modal ref="modal" dialog-class="modal-lg modal-dialog-scrollable" @hidden-bs-modal="reset">
|
||||
<bs-modal ref="modal" dialog-class="modal-lg modal-dialog-scrollable" style="min-height: 500px" @hidden-bs-modal="reset">
|
||||
<template #title>
|
||||
{{ personOnly ? $p.t('person', 'personAnlegen') : $p.t('lehre', 'interessentAnlegen') }}
|
||||
</template>
|
||||
<template #default>
|
||||
|
||||
<form-validation></form-validation>
|
||||
|
||||
<template v-if="person === null">
|
||||
<div class="row">
|
||||
<div class="col-sm-4 mb-3">
|
||||
@@ -275,16 +289,25 @@ export default {
|
||||
@update:model-value="loadSuggestions"
|
||||
text-input
|
||||
auto-apply
|
||||
no-today
|
||||
no-today
|
||||
:enable-time-picker="false"
|
||||
format="dd.MM.yyyy"
|
||||
:teleport="true"
|
||||
>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
<!-- TODO(chris): more details -->
|
||||
<table class="table caption-top table-striped table-hover">
|
||||
<table class="table caption-top table-striped table-hover" >
|
||||
<caption>{{ $p.t('person', 'personExistiertPruefung') }}</caption>
|
||||
<thead v-if="suggestions?.length">
|
||||
<th>{{ $p.t('person', 'nachname') }}</th>
|
||||
<th>{{ $p.t('person', 'vorname') }}</th>
|
||||
<th>{{ $p.t('person', 'weitereVornamen') }}</th>
|
||||
<th>{{ $p.t('person', 'geburtsdatum') }}</th>
|
||||
<th>{{ $p.t('person', 'geschlecht') }}</th>
|
||||
<th>{{ $p.t('person', 'adresse') }}</th>
|
||||
<th>Status</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr
|
||||
v-for="(suggestion, index) in suggestions"
|
||||
@@ -293,8 +316,21 @@ export default {
|
||||
@click="(index == 2) ? suggestions.shift() : setPerson(suggestion)"
|
||||
v-accessibility:tab.vertical
|
||||
>
|
||||
<td>{{suggestion.vorname + ' ' + suggestion.nachname}}</td>
|
||||
<td></td>
|
||||
<td>{{ suggestion.nachname }}</td>
|
||||
<td>{{ suggestion.vorname }}</td>
|
||||
<td>{{ suggestion.vornamen }}</td>
|
||||
<td>{{ dateFormatter(suggestion.gebdatum) }}</td>
|
||||
<td>{{ suggestion.geschlecht_bezeichnung }}</td>
|
||||
<td>
|
||||
<div v-for="adresse in suggestion.adressen">
|
||||
{{ (adresse.plz ?? '') + (adresse.plz && adresse.ort ? ' ' : '') + (adresse.ort ?? '') + (adresse.ort && adresse.strasse ? ', ' : '') + (adresse.strasse ?? '') }}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div v-for="status in suggestion.status">
|
||||
{{ status.status_kurzbz + " " + status.studiengang_kuerzel }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -418,23 +454,22 @@ export default {
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6 mb-3">
|
||||
<form-input
|
||||
type="select"
|
||||
id="stv-list-new-address-func"
|
||||
name="address[func]"
|
||||
v-model="formData['address']['func']"
|
||||
:label="$p.t('person', 'adresseHinzufuegen')"
|
||||
type="checkbox"
|
||||
id="stv-new-adresse"
|
||||
name="adresseChecked"
|
||||
v-model="formData['address']['checked']"
|
||||
value="true"
|
||||
>
|
||||
<option value="-1" v-if="person">{{ $p.t('person', 'bestehendeAdresseUeberschreiben') }}</option>
|
||||
<option value="1">{{ $p.t('person', 'adresseHinzufuegen') }}</option>
|
||||
<option value="0">{{ $p.t('person', 'adresseNichtAnlegen') }}</option>
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset v-if="formData['address']['func'] != 0">
|
||||
<fieldset v-if="formData['address']['checked']">
|
||||
<hr>
|
||||
<legend>Adresse</legend>
|
||||
<div class="row">
|
||||
<div class="col-sm-4 mb-3">
|
||||
@@ -519,6 +554,7 @@ export default {
|
||||
</form-input>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
</fieldset>
|
||||
|
||||
<div class="row">
|
||||
@@ -644,7 +680,7 @@ export default {
|
||||
name="ausbildungssemester"
|
||||
v-model="formData['ausbildungssemester']"
|
||||
:disabled="formData['incoming']"
|
||||
@input="loadStudienplaene"
|
||||
@change="loadStudienplaene"
|
||||
>
|
||||
<option v-for="sem in Array.from({length:8}).map((u,i) => i+1)" :key="sem" :value="sem">{{sem}}. Semester</option>
|
||||
</form-input>
|
||||
@@ -658,7 +694,7 @@ export default {
|
||||
id="stv-list-new-orgform_kurzbz"
|
||||
name="orgform_kurzbz"
|
||||
v-model="formData['orgform_kurzbz']"
|
||||
@input="loadStudienplaene"
|
||||
@change="loadStudienplaene"
|
||||
>
|
||||
<option value="">-- keine Auswahl --</option>
|
||||
<option v-for="orgform in lists.orgforms" :key="orgform.orgform_kurzbz" :value="orgform.orgform_kurzbz">{{orgform.bezeichnung}}</option>
|
||||
@@ -679,7 +715,7 @@ export default {
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-10 mb-3">
|
||||
<div class="form-check">
|
||||
<div>
|
||||
<form-input
|
||||
label="Incoming"
|
||||
type="checkbox"
|
||||
@@ -696,7 +732,7 @@ export default {
|
||||
</template>
|
||||
</template>
|
||||
<template #footer>
|
||||
<button v-if="person !== null" type="button" class="btn btn-secondary" @click="person = null; formData.address.func = 1;"><i class="fa fa-chevron-left"></i>{{ $p.t('ui', 'zurueck') }}</button>
|
||||
<button v-if="person !== null" type="button" class="btn btn-secondary" @click="person = null; formData.address.checked = true;"><i class="fa fa-chevron-left"></i>{{ $p.t('ui', 'zurueck') }}</button>
|
||||
<button type="submit" class="btn btn-primary">{{ person === null || personOnly ? $p.t('person', 'personAnlegen') : $p.t('lehre', 'interessentAnlegen') }}</button>
|
||||
</template>
|
||||
</bs-modal>
|
||||
|
||||
@@ -85,6 +85,7 @@ require_once('dbupdate_3.4/66982_berufsschule.php');
|
||||
require_once('dbupdate_3.4/40314_electronic_onboarding_anbindung_ida.php');
|
||||
require_once('dbupdate_3.4/47972_pruefungsverwaltung_ects_angabe.php');
|
||||
require_once('dbupdate_3.4/67490_studstatus_suche_abort_controller_haengt.php');
|
||||
require_once('dbupdate_3.4/69065_Projektarbeiten_Firmen_verwalten.php');
|
||||
require_once('dbupdate_3.4/68744_StV_settings.php');
|
||||
|
||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
// Add permission: paarbeit/beurteilung_loeschen
|
||||
if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berechtigung_kurzbz = 'paarbeit/beurteilung_loeschen';"))
|
||||
{
|
||||
if($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "INSERT INTO system.tbl_berechtigung(berechtigung_kurzbz, beschreibung) VALUES('paarbeit/beurteilung_loeschen', 'Berechtigung zum Löschen von Projektarbeitsbeurteilung');";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
{
|
||||
echo '<strong>system.tbl_berechtigung '.$db->db_last_error().'</strong><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'system.tbl_berechtigung: Added permission for paarbeit/beurteilung_loeschen<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52245,6 +52245,186 @@ I have been informed that I am under no obligation to consent to the transmissio
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'projektarbeit',
|
||||
'phrase' => 'punkte',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Punkte',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'points',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'projektarbeit',
|
||||
'phrase' => 'gesamtnote',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Gesamtnote',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'final grade',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'projektarbeit',
|
||||
'phrase' => 'abgabeEndupload',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Abgabe Endupload',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'final submission upload',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'projektarbeit',
|
||||
'phrase' => 'vertrag_id',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Vertrag ID',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'contract ID',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'projektarbeit',
|
||||
'phrase' => 'projektarbeit_id',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Projektarbeit ID',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'project work ID',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'projektarbeit',
|
||||
'phrase' => 'betreuerart_kurzbz',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Betreuerart Kurzbezeichnung',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'project assessor short name',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'projektarbeit',
|
||||
'phrase' => 'typ_kurzbz',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Typ Kurzbezeichnung',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'type short name',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'projektarbeit',
|
||||
'phrase' => 'betreuerZugewiesen',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Betreuer*In ist bereits zugewiesen',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'This project assessor is already assigned',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'projektarbeit',
|
||||
'phrase' => 'error_paarbeitHatBeurteilung',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Für diese Projektarbeit ist bereits eine Projektarbeitsbeurteilung eingetragen',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'This project work has already been assessed',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
// FHC-4 Projektarbeiten & Vertraege ENDE
|
||||
// ### DOKUMENTE ERSTELLEN PHRASEN START ###
|
||||
array(
|
||||
@@ -52330,6 +52510,108 @@ I have been informed that I am under no obligation to consent to the transmissio
|
||||
)
|
||||
),
|
||||
// ### Personen zusammenlegen Phrasen END
|
||||
// ### Refactor Messages START
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'errorMissingOrInvalidParameterRecipientTypeId',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Fehlender oder ungültiger Parameter Type_ID Empfänger',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Missing or invalid parameter type ID Recipient',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'errorMissingOrInvalidParameterRecipientIds',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Fehlende(r) oder ungültige(r) Parameter Empfänger-Id(s)',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Missing or invalid parameter(s) Recipient ID(s)',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'errorMissingOrInvalidParameters',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Fehlende(r) oder ungültige(r) Parameter {parameter}',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Missing or invalid parameter(s) {parameter}',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'messages',
|
||||
'phrase' => 'errorEditorNotAvailable',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Editor-Instanz nicht verfügbar.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Editor instance is not available.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'messages',
|
||||
'phrase' => 'error_missingLogic',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Logik für Type ID {type} nicht implementiert.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'logic for type ID {type} not implemented.',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
// ### Refactor Messages END
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user