Merge branch 'master' into feature-20813/BTSponsionsdatumFuerInterneZGVUebernehmen

This commit is contained in:
ma0068
2022-11-03 08:31:10 +01:00
349 changed files with 10250 additions and 2564 deletions
@@ -0,0 +1,207 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* This controller operates between (interface) the JS (GUI) and the FilterCmptLib (back-end)
* Provides data to the ajax get calls about the filter component
* Listens to ajax post calls to change the filter data
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
* NOTE: extends the FHC_Controller instead of the Auth_Controller because the FilterCmpt has its
* own permissions check
*/
class Filter extends FHC_Controller
{
const FILTER_UNIQUE_ID = 'filterUniqueId'; // Name of the filter cmpt unique id (mandatory)
const FILTER_TYPE = 'filterType'; // The filter type (PHP filter definition) used (mandatory)
const FILTER_ID = 'filterId'; // The id of the used filter (optional)
/**
* Calls the parent's constructor and loads the FilterCmptLib
*/
public function __construct()
{
parent::__construct();
// Loads authentication library and starts authentication
$this->load->library('AuthLib');
// Loads the FilterCmptLib with HTTP GET/POST parameters
$this->_startFilterCmptLib();
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Retrieves data about the current filter from the session and will be written on the output in JSON format
*/
public function getFilter()
{
$this->outputJsonSuccess($this->filtercmptlib->getSession());
}
/**
* Remove an applied filter (SQL where condition) from the current filter
*/
public function removeFilterField()
{
$request = $this->getPostJSON();
if (property_exists($request, 'filterField')
&& $this->filtercmptlib->removeFilterField($request->filterField) == true)
{
$this->outputJsonSuccess('Field removed');
}
else
{
$this->outputJsonError('Error occurred');
}
}
/**
* Add a filter (SQL where clause) to be applied to the current filter
*/
public function addFilterField()
{
$request = $this->getPostJSON();
if (property_exists($request, 'filterField')
&& $this->filtercmptlib->addFilterField($request->filterField) == true)
{
$this->outputJsonSuccess('Field added');
}
else
{
$this->outputJsonError('Error occurred');
}
}
/**
* Apply the filter changes
*/
public function applyFilterFields()
{
$request = $this->getPostJSON();
if (property_exists($request, 'filterFields')
&& $this->filtercmptlib->applyFilterFields($request->filterFields) == true)
{
$this->outputJsonSuccess('Applied');
}
else
{
$this->outputJsonError('Error occurred');
}
}
/**
* Save the current filter as a custom filter for this user with the given description
*/
public function saveCustomFilter()
{
$request = $this->getPostJSON();
if (property_exists($request, 'customFilterName')
&& $this->filtercmptlib->saveCustomFilter($request->customFilterName) == true)
{
$this->outputJsonSuccess('Saved');
}
else
{
$this->outputJsonError('An error occurred while saving a custom filter');
}
}
/**
* Remove a custom filter by its filterId
*/
public function removeCustomFilter()
{
$request = $this->getPostJSON();
if (property_exists($request, 'filterId')
&& $this->filtercmptlib->removeCustomFilter($request->filterId) == true)
{
$this->outputJsonSuccess('Removed');
}
else
{
$this->outputJsonError('Wrong parameter');
}
}
/**
* Reloads the dataset
*/
public function reloadDataset()
{
$this->filtercmptlib->reloadDataset();
$this->outputJsonSuccess('Success');
}
//------------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Loads the FilterCmptLib with the FILTER_UNIQUE_ID parameter
* If the parameter FILTER_UNIQUE_ID is not given then the execution of the controller is terminated and
* an error message is printed
*/
private function _startFilterCmptLib()
{
$filterUniqueId = null;
$filterType = null;
$filterId = null;
// Try to get the POSTed JSON
$postJSON = $this->getPostJSON();
// POSTed JSON
if ($postJSON != null)
{
// If the mandatory parameters FILTER_UNIQUE_ID and FILTER_TYPE have been provided
if (property_exists($postJSON, self::FILTER_UNIQUE_ID) && property_exists($postJSON, self::FILTER_TYPE))
{
// Retrives them from the POSTed JSON
$filterUniqueId = $postJSON->{self::FILTER_UNIQUE_ID};
$filterType = $postJSON->{self::FILTER_TYPE};
}
// If the optional parameter FILTER_ID has been provided
if (property_exists($postJSON, self::FILTER_ID)) $filterId = $postJSON->{self::FILTER_ID};
}
else // otherwise it is an HTTP GET call
{
// If the mandatory parameters FILTER_UNIQUE_ID and FILTER_TYPE have been provided
if (isset($_GET[self::FILTER_UNIQUE_ID]) && isset($_GET[self::FILTER_TYPE]))
{
// Retrives them from the HTTP GET
$filterUniqueId = $this->input->get(self::FILTER_UNIQUE_ID);
$filterType = $this->input->get(self::FILTER_TYPE);
}
// If the optional parameter FILTER_ID has been provided
if (isset($_GET[self::FILTER_ID])) $filterId = $filterId = $this->input->get(self::FILTER_ID);
}
// If the mandatory parameters have _not_ been provided, then terminate the execution and return an error
if ($filterUniqueId == null) $this->terminateWithJsonError('Parameter "'.self::FILTER_UNIQUE_ID.'" not provided!');
if ($filterType == null) $this->terminateWithJsonError('Parameter "'.self::FILTER_TYPE.'" not provided!');
// Loads the FilterCmptLib that contains all the used logic
$this->load->library(
'FilterCmptLib',
array(
'filterUniqueId' => $filterUniqueId,
'filterType' => $filterType,
'filterId' => $filterId
)
);
// Start the component
$this->filtercmptlib->start();
}
}
@@ -0,0 +1,51 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
*
*/
class SearchBar extends FHC_Controller
{
const SEARCHSTR_PARAM = 'searchstr';
const TYPES_PARAM = 'types';
/**
* Object initialization
*/
public function __construct()
{
parent::__construct();
// Load the library SearchBarLib
$this->load->library('SearchBarLib');
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Gets a JSON body via HTTP POST and provides the parameters
*/
public function search()
{
$json = json_decode($this->input->raw_input_stream);
// Checks if the searchstr and the types parameters are in the POSTed JSON
if (isset($json->{self::SEARCHSTR_PARAM}) && isset($json->{self::TYPES_PARAM}))
{
// Convert to json the result from searchbarlib->search
$this->outputJson(
$this->searchbarlib->search(
$json->{self::SEARCHSTR_PARAM},
$json->{self::TYPES_PARAM}
)
);
}
else // otherwise return an error in JSON format
{
$this->outputJsonError(SearchBarLib::ERROR_WRONG_JSON);
}
}
}
@@ -322,20 +322,10 @@ class reviewAnrechnungDetail extends Auth_Controller
// Send mail to STGL of each studiengang
foreach ($studiengang_kz_arr as $studiengang_kz)
{
// Get STGL mail address, if available, otherwise get assistance mail address
$stgmail = $this->_getSTGLMailAddress($studiengang_kz);
if(isSuccess($stgmail) && hasData($stgmail))
list ($to, $vorname) = getData($stgmail)[0];
else
show_error ('Failed retrieving DegreeProgram Mail');
// Get full name of lector
$this->load->model('person/Person_model', 'PersonModel');
if (!$lector_name = getData($this->PersonModel->getFullName($this->_uid)))
{
show_error ('Failed retrieving person');
}
$result = $this->PersonModel->getFullName($this->_uid);
$lector_name = hasData($result) ? getData($result) : 'Ein Lektor';
// Link to Antrag genehmigen
$url =
@@ -343,22 +333,26 @@ class reviewAnrechnungDetail extends Auth_Controller
CIS_ROOT. 'cis/menu.php?content_id=&content='.
CIS_ROOT. index_page(). self::APPROVE_ANRECHNUNG_URI;
// Prepare mail content
$body_fields = array(
'vorname' => $vorname,
'lektor_name' => $lector_name,
'empfehlung' => $empfehlung ? 'positive' : 'negative',
'link' => anchor($url, 'Anrechnungsanträge Übersicht')
);
// Get STGL mail address, if available, otherwise get assistance mail address
if( !$result = $this->_getSTGLMailAddress($studiengang_kz)) return false;
foreach ($result as $stgl)
{
// Prepare mail content
$body_fields = array(
'vorname' => $stgl['vorname'],
'lektor_name' => $lector_name,
'empfehlung' => $empfehlung ? 'positive' : 'negative',
'link' => anchor($url, 'Anrechnungsanträge Übersicht')
);
sendSanchoMail(
'AnrechnungEmpfehlungAbgeben',
$body_fields,
$to,
'Anerkennung nachgewiesener Kenntnisse: Empfehlung wurde abgegeben'
);
sendSanchoMail(
'AnrechnungEmpfehlungAbgeben',
$body_fields,
$stgl['to'],
'Anerkennung nachgewiesener Kenntnisse: Empfehlung wurde abgegeben'
);
}
}
return true;
}
@@ -369,28 +363,33 @@ class reviewAnrechnungDetail extends Auth_Controller
$result = $this->StudiengangModel->getLeitung($stg_kz);
// Get STGL mail address, if available
if (isSuccess($result) && hasData($result))
{
return success(array(
$result->retval[0]->uid. '@'. DOMAIN,
$result->retval[0]->vorname
));
}
if (hasData($result))
{
foreach (getData($result) as $stgl)
{
$stglMailAdress_arr[]= array(
'to' => $stgl->uid. '@'. DOMAIN,
'vorname' => $stgl->vorname
);
}
return $stglMailAdress_arr;
}
// ...otherwise get assistance mail address
else
{
$result = $this->StudiengangModel->load($stg_kz);
if (isSuccess($result) && hasData($result))
if (hasData($result))
{
return success(array(
return array(
$result->retval[0]->email,
''
));
);
}
else
{
return error('Keine E-Mail für diesen Stg gefunden');
return false;
}
}
}
@@ -257,20 +257,10 @@ class reviewAnrechnungUebersicht extends Auth_Controller
// Send mail to STGL of each studiengang
foreach ($studiengang_kz_arr as $studiengang_kz)
{
// Get STGL mail address, if available, otherwise get assistance mail address
$stgmail = $this->_getSTGLMailAddress($studiengang_kz);
if(isSuccess($stgmail) && hasData($stgmail))
list ($to, $vorname) = getData($stgmail)[0];
else
show_error ('Failed retrieving DegreeProgram Mail');
// Get full name of lector
$this->load->model('person/Person_model', 'PersonModel');
if (!$lector_name = getData($this->PersonModel->getFullName($this->_uid)))
{
show_error ('Failed retrieving person');
}
$result = $this->PersonModel->getFullName($this->_uid);
$lector_name = hasData($result) ? getData($result) : 'Ein Lektor';
// Link to Antrag genehmigen
$url =
@@ -278,22 +268,26 @@ class reviewAnrechnungUebersicht extends Auth_Controller
CIS_ROOT. 'cis/menu.php?content_id=&content='.
CIS_ROOT. index_page(). self::APPROVE_ANRECHNUNG_URI;
// Prepare mail content
$body_fields = array(
'vorname' => $vorname,
'lektor_name' => $lector_name,
'empfehlung' => $empfehlung ? 'positive' : 'negative',
'link' => anchor($url, 'Anrechnungsanträge Übersicht')
);
// Get STGL mail address, if available, otherwise get assistance mail address
if (!$result = $this->_getSTGLMailAddress($studiengang_kz)) return false;
foreach ($result as $stgl)
{
// Prepare mail content
$body_fields = array(
'vorname' => $stgl['vorname'],
'lektor_name' => $lector_name,
'empfehlung' => $empfehlung ? 'positive' : 'negative',
'link' => anchor($url, 'Anrechnungsanträge Übersicht')
);
sendSanchoMail(
'AnrechnungEmpfehlungAbgeben',
$body_fields,
$to,
'Anerkennung nachgewiesener Kenntnisse: Empfehlung wurde abgegeben'
);
sendSanchoMail(
'AnrechnungEmpfehlungAbgeben',
$body_fields,
$stgl['to'],
'Anerkennung nachgewiesener Kenntnisse: Empfehlung wurde abgegeben'
);
}
}
return true;
}
@@ -304,28 +298,33 @@ class reviewAnrechnungUebersicht extends Auth_Controller
$result = $this->StudiengangModel->getLeitung($stg_kz);
// Get STGL mail address, if available
if (isSuccess($result) && hasData($result))
{
return success(array(
$result->retval[0]->uid. '@'. DOMAIN,
$result->retval[0]->vorname
));
}
if (hasData($result))
{
foreach (getData($result) as $stgl)
{
$stglMailAdress_arr[]= array(
'to' => $stgl->uid. '@'. DOMAIN,
'vorname' => $stgl->vorname
);
}
return $stglMailAdress_arr;
}
// ...otherwise get assistance mail address
else
{
$result = $this->StudiengangModel->load($stg_kz);
if (isSuccess($result) && hasData($result))
if (hasData($result))
{
return success(array(
return array(
$result->retval[0]->email,
''
));
);
}
else
{
return error('Keine E-Mail für diesen Stg gefunden');
return false;
}
}
}
@@ -138,7 +138,7 @@ class Studiensemester extends Auth_Controller
$start = $this->input->post("semstart");
$ende = $this->input->post("semende");
$studienjahr_kurzbz = $this->input->post("studienjahrkurzbz");
$beschreibung = $this->input->post("beschreibung");
$beschreibung = isEmptyString($this->input->post("beschreibung")) ? null : $this->input->post("beschreibung");
$onlinebewerbung = $this->input->post("onlinebewerbung");
$onlinebewerbung = isset($onlinebewerbung);
@@ -7,8 +7,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
*/
class BPKWartung extends Auth_Controller
{
private $_uid; // contains the UID of the logged user
/**
* Constructor
*/
@@ -46,7 +44,7 @@ class BPKWartung extends Auth_Controller
// Public methods
/**
* Main page of the InfoCenter tool
* Main page of the bPK Wartung.
*/
public function index()
{
@@ -56,9 +54,7 @@ class BPKWartung extends Auth_Controller
}
/**
* Personal details page of the InfoCenter tool
* Initialization function, gets person and prestudent data and loads the view with the data
* @param $person_id
* bPK Details initialization function, gets person data and loads the view with the data.
*/
public function showDetails()
{
@@ -85,8 +81,7 @@ class BPKWartung extends Auth_Controller
}
/**
* Saves a ZGV for a prestudent, includes Ort, Datum, Nation for bachelor and master
* @param $prestudent_id
* Saves a bPK for a person.
*/
public function saveBPK()
{
@@ -112,7 +107,7 @@ class BPKWartung extends Auth_Controller
// Private methods
/**
* Loads all necessary Person data: Stammdaten (name, svnr, contact, ...), Dokumente, Logs and Notizen
* Loads all necessary Person data.
* @param $person_id
* @return array
*/
@@ -0,0 +1,254 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Page for managing groups of which user is the manager
*/
class Gruppenmanagement extends Auth_Controller
{
private $_uid; // contains the UID of the logged user
/**
* Constructor
*/
public function __construct()
{
parent::__construct(
array(
'index' => 'lehre/gruppenmanager:r',
'showBenutzergruppe' => 'lehre/gruppenmanager:r',
'getBenutzer' => 'lehre/gruppenmanager:r',
'getAllBenutzer' => 'lehre/gruppenmanager:r',
'addBenutzer' => 'lehre/gruppenmanager:rw',
'removeBenutzer' => 'lehre/gruppenmanager:rw'
)
);
// Loads models
$this->load->model('person/benutzer_model', 'BenutzerModel');
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
$this->load->model('person/benutzergruppe_model', 'BenutzergruppeModel');
$this->load->model('system/Log_model', 'LogModel');
$this->load->library('WidgetLib');
$this->loadPhrases(
array(
'global',
'person',
'lehre',
'ui',
'filter',
'gruppenmanagement'
)
);
$this->setControllerId(); // sets the controller id
$this->_setAuthUID(); // sets property uid
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Main page
*/
public function index()
{
$this->load->view(
'person/gruppenmanagement/gruppenmanagement.php',
array('uid' => $this->_uid)
);
}
/**
* Shows Benutzergruppe overview page.
*/
public function showBenutzergruppe()
{
$this->_setNavigationMenuShowDetails();
$gruppe_kurzbz = $this->input->get('gruppe_kurzbz');
$data[self::FHC_CONTROLLER_ID] = $this->getControllerId();
$this->load->view(
'person/gruppenmanagement/benutzergruppe.php',
array('gruppe_kurzbz' => $gruppe_kurzbz)
);
}
/**
* Gets Benutzer assigned to a Gruppe
*/
public function getBenutzer()
{
$gruppe_kurzbz = $this->input->get('gruppe_kurzbz');
$this->BenutzergruppeModel->addSelect('uid, vorname, nachname, ben.aktiv');
$this->BenutzergruppeModel->addJoin('public.tbl_benutzer ben', 'uid');
$this->BenutzergruppeModel->addJoin('public.tbl_person', 'person_id');
$benutzerRes = $this->BenutzergruppeModel->loadWhere(array('gruppe_kurzbz' => $gruppe_kurzbz));
$this->outputJson($benutzerRes);
}
/**
* Gets all Benutzer for assignment to Gruppe
*/
public function getAllBenutzer()
{
$this->BenutzerModel->addSelect('uid, vorname, nachname');
$this->BenutzerModel->addJoin('public.tbl_person', 'person_id');
$benutzerRes = $this->BenutzerModel->loadWhere(
array('tbl_benutzer.aktiv' => true)
);
$this->outputJson($benutzerRes);
}
/**
* Adds a Benutzer to Gruppe
*/
public function addBenutzer()
{
$uid = $this->input->post('uid');
$gruppe_kurzbz = $this->input->post('gruppe_kurzbz');
if (isEmptyString($uid))
$result = error('Uid missing');
else
{
$benutzerExistsRes = $this->BenutzergruppeModel->loadWhere(
array(
'uid' => $uid,
'gruppe_kurzbz' => $gruppe_kurzbz
)
);
if (isError($benutzerExistsRes))
{
$this->outputJsonError(getError($benutzerExistsRes));
return;
}
if (hasData($benutzerExistsRes))
{
$this->outputJsonError($this->p->t('gruppenmanagement', 'benutzerSchonZugewiesen'));
return;
}
$result = $this->BenutzergruppeModel->insert(
array(
'uid' => $uid,
'gruppe_kurzbz' => $gruppe_kurzbz,
'insertamum' => date('Y-m-d H:i:s'),
'insertvon' => $this->_uid
)
);
// log the group add
$lastQry = $this->db->last_query();
if (isSuccess($result))
{
$beschreibung = 'Gruppenmanagement: Nutzer zu Gruppe hinzugefügt';
$this->_writeLog($this->_uid, $beschreibung, $lastQry);
}
}
$this->outputJson($result);
}
/**
* Removes Benutzer from Gruppe
*/
public function removeBenutzer()
{
$uid = $this->input->post('uid');
$gruppe_kurzbz = $this->input->post('gruppe_kurzbz');
if (isEmptyString($uid))
$result = error('Uid missing');
else
{
$result = $this->BenutzergruppeModel->delete(
array(
'uid' => $uid,
'gruppe_kurzbz' => $gruppe_kurzbz
)
);
}
// log the group remove
$lastQry = $this->db->last_query();
if (isSuccess($result))
{
$beschreibung = 'Gruppenmanagement: Nutzer aus Gruppe entfernt';
$this->_writeLog($this->_uid, $beschreibung, $lastQry);
}
$this->outputJson($result);
}
// -----------------------------------------------------------------------------------------------------------------
// Private methods
/**
* Define the navigation menu for the showDetails page
*/
private function _setNavigationMenuShowDetails()
{
$this->load->library('NavigationLib', array('navigation_page' => 'person/Gruppenmanagement/showBenutzergruppe'));
$link = site_url('person/Gruppenmanagement');
$this->navigationlib->setSessionMenu(
array(
'back' => $this->navigationlib->oneLevel(
'Zurück', // description
$link, // link
array(), // children
'angle-left', // icon
true, // expand
null, // subscriptDescription
null, // subscriptLinkClass
null, // subscriptLinkValue
'', // target
1 // sort
)
)
);
}
/**
* Set uid of authentificated user
*/
private function _setAuthUID()
{
$this->_uid = getAuthUID();
if (!$this->_uid) show_error('User authentification failed');
}
/**
* Writes an entry in the log table
*/
private function _writeLog($uid, $beschreibung, $lastQry)
{
$mitarbeiterResult = $this->MitarbeiterModel->load(array('mitarbeiter_uid'=>$this->_uid));
if(!isSuccess($mitarbeiterResult) || !hasData($mitarbeiterResult))
{
$uid = DUMMY_LEKTOR_UID;
$beschreibung .= ': '.$this->_uid;
$beschreibung = mb_substr($beschreibung, 0, 64);
}
$this->LogModel->insert(array(
'mitarbeiter_uid' => $uid,
'beschreibung' => $beschreibung,
'sql' => $lastQry
));
}
}
@@ -1,4 +1,20 @@
<?php
/**
* Copyright (C) 2022 fhcomplete.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
if (! defined('BASEPATH')) exit('No direct script access allowed');
@@ -0,0 +1,44 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Test Search Vue Component
*/
class TestSearch extends Auth_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct(
array(
'index' => 'system/developer:r'
)
);
// Loads WidgetLib
$this->load->library('WidgetLib');
// Loads phrases system
$this->loadPhrases(
array(
'global',
'ui',
'filter'
)
);
}
// -----------------------------------------------------------------------------------------------------------------
// Public methods
/**
* Everything has a beginning
*/
public function index()
{
$this->load->view('system/logs/testSearch.php');
}
}
@@ -88,6 +88,12 @@ class InfoCenter extends Auth_Controller
'message' => 'Type of Document %s was updated, set to %s',
'success' => null
),
'deletedoc' => array(
'logtype' => 'Action',
'name' => 'Document deleted',
'message' => 'Document %s deleted',
'success' => null
),
);
// Name of Interessentenstatus
@@ -131,6 +137,7 @@ class InfoCenter extends Auth_Controller
'reloadZgvPruefungen' => 'infocenter:r',
'reloadMessages' => 'infocenter:r',
'reloadDoks' => 'infocenter:r',
'reloadUebersichtDoks' => 'infocenter:r',
'reloadNotizen' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'reloadLogs' => 'infocenter:r',
'outputAkteContent' => array('infocenter:r', 'lehre/zgvpruefung:r'),
@@ -142,7 +149,9 @@ class InfoCenter extends Auth_Controller
'getStudienjahrEnd' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'setNavigationMenuArrayJson' => 'infocenter:r',
'getAbsageData' => 'infocenter:r',
'saveAbsageForAll' => 'infocenter:rw'
'saveAbsageForAll' => 'infocenter:rw',
'deleteDoc' => 'infocenter:rw',
'getStudienartData' => 'infocenter:rw'
)
);
@@ -159,6 +168,10 @@ class InfoCenter extends Auth_Controller
$this->load->model('system/Message_model', 'MessageModel');
$this->load->model('system/Filters_model', 'FiltersModel');
$this->load->model('system/PersonLock_model', 'PersonLockModel');
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
$this->load->model('codex/Zgv_model', 'ZgvModel');
$this->load->model('codex/Zgvmaster_model', 'ZgvmasterModel');
$this->load->model('codex/Nation_model', 'NationModel');
// Loads libraries
$this->load->library('PersonLogLib');
@@ -398,6 +411,35 @@ class InfoCenter extends Auth_Controller
$this->outputJsonSuccess(array($json));
}
public function deleteDoc($person_id)
{
$akte_id = $this->input->post('akteid');
if (isset($akte_id) && isset($person_id))
{
$this->load->library('AkteLib');
$akte = $this->aktelib->get($akte_id);
if (hasData($akte))
{
$akte = getData($akte);
if ($akte->person_id === (int)$person_id)
{
$result = $this->aktelib->remove($akte_id);
if (isError($result))
{
$this->terminateWithJsonError('Error deleting document');
}
$this->_log($person_id, 'deletedoc', array($akte->bezeichnung));
$this->outputJsonSuccess('success');
}
}
}
}
/**
* Gets prestudent data for a person in json format
* @param $person_id
@@ -1074,6 +1116,17 @@ class InfoCenter extends Auth_Controller
$this->load->view('system/infocenter/dokNachzureichend.php', array('dokumente_nachgereicht' => $dokumente_nachgereicht->retval));
}
public function reloadUebersichtDoks($person_id)
{
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false);
$this->DokumentModel->addOrder('bezeichnung');
$dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load())));
$data = array_merge($dokumentdata, ['dokumente' => $dokumente->retval]);
$this->load->view('system/infocenter/dokpruefung.php', $data);
}
/**
* Outputs content of an Akte, sends appropriate headers (so the document can be downloaded)
* @param $akte_id
@@ -1932,10 +1985,25 @@ class InfoCenter extends Auth_Controller
$abwstatusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
$intstatusgruende = $this->StatusgrundModel->getStatus(self::INTERESSENTSTATUS)->retval;
$studienArtBerechtigung = array_column($this->getStudienArtBerechtigung(), 'typ');
$this->ZgvModel->addOrder('zgv_bez');
$allZGVs = getData($this->ZgvModel->load());
$this->ZgvModel->addOrder('zgvmas_bez');
$allZGVsMaster = getData($this->ZgvmasterModel->load());
$this->NationModel->addOrder('langtext');
$allNations = getData($this->NationModel->load());
$data = array (
'zgvpruefungen' => $zgvpruefungen,
'abwstatusgruende' => $abwstatusgruende,
'intstatusgruende' => $intstatusgruende
'intstatusgruende' => $intstatusgruende,
'studienArtBerechtigung' => $studienArtBerechtigung,
'all_zgvs' => $allZGVs,
'all_zgvs_master' => $allZGVsMaster,
'all_nations' => $allNations,
);
return $data;
@@ -2194,18 +2262,36 @@ class InfoCenter extends Auth_Controller
public function getAbsageData()
{
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
$studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter');
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, ['b', 'm']);
$statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
$studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(['b', 'm'], $studienSemester);
if (hasData($stg_typ))
{
$stg_typ = getData($stg_typ);
$statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
$studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(array_column($stg_typ, 'typ'), $studienSemester);
$data = array (
'statusgruende' => $statusgruende,
'studiengaenge' => $studiengaenge->retval
);
$data = array (
'statusgruende' => $statusgruende,
'studiengaenge' => $studiengaenge->retval
);
$this->outputJsonSuccess($data);
$this->outputJsonSuccess($data);
}
else
$this->outputJsonSuccess(null);
}
public function getStudienArtBerechtigung()
{
$studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter');
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, ['b', 'm', 'l']);
return getData($stg_typ);
}
public function getStudienartData()
{
$this->outputJsonSuccess($this->getStudienArtBerechtigung());
}
public function saveAbsageForAll()
@@ -81,7 +81,7 @@ class Issues extends Auth_Controller
}
if (isEmptyString($changeIssueMethod))
$errors[] = error("Invalid issue status given");
$errors[] = "Invalid issue status given";
else
{
$issueRes = $this->issueslib->{$changeIssueMethod}($issue_id, $user);