mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 09:52:22 +00:00
Created Anrechnungen STGL: GUI, Controller, Tabledata, Phrases
Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
//if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// Set required permissions
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'admin:rw',
|
||||
'download' => 'admin:rw'
|
||||
)
|
||||
);
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('WidgetLib');
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->library('AnrechnungLib');
|
||||
$this->load->library('DmsLib');
|
||||
|
||||
// Load helpers
|
||||
$this->load->helper('form');
|
||||
$this->load->helper('url');
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
'ui',
|
||||
'anrechnung',
|
||||
'person',
|
||||
'lehre',
|
||||
'table'
|
||||
)
|
||||
);
|
||||
|
||||
$this->_setAuthUID();
|
||||
|
||||
$this->setControllerId();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$studiensemester_kurzbz = $this->input->get('studiensemester');
|
||||
|
||||
if (!is_string($studiensemester_kurzbz))
|
||||
{
|
||||
$studiensemester = $this->StudiensemesterModel->getNearest(); // TODO check
|
||||
if (hasData($studiensemester))
|
||||
{
|
||||
$studiensemester_kurzbz = $studiensemester->retval[0]->studiensemester_kurzbz;
|
||||
}
|
||||
elseif (isError($studiensemester))
|
||||
{
|
||||
show_error(getError($studiensemester));
|
||||
}
|
||||
}
|
||||
|
||||
$viewData = array(
|
||||
'studiensemester_selected' => $studiensemester_kurzbz
|
||||
);
|
||||
|
||||
$this->load->view('lehre/anrechnung/approveAnrechnungUebersicht.php', $viewData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download and open uploaded document (Nachweisdokument).
|
||||
*/
|
||||
public function download()
|
||||
{
|
||||
$dms_id = $this->input->get('dms_id');
|
||||
|
||||
if (!is_numeric($dms_id))
|
||||
{
|
||||
show_error('Wrong parameter');
|
||||
}
|
||||
|
||||
$this->dmslib->download($dms_id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user