mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-02 03:19:27 +00:00
Studierendenverwaltung Projektarbeit: added phrases, only necessary Projektarbeit properties are set when saving
This commit is contained in:
@@ -45,7 +45,8 @@ class Config extends FHCAPI_Controller
|
||||
'lehre',
|
||||
'stv',
|
||||
'konto',
|
||||
'abschlusspruefung'
|
||||
'abschlusspruefung',
|
||||
'projektarbeit'
|
||||
]);
|
||||
|
||||
// Load Config
|
||||
|
||||
@@ -112,15 +112,15 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
|
||||
$formData = $this->input->post('formData');
|
||||
|
||||
$this->addMeta('form', $formData);
|
||||
|
||||
if ($this->_validate($formData) == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$projektarbeit = $this->_getProjektarbeitArr($formData);
|
||||
|
||||
$result = $this->ProjektarbeitModel->insert(
|
||||
array_merge($formData, ['insertamum' => date('c'), 'insertvon' => getAuthUID(), 'student_uid' => $student_uid])
|
||||
array_merge($projektarbeit, ['insertamum' => date('c'), 'insertvon' => getAuthUID(), 'student_uid' => $student_uid])
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
@@ -145,9 +145,11 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$projektarbeit = $this->_getProjektarbeitArr($formData);
|
||||
|
||||
$result = $this->ProjektarbeitModel->update(
|
||||
$projektarbeit_id,
|
||||
array_merge($formData, ['updateamum' => date('c'), 'updatevon' => getAuthUID()])
|
||||
array_merge($projektarbeit, ['updateamum' => date('c'), 'updatevon' => getAuthUID()])
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
@@ -196,7 +198,8 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
{
|
||||
$searchString = $this->input->get('searchString');
|
||||
|
||||
if (!isset($searchString)) $this->terminateWithError($this->p->t('projektarbeit', 'error_searchStringMissing', self::ERROR_TYPE_GENERAL));
|
||||
if (!isset($searchString))
|
||||
$this->terminateWithError($this->p->t('ui', 'error_fieldRequired', ['field' => 'Search term']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$result = $this->FirmaModel->searchFirmen($searchString, $aktiv = true);
|
||||
|
||||
@@ -285,6 +288,29 @@ class Projektarbeit extends FHCAPI_Controller
|
||||
return $this->form_validation->run();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return object success or error
|
||||
*/
|
||||
private function _getProjektarbeitArr($formData)
|
||||
{
|
||||
return [
|
||||
'titel' => $formData['titel'],
|
||||
'titel_english' => $formData['titel_english'] ?? null,
|
||||
'themenbereich' => $formData['themenbereich'] ?? null,
|
||||
'projekttyp_kurzbz' => $formData['projekttyp_kurzbz'],
|
||||
'firma_id' => $formData['firma_id'] ?? null,
|
||||
'lehreinheit_id' => $formData['lehreinheit_id'],
|
||||
'beginn' => $formData['beginn'] ?? null,
|
||||
'note' => $formData['note'] ?? null,
|
||||
'final' => $formData['final'] ?? null,
|
||||
'freigegeben' => $formData['freigegeben'] ?? null,
|
||||
'anmerkung' => $formData['anmerkung'] ?? null,
|
||||
'gesperrtbis' => $formData['gesperrtbis'] ?? null
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
|
||||
@@ -45,7 +45,8 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
{
|
||||
$projektarbeit_id = $this->input->get('projektarbeit_id');
|
||||
|
||||
if (!isset($projektarbeit_id)) $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Projektarbeit ID']), self::ERROR_TYPE_GENERAL);
|
||||
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,
|
||||
@@ -98,14 +99,8 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
|
||||
$projektbetreuer = $this->input->post('projektbetreuerListe');
|
||||
|
||||
//$this->addMeta('form', $projektbetreuer);
|
||||
|
||||
if (!is_array($projektbetreuer))
|
||||
{
|
||||
return $this->terminateWithError(
|
||||
$this->p->t('projektarbeit', 'error_invalidProjektbetreuer'), self::ERROR_TYPE_GENERAL
|
||||
);
|
||||
}
|
||||
return $this->terminateWithError($this->p->t('projektarbeit', 'error_invalidProjektbetreuer'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
foreach ($projektbetreuer as $pb)
|
||||
{
|
||||
@@ -120,17 +115,6 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
|
||||
foreach ($projektbetreuer as $pb)
|
||||
{
|
||||
//~ $this->addMeta('form', $pb);
|
||||
//~ error_log(print_r($pb, true));
|
||||
//die();
|
||||
|
||||
//~ $this->ProjektbetreuerModel->addSelect('1');
|
||||
//~ $checkResult = $this->ProjektbetreuerModel->loadWhere(
|
||||
//~ ['person_id' => $pb['person_id'], 'projektarbeit_id' => $projektarbeit_id, 'betreuerart_kurzbz' => $pb['betreuerart_kurzbz']]
|
||||
//~ );
|
||||
|
||||
//~ if (isError($checkResult)) $this->terminateWithError(getError($checkResult), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$betreuer = [
|
||||
'projektarbeit_id' => $projektarbeit_id,
|
||||
'person_id' => $pb['person_id'],
|
||||
@@ -236,7 +220,9 @@ class Projektbetreuer extends FHCAPI_Controller
|
||||
{
|
||||
$searchString = $this->input->get('searchString');
|
||||
|
||||
if (!isset($searchString)) $this->terminateWithError($this->p->t('projektarbeit', 'error_searchStringMissing', self::ERROR_TYPE_GENERAL));
|
||||
if (!isset($searchString))
|
||||
$this->terminateWithError($this->p->t('ui', 'error_fieldRequired', ['field' => 'Search term']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
$result = $this->PersonModel->searchPerson($searchString);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user