mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Merge branch 'master' into feature-3716/Messaging_inbox_outbox_user
This commit is contained in:
+22
-15
@@ -2,8 +2,10 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class UDF extends Auth_Controller
|
||||
class FAS_UDF extends Auth_Controller
|
||||
{
|
||||
const FAS_UDF_SESSION_NAME = 'fasUdfSessionName';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
@@ -22,31 +24,33 @@ class UDF extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$fasUdfSession = getSession(self::FAS_UDF_SESSION_NAME);
|
||||
|
||||
$person_id = $this->input->get('person_id');
|
||||
if (isset($this->session->person_id))
|
||||
if (isset($fasUdfSession['person_id']))
|
||||
{
|
||||
if (!isset($person_id))
|
||||
{
|
||||
$person_id = $this->session->person_id;
|
||||
$person_id = $fasUdfSession['person_id'];
|
||||
}
|
||||
unset($this->session->person_id);
|
||||
unset($fasUdfSession['person_id']);
|
||||
}
|
||||
|
||||
$prestudent_id = $this->input->get('prestudent_id');
|
||||
if (isset($this->session->prestudent_id))
|
||||
if (isset($fasUdfSession['prestudent_id']))
|
||||
{
|
||||
if (!isset($prestudent_id))
|
||||
{
|
||||
$prestudent_id = $this->session->prestudent_id;
|
||||
$prestudent_id = $fasUdfSession['prestudent_id'];
|
||||
}
|
||||
unset($this->session->prestudent_id);
|
||||
unset($fasUdfSession['prestudent_id']);
|
||||
}
|
||||
|
||||
$result = null;
|
||||
if (isset($this->session->result))
|
||||
if (isset($fasUdfSession['result']))
|
||||
{
|
||||
$result = clone $this->session->result;
|
||||
$this->session->set_userdata('result', null);
|
||||
$result = clone $fasUdfSession['result'];
|
||||
setSessionElement(self::FAS_UDF_SESSION_NAME, 'result', null);
|
||||
}
|
||||
|
||||
$data = array('result' => $result);
|
||||
@@ -71,7 +75,7 @@ class UDF extends Auth_Controller
|
||||
}
|
||||
}
|
||||
|
||||
$this->load->view('system/udf', $data);
|
||||
$this->load->view('system/fas_udf', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,9 +94,9 @@ class UDF extends Auth_Controller
|
||||
if (isSuccess($validation))
|
||||
{
|
||||
// Load model UDF_model
|
||||
$this->load->model('system/UDF_model', 'UDFModel');
|
||||
$this->load->model('system/FAS_UDF_model', 'FASUDFModel');
|
||||
|
||||
$result = $this->UDFModel->saveUDFs($udfs);
|
||||
$result = $this->FASUDFModel->saveUDFs($udfs);
|
||||
|
||||
$userdata['result'] = $result;
|
||||
}
|
||||
@@ -101,8 +105,11 @@ class UDF extends Auth_Controller
|
||||
$userdata['result'] = $validation;
|
||||
}
|
||||
|
||||
$this->session->set_userdata($userdata);
|
||||
redirect('system/UDF');
|
||||
setSessionElement(self::FAS_UDF_SESSION_NAME, 'person_id', $userdata['person_id']);
|
||||
setSessionElement(self::FAS_UDF_SESSION_NAME, 'prestudent_id', $userdata['prestudent_id']);
|
||||
setSessionElement(self::FAS_UDF_SESSION_NAME, 'result', $userdata['result']);
|
||||
|
||||
redirect('system/FAS_UDF');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1,261 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the FiltersLib (back-end)
|
||||
* Provides data to the ajax get calls about the filter
|
||||
* Accepts 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 FilterWidget has its
|
||||
* own permissions check
|
||||
*/
|
||||
class Filters extends FHC_Controller
|
||||
{
|
||||
const FILTER_PAGE_PARAM = 'filter_page';
|
||||
|
||||
/**
|
||||
* Calls the parent's constructor and loads the FiltersLib
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads authentication library and starts authentication
|
||||
$this->load->library('AuthLib');
|
||||
|
||||
// Loads the FiltersLib with HTTP GET/POST parameters
|
||||
$this->_loadFiltersLib();
|
||||
|
||||
// Checks if the caller is allow to read this data
|
||||
$this->_isAllowed();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// 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->filterslib->getSession());
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the number of records present in the current dataset and will be written on the output in JSON format
|
||||
*/
|
||||
public function rowNumber()
|
||||
{
|
||||
$rowNumber = 0;
|
||||
$dataset = $this->filterslib->getSessionElement(FiltersLib::SESSION_DATASET);
|
||||
|
||||
if (isset($dataset) && is_array($dataset))
|
||||
{
|
||||
$rowNumber = count($dataset);
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess($rowNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the sort of the selected fields of the current filter and
|
||||
* its data will be written on the output in JSON format
|
||||
*/
|
||||
public function sortSelectedFields()
|
||||
{
|
||||
$selectedFields = $this->input->post('selectedFields');
|
||||
|
||||
if ($this->filterslib->sortSelectedFields($selectedFields) == true)
|
||||
{
|
||||
$this->getFilter();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a selected field from the current filter and
|
||||
* its data will be written on the output in JSON format
|
||||
*/
|
||||
public function removeSelectedField()
|
||||
{
|
||||
$selectedField = $this->input->post('selectedField');
|
||||
|
||||
if ($this->filterslib->removeSelectedField($selectedField) == true)
|
||||
{
|
||||
$this->getFilter();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a field to the current filter and its data will be written on the output in JSON format
|
||||
*/
|
||||
public function addSelectedField()
|
||||
{
|
||||
$selectedField = $this->input->post('selectedField');
|
||||
|
||||
if ($this->filterslib->addSelectedField($selectedField) == true)
|
||||
{
|
||||
$this->getFilter();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an applied filter (SQL where condition) from the current filter
|
||||
*/
|
||||
public function removeAppliedFilter()
|
||||
{
|
||||
$appliedFilter = $this->input->post('appliedFilter');
|
||||
|
||||
if ($this->filterslib->removeAppliedFilter($appliedFilter) == true)
|
||||
{
|
||||
$this->outputJsonSuccess('Removed');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply all the applied filters (SQL where conditions) to the current filter
|
||||
*/
|
||||
public function applyFilters()
|
||||
{
|
||||
$appliedFilters = $this->input->post('appliedFilters');
|
||||
$appliedFiltersOperations = $this->input->post('appliedFiltersOperations');
|
||||
$appliedFiltersConditions = $this->input->post('appliedFiltersConditions');
|
||||
$appliedFiltersOptions = $this->input->post('appliedFiltersOptions');
|
||||
|
||||
if ($this->filterslib->applyFilters(
|
||||
$appliedFilters,
|
||||
$appliedFiltersOperations,
|
||||
$appliedFiltersConditions,
|
||||
$appliedFiltersOptions
|
||||
) == true)
|
||||
{
|
||||
$this->outputJsonSuccess('Applied');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a filter (SQL where clause) to be applied to the current filter
|
||||
*/
|
||||
public function addFilter()
|
||||
{
|
||||
$filter = $this->input->post('filter');
|
||||
|
||||
if ($this->filterslib->addFilter($filter) == true)
|
||||
{
|
||||
$this->getFilter();
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the current filter as a custom filter for this user with the given description
|
||||
*/
|
||||
public function saveCustomFilter()
|
||||
{
|
||||
$customFilterDescription = $this->input->post('customFilterDescription');
|
||||
|
||||
if ($this->filterslib->saveCustomFilter($customFilterDescription) == true)
|
||||
{
|
||||
$this->outputJsonSuccess('Saved');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('An error occurred while saving a custom filter');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove a custom filter by its filter_id
|
||||
*/
|
||||
public function removeCustomFilter()
|
||||
{
|
||||
$filter_id = $this->input->post('filter_id');
|
||||
|
||||
if ($this->filterslib->removeCustomFilter($filter_id) == true)
|
||||
{
|
||||
$this->outputJsonSuccess('Removed');
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->outputJsonError('Wrong parameter');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Define the navigation menu for the current filter widget
|
||||
*/
|
||||
public function setNavigationMenu()
|
||||
{
|
||||
// Generates the filters structure array
|
||||
$filterMenu = $this->filterslib->generateFilterMenu($this->input->get(FiltersLib::NAVIGATION_PAGE));
|
||||
|
||||
$this->outputJsonSuccess('Success');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Checks if the user is allowed to use this filter
|
||||
*/
|
||||
private function _isAllowed()
|
||||
{
|
||||
if (!$this->filterslib->isAllowed())
|
||||
{
|
||||
$this->terminateWithJsonError('You are not allowed to access to this content');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the FiltersLib with the FILTER_PAGE_PARAM parameter
|
||||
* If the parameter FILTER_PAGE_PARAM is not given then the execution of the controller is terminated and
|
||||
* an error message is printed
|
||||
*/
|
||||
private function _loadFiltersLib()
|
||||
{
|
||||
// If the parameter FILTER_PAGE_PARAM is present in the HTTP GET or POST
|
||||
if (isset($_GET[self::FILTER_PAGE_PARAM]) || isset($_POST[self::FILTER_PAGE_PARAM]))
|
||||
{
|
||||
// If it is present in the HTTP GET
|
||||
if (isset($_GET[self::FILTER_PAGE_PARAM]))
|
||||
{
|
||||
$filterPage = $this->input->get(self::FILTER_PAGE_PARAM); // is retrieved from the HTTP GET
|
||||
}
|
||||
elseif (isset($_POST[self::FILTER_PAGE_PARAM])) // Else if it is present in the HTTP POST
|
||||
{
|
||||
$filterPage = $this->input->post(self::FILTER_PAGE_PARAM); // is retrieved from the HTTP POST
|
||||
}
|
||||
|
||||
// Loads the FiltersLib that contains all the used logic
|
||||
$this->load->library('FiltersLib', array(self::FILTER_PAGE_PARAM => $filterPage));
|
||||
}
|
||||
else // Otherwise an error will be written in the output
|
||||
{
|
||||
$this->terminateWithJsonError('Parameter "'.self::FILTER_PAGE_PARAM.'" not provided!');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Overview on cronjob logs
|
||||
*/
|
||||
class LogsViewer 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
|
||||
|
||||
/**
|
||||
* Main page of the InfoCenter tool
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('system/logs/logsViewer.php');
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
* Provides data to the ajax get calls about the filter
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Navigation extends Auth_Controller
|
||||
class Navigation extends FHC_Controller
|
||||
{
|
||||
const NAVIGATION_PAGE_PARAM = 'navigation_page'; // Navigation page parameter name
|
||||
|
||||
@@ -16,12 +16,9 @@ class Navigation extends Auth_Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'menu' => 'basis/vilesci:r',
|
||||
'header' => 'basis/vilesci:r'
|
||||
)
|
||||
);
|
||||
parent::__construct();
|
||||
|
||||
$this->load->library('AuthLib');
|
||||
|
||||
$this->_loadNavigationLib(); // Loads the NavigationLib with parameters
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ class Phrases extends Auth_Controller
|
||||
{
|
||||
$phrases = $this->phraseslib->getPhraseByApp('aufnahme');
|
||||
if ($phrases->error)
|
||||
show_error($phrases->retval);
|
||||
show_error(getError($phrases));
|
||||
|
||||
$data = array(
|
||||
'app' => 'aufnahme',
|
||||
@@ -67,7 +67,7 @@ class Phrases extends Auth_Controller
|
||||
|
||||
$phrase_inhalt = $this->phraseslib->getPhraseInhalt($phrase_id);
|
||||
if ($phrase_inhalt->error)
|
||||
show_error($phrase_inhalt->retval);
|
||||
show_error(getError($phrase_inhalt));
|
||||
|
||||
$data = array(
|
||||
'phrase_id' => $phrase_id,
|
||||
@@ -88,7 +88,7 @@ class Phrases extends Auth_Controller
|
||||
|
||||
$phrase_inhalt = $this->phraseslib->delPhrasentext($phrasentext_id);
|
||||
if ($phrase_inhalt->error)
|
||||
show_error($phrase_inhalt->retval);
|
||||
show_error(getError($phrase_inhalt));
|
||||
|
||||
redirect('/system/Phrases/view/'.$phrase_id);
|
||||
}
|
||||
@@ -102,7 +102,7 @@ class Phrases extends Auth_Controller
|
||||
|
||||
$phrase = $this->phraseslib->getPhrase($phrase_id);
|
||||
if ($phrase->error)
|
||||
show_error($phrase->retval);
|
||||
show_error(getError($phrase));
|
||||
|
||||
if (count($phrase->retval) != 1)
|
||||
show_error('Phrase nicht vorhanden! ID: '.$phrase_id);
|
||||
@@ -124,7 +124,7 @@ class Phrases extends Auth_Controller
|
||||
|
||||
$phrase = $this->phraseslib->savePhrase($phrase_id, $data);
|
||||
if ($phrase->error)
|
||||
show_error($phrase->retval);
|
||||
show_error(getError($phrase));
|
||||
|
||||
$phrase_id = $phrase->retval;
|
||||
|
||||
@@ -145,7 +145,7 @@ class Phrases extends Auth_Controller
|
||||
|
||||
$resultOE = $this->OrganisationseinheitModel->loadWhere(array('aktiv' => true, 'oe_parent_kurzbz' => null));
|
||||
if ($resultOE->error)
|
||||
show_error($resultOE->retval);
|
||||
show_error(getError($resultOE));
|
||||
|
||||
if (hasData($resultOE))
|
||||
{
|
||||
@@ -161,7 +161,7 @@ class Phrases extends Auth_Controller
|
||||
|
||||
$phrase_inhalt = $this->phraseslib->insertPhraseinhalt($data);
|
||||
if ($phrase_inhalt->error)
|
||||
show_error($phrase_inhalt->retval);
|
||||
show_error(getError($phrase_inhalt);
|
||||
|
||||
$phrase_inhalt_id = $phrase_inhalt->retval;
|
||||
|
||||
@@ -180,7 +180,7 @@ class Phrases extends Auth_Controller
|
||||
{
|
||||
$phrase_inhalt = $this->phraseslib->getPhrasentextById($phrasentext_id);
|
||||
if ($phrase_inhalt->error)
|
||||
show_error($phrase_inhalt->retval);
|
||||
show_error(getError($phrase_inhalt));
|
||||
|
||||
$data = $phrase_inhalt->retval[0];
|
||||
|
||||
@@ -204,7 +204,7 @@ class Phrases extends Auth_Controller
|
||||
|
||||
$phrase_inhalt = $this->phraseslib->updatePhraseInhalt($phrase_inhalt_id, $data);
|
||||
if ($phrase_inhalt->error)
|
||||
show_error($phrase_inhalt->retval);
|
||||
show_error(getError($phrase_inhalt));
|
||||
|
||||
|
||||
redirect('/system/Phrases/editText/'.$phrase_inhalt_id);
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Class Variables
|
||||
* Provides interface for managing user variables.
|
||||
*/
|
||||
class Variables extends Auth_Controller
|
||||
{
|
||||
private $_uid;
|
||||
|
||||
/**
|
||||
* Variables constructor.
|
||||
* Sets logged in user, loads models and libraries.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'setVar' => 'basis/variable:rw',
|
||||
'getVar' => 'basis/variable:rw',
|
||||
'changeStudiensemesterVar' => 'basis/variable:rw'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->model('system/variable_model', 'VariableModel');
|
||||
|
||||
$this->_setAuthUID();
|
||||
|
||||
$this->load->library('VariableLib', array('uid' => $this->_uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a user variable based on received post parameters, outputs JSON response.
|
||||
*/
|
||||
public function setVar()
|
||||
{
|
||||
$name = $this->input->post('name');
|
||||
$wert = $this->input->post('wert');
|
||||
|
||||
$result = $this->VariableModel->setVariable($this->_uid, $name, $wert);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* gets a user variable based on received post parameter, outputs JSON response.
|
||||
*/
|
||||
public function getVar()
|
||||
{
|
||||
$name = $this->input->get('name');
|
||||
$this->outputJson($this->VariableModel->getVariables($this->_uid, array($name)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes a user variable containing a Studiensemester based on received post parameters, outputs JSON response.
|
||||
*/
|
||||
public function changeStudiensemesterVar()
|
||||
{
|
||||
$name = $this->input->post('name');
|
||||
$change = $this->input->post('change');
|
||||
|
||||
$result = $this->variablelib->changeStudiensemesterVar($this->_uid, $name, $change);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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');
|
||||
}
|
||||
}
|
||||
@@ -49,7 +49,7 @@ class Vorlage extends Auth_Controller
|
||||
$vorlage = $this->vorlagelib->getVorlageByMimetype($mimetype);
|
||||
|
||||
if ($vorlage->error)
|
||||
show_error($vorlage->retval);
|
||||
show_error(getError($vorlage));
|
||||
|
||||
$data = array (
|
||||
'mimetype' => $mimetype,
|
||||
@@ -66,7 +66,7 @@ class Vorlage extends Auth_Controller
|
||||
$vorlagentext = $this->vorlagelib->getVorlagetextByVorlage($vorlage_kurzbz);
|
||||
|
||||
if ($vorlagentext->error)
|
||||
show_error($vorlagentext->retval);
|
||||
show_error(getError($vorlagentext));
|
||||
|
||||
$data = array (
|
||||
'vorlage_kurzbz' => $vorlage_kurzbz,
|
||||
@@ -83,7 +83,7 @@ class Vorlage extends Auth_Controller
|
||||
$vorlage = $this->vorlagelib->getVorlage($vorlage_kurzbz);
|
||||
|
||||
if ($vorlage->error)
|
||||
show_error($vorlage->retval);
|
||||
show_error(getError($vorlage));
|
||||
|
||||
if (count($vorlage->retval) != 1)
|
||||
show_error('Nachricht nicht vorhanden! ID: '.$vorlage_kurzbz);
|
||||
@@ -119,7 +119,7 @@ class Vorlage extends Auth_Controller
|
||||
$vorlage = $this->vorlagelib->saveVorlage($vorlage_kurzbz, $data);
|
||||
|
||||
if ($vorlage->error)
|
||||
show_error($vorlage->retval);
|
||||
show_error(getError($vorlage));
|
||||
|
||||
$vorlage_kurzbz = $vorlage->retval;
|
||||
|
||||
@@ -137,7 +137,7 @@ class Vorlage extends Auth_Controller
|
||||
$resultOE = $this->OrganisationseinheitModel->loadWhere(array('aktiv' => true, 'oe_parent_kurzbz' => null));
|
||||
|
||||
if ($resultOE->error)
|
||||
show_error($resultOE->retval);
|
||||
show_error(getError($resultOE));
|
||||
|
||||
if (hasData($resultOE))
|
||||
{
|
||||
@@ -153,7 +153,7 @@ class Vorlage extends Auth_Controller
|
||||
$vorlagetext = $this->vorlagelib->insertVorlagetext($data);
|
||||
|
||||
if ($vorlagetext->error)
|
||||
show_error($vorlagetext->retval);
|
||||
show_error(getError($vorlagetext));
|
||||
|
||||
$vorlagestudiengang_id = $vorlagetext->retval;
|
||||
|
||||
@@ -170,7 +170,7 @@ class Vorlage extends Auth_Controller
|
||||
$vorlagetext = $this->vorlagelib->getVorlagetextById($vorlagestudiengang_id);
|
||||
|
||||
if ($vorlagetext->error)
|
||||
show_error($vorlagetext->retval);
|
||||
show_error(getError($vorlagetext));
|
||||
|
||||
$data = $vorlagetext->retval[0];
|
||||
|
||||
@@ -254,7 +254,7 @@ class Vorlage extends Auth_Controller
|
||||
$vorlagetext = $this->vorlagelib->updateVorlagetext($data['vorlagestudiengang_id'], $data);
|
||||
|
||||
if ($vorlagetext->error)
|
||||
show_error($vorlagetext->retval);
|
||||
show_error(getError($vorlagetext));
|
||||
|
||||
redirect('/system/vorlage/editText/'.$data['vorlagestudiengang_id']);
|
||||
}
|
||||
@@ -266,7 +266,7 @@ class Vorlage extends Auth_Controller
|
||||
$vorlagetext = $this->vorlagelib->getVorlagetextById($vorlagestudiengang_id);
|
||||
|
||||
if ($vorlagetext->error)
|
||||
show_error($vorlagetext->retval);
|
||||
show_error(getError($vorlagetext));
|
||||
|
||||
$data = array(
|
||||
'text' => parseText($vorlagetext->retval[0]->text, $jsonDecodedForm)
|
||||
|
||||
@@ -61,7 +61,7 @@ class PrestudentMultiAssign extends Auth_Controller
|
||||
}
|
||||
else if (isError($returnUsers))
|
||||
{
|
||||
show_error($returnUsers->retval);
|
||||
show_error(getError($returnUsers));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
const FILTER_ID = 'filter_id';
|
||||
const PREV_FILTER_ID = 'prev_filter_id';
|
||||
const KEEP_TABLESORTER_FILTER = 'keepTsFilter';
|
||||
|
||||
private $_uid; // contains the UID of the logged user
|
||||
|
||||
@@ -100,9 +101,11 @@ class InfoCenter extends Auth_Controller
|
||||
'reloadNotizen' => 'infocenter:r',
|
||||
'reloadLogs' => 'infocenter:r',
|
||||
'outputAkteContent' => 'infocenter:r',
|
||||
'getParkedDate' => 'infocenter:r',
|
||||
'getPostponeDate' => 'infocenter:r',
|
||||
'park' => 'infocenter:rw',
|
||||
'unpark' => 'infocenter:rw',
|
||||
'setOnHold' => 'infocenter:rw',
|
||||
'removeOnHold' => 'infocenter:rw',
|
||||
'getStudienjahrEnd' => 'infocenter:r',
|
||||
'setNavigationMenuArrayJson' => 'infocenter:r'
|
||||
)
|
||||
@@ -136,6 +139,8 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
|
||||
$this->load->library('VariableLib', array('uid' => $this->_uid));
|
||||
|
||||
$this->setControllerId(); // sets the controller id
|
||||
}
|
||||
|
||||
@@ -188,7 +193,7 @@ class InfoCenter extends Auth_Controller
|
||||
$personexists = $this->PersonModel->load($person_id);
|
||||
|
||||
if (isError($personexists))
|
||||
show_error($personexists->retval);
|
||||
show_error(getError($personexists));
|
||||
|
||||
if (!hasData($personexists))
|
||||
show_error('Person does not exist!');
|
||||
@@ -199,8 +204,7 @@ class InfoCenter extends Auth_Controller
|
||||
// mark person as locked for editing
|
||||
$result = $this->PersonLockModel->lockPerson($person_id, $this->_uid, self::APP);
|
||||
|
||||
if (isError($result))
|
||||
show_error($result->retval);
|
||||
if (isError($result)) show_error(getError($result));
|
||||
}
|
||||
|
||||
$persondata = $this->_loadPersonData($person_id);
|
||||
@@ -226,13 +230,12 @@ class InfoCenter extends Auth_Controller
|
||||
{
|
||||
$result = $this->PersonLockModel->unlockPerson($person_id, self::APP);
|
||||
|
||||
if (isError($result))
|
||||
show_error($result->retval);
|
||||
if (isError($result)) show_error(getError($result));
|
||||
|
||||
$redirectLink = '/'.self::INFOCENTER_URI.'?'.self::FHC_CONTROLLER_ID.'='.$this->getControllerId();
|
||||
|
||||
// Force reload of Dataset after Unlock
|
||||
$redirectLink .= '&reloadDataset=true';
|
||||
$redirectLink .= '&'.self::KEEP_TABLESORTER_FILTER.'=true';
|
||||
|
||||
$currentFilterId = $this->input->get(self::FILTER_ID);
|
||||
if (isset($currentFilterId))
|
||||
@@ -659,7 +662,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
if (isError($notizen))
|
||||
{
|
||||
show_error($notizen->retval);
|
||||
show_error(getError($notizen));
|
||||
}
|
||||
|
||||
$this->load->view('system/infocenter/notizen.php', array('notizen' => $notizen->retval));
|
||||
@@ -687,14 +690,14 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
if (isError($akte))
|
||||
{
|
||||
show_error($akte->retval);
|
||||
show_error(getError($akte));
|
||||
}
|
||||
|
||||
$aktecontent = $this->dmslib->getAkteContent($akte_id);
|
||||
|
||||
if (isError($aktecontent))
|
||||
{
|
||||
show_error($aktecontent->retval);
|
||||
show_error(getError($aktecontent));
|
||||
}
|
||||
|
||||
$this->output
|
||||
@@ -709,11 +712,32 @@ class InfoCenter extends Auth_Controller
|
||||
* Gets the date until which a person is parked
|
||||
* @param $person_id
|
||||
*/
|
||||
public function getParkedDate($person_id)
|
||||
public function getPostponeDate($person_id)
|
||||
{
|
||||
$result = array(
|
||||
'type' => null,
|
||||
'date' => null
|
||||
);
|
||||
|
||||
$parkedDate = $this->personloglib->getParkedDate($person_id);
|
||||
|
||||
$this->outputJsonSuccess(array($parkedDate));
|
||||
if (isset($parkedDate))
|
||||
{
|
||||
$result['type'] = 'parked';
|
||||
$result['date'] = $parkedDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
$onholdDate = $this->personloglib->getOnHoldDate($person_id);
|
||||
|
||||
if (isset($onholdDate))
|
||||
{
|
||||
$result['type'] = 'onhold';
|
||||
$result['date'] = $onholdDate;
|
||||
}
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -741,6 +765,31 @@ class InfoCenter extends Auth_Controller
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a person on hold ("zurückstellen")
|
||||
*/
|
||||
public function setOnHold()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
$date = $this->input->post('onholddate');
|
||||
|
||||
$result = $this->personloglib->setOnHold($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->_uid);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removed on hold status of a person
|
||||
*/
|
||||
public function removeOnHold()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
|
||||
$result = $this->personloglib->removeOnHold($person_id);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the End date of the current Studienjahr
|
||||
*/
|
||||
@@ -891,6 +940,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
$freigegebenLink = site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE);
|
||||
$reihungstestAbsolviertLink = site_url(self::INFOCENTER_URI.'/'.self::REIHUNGSTESTABSOLVIERT_PAGE);
|
||||
|
||||
$currentFilterId = $this->input->get(self::FILTER_ID);
|
||||
if (isset($currentFilterId))
|
||||
{
|
||||
@@ -948,7 +998,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
$origin_page = $this->input->get(self::ORIGIN_PAGE);
|
||||
|
||||
$link = site_url(self::INFOCENTER_URI.'/'.self::INDEX_PAGE);
|
||||
$link = site_url(self::INFOCENTER_URI);
|
||||
if ($origin_page == self::FREIGEGEBEN_PAGE)
|
||||
{
|
||||
$link = site_url(self::INFOCENTER_URI.'/'.self::FREIGEGEBEN_PAGE);
|
||||
@@ -961,7 +1011,7 @@ class InfoCenter extends Auth_Controller
|
||||
$prevFilterId = $this->input->get(self::PREV_FILTER_ID);
|
||||
if (isset($prevFilterId))
|
||||
{
|
||||
$link .= '?'.self::FILTER_ID.'='.$prevFilterId;
|
||||
$link .= '?'.self::FILTER_ID.'='.$prevFilterId.'&'.self::KEEP_TABLESORTER_FILTER.'=true';
|
||||
}
|
||||
|
||||
$this->navigationlib->setSessionMenu(
|
||||
@@ -997,7 +1047,7 @@ class InfoCenter extends Auth_Controller
|
||||
$prevFilterId = $this->input->get(self::PREV_FILTER_ID);
|
||||
if (isset($prevFilterId))
|
||||
{
|
||||
$homeLink .= '?'.self::FILTER_ID.'='.$prevFilterId;
|
||||
$homeLink .= '&'.self::FILTER_ID.'='.$prevFilterId;
|
||||
}
|
||||
|
||||
$this->navigationlib->setSessionElementMenu(
|
||||
@@ -1112,7 +1162,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
if (isError($locked))
|
||||
{
|
||||
show_error($locked->retval);
|
||||
show_error(getError($locked));
|
||||
}
|
||||
|
||||
$lockedby = null;
|
||||
@@ -1131,7 +1181,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
if (isError($stammdaten))
|
||||
{
|
||||
show_error($stammdaten->retval);
|
||||
show_error(getError($stammdaten));
|
||||
}
|
||||
|
||||
if (!isset($stammdaten->retval))
|
||||
@@ -1141,21 +1191,21 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
if (isError($dokumente))
|
||||
{
|
||||
show_error($dokumente->retval);
|
||||
show_error(getError($dokumente));
|
||||
}
|
||||
|
||||
$dokumente_nachgereicht = $this->AkteModel->getAktenWithDokInfo($person_id, null, true);
|
||||
|
||||
if (isError($dokumente_nachgereicht))
|
||||
{
|
||||
show_error($dokumente_nachgereicht->retval);
|
||||
show_error(getError($dokumente_nachgereicht));
|
||||
}
|
||||
|
||||
$messages = $this->MessageModel->getMessagesOfPerson($person_id, 1);
|
||||
|
||||
if (isError($messages))
|
||||
{
|
||||
show_error($messages->retval);
|
||||
show_error(getError($messages));
|
||||
}
|
||||
|
||||
$logs = $this->personloglib->getLogs($person_id);
|
||||
@@ -1164,21 +1214,21 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
if (isError($notizen))
|
||||
{
|
||||
show_error($notizen->retval);
|
||||
show_error(getError($notizen));
|
||||
}
|
||||
|
||||
$notizen_bewerbung = $this->NotizModel->getNotizByTitel($person_id, 'Anmerkung zur Bewerbung%');
|
||||
|
||||
if (isError($notizen_bewerbung))
|
||||
{
|
||||
show_error($notizen_bewerbung->retval);
|
||||
show_error(getError($notizen_bewerbung));
|
||||
}
|
||||
|
||||
$user_person = $this->PersonModel->getByUid($this->_uid);
|
||||
|
||||
if (isError($user_person))
|
||||
{
|
||||
show_error($user_person->retval);
|
||||
show_error(getError($user_person));
|
||||
}
|
||||
|
||||
$data = array (
|
||||
@@ -1209,7 +1259,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
if (isError($prestudenten))
|
||||
{
|
||||
show_error($prestudenten->retval);
|
||||
show_error(getError($prestudenten));
|
||||
}
|
||||
|
||||
foreach ($prestudenten->retval as $prestudent)
|
||||
@@ -1218,7 +1268,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
if (isError($prestudentWithZgv))
|
||||
{
|
||||
show_error($prestudentWithZgv->retval);
|
||||
show_error(getError($prestudentWithZgv));
|
||||
}
|
||||
|
||||
$zgvpruefung = $prestudentWithZgv->retval[0];
|
||||
@@ -1326,13 +1376,13 @@ class InfoCenter extends Auth_Controller
|
||||
$starta = $this->StudiensemesterModel->load($a->prestudentstatus->studiensemester_kurzbz);
|
||||
if (!hasData($starta))
|
||||
{
|
||||
show_error($starta->retval);
|
||||
show_error(getError($starta));
|
||||
}
|
||||
|
||||
$startb = $this->StudiensemesterModel->load($b->prestudentstatus->studiensemester_kurzbz);
|
||||
if (!hasData($startb))
|
||||
{
|
||||
show_error($startb->retval);
|
||||
show_error(getError($startb));
|
||||
}
|
||||
|
||||
$starta = date_format(date_create($starta->retval[0]->start), 'Y-m-d');
|
||||
@@ -1404,7 +1454,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
if (isError($prestudent))
|
||||
{
|
||||
show_error($prestudent->retval);
|
||||
show_error(getError($prestudent));
|
||||
}
|
||||
|
||||
$person_id = $prestudent->retval[0]->person_id;
|
||||
|
||||
Reference in New Issue
Block a user