WIP Abgabetool Mitarbeiter DetailComponent

This commit is contained in:
Johann Hoffmann
2025-04-23 13:59:31 +02:00
parent 91910ef538
commit e28067259b
12 changed files with 853 additions and 22 deletions
+26 -3
View File
@@ -13,8 +13,10 @@ class Abgabetool extends Auth_Controller
public function __construct()
{
parent::__construct([
'index' => ['basis/cis:r'],
'getStudentProjektarbeitAbgabeFile' => ['basis/cis:r']
'index' => self::PERM_LOGGED,
'getStudentProjektarbeitAbgabeFile' => self::PERM_LOGGED,
'Mitarbeiter' => self::PERM_LOGGED,
'Student' => self::PERM_LOGGED
]);
}
@@ -33,7 +35,28 @@ class Abgabetool extends Auth_Controller
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Abgabetool']);
}
public function Student()
{
$viewData = array(
'uid'=>getAuthUID(),
);
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Abgabetool']);
}
public function Mitarbeiter()
{
$viewData = array(
'uid'=>getAuthUID(),
);
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Abgabetool']);
}
public function getStudentProjektarbeitAbgabeFile()
{
$this->_ci =& get_instance();
@@ -42,7 +42,8 @@ class Lehre extends FHCAPI_Controller
'getStudentProjektarbeiten' => self::PERM_LOGGED, // TODO: abgabetool berechtigung?
'getStudentProjektabgaben' => self::PERM_LOGGED,
'postStudentProjektarbeitZwischenabgabe' => self::PERM_LOGGED,
'postStudentProjektarbeitEndupload' => self::PERM_LOGGED
'postStudentProjektarbeitEndupload' => self::PERM_LOGGED,
'getMitarbeiterProjektarbeiten' => self::PERM_LOGGED
]);
$this->load->library('PhrasesLib');
@@ -443,5 +444,34 @@ class Lehre extends FHCAPI_Controller
}
}
}
public function getMitarbeiterProjektarbeiten() {
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
// if (!isset($uid) || isEmptyString($uid))
// $this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
$boolParamStr = $this->input->get('showall');
$trueStrings = ['true', '1'];
$falseStrings = ['false', '0'];
// Handle missing or invalid parameter
if ($boolParamStr === null) {
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
}
$boolParamStrLower = strtolower($boolParamStr);
if (in_array($boolParamStrLower, $trueStrings, true)) {
$showAllBool = true;
} elseif (in_array($boolParamStrLower, $falseStrings, true)) {
$showAllBool = false;
} else {
// $this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
}
$projektarbeiten = $this->ProjektarbeitModel->getMitarbeiterProjektarbeiten(getAuthUID(), $showAllBool);
$this->terminateWithSuccess(array($projektarbeiten, DOMAIN));
}
}