mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Merge branch 'feature-17644/Anrechnung_Ansicht-fuer-Assistenz'
This commit is contained in:
@@ -22,8 +22,8 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
// Set required permissions
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'lehre/anrechnung_genehmigen:rw',
|
||||
'download' => 'lehre/anrechnung_genehmigen:rw',
|
||||
'index' => 'lehre/anrechnung_genehmigen:r',
|
||||
'download' => 'lehre/anrechnung_genehmigen:r',
|
||||
'approve' => 'lehre/anrechnung_genehmigen:rw',
|
||||
'reject' => 'lehre/anrechnung_genehmigen:rw',
|
||||
'requestRecommendation' => 'lehre/anrechnung_genehmigen:rw',
|
||||
@@ -81,7 +81,7 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
}
|
||||
|
||||
// Check if user is entitled to read the Anrechnung
|
||||
self::_checkIfEntitledToReadAnrechnung($anrechnung_id);
|
||||
$this->_checkIfEntitledToReadAnrechnung($anrechnung_id);
|
||||
|
||||
// Get Anrechung data
|
||||
$anrechnungData = $this->anrechnunglib->getAnrechnungData($anrechnung_id);
|
||||
@@ -99,11 +99,16 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
// Get Genehmigung data
|
||||
$genehmigungData = $this->anrechnunglib->getGenehmigungData($anrechnung_id);
|
||||
|
||||
$hasReadOnlyAccess =
|
||||
$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's', $antragData->studiengang_kz)
|
||||
&& !$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 'suid', $antragData->studiengang_kz);
|
||||
|
||||
$viewData = array(
|
||||
'antragData' => $antragData,
|
||||
'anrechnungData' => $anrechnungData,
|
||||
'empfehlungData' => $empfehlungData,
|
||||
'genehmigungData' => $genehmigungData
|
||||
'genehmigungData' => $genehmigungData,
|
||||
'hasReadOnlyAccess' => $hasReadOnlyAccess
|
||||
);
|
||||
|
||||
$this->load->view('lehre/anrechnung/approveAnrechnungDetail.php', $viewData);
|
||||
@@ -385,7 +390,7 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
}
|
||||
|
||||
// Check if user is entitled to read dms doc
|
||||
self::_checkIfEntitledToReadDMSDoc($dms_id);
|
||||
$this->_checkIfEntitledToReadDMSDoc($dms_id);
|
||||
|
||||
// Set filename to be used on downlaod
|
||||
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
|
||||
@@ -421,26 +426,13 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
'lehrveranstaltung_id' => getData($result)[0]->lehrveranstaltung_id
|
||||
));
|
||||
|
||||
if(!hasData($result))
|
||||
{
|
||||
show_error('Failed loading Lehrveranstaltung');
|
||||
}
|
||||
$studiengang_kz = getData($result)[0]->studiengang_kz;
|
||||
|
||||
// Get STGL
|
||||
$result = $this->StudiengangModel->getLeitung(getData($result)[0]->studiengang_kz);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach (getData($result) as $stgl)
|
||||
{
|
||||
if ($stgl->uid == $this->_uid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
show_error('You are not entitled to read this Anrechnung');
|
||||
// Check if user is entitled
|
||||
if (!$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's', $studiengang_kz))
|
||||
{
|
||||
show_error('You are not entitled to read this page');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -460,23 +452,13 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
'lehrveranstaltung_id' => $result->lehrveranstaltung_id
|
||||
));
|
||||
|
||||
if(!$result = getData($result)[0])
|
||||
{
|
||||
show_error('Failed loading Lehrveranstaltung');
|
||||
}
|
||||
$studiengang_kz = getData($result)[0]->studiengang_kz;
|
||||
|
||||
// Get STGL
|
||||
$result = $this->StudiengangModel->getLeitung($result->studiengang_kz);
|
||||
|
||||
if($result = getData($result)[0])
|
||||
{
|
||||
if ($result->uid == $this->_uid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
show_error('You are not entitled to read this document');
|
||||
// Check if user is entitled
|
||||
if (!$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's', $studiengang_kz))
|
||||
{
|
||||
show_error('You are not entitled to read this document');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
const BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN = 'lehre/anrechnung_genehmigen';
|
||||
|
||||
const BERECHTIGUNG_ANRECHNUNG_ANLEGEN = 'lehre/anrechnung_anlegen';
|
||||
|
||||
const REVIEW_ANRECHNUNG_URI = '/lehre/anrechnung/ReviewAnrechnungUebersicht';
|
||||
|
||||
const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP';
|
||||
@@ -19,8 +20,8 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
// Set required permissions
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'lehre/anrechnung_genehmigen:rw',
|
||||
'download' => 'lehre/anrechnung_genehmigen:rw',
|
||||
'index' => 'lehre/anrechnung_genehmigen:r',
|
||||
'download' => 'lehre/anrechnung_genehmigen:r',
|
||||
'approve' => 'lehre/anrechnung_genehmigen:rw',
|
||||
'reject' => 'lehre/anrechnung_genehmigen:rw',
|
||||
'requestRecommendation' => 'lehre/anrechnung_genehmigen:rw'
|
||||
@@ -76,10 +77,19 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
show_error(getError($studiengang_kz_arr));
|
||||
}
|
||||
|
||||
|
||||
$hasReadOnlyAccess =
|
||||
$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's')
|
||||
&& !$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 'suid');
|
||||
|
||||
// This permission is checked here to disable create Anrechnung button, if permission is not given
|
||||
$hasCreateAnrechnungAccess = $this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_ANLEGEN, 's');
|
||||
|
||||
$viewData = array(
|
||||
'studiensemester_selected' => $studiensemester_kurzbz,
|
||||
'studiengaenge_entitled' => $studiengang_kz_arr
|
||||
'studiengaenge_entitled' => $studiengang_kz_arr,
|
||||
'hasReadOnlyAccess' => $hasReadOnlyAccess,
|
||||
'hasCreateAnrechnungAccess' => $hasCreateAnrechnungAccess
|
||||
);
|
||||
|
||||
$this->load->view('lehre/anrechnung/approveAnrechnungUebersicht.php', $viewData);
|
||||
@@ -239,7 +249,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
}
|
||||
|
||||
// Check if user is entitled to read dms doc
|
||||
self::_checkIfEntitledToReadDMSDoc($dms_id);
|
||||
$this->_checkIfEntitledToReadDMSDoc($dms_id);
|
||||
|
||||
// Set filename to be used on downlaod
|
||||
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
|
||||
@@ -281,22 +291,14 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
show_error('Failed loading Lehrveranstaltung');
|
||||
}
|
||||
|
||||
$studiengang_kz = $result->studiengang_kz;
|
||||
|
||||
// Get STGL
|
||||
$result = $this->StudiengangModel->getLeitung($result->studiengang_kz);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach (getData($result) as $stgl)
|
||||
{
|
||||
if ($stgl->uid == $this->_uid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
show_error('You are not entitled to read this document');
|
||||
// Check if user is entitled
|
||||
if (!$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's', $studiengang_kz))
|
||||
{
|
||||
show_error('You are not entitled to read this document');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -79,7 +79,7 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
|
||||
// Get Anrechung data
|
||||
$anrechnungData = $this->anrechnunglib->getAnrechnungData($anrechnung_id);
|
||||
|
||||
|
||||
// Get Antrag data
|
||||
$antragData = $this->anrechnunglib->getAntragData(
|
||||
$anrechnungData->prestudent_id,
|
||||
@@ -110,7 +110,7 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
{
|
||||
return $this->outputJsonError('Fehler beim Übertragen der Daten.');
|
||||
}
|
||||
|
||||
|
||||
// Get lectors person data
|
||||
if (!$person = getData($this->PersonModel->getByUID($this->_uid))[0])
|
||||
{
|
||||
@@ -218,10 +218,10 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
|
||||
// Check if user is entitled to read dms doc
|
||||
self::_checkIfEntitledToReadDMSDoc($dms_id);
|
||||
|
||||
|
||||
// Set filename to be used on downlaod
|
||||
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
|
||||
|
||||
|
||||
// Download file
|
||||
$this->dmslib->download($dms_id, $filename);
|
||||
}
|
||||
@@ -320,7 +320,12 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
foreach ($studiengang_kz_arr as $studiengang_kz)
|
||||
{
|
||||
// Get STGL mail address, if available, otherwise get assistance mail address
|
||||
list ($to, $vorname) = $this->_getSTGLMailAddress($studiengang_kz);
|
||||
$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');
|
||||
@@ -361,24 +366,28 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
$result = $this->StudiengangModel->getLeitung($stg_kz);
|
||||
|
||||
// Get STGL mail address, if available
|
||||
if (hasData($result))
|
||||
if (isSuccess($result) && hasData($result))
|
||||
{
|
||||
return array(
|
||||
return success(array(
|
||||
$result->retval[0]->uid. '@'. DOMAIN,
|
||||
$result->retval[0]->vorname
|
||||
);
|
||||
));
|
||||
}
|
||||
// ...otherwise get assistance mail address
|
||||
else
|
||||
{
|
||||
$result = $this->StudiengangModel->load($stg_kz);
|
||||
|
||||
if (hasData($result))
|
||||
if (isSuccess($result) && hasData($result))
|
||||
{
|
||||
return array(
|
||||
return success(array(
|
||||
$result->retval[0]->email,
|
||||
''
|
||||
);
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
return error('Keine E-Mail für diesen Stg gefunden');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,15 +5,15 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
const BERECHTIGUNG_ANRECHNUNG_EMPFEHLEN = 'lehre/anrechnung_empfehlen';
|
||||
|
||||
|
||||
const APPROVE_ANRECHNUNG_URI = '/lehre/anrechnung/ApproveAnrechnungUebersicht';
|
||||
|
||||
|
||||
const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP';
|
||||
const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF';
|
||||
const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor';
|
||||
const ANRECHNUNGSTATUS_APPROVED = 'approved';
|
||||
const ANRECHNUNGSTATUS_REJECTED = 'rejected';
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
// Set required permissions
|
||||
@@ -25,24 +25,24 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
'dontRecommend' => 'lehre/anrechnung_empfehlen:rw'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel');
|
||||
$this->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
|
||||
// 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(
|
||||
@@ -54,12 +54,12 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
'table'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->_setAuthUID();
|
||||
|
||||
|
||||
$this->setControllerId();
|
||||
}
|
||||
|
||||
|
||||
public function index()
|
||||
{
|
||||
// Get study semester
|
||||
@@ -70,14 +70,14 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
$result = $this->StudiensemesterModel->getNearest();
|
||||
$studiensemester_kurzbz = getData($result)[0]->studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
|
||||
$viewData = array(
|
||||
'studiensemester_selected' => $studiensemester_kurzbz
|
||||
);
|
||||
|
||||
|
||||
$this->load->view('lehre/anrechnung/reviewAnrechnungUebersicht.php', $viewData);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Recommend Anrechnungen.
|
||||
*/
|
||||
@@ -103,7 +103,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Output json to ajax
|
||||
if (isset($json) && !isEmptyArray($json))
|
||||
{
|
||||
@@ -123,19 +123,19 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Dont recommend Anrechnungen.
|
||||
*/
|
||||
public function dontRecommend()
|
||||
{
|
||||
$data = $this->input->post('data');
|
||||
|
||||
|
||||
if(isEmptyArray($data))
|
||||
{
|
||||
return $this->outputJsonError('Fehler beim Übertragen der Daten.');
|
||||
}
|
||||
|
||||
|
||||
foreach ($data as $item)
|
||||
{
|
||||
// Approve Anrechnung
|
||||
@@ -149,7 +149,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Output json to ajax
|
||||
if (isset($json) && !isEmptyArray($json))
|
||||
{
|
||||
@@ -158,7 +158,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
show_error('Failed sending emails');
|
||||
}
|
||||
|
||||
|
||||
return $this->outputJsonSuccess($json);
|
||||
}
|
||||
else
|
||||
@@ -166,7 +166,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Download and open uploaded document (Nachweisdokument).
|
||||
*/
|
||||
@@ -178,28 +178,28 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
show_error('Wrong parameter');
|
||||
}
|
||||
|
||||
|
||||
// Check if user is entitled to read dms doc
|
||||
self::_checkIfEntitledToReadDMSDoc($dms_id);
|
||||
|
||||
|
||||
// Set filename to be used on downlaod
|
||||
$filename = $this->anrechnunglib->setFilenameOnDownload($dms_id);
|
||||
|
||||
|
||||
// Download file
|
||||
$this->dmslib->download($dms_id, $filename);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 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');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if user is entitled to read dms doc
|
||||
* @param $dms_id
|
||||
@@ -207,15 +207,15 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
private function _checkIfEntitledToReadDMSDoc($dms_id)
|
||||
{
|
||||
$result = $this->AnrechnungModel->loadWhere(array('dms_id' => $dms_id));
|
||||
|
||||
|
||||
if(!$result = getData($result)[0])
|
||||
{
|
||||
show_error('Failed retrieving Anrechnung');
|
||||
}
|
||||
|
||||
|
||||
$result = $this->LehrveranstaltungModel
|
||||
->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id);
|
||||
|
||||
|
||||
if($result = getData($result))
|
||||
{
|
||||
$entitled_lector_arr = array_column($result, 'uid');
|
||||
@@ -225,10 +225,10 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
show_error('You are not entitled to read this document');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send mails to STGL (if not present then to STGL assistance)
|
||||
* @param $mail_params
|
||||
@@ -239,36 +239,41 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
{
|
||||
// Get studiengaenge
|
||||
$studiengang_kz_arr = array();
|
||||
|
||||
|
||||
foreach ($mail_params as $item)
|
||||
{
|
||||
$this->AnrechnungModel->addSelect('studiengang_kz');
|
||||
$this->AnrechnungModel->addJoin('public.tbl_prestudent', 'prestudent_id');
|
||||
|
||||
|
||||
$studiengang_kz_arr[]= $this->AnrechnungModel->load($item['anrechnung_id'])->retval[0]->studiengang_kz;
|
||||
}
|
||||
|
||||
|
||||
$studiengang_kz_arr = array_unique($studiengang_kz_arr);
|
||||
|
||||
|
||||
// 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
|
||||
list ($to, $vorname) = $this->_getSTGLMailAddress($studiengang_kz);
|
||||
|
||||
$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');
|
||||
}
|
||||
|
||||
|
||||
// Link to Antrag genehmigen
|
||||
$url =
|
||||
CIS_ROOT. 'cis/index.php?menu='.
|
||||
CIS_ROOT. 'cis/menu.php?content_id=&content='.
|
||||
CIS_ROOT. index_page(). self::APPROVE_ANRECHNUNG_URI;
|
||||
|
||||
|
||||
// Prepare mail content
|
||||
$body_fields = array(
|
||||
'vorname' => $vorname,
|
||||
@@ -276,7 +281,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
'empfehlung' => $empfehlung ? 'positive' : 'negative',
|
||||
'link' => anchor($url, 'Anrechnungsanträge Übersicht')
|
||||
);
|
||||
|
||||
|
||||
sendSanchoMail(
|
||||
'AnrechnungEmpfehlungAbgeben',
|
||||
$body_fields,
|
||||
@@ -284,37 +289,41 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
'Anerkennung nachgewiesener Kenntnisse: Empfehlung wurde abgegeben'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Get STGL mail address, if available, otherwise get assistance mail address
|
||||
private function _getSTGLMailAddress($stg_kz)
|
||||
{
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$result = $this->StudiengangModel->getLeitung($stg_kz);
|
||||
|
||||
|
||||
// Get STGL mail address, if available
|
||||
if (hasData($result))
|
||||
if (isSuccess($result) && hasData($result))
|
||||
{
|
||||
return array(
|
||||
return success(array(
|
||||
$result->retval[0]->uid. '@'. DOMAIN,
|
||||
$result->retval[0]->vorname
|
||||
);
|
||||
));
|
||||
}
|
||||
// ...otherwise get assistance mail address
|
||||
else
|
||||
{
|
||||
$result = $this->StudiengangModel->load($stg_kz);
|
||||
|
||||
if (hasData($result))
|
||||
|
||||
if (isSuccess($result) && hasData($result))
|
||||
{
|
||||
return array(
|
||||
return success(array(
|
||||
$result->retval[0]->email,
|
||||
''
|
||||
);
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
return error('Keine E-Mail für diesen Stg gefunden');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@ class AnrechnungLib
|
||||
$antrag_data->vorname = $person->vorname;
|
||||
$antrag_data->nachname = $person->nachname;
|
||||
$antrag_data->matrikelnr = $student->matrikelnr;
|
||||
$antrag_data->studiengang_kz = $studiengang->studiengang_kz;
|
||||
$antrag_data->stg_bezeichnung = $studiengang->bezeichnung;
|
||||
$antrag_data->lektoren = $lv_lektoren_arr;
|
||||
$antrag_data->zgv = $latest_zgv_bezeichnung;
|
||||
|
||||
@@ -448,10 +448,11 @@ class Studiengang_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, array($typ));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Studiengangsleitung
|
||||
* @param null $studiengang_kz
|
||||
* Get Studiengangsleitung/en of Studiengang/Studiengaenge.
|
||||
*
|
||||
* @param null $studiengang_kz Numeric or Array
|
||||
* @return array
|
||||
*/
|
||||
public function getLeitung($studiengang_kz = null)
|
||||
@@ -460,7 +461,12 @@ class Studiengang_model extends DB_Model
|
||||
$this->addJoin('public.tbl_benutzerfunktion', 'oe_kurzbz');
|
||||
$this->addJoin('public.tbl_benutzer', 'uid');
|
||||
$this->addJoin('public.tbl_person', 'person_id');
|
||||
|
||||
|
||||
if (!is_numeric($studiengang_kz) && !is_array($studiengang_kz))
|
||||
{
|
||||
return error('Studiengangskennzahl ungültig');
|
||||
}
|
||||
|
||||
if (is_null($studiengang_kz))
|
||||
{
|
||||
$condition = '
|
||||
@@ -469,16 +475,21 @@ class Studiengang_model extends DB_Model
|
||||
AND ( datum_bis >= NOW() OR datum_bis IS NULL )
|
||||
';
|
||||
}
|
||||
elseif (is_numeric($studiengang_kz))
|
||||
elseif (is_numeric($studiengang_kz) || is_array($studiengang_kz))
|
||||
{
|
||||
if (is_array($studiengang_kz))
|
||||
{
|
||||
$studiengang_kz = array_map(array($this,'escape'), $studiengang_kz);
|
||||
$studiengang_kz = implode(', ', $studiengang_kz);
|
||||
}
|
||||
$condition = '
|
||||
funktion_kurzbz = \'Leitung\'
|
||||
AND ( datum_von <= NOW() OR datum_von IS NULL )
|
||||
AND ( datum_bis >= NOW() OR datum_bis IS NULL )
|
||||
AND studiengang_kz = ' . $this->db->escape($studiengang_kz)
|
||||
AND studiengang_kz IN (' . $studiengang_kz. ')';
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
return $this->loadWhere($condition);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,8 @@ $this->load->view(
|
||||
'bitteBegruendungAngeben',
|
||||
'empfehlungWurdeAngefordert',
|
||||
'anrechnungenWurdenGenehmigt',
|
||||
'anrechnungenWurdenAbgelehnt'
|
||||
'anrechnungenWurdenAbgelehnt',
|
||||
'nurLeseberechtigung'
|
||||
),
|
||||
'person' => array(
|
||||
'student',
|
||||
@@ -72,7 +73,7 @@ $this->load->view(
|
||||
</div>
|
||||
<!--end header -->
|
||||
|
||||
<div class="row">
|
||||
<div class="row" id="approveAnrechnungDetail-generell" data-readonly="<?php echo json_encode($hasReadOnlyAccess)?>">
|
||||
<div class="col-xs-8">
|
||||
<!-- Antragsdaten -->
|
||||
<div class="row">
|
||||
|
||||
@@ -48,7 +48,8 @@ $this->load->view(
|
||||
'empfehlungWurdeAngefordert',
|
||||
'empfehlungWurdeAngefordertAusnahmeWoKeineLektoren',
|
||||
'anrechnungenWurdenGenehmigt',
|
||||
'anrechnungenWurdenAbgelehnt'
|
||||
'anrechnungenWurdenAbgelehnt',
|
||||
'nurLeseberechtigung'
|
||||
),
|
||||
'person' => array(
|
||||
'student',
|
||||
@@ -101,7 +102,7 @@ $this->load->view(
|
||||
<!-- dropdown studiensemester -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<form id="formApproveAnrechnungUebersicht" class="form-inline" action="" method="get">
|
||||
<form id="formApproveAnrechnungUebersicht" class="form-inline" action="" method="get" data-readonly="<?php echo json_encode($hasReadOnlyAccess)?>" data-createaccess="<?php echo json_encode($hasCreateAnrechnungAccess)?>">
|
||||
<div class="form-group">
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
@@ -226,7 +227,7 @@ $this->load->view(
|
||||
class='fa fa-times'></i>
|
||||
</button>
|
||||
</div>
|
||||
<a type="button" class="btn btn-default" style="margin-left: 20px;" href='<?php echo site_url('lehre/anrechnung/createAnrechnung') ?>' target='_blank'>
|
||||
<a type="button" id="approveAnrechnungUebersicht-create-anrechnung" class="btn btn-default" style="margin-left: 20px;" href='<?php echo site_url('lehre/anrechnung/createAnrechnung') ?>' target='_blank'>
|
||||
<i class='fa fa-plus' aria-hidden='true'></i> <?php echo $this->p->t('global', 'antragAnlegen'); ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,7 @@ $(function(){
|
||||
|
||||
const genehmigung_panel = $('#approveAnrechnungDetail-genehmigung-panel');
|
||||
const begruendung_panel = $('#approveAnrechnungDetail-begruendung-panel');
|
||||
const hasReadOnlyAccess = $('#approveAnrechnungDetail-generell').data('readonly');
|
||||
|
||||
// Pruefen ob Promise unterstuetzt wird
|
||||
// Tabulator funktioniert nicht mit IE
|
||||
@@ -21,6 +22,11 @@ $(function(){
|
||||
return;
|
||||
}
|
||||
|
||||
if (hasReadOnlyAccess)
|
||||
{
|
||||
approveAnrechnungDetail.disableEditElements();
|
||||
}
|
||||
|
||||
// Set status alert color
|
||||
approveAnrechnungDetail.setStatusAlertColor();
|
||||
|
||||
@@ -417,6 +423,34 @@ var approveAnrechnungDetail = {
|
||||
}
|
||||
);
|
||||
},
|
||||
disableEditElements: function()
|
||||
{
|
||||
// Disable:
|
||||
// ...button Empfehlung anfordern
|
||||
$('#approveAnrechnungDetail-request-recommendation')
|
||||
.prop('disabled', true)
|
||||
.attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung"));
|
||||
// ...button Empfehlung zuruecknehmen
|
||||
$('#approveAnrechnungDetail-withdraw-request-recommedation')
|
||||
.prop('disabled', true)
|
||||
.attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung"));
|
||||
// ...button Genehmigen
|
||||
$('#approveAnrechnungDetail-approve-anrechnung-ask')
|
||||
.prop('disabled', true)
|
||||
.attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung"));
|
||||
// ...button Ablehnen
|
||||
$('#approveAnrechnungDetail-reject-anrechnung-ask')
|
||||
.prop('disabled', true)
|
||||
.attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung"));
|
||||
// ...button Genehmigung zurücknehmen
|
||||
$('#approveAnrechnungDetail-withdraw-anrechnung-approvement')
|
||||
.prop('disabled', true)
|
||||
.attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung"));
|
||||
// ... form Empfehlungsnotiz
|
||||
$('#form-empfehlungNotiz :input')
|
||||
.prop('disabled', true)
|
||||
.attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung"));
|
||||
},
|
||||
copyIntoTextarea: function(elem){
|
||||
|
||||
// Find closest textarea
|
||||
|
||||
@@ -148,6 +148,8 @@ $(function(){
|
||||
|
||||
const genehmigung_panel = $('#approveAnrechnungUebersicht-genehmigung-panel');
|
||||
const begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel');
|
||||
const hasReadOnlyAccess = $('#formApproveAnrechnungUebersicht').data('readonly');
|
||||
const hasCreateAnrechnungAccess = $('#formApproveAnrechnungUebersicht').data('createaccess');
|
||||
|
||||
// Pruefen ob Promise unterstuetzt wird
|
||||
// Tabulator funktioniert nicht mit IE
|
||||
@@ -165,6 +167,16 @@ $(function(){
|
||||
$('#tableWidgetTabulator').tabulator('redraw', true);
|
||||
});
|
||||
|
||||
if (hasReadOnlyAccess)
|
||||
{
|
||||
approveAnrechnung.disableEditElements();
|
||||
}
|
||||
|
||||
if (!hasCreateAnrechnungAccess)
|
||||
{
|
||||
approveAnrechnung.disableCreateAnrechnungButton();
|
||||
}
|
||||
|
||||
// Set status alert color
|
||||
approveAnrechnung.setStatusAlertColor();
|
||||
|
||||
@@ -517,6 +529,30 @@ var approveAnrechnung = {
|
||||
$('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-warning');
|
||||
}
|
||||
},
|
||||
disableEditElements: function()
|
||||
{
|
||||
// Disable:
|
||||
// ...button Empfehlung anfordern
|
||||
$('#approveAnrechnungUebersicht-request-recommendation')
|
||||
.prop('disabled', true)
|
||||
.attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung"));
|
||||
// ...button Ablehnen
|
||||
$('#approveAnrechnungUebersicht-reject-anrechnungen-ask')
|
||||
.prop('disabled', true)
|
||||
.attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung"));
|
||||
// ...button Genehmigen
|
||||
$('#approveAnrechnungUebersicht-approve-anrechnungen-ask')
|
||||
.prop('disabled', true)
|
||||
.attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung"));
|
||||
|
||||
},
|
||||
disableCreateAnrechnungButton: function()
|
||||
{
|
||||
// Disable button Antrag anlegen
|
||||
$('#approveAnrechnungUebersicht-create-anrechnung')
|
||||
.removeAttr('href')
|
||||
.css({'color': 'grey', 'pointer-events': 'none'}); // property disabled does not work for <a> link
|
||||
},
|
||||
copyIntoTextarea: function(elem){
|
||||
|
||||
// Find closest textarea
|
||||
|
||||
@@ -13694,7 +13694,27 @@ array(
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'ui',
|
||||
'phrase' => 'nurLeseberechtigung',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => "Nur Leseberechtigung",
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => "Read-Only Access",
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user