Merge branch 'master' into feature-13011/installation_on_multiple_servers

This commit is contained in:
Paolo
2022-04-12 10:38:01 +02:00
277 changed files with 71126 additions and 57897 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ class FAS_UDF extends Auth_Controller
if (isset($person_id) && is_numeric($person_id))
{
if ($this->PersonModel->hasUDF())
if ($this->PersonModel->udfsExistAndDefined())
{
$personUdfs = $this->PersonModel->getUDFs($person_id);
$data['person_id'] = $person_id;
@@ -41,7 +41,7 @@ class FAS_UDF extends Auth_Controller
if (isset($prestudent_id) && is_numeric($prestudent_id))
{
if ($this->PrestudentModel->hasUDF())
if ($this->PrestudentModel->udfsExistAndDefined())
{
$prestudentUdfs = $this->PrestudentModel->getUDFs($prestudent_id);
$data['prestudent_id'] = $prestudent_id;
@@ -20,6 +20,7 @@ class InfoCenter extends Auth_Controller
const INDEX_PAGE = 'index';
const FREIGEGEBEN_PAGE = 'freigegeben';
const REIHUNGSTESTABSOLVIERT_PAGE = 'reihungstestAbsolviert';
const ABGEWIESEN_PAGE = 'abgewiesen';
const SHOW_DETAILS_PAGE = 'showDetails';
const SHOW_ZGV_DETAILS_PAGE = 'showZGVDetails';
const ZGV_UBERPRUEFUNG_PAGE = 'ZGVUeberpruefung';
@@ -107,6 +108,7 @@ class InfoCenter extends Auth_Controller
array(
'index' => 'infocenter:r',
'freigegeben' => 'infocenter:r',
'abgewiesen' => 'infocenter:r',
'reihungstestAbsolviert' => 'infocenter:r',
'showDetails' => 'infocenter:r',
'showZGVDetails' => 'lehre/zgvpruefung:r',
@@ -124,20 +126,20 @@ class InfoCenter extends Auth_Controller
'saveAbsage' => 'infocenter:rw',
'saveFreigabe' => 'infocenter:rw',
'getNotiz' => 'infocenter:r',
'saveNotiz' => 'infocenter:rw',
'saveNotiz' => array('infocenter:rw', 'lehre/zgvpruefung:rw'),
'updateNotiz' => 'infocenter:rw',
'reloadZgvPruefungen' => 'infocenter:r',
'reloadMessages' => 'infocenter:r',
'reloadDoks' => 'infocenter:r',
'reloadNotizen' => 'infocenter:r',
'reloadNotizen' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'reloadLogs' => 'infocenter:r',
'outputAkteContent' => 'infocenter:r',
'getPostponeDate' => 'infocenter:r',
'outputAkteContent' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'getPostponeDate' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'park' => 'infocenter:rw',
'unpark' => 'infocenter:rw',
'setOnHold' => 'infocenter:rw',
'removeOnHold' => 'infocenter:rw',
'getStudienjahrEnd' => 'infocenter:r',
'removeOnHold' => array('infocenter:rw', 'lehre/zgvpruefung:rw'),
'getStudienjahrEnd' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'setNavigationMenuArrayJson' => 'infocenter:r',
'getAbsageData' => 'infocenter:r',
'saveAbsageForAll' => 'infocenter:rw'
@@ -203,6 +205,16 @@ class InfoCenter extends Auth_Controller
$this->load->view('system/infocenter/infocenterFreigegeben.php');
}
/**
* Abgewiesen page of the InfoCenter tool
*/
public function abgewiesen()
{
$this->_setNavigationMenu(self::ABGEWIESEN_PAGE); // define the navigation menu for this page
$this->load->view('system/infocenter/infocenterAbgewiesen.php');
}
/**
*
*/
@@ -297,6 +309,13 @@ class InfoCenter extends Auth_Controller
}
$persondata = $this->_loadPersonData($person_id);
$checkPerson = $this->PersonModel->checkDuplicate($person_id);
if (isError($checkPerson)) show_error(getError($checkPerson));
$duplicate = array('duplicated' => getData($checkPerson));
$prestudentdata = $this->_loadPrestudentData($person_id);
$this->DokumentModel->addOrder('bezeichnung');
@@ -305,7 +324,8 @@ class InfoCenter extends Auth_Controller
$data = array_merge(
$persondata,
$prestudentdata,
$dokumentdata
$dokumentdata,
$duplicate
);
$data[self::FHC_CONTROLLER_ID] = $this->getControllerId();
@@ -540,8 +560,10 @@ class InfoCenter extends Auth_Controller
/**
* Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang
*/
private function sendZgvMail($mail, $typ){
private function sendZgvMail($mail, $typ, $person){
$data = array(
'vorname' => $person->vorname,
'nachname' => $person->nachname,
'link' => site_url('system/infocenter/ZGVUeberpruefung')
);
@@ -637,6 +659,16 @@ class InfoCenter extends Auth_Controller
if (isEmptyString($prestudent_id) || isEmptyString($person_id))
$this->terminateWithJsonError('Prestudentid OR/AND Personid missing');
$person = $this->PersonModel->load($person_id);
if (isError($person))
$this->terminateWithJsonError(getError($person));
if (!hasData($person))
$this->terminateWithJsonError('Person existiert nicht.');
$person = getData($person)[0];
$zgv = $this->ZGVPruefungStatusModel->getZgvStatusByPrestudent($prestudent_id);
$data = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id);
@@ -668,7 +700,7 @@ class InfoCenter extends Auth_Controller
$this->_log($person_id, 'updatezgv', array($zgv[0]->zgvpruefung_id, 'pruefung_stg'));
if (isSuccess($insert))
$this->sendZgvMail($mail, $typ);
$this->sendZgvMail($mail, $typ, $person);
elseif (isError($insert))
$this->terminateWithJsonError('Fehler beim Speichern');
}else
@@ -694,7 +726,7 @@ class InfoCenter extends Auth_Controller
$this->_log($person_id, 'newzgv', array($zgvpruefung_id));
if (isSuccess($result))
$this->sendZgvMail($mail, $typ);
$this->sendZgvMail($mail, $typ, $person);
elseif (isError($result))
$this->terminateWithJsonError('Fehler beim Speichern');
}
@@ -734,7 +766,7 @@ class InfoCenter extends Auth_Controller
if (hasData($lastStatus) && hasData($statusgrresult))
{
//check if still Interessent
//check if still Interessent, Bewerber or Wartender
if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS
|| $lastStatus->retval[0]->status_kurzbz === self::BEWERBERSTATUS
|| $lastStatus->retval[0]->status_kurzbz === self::WARTENDER)
@@ -913,7 +945,8 @@ class InfoCenter extends Auth_Controller
$this->_log($person_id, 'freigegeben', $logparams);
$this->_sendFreigabeMail($prestudent_id);
if (is_numeric($statusgrund_id) || $logdata['studiengang_typ'] === 'm')
$this->_sendFreigabeMail($prestudent_id);
}
}
}
@@ -1191,6 +1224,10 @@ class InfoCenter extends Auth_Controller
{
$this->_setNavigationMenu(self::REIHUNGSTESTABSOLVIERT_PAGE);
}
elseif (strpos($navigation_page, self::ABGEWIESEN_PAGE) !== false)
{
$this->_setNavigationMenu(self::ABGEWIESEN_PAGE);
}
$this->outputJsonSuccess('success');
}
@@ -1414,12 +1451,14 @@ class InfoCenter extends Auth_Controller
$freigegebenLink = site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE);
$reihungstestAbsolviertLink = site_url(self::INFOCENTER_URI.'/'.self::REIHUNGSTESTABSOLVIERT_PAGE);
$abgewiesenLink = site_url(self::INFOCENTER_URI.'/'.self::ABGEWIESEN_PAGE);
$currentFilterId = $this->input->get(self::FILTER_ID);
if (isset($currentFilterId))
{
$freigegebenLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId;
$reihungstestAbsolviertLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId;
$abgewiesenLink .= '?'.self::PREV_FILTER_ID.'='.$currentFilterId;
}
$this->navigationlib->setSessionMenu(
@@ -1458,6 +1497,18 @@ class InfoCenter extends Auth_Controller
null, // subscriptLinkValue
'', // target
20 // sort
),
'abgewiesen' => $this->navigationlib->oneLevel(
'Abgewiesene', // description
$abgewiesenLink, // link
null, // children
'close', // icon
null, // subscriptDescription
false, // expand
null, // subscriptLinkClass
null, // subscriptLinkValue
'', // target
30 // sort
)
)
);
@@ -1483,6 +1534,8 @@ class InfoCenter extends Auth_Controller
}
if ($origin_page === self::ZGV_UBERPRUEFUNG_PAGE)
$link = site_url(self::ZGV_UEBERPRUEFUNG_URI);
if ($origin_page === self::ABGEWIESEN_PAGE)
$link = site_url(self::INFOCENTER_URI.'/'.self::ABGEWIESEN_PAGE);
$prevFilterId = $this->input->get(self::PREV_FILTER_ID);
if (isset($prevFilterId))
@@ -1520,6 +1573,7 @@ class InfoCenter extends Auth_Controller
$homeLink = site_url(self::INFOCENTER_URI.'/'.self::INDEX_PAGE);
$freigegebenLink = site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE);
$absolviertLink = site_url(self::INFOCENTER_URI.'/'.self::REIHUNGSTESTABSOLVIERT_PAGE);
$abgewiesenLink = site_url(self::INFOCENTER_URI.'/'.self::ABGEWIESEN_PAGE);
$prevFilterId = $this->input->get(self::PREV_FILTER_ID);
if (isset($prevFilterId))
{
@@ -1578,6 +1632,24 @@ class InfoCenter extends Auth_Controller
)
);
}
if($page == self::ABGEWIESEN_PAGE)
{
$this->navigationlib->setSessionElementMenu(
'abgewiesen',
$this->navigationlib->oneLevel(
'Abgewiesene', // description
$abgewiesenLink, // link
null, // children
'close', // icon
null, // subscriptDescription
false, // expand
null, // subscriptLinkClass
null, // subscriptLinkValue
'', // target
40 // sort
)
);
}
}
/**
@@ -1648,9 +1720,15 @@ class InfoCenter extends Auth_Controller
if (isset($locked->retval[0]->uid))
{
$lockedby = $locked->retval[0]->uid;
if ($lockedby !== $this->_uid)
if (!$lockedby = getData($this->PersonModel->getFullName($locked->retval[0]->uid)))
{
show_error('Failed retrieving person');
}
if ($locked->retval[0]->uid !== $this->_uid)
{
$lockedbyother = true;
}
}
$stammdaten = $this->PersonModel->getPersonStammdaten($person_id, true);
@@ -2134,17 +2212,18 @@ class InfoCenter extends Auth_Controller
{
$statusgrund = $this->input->post('statusgrund');
$studiengang = $this->input->post('studiengang');
$abgeschickt = $this->input->post('abgeschickt');
$personen = $this->input->post('personen');
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
if ($statusgrund === 'null' || $studiengang === 'null' || empty($personen))
$this->terminateWithJsonError("Bitte Statusgrund, Studiengang und Personen auswählen.");
if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen))
$this->terminateWithJsonError("Bitte füllen Sie alle Felder aus");
foreach($personen as $person)
{
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester);
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt);
if(!hasData($prestudent))
if (!hasData($prestudent))
continue;
$prestudentData = getData($prestudent);
@@ -0,0 +1,166 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
class Issues extends Auth_Controller
{
private $_uid;
const FUNKTION_KURZBZ = 'ass'; // // user having this funktion can see issues for oes assigned with this funktion
const BERECHTIGUNG_KURZBZ = 'system/issues_verwalten'; // user having this permission can see issues for oes assigned with this permission
public function __construct()
{
parent::__construct(
array(
'index' => array(self::BERECHTIGUNG_KURZBZ.':r'),
'changeIssueStatus' => array(self::BERECHTIGUNG_KURZBZ.':rw')
)
);
// Load libraries
$this->load->library('IssuesLib');
$this->load->library('PermissionLib');
$this->load->library('WidgetLib');
// Load models
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
$this->loadPhrases(
array(
'global',
'ui',
'filter',
'lehre',
'person',
'fehlermonitoring'
)
);
$this->_setAuthUID(); // sets property uid
}
public function index()
{
$oes_for_issues = $this->_getOesForIssues();
$this->load->view(
'system/issues/issues',
$oes_for_issues
);
}
/**
* Initializes issues status change
*/
public function changeIssueStatus()
{
$issue_ids = $this->input->post('issue_ids');
$status_kurzbz = $this->input->post('status_kurzbz');
$user = $this->_uid;
$errors = array();
foreach ($issue_ids as $issue_id)
{
switch ($status_kurzbz)
{
case IssuesLib::STATUS_NEU:
$changeIssueMethod = 'setNeu';
break;
case IssuesLib::STATUS_IN_BEARBEITUNG:
$changeIssueMethod = 'setInBearbeitung';
break;
case IssuesLib::STATUS_BEHOBEN:
$changeIssueMethod = 'setBehoben';
break;
default:
$changeIssueMethod = null;
break;
}
if (isEmptyString($changeIssueMethod))
$errors[] = error("Invalid issue status given");
else
{
$issueRes = $this->issueslib->{$changeIssueMethod}($issue_id, $user);
if (isError($issueRes))
$errors[] = getError($issueRes);
}
}
if (!isEmptyArray($errors))
$this->outputJsonError(implode(", ", $errors));
else
$this->outputJsonSuccess("Status successfully refreshed");
}
/**
* Retrieve the UID of the logged user and checks if it is valid
*/
private function _setAuthUID()
{
$this->_uid = getAuthUID();
if (!$this->_uid) show_error('User authentification failed');
}
/**
* Gets oes of logged in user, which are needed to display issues of the user.
* This includes oes assigned by a funktio and as the issue permission.
* @return array
*/
private function _getOesForIssues()
{
// get oes of uid for which there is a current funktion
$all_funktionen_oe_kurzbz = array();
$oe_kurzbz_for_funktion = array();
$benutzerfunktionRes = $this->BenutzerfunktionModel->getBenutzerFunktionByUid($this->_uid, null, date('Y-m-d'), date('Y-m-d'));
if (isError($benutzerfunktionRes))
show_error(getError($benutzerfunktionRes));
if (hasData($benutzerfunktionRes))
{
foreach (getData($benutzerfunktionRes) as $benutzerfunktion)
{
$all_funktionen_oe_kurzbz[$benutzerfunktion->oe_kurzbz][] = $benutzerfunktion->funktion_kurzbz;
// separate oes for the funktion needed for displaying issues
if ($benutzerfunktion->funktion_kurzbz == self::FUNKTION_KURZBZ)
{
$oe_kurzbz_for_funktion[] = $benutzerfunktion->oe_kurzbz;
// permission also for all oes under the oe for which funktion is assigend
$childOesFunktionRes = $this->OrganisationseinheitModel->getChilds($benutzerfunktion->oe_kurzbz);
if (isError($childOesFunktionRes))
show_error(getError($childOesFunktionRes));
if (hasData($childOesFunktionRes))
{
$childOesFunktion = getData($childOesFunktionRes);
foreach ($childOesFunktion as $childOeFunktion)
{
if (!in_array($childOeFunktion->oe_kurzbz, $oe_kurzbz_for_funktion))
$oe_kurzbz_for_funktion[] = $childOeFunktion->oe_kurzbz;
}
}
}
}
}
// add oes for which there is the "manage issues" Berechtigung
if (!$oe_kurzbz_berechtigt = $this->permissionlib->getOE_isEntitledFor(self::BERECHTIGUNG_KURZBZ))
show_error('No permission or error when checking permissions');
$all_oe_kurzbz_berechtigt = array_unique(array_merge($oe_kurzbz_for_funktion, $oe_kurzbz_berechtigt));
return array(
'all_funktionen_oe_kurzbz' => $all_funktionen_oe_kurzbz,
'all_oe_kurzbz_berechtigt' => $all_oe_kurzbz_berechtigt
);
}
}